@servicetitan/startup 34.3.0-beta.0 → 34.3.0-beta.2
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/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +1 -0
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/core/utils/get-bundle-type.d.ts +1 -1
- package/dist/storybook-config/webpack-final.js +2 -0
- package/dist/storybook-config/webpack-final.js.map +1 -1
- package/dist/vite/base-config.d.ts.map +1 -1
- package/dist/vite/base-config.js +11 -0
- package/dist/vite/base-config.js.map +1 -1
- package/dist/webpack/create-webpack-config.d.ts.map +1 -1
- package/dist/webpack/create-webpack-config.js +0 -1
- package/dist/webpack/create-webpack-config.js.map +1 -1
- package/package.json +9 -9
- package/src/cli/commands/bundle-package.ts +3 -1
- package/src/storybook-config/__tests__/webpack-final.test.ts +3 -1
- package/src/storybook-config/webpack-final.ts +1 -1
- package/src/vite/base-config.ts +9 -0
- package/src/webpack/create-webpack-config.ts +0 -3
- package/dist/cli/tasks/swc-compile-package.js +0 -127
- package/dist/cli/tasks/swc-compile-package.js.map +0 -1
- package/dist/cli/tasks/tsc-compile-package.js +0 -46
- package/dist/cli/tasks/tsc-compile-package.js.map +0 -1
- package/dist/cli/tasks/tsc-compile.js +0 -68
- package/dist/cli/tasks/tsc-compile.js.map +0 -1
- package/dist/vite/plugins/dev-bundle-routing-plugin.d.ts +0 -7
- package/dist/vite/plugins/dev-bundle-routing-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/dev-bundle-routing-plugin.js +0 -48
- package/dist/vite/plugins/dev-bundle-routing-plugin.js.map +0 -1
- package/dist/vite/plugins/full-bundle-proxy-plugin.d.ts +0 -14
- package/dist/vite/plugins/full-bundle-proxy-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/full-bundle-proxy-plugin.js +0 -48
- package/dist/vite/plugins/full-bundle-proxy-plugin.js.map +0 -1
- package/dist/vite/plugins/outdir-rewrite-plugin.d.ts +0 -9
- package/dist/vite/plugins/outdir-rewrite-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/preview-static-files-plugin.d.ts +0 -9
- package/dist/vite/plugins/preview-static-files-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/preview-static-files-plugin.js +0 -50
- package/dist/vite/plugins/preview-static-files-plugin.js.map +0 -1
- package/dist/vite/plugins/shared-deps-dev-server-plugin.d.ts +0 -11
- package/dist/vite/plugins/shared-deps-dev-server-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/shared-deps-rewrite-plugin.d.ts +0 -10
- package/dist/vite/plugins/shared-deps-rewrite-plugin.d.ts.map +0 -1
- package/dist/vite/plugins/shared-deps-rewrite-plugin.js +0 -51
- package/dist/vite/plugins/shared-deps-rewrite-plugin.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +0 -40
- package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js +0 -37
- package/dist/webpack/configs/plugins/ignore-plugin/get-package-json.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +0 -27
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js.map +0 -1
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js +0 -15
- package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map +0 -1
- package/dist/webpack/configs/types.js +0 -6
- package/dist/webpack/configs/types.js.map +0 -1
- package/dist/webpack/configs/utils/build-metadata.js +0 -50
- package/dist/webpack/configs/utils/build-metadata.js.map +0 -1
- package/dist/webpack/configs/utils/generate-metadata.js +0 -39
- package/dist/webpack/configs/utils/generate-metadata.js.map +0 -1
- package/dist/webpack/configs/utils/get-bundle-type.js +0 -24
- package/dist/webpack/configs/utils/get-bundle-type.js.map +0 -1
- package/dist/webpack/configs/utils/get-exposed-dependencies.js +0 -21
- package/dist/webpack/configs/utils/get-exposed-dependencies.js.map +0 -1
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +0 -26
- package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +0 -1
- package/dist/webpack/configs/utils/get-web-components-version.js +0 -22
- package/dist/webpack/configs/utils/get-web-components-version.js.map +0 -1
- package/dist/webpack/configs/utils/index.js +0 -22
- package/dist/webpack/configs/utils/index.js.map +0 -1
- package/dist/webpack/utils/stringify-config.d.ts +0 -2
- package/dist/webpack/utils/stringify-config.d.ts.map +0 -1
- package/dist/webpack/utils/stringify-config.js +0 -35
- package/dist/webpack/utils/stringify-config.js.map +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "devBundleRoutingPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return devBundleRoutingPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function devBundleRoutingPlugin(redirects) {
|
|
18
|
-
const routes = redirects.map(({ outDir, port })=>({
|
|
19
|
-
prefix: '/' + _path.default.relative(process.cwd(), outDir) + '/',
|
|
20
|
-
port
|
|
21
|
-
}));
|
|
22
|
-
return {
|
|
23
|
-
name: 'dev-bundle-routing',
|
|
24
|
-
configureServer (server) {
|
|
25
|
-
server.middlewares.use((req, res, next)=>{
|
|
26
|
-
var _req_url;
|
|
27
|
-
const url = (_req_url = req.url) !== null && _req_url !== void 0 ? _req_url : '';
|
|
28
|
-
for (const { prefix, port } of routes){
|
|
29
|
-
if (url.startsWith(prefix)) {
|
|
30
|
-
if (port === undefined) {
|
|
31
|
-
req.url = '/' + url.slice(prefix.length);
|
|
32
|
-
return next();
|
|
33
|
-
}
|
|
34
|
-
const target = `http://localhost:${port}${url.slice(prefix.length - 1)}`;
|
|
35
|
-
res.writeHead(302, {
|
|
36
|
-
Location: target
|
|
37
|
-
});
|
|
38
|
-
res.end();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
next();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=dev-bundle-routing-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/dev-bundle-routing-plugin.ts"],"sourcesContent":["import path from 'path';\nimport type { Plugin } from 'vite';\n\nexport interface BundleRedirect {\n outDir: string;\n port?: number;\n}\n\nexport function devBundleRoutingPlugin(redirects: BundleRedirect[]): Plugin {\n const routes = redirects.map(({ outDir, port }) => ({\n prefix: '/' + path.relative(process.cwd(), outDir) + '/',\n port,\n }));\n\n return {\n name: 'dev-bundle-routing',\n configureServer(server) {\n server.middlewares.use((req, res, next) => {\n const url = req.url ?? '';\n\n for (const { prefix, port } of routes) {\n if (url.startsWith(prefix)) {\n if (port === undefined) {\n req.url = '/' + url.slice(prefix.length);\n return next();\n }\n const target = `http://localhost:${port}${url.slice(prefix.length - 1)}`;\n res.writeHead(302, { Location: target });\n res.end();\n return;\n }\n }\n\n next();\n });\n },\n };\n}\n"],"names":["devBundleRoutingPlugin","redirects","routes","map","outDir","port","prefix","path","relative","process","cwd","name","configureServer","server","middlewares","use","req","res","next","url","startsWith","undefined","slice","length","target","writeHead","Location","end"],"mappings":";;;;+BAQgBA;;;eAAAA;;;6DARC;;;;;;AAQV,SAASA,uBAAuBC,SAA2B;IAC9D,MAAMC,SAASD,UAAUE,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAM,CAAA;YAChDC,QAAQ,MAAMC,aAAI,CAACC,QAAQ,CAACC,QAAQC,GAAG,IAAIN,UAAU;YACrDC;QACJ,CAAA;IAEA,OAAO;QACHM,MAAM;QACNC,iBAAgBC,MAAM;YAClBA,OAAOC,WAAW,CAACC,GAAG,CAAC,CAACC,KAAKC,KAAKC;oBAClBF;gBAAZ,MAAMG,OAAMH,WAAAA,IAAIG,GAAG,cAAPH,sBAAAA,WAAW;gBAEvB,KAAK,MAAM,EAAEV,MAAM,EAAED,IAAI,EAAE,IAAIH,OAAQ;oBACnC,IAAIiB,IAAIC,UAAU,CAACd,SAAS;wBACxB,IAAID,SAASgB,WAAW;4BACpBL,IAAIG,GAAG,GAAG,MAAMA,IAAIG,KAAK,CAAChB,OAAOiB,MAAM;4BACvC,OAAOL;wBACX;wBACA,MAAMM,SAAS,CAAC,iBAAiB,EAAEnB,OAAOc,IAAIG,KAAK,CAAChB,OAAOiB,MAAM,GAAG,IAAI;wBACxEN,IAAIQ,SAAS,CAAC,KAAK;4BAAEC,UAAUF;wBAAO;wBACtCP,IAAIU,GAAG;wBACP;oBACJ;gBACJ;gBAEAT;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
|
-
export interface BundleRedirect {
|
|
3
|
-
outDir: string;
|
|
4
|
-
port?: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Web component dev mode only. Each bundle type (full, light, headless) runs its
|
|
8
|
-
* own Vite dev server. This plugin sits on the full bundle's server and proxies
|
|
9
|
-
* requests for light/headless assets to their respective servers. The full bundle's
|
|
10
|
-
* own requests (port omitted) are rewritten to strip the output path prefix and
|
|
11
|
-
* served locally.
|
|
12
|
-
*/
|
|
13
|
-
export declare function fullBundleProxyPlugin(redirects: BundleRedirect[]): Plugin;
|
|
14
|
-
//# sourceMappingURL=full-bundle-proxy-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"full-bundle-proxy-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/full-bundle-proxy-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CA6BzE"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "fullBundleProxyPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return fullBundleProxyPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
|
-
function _interop_require_default(obj) {
|
|
13
|
-
return obj && obj.__esModule ? obj : {
|
|
14
|
-
default: obj
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function fullBundleProxyPlugin(redirects) {
|
|
18
|
-
const routes = redirects.map(({ outDir, port })=>({
|
|
19
|
-
prefix: '/' + _path.default.relative(process.cwd(), outDir) + '/',
|
|
20
|
-
port
|
|
21
|
-
}));
|
|
22
|
-
return {
|
|
23
|
-
name: 'full-bundle-proxy',
|
|
24
|
-
configureServer (server) {
|
|
25
|
-
server.middlewares.use((req, res, next)=>{
|
|
26
|
-
var _req_url;
|
|
27
|
-
const url = (_req_url = req.url) !== null && _req_url !== void 0 ? _req_url : '';
|
|
28
|
-
for (const { prefix, port } of routes){
|
|
29
|
-
if (url.startsWith(prefix)) {
|
|
30
|
-
if (port === undefined) {
|
|
31
|
-
req.url = '/' + url.slice(prefix.length);
|
|
32
|
-
return next();
|
|
33
|
-
}
|
|
34
|
-
const target = `http://localhost:${port}${url.slice(prefix.length - 1)}`;
|
|
35
|
-
res.writeHead(302, {
|
|
36
|
-
Location: target
|
|
37
|
-
});
|
|
38
|
-
res.end();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
next();
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=full-bundle-proxy-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/full-bundle-proxy-plugin.ts"],"sourcesContent":["import path from 'path';\nimport type { Plugin } from 'vite';\n\nexport interface BundleRedirect {\n outDir: string;\n port?: number;\n}\n\nexport function fullBundleProxyPlugin(redirects: BundleRedirect[]): Plugin {\n const routes = redirects.map(({ outDir, port }) => ({\n prefix: '/' + path.relative(process.cwd(), outDir) + '/',\n port,\n }));\n\n return {\n name: 'full-bundle-proxy',\n configureServer(server) {\n server.middlewares.use((req, res, next) => {\n const url = req.url ?? '';\n\n for (const { prefix, port } of routes) {\n if (url.startsWith(prefix)) {\n if (port === undefined) {\n req.url = '/' + url.slice(prefix.length);\n return next();\n }\n const target = `http://localhost:${port}${url.slice(prefix.length - 1)}`;\n res.writeHead(302, { Location: target });\n res.end();\n return;\n }\n }\n\n next();\n });\n },\n };\n}\n"],"names":["fullBundleProxyPlugin","redirects","routes","map","outDir","port","prefix","path","relative","process","cwd","name","configureServer","server","middlewares","use","req","res","next","url","startsWith","undefined","slice","length","target","writeHead","Location","end"],"mappings":";;;;+BAQgBA;;;eAAAA;;;6DARC;;;;;;AAQV,SAASA,sBAAsBC,SAA2B;IAC7D,MAAMC,SAASD,UAAUE,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAM,CAAA;YAChDC,QAAQ,MAAMC,aAAI,CAACC,QAAQ,CAACC,QAAQC,GAAG,IAAIN,UAAU;YACrDC;QACJ,CAAA;IAEA,OAAO;QACHM,MAAM;QACNC,iBAAgBC,MAAM;YAClBA,OAAOC,WAAW,CAACC,GAAG,CAAC,CAACC,KAAKC,KAAKC;oBAClBF;gBAAZ,MAAMG,OAAMH,WAAAA,IAAIG,GAAG,cAAPH,sBAAAA,WAAW;gBAEvB,KAAK,MAAM,EAAEV,MAAM,EAAED,IAAI,EAAE,IAAIH,OAAQ;oBACnC,IAAIiB,IAAIC,UAAU,CAACd,SAAS;wBACxB,IAAID,SAASgB,WAAW;4BACpBL,IAAIG,GAAG,GAAG,MAAMA,IAAIG,KAAK,CAAChB,OAAOiB,MAAM;4BACvC,OAAOL;wBACX;wBACA,MAAMM,SAAS,CAAC,iBAAiB,EAAEnB,OAAOc,IAAIG,KAAK,CAAChB,OAAOiB,MAAM,GAAG,IAAI;wBACxEN,IAAIQ,SAAS,CAAC,KAAK;4BAAEC,UAAUF;wBAAO;wBACtCP,IAAIU,GAAG;wBACP;oBACJ;gBACJ;gBAEAT;YACJ;QACJ;IACJ;AACJ"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
|
-
import { BuildContext } from '../../core';
|
|
3
|
-
/**
|
|
4
|
-
* MFE dev mode only. The host requests MFE assets using the production output
|
|
5
|
-
* path (e.g. `/dist/bundle/full/@vite/client`). The dev server serves from the
|
|
6
|
-
* project root, so the output path prefix needs to be stripped.
|
|
7
|
-
*/
|
|
8
|
-
export declare function outdirRewritePlugin(context: BuildContext): Plugin[];
|
|
9
|
-
//# sourceMappingURL=outdir-rewrite-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outdir-rewrite-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/outdir-rewrite-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAsBnE"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
|
-
import type { BuildContext } from '../../core';
|
|
3
|
-
/**
|
|
4
|
-
* Prod only. The preview server serves from `build.outDir` (e.g. `dist/bundle/`)
|
|
5
|
-
* but metadata.json and other static files live in the parent destination directory
|
|
6
|
-
* (e.g. `dist/`). This plugin serves those files during preview.
|
|
7
|
-
*/
|
|
8
|
-
export declare function previewStaticFilesPlugin(context: BuildContext): Plugin[];
|
|
9
|
-
//# sourceMappingURL=preview-static-files-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-static-files-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/preview-static-files-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAmCxE"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "previewStaticFilesPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return previewStaticFilesPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function previewStaticFilesPlugin(context) {
|
|
19
|
-
if (!context.build.isProduction) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
const destDir = _path.default.resolve(context.package.destination);
|
|
23
|
-
const mountPath = '/' + _path.default.relative(process.cwd(), destDir);
|
|
24
|
-
return [
|
|
25
|
-
{
|
|
26
|
-
name: 'preview-static-files',
|
|
27
|
-
configurePreviewServer (server) {
|
|
28
|
-
server.middlewares.use(mountPath, (req, res, next)=>{
|
|
29
|
-
var _req_url;
|
|
30
|
-
const filePath = _path.default.join(destDir, (_req_url = req.url) !== null && _req_url !== void 0 ? _req_url : '');
|
|
31
|
-
if (!_fs.default.existsSync(filePath) || _fs.default.statSync(filePath).isDirectory()) {
|
|
32
|
-
return next();
|
|
33
|
-
}
|
|
34
|
-
const ext = _path.default.extname(filePath);
|
|
35
|
-
const contentTypes = {
|
|
36
|
-
'.js': 'application/javascript',
|
|
37
|
-
'.css': 'text/css',
|
|
38
|
-
'.json': 'application/json'
|
|
39
|
-
};
|
|
40
|
-
if (contentTypes[ext]) {
|
|
41
|
-
res.setHeader('Content-Type', contentTypes[ext]);
|
|
42
|
-
}
|
|
43
|
-
_fs.default.createReadStream(filePath).pipe(res);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=preview-static-files-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/preview-static-files-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport type { Plugin } from 'vite';\nimport type { BuildContext } from '../../core';\n\n/**\n * Prod only. The preview server serves from `build.outDir` (e.g. `dist/bundle/`)\n * but metadata.json and other static files live in the parent destination directory\n * (e.g. `dist/`). This plugin serves those files during preview.\n */\nexport function previewStaticFilesPlugin(context: BuildContext): Plugin[] {\n if (!context.build.isProduction) {\n return [];\n }\n\n const destDir = path.resolve(context.package.destination);\n const mountPath = '/' + path.relative(process.cwd(), destDir);\n\n return [\n {\n name: 'preview-static-files',\n configurePreviewServer(server) {\n server.middlewares.use(mountPath, (req, res, next) => {\n const filePath = path.join(destDir, req.url ?? '');\n\n if (!fs.existsSync(filePath) || fs.statSync(filePath).isDirectory()) {\n return next();\n }\n\n const ext = path.extname(filePath);\n const contentTypes: Record<string, string> = {\n '.js': 'application/javascript',\n '.css': 'text/css',\n '.json': 'application/json',\n };\n\n if (contentTypes[ext]) {\n res.setHeader('Content-Type', contentTypes[ext]);\n }\n\n fs.createReadStream(filePath).pipe(res);\n });\n },\n },\n ];\n}\n"],"names":["previewStaticFilesPlugin","context","build","isProduction","destDir","path","resolve","package","destination","mountPath","relative","process","cwd","name","configurePreviewServer","server","middlewares","use","req","res","next","filePath","join","url","fs","existsSync","statSync","isDirectory","ext","extname","contentTypes","setHeader","createReadStream","pipe"],"mappings":";;;;+BAUgBA;;;eAAAA;;;2DAVD;6DACE;;;;;;AASV,SAASA,yBAAyBC,OAAqB;IAC1D,IAAI,CAACA,QAAQC,KAAK,CAACC,YAAY,EAAE;QAC7B,OAAO,EAAE;IACb;IAEA,MAAMC,UAAUC,aAAI,CAACC,OAAO,CAACL,QAAQM,OAAO,CAACC,WAAW;IACxD,MAAMC,YAAY,MAAMJ,aAAI,CAACK,QAAQ,CAACC,QAAQC,GAAG,IAAIR;IAErD,OAAO;QACH;YACIS,MAAM;YACNC,wBAAuBC,MAAM;gBACzBA,OAAOC,WAAW,CAACC,GAAG,CAACR,WAAW,CAACS,KAAKC,KAAKC;wBACLF;oBAApC,MAAMG,WAAWhB,aAAI,CAACiB,IAAI,CAAClB,UAASc,WAAAA,IAAIK,GAAG,cAAPL,sBAAAA,WAAW;oBAE/C,IAAI,CAACM,WAAE,CAACC,UAAU,CAACJ,aAAaG,WAAE,CAACE,QAAQ,CAACL,UAAUM,WAAW,IAAI;wBACjE,OAAOP;oBACX;oBAEA,MAAMQ,MAAMvB,aAAI,CAACwB,OAAO,CAACR;oBACzB,MAAMS,eAAuC;wBACzC,OAAO;wBACP,QAAQ;wBACR,SAAS;oBACb;oBAEA,IAAIA,YAAY,CAACF,IAAI,EAAE;wBACnBT,IAAIY,SAAS,CAAC,gBAAgBD,YAAY,CAACF,IAAI;oBACnD;oBAEAJ,WAAE,CAACQ,gBAAgB,CAACX,UAAUY,IAAI,CAACd;gBACvC;YACJ;QACJ;KACH;AACL"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
|
-
import { BuildContext } from '../../core';
|
|
3
|
-
/**
|
|
4
|
-
* In dev mode, the HTML template references shared deps with paths relative to
|
|
5
|
-
* index.html's output location (e.g. `./shared/file.js`). The browser resolves
|
|
6
|
-
* these relative to the page URL at `/`, producing requests like `/shared/file.js`.
|
|
7
|
-
* The actual files are on disk at `dist/bundle/shared/`. This plugin maps those
|
|
8
|
-
* requests to the correct filesystem location.
|
|
9
|
-
*/
|
|
10
|
-
export declare function sharedDepsDevServerPlugin(context: BuildContext): Plugin;
|
|
11
|
-
//# sourceMappingURL=shared-deps-dev-server-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-deps-dev-server-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/shared-deps-dev-server-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAyCvE"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from 'vite';
|
|
2
|
-
import { BuildContext } from '../../core';
|
|
3
|
-
/**
|
|
4
|
-
* Host dev mode only. The HTML references shared deps relative to index.html's
|
|
5
|
-
* output location (e.g. `./shared/file.js`). The browser resolves these relative
|
|
6
|
-
* to the page at `/`, requesting `/shared/file.js`. The actual files are on disk
|
|
7
|
-
* at `dist/bundle/shared/`. This plugin rewrites the URL so Vite can serve them.
|
|
8
|
-
*/
|
|
9
|
-
export declare function sharedDepsRewritePlugin(context: BuildContext): Plugin[];
|
|
10
|
-
//# sourceMappingURL=shared-deps-rewrite-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared-deps-rewrite-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/shared-deps-rewrite-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CA8BvE"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "sharedDepsRewritePlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return sharedDepsRewritePlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
|
-
const _core = require("../../core");
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function sharedDepsRewritePlugin(context) {
|
|
19
|
-
if (context.build.isProduction || context.package.isWebComponent) {
|
|
20
|
-
return [];
|
|
21
|
-
}
|
|
22
|
-
const sharedDepsOutputDir = (0, _core.getOutputPath)({
|
|
23
|
-
...context,
|
|
24
|
-
options: {
|
|
25
|
-
...context.options,
|
|
26
|
-
bundlerConfig: {
|
|
27
|
-
...context.options.bundlerConfig,
|
|
28
|
-
emitExposedDependencies: true
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const urlPrefix = '/' + _path.default.basename(sharedDepsOutputDir) + '/';
|
|
33
|
-
const rewriteTo = '/' + _path.default.relative(process.cwd(), sharedDepsOutputDir) + '/';
|
|
34
|
-
return [
|
|
35
|
-
{
|
|
36
|
-
name: 'shared-deps-rewrite',
|
|
37
|
-
configureServer (server) {
|
|
38
|
-
server.middlewares.use((req, _res, next)=>{
|
|
39
|
-
var _req_url;
|
|
40
|
-
const url = (_req_url = req.url) !== null && _req_url !== void 0 ? _req_url : '';
|
|
41
|
-
if (url.startsWith(urlPrefix)) {
|
|
42
|
-
req.url = rewriteTo + url.slice(urlPrefix.length);
|
|
43
|
-
}
|
|
44
|
-
next();
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=shared-deps-rewrite-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/vite/plugins/shared-deps-rewrite-plugin.ts"],"sourcesContent":["import path from 'path';\nimport type { Plugin } from 'vite';\nimport { BuildContext, getOutputPath } from '../../core';\n\n/**\n * Host dev mode only. The HTML references shared deps relative to index.html's\n * output location (e.g. `./shared/file.js`). The browser resolves these relative\n * to the page at `/`, requesting `/shared/file.js`. The actual files are on disk\n * at `dist/bundle/shared/`. This plugin rewrites the URL so Vite can serve them.\n */\nexport function sharedDepsRewritePlugin(context: BuildContext): Plugin[] {\n if (context.build.isProduction || context.package.isWebComponent) {\n return [];\n }\n\n const sharedDepsOutputDir = getOutputPath({\n ...context,\n options: {\n ...context.options,\n bundlerConfig: { ...context.options.bundlerConfig, emitExposedDependencies: true },\n },\n });\n\n const urlPrefix = '/' + path.basename(sharedDepsOutputDir) + '/';\n const rewriteTo = '/' + path.relative(process.cwd(), sharedDepsOutputDir) + '/';\n\n return [\n {\n name: 'shared-deps-rewrite',\n configureServer(server) {\n server.middlewares.use((req, _res, next) => {\n const url = req.url ?? '';\n if (url.startsWith(urlPrefix)) {\n req.url = rewriteTo + url.slice(urlPrefix.length);\n }\n next();\n });\n },\n },\n ];\n}\n"],"names":["sharedDepsRewritePlugin","context","build","isProduction","package","isWebComponent","sharedDepsOutputDir","getOutputPath","options","bundlerConfig","emitExposedDependencies","urlPrefix","path","basename","rewriteTo","relative","process","cwd","name","configureServer","server","middlewares","use","req","_res","next","url","startsWith","slice","length"],"mappings":";;;;+BAUgBA;;;eAAAA;;;6DAVC;sBAE2B;;;;;;AAQrC,SAASA,wBAAwBC,OAAqB;IACzD,IAAIA,QAAQC,KAAK,CAACC,YAAY,IAAIF,QAAQG,OAAO,CAACC,cAAc,EAAE;QAC9D,OAAO,EAAE;IACb;IAEA,MAAMC,sBAAsBC,IAAAA,mBAAa,EAAC;QACtC,GAAGN,OAAO;QACVO,SAAS;YACL,GAAGP,QAAQO,OAAO;YAClBC,eAAe;gBAAE,GAAGR,QAAQO,OAAO,CAACC,aAAa;gBAAEC,yBAAyB;YAAK;QACrF;IACJ;IAEA,MAAMC,YAAY,MAAMC,aAAI,CAACC,QAAQ,CAACP,uBAAuB;IAC7D,MAAMQ,YAAY,MAAMF,aAAI,CAACG,QAAQ,CAACC,QAAQC,GAAG,IAAIX,uBAAuB;IAE5E,OAAO;QACH;YACIY,MAAM;YACNC,iBAAgBC,MAAM;gBAClBA,OAAOC,WAAW,CAACC,GAAG,CAAC,CAACC,KAAKC,MAAMC;wBACnBF;oBAAZ,MAAMG,OAAMH,WAAAA,IAAIG,GAAG,cAAPH,sBAAAA,WAAW;oBACvB,IAAIG,IAAIC,UAAU,CAAChB,YAAY;wBAC3BY,IAAIG,GAAG,GAAGZ,YAAYY,IAAIE,KAAK,CAACjB,UAAUkB,MAAM;oBACpD;oBACAJ;gBACJ;YACJ;QACJ;KACH;AACL"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "checkResource", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return checkResource;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _utils = require("../../../../utils");
|
|
12
|
-
const _isoptionalpeerdependency = require("./is-optional-peer-dependency");
|
|
13
|
-
const _isoptionalreactdompeerdependency = require("./is-optional-react-dom-peer-dependency");
|
|
14
|
-
function checkResource(packageContext) {
|
|
15
|
-
return function(resource, context) {
|
|
16
|
-
if (!packageContext.packageData.dependencies[resource] && (0, _isoptionalpeerdependency.isOptionalPeerDependency)(resource, context)) {
|
|
17
|
-
_utils.log.debug('check-resource', `${JSON.stringify({
|
|
18
|
-
resource,
|
|
19
|
-
context
|
|
20
|
-
})} => true`);
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* isOptionalReactDomPeerDependency cannot use packageContext because react-dom/client
|
|
25
|
-
* is not explicitly listed in the package.json dependencies
|
|
26
|
-
*/ if ((0, _isoptionalreactdompeerdependency.isOptionalReactDomPeerDependency)({
|
|
27
|
-
resource,
|
|
28
|
-
context
|
|
29
|
-
})) {
|
|
30
|
-
try {
|
|
31
|
-
require.resolve(resource);
|
|
32
|
-
} catch (unused) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=check-resource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/check-resource.ts"],"sourcesContent":["import { log } from '../../../../utils';\nimport { Context } from '../../types';\nimport { isOptionalPeerDependency } from './is-optional-peer-dependency';\nimport { isOptionalReactDomPeerDependency } from './is-optional-react-dom-peer-dependency';\n\nexport function checkResource(packageContext: Context) {\n return function (resource: string, context: string) {\n if (\n !packageContext.packageData.dependencies[resource] &&\n isOptionalPeerDependency(resource, context)\n ) {\n log.debug('check-resource', `${JSON.stringify({ resource, context })} => true`);\n return true;\n }\n\n /**\n * isOptionalReactDomPeerDependency cannot use packageContext because react-dom/client\n * is not explicitly listed in the package.json dependencies\n */\n if (isOptionalReactDomPeerDependency({ resource, context })) {\n try {\n require.resolve(resource);\n } catch {\n return true;\n }\n }\n return false;\n };\n}\n"],"names":["checkResource","packageContext","resource","context","packageData","dependencies","isOptionalPeerDependency","log","debug","JSON","stringify","isOptionalReactDomPeerDependency","require","resolve"],"mappings":";;;;+BAKgBA;;;eAAAA;;;uBALI;0CAEqB;kDACQ;AAE1C,SAASA,cAAcC,cAAuB;IACjD,OAAO,SAAUC,QAAgB,EAAEC,OAAe;QAC9C,IACI,CAACF,eAAeG,WAAW,CAACC,YAAY,CAACH,SAAS,IAClDI,IAAAA,kDAAwB,EAACJ,UAAUC,UACrC;YACEI,UAAG,CAACC,KAAK,CAAC,kBAAkB,GAAGC,KAAKC,SAAS,CAAC;gBAAER;gBAAUC;YAAQ,GAAG,QAAQ,CAAC;YAC9E,OAAO;QACX;QAEA;;;SAGC,GACD,IAAIQ,IAAAA,kEAAgC,EAAC;YAAET;YAAUC;QAAQ,IAAI;YACzD,IAAI;gBACAS,QAAQC,OAAO,CAACX;YACpB,EAAE,eAAM;gBACJ,OAAO;YACX;QACJ;QACA,OAAO;IACX;AACJ"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getPackageJson", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getPackageJson;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
-
const _utils = require("../../../../utils");
|
|
14
|
-
function _interop_require_default(obj) {
|
|
15
|
-
return obj && obj.__esModule ? obj : {
|
|
16
|
-
default: obj
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const containsNodeModules = /[\\/](node_modules|\.yalc|uikit)[\\/]/;
|
|
20
|
-
const isNodeModules = /(node_modules|\.yalc)/;
|
|
21
|
-
function getPackageJson(context) {
|
|
22
|
-
const fullPath = _path.default.resolve(context);
|
|
23
|
-
if (!containsNodeModules.test(fullPath)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
let dirname = _path.default.dirname(fullPath);
|
|
27
|
-
do {
|
|
28
|
-
const packageJsonFile = _path.default.join(dirname, 'package.json');
|
|
29
|
-
if (_fs.default.existsSync(packageJsonFile)) {
|
|
30
|
-
_utils.log.debug('get-package-json', `${context} => ${packageJsonFile}`);
|
|
31
|
-
return (0, _utils.readJson)(packageJsonFile);
|
|
32
|
-
}
|
|
33
|
-
dirname = _path.default.dirname(dirname);
|
|
34
|
-
}while (!isNodeModules.test(_path.default.basename(dirname)))
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=get-package-json.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/get-package-json.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { log, readJson } from '../../../../utils';\n\nconst containsNodeModules = /[\\\\/](node_modules|\\.yalc|uikit)[\\\\/]/;\nconst isNodeModules = /(node_modules|\\.yalc)/;\n\nexport function getPackageJson(context: string) {\n const fullPath = path.resolve(context);\n if (!containsNodeModules.test(fullPath)) {\n return;\n }\n\n let dirname = path.dirname(fullPath);\n do {\n const packageJsonFile = path.join(dirname, 'package.json');\n if (fs.existsSync(packageJsonFile)) {\n log.debug('get-package-json', `${context} => ${packageJsonFile}`);\n return readJson<Record<string, any>>(packageJsonFile);\n }\n dirname = path.dirname(dirname);\n } while (!isNodeModules.test(path.basename(dirname)));\n}\n"],"names":["getPackageJson","containsNodeModules","isNodeModules","context","fullPath","path","resolve","test","dirname","packageJsonFile","join","fs","existsSync","log","debug","readJson","basename"],"mappings":";;;;+BAOgBA;;;eAAAA;;;2DAPD;6DACE;uBACa;;;;;;AAE9B,MAAMC,sBAAsB;AAC5B,MAAMC,gBAAgB;AAEf,SAASF,eAAeG,OAAe;IAC1C,MAAMC,WAAWC,aAAI,CAACC,OAAO,CAACH;IAC9B,IAAI,CAACF,oBAAoBM,IAAI,CAACH,WAAW;QACrC;IACJ;IAEA,IAAII,UAAUH,aAAI,CAACG,OAAO,CAACJ;IAC3B,GAAG;QACC,MAAMK,kBAAkBJ,aAAI,CAACK,IAAI,CAACF,SAAS;QAC3C,IAAIG,WAAE,CAACC,UAAU,CAACH,kBAAkB;YAChCI,UAAG,CAACC,KAAK,CAAC,oBAAoB,GAAGX,QAAQ,IAAI,EAAEM,iBAAiB;YAChE,OAAOM,IAAAA,eAAQ,EAAsBN;QACzC;QACAD,UAAUH,aAAI,CAACG,OAAO,CAACA;IAC3B,QAAS,CAACN,cAAcK,IAAI,CAACF,aAAI,CAACW,QAAQ,CAACR,UAAW;AAC1D"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "isOptionalPeerDependency", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return isOptionalPeerDependency;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _lodashmemoize = /*#__PURE__*/ _interop_require_default(require("lodash.memoize"));
|
|
12
|
-
const _getpackagejson = require("./get-package-json");
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function isOptionalPeerDependency(resource, context) {
|
|
19
|
-
var _getPeerDependenciesMeta_resource, _getPeerDependenciesMeta;
|
|
20
|
-
return /^[@a-z]/.test(resource) && ((_getPeerDependenciesMeta = getPeerDependenciesMeta(context)) === null || _getPeerDependenciesMeta === void 0 ? void 0 : (_getPeerDependenciesMeta_resource = _getPeerDependenciesMeta[resource]) === null || _getPeerDependenciesMeta_resource === void 0 ? void 0 : _getPeerDependenciesMeta_resource.optional) === true;
|
|
21
|
-
}
|
|
22
|
-
const getPeerDependenciesMeta = (0, _lodashmemoize.default)(function getPeerDependenciesMeta(context) {
|
|
23
|
-
var _getPackageJson;
|
|
24
|
-
return (_getPackageJson = (0, _getpackagejson.getPackageJson)(context)) === null || _getPackageJson === void 0 ? void 0 : _getPackageJson.peerDependenciesMeta;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=is-optional-peer-dependency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.ts"],"sourcesContent":["import memoize from 'lodash.memoize';\nimport { getPackageJson } from './get-package-json';\n\nexport function isOptionalPeerDependency(resource: string, context: string) {\n return (\n /^[@a-z]/.test(resource) && getPeerDependenciesMeta(context)?.[resource]?.optional === true\n );\n}\n\nconst getPeerDependenciesMeta = memoize(function getPeerDependenciesMeta(context: string) {\n return getPackageJson(context)?.peerDependenciesMeta;\n});\n"],"names":["isOptionalPeerDependency","resource","context","getPeerDependenciesMeta","test","optional","memoize","getPackageJson","peerDependenciesMeta"],"mappings":";;;;+BAGgBA;;;eAAAA;;;sEAHI;gCACW;;;;;;AAExB,SAASA,yBAAyBC,QAAgB,EAAEC,OAAe;QAEtCC,mCAAAA;IADhC,OACI,UAAUC,IAAI,CAACH,aAAaE,EAAAA,2BAAAA,wBAAwBD,sBAAxBC,gDAAAA,oCAAAA,wBAAkC,CAACF,SAAS,cAA5CE,wDAAAA,kCAA8CE,QAAQ,MAAK;AAE/F;AAEA,MAAMF,0BAA0BG,IAAAA,sBAAO,EAAC,SAASH,wBAAwBD,OAAe;QAC7EK;IAAP,QAAOA,kBAAAA,IAAAA,8BAAc,EAACL,sBAAfK,sCAAAA,gBAAyBC,oBAAoB;AACxD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "isOptionalReactDomPeerDependency", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return isOptionalReactDomPeerDependency;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
function isOptionalReactDomPeerDependency({ context, resource }) {
|
|
12
|
-
return resource === 'react-dom/client' && /(@servicetitan|packages)\/(ko-bridge|web-components)/.test(context);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=is-optional-react-dom-peer-dependency.js.map
|
package/dist/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/webpack/configs/plugins/ignore-plugin/is-optional-react-dom-peer-dependency.ts"],"sourcesContent":["interface Dependency {\n context: string;\n resource: string;\n}\n\nexport function isOptionalReactDomPeerDependency({ context, resource }: Dependency) {\n return (\n resource === 'react-dom/client' &&\n /(@servicetitan|packages)\\/(ko-bridge|web-components)/.test(context)\n );\n}\n"],"names":["isOptionalReactDomPeerDependency","context","resource","test"],"mappings":";;;;+BAKgBA;;;eAAAA;;;AAAT,SAASA,iCAAiC,EAAEC,OAAO,EAAEC,QAAQ,EAAc;IAC9E,OACIA,aAAa,sBACb,uDAAuDC,IAAI,CAACF;AAEpE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/webpack/configs/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "buildMetadata", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return buildMetadata;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
|
-
const _utils = require("../../../utils");
|
|
13
|
-
const _getlaunchdarklysdkversion = require("./get-launchdarkly-sdk-version");
|
|
14
|
-
const _getwebcomponentsversion = require("./get-web-components-version");
|
|
15
|
-
function _interop_require_default(obj) {
|
|
16
|
-
return obj && obj.__esModule ? obj : {
|
|
17
|
-
default: obj
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function buildMetadata(params) {
|
|
21
|
-
const { destination, name, version, dependencies, sharedDependencies } = params;
|
|
22
|
-
const full = (0, _utils.readJsonSafe)(_path.default.join(destination, 'bundle', 'full', 'entrypoints.json'));
|
|
23
|
-
const light = (0, _utils.readJsonSafe)(_path.default.join(destination, 'bundle', 'light', 'entrypoints.json'));
|
|
24
|
-
const headless = (0, _utils.readJsonSafe)(_path.default.join(destination, 'bundle', 'headless', 'entrypoints.json'));
|
|
25
|
-
const entrypoints = {
|
|
26
|
-
...full ? {
|
|
27
|
-
full
|
|
28
|
-
} : {},
|
|
29
|
-
...light ? {
|
|
30
|
-
light
|
|
31
|
-
} : {},
|
|
32
|
-
...headless ? {
|
|
33
|
-
headless
|
|
34
|
-
} : {}
|
|
35
|
-
};
|
|
36
|
-
return {
|
|
37
|
-
name,
|
|
38
|
-
version,
|
|
39
|
-
bundledWith: {
|
|
40
|
-
'@servicetitan/startup': (0, _utils.getStartupVersion)(),
|
|
41
|
-
'@servicetitan/web-components': (0, _getwebcomponentsversion.getWebComponentsVersion)(),
|
|
42
|
-
'launchdarkly-js-client-sdk': (0, _getlaunchdarklysdkversion.getLaunchDarklySdkVersion)()
|
|
43
|
-
},
|
|
44
|
-
sharedDependencies,
|
|
45
|
-
dependencies,
|
|
46
|
-
entrypoints
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=build-metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/utils/build-metadata.ts"],"sourcesContent":["import path from 'path';\nimport { getStartupVersion, readJsonSafe } from '../../../utils';\nimport { EntryPoints, Metadata } from '../types';\nimport { getLaunchDarklySdkVersion } from './get-launchdarkly-sdk-version';\nimport { getWebComponentsVersion } from './get-web-components-version';\n\nexport interface BuildMetadataParams {\n destination: string;\n name: string;\n version: string;\n dependencies: Record<string, string>;\n sharedDependencies: Record<string, string>;\n}\n\nexport function buildMetadata(params: BuildMetadataParams): Metadata {\n const { destination, name, version, dependencies, sharedDependencies } = params;\n\n const full = readJsonSafe(path.join(destination, 'bundle', 'full', 'entrypoints.json'));\n const light = readJsonSafe(path.join(destination, 'bundle', 'light', 'entrypoints.json'));\n const headless = readJsonSafe(path.join(destination, 'bundle', 'headless', 'entrypoints.json'));\n\n const entrypoints: EntryPoints = {\n ...(full ? { full } : {}),\n ...(light ? { light } : {}),\n ...(headless ? { headless } : {}),\n };\n\n return {\n name,\n version,\n bundledWith: {\n '@servicetitan/startup': getStartupVersion(),\n '@servicetitan/web-components': getWebComponentsVersion(),\n 'launchdarkly-js-client-sdk': getLaunchDarklySdkVersion(),\n },\n sharedDependencies,\n dependencies,\n entrypoints,\n };\n}\n"],"names":["buildMetadata","params","destination","name","version","dependencies","sharedDependencies","full","readJsonSafe","path","join","light","headless","entrypoints","bundledWith","getStartupVersion","getWebComponentsVersion","getLaunchDarklySdkVersion"],"mappings":";;;;+BAcgBA;;;eAAAA;;;6DAdC;uBAC+B;2CAEN;yCACF;;;;;;AAUjC,SAASA,cAAcC,MAA2B;IACrD,MAAM,EAAEC,WAAW,EAAEC,IAAI,EAAEC,OAAO,EAAEC,YAAY,EAAEC,kBAAkB,EAAE,GAAGL;IAEzE,MAAMM,OAAOC,IAAAA,mBAAY,EAACC,aAAI,CAACC,IAAI,CAACR,aAAa,UAAU,QAAQ;IACnE,MAAMS,QAAQH,IAAAA,mBAAY,EAACC,aAAI,CAACC,IAAI,CAACR,aAAa,UAAU,SAAS;IACrE,MAAMU,WAAWJ,IAAAA,mBAAY,EAACC,aAAI,CAACC,IAAI,CAACR,aAAa,UAAU,YAAY;IAE3E,MAAMW,cAA2B;QAC7B,GAAIN,OAAO;YAAEA;QAAK,IAAI,CAAC,CAAC;QACxB,GAAII,QAAQ;YAAEA;QAAM,IAAI,CAAC,CAAC;QAC1B,GAAIC,WAAW;YAAEA;QAAS,IAAI,CAAC,CAAC;IACpC;IAEA,OAAO;QACHT;QACAC;QACAU,aAAa;YACT,yBAAyBC,IAAAA,wBAAiB;YAC1C,gCAAgCC,IAAAA,gDAAuB;YACvD,8BAA8BC,IAAAA,oDAAyB;QAC3D;QACAX;QACAD;QACAQ;IACJ;AACJ"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "generateMetadata", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return generateMetadata;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
-
const _utils = require("../../../utils");
|
|
14
|
-
const _buildmetadata = require("./build-metadata");
|
|
15
|
-
function _interop_require_default(obj) {
|
|
16
|
-
return obj && obj.__esModule ? obj : {
|
|
17
|
-
default: obj
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function generateMetadata(context) {
|
|
21
|
-
const { destination, name, packageData, sharedDependencies } = context;
|
|
22
|
-
if (!_fs.default.existsSync(destination)) {
|
|
23
|
-
_fs.default.mkdirSync(destination, {
|
|
24
|
-
recursive: true
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
const metadata = (0, _buildmetadata.buildMetadata)({
|
|
28
|
-
destination,
|
|
29
|
-
name,
|
|
30
|
-
version: packageData.version,
|
|
31
|
-
dependencies: packageData.dependencies,
|
|
32
|
-
sharedDependencies
|
|
33
|
-
});
|
|
34
|
-
const outputFile = _path.default.join(destination, 'metadata.json');
|
|
35
|
-
_fs.default.writeFileSync(outputFile, JSON.stringify(metadata, null, 2), 'utf8');
|
|
36
|
-
/* istanbul ignore next: debug only */ _utils.log.debug('generate-metadata', `${outputFile}:`, ()=>JSON.stringify(metadata));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=generate-metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { log } from '../../../utils';\nimport { Context } from '../types';\nimport { buildMetadata } from './build-metadata';\n\nexport function generateMetadata(context: Context) {\n const { destination, name, packageData, sharedDependencies } = context;\n\n if (!fs.existsSync(destination)) {\n fs.mkdirSync(destination, { recursive: true });\n }\n\n const metadata = buildMetadata({\n destination,\n name,\n version: packageData.version,\n dependencies: packageData.dependencies,\n sharedDependencies,\n });\n\n const outputFile = path.join(destination, 'metadata.json');\n fs.writeFileSync(outputFile, JSON.stringify(metadata, null, 2), 'utf8');\n\n /* istanbul ignore next: debug only */\n log.debug('generate-metadata', `${outputFile}:`, () => JSON.stringify(metadata));\n}\n"],"names":["generateMetadata","context","destination","name","packageData","sharedDependencies","fs","existsSync","mkdirSync","recursive","metadata","buildMetadata","version","dependencies","outputFile","path","join","writeFileSync","JSON","stringify","log","debug"],"mappings":";;;;+BAMgBA;;;eAAAA;;;2DAND;6DACE;uBACG;+BAEU;;;;;;AAEvB,SAASA,iBAAiBC,OAAgB;IAC7C,MAAM,EAAEC,WAAW,EAAEC,IAAI,EAAEC,WAAW,EAAEC,kBAAkB,EAAE,GAAGJ;IAE/D,IAAI,CAACK,WAAE,CAACC,UAAU,CAACL,cAAc;QAC7BI,WAAE,CAACE,SAAS,CAACN,aAAa;YAAEO,WAAW;QAAK;IAChD;IAEA,MAAMC,WAAWC,IAAAA,4BAAa,EAAC;QAC3BT;QACAC;QACAS,SAASR,YAAYQ,OAAO;QAC5BC,cAAcT,YAAYS,YAAY;QACtCR;IACJ;IAEA,MAAMS,aAAaC,aAAI,CAACC,IAAI,CAACd,aAAa;IAC1CI,WAAE,CAACW,aAAa,CAACH,YAAYI,KAAKC,SAAS,CAACT,UAAU,MAAM,IAAI;IAEhE,oCAAoC,GACpCU,UAAG,CAACC,KAAK,CAAC,qBAAqB,GAAGP,WAAW,CAAC,CAAC,EAAE,IAAMI,KAAKC,SAAS,CAACT;AAC1E"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getBundleType", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getBundleType;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
function getBundleType({ embed, emitExposedDependencies, headless, isExposeSharedDependencies, isWebComponent }) {
|
|
12
|
-
if (isExposeSharedDependencies && emitExposedDependencies) {
|
|
13
|
-
return 'shared';
|
|
14
|
-
}
|
|
15
|
-
if (isWebComponent) {
|
|
16
|
-
if (headless) {
|
|
17
|
-
return 'headless';
|
|
18
|
-
}
|
|
19
|
-
return embed ? 'light' : 'full';
|
|
20
|
-
}
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=get-bundle-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/webpack/configs/utils/get-bundle-type.ts"],"sourcesContent":["import { Context } from '../types';\n\nexport function getBundleType({\n embed,\n emitExposedDependencies,\n headless,\n isExposeSharedDependencies,\n isWebComponent,\n}: Context) {\n if (isExposeSharedDependencies && emitExposedDependencies) {\n return 'shared';\n }\n\n if (isWebComponent) {\n if (headless) {\n return 'headless';\n }\n return embed ? 'light' : 'full';\n }\n\n return undefined;\n}\n"],"names":["getBundleType","embed","emitExposedDependencies","headless","isExposeSharedDependencies","isWebComponent","undefined"],"mappings":";;;;+BAEgBA;;;eAAAA;;;AAAT,SAASA,cAAc,EAC1BC,KAAK,EACLC,uBAAuB,EACvBC,QAAQ,EACRC,0BAA0B,EAC1BC,cAAc,EACR;IACN,IAAID,8BAA8BF,yBAAyB;QACvD,OAAO;IACX;IAEA,IAAIG,gBAAgB;QAChB,IAAIF,UAAU;YACV,OAAO;QACX;QACA,OAAOF,QAAQ,UAAU;IAC7B;IAEA,OAAOK;AACX"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getExposedDependencies", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getExposedDependencies;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
function getExposedDependencies(sharedDependencies, dependenciesOrCallback) {
|
|
12
|
-
const getVersion = typeof dependenciesOrCallback === 'function' ? dependenciesOrCallback : (dependency)=>dependenciesOrCallback[dependency];
|
|
13
|
-
return Object.entries(sharedDependencies).reduce((result, [dependency, variable])=>Object.assign(result, {
|
|
14
|
-
[dependency]: {
|
|
15
|
-
version: getVersion(dependency),
|
|
16
|
-
variable
|
|
17
|
-
}
|
|
18
|
-
}), {});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=get-exposed-dependencies.js.map
|