node-karin 0.12.2-5.pr.206.201f747 → 0.12.2-5.pr.206.310b2e4

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.
@@ -275,11 +275,24 @@ var createConfig = () => {
275
275
  };
276
276
  var modifyPackageJson = () => {
277
277
  const pkg = fs2__default.default.readFileSync(path2__default.default.join(dir, "package.json"), "utf-8");
278
- const pkgData = JSON.parse(pkg);
279
- if (pkgData.type === "module") return pkgData;
280
- pkgData.type = "module";
281
- fs2__default.default.writeFileSync(path2__default.default.join(dir, "package.json"), JSON.stringify(pkgData, null, 2));
282
- return pkgData;
278
+ const data = JSON.parse(pkg);
279
+ data.type = "module";
280
+ data.scripts.karin = "karin";
281
+ const list = [
282
+ "app",
283
+ "start",
284
+ "pm2",
285
+ "stop",
286
+ "rs",
287
+ "log",
288
+ "up",
289
+ "init"
290
+ ];
291
+ list.forEach((v) => {
292
+ data.scripts[v] = `karin ${v}`;
293
+ });
294
+ fs2__default.default.writeFileSync(path2__default.default.join(dir, "package.json"), JSON.stringify(data, null, 2));
295
+ return data;
283
296
  };
284
297
  var init = async () => {
285
298
  createDir();
@@ -426,8 +439,10 @@ var updateAll = async () => {
426
439
  process.exit(0);
427
440
  }
428
441
  };
442
+ var _a;
443
+ if (!((_a = process.argv) == null ? undefined : _a[2])) process.argv.push("-h");
429
444
  commander.program.version(process.env.npm_package_version, "-v, --version", "\u663E\u793A\u7248\u672C\u53F7");
430
- commander.program.command(".").description("\u524D\u53F0\u542F\u52A8").action(() => start2());
445
+ commander.program.command("app").description("\u524D\u53F0\u542F\u52A8").action(() => start2());
431
446
  commander.program.command("start").description("\u524D\u53F0\u542F\u52A8").action(() => start2());
432
447
  commander.program.command("pm2").description("\u540E\u53F0\u8FD0\u884C").action(pm2.start);
433
448
  commander.program.command("stop").description("\u505C\u6B62\u540E\u53F0\u8FD0\u884C").action(pm2.stop);
package/dist/cli/index.js CHANGED
@@ -268,11 +268,24 @@ var createConfig = () => {
268
268
  };
269
269
  var modifyPackageJson = () => {
270
270
  const pkg = fs2.readFileSync(path2.join(dir, "package.json"), "utf-8");
271
- const pkgData = JSON.parse(pkg);
272
- if (pkgData.type === "module") return pkgData;
273
- pkgData.type = "module";
274
- fs2.writeFileSync(path2.join(dir, "package.json"), JSON.stringify(pkgData, null, 2));
275
- return pkgData;
271
+ const data = JSON.parse(pkg);
272
+ data.type = "module";
273
+ data.scripts.karin = "karin";
274
+ const list = [
275
+ "app",
276
+ "start",
277
+ "pm2",
278
+ "stop",
279
+ "rs",
280
+ "log",
281
+ "up",
282
+ "init"
283
+ ];
284
+ list.forEach((v) => {
285
+ data.scripts[v] = `karin ${v}`;
286
+ });
287
+ fs2.writeFileSync(path2.join(dir, "package.json"), JSON.stringify(data, null, 2));
288
+ return data;
276
289
  };
277
290
  var init = async () => {
278
291
  createDir();
@@ -419,8 +432,10 @@ var updateAll = async () => {
419
432
  process.exit(0);
420
433
  }
421
434
  };
435
+ var _a;
436
+ if (!((_a = process.argv) == null ? undefined : _a[2])) process.argv.push("-h");
422
437
  program.version(process.env.npm_package_version, "-v, --version", "\u663E\u793A\u7248\u672C\u53F7");
423
- program.command(".").description("\u524D\u53F0\u542F\u52A8").action(() => start2());
438
+ program.command("app").description("\u524D\u53F0\u542F\u52A8").action(() => start2());
424
439
  program.command("start").description("\u524D\u53F0\u542F\u52A8").action(() => start2());
425
440
  program.command("pm2").description("\u540E\u53F0\u8FD0\u884C").action(pm2.start);
426
441
  program.command("stop").description("\u505C\u6B62\u540E\u53F0\u8FD0\u884C").action(pm2.stop);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-karin",
3
- "version": "0.12.25.pr.206.201f747",
3
+ "version": "0.12.25.pr.206.310b2e4",
4
4
  "description": "Lightweight, efficient, concise, and stable robot framework.",
5
5
  "keywords": [
6
6
  "node",
@@ -26,6 +26,11 @@
26
26
  "type": "module",
27
27
  "main": "./dist/index.js",
28
28
  "types": "./dist/index.d.ts",
29
+ "bin": {
30
+ "k": "./dist/cli/index.cjs",
31
+ "karin": "./dist/cli/index.js",
32
+ "kr": "./dist/cli/index.cjs"
33
+ },
29
34
  "files": [
30
35
  "/dist/**/*.js",
31
36
  "/dist/**/*.cjs",
@@ -60,7 +65,6 @@
60
65
  "dependencies": {
61
66
  "@types/express": "^5.0.0",
62
67
  "@types/lodash": "^4.17.10",
63
- "@types/node": "^22.5.0",
64
68
  "@types/node-schedule": "^2.1.7",
65
69
  "@types/ws": "^8.5.12",
66
70
  "art-template": "4.13.2",