@aiot-toolkit/aiotpack 2.0.6-beta.21 → 2.0.6-beta.23

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.
@@ -42,6 +42,10 @@ export default interface IManifest {
42
42
  file: string;
43
43
  }[];
44
44
  };
45
+ widgetProvider?: {
46
+ name: string;
47
+ path: string;
48
+ }[];
45
49
  }
46
50
  export interface IFeatures {
47
51
  name: string;
@@ -129,6 +129,15 @@ class UxCompileUtil {
129
129
  }
130
130
  }
131
131
  }
132
+ // 5. 添加 widget_provider
133
+ const {
134
+ widgetProvider
135
+ } = config;
136
+ if (widgetProvider?.length) {
137
+ for (const widgetItem of widgetProvider) {
138
+ result[widgetItem.path] = './src/' + widgetItem.path;
139
+ }
140
+ }
132
141
  return result;
133
142
  }
134
143
 
@@ -29,10 +29,12 @@ declare class UxConfig implements IFileLaneConfig<IJavascriptCompileOption> {
29
29
  beforeCompile: import("file-lane").PreWork<IJavascriptCompileOption>[];
30
30
  afterCompile: ({
31
31
  worker: import("file-lane").FollowWork<IJavascriptCompileOption>;
32
+ workDescribe: string;
32
33
  workerDescribe?: undefined;
33
34
  } | {
34
35
  worker: import("file-lane").FollowWork<IJavascriptCompileOption>;
35
36
  workerDescribe: string;
37
+ workDescribe?: undefined;
36
38
  })[];
37
39
  afterWorks: (typeof UxAfterWorks.cleanOutput)[];
38
40
  watchIgnores: string[];
@@ -75,7 +75,8 @@ class UxConfig {
75
75
  beforeWorks = (() => [_UxBeforeWorks.default.cleanOutput])();
76
76
  beforeCompile = (() => [_UxBeforeCompile.default.validateManifest, _UxBeforeCompile.default.validateSitemap, _BeforeCompileUtils.default.clean, _BeforeCompileUtils.default.getEntries, _BeforeCompileUtils.default.getGlobalVar])();
77
77
  afterCompile = (() => [{
78
- worker: _UxAfterCompile.default.writeGitIgnore
78
+ worker: _UxAfterCompile.default.writeGitIgnore,
79
+ workDescribe: 'Write .gitignore'
79
80
  }, {
80
81
  worker: _UxAfterCompile.default.symlinkNodeModule,
81
82
  workerDescribe: 'Create a soft link to the node_modules folder'
@@ -66,9 +66,6 @@ class BeforeCompileUtils {
66
66
  _sharedUtils.ColorConsole.throw(`### manifest ### path '${_path.default.join(entryDir, entryPages.join(' | '))}' does not exist`);
67
67
  }
68
68
  });
69
- } else {
70
- // 没有pages配置
71
- _sharedUtils.ColorConsole.throw(`### manifest ### No pages configuration`);
72
69
  }
73
70
  //获取轻卡路由
74
71
  if (widgets) {
@@ -69,7 +69,6 @@ const ManifestSchema = {
69
69
  router: {
70
70
  // TODO 更详细的后台运行配置信息,
71
71
  type: 'object',
72
- required: ['entry', 'pages'],
73
72
  properties: {
74
73
  entry: {
75
74
  type: 'string'
@@ -67,7 +67,7 @@ class UxFileUtils {
67
67
  entry,
68
68
  pages
69
69
  } = jsonData.router;
70
- if (!pages[entry]) {
70
+ if (entry && !pages?.[entry]) {
71
71
  errors.push(new TypeError(`router.entry content: ${entry}, is missing in router.pages`));
72
72
  }
73
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiot-toolkit/aiotpack",
3
- "version": "2.0.6-beta.21",
3
+ "version": "2.0.6-beta.23",
4
4
  "description": "The process tool for packaging aiot projects.",
5
5
  "keywords": [
6
6
  "aiotpack"
@@ -19,14 +19,14 @@
19
19
  "test": "node ./__tests__/aiotpack.test.js"
20
20
  },
21
21
  "dependencies": {
22
- "@aiot-toolkit/generator": "2.0.6-beta.21",
23
- "@aiot-toolkit/parser": "2.0.6-beta.21",
24
- "@aiot-toolkit/shared-utils": "2.0.6-beta.21",
22
+ "@aiot-toolkit/generator": "2.0.6-beta.23",
23
+ "@aiot-toolkit/parser": "2.0.6-beta.23",
24
+ "@aiot-toolkit/shared-utils": "2.0.6-beta.23",
25
25
  "@hap-toolkit/aaptjs": "^2.0.0",
26
26
  "@rspack/core": "^1.3.9",
27
27
  "aiot-parse5": "^1.0.2",
28
28
  "babel-loader": "^9.1.3",
29
- "file-lane": "2.0.6-beta.21",
29
+ "file-lane": "2.0.6-beta.23",
30
30
  "file-loader": "^6.2.0",
31
31
  "fs-extra": "^11.2.0",
32
32
  "jsrsasign": "^11.1.0",
@@ -42,5 +42,5 @@
42
42
  "@types/jsrsasign": "^10.5.12",
43
43
  "@types/webpack-sources": "^3.2.3"
44
44
  },
45
- "gitHead": "9294502171d727985c7a28a4a6f0c4a291623309"
45
+ "gitHead": "9de83750ab05714a26c3f23c22619605ebea720b"
46
46
  }