create-pnpm-cli 0.0.2 → 0.0.3

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/lib/cli.js CHANGED
@@ -38,7 +38,7 @@ import packageManagerInstall from "package-manager-install";
38
38
  import path3 from "path";
39
39
  var cli = program;
40
40
  cli.name("create-pnpm-cli").version(version);
41
- cli.command("create", { isDefault: true }).description("create pnpm cli").action(async () => {
41
+ cli.command("create", { isDefault: true }).description("create pnpm cli").argument("[path]", "path to mkdir", "./").action(async (targetPath) => {
42
42
  const names = await glob(`**`, {
43
43
  deep: 1,
44
44
  cwd: TEMPLATE_PATH,
@@ -52,9 +52,10 @@ cli.command("create", { isDefault: true }).description("create pnpm cli").action
52
52
  message: "\u8BF7\u8F93\u5165\u5305\u540D",
53
53
  default: template
54
54
  });
55
- fse.mkdir(name).catch((err) => handleError(err, "\u521B\u5EFA\u6587\u4EF6\u5939\u9519\u8BEF"));
56
- fse.copy(path3.join(TEMPLATE_PATH, template), name).catch((err) => handleError(err, "\u62F7\u8D1D\u6587\u4EF6\u9519\u8BEF"));
57
- packageManagerInstall({ cwd: name });
55
+ const target = path3.join(targetPath, name);
56
+ await fse.ensureDir(target).catch((err) => handleError(err, "\u6587\u4EF6\u5939\u4E0D\u5B58\u5728"));
57
+ await fse.copy(path3.join(TEMPLATE_PATH, template), target).catch((err) => handleError(err, "\u62F7\u8D1D\u6587\u4EF6\u9519\u8BEF"));
58
+ await packageManagerInstall({ cwd: target });
58
59
  });
59
60
  cli.parse();
60
61
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pnpm-cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "create pnpm cli",
5
5
  "type": "module",
6
6
  "main": "./lib/cli.js",
@@ -4,7 +4,10 @@
4
4
  "build": "pnpm --recursive --filter=./packages/** build"
5
5
  },
6
6
  "devDependencies": {
7
- "@types/node": "^20.10.5"
7
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
8
+ "@types/node": "^20.10.5",
9
+ "prettier": "^3.2.4",
10
+ "typescript": "^5.2.2"
8
11
  },
9
12
  "keywords": [],
10
13
  "author": "",