create-unibest 4.0.0 → 4.0.1

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -12
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { green as green6, yellow as yellow5 } from "kolorist";
6
6
  import minimist from "minimist";
7
7
 
8
8
  // package.json
9
- var version = "4.0.0";
9
+ var version = "4.0.1";
10
10
  var package_default = {
11
11
  name: "create-unibest",
12
12
  type: "module",
@@ -23,7 +23,8 @@ var package_default = {
23
23
  },
24
24
  files: [
25
25
  "bin",
26
- "dist"
26
+ "dist",
27
+ "features"
27
28
  ],
28
29
  scripts: {
29
30
  dev: "cross-env NODE_ENV=development tsup --watch",
@@ -93,7 +94,10 @@ function getSelectedFeatures(options) {
93
94
  // src/features/loader.ts
94
95
  import fs from "fs";
95
96
  import path from "path";
96
- var FEATURES_DIR = path.resolve(process.cwd(), "../../features");
97
+ import { fileURLToPath } from "url";
98
+ var __filename = fileURLToPath(import.meta.url);
99
+ var __dirname = path.dirname(__filename);
100
+ var FEATURES_DIR = path.resolve(__dirname, "../../features");
97
101
  async function loadFeatureHooks(featureName) {
98
102
  const hooksPath = path.join(FEATURES_DIR, featureName, "hooks.ts");
99
103
  if (!fs.existsSync(hooksPath)) {
@@ -114,10 +118,10 @@ function getAvailableFeatureNames() {
114
118
  import fs2 from "fs";
115
119
  import path2 from "path";
116
120
  import { dirname } from "path";
117
- import { fileURLToPath } from "url";
118
- var __filename = fileURLToPath(import.meta.url);
119
- var __dirname = dirname(__filename);
120
- var FEATURES_PATH = path2.join(__dirname, "..", "..", "..", "features");
121
+ import { fileURLToPath as fileURLToPath2 } from "url";
122
+ var __filename2 = fileURLToPath2(import.meta.url);
123
+ var __dirname2 = dirname(__filename2);
124
+ var FEATURES_PATH = path2.join(__dirname2, "..", "..", "..", "features");
121
125
  var FeatureInjector = class {
122
126
  constructor(projectPath) {
123
127
  this.projectPath = projectPath;
@@ -622,7 +626,7 @@ import { log as log2 } from "@clack/prompts";
622
626
  import { exec } from "child_process";
623
627
  import { promises as fsPromises } from "fs";
624
628
  import { join as join3, dirname as dirname2 } from "path";
625
- import { fileURLToPath as fileURLToPath2 } from "url";
629
+ import { fileURLToPath as fileURLToPath3 } from "url";
626
630
  import process4 from "process";
627
631
  import { red as red3 } from "kolorist";
628
632
 
@@ -679,15 +683,15 @@ function replacePackageJson(root2, name, version2, options) {
679
683
  }
680
684
 
681
685
  // src/utils/cloneRepo.ts
682
- var __filename2 = fileURLToPath2(import.meta.url);
683
- var __dirname2 = dirname2(__filename2);
686
+ var __filename3 = fileURLToPath3(import.meta.url);
687
+ var __dirname3 = dirname2(__filename3);
684
688
  var USE_LOCAL_TEMPLATE = process4.env.LOCAL_TEMPLATE === "true";
685
689
  var TEMPLATE_BASE_PATH = null;
686
690
  async function getTemplateBasePath() {
687
691
  if (TEMPLATE_BASE_PATH) return TEMPLATE_BASE_PATH;
688
692
  const candidates = [
689
- join3(__dirname2, "..", "..", "..", "packages", "template-base"),
690
- join3(__dirname2, "..", "..", "packages", "template-base")
693
+ join3(__dirname3, "..", "..", "..", "packages", "template-base"),
694
+ join3(__dirname3, "..", "..", "packages", "template-base")
691
695
  ];
692
696
  const { existsSync: existsSync3 } = await import("fs");
693
697
  for (const candidate of candidates) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-unibest",
3
3
  "type": "module",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
5
5
  "packageManager": "pnpm@10.10.0",
6
6
  "description": "快速创建 unibest 项目的脚手架工具",
7
7
  "author": "feige996",
@@ -14,7 +14,8 @@
14
14
  },
15
15
  "files": [
16
16
  "bin",
17
- "dist"
17
+ "dist",
18
+ "features"
18
19
  ],
19
20
  "scripts": {
20
21
  "dev": "cross-env NODE_ENV=development tsup --watch",