-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
946 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,21 @@ | ||
// preconstruct doesn't like the shebang line, it is added in postbuild script | ||
// #!/usr/bin/env node | ||
#!/usr/bin/env node | ||
|
||
import { program, Command } from '@commander-js/extra-typings'; | ||
import { program } from '@commander-js/extra-typings'; | ||
|
||
import { createTestProfile } from './commands/createTestProfile'; | ||
import { createTestProfile } from './commands/createTestProfile.js'; | ||
import './utils/logger.js'; | ||
|
||
program.name('lens').description('Lens CLI'); | ||
|
||
// top level commands - define the environment | ||
const development = new Command('development'); | ||
development.description('Command will run in development environment'); | ||
program | ||
.command('development') | ||
.alias('dev') | ||
.description('Command will run in the development environment') | ||
.addCommand(createTestProfile); | ||
|
||
const dev = new Command('dev'); | ||
dev.description('Command will run in development environment'); | ||
|
||
const production = new Command('production'); | ||
production.description('Command will run in production environment'); | ||
|
||
const prod = new Command('prod'); | ||
prod.description('Command will run in production environment'); | ||
|
||
// add subcommands | ||
development.addCommand(createTestProfile); | ||
dev.addCommand(createTestProfile); | ||
|
||
// add to main program | ||
program.addCommand(development); | ||
program.addCommand(dev); | ||
program.addCommand(production); | ||
program.addCommand(prod); | ||
program | ||
.command('production') | ||
.alias('prod') | ||
.description('Command will run in the production environment'); | ||
|
||
program.parse(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import chalk from 'chalk'; | ||
|
||
const log = console.log; | ||
const error = console.error; | ||
|
||
console.log = (...args: Parameters<typeof console.log>) => { | ||
log(chalk.green(...args)); | ||
}; | ||
|
||
console.error = (...args: Parameters<typeof console.error>) => { | ||
error(chalk.red(...args)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
{ | ||
"extends": "@lens-protocol/tsconfig/base.json", | ||
"compilerOptions": { | ||
"esModuleInterop": true, | ||
"module": "ESNext", | ||
"moduleResolution": "node", | ||
"module": "NodeNext", | ||
"moduleResolution": "NodeNext", | ||
"outDir": "dist" | ||
}, | ||
"include": ["./src"] | ||
"include": ["src"], | ||
"ts-node": { | ||
"transpileOnly": true, | ||
"swc": true | ||
} | ||
} |
Oops, something went wrong.