@omnia/tooling-vue 8.0.27-vnext → 8.0.28-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 +2290 -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 -105
- package/internal-do-not-import-from-here/shared.js +97 -155
- package/internal-do-not-import-from-here/tasks/ComponentDocRegistrations.js +1 -1
- package/internal-do-not-import-from-here/tasks/bundle.d.ts +2 -3
- package/internal-do-not-import-from-here/tasks/bundle.js +168 -390
- 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 +7 -3
- 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/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/middlewares/HmrMiddleware.js +5 -12
- package/internal-do-not-import-from-here/vite/middlewares/OmniaMiddleware.js +55 -17
- package/internal-do-not-import-from-here/vite/middlewares/StaticFileMiddleware.js +9 -8
- package/internal-do-not-import-from-here/vite/middlewares/WebpackMiddleware.js +1 -1
- package/internal-do-not-import-from-here/vite/plugins/OmniaPlugin.js +9 -1
- 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 +10 -3
- package/internal-do-not-import-from-here/webpack-loaders/ts-loader.js +11 -4
- package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.d.ts +10 -0
- package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.js +12 -2
- 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 +8 -6
- package/internal-do-not-import-from-here/bb000000-0000-bbbb-0000-0000000000bb.wctypings.d.ts +0 -445
- 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/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/{bb000000-0000-bbbb-0000-0000000000bb.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
|
@@ -186,13 +186,17 @@ $.webpack({
|
|
|
186
186
|
'dayjs/plugin/duration',
|
|
187
187
|
'dayjs/plugin/relativeTime',
|
|
188
188
|
"dayjs/locale/da.js",
|
|
189
|
-
"dayjs/locale/pl.js",
|
|
190
|
-
"dayjs/locale/fr.js",
|
|
191
189
|
"dayjs/locale/de.js",
|
|
192
190
|
"dayjs/locale/et.js",
|
|
193
|
-
"dayjs/locale/
|
|
191
|
+
"dayjs/locale/fr.js",
|
|
194
192
|
"dayjs/locale/lt.js",
|
|
193
|
+
"dayjs/locale/lv.js",
|
|
194
|
+
"dayjs/locale/pl.js",
|
|
195
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",
|
|
196
200
|
"./wwwroot/scripts/zepto.extras.js",
|
|
197
201
|
// "@material/material-color-utilities"
|
|
198
202
|
]
|
|
@@ -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
|
},
|
|
@@ -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
|
|
@@ -292,12 +292,7 @@ const manifestResolvePromise = new Promise(function (resolve) {
|
|
|
292
292
|
resolveManifest = resolve;
|
|
293
293
|
});
|
|
294
294
|
|
|
295
|
-
omniaLoader['${serviceId}']['${resourceId}'] = function (
|
|
296
|
-
if (preBundle && !preBundleLoader) {
|
|
297
|
-
preBundleLoader = preBundle;
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
|
|
295
|
+
omniaLoader['${serviceId}']['${resourceId}'] = function () {
|
|
301
296
|
if (triggered) {
|
|
302
297
|
return manifestResolvePromise;
|
|
303
298
|
}
|
|
@@ -325,8 +320,8 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
325
320
|
|
|
326
321
|
// pre-bundle exports
|
|
327
322
|
let preBundleWebpackRequire;
|
|
328
|
-
if (
|
|
329
|
-
|
|
323
|
+
if (typeof hmrPreBundle === "function") {
|
|
324
|
+
hmrPreBundle();
|
|
330
325
|
}
|
|
331
326
|
|
|
332
327
|
function require(moduleId) {
|
|
@@ -344,7 +339,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
344
339
|
}
|
|
345
340
|
|
|
346
341
|
${fromWorker ?
|
|
347
|
-
`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);
|
|
348
343
|
__shimport__.load(href).then(function () {
|
|
349
344
|
if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
|
|
350
345
|
preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
|
|
@@ -353,7 +348,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
353
348
|
omniaWebpackJsonp['${serviceId}']['${resourceId}'] = require;
|
|
354
349
|
resolveManifest();
|
|
355
350
|
});` :
|
|
356
|
-
`import('${
|
|
351
|
+
`import('${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}').then(function () {
|
|
357
352
|
if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
|
|
358
353
|
preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
|
|
359
354
|
}
|
|
@@ -364,9 +359,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
364
359
|
|
|
365
360
|
return manifestResolvePromise;
|
|
366
361
|
}
|
|
367
|
-
|
|
368
362
|
${preBundleContent}
|
|
369
|
-
|
|
370
363
|
${forGroupManifest ? 'return manifestResolvePromise;' : `${$.composers.LoadableManifestRegistry.isDefineWithNoDependency(resourceId) ? `omniaLoader['${serviceId}']['${resourceId}']();` : ''}`}
|
|
371
364
|
`;
|
|
372
365
|
return template.trim();
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerOmniaMiddleware = exports.ManifestChangedMessage = exports.resolvableManifest = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chokidar_1 = tslib_1.__importDefault(require("chokidar"));
|
|
6
|
+
const url_1 = tslib_1.__importDefault(require("url"));
|
|
6
7
|
const tooling_1 = require("@omnia/tooling");
|
|
7
8
|
const tooling_2 = require("@omnia/tooling");
|
|
8
9
|
const $ = tslib_1.__importStar(require("../../variables"));
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const fx_models_1 = require("@omnia/fx-models");
|
|
11
|
+
const fsExtra = tslib_1.__importStar(require("fs-extra"));
|
|
12
|
+
let _middlewares = null;
|
|
13
|
+
let _server = null;
|
|
11
14
|
class ImplementManifestChangedMessage {
|
|
12
15
|
constructor() {
|
|
13
16
|
this._subcribers = [];
|
|
@@ -22,7 +25,8 @@ class ImplementManifestChangedMessage {
|
|
|
22
25
|
exports.resolvableManifest = null;
|
|
23
26
|
exports.ManifestChangedMessage = new ImplementManifestChangedMessage();
|
|
24
27
|
function registerOmniaMiddleware(server, hmr) {
|
|
25
|
-
|
|
28
|
+
_server = server;
|
|
29
|
+
_middlewares = server.middlewares;
|
|
26
30
|
server.middlewares.use('/omnia', function (req, res, next) {
|
|
27
31
|
ensureLoadManifest();
|
|
28
32
|
exports.resolvableManifest.promise.then(() => {
|
|
@@ -33,12 +37,9 @@ function registerOmniaMiddleware(server, hmr) {
|
|
|
33
37
|
res.setHeader('Content-Type', 'application/json');
|
|
34
38
|
res.end(JSON.stringify({ id: $.composers.ServiceManifestRegistry.getServiceInfo().id, hmr: hmr }));
|
|
35
39
|
});
|
|
36
|
-
server.middlewares.use('/omnia/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
//if (server.config.server.hmr) {
|
|
40
|
-
// manifestJson.groupedResouresAndComponents = [];
|
|
41
|
-
//}
|
|
40
|
+
server.middlewares.use('/omnia/manifest.json', function (req, res, next) {
|
|
41
|
+
const target = url_1.default.parse(req.url, true).query.target;
|
|
42
|
+
let manifestJson = JSON.parse(JSON.stringify($.tooling.composer.getManifestJsonByTarget(target)));
|
|
42
43
|
res.setHeader('Cache-Control', 'no-cache');
|
|
43
44
|
res.setHeader('Content-Type', 'application/json');
|
|
44
45
|
res.end(JSON.stringify({
|
|
@@ -46,6 +47,13 @@ function registerOmniaMiddleware(server, hmr) {
|
|
|
46
47
|
manifest: manifestJson
|
|
47
48
|
}));
|
|
48
49
|
});
|
|
50
|
+
server.middlewares.use('/omnia/localization', function (req, res, next) {
|
|
51
|
+
const target = url_1.default.parse(req.url, true).query.target;
|
|
52
|
+
let localizeObject = $.composers.getLocalizations();
|
|
53
|
+
res.setHeader('Cache-Control', 'no-cache');
|
|
54
|
+
res.setHeader('Content-Type', 'application/json');
|
|
55
|
+
res.end(JSON.stringify(localizeObject[target] || ""));
|
|
56
|
+
});
|
|
49
57
|
let watchManifests = chokidar_1.default.watch(["**/*.manifest.ts", "omnia.service.ts"], {
|
|
50
58
|
ignored: [/[\/\\]\./, '**/node_modules/**'],
|
|
51
59
|
persistent: true
|
|
@@ -53,12 +61,24 @@ function registerOmniaMiddleware(server, hmr) {
|
|
|
53
61
|
watchManifests.on('ready', function () {
|
|
54
62
|
watchManifests
|
|
55
63
|
.on('add', path => {
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
if (isLocalizeManifestFile(path)) {
|
|
65
|
+
$.tooling.utils.log(`Found localize manifest file added -> ${path}`);
|
|
66
|
+
rebuildLocalization(path);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
$.tooling.utils.log(`Found manifest added -> ${path}`);
|
|
70
|
+
rebuildManifests();
|
|
71
|
+
}
|
|
58
72
|
})
|
|
59
73
|
.on('change', path => {
|
|
60
|
-
|
|
61
|
-
|
|
74
|
+
if (isLocalizeManifestFile(path)) {
|
|
75
|
+
$.tooling.utils.log(`Found localize manifest file changed -> ${path}`);
|
|
76
|
+
rebuildLocalization(path);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
$.tooling.utils.log(`Found manifest changed -> ${path}`);
|
|
80
|
+
rebuildManifests();
|
|
81
|
+
}
|
|
62
82
|
})
|
|
63
83
|
.on('unlink', path => {
|
|
64
84
|
$.tooling.utils.log(`Found manifest removed -> ${path}`);
|
|
@@ -70,6 +90,24 @@ function registerOmniaMiddleware(server, hmr) {
|
|
|
70
90
|
// setTimeout(ensureLoadManifest, 100);
|
|
71
91
|
}
|
|
72
92
|
exports.registerOmniaMiddleware = registerOmniaMiddleware;
|
|
93
|
+
function isLocalizeManifestFile(filePath) {
|
|
94
|
+
const content = fsExtra.readFileSync(filePath, 'utf8');
|
|
95
|
+
return content.indexOf(".registerLocalization") > -1;
|
|
96
|
+
}
|
|
97
|
+
function rebuildLocalization(filePath) {
|
|
98
|
+
try {
|
|
99
|
+
$.tooling.composer.processManifests([filePath]);
|
|
100
|
+
let localizeObject = $.composers.getLocalizations();
|
|
101
|
+
const payLoad = {
|
|
102
|
+
type: fx_models_1.LocalServingMessageType.LocalizeChanged,
|
|
103
|
+
data: localizeObject
|
|
104
|
+
};
|
|
105
|
+
_server.ws.send(payLoad);
|
|
106
|
+
}
|
|
107
|
+
catch (ex) {
|
|
108
|
+
// ignore ex because that already log error inside $.tooling.composer.processManifests
|
|
109
|
+
}
|
|
110
|
+
}
|
|
73
111
|
function rebuildManifests() {
|
|
74
112
|
tooling_1.utils.timeWatch("omniamiddleware_watchmanifest", () => {
|
|
75
113
|
if (exports.resolvableManifest) {
|
|
@@ -91,14 +129,14 @@ function rebuildManifests() {
|
|
|
91
129
|
tooling_1.utils.log(e, tooling_2.LogTypes.Error);
|
|
92
130
|
}
|
|
93
131
|
}
|
|
94
|
-
},
|
|
132
|
+
}, 100);
|
|
95
133
|
}
|
|
96
134
|
function ensureLoadManifest() {
|
|
97
|
-
if (
|
|
135
|
+
if (_middlewares && !exports.resolvableManifest) {
|
|
98
136
|
exports.resolvableManifest = new tooling_2.ResolvablePromise();
|
|
99
|
-
|
|
137
|
+
// ManifestChangedMessage.publish();
|
|
100
138
|
var tasks = tooling_1.core.getRegisteredServeTasks().filter(function (task) { return task.stage === tooling_1.core.TaskStage.AfterCreateServer; }).sort(sortTask) || [];
|
|
101
|
-
executeTasks(tasks,
|
|
139
|
+
executeTasks(tasks, _middlewares, () => {
|
|
102
140
|
exports.resolvableManifest.resolve();
|
|
103
141
|
}, err => {
|
|
104
142
|
exports.resolvableManifest.resolve();
|
|
@@ -48,15 +48,16 @@ function registerStaticFileMiddleware(server) {
|
|
|
48
48
|
res.setHeader('content-type', 'application/x-javascript');
|
|
49
49
|
let localizeObject = $.composers.getLocalizations();
|
|
50
50
|
res.end(`
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const OmniaContext = omniaWebpackJsonp["bb000000-0000-bbbb-0000-0000000000bb"]["a1602121-3070-4304-b4d8-0859e50c482b"]("5326a8ef-4e3c-49d6-b415-1ddf7fdcc830").OmniaContext;
|
|
52
|
+
const container = omniaWebpackJsonp["bb000000-0000-bbbb-0000-0000000000bb"]["` + fx_models_1.OmniaResourceManifests.FxCore.toString() + `"]("97786ea9-4861-48bd-8a57-eae9bbdb4892").ServiceContainer;
|
|
53
|
+
const omniaCtx = container.createInstance(OmniaContext);
|
|
54
|
+
const useLocalizationStore = omniaWebpackJsonp["bb000000-0000-bbbb-0000-0000000000bb"]["` + fx_models_1.OmniaResourceManifests.Fx.toString() + `"]("5e618f4d-d014-414e-a681-89e34cbeda0f").useLocalizationStore;
|
|
55
|
+
const localizeStore = container.createInstance(useLocalizationStore);
|
|
56
|
+
const currentCulture = omniaCtx.language.toLowerCase();
|
|
57
|
+
const loc = JSON.parse('${JSON.stringify(localizeObject).replace(/'/g, "\\'").replace(/\\"/g, "\\\\\"")}');
|
|
57
58
|
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
localizeStore.actions.merge(loc['en-us'] || {}); // add default english
|
|
60
|
+
localizeStore.actions.merge(loc[currentCulture] || {});
|
|
60
61
|
`);
|
|
61
62
|
}
|
|
62
63
|
else {
|
|
@@ -94,7 +94,7 @@ function registerWebpackMiddleWareBundle(entries) {
|
|
|
94
94
|
if (manifestId) {
|
|
95
95
|
let manifest = $.tooling.composer.getManifestById(manifestId);
|
|
96
96
|
if (manifest) {
|
|
97
|
-
let manifestsData = $.tooling.composer.
|
|
97
|
+
let manifestsData = $.tooling.composer.getManifestsJson();
|
|
98
98
|
let bundleType = path_1.default.extname(filePath).replace('.', '');
|
|
99
99
|
manifest.version = manifest.version || {};
|
|
100
100
|
manifest.version[bundleType] = $.tooling.utils.generateGuid().replace(/-/g, '');
|
|
@@ -20,7 +20,7 @@ function omniaPlugin(options) {
|
|
|
20
20
|
'vue': 'vue/dist/vue.runtime.esm-bundler.js',
|
|
21
21
|
// 'vue-class-component': 'vue-class-component/dist/vue-class-component.esm.js',
|
|
22
22
|
// 'vue-property-decorator': 'vue-property-decorator/lib/vue-property-decorator.js',
|
|
23
|
-
'vue-virtual-scroller': 'vue-virtual-scroller/dist/vue-virtual-scroller.esm.js',
|
|
23
|
+
// 'vue-virtual-scroller': 'vue-virtual-scroller/dist/vue-virtual-scroller.esm.js',
|
|
24
24
|
'typestyle': 'typestyle/lib.es2015/index.js',
|
|
25
25
|
'dayjs': 'dayjs/dayjs.min.js',
|
|
26
26
|
// '@tiptap/core': '@tiptap/core/dist/index.js',
|
|
@@ -67,7 +67,15 @@ function omniaPlugin(options) {
|
|
|
67
67
|
server.middlewares.use(async (req, res, next) => {
|
|
68
68
|
res.setHeader('Access-Control-Allow-Origin', req.headers['origin'] || '*');
|
|
69
69
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
70
|
+
res.setHeader('Access-Control-Request-Private-Network', 'true');
|
|
71
|
+
res.setHeader('Access-Control-Request-Method', '*');
|
|
70
72
|
res.setHeader('Access-Control-Allow-Headers', '*');
|
|
73
|
+
if (req.method === "OPTIONS") {
|
|
74
|
+
res.setHeader('Access-Control-Max-Age', 31536000);
|
|
75
|
+
// res.setHeader('Cache-Control', 'public, max-age=31536000');
|
|
76
|
+
res.end("OK");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
71
79
|
next();
|
|
72
80
|
});
|
|
73
81
|
(0, middlewares_1.registerOmniaMiddleware)(server, hosting.hmr);
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
|
+
const doc_1 = require("../tasks/doc");
|
|
6
|
+
function default_1(content, context) {
|
|
7
|
+
const filePath = "./" + path_1.default.relative(process.cwd(), this.resourcePath).replace(/\\/g, "/");
|
|
8
|
+
content = (0, doc_1.importSnippetCode)(content, filePath);
|
|
9
|
+
return content;
|
|
10
|
+
}
|
|
11
|
+
exports.default = default_1;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export default function (): {
|
|
2
2
|
test: RegExp;
|
|
3
3
|
use: ({
|
|
4
|
-
loader: any;
|
|
5
|
-
options?: undefined;
|
|
6
|
-
} | {
|
|
7
4
|
loader: string;
|
|
8
5
|
options: {
|
|
9
6
|
loader: string;
|
|
10
7
|
target: string;
|
|
8
|
+
tsconfigRaw: {
|
|
9
|
+
compilerOptions: {
|
|
10
|
+
jsx: string;
|
|
11
|
+
target: string;
|
|
12
|
+
useDefineForClassFields: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
11
15
|
};
|
|
16
|
+
} | {
|
|
17
|
+
loader: any;
|
|
18
|
+
options?: undefined;
|
|
12
19
|
})[];
|
|
13
20
|
}[];
|
|
@@ -7,15 +7,22 @@ function default_1() {
|
|
|
7
7
|
return [{
|
|
8
8
|
test: /\.ts$/,
|
|
9
9
|
use: [
|
|
10
|
-
{
|
|
11
|
-
loader: path.resolve(__dirname, $.isExtensionEnv ? './esbuild-custom-loader.js' : './esbuild-custom-loader.ts'),
|
|
12
|
-
},
|
|
13
10
|
{
|
|
14
11
|
loader: 'esbuild-loader',
|
|
15
12
|
options: {
|
|
16
13
|
loader: 'ts',
|
|
17
|
-
target: '
|
|
14
|
+
target: 'es2020',
|
|
15
|
+
tsconfigRaw: {
|
|
16
|
+
compilerOptions: {
|
|
17
|
+
jsx: "preserve",
|
|
18
|
+
target: "es2020",
|
|
19
|
+
useDefineForClassFields: false
|
|
20
|
+
}
|
|
21
|
+
}
|
|
18
22
|
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
loader: path.resolve(__dirname, $.isExtensionEnv ? './doc-loader.js' : './doc-loader.ts'),
|
|
19
26
|
}
|
|
20
27
|
]
|
|
21
28
|
}];
|
|
@@ -14,6 +14,16 @@ export default function (): {
|
|
|
14
14
|
loader: string;
|
|
15
15
|
target: string;
|
|
16
16
|
jsx: string;
|
|
17
|
+
tsconfigRaw: {
|
|
18
|
+
compilerOptions: {
|
|
19
|
+
jsx: string;
|
|
20
|
+
target: string;
|
|
21
|
+
useDefineForClassFields: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
17
24
|
};
|
|
25
|
+
} | {
|
|
26
|
+
loader: any;
|
|
27
|
+
options?: undefined;
|
|
18
28
|
})[];
|
|
19
29
|
}[];
|
|
@@ -51,9 +51,19 @@ function default_1() {
|
|
|
51
51
|
loader: 'esbuild-loader',
|
|
52
52
|
options: {
|
|
53
53
|
loader: 'tsx',
|
|
54
|
-
target: '
|
|
55
|
-
jsx: 'preserve'
|
|
54
|
+
target: 'es2020',
|
|
55
|
+
jsx: 'preserve',
|
|
56
|
+
tsconfigRaw: {
|
|
57
|
+
compilerOptions: {
|
|
58
|
+
jsx: "preserve",
|
|
59
|
+
target: "es2020",
|
|
60
|
+
useDefineForClassFields: false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
56
63
|
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
loader: path.resolve(__dirname, $.isExtensionEnv ? './wc-loader.js' : './wc-loader.ts'),
|
|
57
67
|
}
|
|
58
68
|
];
|
|
59
69
|
return [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (content: any, context: any): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
5
|
+
const shared_1 = require("../shared");
|
|
6
|
+
function default_1(content, context) {
|
|
7
|
+
const filePath = "./" + path_1.default.relative(process.cwd(), this.resourcePath).replace(/\\/g, "/");
|
|
8
|
+
content = (0, shared_1.modifyComponent)(content, filePath);
|
|
9
|
+
return content;
|
|
10
|
+
}
|
|
11
|
+
exports.default = default_1;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnia/tooling-vue",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.28-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.
|
|
23
|
-
"@omnia/tooling-composers": "8.0.
|
|
22
|
+
"@omnia/fx-models": "8.0.28-dev",
|
|
23
|
+
"@omnia/tooling-composers": "8.0.28-dev",
|
|
24
24
|
"@types/mousetrap": "1.5.34",
|
|
25
25
|
"@types/quill": "1.3.6",
|
|
26
26
|
"@types/zepto": "1.0.29",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"console-timestamp": "0.3.0",
|
|
33
33
|
"css-loader": "5.0.1",
|
|
34
34
|
"file-loader": "6.2.0",
|
|
35
|
+
"json-parse-better-errors": "1.0.2",
|
|
35
36
|
"null-loader": "4.0.1",
|
|
36
37
|
"terser": "5.17.1",
|
|
37
38
|
"less-loader": "10.2.0",
|
|
@@ -56,10 +57,11 @@
|
|
|
56
57
|
"es6-promise": "4.2.4",
|
|
57
58
|
"hash-sum": "1.0.2",
|
|
58
59
|
"lodash": "4.17.21",
|
|
59
|
-
"vite": "4.
|
|
60
|
-
"vite-plugin-inspect": "0.7.
|
|
60
|
+
"vite": "4.4.1",
|
|
61
|
+
"vite-plugin-inspect": "0.7.32",
|
|
61
62
|
"appdata-path": "1.0.0",
|
|
62
|
-
"json-parse-better-errors": "1.0.2"
|
|
63
|
+
"json-parse-better-errors": "1.0.2",
|
|
64
|
+
"url": "0.11.0"
|
|
63
65
|
},
|
|
64
66
|
"bugs": {
|
|
65
67
|
"url": "https://github.com/preciofishbone/OmniaFx/issues"
|