-
Notifications
You must be signed in to change notification settings - Fork 0
TypeScript Rewrite: App bootstrap, config, and shared utilities #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: ENG-219/build-setup
Are you sure you want to change the base?
Changes from all commits
ff051ce
e768bf1
71b22cc
d18da44
d130c3e
b0a0516
37f4c92
56a1585
12df110
3fb3385
741d07d
cd4894d
ec2249e
9f478e1
3ccbe0a
3135f4b
75308bc
fe88e3a
8bc0588
35d61a5
f6c5a1d
959c4a6
8c31609
bf9d965
658a8fa
391ea51
3c45c6f
f7e5f20
4aeabfd
ea8ee0e
a497018
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import { Command } from 'commander'; | ||
| import { Config, getConfig, resetConfig } from './config.ts'; | ||
| import { version } from '../package.json'; | ||
|
|
||
| export const PUP_VERSION = version; | ||
|
|
||
| /** | ||
| * Creates and configures the Commander program instance. | ||
| * | ||
| * @since TBD | ||
| * | ||
| * @returns {Command} The configured Commander program. | ||
| */ | ||
| export function createApp(): Command { | ||
| resetConfig(); | ||
|
|
||
| getConfig(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that because of that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be right, actually. When you call something like So, we should load the config as early as possible like we are now. This ensures that the config is loaded at all times. It looks like some commands are strangely passing |
||
|
|
||
| const program = new Command(); | ||
| program | ||
| .name('pup') | ||
| .version(PUP_VERSION) | ||
| .description("StellarWP's Project Utilities & Packager"); | ||
|
|
||
| return program; | ||
| } | ||
|
|
||
| export { Config, getConfig, resetConfig }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { createApp } from './app.ts'; | ||
|
|
||
| const program = createApp(); | ||
|
|
||
| program.parseAsync(process.argv).catch((err) => { | ||
| console.error(err instanceof Error ? err.message : String(err)); | ||
| process.exit(1); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.