-
Notifications
You must be signed in to change notification settings - Fork 81
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
13 changed files
with
958 additions
and
173 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"@lens-protocol/cli": minor | ||
--- | ||
|
||
**feat:** Initial version of Lens CLI - a CLI tool for Lens developers. | ||
|
||
Commands available: | ||
|
||
```bash | ||
$ lens development create-profile --handle myhandle --address 0xa5653e88D9c352387deDdC79bcf99f0ada000000 | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,55 @@ | ||
{ | ||
"name": "@lens-protocol/cli", | ||
"version": "0.1.0", | ||
"version": "0.0.0", | ||
"description": "Lens CLI", | ||
"repository": { | ||
"directory": "packages/cli", | ||
"type": "git", | ||
"url": "git://github.com/lens-protocol/lens-sdk.git" | ||
}, | ||
"private": true, | ||
"main": "dist/lens-protocol-cli.cjs.js", | ||
"module": "dist/lens-protocol-cli.esm.js", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"bin": { | ||
"lens": "./dist/lens-protocol-cli.cjs.js" | ||
"lens": "./dist/index.js" | ||
}, | ||
"scripts": { | ||
"build": "preconstruct build && pnpm run postbuild", | ||
"postbuild": "node scripts/add-shebang.mjs", | ||
"build": "tsup src/index.ts --format esm", | ||
"dev": "tsup src/index.ts --format esm --watch", | ||
"lens": "ts-node --esm ./src/index.ts", | ||
"eslint:fix": "pnpm run eslint --fix", | ||
"eslint": "eslint src", | ||
"lint": "pnpm run prettier && pnpm run eslint && pnpm run tsc", | ||
"lint:fix": "pnpm run prettier:fix && pnpm run eslint:fix && pnpm run tsc", | ||
"prettier:fix": "prettier --write .", | ||
"prettier": "prettier --check .", | ||
"test": "jest --passWithNoTests", | ||
"test:watch": "jest --watch", | ||
"test": "echo \"Not in scope for this example\"", | ||
"tsc": "tsc --noEmit" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"@commander-js/extra-typings": "^12.0.1", | ||
"@ethersproject/address": "^5.7.0", | ||
"@lens-protocol/client": "workspace:*", | ||
"@lens-protocol/shared-kernel": "workspace:*", | ||
"@lens-protocol/client": "*", | ||
"@lens-protocol/shared-kernel": "*", | ||
"chalk": "^5.3.0", | ||
"commander": "^12.0.0", | ||
"nanospinner": "^1.1.0", | ||
"tslib": "^2.6.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.23.3", | ||
"@babel/preset-env": "^7.23.3", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@lens-protocol/eslint-config": "workspace:*", | ||
"@lens-protocol/prettier-config": "workspace:*", | ||
"@lens-protocol/tsconfig": "workspace:*", | ||
"@swc/core": "^1.4.13", | ||
"@types/node": "^18.18.12", | ||
"eslint": "^8.54.0", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.1.0", | ||
"ts-node": "^10.9.2", | ||
"tsup": "^8.0.2", | ||
"typescript": "5.2.2" | ||
}, | ||
"engines": { | ||
"node": ">=18 <21" | ||
}, | ||
"prettier": "@lens-protocol/prettier-config", | ||
"babel": { | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript" | ||
] | ||
}, | ||
"preconstruct": { | ||
"entrypoints": [ | ||
"index.ts" | ||
] | ||
} | ||
"prettier": "@lens-protocol/prettier-config" | ||
} |
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.