@omnia/tooling-vue 8.0.16-vnext → 8.0.17-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.
- package/internal-do-not-import-from-here/config/omnia.vendor.manifest.json +1 -1
- package/internal-do-not-import-from-here/config/tooling.output.json +1 -0
- package/internal-do-not-import-from-here/config/wctypings.d.ts +2122 -0
- package/internal-do-not-import-from-here/index.d.ts +3 -1
- package/internal-do-not-import-from-here/index.js +6 -2
- package/internal-do-not-import-from-here/shared.d.ts +32 -122
- package/internal-do-not-import-from-here/shared.js +97 -192
- package/internal-do-not-import-from-here/swc/extract-doc-plugin/package.json +14 -0
- package/internal-do-not-import-from-here/tasks/ComponentDocRegistrations.d.ts +1 -0
- package/internal-do-not-import-from-here/tasks/ComponentDocRegistrations.js +9 -0
- package/internal-do-not-import-from-here/tasks/bundle.d.ts +3 -4
- package/internal-do-not-import-from-here/tasks/bundle.js +264 -264
- package/internal-do-not-import-from-here/tasks/doc.d.ts +3 -1
- package/internal-do-not-import-from-here/tasks/doc.js +282 -395
- package/internal-do-not-import-from-here/tasks/vendor.js +166 -19
- package/internal-do-not-import-from-here/variables.d.ts +1 -1
- package/internal-do-not-import-from-here/variables.js +2 -2
- package/internal-do-not-import-from-here/vite/hmr/graph.js +5 -1
- package/internal-do-not-import-from-here/vite/hmr/manifest.js +5 -5
- package/internal-do-not-import-from-here/vite/hmr/runtime.js +5 -5
- package/internal-do-not-import-from-here/vite/hmr/transformers/internal/dynamicBundle.js +7 -1
- package/internal-do-not-import-from-here/vite/hmr/utils/manifest.js +3 -3
- package/internal-do-not-import-from-here/vite/hmr/utils/path.js +7 -6
- package/internal-do-not-import-from-here/vite/hmr/utils/webpack.js +2 -2
- package/internal-do-not-import-from-here/vite/index.js +4 -0
- package/internal-do-not-import-from-here/vite/middlewares/HmrMiddleware.js +8 -13
- package/internal-do-not-import-from-here/vite/middlewares/OmniaMiddleware.js +55 -17
- package/internal-do-not-import-from-here/vite/middlewares/StaticFileMiddleware.js +31 -10
- package/internal-do-not-import-from-here/vite/middlewares/WebpackMiddleware.js +1 -1
- package/internal-do-not-import-from-here/vite/plugins/OmniaPlugin.js +10 -2
- package/internal-do-not-import-from-here/wctypings.ts +0 -0
- package/internal-do-not-import-from-here/webpack-loaders/doc-loader.js +11 -0
- package/internal-do-not-import-from-here/webpack-loaders/ts-loader.d.ts +11 -4
- package/internal-do-not-import-from-here/webpack-loaders/ts-loader.js +12 -12
- package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.d.ts +11 -1
- package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.js +34 -29
- package/internal-do-not-import-from-here/webpack-loaders/wc-loader.d.ts +1 -0
- package/internal-do-not-import-from-here/webpack-loaders/wc-loader.js +11 -0
- package/package.json +13 -9
- package/internal-do-not-import-from-here/1cacb55c-202b-4cd7-819d-11bad92fa9cb.wcdefinitions.json +0 -1
- package/internal-do-not-import-from-here/1cacb55c-202b-4cd7-819d-11bad92fa9cb.wctypings.d.ts +0 -11
- package/internal-do-not-import-from-here/bb000000-0000-bbbb-0000-0000000000bb.wcdefinitions.json +0 -1
- package/internal-do-not-import-from-here/bb000000-0000-bbbb-0000-0000000000bb.wctypings.d.ts +0 -347
- package/internal-do-not-import-from-here/bb000000-0000-bbbb-0000-0000000000bb.wctypings.js +0 -2
- package/internal-do-not-import-from-here/cc000000-0000-cccc-0000-0000000000cc.wcdefinitions.json +0 -1
- package/internal-do-not-import-from-here/config/tsconfig.es2015.json +0 -21
- package/internal-do-not-import-from-here/webpack-loaders/esbuild-custom-loader.js +0 -13
- package/internal-do-not-import-from-here/webpack-loaders/jsx-loader.d.ts +0 -8
- package/internal-do-not-import-from-here/webpack-loaders/jsx-loader.js +0 -61
- package/internal-do-not-import-from-here/webpack-loaders/vue-tsx-hot-loader.d.ts +0 -1
- package/internal-do-not-import-from-here/webpack-loaders/vue-tsx-hot-loader.js +0 -44
- package/internal-do-not-import-from-here/webpack-loaders/wcmanifest-loader.d.ts +0 -1
- package/internal-do-not-import-from-here/webpack-loaders/wcmanifest-loader.js +0 -10
- /package/internal-do-not-import-from-here/{1cacb55c-202b-4cd7-819d-11bad92fa9cb.wctypings.js → config/wctypings.js} +0 -0
- /package/internal-do-not-import-from-here/webpack-loaders/{esbuild-custom-loader.d.ts → doc-loader.d.ts} +0 -0
|
@@ -5,7 +5,6 @@ const $ = tslib_1.__importStar(require("../variables"));
|
|
|
5
5
|
const ts_loader_1 = tslib_1.__importDefault(require("../webpack-loaders/ts-loader"));
|
|
6
6
|
const ExtractTextPlugin = require('mini-css-extract-plugin');
|
|
7
7
|
const fsExtra = require('fs-extra');
|
|
8
|
-
fsExtra.copySync('wwwroot/scripts/vue-class-component/vue-class-component.esm.custom.js', 'node_modules/vue-class-component/dist/vue-class-component.esm.js');
|
|
9
8
|
const extractCSS = new ExtractTextPlugin({
|
|
10
9
|
filename: "omnia.vendor.css",
|
|
11
10
|
});
|
|
@@ -123,7 +122,7 @@ $.webpack({
|
|
|
123
122
|
$.tooling.log('omnia shared vendor generated');
|
|
124
123
|
}
|
|
125
124
|
});
|
|
126
|
-
$.tooling.log('omnia vendor running...');
|
|
125
|
+
$.tooling.log('omnia vendor devlopment running...');
|
|
127
126
|
$.webpack({
|
|
128
127
|
mode: 'production',
|
|
129
128
|
devtool: false,
|
|
@@ -132,11 +131,9 @@ $.webpack({
|
|
|
132
131
|
extensions: ['.ts', '.js', '.css'],
|
|
133
132
|
alias: {
|
|
134
133
|
'typestyle$': 'typestyle/lib.es2015/index.js',
|
|
135
|
-
//
|
|
136
|
-
'vue$': 'vue/dist/vue.esm-
|
|
137
|
-
|
|
138
|
-
//'w3c-keyname$': $.path.resolve($.tooling.utils.root(""), 'node_modules/w3c-keyname/index.es.js'),
|
|
139
|
-
//'orderedmap$': 'orderedmap/index.js',
|
|
134
|
+
// vuetify have not working fully 100% with vue runtime browser only, so temp to full bundle vue now.
|
|
135
|
+
//'vue$': 'vue/dist/vue.runtime.esm-browser.js',
|
|
136
|
+
'vue$': 'vue/dist/vue.runtime.esm-bundler.js',
|
|
140
137
|
},
|
|
141
138
|
},
|
|
142
139
|
optimization: {
|
|
@@ -149,7 +146,161 @@ $.webpack({
|
|
|
149
146
|
},
|
|
150
147
|
module: {
|
|
151
148
|
rules: [
|
|
152
|
-
...(0, ts_loader_1.default)(
|
|
149
|
+
...(0, ts_loader_1.default)(),
|
|
150
|
+
{
|
|
151
|
+
test: /\.css(\?|$)/,
|
|
152
|
+
use: [
|
|
153
|
+
{
|
|
154
|
+
loader: ExtractTextPlugin.loader,
|
|
155
|
+
options: {
|
|
156
|
+
publicPath: '../css'
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
'css-loader',
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
test: /\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/,
|
|
164
|
+
use: [{
|
|
165
|
+
loader: 'file-loader',
|
|
166
|
+
options: {
|
|
167
|
+
name: '[name].[ext]',
|
|
168
|
+
outputPath: '../fonts/'
|
|
169
|
+
}
|
|
170
|
+
}]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
entry: {
|
|
175
|
+
vendor: [
|
|
176
|
+
"tslib",
|
|
177
|
+
"./client/fx/vue/VueBundler",
|
|
178
|
+
"typestyle",
|
|
179
|
+
"csx",
|
|
180
|
+
"zepto-webpack",
|
|
181
|
+
"mousetrap",
|
|
182
|
+
"mousetrap-global-bind",
|
|
183
|
+
"dayjs",
|
|
184
|
+
"dayjs/plugin/utc",
|
|
185
|
+
"dayjs/plugin/timezone",
|
|
186
|
+
'dayjs/plugin/duration',
|
|
187
|
+
'dayjs/plugin/relativeTime',
|
|
188
|
+
"dayjs/locale/da.js",
|
|
189
|
+
"dayjs/locale/de.js",
|
|
190
|
+
"dayjs/locale/et.js",
|
|
191
|
+
"dayjs/locale/fr.js",
|
|
192
|
+
"dayjs/locale/lt.js",
|
|
193
|
+
"dayjs/locale/lv.js",
|
|
194
|
+
"dayjs/locale/pl.js",
|
|
195
|
+
"dayjs/locale/sv.js",
|
|
196
|
+
"dayjs/locale/nb.js",
|
|
197
|
+
"dayjs/locale/fi.js",
|
|
198
|
+
"dayjs/locale/es.js",
|
|
199
|
+
"dayjs/locale/nl.js",
|
|
200
|
+
"./wwwroot/scripts/zepto.extras.js",
|
|
201
|
+
// "@material/material-color-utilities"
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
output: {
|
|
205
|
+
path: $.path.join($.tooling.utils.root(""), outDir),
|
|
206
|
+
filename: 'omnia.[name].js',
|
|
207
|
+
library: {
|
|
208
|
+
name: 'omniaVendor',
|
|
209
|
+
type: 'window',
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
plugins: [
|
|
213
|
+
new $.webpack.ContextReplacementPlugin(/moment[\/\\]locale$/, /ignore/),
|
|
214
|
+
extractCSS,
|
|
215
|
+
new $.omniaWebpackPlugins.NamedModulesPlugin(),
|
|
216
|
+
new $.omniaWebpackPlugins.ModifyContent([
|
|
217
|
+
{
|
|
218
|
+
pattern: /var omniaVendor;omniaVendor/i,
|
|
219
|
+
replacement: "window['omniaVendor'] "
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
pattern: /# sourceMappingURL=\s*(\S+)/g,
|
|
223
|
+
replacement: '# ignore'
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
pattern: /__webpack_module_cache__/g,
|
|
227
|
+
replacement: '__omnia_webpack_module_cache__'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
pattern: "const key = `f${stringHash(pid)}`;",
|
|
231
|
+
replacement: `
|
|
232
|
+
// <<omnia custom>> support prefix displayname in styleflow
|
|
233
|
+
` + "const key = `f${stringHash(pid)}`;" +
|
|
234
|
+
` if (!styles.$displayName)
|
|
235
|
+
return key;
|
|
236
|
+
` + "return `${styles.$displayName}_${key}`;"
|
|
237
|
+
},
|
|
238
|
+
]),
|
|
239
|
+
new $.webpack.DllPlugin({
|
|
240
|
+
path: $.path.resolve(__dirname, "../config/omnia.[name].manifest.json"),
|
|
241
|
+
name: 'omniaVendor',
|
|
242
|
+
entryOnly: false
|
|
243
|
+
}),
|
|
244
|
+
new $.webpack.DefinePlugin({
|
|
245
|
+
//process: { env: { NODE_ENV: JSON.stringify('production') } }
|
|
246
|
+
// temp bundle vue vendor in development mode for support HMR
|
|
247
|
+
// process: { env: { NODE_ENV: JSON.stringify('development') } },
|
|
248
|
+
'process.env.NODE_ENV': JSON.stringify('development'),
|
|
249
|
+
__VUE_OPTIONS_API__: true,
|
|
250
|
+
__VUE_PROD_DEVTOOLS__: true
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
})
|
|
254
|
+
.run((err, stats) => {
|
|
255
|
+
if (err || stats.hasErrors()) {
|
|
256
|
+
//console.log(stats.toJson({
|
|
257
|
+
// assets: false,
|
|
258
|
+
// hash: true
|
|
259
|
+
//}))
|
|
260
|
+
$.tooling.log('Omnia vendor have error : \r\n', $.tooling.LogTypes.Error);
|
|
261
|
+
if (err) {
|
|
262
|
+
$.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
stats.toJson().errors.forEach(err => {
|
|
266
|
+
$.tooling.log(err.stack || err, $.tooling.LogTypes.Error);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
// generate omnia vendor metadata
|
|
272
|
+
var manifestPath = $.path.resolve(__dirname, "../config/omnia.vendor.manifest.json");
|
|
273
|
+
var manifestJson = require(manifestPath);
|
|
274
|
+
manifestJson.content["./node_modules/webpack/buildin/module.js"] = undefined;
|
|
275
|
+
$.fs.writeFileSync(manifestPath, JSON.stringify(manifestJson));
|
|
276
|
+
$.tooling.log('omnia vendor devlopment generated');
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
$.tooling.log('omnia vendor prod running...');
|
|
280
|
+
$.webpack({
|
|
281
|
+
mode: 'production',
|
|
282
|
+
devtool: false,
|
|
283
|
+
context: $.tooling.utils.root(""),
|
|
284
|
+
resolve: {
|
|
285
|
+
extensions: ['.ts', '.js', '.css'],
|
|
286
|
+
alias: {
|
|
287
|
+
'typestyle$': 'typestyle/lib.es2015/index.js',
|
|
288
|
+
// vuetify have not working fully 100% with vue runtime browser only, so temp to full bundle vue now.
|
|
289
|
+
'vue$': 'vue/dist/vue.runtime.esm-bundler.js',
|
|
290
|
+
//'vue$': 'vue/dist/vue.esm-bundler.js',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
optimization: {
|
|
294
|
+
minimize: false,
|
|
295
|
+
usedExports: false,
|
|
296
|
+
providedExports: true,
|
|
297
|
+
removeAvailableModules: false,
|
|
298
|
+
mangleExports: false,
|
|
299
|
+
concatenateModules: true,
|
|
300
|
+
},
|
|
301
|
+
module: {
|
|
302
|
+
rules: [
|
|
303
|
+
...(0, ts_loader_1.default)(),
|
|
153
304
|
{
|
|
154
305
|
test: /\.css(\?|$)/,
|
|
155
306
|
use: [
|
|
@@ -178,13 +329,6 @@ $.webpack({
|
|
|
178
329
|
vendor: [
|
|
179
330
|
"tslib",
|
|
180
331
|
"./client/fx/vue/VueBundler",
|
|
181
|
-
// "vue-class-component",
|
|
182
|
-
// "vue-property-decorator",
|
|
183
|
-
// "vue-tsx-support",
|
|
184
|
-
// "vue-tsx-support/enable-check",
|
|
185
|
-
// "vue-tsx-support/lib/vca",
|
|
186
|
-
// "@vue/babel-helper-vue-jsx-merge-props",
|
|
187
|
-
// "@vue/composition-api",
|
|
188
332
|
"typestyle",
|
|
189
333
|
"csx",
|
|
190
334
|
"zepto-webpack",
|
|
@@ -209,7 +353,7 @@ $.webpack({
|
|
|
209
353
|
},
|
|
210
354
|
output: {
|
|
211
355
|
path: $.path.join($.tooling.utils.root(""), outDir),
|
|
212
|
-
filename: 'omnia.[name].js',
|
|
356
|
+
filename: 'omnia.[name].prod.js',
|
|
213
357
|
library: {
|
|
214
358
|
name: 'omniaVendor',
|
|
215
359
|
type: 'window',
|
|
@@ -248,9 +392,12 @@ return key;
|
|
|
248
392
|
entryOnly: false
|
|
249
393
|
}),
|
|
250
394
|
new $.webpack.DefinePlugin({
|
|
251
|
-
//process: { env: { NODE_ENV: JSON.stringify('production') } }
|
|
395
|
+
//process: { env: { NODE_ENV: JSON.stringify('production') } },
|
|
252
396
|
// temp bundle vue vendor in development mode for support HMR
|
|
253
|
-
process: { env: { NODE_ENV: JSON.stringify('development') } }
|
|
397
|
+
// process: { env: { NODE_ENV: JSON.stringify('development') } },
|
|
398
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
399
|
+
__VUE_OPTIONS_API__: true,
|
|
400
|
+
__VUE_PROD_DEVTOOLS__: false
|
|
254
401
|
})
|
|
255
402
|
]
|
|
256
403
|
})
|
|
@@ -276,7 +423,7 @@ return key;
|
|
|
276
423
|
var manifestJson = require(manifestPath);
|
|
277
424
|
manifestJson.content["./node_modules/webpack/buildin/module.js"] = undefined;
|
|
278
425
|
$.fs.writeFileSync(manifestPath, JSON.stringify(manifestJson));
|
|
279
|
-
$.tooling.log('omnia vendor generated');
|
|
426
|
+
$.tooling.log('omnia vendor prod generated');
|
|
280
427
|
}
|
|
281
428
|
});
|
|
282
429
|
// bundle omnia worker vendor
|
|
@@ -5,6 +5,7 @@ import * as composers from "@omnia/tooling-composers";
|
|
|
5
5
|
import * as enums from "../composers/models/Enums";
|
|
6
6
|
import * as composer from '../composers/task';
|
|
7
7
|
import { core, utils } from '@omnia/tooling';
|
|
8
|
+
import { isExtensionEnv } from "./shared";
|
|
8
9
|
import merge from 'webpack-merge';
|
|
9
10
|
import webpack from 'webpack';
|
|
10
11
|
declare var tooling: {
|
|
@@ -16,5 +17,4 @@ declare var tooling: {
|
|
|
16
17
|
LogTypes: typeof utils.LogTypes;
|
|
17
18
|
};
|
|
18
19
|
declare var basePathProcess: string;
|
|
19
|
-
declare var isExtensionEnv: boolean;
|
|
20
20
|
export { omniaWebpackPlugins, basePathProcess, isExtensionEnv, tooling, webpack, chalk, timestamp, path, fs, extend, merge, del, md5File, composers, enums };
|
|
@@ -28,6 +28,8 @@ const enums = tslib_1.__importStar(require("@omnia/tooling-composers/internal-do
|
|
|
28
28
|
exports.enums = enums;
|
|
29
29
|
const composer = tslib_1.__importStar(require("@omnia/tooling-composers/internal-do-not-import-from-here/task"));
|
|
30
30
|
const tooling_1 = require("@omnia/tooling");
|
|
31
|
+
const shared_1 = require("./shared");
|
|
32
|
+
Object.defineProperty(exports, "isExtensionEnv", { enumerable: true, get: function () { return shared_1.isExtensionEnv; } });
|
|
31
33
|
const webpack_merge_1 = tslib_1.__importDefault(require("webpack-merge"));
|
|
32
34
|
exports.merge = webpack_merge_1.default;
|
|
33
35
|
const webpack_1 = tslib_1.__importDefault(require("webpack"));
|
|
@@ -36,5 +38,3 @@ var tooling = { composer, core: tooling_1.core, utils: tooling_1.utils, log: too
|
|
|
36
38
|
exports.tooling = tooling;
|
|
37
39
|
var basePathProcess = process.cwd();
|
|
38
40
|
exports.basePathProcess = basePathProcess;
|
|
39
|
-
var isExtensionEnv = fs.existsSync(basePathProcess + "/node_modules/@omnia/tooling-vue/package.json");
|
|
40
|
-
exports.isExtensionEnv = isExtensionEnv;
|
|
@@ -10,6 +10,8 @@ const utils_1 = require("./utils");
|
|
|
10
10
|
const manifest_1 = require("./manifest");
|
|
11
11
|
const vueJsx_1 = require("./vueJsx");
|
|
12
12
|
const $ = tslib_1.__importStar(require("../../variables"));
|
|
13
|
+
const shared_1 = require("../../shared");
|
|
14
|
+
const doc_1 = require("../../tasks/doc");
|
|
13
15
|
let fileGraphs = {};
|
|
14
16
|
let manifests = {};
|
|
15
17
|
const initialManifests = [
|
|
@@ -18,7 +20,7 @@ const initialManifests = [
|
|
|
18
20
|
fx_models_1.OmniaResourceManifests.FxWorkers.toString()
|
|
19
21
|
];
|
|
20
22
|
const esbuildTransformOptions = {
|
|
21
|
-
target: '
|
|
23
|
+
target: 'es2020',
|
|
22
24
|
jsx: 'preserve',
|
|
23
25
|
sourcemap: false,
|
|
24
26
|
legalComments: 'inline'
|
|
@@ -151,6 +153,7 @@ async function buildFileGraph(unknownId, code) {
|
|
|
151
153
|
return { fileGraph, code };
|
|
152
154
|
}
|
|
153
155
|
fileGraph.js.scanned = true;
|
|
156
|
+
code = (0, shared_1.modifyComponent)(code, fileGraph.id);
|
|
154
157
|
const esbuildTransformResult = await (0, vite_1.transformWithEsbuild)(code, id, esbuildTransformOptions);
|
|
155
158
|
code = esbuildTransformResult.code;
|
|
156
159
|
// d.ts or interface only
|
|
@@ -163,6 +166,7 @@ async function buildFileGraph(unknownId, code) {
|
|
|
163
166
|
}
|
|
164
167
|
fileGraph.js.metadata = utils_1.moduleAnalysis.analyze(code, id);
|
|
165
168
|
ensureDependencies(id, fileGraph.js.metadata);
|
|
169
|
+
code = (0, doc_1.importSnippetCode)(code, fileGraph.id);
|
|
166
170
|
return { fileGraph, code, esbuildTransformResult };
|
|
167
171
|
}
|
|
168
172
|
exports.buildFileGraph = buildFileGraph;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPreBundleInfo = exports.validatePreBundles = exports.getManifest = exports.clearManifestCollection = exports.getManifestCollection = exports.entriesResolver = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
-
const globby_1 =
|
|
6
|
+
const globby_1 = require("globby");
|
|
7
7
|
const $ = tslib_1.__importStar(require("../../variables"));
|
|
8
8
|
const fx_models_1 = require("@omnia/fx-models");
|
|
9
9
|
const utils_1 = require("./utils");
|
|
@@ -61,7 +61,7 @@ exports.entriesResolver = new ManifestBuildEntriesResolver();
|
|
|
61
61
|
let _manifestCollection;
|
|
62
62
|
function getManifestCollection() {
|
|
63
63
|
if (!_manifestCollection) {
|
|
64
|
-
_manifestCollection = $.tooling.composer.
|
|
64
|
+
_manifestCollection = $.tooling.composer.getManifestsJson();
|
|
65
65
|
}
|
|
66
66
|
return _manifestCollection;
|
|
67
67
|
}
|
|
@@ -84,9 +84,9 @@ function getManifest(resourceId) {
|
|
|
84
84
|
exports.getManifest = getManifest;
|
|
85
85
|
async function validatePreBundles(fileNames) {
|
|
86
86
|
const preBundleDir = utils_1.envUtils.getBundleOutputDirPath();
|
|
87
|
-
const filePaths = fileNames.map(fileName => path_1.default.join(preBundleDir, fileName));
|
|
87
|
+
const filePaths = fileNames.map(fileName => path_1.default.join(preBundleDir, fileName).replace(/\\/g, '/'));
|
|
88
88
|
return new Promise((resolve, reject) => {
|
|
89
|
-
(0, globby_1.
|
|
89
|
+
(0, globby_1.globby)(filePaths).then(result => {
|
|
90
90
|
resolve(result);
|
|
91
91
|
}).catch(reject);
|
|
92
92
|
});
|
|
@@ -95,7 +95,7 @@ exports.validatePreBundles = validatePreBundles;
|
|
|
95
95
|
function getPreBundleInfo() {
|
|
96
96
|
return exports.entriesResolver.getPreBundleEntries().then(entries => {
|
|
97
97
|
const serviceId = $.tooling.composer.getServiceId();
|
|
98
|
-
const manifests = $.tooling.composer.
|
|
98
|
+
const manifests = $.tooling.composer.getManifestsJson();
|
|
99
99
|
return Object.keys(entries).reduce((array, fileName) => {
|
|
100
100
|
const resourceId = utils_1.manifestUtils.getResourceIdFromEntryKey(fileName);
|
|
101
101
|
const filePaths = entries[fileName];
|
|
@@ -43,9 +43,9 @@ function setupHmrPlugin(options, config) {
|
|
|
43
43
|
};
|
|
44
44
|
_runtimeContext = runtimeContext;
|
|
45
45
|
const resolvers = config.resolvers.filter(item => !!item);
|
|
46
|
-
const omniaPackagesPathPattern = (0, vite_1.normalizePath)(path_1.default.join(utils_1.envUtils.getRootDirPath(), 'node_modules/@omnia/*/*'));
|
|
47
|
-
const omniaPackagesDeepImports = (0, globby_1.
|
|
48
|
-
const
|
|
46
|
+
const omniaPackagesPathPattern = (0, vite_1.normalizePath)(path_1.default.join(utils_1.envUtils.getRootDirPath(), 'node_modules/@omnia/*/*').replace(/\\/g, '/'));
|
|
47
|
+
const omniaPackagesDeepImports = (0, globby_1.globbySync)(omniaPackagesPathPattern).map(p => p.replace((0, vite_1.normalizePath)(path_1.default.join(utils_1.envUtils.getRootDirPath(), 'node_modules/')), ''));
|
|
48
|
+
const dep = require(path_1.default.join(utils_1.envUtils.getRootDirPath(), 'package.json'));
|
|
49
49
|
clearCacheAssets();
|
|
50
50
|
// Manifests changed
|
|
51
51
|
// entriesResolver.registerManifestEventHandler(() => {
|
|
@@ -55,8 +55,8 @@ function setupHmrPlugin(options, config) {
|
|
|
55
55
|
config: () => ({
|
|
56
56
|
optimizeDeps: {
|
|
57
57
|
exclude: [
|
|
58
|
-
...Object.keys(dependencies),
|
|
59
|
-
...Object.keys(devDependencies),
|
|
58
|
+
...Object.keys(dep.dependencies || {}),
|
|
59
|
+
...Object.keys(dep.devDependencies || {}),
|
|
60
60
|
...omniaPackagesDeepImports
|
|
61
61
|
]
|
|
62
62
|
},
|
|
@@ -32,6 +32,7 @@ exports.dynamicBundle = (0, base_1.defineTransformer)("omnia-bundle", () => {
|
|
|
32
32
|
return utils_1.pathUtils.isJavaScriptSuperset(id);
|
|
33
33
|
},
|
|
34
34
|
async transform(code, id, fileGraph, ctx, fromWorker) {
|
|
35
|
+
//id.indexOf("wwwroot/docs/") === -1 &&
|
|
35
36
|
const dynamicModules = filterDynamicModules(fileGraph, ctx);
|
|
36
37
|
const bundledModules = dynamicModules.filter(item => item.resolved);
|
|
37
38
|
const unBundledModules = dynamicModules.filter(item => !item.resolved);
|
|
@@ -223,7 +224,12 @@ function ensureBundleInjection(code, resourceId) {
|
|
|
223
224
|
function filterBareImport(item, ctx) {
|
|
224
225
|
const depFileGraph = ctx.getFileGraph(item.path);
|
|
225
226
|
// skip omnia packages since they only contain typing files
|
|
226
|
-
return depFileGraph
|
|
227
|
+
return depFileGraph
|
|
228
|
+
&& depFileGraph.id.startsWith('./wwwroot/docs/') == false
|
|
229
|
+
&& depFileGraph.id.startsWith('@omnia') == false
|
|
230
|
+
&& !ctx.alias[depFileGraph.id]
|
|
231
|
+
&& depFileGraph.bareImport
|
|
232
|
+
&& depFileGraph.js;
|
|
227
233
|
}
|
|
228
234
|
function isBareImportResolved(item, ctx) {
|
|
229
235
|
const depFileGraph = ctx.getFileGraph(item.path);
|
|
@@ -15,8 +15,8 @@ const vendors = [
|
|
|
15
15
|
];
|
|
16
16
|
let internalManifestReferences;
|
|
17
17
|
const externalManifestReferences = (function () {
|
|
18
|
-
const externalManifestRefPathPattern = (0, vite_1.normalizePath)(path_1.default.join(envUtils.getRootDirPath(), 'node_modules/@omnia/*/internal-do-not-import-from-here/manifests/*.json'));
|
|
19
|
-
const manifestFilePaths = (0, globby_1.
|
|
18
|
+
const externalManifestRefPathPattern = (0, vite_1.normalizePath)(path_1.default.join(envUtils.getRootDirPath(), 'node_modules/@omnia/*/internal-do-not-import-from-here/manifests/*.json').replace(/\\/g, '/'));
|
|
19
|
+
const manifestFilePaths = (0, globby_1.globbySync)(externalManifestRefPathPattern);
|
|
20
20
|
if (manifestFilePaths.length == 0) {
|
|
21
21
|
return [];
|
|
22
22
|
}
|
|
@@ -73,6 +73,6 @@ function getEntryKeyFromManifest(manifest) {
|
|
|
73
73
|
if (!!manifest.resourceName) {
|
|
74
74
|
return `${manifest.resourceName}_${manifest.resourceId}`;
|
|
75
75
|
}
|
|
76
|
-
return manifest.resourceId;
|
|
76
|
+
return manifest.resourceId.toString();
|
|
77
77
|
}
|
|
78
78
|
exports.getEntryKeyFromManifest = getEntryKeyFromManifest;
|
|
@@ -143,21 +143,22 @@ function modify(value) {
|
|
|
143
143
|
exports.modify = modify;
|
|
144
144
|
function resolveModulePath(modulePath, external) {
|
|
145
145
|
let pattern = null;
|
|
146
|
+
const path = modulePath.replace(/\\/g, '/');
|
|
146
147
|
if (external) {
|
|
147
|
-
pattern = [
|
|
148
|
+
pattern = [path + '.js', path + '/index.js', path + '.ts', path + '.tsx', path + '/index.ts'];
|
|
148
149
|
}
|
|
149
|
-
else if (
|
|
150
|
-
pattern = [
|
|
150
|
+
else if (path.endsWith('.css')) {
|
|
151
|
+
pattern = [path + '.ts', path];
|
|
151
152
|
}
|
|
152
153
|
else {
|
|
153
|
-
pattern = [
|
|
154
|
+
pattern = [path + '.ts', path + '.tsx', path + '/index.ts'];
|
|
154
155
|
}
|
|
155
|
-
const result = (0, globby_1.
|
|
156
|
+
const result = (0, globby_1.globbySync)(pattern);
|
|
156
157
|
if (result.length == 1) {
|
|
157
158
|
return result[0];
|
|
158
159
|
}
|
|
159
160
|
if (result.length > 1) {
|
|
160
|
-
if (
|
|
161
|
+
if (path.endsWith('.css')) {
|
|
161
162
|
// priority typestyle
|
|
162
163
|
let filePath = result.find(p => p.endsWith('.css.ts'));
|
|
163
164
|
// then raw css
|
|
@@ -10,7 +10,7 @@ function createWebpackConfig(entries, option) {
|
|
|
10
10
|
let bundleOptions = bundler.getBuildOption().bundleOptions;
|
|
11
11
|
let outputDir = envUtils.getBundleOutputDirPath().replace(envUtils.getRootDirPath(), '');
|
|
12
12
|
if (bundleOptions && bundleOptions.commonsChunk) {
|
|
13
|
-
let config = bundler.createVueWebpackConfig(null, entries, outputDir,
|
|
13
|
+
let config = bundler.createVueWebpackConfig(null, entries, outputDir, option);
|
|
14
14
|
config.stats = {
|
|
15
15
|
entrypoints: false,
|
|
16
16
|
chunks: false,
|
|
@@ -26,7 +26,7 @@ function createWebpackConfig(entries, option) {
|
|
|
26
26
|
configs = Object.keys(entries).map(key => {
|
|
27
27
|
var entry = {};
|
|
28
28
|
entry[key] = entries[key];
|
|
29
|
-
let config = bundler.createVueWebpackConfig(entry, entries, outputDir,
|
|
29
|
+
let config = bundler.createVueWebpackConfig(entry, entries, outputDir, option);
|
|
30
30
|
config.stats = 'errors-only';
|
|
31
31
|
config.watchOptions = {
|
|
32
32
|
aggregateTimeout: 200
|
|
@@ -10,6 +10,7 @@ const del_1 = tslib_1.__importDefault(require("del"));
|
|
|
10
10
|
const tooling_composers_1 = require("@omnia/tooling-composers");
|
|
11
11
|
const tooling_1 = require("@omnia/tooling");
|
|
12
12
|
const plugins_1 = require("./plugins");
|
|
13
|
+
const vite_plugin_inspect_1 = tslib_1.__importDefault(require("vite-plugin-inspect"));
|
|
13
14
|
async function createViteServer() {
|
|
14
15
|
const hosting = (0, tooling_composers_1.getHosting)();
|
|
15
16
|
let plugins = [
|
|
@@ -17,6 +18,9 @@ async function createViteServer() {
|
|
|
17
18
|
hosting: hosting
|
|
18
19
|
})
|
|
19
20
|
];
|
|
21
|
+
if (hosting.enableProfiling) {
|
|
22
|
+
plugins.push((0, vite_plugin_inspect_1.default)());
|
|
23
|
+
}
|
|
20
24
|
let https = hosting.https || await getCert();
|
|
21
25
|
let serverConfig = {
|
|
22
26
|
configFile: false,
|
|
@@ -119,7 +119,9 @@ function registerHmrMiddleware(server) {
|
|
|
119
119
|
//res.end(content);
|
|
120
120
|
}
|
|
121
121
|
else if (ext === "css") {
|
|
122
|
-
content = `import { updateStyle as __vite__updateStyle} from "/@vite/client";
|
|
122
|
+
content = `import { updateStyle as __vite__updateStyle} from "/@vite/client";
|
|
123
|
+
const __vite__css = ${JSON.stringify(content)}
|
|
124
|
+
__vite__updateStyle("${bundleFileName}", __vite__css)`;
|
|
123
125
|
// req.url = `/omnia/dist/hmr/bundles/${bundleFileName}`;
|
|
124
126
|
// console.log("Hmr middleware", req.url)
|
|
125
127
|
// next();
|
|
@@ -290,12 +292,7 @@ const manifestResolvePromise = new Promise(function (resolve) {
|
|
|
290
292
|
resolveManifest = resolve;
|
|
291
293
|
});
|
|
292
294
|
|
|
293
|
-
omniaLoader['${serviceId}']['${resourceId}'] = function (
|
|
294
|
-
if (preBundle && !preBundleLoader) {
|
|
295
|
-
preBundleLoader = preBundle;
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
|
|
295
|
+
omniaLoader['${serviceId}']['${resourceId}'] = function () {
|
|
299
296
|
if (triggered) {
|
|
300
297
|
return manifestResolvePromise;
|
|
301
298
|
}
|
|
@@ -323,8 +320,8 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
323
320
|
|
|
324
321
|
// pre-bundle exports
|
|
325
322
|
let preBundleWebpackRequire;
|
|
326
|
-
if (
|
|
327
|
-
|
|
323
|
+
if (typeof hmrPreBundle === "function") {
|
|
324
|
+
hmrPreBundle();
|
|
328
325
|
}
|
|
329
326
|
|
|
330
327
|
function require(moduleId) {
|
|
@@ -342,7 +339,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
342
339
|
}
|
|
343
340
|
|
|
344
341
|
${fromWorker ?
|
|
345
|
-
`const { href } = new URL('${host}${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}
|
|
342
|
+
`const { href } = new URL('${host}${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}?${utils_1.pathUtils.WORKER_IDENTIFIER}', location.href);
|
|
346
343
|
__shimport__.load(href).then(function () {
|
|
347
344
|
if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
|
|
348
345
|
preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
|
|
@@ -351,7 +348,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
351
348
|
omniaWebpackJsonp['${serviceId}']['${resourceId}'] = require;
|
|
352
349
|
resolveManifest();
|
|
353
350
|
});` :
|
|
354
|
-
`import('${
|
|
351
|
+
`import('${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}').then(function () {
|
|
355
352
|
if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
|
|
356
353
|
preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
|
|
357
354
|
}
|
|
@@ -362,9 +359,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
362
359
|
|
|
363
360
|
return manifestResolvePromise;
|
|
364
361
|
}
|
|
365
|
-
|
|
366
362
|
${preBundleContent}
|
|
367
|
-
|
|
368
363
|
${forGroupManifest ? 'return manifestResolvePromise;' : `${$.composers.LoadableManifestRegistry.isDefineWithNoDependency(resourceId) ? `omniaLoader['${serviceId}']['${resourceId}']();` : ''}`}
|
|
369
364
|
`;
|
|
370
365
|
return template.trim();
|