initx 0.0.5 → 0.0.7
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/dist/cli.mjs +12 -8
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +2 -18
- package/package.json +4 -6
package/dist/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import cac from 'cac';
|
|
|
2
2
|
import { GitHandler } from '@initx-plugin/git';
|
|
3
3
|
import { CpHandler } from '@initx-plugin/cp';
|
|
4
4
|
|
|
5
|
-
const pkgJson = {name:"initx",type:"module",version:"0.0.
|
|
5
|
+
const pkgJson = {name:"initx",type:"module",version:"0.0.7",packageManager:"pnpm@9.12.2",description:"More convenient initialization tool",author:"imba97",license:"MIT",homepage:"https://github.com/imba97/initx#readme",repository:{type:"git",url:"git+ssh://git@github.com/imba97/initx"},bugs:{url:"https://github.com/imba97/initx/issues"},keywords:["initx"],main:"dist/index.mjs",module:"dist/index.mjs",types:"dist/index.d.ts",bin:"bin/initx.mjs",files:["dist"],scripts:{stub:"unbuild --stub",build:"unbuild"},dependencies:{"@initx-plugin/core":"workspace:*","@initx-plugin/cp":"workspace:*","@initx-plugin/git":"workspace:*",cac:"^6.7.14"}};
|
|
6
6
|
|
|
7
7
|
function getDefaultExportFromCjs (x) {
|
|
8
8
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
@@ -102,22 +102,26 @@ const handlers = [
|
|
|
102
102
|
];
|
|
103
103
|
|
|
104
104
|
const cli = cac("initx");
|
|
105
|
-
cli.help().command("<something>", "
|
|
106
|
-
const { args, options } = cli.parse();
|
|
107
|
-
if (
|
|
105
|
+
cli.help().command("<something>", "see https://github.com/imba97/initx").usage("").option("-v, --version", "Display version number");
|
|
106
|
+
const { args, options: cliOptions } = cli.parse();
|
|
107
|
+
if (cliOptions.h || cliOptions.help) {
|
|
108
108
|
process.exit(0);
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
110
|
+
if (cliOptions.v || cliOptions.version) {
|
|
111
111
|
console.log(pkgJson.version);
|
|
112
112
|
process.exit(0);
|
|
113
113
|
}
|
|
114
|
-
const [
|
|
115
|
-
if (!
|
|
114
|
+
const [key, ...others] = args;
|
|
115
|
+
if (!key || typeof key !== "string") {
|
|
116
116
|
log.error("Please enter something");
|
|
117
117
|
process.exit(0);
|
|
118
118
|
}
|
|
119
119
|
(async function() {
|
|
120
120
|
for (const handler of handlers) {
|
|
121
|
-
await handler.run(
|
|
121
|
+
await handler.run({
|
|
122
|
+
key,
|
|
123
|
+
cliOptions,
|
|
124
|
+
optionsList: Object.keys(cliOptions).filter((key2) => cliOptions[key2] === true).map((key2) => `--${key2}`)
|
|
125
|
+
}, ...others);
|
|
122
126
|
}
|
|
123
127
|
})();
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
export { GitHandler } from '@initx-plugin/git';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
async run(value, ...rest) {
|
|
5
|
-
const tests = Array.isArray(this.matchers) ? this.matchers : [this.matchers];
|
|
6
|
-
const passed = tests.some((test) => {
|
|
7
|
-
if (typeof test === "string") {
|
|
8
|
-
return test === value;
|
|
9
|
-
}
|
|
10
|
-
return test.test(value);
|
|
11
|
-
});
|
|
12
|
-
if (!passed) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
await this.handle(value, ...rest);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { InitxHandler };
|
|
2
|
+
export { CpHandler } from '@initx-plugin/cp';
|
|
3
|
+
export * from '@initx-plugin/core';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "initx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.7",
|
|
5
5
|
"description": "More convenient initialization tool",
|
|
6
6
|
"author": "imba97",
|
|
7
7
|
"license": "MIT",
|
|
@@ -25,11 +25,9 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"cac": "^6.7.14",
|
|
28
|
-
"@initx-plugin/
|
|
29
|
-
"@initx-plugin/git": "0.0.
|
|
30
|
-
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@initx-plugin/types": "0.0.5"
|
|
28
|
+
"@initx-plugin/core": "0.0.7",
|
|
29
|
+
"@initx-plugin/git": "0.0.7",
|
|
30
|
+
"@initx-plugin/cp": "0.0.7"
|
|
33
31
|
},
|
|
34
32
|
"scripts": {
|
|
35
33
|
"stub": "unbuild --stub",
|