@weapp-core/init 0.0.0 → 0.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.
package/dist/index.cjs CHANGED
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.2.3_jiti@1.21.6_postcss@8.4.40_tsx@4.16.2_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
37
37
  var init_cjs_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.2.3_jiti@1.21.6_postcss@8.4.40_tsx@4.16.2_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -2244,14 +2244,14 @@ function updateProjectConfig(options) {
2244
2244
  }
2245
2245
  }
2246
2246
  function updatePackageJson(options) {
2247
- const { root, dest } = options;
2247
+ const { root, dest, command } = options;
2248
2248
  const packageJsonFilename = "package.json";
2249
2249
  const packageJsonPath = import_node_path.default.resolve(root, packageJsonFilename);
2250
2250
  if (import_fs_extra.default.existsSync(packageJsonPath)) {
2251
2251
  try {
2252
2252
  const packageJson = import_fs_extra.default.readJSONSync(packageJsonPath);
2253
- (0, import_shared.set)(packageJson, "scripts.dev", "weapp-tw dev");
2254
- (0, import_shared.set)(packageJson, "scripts.build", "weapp-tw build");
2253
+ (0, import_shared.set)(packageJson, "scripts.dev", `${command} dev`);
2254
+ (0, import_shared.set)(packageJson, "scripts.build", `${command} build`);
2255
2255
  import_fs_extra.default.outputJSONSync(dest ?? packageJsonPath, packageJson, {
2256
2256
  spaces: 2
2257
2257
  });
@@ -2259,9 +2259,10 @@ function updatePackageJson(options) {
2259
2259
  }
2260
2260
  }
2261
2261
  }
2262
- function initConfig(root) {
2262
+ function initConfig(options) {
2263
+ const { root, command } = options;
2263
2264
  updateProjectConfig({ root });
2264
- updatePackageJson({ root });
2265
+ updatePackageJson({ root, command });
2265
2266
  }
2266
2267
  // Annotate the CommonJS export names for ESM import in node:
2267
2268
  0 && (module.exports = {
package/dist/index.d.cts CHANGED
@@ -5,7 +5,11 @@ declare function updateProjectConfig(options: {
5
5
  declare function updatePackageJson(options: {
6
6
  root: string;
7
7
  dest?: string;
8
+ command?: string;
9
+ }): void;
10
+ declare function initConfig(options: {
11
+ root: string;
12
+ command?: string;
8
13
  }): void;
9
- declare function initConfig(root: string): void;
10
14
 
11
15
  export { initConfig, updatePackageJson, updateProjectConfig };
package/dist/index.d.ts CHANGED
@@ -5,7 +5,11 @@ declare function updateProjectConfig(options: {
5
5
  declare function updatePackageJson(options: {
6
6
  root: string;
7
7
  dest?: string;
8
+ command?: string;
9
+ }): void;
10
+ declare function initConfig(options: {
11
+ root: string;
12
+ command?: string;
8
13
  }): void;
9
- declare function initConfig(root: string): void;
10
14
 
11
15
  export { initConfig, updatePackageJson, updateProjectConfig };
package/dist/index.js CHANGED
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  mod
34
34
  ));
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.2.3_jiti@1.21.6_postcss@8.4.40_tsx@4.16.2_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js
37
37
  var init_esm_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.2.3_jiti@1.21.6_postcss@8.4.40_tsx@4.16.2_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_tsx@4.16.5_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -2237,14 +2237,14 @@ function updateProjectConfig(options) {
2237
2237
  }
2238
2238
  }
2239
2239
  function updatePackageJson(options) {
2240
- const { root, dest } = options;
2240
+ const { root, dest, command } = options;
2241
2241
  const packageJsonFilename = "package.json";
2242
2242
  const packageJsonPath = path.resolve(root, packageJsonFilename);
2243
2243
  if (import_fs_extra.default.existsSync(packageJsonPath)) {
2244
2244
  try {
2245
2245
  const packageJson = import_fs_extra.default.readJSONSync(packageJsonPath);
2246
- set(packageJson, "scripts.dev", "weapp-tw dev");
2247
- set(packageJson, "scripts.build", "weapp-tw build");
2246
+ set(packageJson, "scripts.dev", `${command} dev`);
2247
+ set(packageJson, "scripts.build", `${command} build`);
2248
2248
  import_fs_extra.default.outputJSONSync(dest ?? packageJsonPath, packageJson, {
2249
2249
  spaces: 2
2250
2250
  });
@@ -2252,9 +2252,10 @@ function updatePackageJson(options) {
2252
2252
  }
2253
2253
  }
2254
2254
  }
2255
- function initConfig(root) {
2255
+ function initConfig(options) {
2256
+ const { root, command } = options;
2256
2257
  updateProjectConfig({ root });
2257
- updatePackageJson({ root });
2258
+ updatePackageJson({ root, command });
2258
2259
  }
2259
2260
  export {
2260
2261
  initConfig,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-core/init",
3
3
  "type": "module",
4
- "version": "0.0.0",
4
+ "version": "0.0.1",
5
5
  "description": "@weapp-core/init",
6
6
  "author": "",
7
7
  "license": "ISC",
@@ -14,11 +14,14 @@
14
14
  "require": "./dist/index.cjs"
15
15
  }
16
16
  },
17
+ "main": "./dist/index.cjs",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
17
20
  "files": [
18
21
  "dist"
19
22
  ],
20
23
  "dependencies": {
21
- "@weapp-core/shared": "^0.0.0"
24
+ "@weapp-core/shared": "^0.0.1"
22
25
  },
23
26
  "scripts": {
24
27
  "dev": "tsup --watch --sourcemap",
@@ -28,8 +31,5 @@
28
31
  "release": "pnpm publish",
29
32
  "lint": "eslint .",
30
33
  "lint:fix": "eslint . --fix"
31
- },
32
- "main": "./dist/index.cjs",
33
- "module": "./dist/index.js",
34
- "types": "./dist/index.d.ts"
34
+ }
35
35
  }