@omnia/tooling-vue 8.0.19-vnext → 8.0.20-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 +2213 -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 +12 -8
- 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 -353
- 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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.registerWebComponentDefinitions = exports.registerManifestsReference = void 0;
|
|
3
|
+
exports.registerWebComponentDefinitions = exports.registerOutputInfo = exports.registerManifestsReference = void 0;
|
|
4
4
|
var bundle_1 = require("./tasks/bundle");
|
|
5
5
|
Object.defineProperty(exports, "registerManifestsReference", { enumerable: true, get: function () { return bundle_1.registerManifestsReference; } });
|
|
6
|
-
|
|
6
|
+
var shared_1 = require("./shared");
|
|
7
|
+
Object.defineProperty(exports, "registerOutputInfo", { enumerable: true, get: function () { return shared_1.registerOutputInfo; } });
|
|
8
|
+
// will remove legacy function when update all core extension packages
|
|
9
|
+
function registerWebComponentDefinitions() { }
|
|
10
|
+
exports.registerWebComponentDefinitions = registerWebComponentDefinitions;
|
|
@@ -1,131 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
symlinks: boolean;
|
|
11
|
-
cacheWithContext: boolean;
|
|
12
|
-
descriptionFiles: string[];
|
|
13
|
-
alias: Object & {
|
|
14
|
-
[name: string]: string;
|
|
15
|
-
} & {
|
|
16
|
-
axios$: string;
|
|
17
|
-
typestyle$: string;
|
|
18
|
-
vue$: string;
|
|
19
|
-
'@microsoft/signalr': string;
|
|
1
|
+
import { WebComponentOptions } from '@omnia/tooling-composers';
|
|
2
|
+
export interface WebComponentOptionsExtends extends WebComponentOptions {
|
|
3
|
+
entryPointPath: string;
|
|
4
|
+
}
|
|
5
|
+
export type OutputInfo = {
|
|
6
|
+
wc: {
|
|
7
|
+
namespace: string;
|
|
8
|
+
mappings: {
|
|
9
|
+
[element: string]: string;
|
|
20
10
|
};
|
|
21
11
|
};
|
|
22
|
-
output: {
|
|
23
|
-
pathinfo: boolean;
|
|
24
|
-
path: any;
|
|
25
|
-
filename: string;
|
|
26
|
-
};
|
|
27
|
-
externals: (({ context, request }: {
|
|
28
|
-
context: any;
|
|
29
|
-
request: any;
|
|
30
|
-
}, callback: any) => any)[];
|
|
31
|
-
module: {
|
|
32
|
-
noParse: RegExp;
|
|
33
|
-
rules: ({
|
|
34
|
-
test: RegExp;
|
|
35
|
-
use: ({
|
|
36
|
-
loader: any;
|
|
37
|
-
options?: undefined;
|
|
38
|
-
} | {
|
|
39
|
-
loader: string;
|
|
40
|
-
options: {
|
|
41
|
-
loader: string;
|
|
42
|
-
target: string;
|
|
43
|
-
};
|
|
44
|
-
})[];
|
|
45
|
-
} | {
|
|
46
|
-
test: RegExp;
|
|
47
|
-
exclude: RegExp;
|
|
48
|
-
use: ({
|
|
49
|
-
loader: string;
|
|
50
|
-
options: {
|
|
51
|
-
cacheDirectory: boolean;
|
|
52
|
-
plugins: any[];
|
|
53
|
-
presets: string[][];
|
|
54
|
-
};
|
|
55
|
-
} | {
|
|
56
|
-
loader: string;
|
|
57
|
-
options: {
|
|
58
|
-
loader: string;
|
|
59
|
-
target: string;
|
|
60
|
-
jsx: string;
|
|
61
|
-
};
|
|
62
|
-
})[];
|
|
63
|
-
} | {
|
|
64
|
-
test: RegExp;
|
|
65
|
-
resolve: {
|
|
66
|
-
fullySpecified: boolean;
|
|
67
|
-
};
|
|
68
|
-
exclude?: undefined;
|
|
69
|
-
use?: undefined;
|
|
70
|
-
loader?: undefined;
|
|
71
|
-
} | {
|
|
72
|
-
test: RegExp;
|
|
73
|
-
exclude: RegExp;
|
|
74
|
-
use: {
|
|
75
|
-
loader: string;
|
|
76
|
-
options: {
|
|
77
|
-
cacheDirectory: boolean;
|
|
78
|
-
plugins: string[];
|
|
79
|
-
};
|
|
80
|
-
}[];
|
|
81
|
-
resolve?: undefined;
|
|
82
|
-
loader?: undefined;
|
|
83
|
-
} | {
|
|
84
|
-
test: RegExp;
|
|
85
|
-
use: string[];
|
|
86
|
-
resolve?: undefined;
|
|
87
|
-
exclude?: undefined;
|
|
88
|
-
loader?: undefined;
|
|
89
|
-
} | {
|
|
90
|
-
test: RegExp;
|
|
91
|
-
use: {
|
|
92
|
-
loader: string;
|
|
93
|
-
options: {
|
|
94
|
-
implementation: any;
|
|
95
|
-
sassOptions: {
|
|
96
|
-
indentedSyntax: boolean;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
}[];
|
|
100
|
-
resolve?: undefined;
|
|
101
|
-
exclude?: undefined;
|
|
102
|
-
loader?: undefined;
|
|
103
|
-
} | {
|
|
104
|
-
test: RegExp;
|
|
105
|
-
loader: string;
|
|
106
|
-
resolve?: undefined;
|
|
107
|
-
exclude?: undefined;
|
|
108
|
-
use?: undefined;
|
|
109
|
-
} | {
|
|
110
|
-
test: RegExp;
|
|
111
|
-
use: {
|
|
112
|
-
loader: string;
|
|
113
|
-
options: {
|
|
114
|
-
name: string;
|
|
115
|
-
outputPath: string;
|
|
116
|
-
publicPath: string;
|
|
117
|
-
};
|
|
118
|
-
}[];
|
|
119
|
-
resolve?: undefined;
|
|
120
|
-
exclude?: undefined;
|
|
121
|
-
loader?: undefined;
|
|
122
|
-
})[];
|
|
123
|
-
};
|
|
124
12
|
};
|
|
125
|
-
export declare
|
|
13
|
+
export declare const isExtensionEnv: boolean;
|
|
14
|
+
export declare function getBuildOption(): import("@omnia/tooling-composers").BuildOptions;
|
|
15
|
+
export declare function registerOutputInfo(info: OutputInfo): void;
|
|
16
|
+
export declare function modifyComponent(content: string, filePath: string): string;
|
|
17
|
+
export declare function convertManifestPathToEntryPath(pathToManifest: any, pathsInManifest: Array<string>): string[];
|
|
126
18
|
export declare const buildContext: {
|
|
127
19
|
isManifestsChanged: boolean;
|
|
128
20
|
};
|
|
129
21
|
export declare var cacheKeys: {
|
|
130
22
|
bundleManifests: string;
|
|
131
23
|
};
|
|
24
|
+
export declare class ConfigurationManager {
|
|
25
|
+
private static _webComponentTypings;
|
|
26
|
+
private static _outputInfoManagaer;
|
|
27
|
+
static get webComponentTypings(): WebComponentTypingsManagaer;
|
|
28
|
+
static get outputInfo(): OutputInfoManagaer;
|
|
29
|
+
}
|
|
30
|
+
declare class OutputInfoManagaer {
|
|
31
|
+
private filePath;
|
|
32
|
+
private _value;
|
|
33
|
+
update(value: OutputInfo): void;
|
|
34
|
+
get(): OutputInfo;
|
|
35
|
+
}
|
|
36
|
+
declare class WebComponentTypingsManagaer {
|
|
37
|
+
private filePath;
|
|
38
|
+
update(value: string): void;
|
|
39
|
+
delete(): void;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
@@ -1,207 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cacheKeys = exports.buildContext = exports.convertManifestPathToEntryPath = exports.
|
|
3
|
+
exports.ConfigurationManager = exports.cacheKeys = exports.buildContext = exports.convertManifestPathToEntryPath = exports.modifyComponent = exports.registerOutputInfo = exports.getBuildOption = exports.isExtensionEnv = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// //moduleTrace: true,
|
|
31
|
-
// //errorDetails: true
|
|
32
|
-
//},
|
|
33
|
-
//ignoreWarnings: [
|
|
34
|
-
// {
|
|
35
|
-
// module: /DEP_WEBPACK_MODULE_ID/ // A RegExp
|
|
36
|
-
// },
|
|
37
|
-
// {
|
|
38
|
-
// module: /[DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS]/ // A RegExp
|
|
39
|
-
// },
|
|
40
|
-
// (warning) => { console.log('marning', warning); return true;}
|
|
41
|
-
//],
|
|
42
|
-
optimization: Object.assign({
|
|
43
|
-
removeAvailableModules: false,
|
|
44
|
-
removeEmptyChunks: false,
|
|
45
|
-
splitChunks: false,
|
|
46
|
-
}),
|
|
47
|
-
resolve: {
|
|
48
|
-
modules: $.tooling.core.getWebpackResolveModules(),
|
|
49
|
-
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx'],
|
|
50
|
-
//extensions: ['.js', '.jsx', '.ts', '.tsx', '.html', '.vue', '.less', '.styl'],
|
|
51
|
-
symlinks: false,
|
|
52
|
-
cacheWithContext: true,
|
|
53
|
-
descriptionFiles: ['package.json'],
|
|
54
|
-
alias: Object.assign({}, $.tooling.core.getWebpackResolveAlias(), ($.composers.BuildConfigurationRegistry.getBuildOptions()?.moduleOptions?.alias || {}), {
|
|
55
|
-
'axios$': 'axios/dist/axios.js',
|
|
56
|
-
'typestyle$': 'typestyle/lib.es2015/index.js',
|
|
57
|
-
'vue$': 'vue/dist/vue.esm-bundler.js',
|
|
58
|
-
'@microsoft/signalr': '@microsoft/signalr/dist/webworker/signalr.js',
|
|
59
|
-
}),
|
|
60
|
-
//mainFields: ['main', 'browser', 'module']
|
|
61
|
-
},
|
|
62
|
-
output: {
|
|
63
|
-
pathinfo: false,
|
|
64
|
-
path: $.tooling.utils.root(bundleOutputDir),
|
|
65
|
-
filename: '[name].js'
|
|
66
|
-
},
|
|
67
|
-
externals: [
|
|
68
|
-
function ({ context, request }, callback) {
|
|
69
|
-
if (request.indexOf("node_modules") > -1 || (/\.(sass|scss|styl|less|css)$/i).test(request)) {
|
|
70
|
-
return callback(null, 'commonjs ' + request);
|
|
71
|
-
}
|
|
72
|
-
callback();
|
|
73
|
-
}
|
|
74
|
-
],
|
|
75
|
-
//optimization: {
|
|
76
|
-
// removeAvailableModules: false,
|
|
77
|
-
// removeEmptyChunks: false,
|
|
78
|
-
// splitChunks: false,
|
|
79
|
-
//},
|
|
80
|
-
module: {
|
|
81
|
-
noParse: /wwwroot(.*)/,
|
|
82
|
-
rules: [
|
|
83
|
-
//{
|
|
84
|
-
// parser: {
|
|
85
|
-
// amd: false,
|
|
86
|
-
// harmony: false
|
|
87
|
-
// }
|
|
88
|
-
//},
|
|
89
|
-
{
|
|
90
|
-
test: /\.m?js$/,
|
|
91
|
-
resolve: {
|
|
92
|
-
fullySpecified: false, // disable the behaviour
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
...(0, ts_loader_1.default)(enableTreeShaking),
|
|
96
|
-
...(0, tsx_loader_1.default)(enableTreeShaking, wcDomProps),
|
|
97
|
-
{
|
|
98
|
-
test: /\.jsx$/,
|
|
99
|
-
exclude: /(node_modules|bower_components)/,
|
|
100
|
-
use: [
|
|
101
|
-
//{
|
|
102
|
-
// loader: 'cache-loader'
|
|
103
|
-
//},
|
|
104
|
-
{
|
|
105
|
-
loader: 'babel-loader',
|
|
106
|
-
options: {
|
|
107
|
-
cacheDirectory: true,
|
|
108
|
-
//presets: ["@babel/preset-env"],
|
|
109
|
-
//presets: [["@babel/preset-env", {
|
|
110
|
-
// "targets": {
|
|
111
|
-
// "chrome": "59"
|
|
112
|
-
// }
|
|
113
|
-
//}]],
|
|
114
|
-
plugins: ["syntax-jsx", "jsx-v-model", "transform-vue-jsx"]
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
},
|
|
119
|
-
//{
|
|
120
|
-
// test: /\.vue$/,
|
|
121
|
-
// use: [
|
|
122
|
-
// {
|
|
123
|
-
// loader: 'vue-loader',
|
|
124
|
-
// options: {
|
|
125
|
-
// hotReload: false,
|
|
126
|
-
// loaders: {
|
|
127
|
-
// ts: 'ts-loader',
|
|
128
|
-
// sass: 'vue-style-loader!css-loader!sass-loader!less-loader', // <style lang="scss">
|
|
129
|
-
// }
|
|
130
|
-
// }
|
|
131
|
-
// }
|
|
132
|
-
// ]
|
|
133
|
-
//},
|
|
134
|
-
{
|
|
135
|
-
test: /\.styl$/,
|
|
136
|
-
use: [
|
|
137
|
-
//'style-loader',
|
|
138
|
-
//'css-loader',
|
|
139
|
-
'stylus-loader'
|
|
140
|
-
]
|
|
141
|
-
},
|
|
142
|
-
...($.isExtensionEnv ? [] : [{
|
|
143
|
-
test: /\.s(c|a)ss$/,
|
|
144
|
-
use: [
|
|
145
|
-
{
|
|
146
|
-
loader: 'sass-loader',
|
|
147
|
-
options: {
|
|
148
|
-
implementation: require('sass'),
|
|
149
|
-
sassOptions: {
|
|
150
|
-
//fiber: require('fibers'),
|
|
151
|
-
indentedSyntax: true
|
|
152
|
-
}
|
|
153
|
-
//fiber: require('fibers')
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
}]),
|
|
158
|
-
{
|
|
159
|
-
test: /\.less$/,
|
|
160
|
-
use: [
|
|
161
|
-
//'style-loader',
|
|
162
|
-
//'css-loader',
|
|
163
|
-
'less-loader'
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
test: /\.css$/,
|
|
168
|
-
use: [
|
|
169
|
-
//'style-loader',
|
|
170
|
-
{
|
|
171
|
-
loader: 'css-loader'
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
|
177
|
-
loader: 'url-loader'
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
test: /\.(ico|gif|png|jpe?g|svg)$/i,
|
|
181
|
-
use: [{
|
|
182
|
-
loader: 'file-loader',
|
|
183
|
-
options: {
|
|
184
|
-
name: '[name].[ext]',
|
|
185
|
-
outputPath: "../images/",
|
|
186
|
-
publicPath: '/omnia/images/'
|
|
187
|
-
}
|
|
188
|
-
}]
|
|
189
|
-
//loader: 'url-loader'
|
|
190
|
-
}
|
|
191
|
-
]
|
|
5
|
+
const globby_1 = require("globby");
|
|
6
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const fsExtra = tslib_1.__importStar(require("fs-extra"));
|
|
8
|
+
const del_1 = tslib_1.__importDefault(require("del"));
|
|
9
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
10
|
+
const tooling_composers_1 = require("@omnia/tooling-composers");
|
|
11
|
+
const _outputInfos = [];
|
|
12
|
+
const basePathProcess = process.cwd();
|
|
13
|
+
exports.isExtensionEnv = fs_1.default.existsSync(basePathProcess + "/node_modules/@omnia/tooling/package.json");
|
|
14
|
+
function getBuildOption() {
|
|
15
|
+
return tooling_composers_1.BuildConfigurationRegistry.getBuildOptions();
|
|
16
|
+
}
|
|
17
|
+
exports.getBuildOption = getBuildOption;
|
|
18
|
+
function registerOutputInfo(info) {
|
|
19
|
+
_outputInfos.push(info);
|
|
20
|
+
}
|
|
21
|
+
exports.registerOutputInfo = registerOutputInfo;
|
|
22
|
+
function modifyComponent(content, filePath) {
|
|
23
|
+
let result = content;
|
|
24
|
+
const ext = path_1.default.extname(filePath);
|
|
25
|
+
if (ext === ".tsx") {
|
|
26
|
+
result = replaceWebComponentNamespaceMapping(content);
|
|
27
|
+
const wcs = tooling_composers_1.ComponentRegistry.getComponentRegistrations();
|
|
28
|
+
if (wcs.find(wc => filePath.indexOf(wc.componentOptions.entryPointPath) > -1)) {
|
|
29
|
+
result = result.replace(/defineVueComponent/g, "defineVueWebComponent");
|
|
192
30
|
}
|
|
193
|
-
}
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
exports.modifyComponent = modifyComponent;
|
|
35
|
+
function replaceWebComponentNamespaceMapping(content) {
|
|
36
|
+
const infos = _outputInfos.concat(ConfigurationManager.outputInfo.get());
|
|
37
|
+
infos.forEach(info => {
|
|
38
|
+
if (info.wc?.namespace) {
|
|
39
|
+
content = content.replace(new RegExp(`(<|<\/|\\s)${info.wc.namespace}\\..*?(>|\\s)`, 'g'), function (match) {
|
|
40
|
+
return match.replace(new RegExp(`(${info.wc.namespace}.*)(?=(>|\\s))`), function (token) {
|
|
41
|
+
return token.replace(/(\S+)/g, function (tag) {
|
|
42
|
+
return info.wc.mappings[tag.replace(`${info.wc.namespace}.`, "")] || tag;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return content;
|
|
194
49
|
}
|
|
195
|
-
exports.getBaseWebpackConfigForManifestMetadata = getBaseWebpackConfigForManifestMetadata;
|
|
196
50
|
function convertManifestPathToEntryPath(pathToManifest, pathsInManifest) {
|
|
197
51
|
if (!pathsInManifest)
|
|
198
52
|
return [];
|
|
199
53
|
let pathsToSearch = [];
|
|
200
54
|
pathsInManifest.forEach(p => {
|
|
201
|
-
pathsToSearch.push((p[0] === '!' ? '!./' : './') + (p.indexOf("./") > -1 || p.indexOf(".\\") > -1 ?
|
|
55
|
+
pathsToSearch.push((p[0] === '!' ? '!./' : './') + (p.indexOf("./") > -1 || p.indexOf(".\\") > -1 ? path_1.default.join(pathToManifest.substring(0, pathToManifest.lastIndexOf('/')), p.replace(/^!/, '')).replace(/\\/g, "/")
|
|
202
56
|
: p.replace(/^!/, '').replace(/\\/g, "/")));
|
|
203
57
|
});
|
|
204
|
-
let result =
|
|
58
|
+
let result = (0, globby_1.globbySync)(pathsToSearch.concat(["!./**/*.manifest.+(js|ts)"]));
|
|
205
59
|
if (!result || result.length === 0) {
|
|
206
60
|
throw new Error("Path: " + pathsInManifest.join(', ') + " in manifest: " + pathToManifest + " resolved as " + result + " which was not found");
|
|
207
61
|
}
|
|
@@ -215,3 +69,54 @@ exports.cacheKeys = {
|
|
|
215
69
|
//buildManifestMetadatas: "buildManifestMetadatas",
|
|
216
70
|
bundleManifests: "bundleManifests"
|
|
217
71
|
};
|
|
72
|
+
class ConfigurationManager {
|
|
73
|
+
static get webComponentTypings() {
|
|
74
|
+
if (!this._webComponentTypings) {
|
|
75
|
+
this._webComponentTypings = new WebComponentTypingsManagaer();
|
|
76
|
+
}
|
|
77
|
+
return this._webComponentTypings;
|
|
78
|
+
}
|
|
79
|
+
static get outputInfo() {
|
|
80
|
+
if (!this._outputInfoManagaer) {
|
|
81
|
+
this._outputInfoManagaer = new OutputInfoManagaer();
|
|
82
|
+
}
|
|
83
|
+
return this._outputInfoManagaer;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
ConfigurationManager._webComponentTypings = null;
|
|
87
|
+
ConfigurationManager._outputInfoManagaer = null;
|
|
88
|
+
exports.ConfigurationManager = ConfigurationManager;
|
|
89
|
+
class OutputInfoManagaer {
|
|
90
|
+
constructor() {
|
|
91
|
+
this.filePath = exports.isExtensionEnv ? path_1.default.resolve(__dirname, "tooling.output.json") : path_1.default.resolve(__dirname, "config/tooling.output.json");
|
|
92
|
+
this._value = null;
|
|
93
|
+
}
|
|
94
|
+
update(value) {
|
|
95
|
+
fsExtra.ensureFileSync(this.filePath);
|
|
96
|
+
fsExtra.writeJsonSync(this.filePath, value);
|
|
97
|
+
}
|
|
98
|
+
get() {
|
|
99
|
+
if (this._value === null) {
|
|
100
|
+
fsExtra.ensureFileSync(this.filePath);
|
|
101
|
+
const content = fsExtra.readFileSync(this.filePath).toString();
|
|
102
|
+
this._value = content ? JSON.parse(content) : {};
|
|
103
|
+
}
|
|
104
|
+
return this._value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
class WebComponentTypingsManagaer {
|
|
108
|
+
constructor() {
|
|
109
|
+
this.filePath = exports.isExtensionEnv ? path_1.default.resolve(__dirname, "wctypings.ts") : path_1.default.resolve(__dirname, "config/wctypings.ts");
|
|
110
|
+
}
|
|
111
|
+
update(value) {
|
|
112
|
+
fsExtra.outputFileSync(this.filePath, value);
|
|
113
|
+
}
|
|
114
|
+
delete() {
|
|
115
|
+
del_1.default.sync(this.filePath);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// initial
|
|
119
|
+
if (exports.isExtensionEnv) {
|
|
120
|
+
//auto register output info from omnia
|
|
121
|
+
registerOutputInfo(fsExtra.readJSONSync(path_1.default.resolve(__dirname, "config/tooling.output.json")));
|
|
122
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "extract-doc-plugin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"keywords": ["swc-plugin"],
|
|
8
|
+
"main": "target/wasm32-wasi/release/extract_doc_plugin.wasm",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"prepublishOnly": "cargo build-wasi --release"
|
|
11
|
+
},
|
|
12
|
+
"files": [],
|
|
13
|
+
"preferUnplugged": true
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|