diff --git a/bin/dev.cmd b/bin/dev.cmd deleted file mode 100644 index cec553b..0000000 --- a/bin/dev.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %* diff --git a/bin/dev.js b/bin/dev.js deleted file mode 100755 index cc4944a..0000000 --- a/bin/dev.js +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bun - -// #!/usr/bin/env -S node --loader ts-node/esm --disable-warning=ExperimentalWarning - -// eslint-disable-next-line n/shebang -import {execute} from '@oclif/core' - -await execute({development: true, dir: import.meta.url}) diff --git a/bin/run.js b/bin/run.ts similarity index 100% rename from bin/run.js rename to bin/run.ts diff --git a/bun.lockb b/bun.lockb index dc977b9..2809042 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 25194a7..e20725a 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,26 @@ { "name": "jj-command-line", "description": "jj cli", - "version": "0.0.2", + "version": "0.0.5", "author": "Jason Jafari", "bin": { - "jj": "./bin/run.js" + "jj": "./bin/run.ts" }, "bugs": "https://github.com/https://github.com/jafarijason/jj/jj/issues", "dependencies": { "@oclif/core": "^4", "@oclif/plugin-autocomplete": "^3.2.8", - "@oclif/plugin-help": "^6", + "@oclif/plugin-commands": "^4.1.7", + "@oclif/plugin-help": "^6.2.16", "@oclif/plugin-not-found": "^3.2.25", - "@oclif/plugin-plugins": "^5" + "@oclif/plugin-plugins": "^5.4.15", + "@oclif/plugin-search": "^1.2.14", + "@oclif/plugin-update": "^4.6.10", + "@oclif/plugin-version": "^2.2.15", + "@oclif/plugin-warn-if-update-available": "^3.1.21", + "@oclif/plugin-which": "^3.2.17", + "fs-extra": "^11.2.0", + "lodash": "^4.17.21" }, "devDependencies": { "@oclif/prettier-config": "^0.2.1", @@ -44,30 +52,39 @@ "oclif" ], "license": "MIT", - "main": "dist/index.js", + "main": "src/index.ts", "type": "module", "oclif": { "bin": "jj", "dirname": "jj", - "commands": "./dist/commands", + "commands": "./src/commands", "plugins": [ - "@oclif/plugin-*", "@oclif/plugin-help", - "@oclif/plugin-plugins" + "@oclif/plugin-plugins", + "@oclif/plugin-update", + "@oclif/plugin-warn-if-update-available", + "@oclif/plugin-which", + "@oclif/plugin-commands", + "@oclif/plugin-autocomplete", + "@oclif/plugin-search", + "@oclif/plugin-version" ], "topicSeparator": " ", - "topics": {} + "topics": {}, + "theme": "theme.json", + "hooks": { + "prerun": [ + "./src/hooks/postrun/customPostRun.ts" + ], + "postrun": "./src/hooks/prerun/customPreRun.ts" + } }, "repository": "https://github.com/jafarijason/jj/jj", "scripts": { - "build": "shx rm -rf dist && tsc -b", + "build": " ", "lint": "eslint . --ext .ts", - "postpack": "shx rm -f oclif.manifest.json", - "posttest": "yarn lint", - "prepack": "oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "version": "oclif readme && git add README.md", - "pre-publish": "yarn build && yarn prepack && yarn prepack && git add . && yarn version && git push --follow-tags" + "pre-publish": "git add . && git push --follow-tags" }, "types": "dist/index.d.ts" } \ No newline at end of file diff --git a/src/hooks/postrun/customPostRun.ts b/src/hooks/postrun/customPostRun.ts new file mode 100644 index 0000000..36ec470 --- /dev/null +++ b/src/hooks/postrun/customPostRun.ts @@ -0,0 +1,15 @@ +import { Hook } from '@oclif/core' + +const hook: Hook<'postrun'> = async function (opts: any) { + + + // srmVersion + // console.log(opts.Command.flags) + // console.log(opts.Command.args) + // console.log(opts.Command.name) + // console.log(opts) + // process.stdout.write(`example hook running ${opts?.id}\n`) + +} + +export default hook diff --git a/src/hooks/prerun/customPreRun.ts b/src/hooks/prerun/customPreRun.ts new file mode 100644 index 0000000..be45d43 --- /dev/null +++ b/src/hooks/prerun/customPreRun.ts @@ -0,0 +1,15 @@ +import { Hook, Command } from '@oclif/core' +import fs from 'fs-extra'; +import _ from 'lodash'; + + +const hook: Hook<'prerun'> = async function (opts) { + + + // srmVersion + // console.log(opts.Command.flags) + // console.log(opts.Command.args) + // console.log(opts.Command.name) +} + +export default hook diff --git a/src/index.ts b/src/index.ts old mode 100644 new mode 100755 index e32b0b2..3dee20b --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,3 @@ +#!/usr/bin/env bun + export {run} from '@oclif/core' diff --git a/theme.json b/theme.json new file mode 100644 index 0000000..bfac69c --- /dev/null +++ b/theme.json @@ -0,0 +1,26 @@ +{ + "bin": "white", + "command": "cyan", + "commandSummary": "white", + "dollarSign": "white", + "flag": "white", + "flagDefaultValue": "blue", + "flagOptions": "white", + "flagRequired": "red", + "flagSeparator": "white", + "json": { + "brace": "magenta", + "bracket": "magenta", + "colon": "dim", + "comma": "dim", + "key": "yellow", + "string": "green", + "number": "green", + "boolean": "green", + "null": "red" + }, + "sectionDescription": "white", + "sectionHeader": "underline", + "topic": "white", + "version": "white" +} \ No newline at end of file