@cloudbase/lowcode-builder 1.1.7 → 1.1.9

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.
@@ -6,7 +6,7 @@ export declare const materialsDirName = "materials";
6
6
  * src/template的代码,在IDE编辑器插件中构建builder
7
7
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
8
8
  */
9
- export declare const builderTemplateURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20220810.zip";
9
+ export declare const builderTemplateURL = "https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20221202.zip";
10
10
  /**
11
11
  * miniprogram的代码,IDE插件后续会提供端功能
12
12
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
@@ -44,7 +44,7 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
44
44
  * src/template的代码,在IDE编辑器插件中构建builder
45
45
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
46
46
  */
47
- exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20220810.zip';
47
+ exports.builderTemplateURL = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcap-builder/template_20221202.zip';
48
48
  /**
49
49
  * miniprogram的代码,IDE插件后续会提供端功能
50
50
  * 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-1303824488&region=ap-shanghai&path=%252Flcap-builder%252F
@@ -73,6 +73,7 @@ async function buildWedaApp({ cals, subAppCalsList = [], dependencies = [], appK
73
73
  generateMpPath: appBuildDir,
74
74
  miniprogramRoot: result.miniprogramRoot,
75
75
  plugins,
76
+ ignoreInstall,
76
77
  });
77
78
  }
78
79
  const outDir = appBuildDir;
@@ -1,9 +1,10 @@
1
1
  import { IWeAppData, IPlugin, IMaterialItem } from '@cloudbase/lowcode-generator/lib/weapps-core';
2
2
  import { IAppUsedComp } from '../types/common';
3
- export declare function handleMixMode({ apps, generateMpPath, miniprogramRoot, plugins, }: {
3
+ export declare function handleMixMode({ apps, generateMpPath, miniprogramRoot, plugins, ignoreInstall, }: {
4
4
  apps: IWeAppData[];
5
5
  generateMpPath: string;
6
6
  miniprogramRoot: string;
7
7
  plugins: IPlugin[];
8
+ ignoreInstall: boolean;
8
9
  }): Promise<void>;
9
10
  export declare function handleMixMaterials(projDir: string, apps: IWeAppData[], appUsedComps: IAppUsedComp[], compositedLibs: IMaterialItem[]): Promise<void[]>;
@@ -36,13 +36,13 @@ const chalk_1 = __importDefault(require("chalk"));
36
36
  const generateFiles_1 = require("../util/generateFiles");
37
37
  const webpack_1 = require("../service/webpack");
38
38
  // 将 BUILD 目录往混合模式移动
39
- async function handleMixMode({ apps = [], generateMpPath, miniprogramRoot, plugins = [], }) {
39
+ async function handleMixMode({ apps = [], generateMpPath, miniprogramRoot, plugins = [], ignoreInstall, }) {
40
40
  // await handleMainApp()
41
41
  // await handleAppPages()
42
42
  await handleSubApps();
43
43
  // await handleAppJson()
44
44
  // await handlePkgJson()
45
- await (0, webpack_1.installDependencies)(miniprogramRoot);
45
+ await (0, webpack_1.installDependencies)(miniprogramRoot, { ignoreInstall });
46
46
  await handlePlugins();
47
47
  // 复制框架公用内容
48
48
  async function handleMainApp() {
@@ -99,7 +99,7 @@ function generateDataBindMeta(bind) {
99
99
  }
100
100
  else {
101
101
  expr = value
102
- .replace(/^\w+./, `${isGlobal ? 'app' : '$page'}.${PREFIX_MAP[type]}.`)
102
+ .replace(/^\w+([.[])/, (_, $1) => `${isGlobal ? 'app' : '$page'}.${PREFIX_MAP[type]}${$1}`)
103
103
  .replace(/^comp-\w+/, `$comp.${PREFIX_MAP[type]}`)
104
104
  .replace(/^\$comp_\w+/, `$comp.${PREFIX_MAP[type]}`);
105
105
  }
@@ -462,7 +462,7 @@ async function installDependencies(targetDir, options = {}) {
462
462
  * 否则认为文件发生了更改,应该忽略参数强制安装
463
463
  */
464
464
  const cacheMeta = generateFiles_1.generatedFileContents[packageJsonPath];
465
- const isPkgModify = !cacheMeta || cacheMeta.once ? false : generateFiles_1.generatedFileContents[path_1.default.resolve(targetDir, 'package.json')].modify;
465
+ const isPkgModify = !cacheMeta || cacheMeta.once ? false : cacheMeta.modify;
466
466
  if ((options === null || options === void 0 ? void 0 : options.ignoreInstall) && fs_extra_1.default.existsSync(path_1.default.join(targetDir, 'node_modules')) && !isPkgModify) {
467
467
  console.log(`ignore install dependencies in ${targetDir}`);
468
468
  return;
@@ -503,6 +503,9 @@ async function installDependencies(targetDir, options = {}) {
503
503
  else {
504
504
  installProcess = cross_spawn_1.default.sync('npm', ['install', packageName, ...npmOptions], installlProcessOptions);
505
505
  }
506
+ if (installProcess.status) {
507
+ throw new Error(`安装依赖失败 ${installProcess.error || ''}`);
508
+ }
506
509
  fixNodeModules(targetDir);
507
510
  try {
508
511
  await fs_extra_1.default.remove(path_1.default.join(path_1.default.join(targetDir, 'package-lock.json')));
@@ -1,6 +1,6 @@
1
1
  export { BuildType, GenerateMpType, WebpackModeType, WebpackBuildCallBack, IPackageJson, buildAsWebByBuildType, buildAsAdminPortalByBuildType, buildAsXPageByBuildType, IAppUsedComp, IUsedComps, ISyncProp, IComponentInputProps, IFileCodeMap, } from '@cloudbase/lowcode-generator/lib/generator/types/common';
2
2
  import { IComponentMeta, ICompositedComponent } from '@cloudbase/lowcode-generator/lib/weapps-core';
3
- export declare type IComponentsInfoMap = {
3
+ export type IComponentsInfoMap = {
4
4
  [componentSourceKey: string]: ({
5
5
  meta: IComponentMeta;
6
6
  } & {
@@ -1,7 +1,7 @@
1
1
  import { IComponentInputProps, IComponentsInfoMap, IPackageJson } from '../types/common';
2
2
  import { IMaterialItem, IWeAppComponentInstance, IWeAppCode } from '@cloudbase/lowcode-generator/lib/weapps-core';
3
3
  export { getMetaInfoBySourceKey, isArray, isPlainObject, deepDeal, simpleDeepClone, deepDealSchema, getFileNameByUrl, } from '@cloudbase/lowcode-generator/lib/generator/util/common';
4
- export declare type PromiseResult<T> = Promise<[null, T] | [Error, null]>;
4
+ export type PromiseResult<T> = Promise<[null, T] | [Error, null]>;
5
5
  export declare function promiseWrapper<T>(p: Promise<T>): PromiseResult<T>;
6
6
  export declare function getCurrentPackageJson(): {
7
7
  name: any;