@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-package.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/bundle-package.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAElD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CAOa,CAAC;AAE3B,qBAAa,aAAc,SAAQ,OAAO,CAAC,OAAO,OAAO,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;MAAW;IAE5B,OAAO;
|
|
1
|
+
{"version":3,"file":"bundle-package.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/bundle-package.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAkB,MAAM,SAAS,CAAC;AAElD,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CAOa,CAAC;AAE3B,qBAAa,aAAc,SAAQ,OAAO,CAAC,OAAO,OAAO,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;MAAW;IAE5B,OAAO;CA2BhB"}
|
|
@@ -61,6 +61,7 @@ const options = {
|
|
|
61
61
|
};
|
|
62
62
|
class BundlePackage extends _types.Command {
|
|
63
63
|
async execute() {
|
|
64
|
+
(0, _utils.validateSharedDependenciesConsistency)();
|
|
64
65
|
const { config, codeCoverage, exposedDependencies: emitExposedDependencies, stat = false, useWatchConfig, watch } = this.args;
|
|
65
66
|
if ((0, _utils1.getModuleType)((0, _utils.getTsConfig)()) !== 'esnext') {
|
|
66
67
|
_utils.log.warning('webpack packages should set compilerOptions.module to "esnext" in tsconfig.json');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/bundle-package.ts"],"sourcesContent":["import { getTsConfig, log, logErrors } from '../../utils';\nimport { bundle, getModuleType } from '../utils';\nimport { Command, CommandOptions } from './types';\n\nconst options = {\n codeCoverage: { boolean: true, hidden: true },\n config: { string: true, hidden: true },\n exposedDependencies: { boolean: true, hidden: true },\n stat: { boolean: true, hidden: true },\n useWatchConfig: { boolean: true, hidden: true },\n watch: { boolean: true, hidden: true },\n} satisfies CommandOptions;\n\nexport class BundlePackage extends Command<typeof options> {\n static readonly options = options;\n @logErrors\n async execute() {\n const {\n config,\n codeCoverage,\n exposedDependencies: emitExposedDependencies,\n stat = false,\n useWatchConfig,\n watch,\n } = this.args;\n\n if (getModuleType(getTsConfig()) !== 'esnext') {\n log.warning(\n 'webpack packages should set compilerOptions.module to \"esnext\" in tsconfig.json'\n );\n }\n\n const options: Parameters<typeof bundle>[0] = {\n ...(emitExposedDependencies ? {} : { config }),\n codeCoverage,\n emitExposedDependencies,\n useWatchConfig,\n };\n\n await bundle({ buildStat: stat, ...options, watch });\n }\n}\n"],"names":["BundlePackage","options","codeCoverage","boolean","hidden","config","string","exposedDependencies","stat","useWatchConfig","watch","Command","execute","emitExposedDependencies","args","getModuleType","getTsConfig","log","warning","bundle","buildStat"],"mappings":";;;;+BAaaA;;;eAAAA;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/cli/commands/bundle-package.ts"],"sourcesContent":["import { getTsConfig, log, logErrors, validateSharedDependenciesConsistency } from '../../utils';\nimport { bundle, getModuleType } from '../utils';\nimport { Command, CommandOptions } from './types';\n\nconst options = {\n codeCoverage: { boolean: true, hidden: true },\n config: { string: true, hidden: true },\n exposedDependencies: { boolean: true, hidden: true },\n stat: { boolean: true, hidden: true },\n useWatchConfig: { boolean: true, hidden: true },\n watch: { boolean: true, hidden: true },\n} satisfies CommandOptions;\n\nexport class BundlePackage extends Command<typeof options> {\n static readonly options = options;\n @logErrors\n async execute() {\n validateSharedDependenciesConsistency();\n\n const {\n config,\n codeCoverage,\n exposedDependencies: emitExposedDependencies,\n stat = false,\n useWatchConfig,\n watch,\n } = this.args;\n\n if (getModuleType(getTsConfig()) !== 'esnext') {\n log.warning(\n 'webpack packages should set compilerOptions.module to \"esnext\" in tsconfig.json'\n );\n }\n\n const options: Parameters<typeof bundle>[0] = {\n ...(emitExposedDependencies ? {} : { config }),\n codeCoverage,\n emitExposedDependencies,\n useWatchConfig,\n };\n\n await bundle({ buildStat: stat, ...options, watch });\n }\n}\n"],"names":["BundlePackage","options","codeCoverage","boolean","hidden","config","string","exposedDependencies","stat","useWatchConfig","watch","Command","execute","validateSharedDependenciesConsistency","emitExposedDependencies","args","getModuleType","getTsConfig","log","warning","bundle","buildStat"],"mappings":";;;;+BAaaA;;;eAAAA;;;uBAbsE;wBAC7C;uBACE;;;;;;;;;;;;;;;;;;;;;;;AAExC,MAAMC,UAAU;IACZC,cAAc;QAAEC,SAAS;QAAMC,QAAQ;IAAK;IAC5CC,QAAQ;QAAEC,QAAQ;QAAMF,QAAQ;IAAK;IACrCG,qBAAqB;QAAEJ,SAAS;QAAMC,QAAQ;IAAK;IACnDI,MAAM;QAAEL,SAAS;QAAMC,QAAQ;IAAK;IACpCK,gBAAgB;QAAEN,SAAS;QAAMC,QAAQ;IAAK;IAC9CM,OAAO;QAAEP,SAAS;QAAMC,QAAQ;IAAK;AACzC;AAEO,MAAMJ,sBAAsBW,cAAO;IAEtC,MACMC,UAAU;QACZC,IAAAA,4CAAqC;QAErC,MAAM,EACFR,MAAM,EACNH,YAAY,EACZK,qBAAqBO,uBAAuB,EAC5CN,OAAO,KAAK,EACZC,cAAc,EACdC,KAAK,EACR,GAAG,IAAI,CAACK,IAAI;QAEb,IAAIC,IAAAA,qBAAa,EAACC,IAAAA,kBAAW,SAAQ,UAAU;YAC3CC,UAAG,CAACC,OAAO,CACP;QAER;QAEA,MAAMlB,UAAwC;YAC1C,GAAIa,0BAA0B,CAAC,IAAI;gBAAET;YAAO,CAAC;YAC7CH;YACAY;YACAL;QACJ;QAEA,MAAMW,IAAAA,cAAM,EAAC;YAAEC,WAAWb;YAAM,GAAGP,OAAO;YAAES;QAAM;IACtD;AACJ;AA7BI,iBADSV,eACOC,WAAUA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BuildContext } from '../types';
|
|
2
|
-
export declare function getBundleType(context: BuildContext): "
|
|
2
|
+
export declare function getBundleType(context: BuildContext): "full" | "light" | "headless" | "shared" | undefined;
|
|
3
3
|
//# sourceMappingURL=get-bundle-type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/storybook-config/webpack-final.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport { BuildContext } from '../core';\nimport { log } from '../utils';\nimport { rulesConfig } from '../webpack/configs';\nimport { miniCssExtractPlugin } from '../webpack/configs/plugins';\nimport { Overrides } from '../webpack/types';\n\nexport function webpackFinal(config: Configuration, overrides: Overrides = {}): Configuration {\n const context = getContext(config);\n const rules = getRules(context, overrides);\n const plugins = getPlugins(context, overrides);\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:webpack-final', () => inspect({ rules, plugins }, { depth: null }));\n\n return {\n ...config,\n module: {\n ...config.module,\n rules: [...transformDefaultRules(config.module?.rules), ...rules],\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n };\n}\n\nfunction getContext(config: Configuration): BuildContext {\n return {\n package: {\n name: '',\n version: '',\n destination: '',\n source: '',\n dependencies: {},\n sharedDependencies: {},\n isWebComponent: false,\n isLegacyRoot: false,\n isExposeSharedDependencies: false,\n },\n build: {\n name: '',\n isProduction: config.mode === 'production',\n },\n options: {\n bundlerConfig: {},\n },\n };\n}\n\nfunction getPlugins(context: BuildContext, overrides: Overrides) {\n return [miniCssExtractPlugin(context, overrides)].filter(plugin => !!plugin);\n}\n\nfunction getRules(context: BuildContext, overrides: Overrides) {\n const include = ['.module.css', '.module.less', '.less', '.svg'];\n const exclude = ['.css'];\n\n const { rules } = rulesConfig(context, overrides);\n\n return rules.filter(\n ({ test }) =>\n !(test instanceof RegExp) ||\n include.some(ext => test.exec(ext) && !exclude.some(ext => test.exec(ext)))\n );\n}\n\nfunction transformDefaultRules(rules: NonNullable<Configuration['module']>['rules'] = []) {\n const result = rules.map(rule => {\n if (rule && typeof rule === 'object' && rule.test instanceof RegExp) {\n if (rule.test.test('.css')) {\n return { ...rule, exclude: /\\.module.css$/ };\n }\n if (rule.test.test('.svg')) {\n return { ...rule, exclude: /\\.svg$/i };\n }\n }\n return rule;\n });\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:transform-default-rules', () =>\n inspect({ result }, { depth: null })\n );\n\n return result;\n}\n"],"names":["webpackFinal","config","overrides","context","getContext","rules","getRules","plugins","getPlugins","log","debug","inspect","depth","module","transformDefaultRules","package","name","version","destination","source","dependencies","sharedDependencies","isWebComponent","isLegacyRoot","isExposeSharedDependencies","build","isProduction","mode","options","bundlerConfig","miniCssExtractPlugin","filter","plugin","include","exclude","rulesConfig","test","RegExp","some","ext","exec","result","map","rule"],"mappings":";;;;+BAQgBA;;;eAAAA;;;0BARQ;uBAGJ;yBACQ;yBACS;AAG9B,SAASA,aAAaC,MAAqB,EAAEC,YAAuB,CAAC,CAAC;QAcvDD;QAFuBA;IAXzC,MAAME,UAAUC,WAAWH;IAC3B,MAAMI,QAAQC,SAASH,SAASD;IAChC,MAAMK,UAAUC,WAAWL,SAASD;IAEpC,oCAAoC,GACpCO,UAAG,CAACC,KAAK,CAAC,kCAAkC,IAAMC,IAAAA,iBAAO,EAAC;YAAEN;YAAOE;QAAQ,GAAG;YAAEK,OAAO;QAAK;IAE5F,OAAO;QACH,GAAGX,MAAM;QACTY,QAAQ;YACJ,GAAGZ,OAAOY,MAAM;YAChBR,OAAO;mBAAIS,uBAAsBb,iBAAAA,OAAOY,MAAM,cAAbZ,qCAAAA,eAAeI,KAAK;mBAAMA;aAAM;QACrE;QACAE,SAAS;gBAAKN,kBAAAA,OAAOM,OAAO,cAAdN,6BAAAA,kBAAkB,EAAE;eAAMM;SAAQ;IACpD;AACJ;AAEA,SAASH,WAAWH,MAAqB;IACrC,OAAO;QACHc,SAAS;YACLC,MAAM;YACNC,SAAS;YACTC,aAAa;YACbC,QAAQ;YACRC,cAAc,CAAC;YACfC,oBAAoB,CAAC;YACrBC,gBAAgB;YAChBC,cAAc;YACdC,4BAA4B;QAChC;QACAC,OAAO;YACHT,MAAM;YACNU,cAAczB,OAAO0B,IAAI,KAAK;QAClC;QACAC,SAAS;YACLC,eAAe,CAAC;QACpB;IACJ;AACJ;AAEA,SAASrB,WAAWL,OAAqB,EAAED,SAAoB;IAC3D,OAAO;QAAC4B,IAAAA,6BAAoB,EAAC3B,SAASD;KAAW,CAAC6B,MAAM,CAACC,CAAAA,SAAU,CAAC,CAACA;AACzE;AAEA,SAAS1B,SAASH,OAAqB,EAAED,SAAoB;IACzD,MAAM+B,UAAU;QAAC;QAAe;QAAgB;QAAS;KAAO;
|
|
1
|
+
{"version":3,"sources":["../../src/storybook-config/webpack-final.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport { BuildContext } from '../core';\nimport { log } from '../utils';\nimport { rulesConfig } from '../webpack/configs';\nimport { miniCssExtractPlugin } from '../webpack/configs/plugins';\nimport { Overrides } from '../webpack/types';\n\nexport function webpackFinal(config: Configuration, overrides: Overrides = {}): Configuration {\n const context = getContext(config);\n const rules = getRules(context, overrides);\n const plugins = getPlugins(context, overrides);\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:webpack-final', () => inspect({ rules, plugins }, { depth: null }));\n\n return {\n ...config,\n module: {\n ...config.module,\n rules: [...transformDefaultRules(config.module?.rules), ...rules],\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n };\n}\n\nfunction getContext(config: Configuration): BuildContext {\n return {\n package: {\n name: '',\n version: '',\n destination: '',\n source: '',\n dependencies: {},\n sharedDependencies: {},\n isWebComponent: false,\n isLegacyRoot: false,\n isExposeSharedDependencies: false,\n },\n build: {\n name: '',\n isProduction: config.mode === 'production',\n },\n options: {\n bundlerConfig: {},\n },\n };\n}\n\nfunction getPlugins(context: BuildContext, overrides: Overrides) {\n return [miniCssExtractPlugin(context, overrides)].filter(plugin => !!plugin);\n}\n\nfunction getRules(context: BuildContext, overrides: Overrides) {\n const include = ['.module.css', '.module.less', '.less', '.module.scss', '.scss', '.svg'];\n const exclude = ['.css'];\n\n const { rules } = rulesConfig(context, overrides);\n\n return rules.filter(\n ({ test }) =>\n !(test instanceof RegExp) ||\n include.some(ext => test.exec(ext) && !exclude.some(ext => test.exec(ext)))\n );\n}\n\nfunction transformDefaultRules(rules: NonNullable<Configuration['module']>['rules'] = []) {\n const result = rules.map(rule => {\n if (rule && typeof rule === 'object' && rule.test instanceof RegExp) {\n if (rule.test.test('.css')) {\n return { ...rule, exclude: /\\.module.css$/ };\n }\n if (rule.test.test('.svg')) {\n return { ...rule, exclude: /\\.svg$/i };\n }\n }\n return rule;\n });\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:transform-default-rules', () =>\n inspect({ result }, { depth: null })\n );\n\n return result;\n}\n"],"names":["webpackFinal","config","overrides","context","getContext","rules","getRules","plugins","getPlugins","log","debug","inspect","depth","module","transformDefaultRules","package","name","version","destination","source","dependencies","sharedDependencies","isWebComponent","isLegacyRoot","isExposeSharedDependencies","build","isProduction","mode","options","bundlerConfig","miniCssExtractPlugin","filter","plugin","include","exclude","rulesConfig","test","RegExp","some","ext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;IAExB,MAAM,EAAE7B,KAAK,EAAE,GAAG8B,IAAAA,oBAAW,EAAChC,SAASD;IAEvC,OAAOG,MAAM0B,MAAM,CACf,CAAC,EAAEK,IAAI,EAAE,GACL,CAAEA,CAAAA,gBAAgBC,MAAK,KACvBJ,QAAQK,IAAI,CAACC,CAAAA,MAAOH,KAAKI,IAAI,CAACD,QAAQ,CAACL,QAAQI,IAAI,CAACC,CAAAA,MAAOH,KAAKI,IAAI,CAACD;AAEjF;AAEA,SAASzB,sBAAsBT,QAAuD,EAAE;IACpF,MAAMoC,SAASpC,MAAMqC,GAAG,CAACC,CAAAA;QACrB,IAAIA,QAAQ,OAAOA,SAAS,YAAYA,KAAKP,IAAI,YAAYC,QAAQ;YACjE,IAAIM,KAAKP,IAAI,CAACA,IAAI,CAAC,SAAS;gBACxB,OAAO;oBAAE,GAAGO,IAAI;oBAAET,SAAS;gBAAgB;YAC/C;YACA,IAAIS,KAAKP,IAAI,CAACA,IAAI,CAAC,SAAS;gBACxB,OAAO;oBAAE,GAAGO,IAAI;oBAAET,SAAS;gBAAU;YACzC;QACJ;QACA,OAAOS;IACX;IAEA,oCAAoC,GACpClC,UAAG,CAACC,KAAK,CAAC,4CAA4C,IAClDC,IAAAA,iBAAO,EAAC;YAAE8B;QAAO,GAAG;YAAE7B,OAAO;QAAK;IAGtC,OAAO6B;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../src/vite/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACH,YAAY,EAMf,MAAM,SAAS,CAAC;AAkBjB,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../src/vite/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACH,YAAY,EAMf,MAAM,SAAS,CAAC;AAkBjB,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAoDpE"}
|
package/dist/vite/base-config.js
CHANGED
|
@@ -40,6 +40,17 @@ function createBaseConfig(context) {
|
|
|
40
40
|
legalComments: 'none'
|
|
41
41
|
},
|
|
42
42
|
base: './',
|
|
43
|
+
css: {
|
|
44
|
+
modules: {
|
|
45
|
+
localsConvention: 'camelCaseOnly',
|
|
46
|
+
generateScopedName: isProduction ? '[local]__[hash:base64:5]' : '[local]'
|
|
47
|
+
},
|
|
48
|
+
preprocessorOptions: {
|
|
49
|
+
less: {
|
|
50
|
+
math: 'always'
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
43
54
|
build: {
|
|
44
55
|
outDir: (0, _core.getOutputPath)(context),
|
|
45
56
|
// Preserves shared deps in dist/bundle/shared/ when host rebuilds into dist/bundle/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/vite/base-config.ts"],"sourcesContent":["import type { InlineConfig } from 'vite';\nimport {\n BuildContext,\n defineExposedDependencies,\n defineExposedInstanceDependencies,\n defineWebComponentName,\n getBundleType,\n getOutputPath,\n} from '../core';\n\nfunction importMetaRemap(\n ...definitions: (Record<string, string> | undefined)[]\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n definitions\n .filter(definition => definition !== undefined)\n .forEach(definition =>\n Object.keys(definition).forEach(item => {\n result[`import.meta.env.${item}`] = definition[item];\n })\n );\n\n return result;\n}\n\nexport function createBaseConfig(context: BuildContext): InlineConfig {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n\n return {\n cacheDir: `node_modules/.vite/${getBundleType(context) ?? 'host'}`,\n server: {\n // TODO: need default port for MFE?\n port: isWebComponent ? 8888 : 8080,\n warmup: {\n /*\n * TODO: dist duplication/use destination\n * Pre-warms compiled files to avoid multiple page reloads at dev session start\n */\n clientFiles: ['dist/**/*.js'],\n },\n },\n mode: isProduction ? 'production' : 'development',\n configFile: false,\n oxc: { legalComments: 'none' },\n base: './',\n build: {\n outDir: getOutputPath(context),\n // Preserves shared deps in dist/bundle/shared/ when host rebuilds into dist/bundle/\n emptyOutDir: false,\n sourcemap: true,\n commonjsOptions: {\n include: [\n // TODO: move to config override\n /startup-utils/,\n /\\/node_modules\\//,\n ],\n },\n },\n define: importMetaRemap(\n defineExposedDependencies(context),\n defineExposedInstanceDependencies(context),\n defineWebComponentName(context)\n ),\n optimizeDeps: {\n include: ['@servicetitan/startup-utils'],\n },\n };\n}\n"],"names":["createBaseConfig","importMetaRemap","definitions","result","filter","definition","undefined","forEach","Object","keys","item","context","getBundleType","isProduction","build","isWebComponent","package","cacheDir","server","port","warmup","clientFiles","mode","configFile","oxc","legalComments","base","outDir","getOutputPath","emptyOutDir","sourcemap","commonjsOptions","include","define","defineExposedDependencies","defineExposedInstanceDependencies","defineWebComponentName","optimizeDeps"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;sBAlBT;AAEP,SAASC,gBACL,GAAGC,WAAmD;IAEtD,MAAMC,SAAiC,CAAC;IAExCD,YACKE,MAAM,CAACC,CAAAA,aAAcA,eAAeC,WACpCC,OAAO,CAACF,CAAAA,aACLG,OAAOC,IAAI,CAACJ,YAAYE,OAAO,CAACG,CAAAA;YAC5BP,MAAM,CAAC,CAAC,gBAAgB,EAAEO,MAAM,CAAC,GAAGL,UAAU,CAACK,KAAK;QACxD;IAGR,OAAOP;AACX;AAEO,SAASH,iBAAiBW,OAAqB;QAKdC;IAJpC,MAAM,EAAEC,YAAY,EAAE,GAAGF,QAAQG,KAAK;IACtC,MAAM,EAAEC,cAAc,EAAE,GAAGJ,QAAQK,OAAO;IAE1C,OAAO;QACHC,UAAU,CAAC,mBAAmB,GAAEL,iBAAAA,IAAAA,mBAAa,EAACD,sBAAdC,4BAAAA,iBAA0B,QAAQ;QAClEM,QAAQ;YACJ,mCAAmC;YACnCC,MAAMJ,iBAAiB,OAAO;YAC9BK,QAAQ;gBACJ;;;iBAGC,GACDC,aAAa;oBAAC;iBAAe;YACjC;QACJ;QACAC,MAAMT,eAAe,eAAe;QACpCU,YAAY;QACZC,KAAK;YAAEC,eAAe;QAAO;QAC7BC,MAAM;
|
|
1
|
+
{"version":3,"sources":["../../src/vite/base-config.ts"],"sourcesContent":["import type { InlineConfig } from 'vite';\nimport {\n BuildContext,\n defineExposedDependencies,\n defineExposedInstanceDependencies,\n defineWebComponentName,\n getBundleType,\n getOutputPath,\n} from '../core';\n\nfunction importMetaRemap(\n ...definitions: (Record<string, string> | undefined)[]\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n definitions\n .filter(definition => definition !== undefined)\n .forEach(definition =>\n Object.keys(definition).forEach(item => {\n result[`import.meta.env.${item}`] = definition[item];\n })\n );\n\n return result;\n}\n\nexport function createBaseConfig(context: BuildContext): InlineConfig {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n\n return {\n cacheDir: `node_modules/.vite/${getBundleType(context) ?? 'host'}`,\n server: {\n // TODO: need default port for MFE?\n port: isWebComponent ? 8888 : 8080,\n warmup: {\n /*\n * TODO: dist duplication/use destination\n * Pre-warms compiled files to avoid multiple page reloads at dev session start\n */\n clientFiles: ['dist/**/*.js'],\n },\n },\n mode: isProduction ? 'production' : 'development',\n configFile: false,\n oxc: { legalComments: 'none' },\n base: './',\n css: {\n modules: {\n localsConvention: 'camelCaseOnly',\n generateScopedName: isProduction ? '[local]__[hash:base64:5]' : '[local]',\n },\n preprocessorOptions: {\n less: { math: 'always' },\n },\n },\n build: {\n outDir: getOutputPath(context),\n // Preserves shared deps in dist/bundle/shared/ when host rebuilds into dist/bundle/\n emptyOutDir: false,\n sourcemap: true,\n commonjsOptions: {\n include: [\n // TODO: move to config override\n /startup-utils/,\n /\\/node_modules\\//,\n ],\n },\n },\n define: importMetaRemap(\n defineExposedDependencies(context),\n defineExposedInstanceDependencies(context),\n defineWebComponentName(context)\n ),\n optimizeDeps: {\n include: ['@servicetitan/startup-utils'],\n },\n };\n}\n"],"names":["createBaseConfig","importMetaRemap","definitions","result","filter","definition","undefined","forEach","Object","keys","item","context","getBundleType","isProduction","build","isWebComponent","package","cacheDir","server","port","warmup","clientFiles","mode","configFile","oxc","legalComments","base","css","modules","localsConvention","generateScopedName","preprocessorOptions","less","math","outDir","getOutputPath","emptyOutDir","sourcemap","commonjsOptions","include","define","defineExposedDependencies","defineExposedInstanceDependencies","defineWebComponentName","optimizeDeps"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;sBAlBT;AAEP,SAASC,gBACL,GAAGC,WAAmD;IAEtD,MAAMC,SAAiC,CAAC;IAExCD,YACKE,MAAM,CAACC,CAAAA,aAAcA,eAAeC,WACpCC,OAAO,CAACF,CAAAA,aACLG,OAAOC,IAAI,CAACJ,YAAYE,OAAO,CAACG,CAAAA;YAC5BP,MAAM,CAAC,CAAC,gBAAgB,EAAEO,MAAM,CAAC,GAAGL,UAAU,CAACK,KAAK;QACxD;IAGR,OAAOP;AACX;AAEO,SAASH,iBAAiBW,OAAqB;QAKdC;IAJpC,MAAM,EAAEC,YAAY,EAAE,GAAGF,QAAQG,KAAK;IACtC,MAAM,EAAEC,cAAc,EAAE,GAAGJ,QAAQK,OAAO;IAE1C,OAAO;QACHC,UAAU,CAAC,mBAAmB,GAAEL,iBAAAA,IAAAA,mBAAa,EAACD,sBAAdC,4BAAAA,iBAA0B,QAAQ;QAClEM,QAAQ;YACJ,mCAAmC;YACnCC,MAAMJ,iBAAiB,OAAO;YAC9BK,QAAQ;gBACJ;;;iBAGC,GACDC,aAAa;oBAAC;iBAAe;YACjC;QACJ;QACAC,MAAMT,eAAe,eAAe;QACpCU,YAAY;QACZC,KAAK;YAAEC,eAAe;QAAO;QAC7BC,MAAM;QACNC,KAAK;YACDC,SAAS;gBACLC,kBAAkB;gBAClBC,oBAAoBjB,eAAe,6BAA6B;YACpE;YACAkB,qBAAqB;gBACjBC,MAAM;oBAAEC,MAAM;gBAAS;YAC3B;QACJ;QACAnB,OAAO;YACHoB,QAAQC,IAAAA,mBAAa,EAACxB;YACtB,oFAAoF;YACpFyB,aAAa;YACbC,WAAW;YACXC,iBAAiB;gBACbC,SAAS;oBACL,gCAAgC;oBAChC;oBACA;iBACH;YACL;QACJ;QACAC,QAAQvC,gBACJwC,IAAAA,+BAAyB,EAAC9B,UAC1B+B,IAAAA,uCAAiC,EAAC/B,UAClCgC,IAAAA,4BAAsB,EAAChC;QAE3BiC,cAAc;YACVL,SAAS;gBAAC;aAA8B;QAC5C;IACJ;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-webpack-config.d.ts","sourceRoot":"","sources":["../../src/webpack/create-webpack-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"create-webpack-config.d.ts","sourceRoot":"","sources":["../../src/webpack/create-webpack-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAyBxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,eAAO,MAAM,wBAAwB,0BAA0B,CAAC;AAChE,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAElE,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,GAAE,OAAY,GAAG,aAAa,CAgD9F;AAgBD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,aAAa,EAAE,CA0ClB"}
|
|
@@ -92,7 +92,6 @@ const WEB_COMPONENT_CONFIG_ERROR = `
|
|
|
92
92
|
Export webpack configuration itself as a default export from the config file instead.
|
|
93
93
|
`.replace(/\n\s*/g, ' ').trim();
|
|
94
94
|
function createWebpackConfigs(options) {
|
|
95
|
-
(0, _utils.validateSharedDependenciesConsistency)();
|
|
96
95
|
const { watch, useWatchConfig } = options;
|
|
97
96
|
const mode = watch || useWatchConfig ? 'development' : 'production';
|
|
98
97
|
const fallback = watch || useWatchConfig ? webpackDevConfigFileName : webpackProdConfigFileName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/webpack/create-webpack-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { createBuildContext, getName, stringifyConfig } from '../core';\nimport {\n getWebpackConfiguration,\n hasHeadlessBundle,\n isCustomStyleRules,\n isWebComponent,\n log,\n
|
|
1
|
+
{"version":3,"sources":["../../src/webpack/create-webpack-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { createBuildContext, getName, stringifyConfig } from '../core';\nimport {\n getWebpackConfiguration,\n hasHeadlessBundle,\n isCustomStyleRules,\n isWebComponent,\n log,\n} from '../utils';\nimport {\n amdConfig,\n cacheConfig,\n devServerConfig,\n devtoolConfig,\n entryConfig,\n externalsConfig,\n moduleConfig,\n optimizationConfig,\n outputConfig,\n pluginsConfig,\n resolveConfig,\n statsConfig,\n watchOptionsConfig,\n} from './configs';\nimport { Options, Overrides } from './types';\nimport { getCallerFile } from './utils';\n\nexport const webpackDevConfigFileName = 'webpack.dev.config.js';\nexport const webpackProdConfigFileName = 'webpack.prod.config.js';\n\nexport function createWebpackConfig(overrides: Overrides, options: Options = {}): Configuration {\n const context = createBuildContext({\n name: options.name ?? '',\n isProduction: overrides.configuration?.mode !== 'development',\n light: options.light,\n headless: options.headless,\n codeCoverage: options.codeCoverage,\n buildStat: options.buildStat,\n bundlerConfig: {\n emitExposedDependencies: options.emitExposedDependencies,\n minify: getWebpackConfiguration().minify,\n isCustomStyleRules: isCustomStyleRules(),\n },\n });\n\n if (context.package.isWebComponent && isCalledFromCustomWebpackConfigFile()) {\n throw new Error(WEB_COMPONENT_CONFIG_ERROR);\n }\n\n if (options.emitExposedDependencies && !context.package.isExposeSharedDependencies) {\n throw new Error('package does not expose shared dependencies');\n }\n\n const configs = [\n amdConfig,\n cacheConfig,\n devServerConfig,\n devtoolConfig,\n entryConfig,\n externalsConfig,\n moduleConfig,\n optimizationConfig,\n outputConfig,\n pluginsConfig,\n resolveConfig,\n statsConfig,\n watchOptionsConfig,\n ];\n\n const result = merge(\n configs.reduce((result, fn) => ({ ...result, ...fn(context, overrides) }), {}),\n overrides.configuration ?? {}\n );\n\n /* istanbul ignore next: debug only */\n log.debug('create-webpack-config', () => stringifyConfig(result));\n\n return result;\n}\n\nfunction isCalledFromCustomWebpackConfigFile() {\n const callerFileName = getCallerFile();\n return [webpackDevConfigFileName, webpackProdConfigFileName].some(configFileName =>\n callerFileName.includes(configFileName)\n );\n}\n\nconst WEB_COMPONENT_CONFIG_ERROR = `\n You cannot call createWebpackConfig in a custom webpack config file in a web component (MFE) project.\n Export webpack configuration itself as a default export from the config file instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n\nexport function createWebpackConfigs(options: {\n buildStat?: boolean;\n codeCoverage?: boolean;\n config?: string;\n emitExposedDependencies?: boolean;\n useWatchConfig?: boolean;\n watch?: boolean;\n}): Configuration[] {\n const { watch, useWatchConfig } = options;\n const mode = watch || useWatchConfig ? 'development' : 'production';\n const fallback = watch || useWatchConfig ? webpackDevConfigFileName : webpackProdConfigFileName;\n const customConfig = readWebpackConfig({ config: options.config, fallback });\n\n /* istanbul ignore next: debug only */\n log.debug('custom-webpack-config', () => stringifyConfig(customConfig));\n\n const emitExposedDependencies =\n options.emitExposedDependencies && customConfig\n ? { output: customConfig.output }\n : options.emitExposedDependencies;\n\n const resolved: Options = {\n buildStat: options.buildStat,\n codeCoverage: options.codeCoverage,\n emitExposedDependencies,\n name: getName(),\n };\n\n if (isWebComponent()) {\n const overrides: Overrides = {\n configuration: { ...customConfig?.configuration, mode },\n plugins: customConfig?.plugins,\n };\n\n const configs = [\n createWebpackConfig(overrides, resolved),\n createWebpackConfig(overrides, { ...resolved, light: true }),\n ];\n if (hasHeadlessBundle()) {\n configs.push(createWebpackConfig(overrides, { ...resolved, headless: true }));\n }\n return configs;\n }\n\n if (customConfig && !emitExposedDependencies) {\n return [customConfig];\n }\n\n return [createWebpackConfig({ configuration: { mode } }, resolved)];\n}\n\nfunction readWebpackConfig({ config, fallback }: { config?: string; fallback: string }) {\n return readConfig(config) ?? readConfig(fallback);\n}\n\nfunction readConfig(relativePath?: string): Record<string, any> | undefined {\n if (relativePath && fs.existsSync(relativePath)) {\n return require(path.resolve(relativePath));\n }\n}\n"],"names":["createWebpackConfig","createWebpackConfigs","webpackDevConfigFileName","webpackProdConfigFileName","overrides","options","context","createBuildContext","name","isProduction","configuration","mode","light","headless","codeCoverage","buildStat","bundlerConfig","emitExposedDependencies","minify","getWebpackConfiguration","isCustomStyleRules","package","isWebComponent","isCalledFromCustomWebpackConfigFile","Error","WEB_COMPONENT_CONFIG_ERROR","isExposeSharedDependencies","configs","amdConfig","cacheConfig","devServerConfig","devtoolConfig","entryConfig","externalsConfig","moduleConfig","optimizationConfig","outputConfig","pluginsConfig","resolveConfig","statsConfig","watchOptionsConfig","result","merge","reduce","fn","log","debug","stringifyConfig","callerFileName","getCallerFile","some","configFileName","includes","replace","trim","watch","useWatchConfig","fallback","customConfig","readWebpackConfig","config","output","resolved","getName","plugins","hasHeadlessBundle","push","readConfig","relativePath","fs","existsSync","require","path","resolve"],"mappings":";;;;;;;;;;;QAiCgBA;eAAAA;;QAgEAC;eAAAA;;QAnEHC;eAAAA;;QACAC;eAAAA;;;2DA/BE;6DACE;8BAEK;sBACuC;uBAOtD;yBAeA;wBAEuB;;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,CAAClE,oBAAoBI,WAAW;gBAAE,GAAG0D,QAAQ;gBAAEjD,UAAU;YAAK;QAC9E;QACA,OAAOc;IACX;IAEA,IAAI+B,gBAAgB,CAACzC,yBAAyB;QAC1C,OAAO;YAACyC;SAAa;IACzB;IAEA,OAAO;QAAC1D,oBAAoB;YAAEU,eAAe;gBAAEC;YAAK;QAAE,GAAGmD;KAAU;AACvE;AAEA,SAASH,kBAAkB,EAAEC,MAAM,EAAEH,QAAQ,EAAyC;QAC3EU;IAAP,QAAOA,cAAAA,WAAWP,qBAAXO,yBAAAA,cAAsBA,WAAWV;AAC5C;AAEA,SAASU,WAAWC,YAAqB;IACrC,IAAIA,gBAAgBC,WAAE,CAACC,UAAU,CAACF,eAAe;QAC7C,OAAOG,QAAQC,aAAI,CAACC,OAAO,CAACL;IAChC;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/startup",
|
|
3
|
-
"version": "34.3.0-beta.
|
|
3
|
+
"version": "34.3.0-beta.2",
|
|
4
4
|
"description": "CLI to create multi-package Lerna projects with TypeScript and React",
|
|
5
5
|
"homepage": "https://docs.st.dev/docs/frontend/uikit/startup",
|
|
6
6
|
"repository": {
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
"@jest/core": "~30.2.0",
|
|
57
57
|
"@jest/types": "~30.2.0",
|
|
58
58
|
"@jsdevtools/coverage-istanbul-loader": "^3.0.5",
|
|
59
|
-
"@servicetitan/eslint-config": "34.3.0-beta.
|
|
60
|
-
"@servicetitan/install": "34.3.0-beta.
|
|
61
|
-
"@servicetitan/startup-utils": "34.3.0-beta.
|
|
62
|
-
"@servicetitan/stylelint-config": "34.3.0-beta.
|
|
59
|
+
"@servicetitan/eslint-config": "34.3.0-beta.2",
|
|
60
|
+
"@servicetitan/install": "34.3.0-beta.2",
|
|
61
|
+
"@servicetitan/startup-utils": "34.3.0-beta.2",
|
|
62
|
+
"@servicetitan/stylelint-config": "34.3.0-beta.2",
|
|
63
63
|
"@svgr/webpack": "^8.1.0",
|
|
64
64
|
"@swc/cli": "^0.5.0",
|
|
65
65
|
"@swc/core": "1.15.18",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"cli-table3": "^0.6.5",
|
|
71
71
|
"cpx2": "8.0.0",
|
|
72
72
|
"css-loader": "~7.1.4",
|
|
73
|
-
"css-minimizer-webpack-plugin": "^
|
|
73
|
+
"css-minimizer-webpack-plugin": "^8.0.0",
|
|
74
74
|
"debounce": "^2.2.0",
|
|
75
75
|
"debug": "^4.4.3",
|
|
76
76
|
"deepmerge": "~4.3.1",
|
|
@@ -92,13 +92,13 @@
|
|
|
92
92
|
"eta": "^3.5.0",
|
|
93
93
|
"lodash.kebabcase": "^4.1.1",
|
|
94
94
|
"lodash.memoize": "^4.1.2",
|
|
95
|
-
"memfs": "~4.56.
|
|
95
|
+
"memfs": "~4.56.11",
|
|
96
96
|
"mini-css-extract-plugin": "~2.10.0",
|
|
97
97
|
"moment-locales-webpack-plugin": "~1.2.0",
|
|
98
98
|
"multimatch": "~8.0.0",
|
|
99
99
|
"patch-package": "^8.0.1",
|
|
100
100
|
"portfinder": "~1.0.38",
|
|
101
|
-
"postcss": "~8.5.
|
|
101
|
+
"postcss": "~8.5.8",
|
|
102
102
|
"prettier": "~3.8.1",
|
|
103
103
|
"sass": "~1.97.3",
|
|
104
104
|
"sass-loader": "~16.0.7",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"vite-plugin-css-injected-by-js": "^4.0.1",
|
|
117
117
|
"vite-plugin-svgr": "^4.5.0",
|
|
118
118
|
"vitest": "^4.1.0",
|
|
119
|
-
"webpack": "~5.105.
|
|
119
|
+
"webpack": "~5.105.4",
|
|
120
120
|
"webpack-assets-manifest": "~6.5.0",
|
|
121
121
|
"webpack-bundle-analyzer": "^5.2.0",
|
|
122
122
|
"webpack-dev-server": "~5.2.3",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTsConfig, log, logErrors } from '../../utils';
|
|
1
|
+
import { getTsConfig, log, logErrors, validateSharedDependenciesConsistency } from '../../utils';
|
|
2
2
|
import { bundle, getModuleType } from '../utils';
|
|
3
3
|
import { Command, CommandOptions } from './types';
|
|
4
4
|
|
|
@@ -15,6 +15,8 @@ export class BundlePackage extends Command<typeof options> {
|
|
|
15
15
|
static readonly options = options;
|
|
16
16
|
@logErrors
|
|
17
17
|
async execute() {
|
|
18
|
+
validateSharedDependenciesConsistency();
|
|
19
|
+
|
|
18
20
|
const {
|
|
19
21
|
config,
|
|
20
22
|
codeCoverage,
|
|
@@ -12,6 +12,8 @@ describe(`[startup/storybook-config] ${webpackFinal.name}`, () => {
|
|
|
12
12
|
{ test: /\.module\.css$/, use: ['style-loader', 'css-loader'] },
|
|
13
13
|
{ test: /\.module\.less$/, use: ['style-loader', 'less-loader'] },
|
|
14
14
|
{ test: /\.less$/, use: ['less-loader'] },
|
|
15
|
+
{ test: /\.module\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
|
16
|
+
{ test: /\.scss$/, use: ['style-loader', 'sass-loader'] },
|
|
15
17
|
{ test: /\.svg$/, use: ['svg-loader'] },
|
|
16
18
|
{ test: /\.css$/, use: ['css-loader'] },
|
|
17
19
|
];
|
|
@@ -33,7 +35,7 @@ describe(`[startup/storybook-config] ${webpackFinal.name}`, () => {
|
|
|
33
35
|
return new RegExp(`${extension.replaceAll('.', '\\.')}$`);
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
test.each(['.module.css', '.module.less', '.less', '.svg'])(
|
|
38
|
+
test.each(['.module.css', '.module.less', '.less', '.module.scss', '.scss', '.svg'])(
|
|
37
39
|
'adds %s rules to config',
|
|
38
40
|
extension => {
|
|
39
41
|
expect(subject().module!.rules).toContainEqual(
|
|
@@ -52,7 +52,7 @@ function getPlugins(context: BuildContext, overrides: Overrides) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function getRules(context: BuildContext, overrides: Overrides) {
|
|
55
|
-
const include = ['.module.css', '.module.less', '.less', '.svg'];
|
|
55
|
+
const include = ['.module.css', '.module.less', '.less', '.module.scss', '.scss', '.svg'];
|
|
56
56
|
const exclude = ['.css'];
|
|
57
57
|
|
|
58
58
|
const { rules } = rulesConfig(context, overrides);
|
package/src/vite/base-config.ts
CHANGED
|
@@ -45,6 +45,15 @@ export function createBaseConfig(context: BuildContext): InlineConfig {
|
|
|
45
45
|
configFile: false,
|
|
46
46
|
oxc: { legalComments: 'none' },
|
|
47
47
|
base: './',
|
|
48
|
+
css: {
|
|
49
|
+
modules: {
|
|
50
|
+
localsConvention: 'camelCaseOnly',
|
|
51
|
+
generateScopedName: isProduction ? '[local]__[hash:base64:5]' : '[local]',
|
|
52
|
+
},
|
|
53
|
+
preprocessorOptions: {
|
|
54
|
+
less: { math: 'always' },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
48
57
|
build: {
|
|
49
58
|
outDir: getOutputPath(context),
|
|
50
59
|
// Preserves shared deps in dist/bundle/shared/ when host rebuilds into dist/bundle/
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
isCustomStyleRules,
|
|
10
10
|
isWebComponent,
|
|
11
11
|
log,
|
|
12
|
-
validateSharedDependenciesConsistency,
|
|
13
12
|
} from '../utils';
|
|
14
13
|
import {
|
|
15
14
|
amdConfig,
|
|
@@ -104,8 +103,6 @@ export function createWebpackConfigs(options: {
|
|
|
104
103
|
useWatchConfig?: boolean;
|
|
105
104
|
watch?: boolean;
|
|
106
105
|
}): Configuration[] {
|
|
107
|
-
validateSharedDependenciesConsistency();
|
|
108
|
-
|
|
109
106
|
const { watch, useWatchConfig } = options;
|
|
110
107
|
const mode = watch || useWatchConfig ? 'development' : 'production';
|
|
111
108
|
const fallback = watch || useWatchConfig ? webpackDevConfigFileName : webpackProdConfigFileName;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "SwcCompilePackage", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return SwcCompilePackage;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _cli = require("@swc/cli");
|
|
12
|
-
const _debounce = /*#__PURE__*/ _interop_require_default(require("debounce"));
|
|
13
|
-
const _deepmerge = /*#__PURE__*/ _interop_require_default(require("deepmerge"));
|
|
14
|
-
const _utils = require("../../utils");
|
|
15
|
-
const _utils1 = require("../utils");
|
|
16
|
-
const _task = require("./task");
|
|
17
|
-
function _interop_require_default(obj) {
|
|
18
|
-
return obj && obj.__esModule ? obj : {
|
|
19
|
-
default: obj
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function overwriteMerge(_destinationArray, sourceArray) {
|
|
23
|
-
return sourceArray;
|
|
24
|
-
}
|
|
25
|
-
const typedefsPattern = '**/*.d.ts';
|
|
26
|
-
class SwcCompilePackage extends _task.Task {
|
|
27
|
-
async execute() {
|
|
28
|
-
const config = this.getConfig();
|
|
29
|
-
/* istanbul ignore next: debug only */ _utils.log.debug('swc-compile-package:config', ()=>JSON.stringify(config, null, 2));
|
|
30
|
-
/*
|
|
31
|
-
* @swc/cli@0.5.0 doesn't implement "ignore" in watch mode so debounce
|
|
32
|
-
* noisy output. See https://servicetitan.atlassian.net/browse/FAR-1592
|
|
33
|
-
* and DEVELOPER_NOTES in file://./../../../package.json
|
|
34
|
-
*/ const logSuccessResults = this.watch ? (0, _debounce.default)(this.logCompletionResults.bind(this), 200) : this.logCompletionResults.bind(this);
|
|
35
|
-
return new Promise((resolve, reject)=>{
|
|
36
|
-
(0, _cli.swcDir)({
|
|
37
|
-
...config,
|
|
38
|
-
callbacks: {
|
|
39
|
-
onSuccess: (e)=>{
|
|
40
|
-
logSuccessResults(this.taskTimer.add(e.duration));
|
|
41
|
-
if (!this.watch) {
|
|
42
|
-
resolve();
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
onFail: (e)=>{
|
|
46
|
-
_utils.log.text([
|
|
47
|
-
...e.reasons.values()
|
|
48
|
-
][0]);
|
|
49
|
-
this.logCompletionResults(this.taskTimer.add(e.duration));
|
|
50
|
-
if (!this.watch) {
|
|
51
|
-
reject(new Error('Compilation failed'));
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
getConfig() {
|
|
59
|
-
var _tsConfig_getValue;
|
|
60
|
-
const { source, destination } = (0, _utils.getFolders)();
|
|
61
|
-
const packageConfig = (0, _utils.getSwcCompilePackageConfiguration)();
|
|
62
|
-
const tsConfig = new _utils1.TSConfig((0, _utils.getTsConfig)());
|
|
63
|
-
const target = tsConfig.getValue('compilerOptions.target');
|
|
64
|
-
const legacyDecorator = tsConfig.getValue('compilerOptions.experimentalDecorators');
|
|
65
|
-
const decoratorMetadata = tsConfig.getValue('compilerOptions.emitDecoratorMetadata');
|
|
66
|
-
const sourceMaps = tsConfig.getValue('compilerOptions.sourceMap');
|
|
67
|
-
const module = (_tsConfig_getValue = tsConfig.getValue('compilerOptions.module')) === null || _tsConfig_getValue === void 0 ? void 0 : _tsConfig_getValue.toLowerCase();
|
|
68
|
-
const ignore = tsConfig.getValue('exclude', [
|
|
69
|
-
'**/*.d.ts',
|
|
70
|
-
'**/__tests__/*',
|
|
71
|
-
'**/*.test.*',
|
|
72
|
-
'**/__mocks__/*',
|
|
73
|
-
'**/*.stories.*'
|
|
74
|
-
]);
|
|
75
|
-
if (!ignore.includes(typedefsPattern)) {
|
|
76
|
-
ignore.push(typedefsPattern);
|
|
77
|
-
}
|
|
78
|
-
return (0, _deepmerge.default)({
|
|
79
|
-
cliOptions: {
|
|
80
|
-
watch: this.watch,
|
|
81
|
-
outDir: destination,
|
|
82
|
-
stripLeadingPaths: true,
|
|
83
|
-
extensions: [
|
|
84
|
-
'.ts',
|
|
85
|
-
'.tsx'
|
|
86
|
-
],
|
|
87
|
-
filenames: [
|
|
88
|
-
source
|
|
89
|
-
],
|
|
90
|
-
ignore
|
|
91
|
-
},
|
|
92
|
-
swcOptions: {
|
|
93
|
-
jsc: {
|
|
94
|
-
parser: {
|
|
95
|
-
syntax: 'typescript',
|
|
96
|
-
tsx: true,
|
|
97
|
-
decorators: true
|
|
98
|
-
},
|
|
99
|
-
target,
|
|
100
|
-
transform: {
|
|
101
|
-
legacyDecorator,
|
|
102
|
-
decoratorMetadata,
|
|
103
|
-
react: {
|
|
104
|
-
runtime: 'automatic'
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
sourceMaps,
|
|
109
|
-
module: {
|
|
110
|
-
type: module === 'commonjs' || module === 'nodenext' ? 'commonjs' : 'es6'
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}, packageConfig, {
|
|
114
|
-
arrayMerge: overwriteMerge,
|
|
115
|
-
clone: false
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
constructor({ watch }){
|
|
119
|
-
super({
|
|
120
|
-
name: 'swc-compile-package',
|
|
121
|
-
global: false,
|
|
122
|
-
watch
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
//# sourceMappingURL=swc-compile-package.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/tasks/swc-compile-package.ts"],"sourcesContent":["import { Options, swcDir } from '@swc/cli';\nimport debounce from 'debounce';\nimport deepmerge from 'deepmerge';\nimport { getFolders, getSwcCompilePackageConfiguration, getTsConfig, log } from '../../utils';\nimport { TSConfig } from '../utils';\nimport { Task } from './task';\n\ninterface Args {\n watch?: boolean;\n}\n\nfunction overwriteMerge(_destinationArray: unknown[], sourceArray: unknown[]) {\n return sourceArray;\n}\n\nconst typedefsPattern = '**/*.d.ts';\n\nexport class SwcCompilePackage extends Task {\n constructor({ watch }: Args) {\n super({ name: 'swc-compile-package', global: false, watch });\n }\n\n async execute(): Promise<void> {\n const config = this.getConfig();\n\n /* istanbul ignore next: debug only */\n log.debug('swc-compile-package:config', () => JSON.stringify(config, null, 2));\n\n /*\n * @swc/cli@0.5.0 doesn't implement \"ignore\" in watch mode so debounce\n * noisy output. See https://servicetitan.atlassian.net/browse/FAR-1592\n * and DEVELOPER_NOTES in file://./../../../package.json\n */\n const logSuccessResults = this.watch\n ? debounce(this.logCompletionResults.bind(this), 200)\n : this.logCompletionResults.bind(this);\n\n return new Promise((resolve, reject) => {\n swcDir({\n ...config,\n callbacks: {\n onSuccess: (e: { duration: number }) => {\n logSuccessResults(this.taskTimer.add(e.duration));\n if (!this.watch) {\n resolve();\n }\n },\n onFail: (e: { duration: number; reasons: Map<string, string> }) => {\n log.text([...e.reasons.values()][0]);\n this.logCompletionResults(this.taskTimer.add(e.duration));\n if (!this.watch) {\n reject(new Error('Compilation failed'));\n }\n },\n },\n });\n });\n }\n\n private getConfig(): Options {\n const { source, destination } = getFolders();\n const packageConfig = getSwcCompilePackageConfiguration();\n const tsConfig = new TSConfig(getTsConfig());\n const target = tsConfig.getValue('compilerOptions.target');\n const legacyDecorator = tsConfig.getValue('compilerOptions.experimentalDecorators');\n const decoratorMetadata = tsConfig.getValue('compilerOptions.emitDecoratorMetadata');\n const sourceMaps = tsConfig.getValue('compilerOptions.sourceMap');\n const module = tsConfig.getValue<string>('compilerOptions.module')?.toLowerCase();\n const ignore = tsConfig.getValue('exclude', [\n '**/*.d.ts',\n '**/__tests__/*',\n '**/*.test.*',\n '**/__mocks__/*',\n '**/*.stories.*',\n ]);\n\n if (!ignore.includes(typedefsPattern)) {\n ignore.push(typedefsPattern);\n }\n\n return deepmerge(\n {\n cliOptions: {\n watch: this.watch,\n outDir: destination,\n stripLeadingPaths: true,\n extensions: ['.ts', '.tsx'],\n filenames: [source],\n ignore,\n },\n swcOptions: {\n jsc: {\n parser: {\n syntax: 'typescript',\n tsx: true,\n decorators: true,\n },\n target,\n transform: {\n legacyDecorator,\n decoratorMetadata,\n react: {\n runtime: 'automatic',\n },\n },\n },\n sourceMaps,\n module: {\n type: module === 'commonjs' || module === 'nodenext' ? 'commonjs' : 'es6',\n },\n },\n },\n packageConfig,\n { arrayMerge: overwriteMerge, clone: false }\n );\n }\n}\n"],"names":["SwcCompilePackage","overwriteMerge","_destinationArray","sourceArray","typedefsPattern","Task","execute","config","getConfig","log","debug","JSON","stringify","logSuccessResults","watch","debounce","logCompletionResults","bind","Promise","resolve","reject","swcDir","callbacks","onSuccess","e","taskTimer","add","duration","onFail","text","reasons","values","Error","tsConfig","source","destination","getFolders","packageConfig","getSwcCompilePackageConfiguration","TSConfig","getTsConfig","target","getValue","legacyDecorator","decoratorMetadata","sourceMaps","module","toLowerCase","ignore","includes","push","deepmerge","cliOptions","outDir","stripLeadingPaths","extensions","filenames","swcOptions","jsc","parser","syntax","tsx","decorators","transform","react","runtime","type","arrayMerge","clone","name","global"],"mappings":";;;;+BAiBaA;;;eAAAA;;;qBAjBmB;iEACX;kEACC;uBAC0D;wBACvD;sBACJ;;;;;;AAMrB,SAASC,eAAeC,iBAA4B,EAAEC,WAAsB;IACxE,OAAOA;AACX;AAEA,MAAMC,kBAAkB;AAEjB,MAAMJ,0BAA0BK,UAAI;IAKvC,MAAMC,UAAyB;QAC3B,MAAMC,SAAS,IAAI,CAACC,SAAS;QAE7B,oCAAoC,GACpCC,UAAG,CAACC,KAAK,CAAC,8BAA8B,IAAMC,KAAKC,SAAS,CAACL,QAAQ,MAAM;QAE3E;;;;SAIC,GACD,MAAMM,oBAAoB,IAAI,CAACC,KAAK,GAC9BC,IAAAA,iBAAQ,EAAC,IAAI,CAACC,oBAAoB,CAACC,IAAI,CAAC,IAAI,GAAG,OAC/C,IAAI,CAACD,oBAAoB,CAACC,IAAI,CAAC,IAAI;QAEzC,OAAO,IAAIC,QAAQ,CAACC,SAASC;YACzBC,IAAAA,WAAM,EAAC;gBACH,GAAGd,MAAM;gBACTe,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ACnBc;YACJ;YACAS,YAAY;gBACRC,KAAK;oBACDC,QAAQ;wBACJC,QAAQ;wBACRC,KAAK;wBACLC,YAAY;oBAChB;oBACArB;oBACAsB,WAAW;wBACPpB;wBACAC;wBACAoB,OAAO;4BACHC,SAAS;wBACb;oBACJ;gBACJ;gBACApB;gBACAC,QAAQ;oBACJoB,MAAMpB,WAAW,cAAcA,WAAW,aAAa,aAAa;gBACxE;YACJ;QACJ,GACAT,eACA;YAAE8B,YAAYlE;YAAgBmE,OAAO;QAAM;IAEnD;IAjGA,YAAY,EAAEtD,KAAK,EAAQ,CAAE;QACzB,KAAK,CAAC;YAAEuD,MAAM;YAAuBC,QAAQ;YAAOxD;QAAM;IAC9D;AAgGJ"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "TscCompilePackage", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return TscCompilePackage;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _utils = require("../../utils");
|
|
12
|
-
const _clitask = require("./cli-task");
|
|
13
|
-
class TscCompilePackage extends _clitask.CliTask {
|
|
14
|
-
async execute() {
|
|
15
|
-
const tsConfig = (0, _utils.getTsConfig)();
|
|
16
|
-
await this.runChildProcess('tsc', [
|
|
17
|
-
this.watch ? '-w' : undefined,
|
|
18
|
-
'--pretty',
|
|
19
|
-
'--preserveWatchOutput',
|
|
20
|
-
'--noCheck',
|
|
21
|
-
'--composite',
|
|
22
|
-
'false',
|
|
23
|
-
'--declaration',
|
|
24
|
-
'false',
|
|
25
|
-
'--declarationMap',
|
|
26
|
-
'false',
|
|
27
|
-
'--tsBuildInfoFile',
|
|
28
|
-
'tsconfig.compile.tsbuildinfo',
|
|
29
|
-
'--project',
|
|
30
|
-
tsConfig
|
|
31
|
-
].filter((i)=>i !== undefined));
|
|
32
|
-
}
|
|
33
|
-
constructor({ watch }){
|
|
34
|
-
super({
|
|
35
|
-
name: 'tsc-compile-package',
|
|
36
|
-
global: false,
|
|
37
|
-
indicators: {
|
|
38
|
-
end: 'Watching for file changes.',
|
|
39
|
-
watchStart: 'Starting incremental compilation.'
|
|
40
|
-
},
|
|
41
|
-
watch
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=tsc-compile-package.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/tasks/tsc-compile-package.ts"],"sourcesContent":["import { getTsConfig } from '../../utils';\nimport { CliTask } from './cli-task';\n\ninterface Args {\n watch?: boolean;\n}\n\nexport class TscCompilePackage extends CliTask {\n constructor({ watch }: Args) {\n super({\n name: 'tsc-compile-package',\n global: false,\n indicators: {\n end: 'Watching for file changes.',\n watchStart: 'Starting incremental compilation.',\n },\n watch,\n });\n }\n\n async execute() {\n const tsConfig = getTsConfig();\n await this.runChildProcess(\n 'tsc',\n [\n this.watch ? '-w' : undefined,\n '--pretty',\n '--preserveWatchOutput',\n '--noCheck',\n '--composite',\n 'false',\n '--declaration',\n 'false',\n '--declarationMap',\n 'false',\n '--tsBuildInfoFile',\n 'tsconfig.compile.tsbuildinfo',\n '--project',\n tsConfig,\n ].filter(i => i !== undefined)\n );\n }\n}\n"],"names":["TscCompilePackage","CliTask","execute","tsConfig","getTsConfig","runChildProcess","watch","undefined","filter","i","name","global","indicators","end","watchStart"],"mappings":";;;;+BAOaA;;;eAAAA;;;uBAPe;yBACJ;AAMjB,MAAMA,0BAA0BC,gBAAO;IAa1C,MAAMC,UAAU;QACZ,MAAMC,WAAWC,IAAAA,kBAAW;QAC5B,MAAM,IAAI,CAACC,eAAe,CACtB,OACA;YACI,IAAI,CAACC,KAAK,GAAG,OAAOC;YACpB;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACA;YACAJ;SACH,CAACK,MAAM,CAACC,CAAAA,IAAKA,MAAMF;IAE5B;IAjCA,YAAY,EAAED,KAAK,EAAQ,CAAE;QACzB,KAAK,CAAC;YACFI,MAAM;YACNC,QAAQ;YACRC,YAAY;gBACRC,KAAK;gBACLC,YAAY;YAChB;YACAR;QACJ;IACJ;AAwBJ"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "TscCompile", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return TscCompile;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _utils = require("../../utils");
|
|
12
|
-
const _clitask = require("./cli-task");
|
|
13
|
-
function _define_property(obj, key, value) {
|
|
14
|
-
if (key in obj) {
|
|
15
|
-
Object.defineProperty(obj, key, {
|
|
16
|
-
value: value,
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true
|
|
20
|
-
});
|
|
21
|
-
} else {
|
|
22
|
-
obj[key] = value;
|
|
23
|
-
}
|
|
24
|
-
return obj;
|
|
25
|
-
}
|
|
26
|
-
class TscCompile extends _clitask.CliTask {
|
|
27
|
-
async execute() {
|
|
28
|
-
const packages = (0, _utils.getPackages)({
|
|
29
|
-
scope: this.args.scope,
|
|
30
|
-
ignore: this.args.ignore,
|
|
31
|
-
type: [
|
|
32
|
-
_utils.PackageType.TSC,
|
|
33
|
-
_utils.PackageType.Webpack
|
|
34
|
-
]
|
|
35
|
-
});
|
|
36
|
-
const tsConfigs = collapsePackages(packages).map(({ location })=>(0, _utils.getTsConfig)(location));
|
|
37
|
-
_utils.log.debug('tsc-compile', `${this.args.watch ? 'watching' : 'compiling'} ${tsConfigs.join(' ')}`);
|
|
38
|
-
await this.runChildProcess('tsc', [
|
|
39
|
-
'-b',
|
|
40
|
-
this.watch ? '-w' : undefined,
|
|
41
|
-
'--pretty',
|
|
42
|
-
'--preserveWatchOutput',
|
|
43
|
-
'--emitDeclarationOnly',
|
|
44
|
-
...tsConfigs
|
|
45
|
-
].filter((i)=>i !== undefined));
|
|
46
|
-
}
|
|
47
|
-
constructor(args){
|
|
48
|
-
super({
|
|
49
|
-
name: 'tsc-compile',
|
|
50
|
-
watch: args.watch,
|
|
51
|
-
global: true,
|
|
52
|
-
indicators: {
|
|
53
|
-
end: 'Watching for file changes.',
|
|
54
|
-
watchStart: 'Starting incremental compilation.'
|
|
55
|
-
}
|
|
56
|
-
}), _define_property(this, "args", void 0), this.args = args;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Exclude dependant packages as they will be built through project references
|
|
61
|
-
*/ function collapsePackages(packages) {
|
|
62
|
-
const dependencies = new Set(Object.values((0, _utils.getPackagesGraph)({
|
|
63
|
-
scope: packages.map(({ name })=>name)
|
|
64
|
-
})).flat());
|
|
65
|
-
return packages.filter(({ name })=>!dependencies.has(name));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=tsc-compile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/tasks/tsc-compile.ts"],"sourcesContent":["import { getPackages, getPackagesGraph, getTsConfig, log, Package, PackageType } from '../../utils';\nimport { CliTask } from './cli-task';\n\ninterface Args {\n ignore?: string | string[];\n scope?: string | string[];\n watch?: boolean;\n}\n\nexport class TscCompile extends CliTask {\n constructor(private readonly args: Args) {\n super({\n name: 'tsc-compile',\n watch: args.watch,\n global: true,\n indicators: {\n end: 'Watching for file changes.',\n watchStart: 'Starting incremental compilation.',\n },\n });\n }\n\n async execute() {\n const packages = getPackages({\n scope: this.args.scope,\n ignore: this.args.ignore,\n type: [PackageType.TSC, PackageType.Webpack],\n });\n\n const tsConfigs = collapsePackages(packages).map(({ location }) => getTsConfig(location));\n\n log.debug(\n 'tsc-compile',\n `${this.args.watch ? 'watching' : 'compiling'} ${tsConfigs.join(' ')}`\n );\n\n await this.runChildProcess(\n 'tsc',\n [\n '-b',\n this.watch ? '-w' : undefined,\n '--pretty',\n '--preserveWatchOutput',\n '--emitDeclarationOnly',\n ...tsConfigs,\n ].filter(i => i !== undefined)\n );\n }\n}\n\n/**\n * Exclude dependant packages as they will be built through project references\n */\nfunction collapsePackages(packages: Package[]) {\n const dependencies = new Set(\n Object.values(getPackagesGraph({ scope: packages.map(({ name }) => name) })).flat()\n );\n\n return packages.filter(({ name }) => !dependencies.has(name));\n}\n"],"names":["TscCompile","CliTask","execute","packages","getPackages","scope","args","ignore","type","PackageType","TSC","Webpack","tsConfigs","collapsePackages","map","location","getTsConfig","log","debug","watch","join","runChildProcess","undefined","filter","i","name","global","indicators","end","watchStart","dependencies","Set","Object","values","getPackagesGraph","flat","has"],"mappings":";;;;+BASaA;;;eAAAA;;;uBATyE;yBAC9D;;;;;;;;;;;;;;AAQjB,MAAMA,mBAAmBC,gBAAO;IAanC,MAAMC,UAAU;QACZ,MAAMC,WAAWC,IAAAA,kBAAW,EAAC;YACzBC,OAAO,IAAI,CAACC,IAAI,CAACD,KAAK;YACtBE,QAAQ,IAAI,CAACD,IAAI,CAACC,MAAM;YACxBC,MAAM;gBAACC,kBAAW,CAACC,GAAG;gBAAED,kBAAW,CAACE,OAAO;aAAC;QAChD;QAEA,MAAMC,YAAYC,iBAAiBV,UAAUW,GAAG,CAAC,CAAC,EAAEC,QAAQ,EAAE,GAAKC,IAAAA,kBAAW,EAACD;QAE/EE,UAAG,CAACC,KAAK,CACL,eACA,GAAG,IAAI,CAACZ,IAAI,CAACa,KAAK,GAAG,aAAa,YAAY,CAAC,EAAEP,UAAUQ,IAAI,CAAC,MAAM;QAG1E,MAAM,IAAI,CAACC,eAAe,CACtB,OACA;YACI;YACA,IAAI,CAACF,KAAK,GAAG,OAAOG;YACpB;YACA;YACA;eACGV;SACN,CAACW,MAAM,CAACC,CAAAA,IAAKA,MAAMF;IAE5B;IArCA,YAAY,AAAiBhB,IAAU,CAAE;QACrC,KAAK,CAAC;YACFmB,MAAM;YACNN,OAAOb,KAAKa,KAAK;YACjBO,QAAQ;YACRC,YAAY;gBACRC,KAAK;gBACLC,YAAY;YAChB;QACJ,iDATyBvB,OAAAA;IAU7B;AA4BJ;AAEA;;CAEC,GACD,SAASO,iBAAiBV,QAAmB;IACzC,MAAM2B,eAAe,IAAIC,IACrBC,OAAOC,MAAM,CAACC,IAAAA,uBAAgB,EAAC;QAAE7B,OAAOF,SAASW,GAAG,CAAC,CAAC,EAAEW,IAAI,EAAE,GAAKA;IAAM,IAAIU,IAAI;IAGrF,OAAOhC,SAASoB,MAAM,CAAC,CAAC,EAAEE,IAAI,EAAE,GAAK,CAACK,aAAaM,GAAG,CAACX;AAC3D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-bundle-routing-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/dev-bundle-routing-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,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CA6B1E"}
|