@omnia/tooling-vue 8.0.322-dev → 8.0.323-dev

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.
@@ -215,7 +215,7 @@ import wc1f31fc580b854d19895c1879120a9891 from '../../../../client/fx/ux/docs/ch
215
215
  import wc710dc11b823c4a80b2a031395c206325 from '../../../../client/fx/ux/editorchrome/chrome/EditorChrome';
216
216
  import wc72a828731c4e4f1e9753a6a6bfb31e67 from '../../../../client/fx/ux/enterpriseglossary/componentbase/EnterpriseGlossaryTermComponentBase';
217
217
  import wcb94ea0908c7f461085de9d21a61e0826 from '../../../../client/fx/ux/enterpriseproperties/picker/EnterprisePropertyPicker';
218
- import wc80899927961f45298421948c395d7f39 from '../../../../client/fx/ux/enterpriseproperties/renderers/EnterprisePropertyValue';
218
+ import wc80899927961f45298421948c395d7f39 from '../../../../client/fx/ux/enterpriseproperties/renderers/EnterprisePropertyRenderer';
219
219
  import wc22666b255eb64f378edf70d5e9859216 from '../../../../client/fx/ux/enterpriseproperties/renderers/EnterprisePropertyConfiguration';
220
220
  import wc0619d10d541645aaabbdc17d5b867501 from '../../../../client/fx/ux/enterprisepropertysets/picker/EnterprisePropertySetPicker';
221
221
  import wcfaee0b6397494a9abca9c480856e2498 from '../../../../client/fx/ux/flow/editor/FlowEditor';
@@ -1,9 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
3
4
  const core_1 = require("@rsbuild/core");
4
5
  const core_2 = require("@rspack/core");
5
6
  const tooling_1 = require("@omnia/tooling");
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const shared_1 = require("../shared");
9
+ const fx_models_1 = require("@omnia/fx-models");
10
+ const composers = tslib_1.__importStar(require("@omnia/tooling-composers"));
11
+ const $ = tslib_1.__importStar(require("../variables"));
12
+ const _registeredReferenceManifests = [];
13
+ const vendorProdId = "aaf89b2d-5ea8-4b79-946a-8c1e89f713a3";
6
14
  const useRspack = process.argv.find(argv => argv === "--rspack") !== undefined;
15
+ const rootPath = tooling_1.utils.root("");
16
+ const outDirManifestMetadata = shared_1.isExtensionEnv ? "node_modules/@omnia/tooling-vue/internal-do-not-import-from-here/output_manifests" : "client/tooling/vue/output_manifests";
7
17
  if (useRspack) {
8
18
  tooling_1.core.registerBuildTask({
9
19
  stage: tooling_1.core.TaskStage.BeforeBundleManifest,
@@ -52,32 +62,50 @@ async function beforeBundleManifest(entries) {
52
62
  return new Promise(async function (resolve, reject) {
53
63
  const startTime = new Date().getTime();
54
64
  tooling_1.utils.log('Build manifests metadata running...', tooling_1.utils.LogTypes.HeadLine);
55
- const rsbuild = await (0, core_1.createRsbuild)({
56
- rsbuildConfig: {
57
- source: {},
58
- plugins: []
59
- },
60
- });
61
- rsbuild.build({
62
- watch: false,
63
- // compiler: {
64
- // compilers: []
65
- // }
66
- });
65
+ const serviceId = getServiceId();
66
+ // const rsbuild = await createRsbuild({
67
+ // rsbuildConfig: {
68
+ // source: {
69
+ // },
70
+ // plugins: [
71
+ // ]
72
+ // },
73
+ // });
74
+ // rsbuild.build({
75
+ // watch: false,
76
+ // // compiler: {
77
+ // // compilers: []
78
+ // // }
79
+ // })
67
80
  const compilers = [];
68
81
  Object.keys(entries).forEach((id) => {
69
82
  const entry = {};
70
83
  entry[id] = entries[id];
71
- const config = createConfig(entry);
84
+ const config = createConfig(entry, entries);
72
85
  compilers.push((0, core_1.rspack)(config));
73
86
  });
74
87
  const multiCompiler = new core_2.MultiCompiler(compilers, {
75
- parallelism: 1, // the maximum number of parallel compilers
88
+ // parallelism: 8, // the maximum number of parallel compilers
76
89
  });
77
90
  multiCompiler.run((err, stats) => {
78
- if (stats.hasErrors) {
91
+ if (err) {
79
92
  tooling_1.utils.log('Bundle manifest error : \r\n', tooling_1.utils.LogTypes.Error);
80
- tooling_1.utils.log(err.stack || err, tooling_1.utils.LogTypes.Error);
93
+ tooling_1.utils.log(err?.stack || err, tooling_1.utils.LogTypes.Error);
94
+ reject();
95
+ return;
96
+ }
97
+ if (stats.hasErrors()) {
98
+ tooling_1.utils.logTime(`Build manifests metadata have an exception`, startTime);
99
+ tooling_1.utils.log(stats.toString({
100
+ assets: false,
101
+ hash: true
102
+ }), tooling_1.utils.LogTypes.Error);
103
+ for (let stateError of stats.toJson({
104
+ assets: false,
105
+ hash: true
106
+ }).errors) {
107
+ tooling_1.utils.log(stateError.stack || stateError.message, tooling_1.utils.LogTypes.Error);
108
+ }
81
109
  reject();
82
110
  return;
83
111
  }
@@ -102,11 +130,12 @@ function bundleManifest(entries) {
102
130
  }
103
131
  });
104
132
  }
105
- function createConfig(entry) {
133
+ function createConfig(entry, entries) {
106
134
  return {
135
+ watch: false,
107
136
  mode: "production",
108
137
  devtool: false,
109
- context: tooling_1.utils.root(""),
138
+ context: rootPath,
110
139
  entry: entry,
111
140
  target: ["web", "es2022"],
112
141
  optimization: {
@@ -115,7 +144,212 @@ function createConfig(entry) {
115
144
  providedExports: true,
116
145
  removeAvailableModules: false,
117
146
  mangleExports: false,
118
- concatenateModules: true
119
- }
147
+ concatenateModules: true,
148
+ removeEmptyChunks: false,
149
+ splitChunks: false,
150
+ },
151
+ resolve: {
152
+ modules: tooling_1.core.getWebpackResolveModules(),
153
+ extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.html', '.vue', '.less', '.styl'],
154
+ symlinks: false,
155
+ descriptionFiles: ['package.json'],
156
+ alias: Object.assign({}, $.tooling.core.getWebpackResolveAlias(), (getBuildOption()?.moduleOptions?.alias || {}), {
157
+ 'axios$': 'axios/dist/axios.js',
158
+ 'typestyle$': 'typestyle/lib.es2015/index.js',
159
+ 'vue$': 'vue/dist/vue.runtime.esm-bundler.js',
160
+ '@microsoft/signalr$': '@microsoft/signalr/dist/webworker/signalr.js',
161
+ "@stylexjs/stylex$": $.tooling.utils.root("node_modules/@stylexjs/stylex/lib/es/stylex.mjs")
162
+ }),
163
+ },
164
+ output: {
165
+ pathinfo: false,
166
+ path: tooling_1.utils.root($.tooling.composer.OmniaOutput.OutputBundlePath),
167
+ filename: '[name].js',
168
+ chunkLoadingGlobal: "omniaWebpackJsonp['" + getServiceId() + "']['__register_module__']",
169
+ },
170
+ externals: [
171
+ function ({ context, request }, callback) {
172
+ if (request.indexOf("node_modules") > -1 || (/\.(sass|scss|styl|less|css)$/i).test(request)) {
173
+ return callback(null, 'commonjs ' + request);
174
+ }
175
+ callback();
176
+ }
177
+ ],
178
+ module: {
179
+ noParse: /wwwroot(.*)/,
180
+ rules: [
181
+ {
182
+ test: /\.m?js/,
183
+ resolve: {
184
+ fullySpecified: false
185
+ }
186
+ },
187
+ {
188
+ test: /\.ts$/,
189
+ use: {
190
+ loader: 'builtin:swc-loader',
191
+ options: {
192
+ sourceMaps: false,
193
+ jsc: {
194
+ parser: {
195
+ syntax: 'typescript',
196
+ decorators: true
197
+ },
198
+ target: "es2022",
199
+ transform: {
200
+ useDefineForClassFields: false,
201
+ legacyDecorator: true,
202
+ decoratorMetadata: true,
203
+ },
204
+ }
205
+ },
206
+ },
207
+ },
208
+ {
209
+ test: /\.tsx$/,
210
+ exclude: /(node_modules|bower_components)/,
211
+ use: [
212
+ {
213
+ loader: 'babel-loader',
214
+ options: {
215
+ plugins: ['@vue/babel-plugin-jsx'],
216
+ },
217
+ },
218
+ {
219
+ loader: 'builtin:swc-loader',
220
+ options: {
221
+ sourceMaps: false,
222
+ jsc: {
223
+ parser: {
224
+ syntax: 'typescript',
225
+ tsx: true,
226
+ decorators: true
227
+ },
228
+ target: "es2022",
229
+ transform: {
230
+ useDefineForClassFields: false,
231
+ legacyDecorator: true,
232
+ decoratorMetadata: true,
233
+ // react: {
234
+ // pragma: 'React.createElement',
235
+ // pragmaFrag: 'React.Fragment',
236
+ // throwIfNamespace: true,
237
+ // development: false,
238
+ // useBuiltins: false,
239
+ // },
240
+ },
241
+ }
242
+ },
243
+ },
244
+ ],
245
+ },
246
+ {
247
+ test: /\.css$/i,
248
+ use: [core_2.CssExtractRspackPlugin.loader, 'css-loader'],
249
+ type: 'javascript/auto',
250
+ },
251
+ ],
252
+ },
253
+ plugins: [
254
+ //...buildReferenceManifest(entry, entries)
255
+ ].concat([
256
+ new core_2.DllPlugin({
257
+ path: path_1.default.join(rootPath, outDirManifestMetadata, '[name].manifest.json'),
258
+ name: `omniaWebpackJsonp['${getServiceId()}']['${tooling_1.utils.getguid(Object.keys(entry)[0])}']`
259
+ }),
260
+ new core_2.CssExtractRspackPlugin({})
261
+ // pluginVueJsx()
262
+ ])
120
263
  };
121
264
  }
265
+ function getServiceId() {
266
+ const serviceInfo = composers.ServiceManifestRegistry.getServiceInfo();
267
+ let result;
268
+ if (serviceInfo === null) {
269
+ throw new Error("A service has not been registered, please use Composer.registerManifest(serviceId,serviceName).asWorker or .asWebApp)");
270
+ }
271
+ else {
272
+ result = (0, fx_models_1.maybeGuid)(serviceInfo.id.toLowerCase());
273
+ }
274
+ return result;
275
+ }
276
+ function buildReferenceManifest(currentEntry, entries) {
277
+ var manifests = [];
278
+ var dynamicReferenceManifests = [];
279
+ let buildOptions = getBuildOption();
280
+ var currentEntryName = Object.keys(currentEntry)[0];
281
+ if (buildOptions && buildOptions.bundleOptions && buildOptions.bundleOptions.commonsChunk)
282
+ return dynamicReferenceManifests.concat(buildReferenceManifestFromConfig(currentEntryName));
283
+ // exclude pre-built webpack manifest
284
+ if ($.isExtensionEnv
285
+ || (currentEntryName.indexOf(o$.enums.omniaResourceManifests.Vendor.toString()) === -1
286
+ && currentEntryName.indexOf(vendorProdId) === -1
287
+ // && currentEntryName.indexOf(o$.enums.omniaResourceManifests.FxCore.toString()) === -1
288
+ // && currentEntryName.indexOf(o$.enums.omniaResourceManifests.Fx.toString()) === -1
289
+ // && currentEntryName.indexOf(o$.enums.omniaResourceManifests.FxUx.toString()) === -1
290
+ )) {
291
+ Object.keys(entries).forEach((entryName) => {
292
+ if (entryName !== currentEntryName) {
293
+ if ($.fs.existsSync($.tooling.utils.root(outDirManifestMetadata + "/" + entryName + ".manifest.json"))) {
294
+ manifests.push(new core_2.DllReferencePlugin({
295
+ context: $.tooling.utils.root(""),
296
+ manifest: $.tooling.utils.root(outDirManifestMetadata + "/" + entryName + ".manifest.json"),
297
+ //name: `md${++trackingModuleRefId}` //utils.getguid(entryName)
298
+ //manifest: require($.tooling.utils.root(outDirManifestMetadata + "/" + entryName + ".manifest.json"))
299
+ }));
300
+ }
301
+ }
302
+ });
303
+ }
304
+ manifests = buildReferenceManifestFromConfig(currentEntryName).concat(dynamicReferenceManifests).concat(manifests);
305
+ return manifests;
306
+ }
307
+ function getBuildOption() {
308
+ return $.composers.BuildConfigurationRegistry.getBuildOptions();
309
+ }
310
+ function buildReferenceManifestFromConfig(entryName) {
311
+ var manifests = [];
312
+ let buildOptions = getBuildOption();
313
+ if (buildOptions.reference) {
314
+ for (let manifestPath of buildOptions.reference) {
315
+ manifests.push(new core_2.DllReferencePlugin({
316
+ context: $.tooling.utils.root(""),
317
+ manifest: $.tooling.utils.root(manifestPath),
318
+ // name: `md${++trackingModuleRefId}` //require('md5')(manifestPath)
319
+ }));
320
+ }
321
+ }
322
+ if (!isBuildWebpackManifestOnly() && buildOptions.webpackManifests) {
323
+ for (let manifestPath of buildOptions.webpackManifests) {
324
+ if (manifestPath.indexOf(entryName) === -1) {
325
+ manifests.push(new core_2.DllReferencePlugin({
326
+ context: $.tooling.utils.root(""),
327
+ manifest: $.tooling.utils.root(manifestPath),
328
+ // name: `md${++trackingModuleRefId}` //require('md5')(manifestPath)
329
+ }));
330
+ }
331
+ }
332
+ }
333
+ if ($.isExtensionEnv) {
334
+ _registeredReferenceManifests.forEach(manifest => {
335
+ manifests.push(new core_2.DllReferencePlugin({
336
+ context: $.tooling.utils.root(""),
337
+ manifest: $.tooling.utils.root(manifest.path),
338
+ //name: `md${++trackingModuleRefId}` //require('md5')(manifest.path)
339
+ }));
340
+ });
341
+ }
342
+ return manifests;
343
+ }
344
+ function isBuildWebpackManifestOnly() {
345
+ return process.argv?.find(argv => argv === "--webpackManifest") !== undefined;
346
+ }
347
+ function registerManifestsReference(manifests) {
348
+ manifests.forEach(manifest => {
349
+ if (_registeredReferenceManifests.find(m => m.path === manifest.path) === undefined)
350
+ _registeredReferenceManifests.push(manifest);
351
+ });
352
+ }
353
+ function getRegisteredReferenceManifests() {
354
+ return _registeredReferenceManifests;
355
+ }
@@ -2,7 +2,15 @@ declare const _default: {
2
2
  module: {
3
3
  rules: {
4
4
  test: RegExp;
5
- use: {
5
+ exclude: RegExp;
6
+ use: ({
7
+ loader: string;
8
+ options: {
9
+ plugins: string[];
10
+ sourceMaps?: undefined;
11
+ jsc?: undefined;
12
+ };
13
+ } | {
6
14
  loader: string;
7
15
  options: {
8
16
  sourceMaps: false;
@@ -19,8 +27,9 @@ declare const _default: {
19
27
  decoratorMetadata: true;
20
28
  };
21
29
  };
30
+ plugins?: undefined;
22
31
  };
23
- };
32
+ })[];
24
33
  }[];
25
34
  };
26
35
  };
@@ -5,32 +5,41 @@ exports.default = {
5
5
  rules: [
6
6
  {
7
7
  test: /\.tsx$/,
8
- use: {
9
- loader: 'builtin:swc-loader',
10
- options: {
11
- sourceMaps: false,
12
- jsc: {
13
- parser: {
14
- syntax: 'typescript',
15
- tsx: true,
16
- decorators: true
17
- },
18
- target: "es2022",
19
- transform: {
20
- useDefineForClassFields: false,
21
- legacyDecorator: true,
22
- decoratorMetadata: true,
23
- // react: {
24
- // pragma: 'React.createElement',
25
- // pragmaFrag: 'React.Fragment',
26
- // throwIfNamespace: true,
27
- // development: false,
28
- // useBuiltins: false,
29
- // },
30
- },
31
- }
8
+ exclude: /(node_modules|bower_components)/,
9
+ use: [
10
+ {
11
+ loader: 'babel-loader',
12
+ options: {
13
+ plugins: ['@vue/babel-plugin-jsx'],
14
+ },
32
15
  },
33
- },
16
+ {
17
+ loader: 'builtin:swc-loader',
18
+ options: {
19
+ sourceMaps: false,
20
+ jsc: {
21
+ parser: {
22
+ syntax: 'typescript',
23
+ tsx: true,
24
+ decorators: true
25
+ },
26
+ target: "es2022",
27
+ transform: {
28
+ useDefineForClassFields: false,
29
+ legacyDecorator: true,
30
+ decoratorMetadata: true,
31
+ // react: {
32
+ // pragma: 'React.createElement',
33
+ // pragmaFrag: 'React.Fragment',
34
+ // throwIfNamespace: true,
35
+ // development: false,
36
+ // useBuiltins: false,
37
+ // },
38
+ },
39
+ }
40
+ },
41
+ },
42
+ ],
34
43
  },
35
44
  ],
36
45
  },
@@ -53,8 +53,8 @@ $.tooling.core.registerBuildTask({
53
53
  return new Promise(function (resolve, reject) {
54
54
  buildEntries()
55
55
  .then((result) => {
56
- if (process.argv.length > 0 &&
57
- (process.argv.find(argv => argv === "--package") !== undefined || process.argv.find(argv => argv === "--skipTypeCheck"))) {
56
+ if (!useWebpack || (process.argv.length > 0 &&
57
+ (process.argv.find(argv => argv === "--package") !== undefined || process.argv.find(argv => argv === "--skipTypeCheck")))) {
58
58
  tooling_1.utils.log("Skip Typescript check types.");
59
59
  resolve(result);
60
60
  }
@@ -1,12 +1,4 @@
1
1
  export declare function transformVueJsx(code: string, id: string): {
2
- code: string;
3
- map: {
4
- version: number;
5
- sources: string[];
6
- names: string[];
7
- sourceRoot?: string | undefined;
8
- sourcesContent?: string[] | undefined;
9
- mappings: string;
10
- file: string;
11
- };
2
+ code: any;
3
+ map: any;
12
4
  };
@@ -43,16 +43,8 @@ export declare class StylexPlugin {
43
43
  constructor(options?: PluginOptions);
44
44
  apply(compiler: any): void;
45
45
  transformCode(inputCode: string, filename: any, logger: any): Promise<{
46
- code: string;
47
- map: {
48
- version: number;
49
- sources: string[];
50
- names: string[];
51
- sourceRoot?: string | undefined;
52
- sourcesContent?: string[] | undefined;
53
- mappings: string;
54
- file: string;
55
- };
46
+ code: any;
47
+ map: any;
56
48
  } | {
57
49
  code: string;
58
50
  map?: undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/tooling-vue",
3
3
  "license": "MIT",
4
- "version": "8.0.322-dev",
4
+ "version": "8.0.323-dev",
5
5
  "description": "Used to bundle and serve manifests web component that build on Vue framework.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -19,8 +19,8 @@
19
19
  ],
20
20
  "author": "Precio Fishbone",
21
21
  "dependencies": {
22
- "@omnia/fx-models": "8.0.322-dev",
23
- "@omnia/tooling-composers": "8.0.322-dev",
22
+ "@omnia/fx-models": "8.0.323-dev",
23
+ "@omnia/tooling-composers": "8.0.323-dev",
24
24
  "@types/mousetrap": "1.5.34",
25
25
  "@types/quill": "1.3.6",
26
26
  "@types/zepto": "1.0.29",