initial release of @git.zone/tsdeno - deno compile wrapper that strips package.json to prevent devDependency bloat
This commit is contained in:
33
ts/tsdeno.cli.ts
Normal file
33
ts/tsdeno.cli.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import { TsDeno } from './tsdeno.classes.tsdeno.js';
|
||||
import { commitinfo } from './00_commitinfo_data.js';
|
||||
|
||||
const tsdenoCli = new plugins.smartcli.Smartcli();
|
||||
|
||||
tsdenoCli.addVersion(commitinfo.version);
|
||||
|
||||
tsdenoCli.standardCommand().subscribe(async (argvArg) => {
|
||||
console.log(`@git.zone/tsdeno v${commitinfo.version}`);
|
||||
console.log('');
|
||||
console.log('Usage:');
|
||||
console.log(' tsdeno compile [deno compile args...] Compile with package.json isolation');
|
||||
console.log('');
|
||||
console.log('The compile command temporarily removes package.json before running');
|
||||
console.log('deno compile, preventing devDependencies from bloating the binary.');
|
||||
console.log('--node-modules-dir=none is added automatically.');
|
||||
});
|
||||
|
||||
tsdenoCli.addCommand('compile').subscribe(async (argvArg) => {
|
||||
const tsDeno = new TsDeno();
|
||||
|
||||
// Pass through all args after "compile" to deno compile
|
||||
const rawArgs = process.argv.slice(3);
|
||||
|
||||
await tsDeno.compile(rawArgs);
|
||||
});
|
||||
|
||||
export { tsdenoCli };
|
||||
|
||||
export const runCli = async () => {
|
||||
tsdenoCli.startParse();
|
||||
};
|
||||
Reference in New Issue
Block a user