zova-cli-set-front 1.2.105 → 1.2.107

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.js CHANGED
@@ -281,6 +281,7 @@ class CliBinBuildRest extends BeanCliBase {
281
281
  const templateDir = this.template.resolveTemplatePath(__ThisSetName__, 'rest');
282
282
  // render
283
283
  await this.template.renderDir(srcDir, templateDir);
284
+ context.packageJson = await loadJSONFile(path.join(srcDir, 'package.json'));
284
285
  }
285
286
  async _buildTs({
286
287
  srcDir,
@@ -355,8 +356,8 @@ class CliBinBuildRest extends BeanCliBase {
355
356
  projectPath,
356
357
  flavor,
357
358
  bundleNameCopy,
358
- srcDir,
359
- outDir
359
+ outDir,
360
+ packageJson
360
361
  } = buildContext;
361
362
  // build
362
363
  await this._buildTs(buildContext);
@@ -365,8 +366,10 @@ class CliBinBuildRest extends BeanCliBase {
365
366
  const deps = await _extractDeps(path.join(outDir, 'index.d.mts'));
366
367
  const depsVersion = await _extractDepsVersion(projectPath, deps);
367
368
  // package.json
368
- const pkgContent = await loadJSONFile(path.join(srcDir, 'package.json'));
369
- pkgContent.dependencies = depsVersion;
369
+ const pkgContent = {
370
+ ...packageJson,
371
+ dependencies: depsVersion
372
+ };
370
373
  await saveJSONFile$1(path.join(outDir, 'package.json'), pkgContent);
371
374
  // await fse.copyFile(path.join(srcDir, 'package.json'), path.join(outDir, 'package.json'));
372
375
  // release
@@ -2610,7 +2613,7 @@ async function generateBeanGenerals(globFiles, sceneName, sceneMeta, moduleName,
2610
2613
  const beanFullName = `${moduleName}.${sceneName}.${beanName}`;
2611
2614
  if (isIgnore) continue;
2612
2615
  if (!sceneMeta.scopeResource) {
2613
- contentImports.push(`import { ${className} } from '${fileNameJSRelative}';`);
2616
+ contentImports.push(`import type { ${className} } from '${fileNameJSRelative}';`);
2614
2617
  }
2615
2618
  contentRecords.push(`'${beanFullName}': ${className};`);
2616
2619
  }
@@ -3211,7 +3214,7 @@ async function generateScopeResources(globFiles, sceneName, _sceneMeta, _moduleN
3211
3214
  isIgnore
3212
3215
  } = globFile;
3213
3216
  if (isIgnore) continue;
3214
- contentImports.push(`import { ${className} } from '${fileNameJSRelative}';`);
3217
+ contentImports.push(`import type { ${className} } from '${fileNameJSRelative}';`);
3215
3218
  contentRecords.push(`'${beanName}': ${className};`);
3216
3219
  }
3217
3220
  if (contentImports.length === 0) return '';
@@ -8,6 +8,12 @@ declare module '@cabloy/cli' {
8
8
  Version: string;
9
9
  }
10
10
  }
11
+ interface IBinBuildRestPackageJson {
12
+ name: string;
13
+ version: string;
14
+ dependencies?: Record<string, string>;
15
+ [key: string]: unknown;
16
+ }
11
17
  interface IBinBuildRestContext {
12
18
  projectPath: string;
13
19
  flavor: ZovaMetaFlavor;
@@ -17,6 +23,7 @@ interface IBinBuildRestContext {
17
23
  outDir: string;
18
24
  bundleModules?: string[];
19
25
  sideEffectImportModuleNames?: string[];
26
+ packageJson?: IBinBuildRestPackageJson;
20
27
  }
21
28
  export declare class CliBinBuildRest extends BeanCliBase {
22
29
  execute(): Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-cli-set-front",
3
- "version": "1.2.105",
4
- "gitHead": "8ecb407bf2c0bb2e28592206ca1a39f37ab50902",
3
+ "version": "1.2.107",
4
+ "gitHead": "251374fba6fee7a162645ce818c8deae2be8f7b7",
5
5
  "description": "zova cli-set-front",
6
6
  "keywords": [
7
7
  "framework",