crankscript 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +6 -1
- package/src/index.js.map +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
2
|
import yargs from 'yargs';
|
3
3
|
import { hideBin } from 'yargs/helpers';
|
4
|
-
import
|
4
|
+
import { readFileSync } from 'node:fs';
|
5
|
+
import { dirname, join } from 'node:path';
|
6
|
+
import { fileURLToPath } from 'node:url';
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
8
|
+
const packageJsonContents = readFileSync(join(__dirname, '..', 'package.json'), 'utf-8');
|
9
|
+
const packageJson = JSON.parse(packageJsonContents);
|
5
10
|
yargs(hideBin(process.argv)).version(packageJson.version).scriptName('crankscript').command('$0', 'says hi', {}, ()=>{
|
6
11
|
console.info('Hi! Something here soon.');
|
7
12
|
}).help().parse();
|
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../libs/cli/src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport
|
1
|
+
{"version":3,"sources":["../../../../libs/cli/src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\nimport { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nconst packageJsonContents = readFileSync(\n join(__dirname, '..', 'package.json'),\n 'utf-8'\n);\nconst packageJson = JSON.parse(packageJsonContents);\n\nyargs(hideBin(process.argv))\n .version(packageJson.version)\n .scriptName('crankscript')\n .command('$0', 'says hi', {}, () => {\n console.info('Hi! Something here soon.');\n })\n .help()\n .parse();\n"],"names":["yargs","hideBin","readFileSync","dirname","join","fileURLToPath","__dirname","url","packageJsonContents","packageJson","JSON","parse","process","argv","version","scriptName","command","console","info","help"],"rangeMappings":";;;;;;;;;;;","mappings":";AAEA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,OAAO,EAAEC,IAAI,QAAQ,YAAY;AAC1C,SAASC,aAAa,QAAQ,WAAW;AAEzC,MAAMC,YAAYH,QAAQE,cAAc,YAAYE,GAAG;AAEvD,MAAMC,sBAAsBN,aACxBE,KAAKE,WAAW,MAAM,iBACtB;AAEJ,MAAMG,cAAcC,KAAKC,KAAK,CAACH;AAE/BR,MAAMC,QAAQW,QAAQC,IAAI,GACrBC,OAAO,CAACL,YAAYK,OAAO,EAC3BC,UAAU,CAAC,eACXC,OAAO,CAAC,MAAM,WAAW,CAAC,GAAG;IAC1BC,QAAQC,IAAI,CAAC;AACjB,GACCC,IAAI,GACJR,KAAK"}
|