@modern-js/module-tools 2.21.0 → 2.22.0
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/CHANGELOG.md +41 -0
- package/compiled/@rollup/plugin-json/@rollup/pluginutils/types/index.d.ts +8 -2
- package/compiled/@rollup/plugin-json/estree/index.d.ts +677 -548
- package/compiled/@rollup/plugin-json/index.js +1 -1
- package/compiled/@rollup/plugin-json/package.json +1 -1
- package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +167 -150
- package/compiled/@rollup/plugin-json/types/index.d.ts +2 -2
- package/compiled/rollup/249.index.js +103 -0
- package/compiled/rollup/index.js +36 -21
- package/compiled/rollup/package.json +1 -1
- package/compiled/rollup/types/rollup.d.ts +167 -150
- package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +3 -105
- package/compiled/rollup-plugin-dts/index.js +1 -1
- package/compiled/rollup-plugin-dts/package.json +1 -1
- package/compiled/rollup-plugin-dts/rollup/dist/rollup.d.ts +167 -150
- package/dist/build.js +3 -1
- package/dist/build.js.map +1 -1
- package/dist/builder/build.js +37 -14
- package/dist/builder/build.js.map +1 -1
- package/dist/builder/clear.js +6 -2
- package/dist/builder/clear.js.map +1 -1
- package/dist/builder/copy.js +9 -3
- package/dist/builder/copy.js.map +1 -1
- package/dist/builder/dts/index.js +6 -2
- package/dist/builder/dts/index.js.map +1 -1
- package/dist/builder/dts/rollup.js +3 -1
- package/dist/builder/dts/rollup.js.map +1 -1
- package/dist/builder/dts/tsc.js +6 -2
- package/dist/builder/dts/tsc.js.map +1 -1
- package/dist/builder/index.js +3 -1
- package/dist/builder/index.js.map +1 -1
- package/dist/builder/platform.js +3 -1
- package/dist/builder/platform.js.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/command.js +12 -4
- package/dist/command.js.map +1 -1
- package/dist/config/defineConfig.js +6 -2
- package/dist/config/defineConfig.js.map +1 -1
- package/dist/config/legacySchema.js +21 -7
- package/dist/config/legacySchema.js.map +1 -1
- package/dist/config/normalize.js +18 -6
- package/dist/config/normalize.js.map +1 -1
- package/dist/config/schema.js +21 -7
- package/dist/config/schema.js.map +1 -1
- package/dist/config/transformLegacyConfig.js +30 -10
- package/dist/config/transformLegacyConfig.js.map +1 -1
- package/dist/constants/build.js +3 -1
- package/dist/constants/build.js.map +1 -1
- package/dist/constants/buildPresets.js +54 -18
- package/dist/constants/buildPresets.js.map +1 -1
- package/dist/constants/colors.js +9 -3
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/dts.js +12 -4
- package/dist/constants/dts.js.map +1 -1
- package/dist/constants/file.js +9 -3
- package/dist/constants/file.js.map +1 -1
- package/dist/constants/legacyBuildPresets.js +18 -6
- package/dist/constants/legacyBuildPresets.js.map +1 -1
- package/dist/constants/log.js +21 -7
- package/dist/constants/log.js.map +1 -1
- package/dist/dev.js +6 -2
- package/dist/dev.js.map +1 -1
- package/dist/error.js +18 -6
- package/dist/error.js.map +1 -1
- package/dist/hooks/build.js +6 -2
- package/dist/hooks/build.js.map +1 -1
- package/dist/hooks/dev.js +3 -1
- package/dist/hooks/dev.js.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/misc.js +3 -1
- package/dist/hooks/misc.js.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/locale/en.js +3 -1
- package/dist/locale/en.js.map +1 -1
- package/dist/locale/index.js +6 -2
- package/dist/locale/index.js.map +1 -1
- package/dist/locale/zh.js +3 -1
- package/dist/locale/zh.js.map +1 -1
- package/dist/plugins.js +3 -1
- package/dist/plugins.js.map +1 -1
- package/dist/types/config/index.d.ts +3 -0
- package/dist/types/config/index.js.map +1 -1
- package/dist/utils/builder.js +15 -5
- package/dist/utils/builder.js.map +1 -1
- package/dist/utils/common.js +3 -1
- package/dist/utils/common.js.map +1 -1
- package/dist/utils/config.js +15 -5
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/context.js +3 -1
- package/dist/utils/context.js.map +1 -1
- package/dist/utils/dts.js +15 -5
- package/dist/utils/dts.js.map +1 -1
- package/dist/utils/input.js +15 -5
- package/dist/utils/input.js.map +1 -1
- package/dist/utils/language.js +3 -1
- package/dist/utils/language.js.map +1 -1
- package/dist/utils/libuildPlugins.js +6 -2
- package/dist/utils/libuildPlugins.js.map +1 -1
- package/dist/utils/log.js +3 -1
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/onExit.js +3 -1
- package/dist/utils/onExit.js.map +1 -1
- package/dist/utils/path.js +3 -1
- package/dist/utils/path.js.map +1 -1
- package/dist/utils/print.js +21 -7
- package/dist/utils/print.js.map +1 -1
- package/dist/utils/style.js +12 -4
- package/dist/utils/style.js.map +1 -1
- package/dist/utils/tspathsTransform.js +3 -1
- package/dist/utils/tspathsTransform.js.map +1 -1
- package/package.json +16 -16
- package/compiled/@rollup/plugin-json/license +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;EAEaA,OAAK
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;EAEaA,OAAK;WAALA;;EACAC,MAAI;WAAJA;;EACAC,MAAI;WAAJA;;;AAFN,MAAMF,QAAa;EAAC;EAAI;EAAK;;AAC7B,MAAMC,OAAY;EAAC;EAAI;EAAK;;AAC5B,MAAMC,OAAY;EAAC;EAAI;EAAG;;","names":["green","blue","gray"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/colors.ts"],"sourcesContent":["import type { RGB } from '../types/color';\n\nexport const green: RGB = [96, 186, 154];\nexport const blue: RGB = [82, 221, 252];\nexport const gray: RGB = [36, 2, 45];\n"]}
|
package/dist/constants/dts.js
CHANGED
|
@@ -10,10 +10,18 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
defaultTransformedFunctions: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
defaultTransformedFunctions: function() {
|
|
14
|
+
return defaultTransformedFunctions;
|
|
15
|
+
},
|
|
16
|
+
defaultTsConfigPath: function() {
|
|
17
|
+
return defaultTsConfigPath;
|
|
18
|
+
},
|
|
19
|
+
watchDoneText: function() {
|
|
20
|
+
return watchDoneText;
|
|
21
|
+
},
|
|
22
|
+
dtsTempDirectory: function() {
|
|
23
|
+
return dtsTempDirectory;
|
|
24
|
+
}
|
|
17
25
|
});
|
|
18
26
|
const defaultTransformedFunctions = [
|
|
19
27
|
"require",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;EAAaA,6BAA2B
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;EAAaA,6BAA2B;WAA3BA;;EAoBAC,qBAAmB;WAAnBA;;EACAC,eAAa;WAAbA;;EACAC,kBAAgB;WAAhBA;;;AAtBN,MAAMH,8BAA8B;EACzC;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAGA;EACA;;AAGK,MAAMC,sBAAsB;AAC5B,MAAMC,gBAAgB;AACtB,MAAMC,mBAAmB;","names":["defaultTransformedFunctions","defaultTsConfigPath","watchDoneText","dtsTempDirectory"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/dts.ts"],"sourcesContent":["export const defaultTransformedFunctions = [\n 'require',\n 'require.resolve',\n 'System.import',\n\n // Jest methods\n 'jest.genMockFromModule',\n 'jest.mock',\n 'jest.unmock',\n 'jest.doMock',\n 'jest.dontMock',\n 'jest.setMock',\n 'jest.requireActual',\n 'jest.requireMock',\n\n // Older Jest methods\n 'require.requireActual',\n 'require.requireMock',\n];\n\nexport const defaultTsConfigPath = './tsconfig.json';\nexport const watchDoneText = 'Watching for file changes';\nexport const dtsTempDirectory = 'node_modules/.dts-temp';\n"]}
|
package/dist/constants/file.js
CHANGED
|
@@ -10,9 +10,15 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
assetExts: ()
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
assetExts: function() {
|
|
14
|
+
return assetExts;
|
|
15
|
+
},
|
|
16
|
+
styleExts: function() {
|
|
17
|
+
return styleExts;
|
|
18
|
+
},
|
|
19
|
+
dtsAliasExts: function() {
|
|
20
|
+
return dtsAliasExts;
|
|
21
|
+
}
|
|
16
22
|
});
|
|
17
23
|
const assetExts = [
|
|
18
24
|
".png",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;EAAaA,WAAS
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;EAAaA,WAAS;WAATA;;EACAC,WAAS;WAATA;;EACAC,cAAY;WAAZA;;;AAFN,MAAMF,YAAY;EAAC;EAAQ;EAAQ;;AACnC,MAAMC,YAAY;EAAC;EAAQ;EAAS;EAAS;;AAC7C,MAAMC,eAAe;EAAC;;","names":["assetExts","styleExts","dtsAliasExts"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/file.ts"],"sourcesContent":["export const assetExts = ['.png', '.jpg', '.svg'];\nexport const styleExts = ['.css', '.less', '.sass', '.scss'];\nexport const dtsAliasExts = ['.d.ts'];\n"]}
|
|
@@ -10,12 +10,24 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
universalJsPreset: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
universalJsPreset: function() {
|
|
14
|
+
return universalJsPreset;
|
|
15
|
+
},
|
|
16
|
+
universalJsLitePreset: function() {
|
|
17
|
+
return universalJsLitePreset;
|
|
18
|
+
},
|
|
19
|
+
browserJsPreset: function() {
|
|
20
|
+
return browserJsPreset;
|
|
21
|
+
},
|
|
22
|
+
browserJsLitePreset: function() {
|
|
23
|
+
return browserJsLitePreset;
|
|
24
|
+
},
|
|
25
|
+
nodeJsPreset: function() {
|
|
26
|
+
return nodeJsPreset;
|
|
27
|
+
},
|
|
28
|
+
legacyPresets: function() {
|
|
29
|
+
return legacyPresets;
|
|
30
|
+
}
|
|
19
31
|
});
|
|
20
32
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
33
|
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAYaA,mBAAiB
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAYaA,mBAAiB;WAAjBA;;EA8BAC,uBAAqB;WAArBA;;EA6BAC,iBAAe;WAAfA;;EA8BAC,qBAAmB;WAAnBA;;EA8BAC,cAAY;WAAZA;;EAuBAC,eAAa;WAAbA;;;;iEA1JI;AAGjB,MAAMC,mCAAmC;EACvCC,UAAU;IACR;MACEC,MAAMC,cAAKC,KAAK,OAAO;MACvBC,SAAS;IACX;;AAEJ;AAEO,MAAMX,oBAAwC;EACnD;IACEY,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,MAAMV;IACNW,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXK,KAAK;MAAEC,MAAM;IAAK;IAClBH,QAAQ;EACV;;AAGK,MAAMd,wBAA4C;EACvD;IACEW,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,MAAMV;IACNW,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXK,KAAK;MAAEC,MAAM;IAAK;IAClBH,QAAQ;EACV;;AAEK,MAAMb,kBAAsC;EACjD;IACEU,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRC,MAAMV;IACNW,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXK,KAAK;MAAEC,MAAM;IAAK;IAClBH,QAAQ;EACV;;AAGK,MAAMZ,sBAA0C;EACrD;IACES,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLF,QAAQ;IACRC,MAAMV;EACR;EACA;IACEM,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;IACRE,KAAK;EACP;EACA;IACEL,WAAW;IACXK,KAAK;MAAEC,MAAM;IAAK;IAClBH,QAAQ;EACV;;AAGK,MAAMX,eAAmC;EAC9C;IACEQ,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLF,QAAQ;IACRC,MAAMV;EACR;EACA;IACEM,WAAW;IACXC,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLF,QAAQ;EACV;EACA;IACEH,WAAW;IACXK,KAAK;MAAEC,MAAM;IAAK;IAClBH,QAAQ;EACV;;AAGK,MAAMV,gBAAgB;EAC3B,gBAAgBL;EAChBmB,cAAcnB;EACd,qBAAqBC;EACrBmB,mBAAmBnB;EACnB,cAAcC;EACdmB,YAAYnB;EACZ,mBAAmBC;EACnBmB,iBAAiBnB;EACjB,WAAWC;EACXmB,SAASnB;AACX;","names":["universalJsPreset","universalJsLitePreset","browserJsPreset","browserJsLitePreset","nodeJsPreset","legacyPresets","legacyWithSourceCodeToCopyConfig","patterns","from","path","join","context","buildType","format","target","outDir","copy","dts","only","UNIVERSAL_JS","UNIVERSAL_JS_LITE","BROWSER_JS","BROWSER_JS_LITE","NODE_JS"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/legacyBuildPresets.ts"],"sourcesContent":["import path from 'path';\nimport type { PartialBuildConfig } from '../types';\n\nconst legacyWithSourceCodeToCopyConfig = {\n patterns: [\n {\n from: path.join('src', '**/*.{less,sass,scss}'),\n context: 'src',\n },\n ],\n};\n\nexport const universalJsPreset: PartialBuildConfig = [\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n outDir: './dist/js/treeshaking',\n copy: legacyWithSourceCodeToCopyConfig,\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'cjs',\n target: 'es6',\n outDir: './dist/js/node',\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es6',\n outDir: './dist/js/modern',\n dts: false,\n },\n {\n buildType: 'bundleless',\n dts: { only: true },\n outDir: './dist/types',\n },\n];\n\nexport const universalJsLitePreset: PartialBuildConfig = [\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n outDir: './dist/js/treeshaking',\n copy: legacyWithSourceCodeToCopyConfig,\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'cjs',\n target: 'es6',\n outDir: './dist/js/node',\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n outDir: './dist/js/modern',\n dts: false,\n },\n {\n buildType: 'bundleless',\n dts: { only: true },\n outDir: './dist/types',\n },\n];\nexport const browserJsPreset: PartialBuildConfig = [\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n outDir: './dist/js/treeshaking',\n copy: legacyWithSourceCodeToCopyConfig,\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es6',\n outDir: './dist/js/node',\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es6',\n outDir: './dist/js/modern',\n dts: false,\n },\n {\n buildType: 'bundleless',\n dts: { only: true },\n outDir: './dist/types',\n },\n];\n\nexport const browserJsLitePreset: PartialBuildConfig = [\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n dts: false,\n outDir: './dist/js/treeshaking',\n copy: legacyWithSourceCodeToCopyConfig,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n outDir: './dist/js/node',\n dts: false,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n outDir: './dist/js/modern',\n dts: false,\n },\n {\n buildType: 'bundleless',\n dts: { only: true },\n outDir: './dist/types',\n },\n];\n\nexport const nodeJsPreset: PartialBuildConfig = [\n {\n buildType: 'bundleless',\n format: 'cjs',\n target: 'es6',\n dts: false,\n outDir: './dist/js/node',\n copy: legacyWithSourceCodeToCopyConfig,\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es6',\n dts: false,\n outDir: './dist/js/modern',\n },\n {\n buildType: 'bundleless',\n dts: { only: true },\n outDir: './dist/types',\n },\n];\n\nexport const legacyPresets = {\n 'universal-js': universalJsPreset,\n UNIVERSAL_JS: universalJsPreset,\n 'universal-js-lite': universalJsLitePreset,\n UNIVERSAL_JS_LITE: universalJsLitePreset,\n 'browser-js': browserJsPreset,\n BROWSER_JS: browserJsPreset,\n 'browser-js-lite': browserJsLitePreset,\n BROWSER_JS_LITE: browserJsLitePreset,\n 'node-js': nodeJsPreset,\n NODE_JS: nodeJsPreset,\n};\n"]}
|
package/dist/constants/log.js
CHANGED
|
@@ -10,13 +10,27 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
SectionTitleStatus: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
SectionTitleStatus: function() {
|
|
14
|
+
return SectionTitleStatus;
|
|
15
|
+
},
|
|
16
|
+
BundleDtsLogPrefix: function() {
|
|
17
|
+
return BundleDtsLogPrefix;
|
|
18
|
+
},
|
|
19
|
+
BundlelessDtsLogPrefix: function() {
|
|
20
|
+
return BundlelessDtsLogPrefix;
|
|
21
|
+
},
|
|
22
|
+
CopyLogPrefix: function() {
|
|
23
|
+
return CopyLogPrefix;
|
|
24
|
+
},
|
|
25
|
+
buildSuccessText: function() {
|
|
26
|
+
return buildSuccessText;
|
|
27
|
+
},
|
|
28
|
+
reportFile1LineText: function() {
|
|
29
|
+
return reportFile1LineText;
|
|
30
|
+
},
|
|
31
|
+
reportFile2LineText: function() {
|
|
32
|
+
return reportFile2LineText;
|
|
33
|
+
}
|
|
20
34
|
});
|
|
21
35
|
var SectionTitleStatus;
|
|
22
36
|
(function(SectionTitleStatus2) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;EAMaA,oBAAkB;WAAlBA;;EACAC,wBAAsB;WAAtBA;;EACAC,eAAa;WAAbA;;EACAC,kBAAgB;WAAhBA;;EAEAC,qBAAmB;WAAnBA;;EACAC,qBAAmB;WAAnBA;;;IAZN;UAAKC,qBAAkB;AAAlBA,0CACVC;AADUD,0CAEVE;AAFUF,0CAGVG;GAHUH;AAML,MAAMN,qBAAqB;AAC3B,MAAMC,yBAAyB;AAC/B,MAAMC,gBAAgB;AACtB,MAAMC,mBAAmB;AAEzB,MAAMC,sBAAsB;AAC5B,MAAMC,sBAAsB;","names":["BundleDtsLogPrefix","BundlelessDtsLogPrefix","CopyLogPrefix","buildSuccessText","reportFile1LineText","reportFile2LineText","SectionTitleStatus","Success","Fail","Log"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/log.ts"],"sourcesContent":["export enum SectionTitleStatus {\n Success,\n Fail,\n Log,\n}\n\nexport const BundleDtsLogPrefix = '[Bundle:DTS]';\nexport const BundlelessDtsLogPrefix = '[Bundleless:DTS]';\nexport const CopyLogPrefix = '[Copy]';\nexport const buildSuccessText = 'Build succeed';\n\nexport const reportFile1LineText = 'Bundle Files';\nexport const reportFile2LineText = 'Size';\n"]}
|
package/dist/dev.js
CHANGED
|
@@ -10,8 +10,12 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
showMenu: ()
|
|
14
|
-
|
|
13
|
+
showMenu: function() {
|
|
14
|
+
return showMenu;
|
|
15
|
+
},
|
|
16
|
+
dev: function() {
|
|
17
|
+
return dev;
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
17
21
|
const _logger = require("@modern-js/utils/logger");
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAyCaA,UAAQ
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAyCaA,UAAQ;WAARA;;EAmDAC,KAAG;WAAHA;;;;wBA3FU;AAwChB,MAAMD,WAAW,OACtBE,OACAC,eACAC,KACAC,YACG;AACH,QAAM,EAAEC,OAAOC,SAAQ,IAAK,MAAM,iFAAO;AACzC,QAAMC,SAASJ,IAAIK,eAAc;AAEjC,QAAMC,YAAYJ,MAAMK,IAAI,KAAK,KAAK;AACtC,QAAMC,UAAUV,MACbW,IAAIC,UAAQA,KAAKC,QAAQ,EACzBC,OAAOD,cAAY,OAAOA,aAAa;AAC1C,QAAME,YAAY;IAChB;MACEC,MAAM;MACNC,SAAST,UAAU;MACnBU,MAAM;MACNR;IACF;;AAGF,QAAMS,eAAe,MAAMb,OAAOc,cAAcL;AAChD,QAAMM,SAAoC,MAAMhB,SAASiB,OACvDH,aAAaI,WAAW,IAAIJ,eAAeJ,SAAS;AAEtD,QAAMT,OAAOkB,aAAa;IAAEH;IAAQI,UAAUzB;EAAM;AAEpD,QAAM0B,iBAAiB1B,MAAM2B,KAC3Bf;QAAQA;AAAAA,mCAAKC,cAAQ,QAAbD,oDAAegB,WAAUP,OAAOQ;;AAE1C,MAAIH,gBAAgB;AAOlB,UAAMpB,OAAOwB,cAAcJ;AAC3B,UAAMA,eAAeK,OAAO9B,eAAe;MACzC+B,aAAa7B,QAAQ6B;IACvB;EAOF;AACF;AAEO,MAAMjC,MAAM,OACjBkC,SACAjC,OACAE,KACAC,YACG;AACH,QAAM,EAAEC,MAAK,IAAK,MAAM,iFAAO;AAC/B,QAAM,EAAE8B,MAAK,IAAK,MAAM,iFAAO;AAC/B,QAAM5B,SAASJ,IAAIK,eAAc;AACjC,MAAIP,MAAMuB,WAAW,GAAG;AACtB,UAAMY,QAAQ,MAAM,iFAAO;AAC3B,UAAMC,gBAAgB,MAAM9B,OAAO+B,WACjCF,MAAMG,KAAKC,EAAEJ,MAAMK,WAAWC,IAAI1C,IAAI2C,UAAU;AAGlDC,mBAAOC,KAAKR;AAEZS,YAAQC,KAAK;EACf;AAEA,MAAI9C,MAAMuB,WAAW,GAAG;QAIhBvB;QAAAA;AAHN2C,mBAAOC,KACLxC,MAAMK,IAAG,GAAIyB,OACX,8EACElC,kDAAM,GAAGa,cAAQ,QAAjBb,wDAAmBgB,UAAI,QAAvBhB,2DAA2BA,MAAM,GAAGgB,OACnC;AAGP,UAAMJ,OAAOZ,MAAM;AAQnB,UAAMM,OAAOwB,cAAclB;AAC3B,UAAMA,KAAKmB,OAAOE,SAAS;MAAED,aAAa7B,QAAQ6B;IAAY;EAMhE,WAAWhC,MAAMuB,SAAS,GAAG;AAC3B,UAAMzB,SAASE,OAAOiC,SAAS/B,KAAKC;EACtC;AACF;","names":["showMenu","dev","metas","devCmdOptions","api","context","chalk","inquirer","runner","useHookRunners","menuTitle","rgb","choices","map","meta","menuItem","filter","questions","name","message","type","newQuestions","beforeDevMenu","result","prompt","length","afterDevMenu","devTools","currentDevTool","find","value","choiceDevTool","beforeDevTask","action","isTsProject","options","green","local","noDevToolsLog","noDevTools","i18n","t","localeKeys","log","noDevtools","logger","info","process","exit"],"sources":["../src/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/dev.ts"],"sourcesContent":["import type { PluginAPI } from '@modern-js/core';\nimport { logger } from '@modern-js/utils/logger';\nimport type { DevCommandOptions } from './types/command';\nimport type { ModuleContext } from './types/context';\nimport type { DevToolData, ModuleTools } from './types';\n\n// TODO: watch build\n// export const ensureFirstBuild = async (\n// api: PluginAPI<ModuleTools>,\n// context: ModuleContext,\n// cliOptions: DevCommandOptions,\n// options: {\n// watch?: boolean;\n// disableRunBuild: boolean;\n// appDirectory: string;\n// },\n// ) => {\n// if (!options.disableRunBuild) {\n// const { build } = await import('./build');\n// const defaultCmdOptions: BuildCommandOptions = {\n// tsconfig: cliOptions.tsconfig,\n// watch: options.watch ?? false,\n// dts: true,\n// clear: true,\n// };\n// await build(api, defaultCmdOptions, context);\n// }\n// };\n\n// export const watchBuild = async (\n// api: PluginAPI<ModuleTools>,\n// context: ModuleContext,\n// cliOptions: DevCommandOptions,\n// options: {\n// disableRunBuild: boolean;\n// appDirectory: string;\n// },\n// ) => {\n// await ensureFirstBuild(api, context, cliOptions, { ...options, watch: true });\n// };\n\nexport const showMenu = async (\n metas: DevToolData[],\n devCmdOptions: DevCommandOptions,\n api: PluginAPI<ModuleTools>,\n context: ModuleContext,\n) => {\n const { chalk, inquirer } = await import('@modern-js/utils');\n const runner = api.useHookRunners();\n\n const menuTitle = chalk.rgb(255, 153, 0);\n const choices = metas\n .map(meta => meta.menuItem)\n .filter(menuItem => typeof menuItem === 'object');\n const questions = [\n {\n name: 'choiceDevTool',\n message: menuTitle('选择调试工具'),\n type: 'list',\n choices,\n },\n ];\n\n const newQuestions = await runner.beforeDevMenu(questions);\n const result: { choiceDevTool: string } = await inquirer.prompt(\n newQuestions.length !== 0 ? newQuestions : questions,\n );\n await runner.afterDevMenu({ result, devTools: metas });\n\n const currentDevTool = metas.find(\n meta => meta.menuItem?.value === result.choiceDevTool,\n );\n if (currentDevTool) {\n // TODO: watch build\n // await ensureFirstBuild(api, context, devCmdOptions, {\n // disableRunBuild: currentDevTool.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n\n await runner.beforeDevTask(currentDevTool);\n await currentDevTool.action(devCmdOptions, {\n isTsProject: context.isTsProject,\n });\n\n // TODO: watch build\n // await watchBuild(api, context, devCmdOptions, {\n // disableRunBuild: currentDevTool.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n }\n};\n\nexport const dev = async (\n options: DevCommandOptions,\n metas: DevToolData[],\n api: PluginAPI<ModuleTools>,\n context: ModuleContext,\n) => {\n const { chalk } = await import('@modern-js/utils');\n const { green } = await import('./constants/colors');\n const runner = api.useHookRunners();\n if (metas.length === 0) {\n const local = await import('./locale');\n const noDevToolsLog = await runner.noDevTools(\n local.i18n.t(local.localeKeys.log.dev.noDevtools),\n );\n\n logger.info(noDevToolsLog);\n // eslint-disable-next-line no-process-exit\n process.exit(0);\n }\n\n if (metas.length === 1) {\n logger.info(\n chalk.rgb(...green)(\n `Only one dev tooling is currently detected as available, run it directly [${\n metas[0].menuItem?.name ?? metas[0].name\n }]`,\n ),\n );\n const meta = metas[0];\n\n // TODO: watch build\n // await ensureFirstBuild(api, context, options, {\n // disableRunBuild: meta.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n\n await runner.beforeDevTask(meta);\n await meta.action(options, { isTsProject: context.isTsProject });\n // TODO: watch build\n // await watchBuild(api, context, options, {\n // disableRunBuild: meta.disableRunBuild ?? false,\n // appDirectory: context.appDirectory,\n // });\n } else if (metas.length > 1) {\n await showMenu(metas, options, api, context);\n }\n};\n"]}
|
package/dist/error.js
CHANGED
|
@@ -10,12 +10,24 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
padSpaceWith: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
padSpaceWith: function() {
|
|
14
|
+
return padSpaceWith;
|
|
15
|
+
},
|
|
16
|
+
InternalBuildError: function() {
|
|
17
|
+
return InternalBuildError;
|
|
18
|
+
},
|
|
19
|
+
InternalDTSError: function() {
|
|
20
|
+
return InternalDTSError;
|
|
21
|
+
},
|
|
22
|
+
ModuleBuildError: function() {
|
|
23
|
+
return ModuleBuildError;
|
|
24
|
+
},
|
|
25
|
+
isInternalError: function() {
|
|
26
|
+
return isInternalError;
|
|
27
|
+
},
|
|
28
|
+
isExecaError: function() {
|
|
29
|
+
return isExecaError;
|
|
30
|
+
}
|
|
19
31
|
});
|
|
20
32
|
const _define_property = require("@swc/helpers/_/_define_property");
|
|
21
33
|
const _utils = require("@modern-js/utils");
|
package/dist/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAIaA,cAAY
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAIaA,cAAY;WAAZA;;EA8BAC,oBAAkB;WAAlBA;;EAkEAC,kBAAgB;WAAhBA;;EAuCAC,kBAAgB;WAAhBA;;EAQAC,iBAAe;WAAfA;;EAUAC,cAAY;WAAZA;;;;uBA7JS;AAIf,MAAML,eAAe,CAC1BM,KACAC,SACAC,OAGI,CAAC,MACF;AACH,QAAM,EAAEC,SAAS,KAAKC,MAAK,IAAKF;AAChC,QAAMG,IAAIL,IAAIM;AACd,QAAMC,UAAUJ,OAAOG;AACvB,QAAME,SAASP,UAAUI,IAAIE;AAG7B,MAAIC,WAAW,GAAG;AAChB,YAAQJ,QAAQA,MAAMJ,OAAOA,OAAOG;EACtC;AAGA,MAAIK,SAAS,GAAG;AACd,UAAMC,SAAST,IAAIU,OAAOT,UAAU,GAAG;AACvC,QAAIG,OAAO;AACT,aAAOA,MAAMJ,OAAOS,OAAOE,QAAQX,KAAK,MAAMG;IAChD;AACA,WAAOM,SAASN;EAClB;AAEA,SAAOH;AACT;AAEO,MAAML,2BAA2BiB;EA2BtCC,WAAW;AACT,WAAO,KAAKC,YAAW,EAAGC,KAAK;EACjC;EAEAD,cAAc;AACZ,UAAME,OAAiB;AACvB,UAAM,EAAEC,GAAGC,WAAWC,QAAQC,OAAM,IAAK;AACzC,UAAMC,QAAQ;AACd,UAAMC,QAAQ,KAAK5B,aAAa,GAAGwB,qBAAqBG,QAAQ,GAAG;MACjEjB,OAAOmB,aAAMC,IAAIC;MACjBtB,QAAQ;IACV;AACA,UAAMuB,YAAYhC,aAAa,mBAAmB0B,WAAWC,OAAO;MAClElB,QAAQ;IACV;AACA,UAAMwB,YAAYjC,aAAa,mBAAmByB,WAAWE,OAAO;MAClElB,QAAQ;IACV;AACA,UAAMyB,YAAYlC,aAAa,IAAIgB,OAAOW,QAAQ,GAAG,MAAMA,OAAO;MAChElB,QAAQ;IACV;AACA,UAAM0B,UAAUnC,aAAa,IAAIgB,OAAOW,QAAQ,GAAG,MAAMA,OAAO;MAC9DlB,QAAQ;IACV;AACAa,SAAKc,KACHF,WACAN,OACAI,WACAC,WACAE,SACAN,aAAMQ,KAAKC,KAAKP,UAAU;uBAA0B;AAEtDT,SAAKc,KAAKb,EAAEJ,SAAQ;AACpBG,SAAKc,KAAKb,EAAEgB,SAAS;AAErB,WAAOjB;EACT;EAtDAkB,YACEjB,GACAf,MAKA;AACA,UAAMe,EAAEkB,OAAO;AAhBjB,6BAAOjB,aAAP;AAEA,6BAAOC,UAAP;AAEA,6BAAOC,UAAP;AAEA,6BAAQH,KAAR;AAYEL,UAAMwB,kBAAkB,MAAM,KAAKF,WAAW;AAE9C,SAAKjB,IAAIA;AACT,SAAKC,YAAYhB,KAAKgB;AACtB,SAAKC,SAASjB,KAAKiB;AACnB,SAAKC,SAASlB,KAAKkB;EACrB;AAuCF;AAEO,MAAMxB,yBAAyBgB;EAcpCC,WAAW;AACT,WAAO,KAAKC,YAAW,EAAGC,KAAK;EACjC;EAEAD,cAAc;AACZ,UAAME,OAAiB;AACvB,UAAM,EAAEC,GAAGC,UAAS,IAAK;AACzBF,SAAKc,KAAKP,aAAMC,IAAIQ,KAAK,GAAGd,uBAAuB;AACnD,QAAInB,aAAakB,IAAI;AAMnB,UAAIA,EAAEgB,OAAO;YACDhB;AAAVD,aAAKc,MAAKb,aAAEgB,WAAK,QAAPhB,wCAASN,QAAQ,GAAGM,EAAEoB,SAASpB,EAAEqB,gBAAgB;MAC7D;IACF,OAAO;AACLtB,WAAKc,KAAKb,EAAEgB,KAAK;IACnB;AAEA,WAAOjB;EACT;EA/BAkB,YAAYjB,GAAuBf,MAAgC;AACjE,UAAMe,EAAEkB,OAAO;AALjB,6BAAOjB,aAAP;AAEA,6BAAQD,KAAR;AAKEL,UAAMwB,kBAAkB,MAAM,KAAKF,WAAW;AAE9C,SAAKjB,IAAIA;AACT,SAAKC,YAAYhB,KAAKgB;EACxB;AAyBF;AAEO,MAAMrB,yBAAyBe;EACpCsB,YAAYjB,GAA0C;AACpD,UAAM;;EAAOA,GAAG;AAChBL,UAAMwB,kBAAkB,MAAM,KAAKF,WAAW;AAC9C,SAAKG,OAAO;EACd;AACF;AAEO,MAAMvC,kBAAkB,CAC7BmB,MAC+C;AAC/C,MAAIA,aAAatB,sBAAsBsB,aAAarB,kBAAkB;AACpE,WAAO;EACT;AAEA,SAAO;AACT;AAEO,MAAMG,eAAe,CAACkB,MAA4B;AACvD,MAAIA,EAAEsB,QAAQ;AACZ,WAAO;EACT;AAEA,SAAO;AACT;","names":["padSpaceWith","InternalBuildError","InternalDTSError","ModuleBuildError","isInternalError","isExecaError","str","targetL","opts","endStr","style","l","length","endStrL","resetL","padStr","padEnd","replace","Error","toString","formatError","join","msgs","e","buildType","target","format","textL","title","chalk","red","underline","formatMsg","targetMsg","startLine","endLine","push","blue","bold","stack","constructor","message","captureStackTrace","name","shortMessage","stdout"],"sources":["../src/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/error.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\nimport type { ExecaError } from '@modern-js/utils';\nimport type { BuildType, Format, Target } from './types';\n\nexport const padSpaceWith = (\n str: string,\n targetL: number,\n opts: {\n endStr?: string;\n style?: (s: string) => string;\n } = {},\n) => {\n const { endStr = '|', style } = opts;\n const l = str.length;\n const endStrL = endStr.length;\n const resetL = targetL - l - endStrL;\n\n // str is 'aaa', targetL is 4, result is 'aaa|'\n if (resetL === 0) {\n return (style ? style(str) : str) + endStr;\n }\n\n // str is 'aaa', targetL is 5, result is 'aaa |'\n if (resetL > 0) {\n const padStr = str.padEnd(targetL - 1, ' ');\n if (style) {\n return style(str) + padStr.replace(str, '') + endStr;\n }\n return padStr + endStr;\n }\n\n return str;\n};\n\nexport class InternalBuildError extends Error {\n public buildType: BuildType;\n\n public target: Target;\n\n public format: Format;\n\n private e: Error;\n\n constructor(\n e: Error,\n opts: {\n buildType: BuildType;\n format: Format;\n target: Target;\n },\n ) {\n super(e.message);\n\n Error.captureStackTrace(this, this.constructor);\n\n this.e = e;\n this.buildType = opts.buildType;\n this.target = opts.target;\n this.format = opts.format;\n }\n\n toString() {\n return this.formatError().join('\\n');\n }\n\n formatError() {\n const msgs: string[] = [];\n const { e, buildType, target, format } = this;\n const textL = 25;\n const title = `│ ${padSpaceWith(`${buildType} failed:`, textL - 2, {\n style: chalk.red.underline,\n endStr: '│',\n })}`;\n const formatMsg = padSpaceWith(`│ - format is \"${format}\"`, textL, {\n endStr: '│',\n });\n const targetMsg = padSpaceWith(`│ - target is \"${target}\"`, textL, {\n endStr: '│',\n });\n const startLine = padSpaceWith('╭'.padEnd(textL - 1, '─'), textL, {\n endStr: '╮',\n });\n const endLine = padSpaceWith('╰'.padEnd(textL - 1, '─'), textL, {\n endStr: '╯',\n });\n msgs.push(\n startLine,\n title,\n formatMsg,\n targetMsg,\n endLine,\n chalk.blue.bold.underline(`\\nDetailed Information: `),\n );\n msgs.push(e.toString());\n msgs.push(e.stack || '');\n\n return msgs;\n }\n}\n\nexport class InternalDTSError extends Error {\n public buildType: BuildType;\n\n private e: Error;\n\n constructor(e: Error | ExecaError, opts: { buildType: BuildType }) {\n super(e.message);\n\n Error.captureStackTrace(this, this.constructor);\n\n this.e = e;\n this.buildType = opts.buildType;\n }\n\n toString() {\n return this.formatError().join('\\n');\n }\n\n formatError() {\n const msgs: string[] = [];\n const { e, buildType } = this;\n msgs.push(chalk.red.bold(`${buildType} DTS failed:`));\n if (isExecaError(e)) {\n /**\n * `shortMeessage` content like:\n * 'Command failed with exit code 2: /Users/github/modern.js/playground/module/node_modules/.bin/tsc -p /Users/github/modern.js/playground/module/node_modules/tsconfig.temp.json --pretty'\n * Don`t need it.\n */\n if (e.stack) {\n msgs.push(e.stack?.replace(`${e.name}: ${e.shortMessage}`, ''));\n }\n } else {\n msgs.push(e.stack!);\n }\n\n return msgs;\n }\n}\n\nexport class ModuleBuildError extends Error {\n constructor(e: InternalBuildError | InternalDTSError) {\n super(`\\n\\n${e}`);\n Error.captureStackTrace(this, this.constructor);\n this.name = 'ModuleBuildError';\n }\n}\n\nexport const isInternalError = (\n e: unknown,\n): e is InternalDTSError | InternalBuildError => {\n if (e instanceof InternalBuildError || e instanceof InternalDTSError) {\n return true;\n }\n\n return false;\n};\n\nexport const isExecaError = (e: any): e is ExecaError => {\n if (e.stdout) {\n return true;\n }\n\n return false;\n};\n"]}
|
package/dist/hooks/build.js
CHANGED
|
@@ -10,8 +10,12 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
buildHooks: ()
|
|
14
|
-
|
|
13
|
+
buildHooks: function() {
|
|
14
|
+
return buildHooks;
|
|
15
|
+
},
|
|
16
|
+
buildWatchHooks: function() {
|
|
17
|
+
return buildWatchHooks;
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
const _plugin = require("@modern-js/plugin");
|
|
17
21
|
const buildHooks = {
|
package/dist/hooks/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAeaA,YAAU
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAeaA,YAAU;WAAVA;;EAoBAC,iBAAe;WAAfA;;;wBAhCN;AAYA,MAAMD,aAAa;EACxBE,cAAaC,mCAAsB;EAInCC,kBAAiBC,iCAAoB;EACrCC,iBAAgBH,mCAAsB;EACtCI,aAAYJ,mCAAsB;EAClCK,wBAAuBL,mCAAsB;EAI7CM,sBAAqBN,mCAAsB;EAI3CO,gBAAeP,mCAAsB;EACrCQ,qBAAoBR,mCAAsB;AAC5C;AAEO,MAAMF,kBAAkB;EAC7BW,eAAcT,mCAAsB;EACpCU,gBAAeV,mCAAsB;AACvC;","names":["buildHooks","buildWatchHooks","beforeBuild","createParallelWorkflow","beforeBuildTask","createAsyncWaterfall","afterBuildTask","afterBuild","registerBuildPlatform","beforeBuildPlatform","buildPlatform","afterBuildPlatform","buildWatchJs","buildWatchDts"],"sources":["../../src/hooks/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/hooks/build.ts"],"sourcesContent":["import {\n createParallelWorkflow,\n createAsyncWaterfall,\n} from '@modern-js/plugin';\nimport type { RegisterBuildPlatformResult } from '@modern-js/core';\nimport { BuildCommandOptions } from '../types';\nimport type { BuildConfig, BaseBuildConfig } from '../types/config';\nimport type {\n BuildTaskResult,\n BuildResult,\n BuildPlatformResult,\n WatchDtsHookContext,\n WatchJsHookContext,\n} from '../types/hooks';\n\nexport const buildHooks = {\n beforeBuild: createParallelWorkflow<\n { config: BuildConfig; cliOptions: BuildCommandOptions },\n void\n >(),\n beforeBuildTask: createAsyncWaterfall<BaseBuildConfig>(),\n afterBuildTask: createParallelWorkflow<BuildTaskResult, void>(),\n afterBuild: createParallelWorkflow<BuildResult, void>(),\n registerBuildPlatform: createParallelWorkflow<\n void,\n RegisterBuildPlatformResult\n >(),\n beforeBuildPlatform: createParallelWorkflow<\n RegisterBuildPlatformResult[],\n void\n >(),\n buildPlatform: createParallelWorkflow<{ platform: string }, void>(),\n afterBuildPlatform: createParallelWorkflow<BuildPlatformResult, void>(),\n};\n\nexport const buildWatchHooks = {\n buildWatchJs: createParallelWorkflow<WatchJsHookContext, void>(),\n buildWatchDts: createParallelWorkflow<WatchDtsHookContext, void>(),\n};\n"]}
|
package/dist/hooks/dev.js
CHANGED
package/dist/hooks/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAOaA
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;+BAOaA;;;WAAAA;;;wBAJN;AAIA,MAAMA,WAAW;EACtBC,cAAaC,mCAAsB;EACnCC,YAAWD,mCAAsB;EACjCE,gBAAeC,iCAAoB;EACnCC,eAAcJ,mCAAsB;EAIpCK,gBAAeL,mCAAsB;EACrCM,WAAUN,mCAAsB;;EAEhCO,aAAYJ,iCAAoB;AAClC;","names":["devHooks","registerDev","createParallelWorkflow","beforeDev","beforeDevMenu","createAsyncWaterfall","afterDevMenu","beforeDevTask","afterDev","noDevTools"],"sources":["../../src/hooks/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/hooks/dev.ts"],"sourcesContent":["import {\n createParallelWorkflow,\n createAsyncWaterfall,\n} from '@modern-js/plugin';\nimport type { QuestionCollection } from '@modern-js/utils/compiled/inquirer';\nimport type { DevToolData, PromptResult } from '../types/hooks';\n\nexport const devHooks = {\n registerDev: createParallelWorkflow<void, DevToolData>(),\n beforeDev: createParallelWorkflow<DevToolData[], void>(),\n beforeDevMenu: createAsyncWaterfall<QuestionCollection>(),\n afterDevMenu: createParallelWorkflow<\n { result: PromptResult; devTools: DevToolData[] },\n void\n >(),\n beforeDevTask: createParallelWorkflow<DevToolData, void>(),\n afterDev: createParallelWorkflow<void, void>(),\n // Special and rarely used hooks\n noDevTools: createAsyncWaterfall<string>(),\n};\n"]}
|
package/dist/hooks/index.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "registerHook", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return registerHook;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _build = require("./build");
|
|
10
12
|
const _dev = require("./dev");
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAIaA
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;+BAIaA;;;WAAAA;;;uBAJ+B;qBACnB;sBACC;AAEnB,MAAMA,eAAe;EAC1B,GAAGC;EACH,GAAGC;EACH,GAAGC;EACH,GAAGC;AACL;","names":["registerHook","buildHooks","devHooks","miscHooks","buildWatchHooks"],"sources":["../../src/hooks/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/hooks/index.ts"],"sourcesContent":["import { buildHooks, buildWatchHooks } from './build';\nimport { devHooks } from './dev';\nimport { miscHooks } from './misc';\n\nexport const registerHook = {\n ...buildHooks,\n ...devHooks,\n ...miscHooks,\n ...buildWatchHooks,\n};\n"]}
|
package/dist/hooks/misc.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "miscHooks", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return miscHooks;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _plugin = require("@modern-js/plugin");
|
|
10
12
|
const miscHooks = {
|
package/dist/hooks/misc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAGaA
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;+BAGaA;;;WAAAA;;;wBAH6C;AAGnD,MAAMA,YAAY;EACvBC,oBAAmBC,iCAAoB;EACvCC,gBAAeC,gCAAmB;AACpC;","names":["miscHooks","addRuntimeExports","createAsyncWaterfall","modifyLibuild","createAsyncPipeline"],"sources":["../../src/hooks/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/hooks/misc.ts"],"sourcesContent":["import { createAsyncPipeline, createAsyncWaterfall } from '@modern-js/plugin';\nimport type { CLIConfig } from '@modern-js/libuild';\n\nexport const miscHooks = {\n addRuntimeExports: createAsyncWaterfall(),\n modifyLibuild: createAsyncPipeline<CLIConfig, CLIConfig>(),\n};\n"]}
|
package/dist/index.js
CHANGED
|
@@ -10,10 +10,18 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
defineConfig: ()
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
defineConfig: function() {
|
|
14
|
+
return _defineConfig.defineConfig;
|
|
15
|
+
},
|
|
16
|
+
defineLegacyConfig: function() {
|
|
17
|
+
return _defineConfig.defineLegacyConfig;
|
|
18
|
+
},
|
|
19
|
+
legacyPresets: function() {
|
|
20
|
+
return _legacyBuildPresets.legacyPresets;
|
|
21
|
+
},
|
|
22
|
+
default: function() {
|
|
23
|
+
return _default;
|
|
24
|
+
}
|
|
17
25
|
});
|
|
18
26
|
const _export_star = require("@swc/helpers/_/_export_star");
|
|
19
27
|
const _cli = require("./cli");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAESA,cAAY
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAESA,cAAY;WAAZA;;EAAcC,oBAAkB;WAAlBA;;EACdC,eAAa;WAAbA;;EAET,SAAmB;WAAnB;;;;qBALoB;8BAE6B;oCACnB;uBAChB;MACd,WAAeC;","names":["defineConfig","defineLegacyConfig","legacyPresets","cli"],"sources":["../src/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/index.ts"],"sourcesContent":["import { cli } from './cli';\n\nexport { defineConfig, defineLegacyConfig } from './config/defineConfig';\nexport { legacyPresets } from './constants/legacyBuildPresets';\nexport * from './types';\nexport default cli;\n"]}
|
package/dist/locale/en.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "EN_LOCALE", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return EN_LOCALE;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _utils = require("@modern-js/utils");
|
|
10
12
|
const noDevTools = `There are no DevTools available, you can learn about them and choose to use them by following the link options.
|
package/dist/locale/en.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BASaA
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;+BASaA;;;WAAAA;;;uBATS;AAEtB,MAAMC,aAAa;MACbC,aAAMC,UACRD,aAAME,KAAK,gBACX;;AAIG,MAAMJ,YAAY;EACvBK,SAAS;IACPC,OAAO;MACLC,UAAU;MACVC,OAAO;MACPC,UAAU;MACVC,WAAW;MACXC,UACE;MACFC,OAAO;MACPC,KAAK;MACLC,SAAS;MACTC,QAAQ;IACV;IACAC,KAAK;MACHT,UAAU;MACVE,UAAU;IACZ;IACAQ,KAAK;MACHV,UAAU;MACVW,OAAO;MACPH,QAAQ;MACRI,SAAS;MACTC,UAAU;MACVC,MAAM;IACR;EACF;EACAC,KAAK;IACHN,KAAK;MACHO,YAAYtB;IACd;EACF;EACAuB,QAAQ;IACNC,iBAAiB;QACbvB,aAAME,KAAK;QACXF,aAAMwB,OAAO,8BAA8BxB,aAAMwB,OACnD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,+BAA+BxB,aAAMwB,OACpD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,iCAAiCxB,aAAMwB,OACtD;;EAGJ;EACAC,OAAO;IACLd,KAAK;MACHe,cACE;IACJ;EACF;AACF;","names":["EN_LOCALE","noDevTools","chalk","underline","blue","command","build","describe","watch","tsconfig","styleOnly","platform","noTsc","dts","noClear","config","dev","new","debug","distTag","registry","lang","log","noDevtools","errors","externalHelpers","yellow","warns","abortOnError"],"sources":["../../src/locale/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/locale/en.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\n\nconst noDevTools = `There are no DevTools available, you can learn about them and choose to use them by following the link options.\n - ${chalk.underline(\n chalk.blue('[Storybook]'),\n 'https://modernjs.dev/module-tools/guide/basic/using-storybook.html',\n )}\n`;\n\nexport const EN_LOCALE = {\n command: {\n build: {\n describe: 'build the module for production',\n watch: 'building module in watch mode',\n tsconfig: 'Specify a path to the tsconfig.json file',\n styleOnly: 'only build style',\n platform:\n 'build the specified task or all tasks, If exist. (tasks: \"storybook\", \"docs\")',\n noTsc: 'close tsc compiler to emit d.ts (Deprecated)',\n dts: 'Turn on dts generation and type checking',\n noClear: 'disable auto clear dist dir',\n config: 'specify config file',\n },\n dev: {\n describe: 'run and debug the module',\n tsconfig: 'Specify a path to the tsconfig.json file',\n },\n new: {\n describe: 'enable optional features',\n debug: 'using debug mode to log something',\n config: 'set default generator config(json string)',\n distTag: `use specified tag version for it's generator`,\n registry: 'set npm registry url to run npm command',\n lang: 'set new command language(en or zh)',\n },\n },\n log: {\n dev: {\n noDevtools: noDevTools,\n },\n },\n errors: {\n externalHelpers: `The 'externalHelpers' configuration is currently enabled, but the \"@swc/helpers\" dependency declaration was not found. This will cause issues with the build output.Use the following for installation:\n ${chalk.blue('Package Manager is npm:')}\n ${chalk.yellow('`npm i @swc/helpers`')} Or ${chalk.yellow(\n '`npm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is pnpm:')}\n ${chalk.yellow('`pnpm i @swc/helpers`')} Or ${chalk.yellow(\n '`pnpm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is yarn:')}\n ${chalk.yellow('`yarn add @swc/helpers`')} Or ${chalk.yellow(\n '`yarn add @swc/helpers -D`',\n )}\n `,\n },\n warns: {\n dts: {\n abortOnError:\n 'With the `dts.abortOnError` configuration currently turned off, type errors do not cause build failures, but they do not guarantee proper type file output',\n },\n },\n};\n"]}
|
package/dist/locale/index.js
CHANGED
|
@@ -10,8 +10,12 @@ function _export(target, all) {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
i18n: ()
|
|
14
|
-
|
|
13
|
+
i18n: function() {
|
|
14
|
+
return i18n;
|
|
15
|
+
},
|
|
16
|
+
localeKeys: function() {
|
|
17
|
+
return localeKeys;
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
const _utils = require("@modern-js/utils");
|
|
17
21
|
const _zh = require("./zh");
|
package/dist/locale/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAcSA,MAAI
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAcSA,MAAI;WAAJA;;EAAMC,YAAU;WAAVA;;;uBAdQ;oBAEG;oBACA;AAE1B,MAAMC,aAAsDC,cAAOC,KACjE,0BACAC;AAGF,MAAML,OAAO,IAAIE,WAAWI,KAAI;AAEhC,MAAML,aAAaD,KAAKO,KAAK,MAAM;EAAEC,IAAIC;EAAWC,IAAIC;AAAU;","names":["i18n","localeKeys","i18nPlugin","Import","lazy","require","I18n","init","zh","ZH_LOCALE","en","EN_LOCALE"],"sources":["../../src/locale/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/locale/index.ts"],"sourcesContent":["import { Import } from '@modern-js/utils';\n\nimport { ZH_LOCALE } from './zh';\nimport { EN_LOCALE } from './en';\n\nconst i18nPlugin: typeof import('@modern-js/plugin-i18n') = Import.lazy(\n '@modern-js/plugin-i18n',\n require,\n);\n\nconst i18n = new i18nPlugin.I18n();\n\nconst localeKeys = i18n.init('en', { zh: ZH_LOCALE, en: EN_LOCALE });\n\nexport { i18n, localeKeys };\n"]}
|
package/dist/locale/zh.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "ZH_LOCALE", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return ZH_LOCALE;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _utils = require("@modern-js/utils");
|
|
10
12
|
const noDevTools = `暂无可用的 DevTools,你可以通过以下选项以及对应的链接来了解如何使用。
|
package/dist/locale/zh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BASaA
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;+BASaA;;;WAAAA;;;uBATS;AAEtB,MAAMC,aAAa;MACbC,aAAMC,UACRD,aAAME,KAAK,iBACX;;AAIG,MAAMJ,YAAY;EACvBK,SAAS;IACPC,OAAO;MACLC,UAAU;MACVC,OAAO;MACPC,UAAU;MACVC,WAAW;MACXC,UACE;MACFC,OAAO;MACPC,KAAK;MACLC,SAAS;MACTC,QAAQ;IACV;IACAC,KAAK;MACHT,UAAU;MACVE,UAAU;IACZ;IACAQ,KAAK;MACHV,UAAU;MACVW,OAAO;MACPH,QAAQ;MACRI,SAAS;MACTC,UAAU;MACVC,MAAM;IACR;EACF;EACAC,KAAK;IACHN,KAAK;MACHO,YAAYtB;IACd;EACF;EACAuB,QAAQ;IACNC,iBAAiB;QACbvB,aAAME,KAAK;QACXF,aAAMwB,OAAO,8BAA8BxB,aAAMwB,OACnD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,+BAA+BxB,aAAMwB,OACpD;;QAGExB,aAAME,KAAK;QACXF,aAAMwB,OAAO,iCAAiCxB,aAAMwB,OACtD;;EAGJ;EACAC,OAAO;IACLd,KAAK;MACHe,cACE;IACJ;EACF;AACF;","names":["ZH_LOCALE","noDevTools","chalk","underline","blue","command","build","describe","watch","tsconfig","styleOnly","platform","noTsc","dts","noClear","config","dev","new","debug","distTag","registry","lang","log","noDevtools","errors","externalHelpers","yellow","warns","abortOnError"],"sources":["../../src/locale/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/locale/zh.ts"],"sourcesContent":["import { chalk } from '@modern-js/utils';\n\nconst noDevTools = `暂无可用的 DevTools,你可以通过以下选项以及对应的链接来了解如何使用。\n - ${chalk.underline(\n chalk.blue('[Storybook]:'),\n 'https://modernjs.dev/module-tools/guide/basic/using-storybook.html',\n )}\n`;\n\nexport const ZH_LOCALE = {\n command: {\n build: {\n describe: '构建生产环境产物',\n watch: '使用 Watch 模式构建模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n styleOnly: '只构建样式文件',\n platform:\n '如果存在的话,执行指定的构建任务或者全部构建任务. (构建任务包括: \"storybook\", \"文档\")',\n noTsc: '关闭 tsc 编译(废弃)',\n dts: '开启 dts 文件的生成以及类型检查',\n noClear: '不清理产物目录',\n config: '指定配置文件路径,可以为相对路径或绝对路径',\n },\n dev: {\n describe: '运行和调试模块',\n tsconfig: '指定 tsconfig.json 文件的路径',\n },\n new: {\n describe: '启用可选功能',\n debug: '开启 Debug 模式,打印调试日志信息',\n config: '生成器运行默认配置(JSON 字符串)',\n distTag: '生成器使用特殊的 npm Tag 版本',\n registry: '生成器运行过程中定制 npm Registry',\n lang: '设置 new 命令执行语言(zh 或者 en)',\n },\n },\n log: {\n dev: {\n noDevtools: noDevTools,\n },\n },\n errors: {\n externalHelpers: `当前开启了 'externalHelpers' 配置,未找到 \"@swc/helpers\" 依赖声明,构建产物会存在问题。使用下面的方式进行安装:\n ${chalk.blue('Package Manager is npm:')}\n ${chalk.yellow('`npm i @swc/helpers`')} Or ${chalk.yellow(\n '`npm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is pnpm:')}\n ${chalk.yellow('`pnpm i @swc/helpers`')} Or ${chalk.yellow(\n '`pnpm i @swc/helpers -D`',\n )}\n\n ${chalk.blue('Package Manager is yarn:')}\n ${chalk.yellow('`yarn add @swc/helpers`')} Or ${chalk.yellow(\n '`yarn add @swc/helpers -D`',\n )}\n `,\n },\n warns: {\n dts: {\n abortOnError:\n '当前关闭了 `dts.abortOnError` 配置,类型错误不会导致构建失败,但无法保证类型文件正常输出',\n },\n },\n};\n"]}
|
package/dist/plugins.js
CHANGED
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "getPlugins", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return getPlugins;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
11
|
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
10
12
|
const _pluginchangeset = /* @__PURE__ */ _interop_require_default._(require("@modern-js/plugin-changeset"));
|
package/dist/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAIaA
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;+BAIaA;;;WAAAA;;;;4EAHe;uEACL;AAEhB,MAAMA,aAAa,CAACC,eAAuB;AAChD,MAAIC,UAAuB;AAE3B,UAAQD;IACN,KAAK;AACHC,gBAAU;AACV;IACF,KAAK;AACHA,gBAAU;SAACC,wBAAU;;AACrB;IACF,KAAK;IACL,KAAK;IACL,KAAK;AACHD,gBAAU;SAACE,6BAAe;;AAC1B;IACF;AACEF,gBAAU;EACd;AAEA,SAAOA;AACT;","names":["getPlugins","runningCmd","plugins","lintPlugin","changesetPlugin"],"sources":["../src/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/plugins.ts"],"sourcesContent":["import type { CliPlugin } from '@modern-js/core';\nimport changesetPlugin from '@modern-js/plugin-changeset';\nimport lintPlugin from '@modern-js/plugin-lint';\n\nexport const getPlugins = (runningCmd: string) => {\n let plugins: CliPlugin[] = [];\n\n switch (runningCmd) {\n case 'build':\n plugins = [];\n break;\n case 'lint':\n plugins = [lintPlugin()];\n break;\n case 'change':\n case 'release':\n case 'bump':\n plugins = [changesetPlugin()];\n break;\n default:\n plugins = [];\n }\n\n return plugins;\n};\n"]}
|
|
@@ -68,6 +68,9 @@ export type PartialBaseBuildConfig = {
|
|
|
68
68
|
esbuildOptions?: LibuildUserConfig['esbuildOptions'];
|
|
69
69
|
externalHelpers?: ExternalHelpers;
|
|
70
70
|
transformImport?: ImportItem[];
|
|
71
|
+
/**
|
|
72
|
+
* internal configuration
|
|
73
|
+
*/
|
|
71
74
|
disableSwcTransform?: boolean;
|
|
72
75
|
};
|
|
73
76
|
export type BuildConfig = BaseBuildConfig | BaseBuildConfig[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;uBAiBc;","names":[],"sources":["../../../src/types/config/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/types/config/index.ts"],"sourcesContent":["import type {\n UserConfig as LibuildUserConfig,\n Asset as LibuildAsset,\n Style as LibuildStyle,\n} from '@modern-js/libuild';\nimport type { Options } from '@modern-js/libuild-plugin-svgr';\nimport type { ImportItem } from '@modern-js/libuild-plugin-swc';\nimport type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';\nimport { BuildInPreset, presetList } from '../../constants/buildPresets';\nimport type { CopyConfig } from '../copy';\nimport type {\n LessConfig,\n SassConfig,\n PostCSSConfig,\n TailwindCSSConfig,\n} from './style';\n\nexport * from './style';\n\nexport type BuildType = 'bundleless' | 'bundle';\n\nexport type Format = 'esm' | 'cjs' | 'umd' | 'iife';\n\nexport type Target =\n | 'es5'\n | 'es6'\n | 'es2015'\n | 'es2016'\n | 'es2017'\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.\n | 'esnext';\n\nexport type Input = Required<LibuildUserConfig>['input'];\n\nexport type DTSOptions = {\n abortOnError: boolean;\n distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | Options;\n}\nexport type SourceMap = Required<LibuildUserConfig>['sourceMap'];\nexport type AutoExternal =\n | boolean\n | {\n dependencies?: boolean;\n peerDependencies?: boolean;\n };\nexport type JSX = 'automatic' | 'transform';\nexport type ExternalHelpers = boolean;\n\nexport type AliasOption =\n | Record<string, string>\n | ((aliases: Record<string, string>) => Record<string, string> | void);\n\nexport type BaseBuildConfig = Omit<\n Required<PartialBaseBuildConfig>,\n 'dts' | 'style' | 'alias' | 'sideEffects'\n> & {\n sideEffects: LibuildUserConfig['sideEffects'];\n dts: false | DTSOptions;\n style: Omit<Required<LibuildStyle>, 'cleanCss'> & {\n tailwindcss: TailwindCSSConfig;\n };\n alias: Record<string, string>;\n};\n\nexport type PartialBaseBuildConfig = {\n sourceType?: 'commonjs' | 'module';\n buildType?: 'bundleless' | 'bundle';\n format?: Format;\n target?: Target;\n dts?: DTS;\n sourceMap?: SourceMap;\n sourceDir?: string;\n copy?: CopyConfig;\n asset?: Asset;\n jsx?: JSX;\n outDir?: string;\n alias?: AliasOption;\n input?: Input;\n metafile?: boolean;\n platform?: LibuildUserConfig['platform'];\n splitting?: LibuildUserConfig['splitting'];\n minify?: LibuildUserConfig['minify'];\n externals?: LibuildUserConfig['external'];\n autoExternal?: AutoExternal;\n umdGlobals?: LibuildUserConfig['globals'];\n umdModuleName?: ((chunkName: string) => string) | string | undefined;\n define?: LibuildUserConfig['define'];\n style?: StyleConfig;\n redirect?: LibuildUserConfig['redirect'];\n sideEffects?: LibuildUserConfig['sideEffects'];\n esbuildOptions?: LibuildUserConfig['esbuildOptions'];\n // Related to swc-transform\n externalHelpers?: ExternalHelpers;\n transformImport?: ImportItem[];\n disableSwcTransform?: boolean;\n};\n\nexport type BuildConfig = BaseBuildConfig | BaseBuildConfig[];\nexport type PartialBuildConfig =\n | PartialBaseBuildConfig\n | PartialBaseBuildConfig[];\n\nexport type BuildPreset =\n | keyof typeof presetList\n | ((options: {\n preset: typeof BuildInPreset;\n extendPreset: (\n extendPresetName: keyof typeof BuildInPreset,\n extendBuildConfig: PartialBaseBuildConfig,\n ) => PartialBuildConfig;\n }) => PartialBuildConfig | Promise<PartialBuildConfig>);\n\nexport interface StyleConfig {\n less?: LessConfig;\n sass?: SassConfig;\n postcss?: PostCSSConfig;\n autoModules?: LibuildStyle['autoModules'];\n modules?: LibuildStyle['modules'];\n inject?: LibuildStyle['inject'];\n /**\n * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.\n * Please use `yarn new` or `pnpm new` to enable the corresponding capability.\n * @requires `tailwindcss` plugin\n */\n tailwindcss?: TailwindCSSConfig;\n}\n\nexport interface StorybookBuildConfig {\n webpack?: WebpackBuilderToolsConfig['webpack'];\n webpackChain?: WebpackBuilderToolsConfig['webpackChain'];\n}\nexport interface Dev {\n storybook?: StorybookBuildConfig;\n}\n\nexport interface RuntimeUserConfig {\n [name: string]: any;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: Dev;\n\n runtime?: RuntimeUserConfig;\n}\n"]}
|
|
1
|
+
{"version":3,"file":null,"mappings":";;;;;uBAiBc;","names":[],"sources":["../../../src/types/config/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/types/config/index.ts"],"sourcesContent":["import type {\n UserConfig as LibuildUserConfig,\n Asset as LibuildAsset,\n Style as LibuildStyle,\n} from '@modern-js/libuild';\nimport type { Options } from '@modern-js/libuild-plugin-svgr';\nimport type { ImportItem } from '@modern-js/libuild-plugin-swc';\nimport type { ToolsConfig as WebpackBuilderToolsConfig } from '@modern-js/builder-webpack-provider';\nimport { BuildInPreset, presetList } from '../../constants/buildPresets';\nimport type { CopyConfig } from '../copy';\nimport type {\n LessConfig,\n SassConfig,\n PostCSSConfig,\n TailwindCSSConfig,\n} from './style';\n\nexport * from './style';\n\nexport type BuildType = 'bundleless' | 'bundle';\n\nexport type Format = 'esm' | 'cjs' | 'umd' | 'iife';\n\nexport type Target =\n | 'es5'\n | 'es6'\n | 'es2015'\n | 'es2016'\n | 'es2017'\n | 'es2018'\n | 'es2019'\n | 'es2020'\n | 'es2021'\n | 'es2022'\n // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.\n | 'esnext';\n\nexport type Input = Required<LibuildUserConfig>['input'];\n\nexport type DTSOptions = {\n abortOnError: boolean;\n distPath: string;\n tsconfigPath: string;\n only: boolean;\n};\nexport type DTS = false | Partial<DTSOptions>;\n\nexport interface Asset {\n path?: LibuildAsset['outdir'];\n limit?: LibuildAsset['limit'];\n publicPath?: LibuildAsset['publicPath'];\n svgr?: boolean | Options;\n}\nexport type SourceMap = Required<LibuildUserConfig>['sourceMap'];\nexport type AutoExternal =\n | boolean\n | {\n dependencies?: boolean;\n peerDependencies?: boolean;\n };\nexport type JSX = 'automatic' | 'transform';\nexport type ExternalHelpers = boolean;\n\nexport type AliasOption =\n | Record<string, string>\n | ((aliases: Record<string, string>) => Record<string, string> | void);\n\nexport type BaseBuildConfig = Omit<\n Required<PartialBaseBuildConfig>,\n 'dts' | 'style' | 'alias' | 'sideEffects'\n> & {\n sideEffects: LibuildUserConfig['sideEffects'];\n dts: false | DTSOptions;\n style: Omit<Required<LibuildStyle>, 'cleanCss'> & {\n tailwindcss: TailwindCSSConfig;\n };\n alias: Record<string, string>;\n};\n\nexport type PartialBaseBuildConfig = {\n sourceType?: 'commonjs' | 'module';\n buildType?: 'bundleless' | 'bundle';\n format?: Format;\n target?: Target;\n dts?: DTS;\n sourceMap?: SourceMap;\n sourceDir?: string;\n copy?: CopyConfig;\n asset?: Asset;\n jsx?: JSX;\n outDir?: string;\n alias?: AliasOption;\n input?: Input;\n metafile?: boolean;\n platform?: LibuildUserConfig['platform'];\n splitting?: LibuildUserConfig['splitting'];\n minify?: LibuildUserConfig['minify'];\n externals?: LibuildUserConfig['external'];\n autoExternal?: AutoExternal;\n umdGlobals?: LibuildUserConfig['globals'];\n umdModuleName?: ((chunkName: string) => string) | string | undefined;\n define?: LibuildUserConfig['define'];\n style?: StyleConfig;\n redirect?: LibuildUserConfig['redirect'];\n sideEffects?: LibuildUserConfig['sideEffects'];\n esbuildOptions?: LibuildUserConfig['esbuildOptions'];\n // Related to swc-transform\n externalHelpers?: ExternalHelpers;\n transformImport?: ImportItem[];\n /**\n * internal configuration\n */\n disableSwcTransform?: boolean;\n};\n\nexport type BuildConfig = BaseBuildConfig | BaseBuildConfig[];\nexport type PartialBuildConfig =\n | PartialBaseBuildConfig\n | PartialBaseBuildConfig[];\n\nexport type BuildPreset =\n | keyof typeof presetList\n | ((options: {\n preset: typeof BuildInPreset;\n extendPreset: (\n extendPresetName: keyof typeof BuildInPreset,\n extendBuildConfig: PartialBaseBuildConfig,\n ) => PartialBuildConfig;\n }) => PartialBuildConfig | Promise<PartialBuildConfig>);\n\nexport interface StyleConfig {\n less?: LessConfig;\n sass?: SassConfig;\n postcss?: PostCSSConfig;\n autoModules?: LibuildStyle['autoModules'];\n modules?: LibuildStyle['modules'];\n inject?: LibuildStyle['inject'];\n /**\n * The configuration of `tools.tailwindcss` is provided by `tailwindcss` plugin.\n * Please use `yarn new` or `pnpm new` to enable the corresponding capability.\n * @requires `tailwindcss` plugin\n */\n tailwindcss?: TailwindCSSConfig;\n}\n\nexport interface StorybookBuildConfig {\n webpack?: WebpackBuilderToolsConfig['webpack'];\n webpackChain?: WebpackBuilderToolsConfig['webpackChain'];\n}\nexport interface Dev {\n storybook?: StorybookBuildConfig;\n}\n\nexport interface RuntimeUserConfig {\n [name: string]: any;\n}\n\nexport interface ModuleExtraConfig {\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: Dev;\n\n runtime?: RuntimeUserConfig;\n}\n"]}
|