@omnia/tooling-vue 8.0.40-vnext → 8.0.41-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.
Files changed (36) hide show
  1. package/internal-do-not-import-from-here/config/omnia.vendor.manifest.json +1 -1
  2. package/internal-do-not-import-from-here/config/tooling.output.json +1 -0
  3. package/internal-do-not-import-from-here/config/wctypings.d.ts +2374 -0
  4. package/internal-do-not-import-from-here/index.d.ts +3 -1
  5. package/internal-do-not-import-from-here/index.js +6 -2
  6. package/internal-do-not-import-from-here/shared.d.ts +31 -118
  7. package/internal-do-not-import-from-here/shared.js +95 -153
  8. package/internal-do-not-import-from-here/tasks/ComponentDocRegistrations.js +1 -1
  9. package/internal-do-not-import-from-here/tasks/bundle.d.ts +2 -3
  10. package/internal-do-not-import-from-here/tasks/bundle.js +145 -360
  11. package/internal-do-not-import-from-here/tasks/doc.d.ts +3 -1
  12. package/internal-do-not-import-from-here/tasks/doc.js +282 -395
  13. package/internal-do-not-import-from-here/tasks/vendor.js +5 -3
  14. package/internal-do-not-import-from-here/variables.d.ts +1 -1
  15. package/internal-do-not-import-from-here/variables.js +2 -2
  16. package/internal-do-not-import-from-here/vite/hmr/graph.js +4 -0
  17. package/internal-do-not-import-from-here/vite/hmr/runtime.js +3 -3
  18. package/internal-do-not-import-from-here/vite/hmr/utils/webpack.js +2 -2
  19. package/internal-do-not-import-from-here/vite/middlewares/HmrMiddleware.js +2 -2
  20. package/internal-do-not-import-from-here/vite/middlewares/OmniaMiddleware.js +12 -7
  21. package/internal-do-not-import-from-here/vite/plugins/OmniaPlugin.js +1 -1
  22. package/internal-do-not-import-from-here/wctypings.ts +0 -0
  23. package/internal-do-not-import-from-here/webpack-loaders/doc-loader.js +11 -0
  24. package/internal-do-not-import-from-here/webpack-loaders/ts-loader.d.ts +3 -3
  25. package/internal-do-not-import-from-here/webpack-loaders/ts-loader.js +3 -3
  26. package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.d.ts +3 -0
  27. package/internal-do-not-import-from-here/webpack-loaders/tsx-loader.js +3 -0
  28. package/internal-do-not-import-from-here/webpack-loaders/wc-loader.d.ts +1 -0
  29. package/internal-do-not-import-from-here/webpack-loaders/wc-loader.js +11 -0
  30. package/package.json +6 -5
  31. package/internal-do-not-import-from-here/bb000000-0000-bbbb-0000-0000000000bb.wctypings.d.ts +0 -477
  32. package/internal-do-not-import-from-here/webpack-loaders/esbuild-custom-loader.js +0 -13
  33. package/internal-do-not-import-from-here/webpack-loaders/wcmanifest-loader.d.ts +0 -1
  34. package/internal-do-not-import-from-here/webpack-loaders/wcmanifest-loader.js +0 -10
  35. /package/internal-do-not-import-from-here/{bb000000-0000-bbbb-0000-0000000000bb.wctypings.js → config/wctypings.js} +0 -0
  36. /package/internal-do-not-import-from-here/webpack-loaders/{esbuild-custom-loader.d.ts → doc-loader.d.ts} +0 -0
@@ -186,15 +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/lv.js",
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
196
  "dayjs/locale/nb.js",
197
197
  "dayjs/locale/fi.js",
198
+ "dayjs/locale/es.js",
199
+ "dayjs/locale/nl.js",
198
200
  "./wwwroot/scripts/zepto.extras.js",
199
201
  // "@material/material-color-utilities"
200
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 = [
@@ -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;
@@ -45,7 +45,7 @@ function setupHmrPlugin(options, config) {
45
45
  const resolvers = config.resolvers.filter(item => !!item);
46
46
  const omniaPackagesPathPattern = (0, vite_1.normalizePath)(path_1.default.join(utils_1.envUtils.getRootDirPath(), 'node_modules/@omnia/*/*').replace(/\\/g, '/'));
47
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 { dependencies, devDependencies } = require(path_1.default.join(utils_1.envUtils.getRootDirPath(), 'package.json'));
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
  },
@@ -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, false, option);
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, false, option);
29
+ let config = bundler.createVueWebpackConfig(entry, entries, outputDir, option);
30
30
  config.stats = 'errors-only';
31
31
  config.watchOptions = {
32
32
  aggregateTimeout: 200
@@ -339,7 +339,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function () {
339
339
  }
340
340
 
341
341
  ${fromWorker ?
342
- `const { href } = new URL('${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}${fromWorker ? `?${utils_1.pathUtils.WORKER_IDENTIFIER}` : ''}', location.href);
342
+ `const { href } = new URL('${host}${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}?${utils_1.pathUtils.WORKER_IDENTIFIER}', location.href);
343
343
  __shimport__.load(href).then(function () {
344
344
  if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
345
345
  preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
@@ -348,7 +348,7 @@ omniaLoader['${serviceId}']['${resourceId}'] = function () {
348
348
  omniaWebpackJsonp['${serviceId}']['${resourceId}'] = require;
349
349
  resolveManifest();
350
350
  });` :
351
- `import('${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}${fromWorker ? `?${utils_1.pathUtils.WORKER_IDENTIFIER}` : ''}').then(function () {
351
+ `import('${utils_1.pathUtils.HMR_ESM_REQUEST}/${resourceId}').then(function () {
352
352
  if (omniaWebpackJsonp['${serviceId}']['${resourceId}']) {
353
353
  preBundleWebpackRequire = omniaWebpackJsonp['${serviceId}']['${resourceId}'];
354
354
  }
@@ -95,13 +95,18 @@ function isLocalizeManifestFile(filePath) {
95
95
  return content.indexOf(".registerLocalization") > -1;
96
96
  }
97
97
  function rebuildLocalization(filePath) {
98
- $.tooling.composer.processManifests([filePath]);
99
- let localizeObject = $.composers.getLocalizations();
100
- const payLoad = {
101
- type: fx_models_1.LocalServingMessageType.LocalizeChanged,
102
- data: localizeObject
103
- };
104
- _server.ws.send(payLoad);
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
+ }
105
110
  }
106
111
  function rebuildManifests() {
107
112
  tooling_1.utils.timeWatch("omniamiddleware_watchmanifest", () => {
@@ -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',
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,9 +1,6 @@
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;
@@ -16,5 +13,8 @@ export default function (): {
16
13
  };
17
14
  };
18
15
  };
16
+ } | {
17
+ loader: any;
18
+ options?: undefined;
19
19
  })[];
20
20
  }[];
@@ -7,9 +7,6 @@ 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: {
@@ -23,6 +20,9 @@ function default_1() {
23
20
  }
24
21
  }
25
22
  },
23
+ },
24
+ {
25
+ loader: path.resolve(__dirname, $.isExtensionEnv ? './doc-loader.js' : './doc-loader.ts'),
26
26
  }
27
27
  ]
28
28
  }];
@@ -22,5 +22,8 @@ export default function (): {
22
22
  };
23
23
  };
24
24
  };
25
+ } | {
26
+ loader: any;
27
+ options?: undefined;
25
28
  })[];
26
29
  }[];
@@ -61,6 +61,9 @@ function default_1() {
61
61
  }
62
62
  }
63
63
  },
64
+ },
65
+ {
66
+ loader: path.resolve(__dirname, $.isExtensionEnv ? './wc-loader.js' : './wc-loader.ts'),
64
67
  }
65
68
  ];
66
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.40-vnext",
4
+ "version": "8.0.41-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.40-vnext",
23
- "@omnia/tooling-composers": "8.0.40-vnext",
22
+ "@omnia/fx-models": "8.0.41-dev",
23
+ "@omnia/tooling-composers": "8.0.41-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,8 +57,8 @@
56
57
  "es6-promise": "4.2.4",
57
58
  "hash-sum": "1.0.2",
58
59
  "lodash": "4.17.21",
59
- "vite": "4.3.9",
60
- "vite-plugin-inspect": "0.7.23",
60
+ "vite": "4.4.1",
61
+ "vite-plugin-inspect": "0.7.32",
61
62
  "appdata-path": "1.0.0",
62
63
  "json-parse-better-errors": "1.0.2",
63
64
  "url": "0.11.0"