@omnia/tooling-vue 8.0.0-vnext → 8.0.1-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 +2045 -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 -127
- package/internal-do-not-import-from-here/shared.js +97 -207
- 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 +293 -347
- 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/tsc.js +1 -0
- 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 +6 -7
- package/internal-do-not-import-from-here/vite/hmr/runtime.js +5 -5
- package/internal-do-not-import-from-here/vite/hmr/transformers/importPath.js +9 -5
- package/internal-do-not-import-from-here/vite/hmr/transformers/internal/dynamicBundle.js +64 -24
- package/internal-do-not-import-from-here/vite/hmr/transformers/vendorImportPath.d.ts +4 -0
- package/internal-do-not-import-from-here/vite/hmr/transformers/vendorImportPath.js +2 -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 +8 -3
- package/internal-do-not-import-from-here/vite/hmr/vueJsx.js +1 -1
- package/internal-do-not-import-from-here/vite/index.js +4 -0
- package/internal-do-not-import-from-here/vite/middlewares/HmrMiddleware.js +8 -14
- 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 +38 -20
- 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 +14 -10
- 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 -261
- 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
|
@@ -76,7 +76,7 @@ function transformVueJsx(code, id) {
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
else if (isDefineComponentCall(node.declaration)
|
|
79
|
+
else if (isDefineComponentCall(node.declaration)) {
|
|
80
80
|
hasDefault = true;
|
|
81
81
|
hotComponents.push({
|
|
82
82
|
local: '__default__',
|
|
@@ -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,
|
|
@@ -65,7 +65,6 @@ function registerHmrMiddleware(server) {
|
|
|
65
65
|
console.error(message);
|
|
66
66
|
}
|
|
67
67
|
else if (resourceId == fx_models_1.OmniaResourceManifests.Vendor.toString() ||
|
|
68
|
-
resourceId == fx_models_1.OmniaResourceManifests.HMR.toString() ||
|
|
69
68
|
resourceId == fx_models_1.OmniaResourceManifests.FxWorkers.toString()) {
|
|
70
69
|
const serviceId = $.tooling.composer.getServiceId();
|
|
71
70
|
const bundleDirPath = utils_1.envUtils.getBundleOutputDirPath();
|
|
@@ -120,7 +119,9 @@ function registerHmrMiddleware(server) {
|
|
|
120
119
|
//res.end(content);
|
|
121
120
|
}
|
|
122
121
|
else if (ext === "css") {
|
|
123
|
-
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)`;
|
|
124
125
|
// req.url = `/omnia/dist/hmr/bundles/${bundleFileName}`;
|
|
125
126
|
// console.log("Hmr middleware", req.url)
|
|
126
127
|
// next();
|
|
@@ -291,12 +292,7 @@ const manifestResolvePromise = new Promise(function (resolve) {
|
|
|
291
292
|
resolveManifest = resolve;
|
|
292
293
|
});
|
|
293
294
|
|
|
294
|
-
omniaLoader['${serviceId}']['${resourceId}'] = function (
|
|
295
|
-
if (preBundle && !preBundleLoader) {
|
|
296
|
-
preBundleLoader = preBundle;
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
|
|
295
|
+
omniaLoader['${serviceId}']['${resourceId}'] = function () {
|
|
300
296
|
if (triggered) {
|
|
301
297
|
return manifestResolvePromise;
|
|
302
298
|
}
|
|
@@ -324,8 +320,8 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
324
320
|
|
|
325
321
|
// pre-bundle exports
|
|
326
322
|
let preBundleWebpackRequire;
|
|
327
|
-
if (
|
|
328
|
-
|
|
323
|
+
if (typeof hmrPreBundle === "function") {
|
|
324
|
+
hmrPreBundle();
|
|
329
325
|
}
|
|
330
326
|
|
|
331
327
|
function require(moduleId) {
|
|
@@ -343,7 +339,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
343
339
|
}
|
|
344
340
|
|
|
345
341
|
${fromWorker ?
|
|
346
|
-
`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);
|
|
347
343
|
__shimport__.load(href).then(function () {
|
|
348
344
|
if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
|
|
349
345
|
preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
|
|
@@ -352,7 +348,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
352
348
|
omniaWebpackJsonp['${serviceId}']['${resourceId}'] = require;
|
|
353
349
|
resolveManifest();
|
|
354
350
|
});` :
|
|
355
|
-
`import('${
|
|
351
|
+
`import('${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}').then(function () {
|
|
356
352
|
if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
|
|
357
353
|
preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
|
|
358
354
|
}
|
|
@@ -363,9 +359,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function (preBundle) {
|
|
|
363
359
|
|
|
364
360
|
return manifestResolvePromise;
|
|
365
361
|
}
|
|
366
|
-
|
|
367
362
|
${preBundleContent}
|
|
368
|
-
|
|
369
363
|
${forGroupManifest ? 'return manifestResolvePromise;' : `${$.composers.LoadableManifestRegistry.isDefineWithNoDependency(resourceId) ? `omniaLoader['${serviceId}']['${resourceId}']();` : ''}`}
|
|
370
364
|
`;
|
|
371
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();
|
|
@@ -6,9 +6,29 @@ const tooling_1 = require("@omnia/tooling");
|
|
|
6
6
|
const $ = tslib_1.__importStar(require("../../variables"));
|
|
7
7
|
const fx_models_1 = require("@omnia/fx-models");
|
|
8
8
|
const shared_1 = require("./shared");
|
|
9
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
9
10
|
function registerStaticFileMiddleware(server) {
|
|
10
|
-
server.middlewares.use(function (req, res, next) {
|
|
11
|
-
if (req.url.indexOf('/
|
|
11
|
+
server.middlewares.use(async function (req, res, next) {
|
|
12
|
+
if (req.url.indexOf('/api/uxdocs') === 0) {
|
|
13
|
+
if (req.method === "OPTIONS") {
|
|
14
|
+
res.end("OK");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const rawReqToString = async (req) => {
|
|
18
|
+
const buffers = [];
|
|
19
|
+
for await (const chunk of req) {
|
|
20
|
+
buffers.push(chunk);
|
|
21
|
+
}
|
|
22
|
+
return Buffer.concat(buffers).toString();
|
|
23
|
+
};
|
|
24
|
+
const jsonString = await rawReqToString(req);
|
|
25
|
+
const jsonObject = JSON.parse(jsonString);
|
|
26
|
+
const fileUrl = `wwwroot/docs/${jsonObject.relativePath}`;
|
|
27
|
+
console.log(fileUrl);
|
|
28
|
+
const content = fs_1.default.readFileSync(fileUrl, 'utf8');
|
|
29
|
+
res.end(content);
|
|
30
|
+
}
|
|
31
|
+
else if (req.url.indexOf('/omnia/fonts/') === 0 || req.url.indexOf('/omnia/images/') === 0) {
|
|
12
32
|
res.setHeader('Cache-Control', 'public, max-age=31536000');
|
|
13
33
|
req.url = req.url.replace("/omnia/", "/omnia/dist/");
|
|
14
34
|
next();
|
|
@@ -28,15 +48,16 @@ function registerStaticFileMiddleware(server) {
|
|
|
28
48
|
res.setHeader('content-type', 'application/x-javascript');
|
|
29
49
|
let localizeObject = $.composers.getLocalizations();
|
|
30
50
|
res.end(`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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, "\\\\\"")}');
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
localizeStore.actions.merge(loc['en-us'] || {}); // add default english
|
|
60
|
+
localizeStore.actions.merge(loc[currentCulture] || {});
|
|
40
61
|
`);
|
|
41
62
|
}
|
|
42
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, '');
|
|
@@ -17,30 +17,26 @@ function omniaPlugin(options) {
|
|
|
17
17
|
// 'vue-tsx-support/lib/vca': 'vue-tsx-support/dist/esm/vca.js',
|
|
18
18
|
// 'vue-tsx-support/lib/api': 'vue-tsx-support/dist/esm/api.js',
|
|
19
19
|
'csx': 'csx/lib.es2015/index.js',
|
|
20
|
-
'vue': 'vue/dist/vue.esm-bundler.js',
|
|
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
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
|
-
'tiptap': 'tiptap/dist/
|
|
27
|
-
'tiptap
|
|
28
|
-
'tiptap
|
|
29
|
-
'tiptap
|
|
30
|
-
'
|
|
31
|
-
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'prosemirror-
|
|
35
|
-
'prosemirror-
|
|
36
|
-
'prosemirror-
|
|
37
|
-
'prosemirror-
|
|
38
|
-
'prosemirror-
|
|
39
|
-
'prosemirror-
|
|
40
|
-
'prosemirror-gapcursor': 'prosemirror-gapcursor/dist/index.js',
|
|
41
|
-
'prosemirror-keymap': 'prosemirror-keymap/dist/keymap.js',
|
|
42
|
-
'prosemirror-inputrules': 'prosemirror-inputrules/dist/index.js',
|
|
43
|
-
'prosemirror-schema-list': 'prosemirror-schema-list/dist/schema-list.js'
|
|
26
|
+
// '@tiptap/core': '@tiptap/core/dist/index.js',
|
|
27
|
+
// '@tiptap/pm/state': '@tiptap/pm/state/dist/index.js',
|
|
28
|
+
// '@tiptap/pm/tables': '@tiptap/pm/tabels/dist/index.js',
|
|
29
|
+
// '@tiptap/pm/view': '@tiptap/pm/view/dist/index.js',
|
|
30
|
+
// '@tiptap/pm/commands': '@tiptap/pm/commands/dist/index.js',
|
|
31
|
+
// "@tiptap/pm/model": '@tiptap/pm/model/dist/index.js',
|
|
32
|
+
// '@tiptap/suggestion': '@tiptap/suggestion/dist/index.js',
|
|
33
|
+
// '@tiptap/extension-history': '@tiptap/extension-history/dist/index.js',
|
|
34
|
+
// 'prosemirror-model': 'prosemirror-model/dist/index.js',
|
|
35
|
+
// 'prosemirror-state': 'prosemirror-state/dist/index.js',
|
|
36
|
+
// 'prosemirror-transform': 'prosemirror-transform/dist/index.js',
|
|
37
|
+
// 'prosemirror-history': 'prosemirror-history/dist/index.js',
|
|
38
|
+
// 'prosemirror-view': 'prosemirror-view/dist/index.js',
|
|
39
|
+
// 'prosemirror-tables': 'prosemirror-tables/dist/index.js',
|
|
44
40
|
},
|
|
45
41
|
resolvers: [
|
|
46
42
|
(0, hmr_1.tsPathResolver)()
|
|
@@ -48,7 +44,21 @@ function omniaPlugin(options) {
|
|
|
48
44
|
transformers: [
|
|
49
45
|
(0, hmr_1.vendorImportPath)([
|
|
50
46
|
{ from: 'vue-tsx-support/enable-check', ignore: true },
|
|
51
|
-
])
|
|
47
|
+
]),
|
|
48
|
+
(0, hmr_1.defineTransformer)("omnia-rtf", (replacers) => {
|
|
49
|
+
return (0, hmr_1.createTransformer)(replacers, "omniaWebpackJsonp['bb000000-0000-bbbb-0000-0000000000bb']['e32e367c-d09c-4088-90a8-fd6a1e0352c7']");
|
|
50
|
+
})([
|
|
51
|
+
{ from: '@tiptap/core', to: "@tiptap/core/dist/index.js" },
|
|
52
|
+
{ from: '@tiptap/pm/state', to: "@tiptap/pm/state/dist/index.js" },
|
|
53
|
+
{ from: '@tiptap/pm/view', to: "@tiptap/pm/view/dist/index.js" },
|
|
54
|
+
{ from: '@tiptap/pm/commands', to: "@tiptap/pm/commands/dist/index.js" },
|
|
55
|
+
{ from: 'prosemirror-model', to: "prosemirror-model/dist/index.js" },
|
|
56
|
+
{ from: 'prosemirror-state', to: "prosemirror-state/dist/index.js" },
|
|
57
|
+
{ from: 'prosemirror-transform', to: "prosemirror-transform/dist/index.js" },
|
|
58
|
+
{ from: 'prosemirror-keymap', to: "prosemirror-keymap/dist/index.js" },
|
|
59
|
+
{ from: 'prosemirror-view', to: "prosemirror-view/dist/index.js" },
|
|
60
|
+
{ from: 'orderedmap', to: "orderedmap/dist/index.js" },
|
|
61
|
+
]),
|
|
52
62
|
]
|
|
53
63
|
});
|
|
54
64
|
const omniaPlugin = {
|
|
@@ -57,7 +67,15 @@ function omniaPlugin(options) {
|
|
|
57
67
|
server.middlewares.use(async (req, res, next) => {
|
|
58
68
|
res.setHeader('Access-Control-Allow-Origin', req.headers['origin'] || '*');
|
|
59
69
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
70
|
+
res.setHeader('Access-Control-Request-Private-Network', 'true');
|
|
71
|
+
res.setHeader('Access-Control-Request-Method', '*');
|
|
60
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
|
+
}
|
|
61
79
|
next();
|
|
62
80
|
});
|
|
63
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
|
-
export default function (
|
|
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
|
}[];
|
|
@@ -3,26 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const $ = tslib_1.__importStar(require("../variables"));
|
|
5
5
|
var path = require('path');
|
|
6
|
-
function default_1(
|
|
7
|
-
var tsLoaderOptions = {
|
|
8
|
-
happyPackMode: true,
|
|
9
|
-
transpileOnly: true
|
|
10
|
-
};
|
|
11
|
-
if (treeshaking) {
|
|
12
|
-
tsLoaderOptions.configFile = path.resolve(__dirname, "../config/tsconfig.es2015.json");
|
|
13
|
-
}
|
|
6
|
+
function default_1() {
|
|
14
7
|
return [{
|
|
15
8
|
test: /\.ts$/,
|
|
16
9
|
use: [
|
|
17
|
-
{
|
|
18
|
-
loader: path.resolve(__dirname, $.isExtensionEnv ? './esbuild-custom-loader.js' : './esbuild-custom-loader.ts'),
|
|
19
|
-
},
|
|
20
10
|
{
|
|
21
11
|
loader: 'esbuild-loader',
|
|
22
12
|
options: {
|
|
23
13
|
loader: 'ts',
|
|
24
|
-
target: '
|
|
14
|
+
target: 'es2020',
|
|
15
|
+
tsconfigRaw: {
|
|
16
|
+
compilerOptions: {
|
|
17
|
+
jsx: "preserve",
|
|
18
|
+
target: "es2020",
|
|
19
|
+
useDefineForClassFields: false
|
|
20
|
+
}
|
|
21
|
+
}
|
|
25
22
|
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
loader: path.resolve(__dirname, $.isExtensionEnv ? './doc-loader.js' : './doc-loader.ts'),
|
|
26
26
|
}
|
|
27
27
|
]
|
|
28
28
|
}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function (
|
|
1
|
+
export default function (): {
|
|
2
2
|
test: RegExp;
|
|
3
3
|
exclude: RegExp;
|
|
4
4
|
use: ({
|
|
@@ -14,6 +14,16 @@ export default function (treeshaking: any, wcDomProps: any, hotModuleReload?: an
|
|
|
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
|
}[];
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
var path = require('path');
|
|
5
5
|
const $ = tslib_1.__importStar(require("../variables"));
|
|
6
|
-
function default_1(
|
|
6
|
+
function default_1() {
|
|
7
7
|
const babelLoaderOptions = {
|
|
8
8
|
cacheDirectory: true,
|
|
9
9
|
plugins: [
|
|
@@ -21,46 +21,51 @@ function default_1(treeshaking, wcDomProps, hotModuleReload) {
|
|
|
21
21
|
],
|
|
22
22
|
]
|
|
23
23
|
};
|
|
24
|
-
var tsLoaderOptions = {
|
|
25
|
-
happyPackMode: true,
|
|
26
|
-
transpileOnly: true
|
|
27
|
-
};
|
|
28
|
-
if (treeshaking) {
|
|
29
|
-
tsLoaderOptions.configFile = path.resolve(__dirname, "../config/tsconfig.es2015.json");
|
|
30
|
-
}
|
|
31
24
|
let loaders = [
|
|
32
|
-
//{
|
|
33
|
-
// loader: 'thread-loader',
|
|
34
|
-
// options: {
|
|
35
|
-
// workers: require('os').cpus().length,
|
|
36
|
-
// },
|
|
37
|
-
//},
|
|
38
25
|
{
|
|
39
26
|
loader: 'babel-loader',
|
|
40
27
|
options: babelLoaderOptions
|
|
41
28
|
},
|
|
42
|
-
//{
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
29
|
+
// {
|
|
30
|
+
// loader: "swc-loader",
|
|
31
|
+
// options: {
|
|
32
|
+
// jsc: {
|
|
33
|
+
// // parser: {
|
|
34
|
+
// // syntax: "typescript"
|
|
35
|
+
// // }
|
|
36
|
+
// // This makes swc-loader invoke swc synchronously.
|
|
37
|
+
// //sync: true,
|
|
38
|
+
// parser: {
|
|
39
|
+
// // "syntax": "ecmascript",
|
|
40
|
+
// // "jsx": true
|
|
41
|
+
// "syntax": "typescript",
|
|
42
|
+
// "tsx": true,
|
|
43
|
+
// },
|
|
44
|
+
// experimental: {
|
|
45
|
+
// plugins: [["swc-plugin-vue-jsx", {}]]
|
|
46
|
+
// }
|
|
47
|
+
// }
|
|
48
|
+
// }
|
|
49
|
+
// },
|
|
46
50
|
{
|
|
47
51
|
loader: 'esbuild-loader',
|
|
48
52
|
options: {
|
|
49
53
|
loader: 'tsx',
|
|
50
|
-
target: '
|
|
51
|
-
jsx: 'preserve'
|
|
54
|
+
target: 'es2020',
|
|
55
|
+
jsx: 'preserve',
|
|
56
|
+
tsconfigRaw: {
|
|
57
|
+
compilerOptions: {
|
|
58
|
+
jsx: "preserve",
|
|
59
|
+
target: "es2020",
|
|
60
|
+
useDefineForClassFields: false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
52
63
|
},
|
|
53
64
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// }
|
|
65
|
+
{
|
|
66
|
+
loader: path.resolve(__dirname, $.isExtensionEnv ? './wc-loader.js' : './wc-loader.ts'),
|
|
67
|
+
}
|
|
58
68
|
];
|
|
59
|
-
if (hotModuleReload) {
|
|
60
|
-
loaders.push({
|
|
61
|
-
loader: path.resolve(__dirname, __dirname, $.isExtensionEnv ? './vue-tsx-hot-loader.js' : './vue-tsx-hot-loader.ts'),
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
69
|
return [
|
|
65
70
|
{
|
|
66
71
|
test: /\.tsx$/,
|
|
@@ -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;
|