@modern-js/module-tools 2.35.1 → 2.37.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/dist/build.js +43 -16
- package/dist/builder/build.d.ts +0 -10
- package/dist/builder/build.js +96 -208
- package/dist/builder/clear.d.ts +1 -4
- package/dist/builder/clear.js +32 -28
- package/dist/builder/copy.js +75 -60
- package/dist/builder/dts/index.js +27 -19
- package/dist/builder/dts/rollup.d.ts +6 -14
- package/dist/builder/dts/rollup.js +60 -37
- package/dist/builder/dts/tsc.d.ts +3 -2
- package/dist/builder/dts/tsc.js +50 -37
- package/dist/builder/esbuild/adapter.d.ts +3 -0
- package/dist/builder/esbuild/adapter.js +286 -0
- package/dist/builder/esbuild/hook.d.ts +4 -0
- package/dist/builder/esbuild/hook.js +103 -0
- package/dist/builder/esbuild/index.d.ts +35 -0
- package/dist/builder/esbuild/index.js +268 -0
- package/dist/builder/esbuild/resolve.d.ts +18 -0
- package/dist/builder/esbuild/resolve.js +140 -0
- package/dist/builder/esbuild/sourcemap.d.ts +16 -0
- package/dist/builder/esbuild/sourcemap.js +86 -0
- package/dist/builder/esbuild/transform.d.ts +7 -0
- package/dist/builder/esbuild/transform.js +45 -0
- package/dist/builder/esbuild/watch.d.ts +2 -0
- package/dist/builder/esbuild/watch.js +115 -0
- package/dist/builder/esbuild/write-file.d.ts +2 -0
- package/dist/builder/esbuild/write-file.js +89 -0
- package/dist/builder/feature/asset.d.ts +19 -0
- package/dist/builder/feature/asset.js +149 -0
- package/dist/builder/feature/format-cjs.d.ts +5 -0
- package/dist/builder/feature/format-cjs.js +53 -0
- package/dist/builder/feature/index.d.ts +2 -0
- package/dist/builder/feature/index.js +74 -0
- package/dist/builder/feature/json.d.ts +5 -0
- package/dist/builder/feature/json.js +47 -0
- package/dist/builder/feature/redirect.d.ts +5 -0
- package/dist/builder/feature/redirect.js +223 -0
- package/dist/builder/feature/style/index.d.ts +5 -0
- package/dist/builder/feature/style/index.js +94 -0
- package/dist/builder/feature/style/lessAliasPlugin.d.ts +12 -0
- package/dist/builder/feature/style/lessAliasPlugin.js +70 -0
- package/dist/builder/feature/style/lessRender.d.ts +2 -0
- package/dist/builder/feature/style/lessRender.js +64 -0
- package/dist/builder/feature/style/postcssTransformer.d.ts +6 -0
- package/dist/builder/feature/style/postcssTransformer.js +95 -0
- package/dist/builder/feature/style/postcssUrlPlugin.d.ts +6 -0
- package/dist/builder/feature/style/postcssUrlPlugin.js +58 -0
- package/dist/builder/feature/style/sassRender.d.ts +2 -0
- package/dist/builder/feature/style/sassRender.js +85 -0
- package/dist/builder/feature/style/transformStyle.d.ts +13 -0
- package/dist/builder/feature/style/transformStyle.js +101 -0
- package/dist/builder/feature/style/utils.d.ts +18 -0
- package/dist/builder/feature/style/utils.js +130 -0
- package/dist/builder/feature/swc.d.ts +9 -0
- package/dist/builder/feature/swc.js +170 -0
- package/dist/builder/feature/terser.d.ts +5 -0
- package/dist/builder/feature/terser.js +83 -0
- package/dist/builder/index.js +59 -28
- package/dist/builder/platform.js +38 -23
- package/dist/cli.js +58 -29
- package/dist/command.js +62 -38
- package/dist/config/defineConfig.js +25 -17
- package/dist/config/legacySchema.js +35 -32
- package/dist/config/merge.js +69 -36
- package/dist/config/normalize.js +63 -46
- package/dist/config/schema.d.ts +48 -0
- package/dist/config/schema.js +53 -34
- package/dist/config/transformLegacyConfig.js +67 -61
- package/dist/config/valid.d.ts +2 -2
- package/dist/config/valid.js +44 -21
- package/dist/constants/build.d.ts +5 -1
- package/dist/constants/build.js +88 -46
- package/dist/constants/color.js +27 -20
- package/dist/constants/dts.js +27 -20
- package/dist/constants/file.d.ts +2 -2
- package/dist/constants/file.js +48 -25
- package/dist/constants/legacy-preset.js +45 -32
- package/dist/constants/loader.d.ts +2 -0
- package/dist/constants/loader.js +53 -0
- package/dist/constants/log.d.ts +0 -8
- package/dist/constants/log.js +27 -41
- package/dist/constants/preset.d.ts +4 -4
- package/dist/constants/preset.js +55 -62
- package/dist/debug.d.ts +4 -0
- package/dist/debug.js +37 -0
- package/dist/dev.js +42 -25
- package/dist/error.js +49 -42
- package/dist/hooks/build.d.ts +1 -2
- package/dist/hooks/build.js +36 -28
- package/dist/hooks/dev.js +32 -17
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +31 -16
- package/dist/hooks/misc.d.ts +5 -2
- package/dist/hooks/misc.js +31 -12
- package/dist/index.d.ts +2 -1
- package/dist/index.js +39 -32
- package/dist/locale/en.js +32 -17
- package/dist/locale/index.d.ts +2 -1
- package/dist/locale/index.js +31 -24
- package/dist/locale/zh.js +32 -17
- package/dist/plugins.js +28 -13
- package/dist/types/color.js +15 -5
- package/dist/types/command.d.ts +3 -3
- package/dist/types/command.js +15 -5
- package/dist/types/config/copy.js +15 -5
- package/dist/types/config/dev.js +15 -5
- package/dist/types/config/index.d.ts +87 -52
- package/dist/types/config/index.js +24 -6
- package/dist/types/config/style.d.ts +58 -6
- package/dist/types/config/style.js +15 -5
- package/dist/types/context.js +15 -5
- package/dist/types/dts.d.ts +14 -3
- package/dist/types/dts.js +15 -5
- package/dist/types/esbuild.d.ts +107 -0
- package/dist/types/esbuild.js +32 -0
- package/dist/types/hooks.js +15 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +32 -11
- package/dist/types/legacyConfig/index.js +15 -5
- package/dist/types/legacyConfig/output.d.ts +4 -4
- package/dist/types/legacyConfig/output.js +15 -5
- package/dist/types/legacyConfig/source.js +15 -5
- package/dist/types/legacyConfig/tools.js +15 -5
- package/dist/utils/assert.d.ts +5 -0
- package/dist/utils/assert.js +50 -0
- package/dist/utils/builder.d.ts +10 -14
- package/dist/utils/builder.js +59 -59
- package/dist/utils/common.d.ts +1 -1
- package/dist/utils/common.js +25 -17
- package/dist/utils/dts.d.ts +26 -9
- package/dist/utils/dts.js +98 -64
- package/dist/utils/hash.d.ts +2 -0
- package/dist/utils/hash.js +31 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.js +42 -0
- package/dist/utils/input.js +47 -24
- package/dist/utils/log.d.ts +1 -2
- package/dist/utils/log.js +36 -20
- package/dist/utils/map.d.ts +13 -0
- package/dist/utils/map.js +58 -0
- package/dist/utils/onExit.js +35 -11
- package/dist/utils/print.d.ts +2 -2
- package/dist/utils/print.js +52 -49
- package/dist/utils/style.d.ts +5 -23
- package/dist/utils/style.js +57 -37
- package/dist/utils/tspath.js +114 -0
- package/package.json +61 -50
- package/vitest.config.ts +20 -0
- package/dist/build.js.map +0 -1
- package/dist/builder/build.js.map +0 -1
- package/dist/builder/clear.js.map +0 -1
- package/dist/builder/copy.js.map +0 -1
- package/dist/builder/dts/index.js.map +0 -1
- package/dist/builder/dts/rollup.js.map +0 -1
- package/dist/builder/dts/tsc.js.map +0 -1
- package/dist/builder/index.js.map +0 -1
- package/dist/builder/platform.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/command.js.map +0 -1
- package/dist/config/defineConfig.js.map +0 -1
- package/dist/config/legacySchema.js.map +0 -1
- package/dist/config/merge.js.map +0 -1
- package/dist/config/normalize.js.map +0 -1
- package/dist/config/schema.js.map +0 -1
- package/dist/config/transformLegacyConfig.js.map +0 -1
- package/dist/config/valid.js.map +0 -1
- package/dist/constants/build.js.map +0 -1
- package/dist/constants/color.js.map +0 -1
- package/dist/constants/dts.js.map +0 -1
- package/dist/constants/file.js.map +0 -1
- package/dist/constants/legacy-preset.js.map +0 -1
- package/dist/constants/log.js.map +0 -1
- package/dist/constants/preset.js.map +0 -1
- package/dist/dev.js.map +0 -1
- package/dist/error.js.map +0 -1
- package/dist/hooks/build.js.map +0 -1
- package/dist/hooks/dev.js.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/misc.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/locale/en.js.map +0 -1
- package/dist/locale/index.js.map +0 -1
- package/dist/locale/zh.js.map +0 -1
- package/dist/plugins.js.map +0 -1
- package/dist/types/color.js.map +0 -1
- package/dist/types/command.js.map +0 -1
- package/dist/types/config/copy.js.map +0 -1
- package/dist/types/config/dev.js.map +0 -1
- package/dist/types/config/index.js.map +0 -1
- package/dist/types/config/style.js.map +0 -1
- package/dist/types/context.js.map +0 -1
- package/dist/types/dts.js.map +0 -1
- package/dist/types/hooks.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/legacyConfig/index.js.map +0 -1
- package/dist/types/legacyConfig/output.js.map +0 -1
- package/dist/types/legacyConfig/source.js.map +0 -1
- package/dist/types/legacyConfig/tools.js.map +0 -1
- package/dist/types/utils.d.ts +0 -5
- package/dist/types/utils.js +0 -4
- package/dist/utils/builder.js.map +0 -1
- package/dist/utils/common.js.map +0 -1
- package/dist/utils/context.d.ts +0 -7
- package/dist/utils/context.js +0 -23
- package/dist/utils/context.js.map +0 -1
- package/dist/utils/dts.js.map +0 -1
- package/dist/utils/input.js.map +0 -1
- package/dist/utils/language.d.ts +0 -1
- package/dist/utils/language.js +0 -22
- package/dist/utils/language.js.map +0 -1
- package/dist/utils/libuild-plugin.d.ts +0 -3
- package/dist/utils/libuild-plugin.js +0 -31
- package/dist/utils/libuild-plugin.js.map +0 -1
- package/dist/utils/log.js.map +0 -1
- package/dist/utils/onExit.js.map +0 -1
- package/dist/utils/path.d.ts +0 -1
- package/dist/utils/path.js +0 -19
- package/dist/utils/path.js.map +0 -1
- package/dist/utils/print.js.map +0 -1
- package/dist/utils/style.js.map +0 -1
- package/dist/utils/tspathsTransform.js +0 -91
- package/dist/utils/tspathsTransform.js.map +0 -1
- /package/dist/utils/{tspathsTransform.d.ts → tspath.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;EAEaA,SAAO;WAAPA;;EAcAC,wBAAsB;WAAtBA;;EAoBAC,+BAA6B;WAA7BA;;EA4BAC,0BAAwB;WAAxBA;;EAqBAC,iCAA+B;WAA/BA;;EA6BAC,eAAa;WAAbA;;EAEAC,yBAAuB;WAAvBA;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G,KAAK;IACLQ,iBAAiB;IACjBT,QAAQ;EACV;EACA;IACED,WAAW;IACXF,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLQ,iBAAiB;IACjBT,QAAQ;EACV;EACA;IACED,WAAW;IACXE,KAAK;MACHC,MAAM;IACR;IACAF,QAAQ;EACV;;AAGK,MAAMN,uBAAiD;EAC5D;IACEK,WAAW;IACXF,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLQ,iBAAiB;IACjBT,QAAQ;EACV;EACA;IACED,WAAW;IACXF,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLQ,iBAAiB;IACjBT,QAAQ;EACV;EACA;IACED,WAAW;IACXF,QAAQ;IACRC,QAAQ;IACRG,KAAK;IACLQ,iBAAiB;IACjBT,QAAQ;EACV;EACA;IACED,WAAW;IACXE,KAAK;MACHC,MAAM;IACR;IACAF,QAAQ;EACV;;AAGK,MAAML,aAAuD;EAClE,GAAGV;EACH,GAAGC;EACH,GAAGC;EACH,GAAGC;EACH,GAAGC;EACH,GAAGC;EACH,GAAGC;EACH,GAAGC;EACH,kBAAkBC;EAClB,uBAAuBC;AACzB;AAEO,MAAME,iBAA2D;EACtEc,aAAa7B;EACb,eAAeA;EACf8B,sBAAsB7B;EACtB,wBAAwBA;EACxB8B,eAAe7B;EACf,iBAAiBA;EACjB8B,wBAAwB7B;EACxB,0BAA0BA;EAC1B,kBAAkBS;EAClB,uBAAuBC;AACzB;","names":["targets","npmLibraryPresetConfig","npmLibraryWithUmdPresetConfig","npmComponentPresetConfig","npmComponentWithUmdPresetConfig","libraryPreset","libraryPresetWithTarget","libraryUmdPreset","libraryUmdPresetWithTarget","componentPreset","componentPresetWithTarget","componentUmdPreset","componentUmdPresetWithTarget","nodeBuildConfig","universalBuildConfig","presetList","internalPreset","format","target","buildType","outDir","dts","only","distPath","platform","reduce","ret","map","config","externalHelpers","NPM_LIBRARY","NPM_LIBRARY_WITH_UMD","NPM_COMPONENT","NPM_COMPONENT_WITH_UMD"],"sources":["../../src/constants/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/constants/preset.ts"],"sourcesContent":["import type { PartialBaseBuildConfig, Target } from '../types';\n\nexport const targets: Target[] = [\n 'es5',\n 'es6',\n 'es2015',\n 'es2016',\n 'es2017',\n 'es2018',\n 'es2019',\n 'es2020',\n 'es2021',\n 'es2022',\n 'esnext',\n];\n\nexport const npmLibraryPresetConfig: PartialBaseBuildConfig[] = [\n {\n format: 'cjs',\n target: 'es6',\n buildType: 'bundle',\n outDir: './dist/lib',\n dts: false,\n },\n {\n format: 'esm',\n target: 'es6',\n buildType: 'bundle',\n outDir: './dist/es',\n dts: false,\n },\n {\n buildType: 'bundle',\n dts: { only: true, distPath: './types' },\n },\n];\nexport const npmLibraryWithUmdPresetConfig: PartialBaseBuildConfig[] = [\n {\n format: 'cjs',\n target: 'es6',\n buildType: 'bundle',\n outDir: './dist/lib',\n dts: false,\n },\n {\n format: 'esm',\n target: 'es6',\n buildType: 'bundle',\n outDir: './dist/es',\n dts: false,\n },\n {\n format: 'umd',\n target: 'es6',\n platform: 'browser',\n buildType: 'bundle',\n outDir: './dist/umd',\n dts: false,\n },\n {\n buildType: 'bundle',\n dts: { only: true, distPath: './types' },\n },\n];\nexport const npmComponentPresetConfig: PartialBaseBuildConfig[] = [\n {\n format: 'cjs',\n target: 'es6',\n buildType: 'bundleless',\n outDir: './dist/lib',\n dts: false,\n },\n {\n format: 'esm',\n target: 'es6',\n buildType: 'bundleless',\n outDir: './dist/es',\n dts: false,\n },\n {\n buildType: 'bundleless',\n outDir: './dist/types',\n dts: { only: true },\n },\n];\nexport const npmComponentWithUmdPresetConfig: PartialBaseBuildConfig[] = [\n {\n format: 'cjs',\n target: 'es6',\n buildType: 'bundleless',\n outDir: './dist/lib',\n dts: false,\n },\n {\n format: 'esm',\n target: 'es6',\n buildType: 'bundleless',\n outDir: './dist/es',\n dts: false,\n },\n {\n format: 'umd',\n target: 'es6',\n platform: 'browser',\n buildType: 'bundle',\n outDir: './dist/umd',\n dts: false,\n },\n {\n buildType: 'bundleless',\n dts: { only: true, distPath: './types' },\n },\n];\n\nexport const libraryPreset = { 'npm-library': npmLibraryPresetConfig };\n\nexport const libraryPresetWithTarget = targets.reduce((ret, target) => {\n ret[`npm-library-${target}`] = libraryPreset['npm-library'].map(config => {\n return { ...config, target };\n });\n return ret;\n}, {} as Record<`npm-library-${Target}`, PartialBaseBuildConfig[]>);\n\nexport const libraryUmdPreset = {\n 'npm-library-with-umd': npmLibraryWithUmdPresetConfig,\n};\nexport const libraryUmdPresetWithTarget = targets.reduce((ret, target) => {\n ret[`npm-library-with-umd-${target}`] = libraryUmdPreset[\n 'npm-library-with-umd'\n ].map(config => {\n return { ...config, target };\n });\n return ret;\n}, {} as Record<`npm-library-with-umd-${Target}`, PartialBaseBuildConfig[]>);\n\nexport const componentPreset = {\n 'npm-component': npmComponentPresetConfig,\n};\nexport const componentPresetWithTarget = targets.reduce((ret, target) => {\n ret[`npm-component-${target}`] = componentPreset['npm-component'].map(\n config => {\n return { ...config, target };\n },\n );\n return ret;\n}, {} as Record<`npm-component-${Target}`, PartialBaseBuildConfig[]>);\n\nexport const componentUmdPreset = {\n 'npm-component-with-umd': npmComponentWithUmdPresetConfig,\n};\nexport const componentUmdPresetWithTarget = targets.reduce((ret, target) => {\n ret[`npm-component-with-umd-${target}`] = componentUmdPreset[\n 'npm-component-with-umd'\n ].map(config => {\n return { ...config, target };\n });\n return ret;\n}, {} as Record<`npm-component-with-umd-${Target}`, PartialBaseBuildConfig[]>);\n\nexport const nodeBuildConfig: PartialBaseBuildConfig[] = [\n {\n buildType: 'bundleless',\n format: 'cjs',\n target: 'es2019',\n dts: false,\n externalHelpers: true,\n outDir: './dist/cjs',\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es2019',\n dts: false,\n externalHelpers: true,\n outDir: './dist/esm',\n },\n {\n buildType: 'bundleless',\n dts: {\n only: true,\n },\n outDir: './dist/types',\n },\n];\n\nexport const universalBuildConfig: PartialBaseBuildConfig[] = [\n {\n buildType: 'bundleless',\n format: 'cjs',\n target: 'es2019',\n dts: false,\n externalHelpers: true,\n outDir: './dist/cjs',\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es5',\n dts: false,\n externalHelpers: true,\n outDir: './dist/esm',\n },\n {\n buildType: 'bundleless',\n format: 'esm',\n target: 'es2019',\n dts: false,\n externalHelpers: true,\n outDir: './dist/esm-node',\n },\n {\n buildType: 'bundleless',\n dts: {\n only: true,\n },\n outDir: './dist/types',\n },\n];\n\nexport const presetList: Record<string, PartialBaseBuildConfig[]> = {\n ...libraryPreset,\n ...libraryPresetWithTarget,\n ...libraryUmdPreset,\n ...libraryUmdPresetWithTarget,\n ...componentPreset,\n ...componentPresetWithTarget,\n ...componentUmdPreset,\n ...componentUmdPresetWithTarget,\n 'modern-js-node': nodeBuildConfig,\n 'modern-js-universal': universalBuildConfig,\n};\n\nexport const internalPreset: Record<string, PartialBaseBuildConfig[]> = {\n NPM_LIBRARY: npmLibraryPresetConfig,\n 'npm-library': npmLibraryPresetConfig,\n NPM_LIBRARY_WITH_UMD: npmLibraryWithUmdPresetConfig,\n 'npm-library-with-umd': npmLibraryWithUmdPresetConfig,\n NPM_COMPONENT: npmComponentPresetConfig,\n 'npm-component': npmComponentPresetConfig,\n NPM_COMPONENT_WITH_UMD: npmComponentWithUmdPresetConfig,\n 'npm-component-with-umd': npmComponentWithUmdPresetConfig,\n 'modern-js-node': nodeBuildConfig,\n 'modern-js-universal': universalBuildConfig,\n};\n"]}
|
package/dist/dev.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAMaA,UAAQ;WAARA;;EAsCAC,KAAG;WAAHA;;;;uBA3C2B;AAKjC,MAAMD,WAAW,OACtBE,OACAC,eACAC,KACAC;AAEA,QAAMC,SAASF,IAAIG,eAAc;AAEjC,QAAMC,YAAYC,aAAMC,IAAI,KAAK,KAAK;AACtC,QAA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6B;IAAY;EAChE,WAAWhC,MAAMuB,SAAS,GAAG;AAC3B,UAAMzB,SAASE,OAAOiC,SAAS/B,KAAKC;EACtC;AACF;","names":["showMenu","dev","metas","devCmdOptions","api","context","runner","useHookRunners","menuTitle","chalk","rgb","choices","map","meta","menuItem","filter","questions","name","message","type","newQuestions","beforeDevMenu","result","inquirer","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 { chalk, inquirer, logger } from '@modern-js/utils';\nimport type { DevCommandOptions } from './types/command';\nimport type { ModuleContext } from './types/context';\nimport type { DevToolData, ModuleTools } from './types';\n\nexport const showMenu = async (\n metas: DevToolData[],\n devCmdOptions: DevCommandOptions,\n api: PluginAPI<ModuleTools>,\n context: ModuleContext,\n) => {\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 await runner.beforeDevTask(currentDevTool);\n await currentDevTool.action(devCmdOptions, {\n isTsProject: context.isTsProject,\n });\n }\n};\n\nexport const dev = async (\n options: DevCommandOptions,\n metas: DevToolData[],\n api: PluginAPI<ModuleTools>,\n context: ModuleContext,\n) => {\n const { green } = await import('./constants/color');\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 await runner.beforeDevTask(meta);\n await meta.action(options, { isTsProject: context.isTsProject });\n } else if (metas.length > 1) {\n await showMenu(metas, options, api, context);\n }\n};\n"]}
|
package/dist/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,MAAC;AAEN,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,WA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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;AAEA,MAAIA,aAAatB,sBAAsBsB,aAAarB,kBAAkB;AACpE,WAAO;EACT;AAEA,SAAO;AACT;AAEO,MAAMG,eAAe,CAACkB;AAC3B,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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAESA,cAAY;WAAZA;;EAAcC,oBAAkB;WAAlBA;;EACdC,eAAa;WAAbA;;EAEAC,aAAW;WAAXA;;EACT,SAA2B;WAA3B;;;;qBAN4B;8BAEqB;8BACnB;uBAChB;MAEd,WAAeA;","names":["defineConfig","defineLegacyConfig","legacyPresets","moduleTools"],"sources":["../src/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/index.ts"],"sourcesContent":["import { moduleTools } from './cli';\n\nexport { defineConfig, defineLegacyConfig } from './config/defineConfig';\nexport { legacyPresets } from './constants/legacy-preset';\nexport * from './types';\nexport { moduleTools };\nexport default moduleTools;\n"]}
|
package/dist/locale/en.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BASaA;;;WAAAA;;;uBATS;AAEtB,MAAMC,aAAa;MACbC,aAAMC,UACRD,aAAME,KAAK,gBACX;;AAIG,MAAMJ,YAAY;EACvBK,SAAS;IACPC,QAAQ;MACNC,QACE;MACFC,eAAe;IACjB;IACAC,OAAO;MACLC,UAAU;MACVC,OAAO;MACPC,UAAU;MACVC,WAAW;MACXC,UACE;MACFC,OAAO;MACPC,KAAK;MACLC,SAAS;IACX;IACAC,KAAK;MACHR,UAAU;MACVE,UAAU;IACZ;IACAO,KAAK;MACHT,UAAU;MACVU,OAAO;MACPb,QAAQ;MACRc,SAAS;MACTC,UAAU;MACVC,MAAM;IACR;EACF;EACAC,KAAK;IACHN,KAAK;MACHO,YAAYxB;IACd;IACAyB,gBACE;EACJ;EACAC,QAAQ;IACNC,iBAAiB;QACb1B,aAAME,KAAK;QACXF,aAAM2B,OAAO,8BAA8B3B,aAAM2B,OACnD;;QAGE3B,aAAME,KAAK;QACXF,aAAM2B,OAAO,+BAA+B3B,aAAM2B,OACpD;;QAGE3B,aAAME,KAAK;QACXF,aAAM2B,OAAO,iCAAiC3B,aAAM2B,OACtD;;EAGJ;EACAC,OAAO;IACLd,KAAK;MACHe,cACE;IACJ;IACAC,eACE;EACJ;AACF;","names":["EN_LOCALE","noDevTools","chalk","underline","blue","command","shared","config","noNeedInstall","build","describe","watch","tsconfig","styleOnly","platform","noTsc","dts","noClear","dev","new","debug","distTag","registry","lang","log","noDevtools","buildConfigTip","errors","externalHelpers","yellow","warns","abortOnError","clearRootPath"],"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 shared: {\n config:\n 'sspecify the configuration file, which can be a relative or absolute path',\n noNeedInstall: 'not run install command',\n },\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 },\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 buildConfigTip:\n 'The configuration file of the current project has both `buildConfig` and `buildPreset` options. However, only the `buildConfig` configuration will take effect. If you need to override the content of `buildPreset`, please use the function type of `buildPreset` (refer to the API documentation for details).',\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 clearRootPath:\n 'It is detected that the outDir in the configuration is the same as the current project directory, and the current product directory will not be automatically deleted.',\n },\n};\n"]}
|
package/dist/locale/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BASaA;;;WAAAA;;;uBATS;AAEtB,MAAMC,aAAa;MACbC,aAAMC,UACRD,aAAME,KAAK,iBACX;;AAIG,MAAMJ,YAAY;EACvBK,SAAS;IACPC,QAAQ;MACNC,QAAQ;MACRC,eAAe;IACjB;IACAC,OAAO;MACLC,UAAU;MACVC,OAAO;MACPC,UAAU;MACVC,WAAW;MACXC,UACE;MACFC,OAAO;MACPC,KAAK;MACLC,SAAS;IACX;IACAC,KAAK;MACHR,UAAU;MACVE,UAAU;IACZ;IACAO,KAAK;MACHT,UAAU;MACVU,OAAO;MACPb,QAAQ;MACRc,SAAS;MACTC,UAAU;MACVC,MAAM;IACR;EACF;EACAC,KAAK;IACHN,KAAK;MACHO,YAAYxB;IACd;IACAyB,gBACE;EACJ;EACAC,QAAQ;IACNC,iBAAiB;QACb1B,aAAME,KAAK;QACXF,aAAM2B,OAAO,8BAA8B3B,aAAM2B,OACnD;;QAGE3B,aAAME,KAAK;QACXF,aAAM2B,OAAO,+BAA+B3B,aAAM2B,OACpD;;QAGE3B,aAAME,KAAK;QACXF,aAAM2B,OAAO,iCAAiC3B,aAAM2B,OACtD;;EAGJ;EACAC,OAAO;IACLd,KAAK;MACHe,cACE;IACJ;IACAC,eACE;EACJ;AACF;","names":["ZH_LOCALE","noDevTools","chalk","underline","blue","command","shared","config","noNeedInstall","build","describe","watch","tsconfig","styleOnly","platform","noTsc","dts","noClear","dev","new","debug","distTag","registry","lang","log","noDevtools","buildConfigTip","errors","externalHelpers","yellow","warns","abortOnError","clearRootPath"],"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 shared: {\n config: '指定配置文件路径,可以为相对路径或绝对路径',\n noNeedInstall: '无需安装依赖',\n },\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 },\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 buildConfigTip:\n '当前项目的配置文件中同时设置了 `buildConfig` 和 `buildPreset`,因此仅有 `buildConfig` 配置能够生效。如果你需要覆盖 `buildPreset` 的内容,请使用 `buildPreset` 的函数配置方式(详见 API 文档)。',\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 clearRootPath:\n '检测到配置中 outDir 与当前项目目录相同,不会自动删除当前产物目录',\n },\n};\n"]}
|
package/dist/plugins.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAIaA;;;WAAAA;;;iCAHmB;4BACL;AAEpB,MAAMA,aAAa,CAACC;AACzB,MAAIC,UAAuB;AAE3B,UAAQD;IACN,KAAK;AACHC,gBAAU;AACV;IACF,KAAK;AACHA,gBAAU;SAACC,2BAAU;;AACrB;IACF,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;AACHD,gBAAU;SAACE,qCAAe;;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 case 'pre':\n case 'gen-release-note':\n plugins = [changesetPlugin()];\n break;\n default:\n plugins = [];\n }\n\n return plugins;\n};\n"]}
|
package/dist/types/color.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/color.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/command.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/config/copy.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/config/dev.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;uBAkBc;","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 type { TestConfig } from '@modern-js/types';\nimport { internalPreset, presetList } from '../../constants/preset';\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 /**\n * Only for rollup-plugin-dts, see more in https://github.com/Swatinem/rollup-plugin-dts#what-to-expect.\n * We hope you use external to prevent them(like @types) which come from node_modules from be bundled.\n * However, some types from outside that we don't re-export are also checked by plugin.\n * And a third-party package is uncontrollable, it may cause errors.\n * You can overridden by setting it false to excluded all packages from node_modules.\n * @default true\n */\n respectExternal: 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 transformLodash?: boolean;\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 internalPreset;\n extendPreset: (\n extendPresetName: keyof typeof internalPreset,\n extendBuildConfig: PartialBaseBuildConfig,\n ) => PartialBaseBuildConfig[];\n }) => PartialBaseBuildConfig[] | Promise<PartialBaseBuildConfig[]>);\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 /**\n * @deprecated designSystem is no longer required.\n * If you are using Tailwind CSS, you can now use the `theme` option of Tailwind CSS, they are the same.\n */\n designSystem?: Record<string, any>;\n\n buildConfig?: PartialBuildConfig;\n\n buildPreset?: BuildPreset;\n\n dev?: Dev;\n\n testing?: TestConfig;\n\n runtime?: RuntimeUserConfig;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/config/style.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/context.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
package/dist/types/dts.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/dts.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
package/dist/types/hooks.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../src/types/hooks.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
package/dist/types/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;uBAQc;uBACA;uBACA;uBACA;uBACA;uBACA;","names":[],"sources":["../../src/types/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/types/index.ts"],"sourcesContent":["import type { NormalizedConfig, UserConfig } from '@modern-js/core';\nimport type { ModuleToolsHooks } from './hooks';\nimport type { ModuleExtraConfig } from './config';\nimport type {\n ModuleToolsLegacyUserConfig,\n ModuleToolsLegacyNormalizedConfig,\n} from './legacyConfig';\n\nexport * from './hooks';\nexport * from './command';\nexport * from './config';\nexport * from './legacyConfig';\nexport * from './dts';\nexport * from './context';\nexport type { CliPlugin, IAppContext, PluginAPI } from '@modern-js/core';\n\nexport type ModuleTools = {\n hooks: ModuleToolsHooks;\n userConfig: ModuleExtraConfig;\n normalizedConfig: Required<ModuleExtraConfig>;\n};\nexport type LegacyModuleTools = {\n hooks: ModuleToolsHooks;\n userConfig: ModuleToolsLegacyUserConfig;\n normalizedConfig: ModuleToolsLegacyNormalizedConfig;\n};\n\nexport type ModuleUserConfig = UserConfig<ModuleTools>;\nexport type ModuleLegacyUserConfig = UserConfig<LegacyModuleTools>;\n\nexport type ModuleNormalizedConfig = NormalizedConfig<ModuleTools>;\nexport type ModuleLegacyNormalizedConfig = NormalizedConfig<LegacyModuleTools>;\n\n// params type for defineConfig\nexport type ModuleConfigParams =\n | ModuleUserConfig\n | Promise<ModuleUserConfig>\n | ((env: any) => ModuleUserConfig | Promise<ModuleUserConfig>);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/legacyConfig/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/legacyConfig/output.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/legacyConfig/source.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";AACA,OAAO,eAAe,SAAS,cAAc;AAAA,EACzC,OAAO;AACX,CAAC;","names":[],"sources":["../../../src/types/legacyConfig/tools.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n"]}
|
package/dist/types/utils.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type DeepPartial<T> = T extends Function ? T : T extends Array<infer U> ? DeepPartialArray<U> : T extends object ? DeepPartialObject<T> : T | undefined;
|
|
2
|
-
/** @private */
|
|
3
|
-
export type DeepPartialArray<T> = Array<DeepPartial<T>>;
|
|
4
|
-
/** @private */
|
|
5
|
-
export type DeepPartialObject<T> = { [P in keyof T]?: DeepPartial<T[P]> };
|
package/dist/types/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EASaA,YAAU;WAAVA;;EA2CAC,iBAAe;WAAfA;;EAmBAC,4BAA0B;WAA1BA;;EAoCAC,yBAAuB;WAAvBA;;;;;iEA3GI;uBACU;AAQpB,MAAMH,aAAa,OACxBI,cACAC,UAII,CAAC,MAAC;AAEN,MAAI;AACF,UAAMC,OAAOC,KAAKC,MAChBC,UAAGC,aAAaC,cAAKC,QAAQR,cAAc,mBAAmB;AAGhE,QAAIS,OAAiB;AAErB,QAAIR,QAA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AIA,MAAIC,cAAc,YAAYC,WAAW,OAAO;AAC9C,WAAO;EACT;AAEA,SAAO;AACT;","names":["getAllDeps","checkSwcHelpers","matchSwcTransformCondition","matchEs5PluginCondition","appDirectory","options","json","JSON","parse","fs","readFileSync","path","resolve","deps","dependencies","Object","keys","devDependencies","peerDependencies","e","logger","warn","externalHelpers","swcHelpersPkgName","includes","local","Error","i18n","t","localeKeys","errors","condtionOptions","sourceType","buildType","format","disableSwcTransform","target"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/builder.ts"],"sourcesContent":["import path from 'path';\nimport { logger, fs } from '@modern-js/utils';\nimport type {\n ExternalHelpers,\n BuildType,\n Format,\n Target,\n} from '../types/config';\n\nexport const getAllDeps = async <T>(\n appDirectory: string,\n options: {\n dependencies?: boolean;\n devDependencies?: boolean;\n peerDependencies?: boolean;\n } = {},\n) => {\n try {\n const json = JSON.parse(\n fs.readFileSync(path.resolve(appDirectory, './package.json'), 'utf8'),\n );\n\n let deps: string[] = [];\n\n if (options.dependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.dependencies as T | undefined) || {}),\n ];\n }\n\n if (options.devDependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.devDependencies as T | undefined) || {}),\n ];\n }\n\n if (options.peerDependencies) {\n deps = [\n ...deps,\n ...Object.keys((json.peerDependencies as T | undefined) || {}),\n ];\n }\n\n return deps;\n } catch (e) {\n logger.warn('package.json is broken');\n return [];\n }\n};\n\nexport const checkSwcHelpers = async (options: {\n appDirectory: string;\n externalHelpers: ExternalHelpers;\n}) => {\n const { appDirectory, externalHelpers } = options;\n if (externalHelpers === false) {\n return;\n }\n const deps = await getAllDeps(appDirectory, {\n dependencies: true,\n devDependencies: true,\n });\n const swcHelpersPkgName = '@swc/helpers';\n if (!deps.includes(swcHelpersPkgName)) {\n const local = await import('../locale');\n throw new Error(local.i18n.t(local.localeKeys.errors.externalHelpers));\n }\n};\n\nexport const matchSwcTransformCondition = (condtionOptions: {\n sourceType: 'commonjs' | 'module';\n buildType: BuildType;\n format: Format;\n disableSwcTransform?: boolean;\n}) => {\n const { sourceType, buildType, format, disableSwcTransform } =\n condtionOptions;\n\n if (disableSwcTransform) {\n return false;\n }\n\n // 1. source code is esm\n // 2. bundleless\n // 3. bundle and format is esm\n\n if (sourceType === 'commonjs') {\n return false;\n }\n\n if (buildType === 'bundleless') {\n return true;\n }\n\n if (format === 'esm' || format === 'iife') {\n // when format is iife, swc-transform only transform syntax, esbuild transform js format.\n return true;\n }\n\n // bundle only use esbuild-transform in cjs format, because have some limitations\n // eg: treeshaking\n\n return false;\n};\n\nexport const matchEs5PluginCondition = (condtionOptions: {\n sourceType: 'commonjs' | 'module';\n buildType: BuildType;\n format: Format;\n target: Target;\n disableSwcTransform?: boolean;\n}) => {\n const { sourceType, buildType, format, target, disableSwcTransform } =\n condtionOptions;\n\n // dist is es5\n if (target !== 'es5') {\n return false;\n }\n\n // when use disbaleSwcTransform option, we must be use es5Plugin when target is es5\n if (disableSwcTransform) {\n return true;\n }\n\n // only use esbuild-transform, so need es5Plugin\n if (sourceType === 'commonjs') {\n return true;\n }\n\n // when source code is esm and dist is bundle + cjs, we can`t use swc-transform.\n // so we only use esbuild-transform and es5Plugin\n if (buildType === 'bundle' && format === 'cjs') {\n return true;\n }\n\n return false;\n};\n"]}
|
package/dist/utils/common.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"mappings":";;;;;;;;;;;;EAGaA,yBAAuB;WAAvBA;;EAWGC,UAAQ;WAARA;;;AAXT,MAAMD,0BAA0B,CACrCE;AAEA,SAAOA,IAAIC,OAAO,CAACC,GAAGC;AACpB,WAAO;MACL,GAAGD;MACH,CAACC,MAAMC;IACT;EACF,GAAG,CAAC;AACN;AAEO,SAASL,SACdM,KACAC,QAAmB;AAEnB,SAAOC,OAAOC,YACZD,OAAOE,QAAQJ,KAAKK,IAAI,CAAC,CAACP,KAAKQ,WAAW;IAACR;IAAKG,OAAOK;GAAO;AAElE;","names":["transformUndefineObject","mapValue","arr","reduce","o","key","undefined","obj","mapper","Object","fromEntries","entries","map","value"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/common.ts"],"sourcesContent":["/**\n * transform ['a', 'b'] to {a: undefined, b: undefined}\n */\nexport const transformUndefineObject = (\n arr: string[],\n): Record<string, undefined> => {\n return arr.reduce((o, key) => {\n return {\n ...o,\n [key]: undefined,\n };\n }, {});\n};\n\nexport function mapValue<T = any, U = any>(\n obj: Record<string, T>,\n mapper: (x: T) => U,\n): Record<string, U> {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [key, mapper(value)]),\n );\n}\n"]}
|
package/dist/utils/context.d.ts
DELETED
package/dist/utils/context.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "initModuleContext", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return initModuleContext;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const initModuleContext = async (api) => {
|
|
13
|
-
const { isTypescript } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
14
|
-
const { appDirectory, srcDirectory } = api.useAppContext();
|
|
15
|
-
const isTsProject = isTypescript(appDirectory);
|
|
16
|
-
return {
|
|
17
|
-
isTsProject,
|
|
18
|
-
appDirectory,
|
|
19
|
-
srcDirectory
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAGaA;;;WAAAA;;;;AAAN,MAAMA,oBAAoB,OAAOC;AACtC,QAAM,EAAEC,aAAY,IAAK,MAAM,iFAAO;AACtC,QAAM,EAAEC,cAAcC,aAAY,IAAKH,IAAII,cAAa;AACxD,QAAMC,cAAcJ,aAAaC;AAEjC,SAAO;IAAEG;IAAaH;IAAcC;EAAa;AACnD;","names":["initModuleContext","api","isTypescript","appDirectory","srcDirectory","useAppContext","isTsProject"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/context.ts"],"sourcesContent":["import type { PluginAPI } from '@modern-js/core';\nimport type { ModuleTools } from '../types';\n\nexport const initModuleContext = async (api: PluginAPI<ModuleTools>) => {\n const { isTypescript } = await import('@modern-js/utils');\n const { appDirectory, srcDirectory } = api.useAppContext();\n const isTsProject = isTypescript(appDirectory);\n\n return { isTsProject, appDirectory, srcDirectory };\n};\n"]}
|
package/dist/utils/dts.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EASaA,oBAAkB;WAAlBA;;EAUAC,mBAAiB;WAAjBA;;EAkEAC,eAAa;WAAbA;;EAyBAC,cAAY;WAAZA;;EA8EAC,uBAAqB;WAArBA;;EA2BAC,yBAAuB;WAAvBA;;;;sBAvN0D;uBACd;AAQlD,MAAML,qBAAqB,OAChCM;AAEA,MAAI,CAACC,UAAGC,WAAWF,eAAe;AAChC,WAAO,CAAC;EACV;AAEA,SAAOG,aAAMC,MAAMH,UAAGI,aAAaL,cAAc;AACnD;AAEO,MAAML,oBAAoB,OAC/BW;MAuBmBC;AArBnB,QAAM,EAAEC,cAAcC,WAAWC,cAAcV,aAAY,IAAKM;AAEhE,QAAMC,eAAe,MAAMb,mBAAmBM;AAC9C,QAAM,EAAEW,iBAAgB,IAAK,MAAM,iFAAO;AAE1C,QAAMC,uBAAsBC,eAC1BL,cACA,GAAGG,qBAAoBG,kBAAM,GAAI;AAEnC,QAAMC,qBAAoBF,eACxBD,sBACAI,mBAASR,cAAcE;AAGzB,QAAMO,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AO;AAC3C,QAAM,EAAEC,YAAW,IAAK/C;AACxB,QAAMgD,cAAc,GAAGhB;AACvB,QAAMiB,eACJJ,eAAeK,SAAS,IACpBL,iBACAM,cAAOC,KAAKJ,aAAa;IAAEK,UAAU;EAAK;MAIvCpD;AAHT,QAAMqD,SAASR,kBAAkB;IAC/BS,WAAWN;IACXO,SAASlD;IACTmD,QAAOxD,oFAAayB,qBAAe,QAA5BzB,kFAA8BwD,WAAK,QAAnCxD,uFAAuC,CAAC;EACjD;AACA,aAAWyD,KAAKJ,QAAQ;AACtB3D,cAAGgE,cAAcD,EAAEvC,MAAMuC,EAAEE,OAAO;EACpC;AAGA,QAAMjE,UAAGkE,UAAUd;AACnB,QAAMpD,UAAGmE,KAAK9B,oBAAoBe;AACpC;AAgDO,MAAMvD,wBAAwB,OACnCuE,OACAnB;AAEA,QAAM,EAAEoB,iBAAgB,IAAK,MAAM,iFAAO;AAC1C,QAAMC,QAAQ,MAAM,iFAAO;AAC3B,QAAM,EAAEC,cAAcC,UAAS,IAAKvB,mDAAW,CAAC;AAChD,MAAImB,iBAAiBpB,OAAO;AAC1B,QAAIuB,cAAc;AAChB,YAAM,IAAIF,iBAAiBD,OAAO;QAChCI;MACF;IACF,OAAO;AACLC,oBAAOC,KACLC,aAAMC,eACJN,MAAMO,KAAKC,EAAER,MAAMS,WAAWC,MAAMC,IAAIV,YAAY;AAGxDE,oBAAOL,MACL,IAAIC,iBAAiBD,OAAO;QAC1BI;MACF;IAEJ;EACF;AACF;AAEO,MAAM1E,0BAA0B,CAACoF,WACtCA,WAAW,YAAYA,WAAW;","names":["getProjectTsconfig","generatorTsConfig","getTscBinPath","resolveAlias","printOrThrowDtsErrors","tsTargetAtOrAboveES2022","tsconfigPath","fs","existsSync","json5","parse","readFileSync","config","userTsconfig","appDirectory","sourceDir","absSourceDir","dtsTempDirectory","tempDistAbsRootPath","join","nanoid","tempDistAbsOurDir","relative","tempTsconfigPath","basename","ensureFileSync","extendsPath","dirname","references","map","reference","path","userTsconfigDir","generatedTsconfigDir","isAbsolute","resolve","resetConfig","extends","compilerOptions","declaration","emitDeclarationOnly","declarationDir","writeJSONSync","generatedTsconfig","tempDistAbsSrcPath","default","findUp","exists","pathExists","tscBinFile","directory","targetFilePath","hasTscBinFile","undefined","cwd","Error","options","watchFilenames","transformDtsAlias","distAbsPath","dtsDistPath","dtsFilenames","length","globby","sync","absolute","result","filenames","baseUrl","paths","r","writeFileSync","content","ensureDir","copy","error","InternalDTSError","local","abortOnError","buildType","logger","warn","chalk","bgYellowBright","i18n","t","localeKeys","warns","dts","target"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/dts.ts"],"sourcesContent":["import { join, dirname, isAbsolute, relative, resolve, basename } from 'path';\nimport { chalk, fs, globby, json5, logger, nanoid } from '@modern-js/utils';\nimport type {\n ITsconfig,\n BundlelessGeneratorDtsConfig,\n BuildType,\n TsTarget,\n} from '../types';\n\nexport const getProjectTsconfig = async (\n tsconfigPath: string,\n): Promise<ITsconfig> => {\n if (!fs.existsSync(tsconfigPath)) {\n return {};\n }\n\n return json5.parse(fs.readFileSync(tsconfigPath, 'utf-8'));\n};\n\nexport const generatorTsConfig = async (\n config: BundlelessGeneratorDtsConfig,\n) => {\n const { appDirectory, sourceDir: absSourceDir, tsconfigPath } = config;\n\n const userTsconfig = await getProjectTsconfig(tsconfigPath);\n const { dtsTempDirectory } = await import('../constants/dts');\n\n const tempDistAbsRootPath = join(\n appDirectory,\n `${dtsTempDirectory}/${nanoid()}`,\n );\n const tempDistAbsOurDir = join(\n tempDistAbsRootPath,\n relative(appDirectory, absSourceDir),\n );\n\n const tempTsconfigPath = join(tempDistAbsRootPath, basename(tsconfigPath));\n fs.ensureFileSync(tempTsconfigPath);\n\n const extendsPath = join(\n relative(dirname(tempTsconfigPath), dirname(tsconfigPath)),\n basename(tempTsconfigPath),\n );\n const references = userTsconfig?.references?.map(reference => {\n const { path } = reference;\n if (path) {\n const userTsconfigDir = dirname(tsconfigPath);\n const generatedTsconfigDir = dirname(tempTsconfigPath);\n return {\n path: isAbsolute(path)\n ? path\n : relative(generatedTsconfigDir, resolve(userTsconfigDir, path)),\n };\n }\n return reference;\n });\n\n const resetConfig: ITsconfig = {\n extends: extendsPath,\n compilerOptions: {\n // Ensure that .d.ts files are created by tsc, but not .js files\n declaration: true,\n emitDeclarationOnly: true,\n // when `outDir` is './dist', `declarationDir` is `./types`\n // tsc will emit:\n // - ./dist/index.js\n // - ./types/index.d.ts\n // we only want to emit declarations\n declarationDir: tempDistAbsOurDir,\n },\n references,\n };\n\n fs.writeJSONSync(tempTsconfigPath, resetConfig);\n\n return {\n userTsconfig,\n generatedTsconfig: {\n tempTsconfigPath,\n tempDistAbsRootPath,\n tempDistAbsSrcPath: tempDistAbsOurDir,\n },\n };\n};\n\nexport const getTscBinPath = async (appDirectory: string) => {\n const { default: findUp, exists: pathExists } = await import(\n '../../compiled/find-up'\n );\n const tscBinFile = await findUp(\n async (directory: string) => {\n const targetFilePath = join(directory, './node_modules/.bin/tsc');\n const hasTscBinFile = await pathExists(targetFilePath);\n if (hasTscBinFile) {\n return targetFilePath;\n }\n return undefined;\n },\n { cwd: appDirectory },\n );\n\n if (!tscBinFile || !fs.existsSync(tscBinFile)) {\n throw new Error(\n 'Failed to excute the `tsc` command, please check if `typescript` is installed correctly in the current directory.',\n );\n }\n\n return tscBinFile;\n};\n\nexport const resolveAlias = async (\n config: BundlelessGeneratorDtsConfig,\n options: {\n userTsconfig: ITsconfig;\n tempTsconfigPath: string;\n tempDistAbsRootPath: string;\n tempDistAbsSrcPath: string;\n },\n watchFilenames: string[] = [],\n) => {\n const { userTsconfig, tempDistAbsSrcPath, tempDistAbsRootPath } = options;\n const { transformDtsAlias } = await import('./tspathsTransform');\n const { distAbsPath } = config;\n const dtsDistPath = `${tempDistAbsSrcPath}/**/*.d.ts`;\n const dtsFilenames =\n watchFilenames.length > 0\n ? watchFilenames\n : globby.sync(dtsDistPath, { absolute: true });\n const result = transformDtsAlias({\n filenames: dtsFilenames,\n baseUrl: tempDistAbsRootPath,\n paths: userTsconfig.compilerOptions?.paths ?? {},\n });\n for (const r of result) {\n fs.writeFileSync(r.path, r.content);\n }\n\n // why use `ensureDir` before copy? look this: https://github.com/jprichardson/node-fs-extra/issues/957\n await fs.ensureDir(distAbsPath);\n await fs.copy(tempDistAbsSrcPath, distAbsPath);\n};\n\n// export const matchesPattern = (calleePath: NodePath, pattern: string) => {\n// const { node } = calleePath;\n\n// if (t.isMemberExpression(node)) {\n// return calleePath.matchesPattern(pattern);\n// }\n\n// if (!t.isIdentifier(node) || pattern.includes('.')) {\n// return false;\n// }\n\n// const name = pattern.split('.')[0];\n\n// return node.name === name;\n// };\n\n// export const isImportCall = (calleePath: NodePath<tt.CallExpression>) => {\n// return t.isImport(calleePath.node.callee);\n// };\n\n// export const verifyTsConfigPaths = async (\n// tsconfigAbsPath: string,\n// userAliases?: AliasOption,\n// ) => {\n// const { readTsConfigByFile, chalk } = await import('@modern-js/utils');\n// if (!userAliases) {\n// return;\n// }\n\n// const paths = Object.keys(\n// readTsConfigByFile(tsconfigAbsPath).compilerOptions?.paths || {},\n// ).map(key => key.replace(/\\/\\*$/, ''));\n\n// Object.keys(userAliases).forEach(name => {\n// if (paths.includes(name)) {\n// throw new Error(\n// chalk.red(\n// `It looks like you have configured the alias ${chalk.bold(\n// name,\n// )} in both the modern.config file and tsconfig.json.\\n Please remove the configuration in modern.config file and just keep the configuration in tsconfig.json.`,\n// ),\n// );\n// }\n// });\n// };\n\nexport const printOrThrowDtsErrors = async (\n error: unknown,\n options: { abortOnError?: boolean; buildType: BuildType },\n) => {\n const { InternalDTSError } = await import('../error');\n const local = await import('../locale');\n const { abortOnError, buildType } = options ?? {};\n if (error instanceof Error) {\n if (abortOnError) {\n throw new InternalDTSError(error, {\n buildType,\n });\n } else {\n logger.warn(\n chalk.bgYellowBright(\n local.i18n.t(local.localeKeys.warns.dts.abortOnError),\n ),\n );\n logger.error(\n new InternalDTSError(error, {\n buildType,\n }),\n );\n }\n }\n};\n\nexport const tsTargetAtOrAboveES2022 = (target: TsTarget) =>\n target === 'es2022' || target === 'esnext';\n"]}
|
package/dist/utils/input.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAIaA,sBAAoB;WAApBA;;EAoBAC,gBAAc;WAAdA;;;;iEAxBI;uBAC0B;AAGpC,MAAMD,uBAAuB,OAAO,EACzCE,aACAC,aAAY,MAIb;AACC,MAAIC,QAAQF,cAAc,iBAAiB;AAC3C,MAAIG,UAAGC,WAAWC,cAAKC,QAAQL,cAAcC,SAAS;AACpD,WAAO;MAACA;;EACV;AAEAA,UAAQF,cAAc,kBAAkB;AACxC,MAAIG,UAAGC,WAAWC,cAAKC,QAAQL,cAAcC,SAAS;AACpD,WAAO;MAACA;;EACV;AAEA,SAAO;AACT;AAEO,MAAMH,iBAAiB,OAC5BQ,OACAN,cACAO;AAEA,QAAMC,aAAa;IACjB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;AAGF,MAAID,YAAY;AACdC,eAAWC,KAAK;EAClB;AAEA,OAAIC,mBAAQJ,QAAQ;AAClB,UAAMK,kBAAkB,OAAMC,kBAAON,MAAMO,IAAIC,YAAK,GAAG;MACrDC,mBAAmB;QACjBP;MACF;MACAQ,QAAQ;QAAC;;MACTC,KAAKjB;IACP;AACA,WAAOW;EACT,OAAO;AACL,WAAOL;EACT;AACF;","names":["getDefaultIndexEntry","normalizeInput","isTsProject","appDirectory","entry","fs","existsSync","path","resolve","input","enableSvgr","extensions","push","isArray","normalizedInput","globby","map","slash","expandDirectories","ignore","cwd"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/input.ts"],"sourcesContent":["import path from 'path';\nimport { fs, globby, isArray, slash } from '@modern-js/utils';\nimport { Input } from '../types';\n\nexport const getDefaultIndexEntry = async ({\n isTsProject,\n appDirectory,\n}: {\n isTsProject: boolean;\n appDirectory: string;\n}) => {\n let entry = isTsProject ? 'src/index.ts' : 'src/index.js';\n if (fs.existsSync(path.resolve(appDirectory, entry))) {\n return [entry];\n }\n\n entry = isTsProject ? 'src/index.tsx' : 'src/index.jsx';\n if (fs.existsSync(path.resolve(appDirectory, entry))) {\n return [entry];\n }\n\n return [];\n};\n\nexport const normalizeInput = async (\n input: Input,\n appDirectory: string,\n enableSvgr: boolean,\n) => {\n const extensions = [\n 'js',\n 'ts',\n 'jsx',\n 'tsx',\n 'mjs',\n 'cjs',\n 'mts',\n 'cts',\n 'css',\n 'sass',\n 'scss',\n 'less',\n 'json',\n ];\n\n if (enableSvgr) {\n extensions.push('svg');\n }\n\n if (isArray(input)) {\n const normalizedInput = await globby(input.map(slash), {\n expandDirectories: {\n extensions,\n },\n ignore: ['**/*.d.ts'],\n cwd: appDirectory,\n });\n return normalizedInput;\n } else {\n return input;\n }\n};\n"]}
|
package/dist/utils/language.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const initLocalLanguage: () => Promise<typeof import("../locale")>;
|
package/dist/utils/language.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "initLocalLanguage", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return initLocalLanguage;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const initLocalLanguage = async () => {
|
|
13
|
-
const local = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("../locale")));
|
|
14
|
-
const { getLocaleLanguage } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/plugin-i18n/language-detector")));
|
|
15
|
-
const locale = getLocaleLanguage();
|
|
16
|
-
local.i18n.changeLanguage({
|
|
17
|
-
locale
|
|
18
|
-
});
|
|
19
|
-
return local;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=language.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAAaA;;;WAAAA;;;;AAAN,MAAMA,oBAAoB;AAC/B,QAAMC,QAAQ,MAAM,iFAAO;AAC3B,QAAM,EAAEC,kBAAiB,IAAK,MAAM,iFAClC;AAEF,QAAMC,SAASD;AACfD,QAAMG,KAAKC,eAAe;IAAEF;EAAO;AACnC,SAAOF;AACT;","names":["initLocalLanguage","local","getLocaleLanguage","locale","i18n","changeLanguage"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/language.ts"],"sourcesContent":["export const initLocalLanguage = async () => {\n const local = await import('../locale');\n const { getLocaleLanguage } = await import(\n '@modern-js/plugin-i18n/language-detector'\n );\n const locale = getLocaleLanguage();\n local.i18n.changeLanguage({ locale });\n return local;\n};\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "watchPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return watchPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _logger = require("@modern-js/utils/logger");
|
|
13
|
-
const watchPlugin = (api, config) => {
|
|
14
|
-
return {
|
|
15
|
-
name: "watch-plugin",
|
|
16
|
-
apply(compiler) {
|
|
17
|
-
compiler.hooks.watchChange.tap("watch-plugin", async () => {
|
|
18
|
-
const { watchSectionTitle } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("./log")));
|
|
19
|
-
const { SectionTitleStatus } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("../constants/log")));
|
|
20
|
-
const titleText = `[${config.buildType === "bundle" ? "Bundle" : "Bundleless"}:${config.format}_${config.target}]`;
|
|
21
|
-
_logger.logger.info(await watchSectionTitle(titleText, SectionTitleStatus.Log));
|
|
22
|
-
const runner = api.useHookRunners();
|
|
23
|
-
runner.buildWatchJs({
|
|
24
|
-
buildConfig: config
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=libuild-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAIaA;;;WAAAA;;;;wBAJU;AAIhB,MAAMA,cAAc,CACzBC,KACAC;AAEA,SAAO;IACLC,MAAM;IACNC,MAAMC,UAAQ;AACZA,eAASC,MAAMC,YAAYC,IAAI,gBAAgB;AAC7C,cAAM,EAAEC,kBAAiB,IAAK,MAAM,iFAAO;AAC3C,cAAM,EAAEC,mBAAkB,IAAK,MAAM,iFAAO;AAC5C,cAAMC,YAAY,IAChBT,OAAOU,cAAc,WAAW,WAAW,gBACzCV,OAAOW,UAAUX,OAAOY;AAE5BC,uBAAOC,KAAK,MAAMP,kBAAkBE,WAAWD,mBAAmBO,GAAG;AAErE,cAAMC,SAASjB,IAAIkB,eAAc;AACjCD,eAAOE,aAAa;UAAEC,aAAanB;QAAO;MAC5C;IACF;EACF;AACF;","names":["watchPlugin","api","config","name","apply","compiler","hooks","watchChange","tap","watchSectionTitle","SectionTitleStatus","titleText","buildType","format","target","logger","info","Log","runner","useHookRunners","buildWatchJs","buildConfig"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/libuild-plugin.ts"],"sourcesContent":["import { logger } from '@modern-js/utils/logger';\nimport type { LibuildPlugin } from '@modern-js/libuild';\nimport type { BaseBuildConfig, PluginAPI, ModuleTools } from '../types';\n\nexport const watchPlugin = (\n api: PluginAPI<ModuleTools>,\n config: BaseBuildConfig,\n): LibuildPlugin => {\n return {\n name: 'watch-plugin',\n apply(compiler) {\n compiler.hooks.watchChange.tap('watch-plugin', async () => {\n const { watchSectionTitle } = await import('./log');\n const { SectionTitleStatus } = await import('../constants/log');\n const titleText = `[${\n config.buildType === 'bundle' ? 'Bundle' : 'Bundleless'\n }:${config.format}_${config.target}]`;\n\n logger.info(await watchSectionTitle(titleText, SectionTitleStatus.Log));\n\n const runner = api.useHookRunners();\n runner.buildWatchJs({ buildConfig: config });\n });\n },\n };\n};\n"]}
|
package/dist/utils/log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAEaA;;;WAAAA;;;;qBAFsB;AAE5B,MAAMA,oBAAoB,OAC/BC,KACAC,QACAC;AAEA,QAAM,EAAEC,MAAK,IAAK,MAAM,iFAAO;AAC/B,MAAIF,WAAWG,wBAAmBC,SAAS;AACzC,WAAO,GAAGF,MAAMG,KAAKN,QAAQG,MAAMI,MAAM;EAC3C,WAAWN,WAAWG,wBAAmBI,MAAM;AAC7C,WAAO,GAAGL,MAAMG,KAAKN,QAAQG,MAAMM,IAAI;EACzC;AAEA,SAAO,GAAGN,MAAMG,KAAKN,QAAQE,YAAYA,YAAY;AACvD;","names":["watchSectionTitle","str","status","detailLog","chalk","SectionTitleStatus","Success","gray","green","Fail","red"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/log.ts"],"sourcesContent":["import { SectionTitleStatus } from '../constants/log';\n\nexport const watchSectionTitle = async (\n str: string,\n status: SectionTitleStatus,\n detailLog?: string,\n) => {\n const { chalk } = await import('@modern-js/utils');\n if (status === SectionTitleStatus.Success) {\n return `${chalk.gray(str)} ${chalk.green('Successful')}`;\n } else if (status === SectionTitleStatus.Fail) {\n return `${chalk.gray(str)} ${chalk.red('Build Failed')}`;\n }\n\n return `${chalk.gray(str)} ${detailLog ? detailLog : 'Log:'}`;\n};\n"]}
|
package/dist/utils/onExit.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAAaA;;;WAAAA;;;;AAAN,MAAMA,kBAAkB,OAAOC;AACpC,QAAM,EAAEC,SAASC,OAAM,IAAK,MAAM,iFAAO;AAEzCA,SAAO,OAAMC;AACX,QAAIA,SAAS,GAAG;AACd;IACF;AAEA,UAAMH;EACR;AACF;","names":["addExitListener","fn","default","onExit","code"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/onExit.ts"],"sourcesContent":["export const addExitListener = async (fn: () => Promise<void>) => {\n const { default: onExit } = await import('../../compiled/signal-exit');\n\n onExit(async code => {\n if (code === 0) {\n return;\n }\n\n await fn();\n });\n};\n"]}
|
package/dist/utils/path.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getCompiledPath: (packageName: string) => Promise<string>;
|
package/dist/utils/path.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getCompiledPath", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getCompiledPath;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
|
-
const _path = /* @__PURE__ */ _interop_require_default._(require("path"));
|
|
14
|
-
const getCompiledPath = async (packageName) => {
|
|
15
|
-
const { slash } = await Promise.resolve().then(() => /* @__PURE__ */ _interop_require_wildcard._(require("@modern-js/utils")));
|
|
16
|
-
return slash(_path.default.join(__dirname, "../../compiled", packageName));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=path.js.map
|
package/dist/utils/path.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;+BAEaA;;;WAAAA;;;;;iEAFI;AAEV,MAAMA,kBAAkB,OAAOC;AACpC,QAAM,EAAEC,MAAK,IAAK,MAAM,iFAAO;AAC/B,SAAOA,MAAMC,cAAKC,KAAKC,WAAW,kBAAkBJ;AACtD;","names":["getCompiledPath","packageName","slash","path","join","__dirname"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/path.ts"],"sourcesContent":["import path from 'path';\n\nexport const getCompiledPath = async (packageName: string) => {\n const { slash } = await import('@modern-js/utils');\n return slash(path.join(__dirname, '../../compiled', packageName));\n};\n"]}
|
package/dist/utils/print.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAkBaA,aAAW;WAAXA;;EAEAC,iBAAe;WAAfA;;EAEAC,gBAAc;WAAdA;;EAmBAC,gBAAc;WAAdA;;EAiBAC,aAAW;WAAXA;;EAcAC,eAAa;WAAbA;;EAKAC,cAAY;WAAZA;;;sBA7EqB;uBAEa;qBASxC;AAOA,MAAMN,cAAuB;AAE7B,MAAMC,kBAA2B;AAEjC,MAAMC,iBAAiB,CAC5BK,aACAC,cACAC;AAEA,QAAMC,QAAQC,MAAMC,KAAKL,aAAaM,IAAIC;AACxC,UAAM,CAACC,MAAMC,SAASF;AACtB,WAAO;MACLG,OAAMC,mBAASV,cAAcO;MAC7BI,MAAMH,MAAMI,SAASC;IACvB;EACF;AACA,MAAIZ,UAAU;AACZT,gBAAYsB,KAAI,GAAIZ;EACtB,OAAO;AACLT,oBAAgBqB,KAAI,GAAIZ;EAC1B;AACF;AAEO,MAAMP,iBAAiB,CAC5BoB,cACAf,cACAgB;AAEA,QAAM,EAAEC,OAAM,IAAKF;AACnBvB,cAAYsB,KAAI,GACX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MJ;AAElCzD,cAAY8D,QAAQ,CAAC,EAAE7C,MAAME,KAAI,MAAE;AACjC,UAAM4C,UAAU,GAAG9C,OAAO,IAAIyC,OAC5BN,oBAAoBnC,KAAKI,SAAS,KAChCsB,YAAYxB;AAChBqB,kBAAOS,IAAIc;EACb;AACF;AAEA,MAAM7B,sBAAsB;AAC1B,MAAIjC,gBAAgBoB,WAAW,GAAG;AAChC;EACF;AAEA,QAAM2C,QAAQ/D,gBAAgBoB;AAC9B,QAAM4C,YAAYhE,gBAAgBoD,OAAO,CAACa,OAAOjC;AAC/C,WAAOiC,QAAQjC,KAAKd;EACtB,GAAG;AACH,QAAMsB,OAAO,wBAAwBuB,kCAAkC1B,aAAMC,KAC3EI,YAAYsB;AAEdzB,gBAAOC,KAAKA;AACd;","names":["bundleFiles","bundlelessFiles","addOutputChunk","addRollupChunk","addDtsFiles","printFileSize","printSucceed","outputChunk","appDirectory","isBundle","files","Array","from","map","val","path","chunk","name","relative","size","contents","length","push","rollupOutput","distDir","output","o","resolve","fileName","code","fastGlob","slash","stats","file","printBundlelessInfo","printBundleFiles","totalDuration","time","chalk","cyan","logger","info","buildSuccessText","prettyBytes","bytes","unit","exp","Math","floor","log","pow","toFixed","longestFileLength","reduce","max","str","reportFile1LineText","headerRow","repeat","reportFile2LineText","bold","green","forEach","infoRow","count","totalSize","total"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/print.ts"],"sourcesContent":["import { relative, resolve } from 'path';\nimport type { ILibuilder } from '@modern-js/libuild';\nimport { chalk, logger, fastGlob, slash } from '@modern-js/utils';\nimport type {\n RollupOutput,\n OutputChunk,\n} from '../../compiled/rollup/types/rollup';\nimport {\n buildSuccessText,\n reportFile1LineText,\n reportFile2LineText,\n} from '../constants/log';\n\ntype Files = {\n name: string;\n size: number;\n};\n\nexport const bundleFiles: Files[] = [];\n\nexport const bundlelessFiles: Files[] = [];\n\nexport const addOutputChunk = (\n outputChunk: ILibuilder['outputChunk'],\n appDirectory: string,\n isBundle: boolean,\n) => {\n const files = Array.from(outputChunk).map(val => {\n const [path, chunk] = val;\n return {\n name: relative(appDirectory, path),\n size: chunk.contents.length,\n };\n });\n if (isBundle) {\n bundleFiles.push(...files);\n } else {\n bundlelessFiles.push(...files);\n }\n};\n\nexport const addRollupChunk = (\n rollupOutput: RollupOutput,\n appDirectory: string,\n distDir: string,\n) => {\n const { output } = rollupOutput;\n bundleFiles.push(\n ...output.map(o => {\n return {\n name: relative(appDirectory, resolve(distDir, o.fileName)),\n // only d.ts, is outputChunk not outputAsset\n size: (o as OutputChunk).code.length,\n };\n }),\n );\n};\n\nexport const addDtsFiles = async (distDir: string, appDirectory: string) => {\n const files = await fastGlob(`${slash(distDir)}/**/*.d.ts`, {\n stats: true,\n });\n bundlelessFiles.push(\n ...files.map(file => {\n return {\n name: relative(appDirectory, file.path),\n size: file.stats.size,\n };\n }),\n );\n};\n\nexport const printFileSize = () => {\n printBundlelessInfo();\n printBundleFiles();\n};\n\nexport const printSucceed = (totalDuration: number) => {\n const time = chalk.cyan(`${totalDuration / 1000}s`);\n logger.info(`${buildSuccessText} in ${time}`);\n};\n\nconst prettyBytes = (bytes: number) => {\n if (bytes === 0) {\n return '0 B';\n }\n const unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n const exp = Math.floor(Math.log(bytes) / Math.log(1024));\n return `${(bytes / Math.pow(1024, exp)).toFixed(2)} ${unit[exp]}`;\n};\n\nconst printBundleFiles = () => {\n if (bundleFiles.length === 0) {\n return;\n }\n const longestFileLength = bundleFiles.reduce(\n (max, str) => Math.max(max, str.name.length),\n reportFile1LineText.length,\n );\n\n logger.info(`Bundle generated ${bundleFiles.length} files\\n`);\n\n const headerRow =\n reportFile1LineText +\n ' '.repeat(longestFileLength - 10) +\n reportFile2LineText;\n logger.log(chalk.bold(chalk.green(headerRow)));\n\n bundleFiles.forEach(({ name, size }) => {\n const infoRow = `${name}${' '.repeat(\n longestFileLength - name.length + 2,\n )}${prettyBytes(size)}`;\n logger.log(infoRow);\n });\n};\n\nconst printBundlelessInfo = () => {\n if (bundlelessFiles.length === 0) {\n return;\n }\n\n const count = bundlelessFiles.length;\n const totalSize = bundlelessFiles.reduce((total, file) => {\n return total + file.size;\n }, 0);\n const info = `Bundleless generated ${count} files, the total size is ${chalk.cyan(\n prettyBytes(totalSize),\n )}`;\n logger.info(info);\n};\n"]}
|
package/dist/utils/style.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"mappings":";;;;;;;;;;;;EAWaA,eAAa;WAAbA;;EAYAC,eAAa;WAAbA;;EAWAC,kBAAgB;WAAhBA;;EA6CAC,gBAAc;WAAdA;;;uBA7EqB;sBAOF;AAEzB,MAAMH,gBAAgB,OAAOI;MAMhCA;AALF,QAAMC,iBAAgBC,6BACpB;IACEC,aAAa;MAAEC,mBAAmB;IAAK;IACvCC,gBAAgB,OAAMC,0BAAgB;EACxC,IACAN,wEAAQO,WAAK,QAAbP,kDAAeQ,SAAQ,CAAC;AAG1B,SAAOP;AACT;AAEO,MAAMJ,gBAAgB,OAAOG;MAKhCA;AAJF,QAAMC,iBAAgBC,6BACpB;IACEG,gBAAgB,OAAMC,0BAAgB;EACxC,IACAN,wEAAQO,WAAK,QAAbP,kDAAeS,SAAQ,CAAC;AAG1B,SAAOR;AACT;AAEO,MAAMH,mBAAmB,OAAOE;MAmCnCA;AAlCF,QAAMU,eAAiC;AAEvC,QAAMC,QAAQ;IACZC,WAAWC,SAA0C;AACnD,UAAIC,MAAMC,QAAQF,UAAU;AAC1BH,qBAAaM,KAAI,GAAIH;MACvB,OAAO;AACLH,qBAAaM,KAAKH;MACpB;IACF;EACF;AAEA,QAAMI,uBAAuBjB,OAAOkB,WAAW;AAC/C,QAAMC,0BAA0B,YAAY;IAC1CC,QAAQ,OAAMd,0BAAgB;IAC9Bc,QAAQ,OAAMd,0BAAgB;IAC9Bc,QAAQ,OAAMd,0BAAgB;IAC9Bc,QAAQ,OAAMd,0BAAgB;;AAGhC,QAAMe,gBAAenB,6BAInB;;;IAGEW,SAAS;SACHI,uBAAuB,MAAME,4BAA4B;MAC7DC,QAAQ,OAAMd,0BAAgB;MAC9Bc,QAAQ,OAAMd,0BAAgB;MAC9Bc,QAAQ,OAAMd,0BAAgB;MAC9BgB,OAAOC;EACX,IACAvB,wEAAQO,WAAK,QAAbP,kDAAewB,YAAW,CAAC,GAC3Bb;AAEF,MAAID,aAAae,QAAQ;AACvBJ,iBAAaR,QAASG,KAAI,GAAIN;EAChC;AAEA,SAAOW;AACT;AAEO,MAAMtB,iBAAiB,OAAOC;AACnC,QAAM0B,gBAAgB,MAAM5B,iBAAiBE;AAC7C,QAAM2B,aAAa,MAAM/B,cAAcI;AACvC,QAAM4B,aAAa,MAAM/B,cAAcG;AACvC,SAAO;IACLQ,MAAMmB;IACNlB,MAAMmB;IACNJ,SAASE;EACX;AACF;","names":["getLessConfig","getSassConfig","getPostcssConfig","getStyleConfig","config","mergedOptions","applyOptionsChain","lessOptions","javascriptEnabled","implementation","getCompiledPath","style","less","sass","extraPlugins","utils","addPlugins","plugins","Array","isArray","push","targetLegacyBrowsers","target","getLegacyPostCSSPlugins","require","mergedConfig","filter","Boolean","postcss","length","postcssConfig","lessConfig","sassConfig"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/style.ts"],"sourcesContent":["import type { AcceptedPlugin } from 'postcss';\nimport type { PostcssOptions } from '@modern-js/libuild';\nimport { applyOptionsChain } from '@modern-js/utils';\nimport type {\n PartialBaseBuildConfig,\n PostCSSConfigUtils,\n LessOptions,\n SassOptions,\n} from '../types';\nimport { getCompiledPath } from './path';\n\nexport const getLessConfig = async (config: PartialBaseBuildConfig) => {\n const mergedOptions = applyOptionsChain<LessOptions, never>(\n {\n lessOptions: { javascriptEnabled: true },\n implementation: await getCompiledPath('less'),\n },\n config?.style?.less || {},\n );\n\n return mergedOptions;\n};\n\nexport const getSassConfig = async (config: PartialBaseBuildConfig) => {\n const mergedOptions = applyOptionsChain<SassOptions, never>(\n {\n implementation: await getCompiledPath('sass'),\n },\n config?.style?.sass || {},\n );\n\n return mergedOptions;\n};\n\nexport const getPostcssConfig = async (config: PartialBaseBuildConfig) => {\n const extraPlugins: AcceptedPlugin[] = [];\n\n const utils = {\n addPlugins(plugins: AcceptedPlugin | AcceptedPlugin[]) {\n if (Array.isArray(plugins)) {\n extraPlugins.push(...plugins);\n } else {\n extraPlugins.push(plugins);\n }\n },\n };\n\n const targetLegacyBrowsers = config.target === 'es5';\n const getLegacyPostCSSPlugins = async () => [\n require(await getCompiledPath('postcss-custom-properties')),\n require(await getCompiledPath('postcss-initial')),\n require(await getCompiledPath('postcss-page-break')),\n require(await getCompiledPath('postcss-font-variant')),\n ];\n\n const mergedConfig = applyOptionsChain<\n PostcssOptions & { $$tools?: string },\n PostCSSConfigUtils\n >(\n {\n // TODO: when schema support redefine\n // $$tools: 'module-tools',\n plugins: [\n ...(targetLegacyBrowsers ? await getLegacyPostCSSPlugins() : []),\n require(await getCompiledPath('postcss-flexbugs-fixes')),\n require(await getCompiledPath('postcss-media-minmax')),\n require(await getCompiledPath('postcss-nesting')),\n ].filter(Boolean),\n },\n config?.style?.postcss || {},\n utils,\n );\n if (extraPlugins.length) {\n mergedConfig.plugins!.push(...extraPlugins);\n }\n\n return mergedConfig;\n};\n\nexport const getStyleConfig = async (config: PartialBaseBuildConfig) => {\n const postcssConfig = await getPostcssConfig(config);\n const lessConfig = await getLessConfig(config);\n const sassConfig = await getSassConfig(config);\n return {\n less: lessConfig,\n sass: sassConfig,\n postcss: postcssConfig,\n };\n};\n"]}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "transformDtsAlias", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return transformDtsAlias;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
12
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
|
-
const _path = /* @__PURE__ */ _interop_require_wildcard._(require("path"));
|
|
14
|
-
const _tsconfigpaths = require("@modern-js/utils/tsconfig-paths");
|
|
15
|
-
const _utils = require("@modern-js/utils");
|
|
16
|
-
const _parser = /* @__PURE__ */ _interop_require_wildcard._(require("@babel/parser"));
|
|
17
|
-
const _generator = /* @__PURE__ */ _interop_require_default._(require("@babel/generator"));
|
|
18
|
-
const _types = /* @__PURE__ */ _interop_require_wildcard._(require("@babel/types"));
|
|
19
|
-
const _traverse = /* @__PURE__ */ _interop_require_default._(require("@babel/traverse"));
|
|
20
|
-
const _file = require("../constants/file");
|
|
21
|
-
function mapPathString(nodePath, { filename, baseUrl, paths }) {
|
|
22
|
-
if (!_types.isStringLiteral(nodePath)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const sourcePath = nodePath.node.value;
|
|
26
|
-
const currentFile = filename;
|
|
27
|
-
const matchPath = (0, _tsconfigpaths.createMatchPath)(baseUrl, paths, [
|
|
28
|
-
"index"
|
|
29
|
-
]);
|
|
30
|
-
const result = matchPath(sourcePath, (packageJsonPath) => {
|
|
31
|
-
if (!_utils.fs.existsSync(packageJsonPath)) {
|
|
32
|
-
return void 0;
|
|
33
|
-
}
|
|
34
|
-
return _utils.fs.readJSONSync(packageJsonPath);
|
|
35
|
-
}, (filePath) => _utils.fs.existsSync(filePath), _file.dtsAliasExts);
|
|
36
|
-
if (result) {
|
|
37
|
-
const relativePath = _path.relative(_path.dirname(currentFile), _path.dirname(result));
|
|
38
|
-
const fileName = _path.basename(result);
|
|
39
|
-
const filePath = _path.normalize(`${relativePath.length === 0 ? "." : relativePath}/${fileName}`);
|
|
40
|
-
const replaceString = filePath.startsWith(".") ? filePath : `./${filePath}`;
|
|
41
|
-
nodePath.replaceWith(_types.stringLiteral(replaceString));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const transformImport = (option) => (nodePath) => {
|
|
45
|
-
mapPathString(nodePath.get("source"), option);
|
|
46
|
-
};
|
|
47
|
-
const transformExport = (option) => (nodePath) => {
|
|
48
|
-
mapPathString(nodePath.get("source"), option);
|
|
49
|
-
};
|
|
50
|
-
const transformSingleFileAlias = ({ filename, baseUrl, paths }) => {
|
|
51
|
-
const sourceCode = _utils.fs.readFileSync(filename, "utf-8");
|
|
52
|
-
const ast = _parser.parse(sourceCode, {
|
|
53
|
-
sourceType: "module",
|
|
54
|
-
errorRecovery: true,
|
|
55
|
-
plugins: [
|
|
56
|
-
"typescript"
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
(0, _traverse.default)(ast, {
|
|
60
|
-
// d.ts file content not have callExpression which can be parsed;
|
|
61
|
-
// CallExpression: transformCall({ filename, baseUrl, paths }) as any,
|
|
62
|
-
ImportDeclaration: transformImport({
|
|
63
|
-
filename,
|
|
64
|
-
baseUrl,
|
|
65
|
-
paths
|
|
66
|
-
}),
|
|
67
|
-
ExportDeclaration: transformExport({
|
|
68
|
-
filename,
|
|
69
|
-
baseUrl,
|
|
70
|
-
paths
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
return (0, _generator.default)(ast).code;
|
|
74
|
-
};
|
|
75
|
-
const transformDtsAlias = (option) => {
|
|
76
|
-
const { filenames = [], baseUrl, paths } = option;
|
|
77
|
-
const transformResult = [];
|
|
78
|
-
for (const filename of filenames) {
|
|
79
|
-
transformResult.push({
|
|
80
|
-
path: filename,
|
|
81
|
-
content: transformSingleFileAlias({
|
|
82
|
-
filename,
|
|
83
|
-
baseUrl,
|
|
84
|
-
paths
|
|
85
|
-
})
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
return transformResult;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
//# sourceMappingURL=tspathsT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;;IAGZO,mBAAmBd,gBAAgB;MACjC/B;MACAC;MACAC;IACF;IACA4C,mBAAmBZ,gBAAgB;MACjClC;MACAC;MACAC;IACF;EACF;AACA,UAAO6C,uBAAUT,KAAKU;AACxB;AAOO,MAAMnD,oBAAoB,CAACmC;AAChC,QAAM,EAAEiB,YAAY,IAAIhD,SAASC,MAAK,IAAK8B;AAC3C,QAAMkB,kBAAuD;AAC7D,aAAWlD,YAAYiD,WAAW;AAChCC,oBAAgBC,KAAK;MACnB/B,MAAMpB;MACNoD,SAASjB,yBAAyB;QAAEnC;QAAUC;QAASC;MAAM;IAC/D;EACF;AACA,SAAOgD;AACT;","names":["transformDtsAlias","mapPathString","nodePath","filename","baseUrl","paths","t","isStringLiteral","sourcePath","node","value","currentFile","matchPath","createMatchPath","result","packageJsonPath","fs","existsSync","undefined","readJSONSync","filePath","dtsAliasExts","relativePath","path","relative","dirname","fileName","basename","normalize","length","replaceString","startsWith","replaceWith","stringLiteral","transformImport","option","get","transformExport","transformSingleFileAlias","sourceCode","readFileSync","ast","parser","parse","sourceType","errorRecovery","plugins","traverse","ImportDeclaration","ExportDeclaration","generator","code","filenames","transformResult","push","content"],"sources":["../../src/utils/home/runner/work/modern.js/modern.js/packages/solutions/module-tools/src/utils/tspathsTransform.ts"],"sourcesContent":["import * as path from 'path';\nimport { createMatchPath } from '@modern-js/utils/tsconfig-paths';\nimport { fs } from '@modern-js/utils';\nimport * as parser from '@babel/parser';\nimport generator from '@babel/generator';\nimport * as t from '@babel/types';\nimport traverse, { NodePath } from '@babel/traverse';\nimport { dtsAliasExts } from '../constants/file';\n// import { defaultTransformedFunctions } from '../constants/dts';\n// import { matchesPattern, isImportCall } from './dts';\n\nexport interface TransformOption {\n filename: string;\n baseUrl: string;\n paths: Record<string, string[] | string>;\n}\n\nfunction mapPathString(\n nodePath: NodePath<any>,\n { filename, baseUrl, paths }: TransformOption,\n) {\n if (!t.isStringLiteral(nodePath)) {\n return;\n }\n\n const sourcePath = nodePath.node.value;\n const currentFile = filename;\n const matchPath = createMatchPath(\n baseUrl,\n paths as { [key: string]: Array<string> },\n ['index'],\n );\n const result = matchPath(\n sourcePath,\n packageJsonPath => {\n if (!fs.existsSync(packageJsonPath)) {\n return undefined;\n }\n return fs.readJSONSync(packageJsonPath);\n },\n filePath => fs.existsSync(filePath),\n dtsAliasExts,\n );\n if (result) {\n const relativePath = path.relative(\n path.dirname(currentFile),\n path.dirname(result),\n );\n const fileName = path.basename(result);\n // 如果是同级文件,则返回的是 ''\n const filePath = path.normalize(\n `${relativePath.length === 0 ? '.' : relativePath}/${fileName}`,\n );\n const replaceString = filePath.startsWith('.') ? filePath : `./${filePath}`;\n nodePath.replaceWith(t.stringLiteral(replaceString));\n }\n}\n\n// const transformCall =\n// (option: TransformOption) => (nodePath: NodePath<t.CallExpression>) => {\n// const calleePath = nodePath.get('callee') as NodePath;\n// const isNormalCall = defaultTransformedFunctions.some(pattern =>\n// matchesPattern(calleePath, pattern),\n// );\n// if (isNormalCall || isImportCall(nodePath)) {\n// mapPathString(\n// nodePath.get('arguments.0') as NodePath<t.StringLiteral>,\n// option,\n// );\n// }\n// };\n\nconst transformImport =\n (option: TransformOption) => (nodePath: NodePath<t.ImportDeclaration>) => {\n mapPathString(nodePath.get('source'), option);\n };\n\nconst transformExport =\n (option: TransformOption) => (nodePath: NodePath<t.ExportDeclaration>) => {\n mapPathString(nodePath.get('source') as NodePath<t.StringLiteral>, option);\n };\n\nconst transformSingleFileAlias = ({\n filename,\n baseUrl,\n paths,\n}: TransformOption) => {\n const sourceCode = fs.readFileSync(filename, 'utf-8');\n const ast = parser.parse(sourceCode, {\n sourceType: 'module',\n errorRecovery: true, // 防止typescript不支持的语法出现而报错\n plugins: ['typescript'],\n });\n traverse(ast, {\n // d.ts file content not have callExpression which can be parsed;\n // CallExpression: transformCall({ filename, baseUrl, paths }) as any,\n ImportDeclaration: transformImport({\n filename,\n baseUrl,\n paths,\n }) as any,\n ExportDeclaration: transformExport({\n filename,\n baseUrl,\n paths,\n }) as any,\n });\n return generator(ast).code;\n};\n\ninterface TransformDtsAliasOption {\n filenames?: string[];\n baseUrl: string;\n paths: Record<string, string[] | string>;\n}\nexport const transformDtsAlias = (option: TransformDtsAliasOption) => {\n const { filenames = [], baseUrl, paths } = option;\n const transformResult: { path: string; content: string }[] = [];\n for (const filename of filenames) {\n transformResult.push({\n path: filename,\n content: transformSingleFileAlias({ filename, baseUrl, paths }),\n });\n }\n return transformResult;\n};\n"]}
|
|
File without changes
|