@modern-js/module-tools 2.0.0-beta.3 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +207 -211
- package/bin/modern.js +1 -0
- package/compiled/@babel/code-frame/index.d.ts +1 -0
- package/compiled/@babel/code-frame/index.js +1 -0
- package/compiled/@babel/code-frame/license +22 -0
- package/compiled/@babel/code-frame/package.json +1 -0
- package/compiled/@babel/generator/index.d.ts +1 -0
- package/compiled/@babel/generator/index.js +1 -0
- package/compiled/@babel/generator/license +22 -0
- package/compiled/@babel/generator/package.json +1 -0
- package/compiled/@babel/helper-validator-identifier/index.d.ts +1 -0
- package/compiled/@babel/helper-validator-identifier/index.js +1 -0
- package/compiled/@babel/helper-validator-identifier/license +22 -0
- package/compiled/@babel/helper-validator-identifier/package.json +1 -0
- package/compiled/@babel/highlight/index.d.ts +1 -0
- package/compiled/@babel/highlight/index.js +1 -0
- package/compiled/@babel/highlight/license +22 -0
- package/compiled/@babel/highlight/package.json +1 -0
- package/compiled/@babel/parser/@babel/types/lib/index-legacy.d.ts +2742 -0
- package/compiled/@babel/parser/index.js +1 -0
- package/compiled/@babel/parser/license +19 -0
- package/compiled/@babel/parser/package.json +1 -0
- package/compiled/@babel/parser/typings/babel-parser.d.ts +214 -0
- package/compiled/@babel/template/index.d.ts +1 -0
- package/compiled/@babel/template/index.js +1 -0
- package/compiled/@babel/template/license +22 -0
- package/compiled/@babel/template/package.json +1 -0
- package/compiled/@babel/traverse/index.d.ts +1199 -0
- package/compiled/@babel/traverse/index.js +1 -0
- package/compiled/@babel/traverse/license +22 -0
- package/compiled/@babel/traverse/package.json +1 -0
- package/compiled/@babel/types/index.js +1 -0
- package/compiled/@babel/types/lib/index-legacy.d.ts +2732 -0
- package/compiled/@babel/types/license +22 -0
- package/compiled/@babel/types/package.json +1 -0
- package/compiled/@rollup/plugin-json/@rollup/pluginutils/types/index.d.ts +86 -0
- package/compiled/@rollup/plugin-json/estree/index.d.ts +548 -0
- package/compiled/@rollup/plugin-json/index.js +1 -0
- package/compiled/@rollup/plugin-json/license +21 -0
- package/compiled/@rollup/plugin-json/package.json +1 -0
- package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +948 -0
- package/compiled/@rollup/plugin-json/types/index.d.ts +41 -0
- package/compiled/find-up/index.d.ts +138 -0
- package/compiled/find-up/index.js +1 -0
- package/compiled/find-up/license +9 -0
- package/compiled/find-up/locate-path/index.d.ts +83 -0
- package/compiled/find-up/package.json +1 -0
- package/compiled/less/index.d.ts +282 -0
- package/compiled/less/index.js +1 -0
- package/compiled/less/package.json +1 -0
- package/compiled/normalize-path/index.d.ts +8 -0
- package/compiled/normalize-path/index.js +8 -0
- package/compiled/normalize-path/license +21 -0
- package/compiled/normalize-path/package.json +1 -0
- package/compiled/p-map/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
- package/compiled/p-map/cacheable-lookup/index.d.ts +139 -0
- package/compiled/p-map/cacheable-request/index.d.ts +137 -0
- package/compiled/p-map/got/dist/source/as-promise/index.d.ts +3 -0
- package/compiled/p-map/got/dist/source/as-promise/types.d.ts +256 -0
- package/compiled/p-map/got/dist/source/core/index.d.ts +1124 -0
- package/compiled/p-map/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
- package/compiled/p-map/got/dist/source/core/utils/options-to-url.d.ts +14 -0
- package/compiled/p-map/got/dist/source/core/utils/timed-out.d.ts +29 -0
- package/compiled/p-map/got/dist/source/index.d.ts +4 -0
- package/compiled/p-map/got/dist/source/types.d.ts +344 -0
- package/compiled/p-map/http-cache-semantics/index.d.ts +170 -0
- package/compiled/p-map/index.d.ts +67 -0
- package/compiled/p-map/index.js +1 -0
- package/compiled/p-map/keyv/src/index.d.ts +104 -0
- package/compiled/p-map/license +9 -0
- package/compiled/p-map/p-cancelable/index.d.ts +176 -0
- package/compiled/p-map/package.json +1 -0
- package/compiled/p-map/responselike/index.d.ts +34 -0
- package/compiled/postcss-custom-properties/index.d.ts +1 -0
- package/compiled/postcss-custom-properties/index.js +1 -0
- package/compiled/postcss-custom-properties/package.json +1 -0
- package/compiled/postcss-flexbugs-fixes/index.d.ts +1 -0
- package/compiled/postcss-flexbugs-fixes/index.js +1 -0
- package/compiled/postcss-flexbugs-fixes/license +20 -0
- package/compiled/postcss-flexbugs-fixes/package.json +1 -0
- package/compiled/postcss-font-variant/index.d.ts +1 -0
- package/compiled/postcss-font-variant/index.js +1 -0
- package/compiled/postcss-font-variant/license +20 -0
- package/compiled/postcss-font-variant/package.json +1 -0
- package/compiled/postcss-initial/index.d.ts +1 -0
- package/compiled/postcss-initial/index.js +1 -0
- package/compiled/postcss-initial/license +20 -0
- package/compiled/postcss-initial/package.json +1 -0
- package/compiled/postcss-media-minmax/index.d.ts +1 -0
- package/compiled/postcss-media-minmax/index.js +1 -0
- package/compiled/postcss-media-minmax/license +22 -0
- package/compiled/postcss-media-minmax/package.json +1 -0
- package/compiled/postcss-nesting/index.d.ts +1 -0
- package/compiled/postcss-nesting/index.js +2 -0
- package/compiled/postcss-nesting/package.json +1 -0
- package/compiled/postcss-page-break/index.d.ts +1 -0
- package/compiled/postcss-page-break/index.js +1 -0
- package/compiled/postcss-page-break/license +20 -0
- package/compiled/postcss-page-break/package.json +1 -0
- package/compiled/postcss-value-parser/index.d.ts +1 -0
- package/compiled/postcss-value-parser/index.js +1 -0
- package/compiled/postcss-value-parser/license +22 -0
- package/compiled/postcss-value-parser/package.json +1 -0
- package/compiled/rollup/fsevents.node +0 -0
- package/compiled/rollup/index.js +82 -0
- package/compiled/rollup/package.json +1 -0
- package/compiled/rollup/types/rollup.d.ts +948 -0
- package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +21 -0
- package/compiled/rollup-plugin-dts/index.js +1 -0
- package/compiled/rollup-plugin-dts/package.json +1 -0
- package/compiled/rollup-plugin-dts/rollup/dist/rollup.d.ts +948 -0
- package/compiled/sass/index.js +1 -0
- package/compiled/sass/license +1619 -0
- package/compiled/sass/package.json +1 -0
- package/compiled/sass/types/compile.d.ts +152 -0
- package/compiled/sass/types/exception.d.ts +41 -0
- package/compiled/sass/types/importer.d.ts +294 -0
- package/compiled/sass/types/index.d.ts +80 -0
- package/compiled/sass/types/legacy/exception.d.ts +54 -0
- package/compiled/sass/types/legacy/function.d.ts +756 -0
- package/compiled/sass/types/legacy/importer.d.ts +168 -0
- package/compiled/sass/types/legacy/options.d.ts +642 -0
- package/compiled/sass/types/legacy/plugin_this.d.ts +73 -0
- package/compiled/sass/types/legacy/render.d.ts +139 -0
- package/compiled/sass/types/logger/index.d.ts +94 -0
- package/compiled/sass/types/logger/source_location.d.ts +21 -0
- package/compiled/sass/types/logger/source_span.d.ts +34 -0
- package/compiled/sass/types/options.d.ts +435 -0
- package/compiled/sass/types/util/promise_or.d.ts +17 -0
- package/compiled/sass/types/value/argument_list.d.ts +47 -0
- package/compiled/sass/types/value/boolean.d.ts +29 -0
- package/compiled/sass/types/value/color.d.ts +107 -0
- package/compiled/sass/types/value/function.d.ts +22 -0
- package/compiled/sass/types/value/index.d.ts +173 -0
- package/compiled/sass/types/value/list.d.ts +54 -0
- package/compiled/sass/types/value/map.d.ts +41 -0
- package/compiled/sass/types/value/number.d.ts +305 -0
- package/compiled/sass/types/value/string.d.ts +84 -0
- package/compiled/signal-exit/index.d.ts +24 -0
- package/compiled/signal-exit/index.js +1 -0
- package/compiled/signal-exit/package.json +1 -0
- package/dist/builder/build.d.ts +23 -0
- package/dist/builder/build.js +265 -0
- package/dist/builder/build.js.map +1 -0
- package/dist/builder/clear.d.ts +3 -0
- package/dist/builder/clear.js +74 -0
- package/dist/builder/clear.js.map +1 -0
- package/dist/builder/copy.d.ts +9 -0
- package/dist/builder/copy.js +207 -0
- package/dist/builder/copy.js.map +1 -0
- package/dist/builder/dts/index.d.ts +2 -0
- package/dist/builder/dts/index.js +27 -0
- package/dist/builder/dts/index.js.map +1 -0
- package/dist/builder/dts/rollup.d.ts +17 -0
- package/dist/builder/dts/rollup.js +180 -0
- package/dist/builder/dts/rollup.js.map +1 -0
- package/dist/builder/dts/tsc.d.ts +3 -0
- package/dist/builder/dts/tsc.js +160 -0
- package/dist/builder/dts/tsc.js.map +1 -0
- package/dist/builder/index.d.ts +8 -0
- package/dist/builder/index.js +124 -0
- package/dist/builder/index.js.map +1 -0
- package/dist/builder/platform.d.ts +4 -0
- package/dist/builder/platform.js +140 -0
- package/dist/builder/platform.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +103 -0
- package/dist/cli.js.map +1 -0
- package/dist/command.d.ts +7 -0
- package/dist/command.js +169 -0
- package/dist/command.js.map +1 -0
- package/dist/config/defineConfig.d.ts +2 -0
- package/dist/config/defineConfig.js +25 -0
- package/dist/config/defineConfig.js.map +1 -0
- package/dist/config/normalize.d.ts +17 -0
- package/dist/config/normalize.js +177 -0
- package/dist/config/normalize.js.map +1 -0
- package/dist/config/schema.d.ts +641 -0
- package/dist/config/schema.js +207 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/constants/build-presets.d.ts +81 -0
- package/dist/constants/build-presets.js +219 -0
- package/dist/constants/build-presets.js.map +1 -0
- package/dist/constants/build.d.ts +5 -0
- package/dist/constants/build.js +71 -0
- package/dist/constants/build.js.map +1 -0
- package/dist/constants/colors.d.ts +4 -0
- package/dist/constants/colors.js +29 -0
- package/dist/constants/colors.js.map +1 -0
- package/dist/constants/dts.d.ts +4 -0
- package/dist/constants/dts.js +45 -0
- package/dist/constants/dts.js.map +1 -0
- package/dist/constants/file.d.ts +3 -0
- package/dist/constants/file.js +29 -0
- package/dist/constants/file.js.map +1 -0
- package/dist/constants/legacy-build-presets.d.ts +13 -0
- package/dist/constants/legacy-build-presets.js +189 -0
- package/dist/constants/legacy-build-presets.js.map +1 -0
- package/dist/constants/log.d.ts +8 -0
- package/dist/constants/log.js +36 -0
- package/dist/constants/log.js.map +1 -0
- package/dist/dev.d.ts +10 -0
- package/dist/dev.js +135 -0
- package/dist/dev.js.map +1 -0
- package/dist/{types/features/build/error.d.ts → error.d.ts} +1 -1
- package/dist/error.js +139 -0
- package/dist/error.js.map +1 -0
- package/dist/hooks/build.d.ts +22 -0
- package/dist/hooks/build.js +35 -0
- package/dist/hooks/build.js.map +1 -0
- package/dist/hooks/dev.d.ts +12 -0
- package/dist/hooks/dev.js +33 -0
- package/dist/hooks/dev.js.map +1 -0
- package/dist/hooks/index.d.ts +29 -0
- package/dist/hooks/index.js +44 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/misc.d.ts +5 -0
- package/dist/hooks/misc.js +29 -0
- package/dist/hooks/misc.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/{types/locale → locale}/en.d.ts +0 -0
- package/dist/locale/en.js +47 -0
- package/dist/locale/en.js.map +1 -0
- package/dist/{types/locale → locale}/index.d.ts +0 -0
- package/dist/locale/index.js +34 -0
- package/dist/locale/index.js.map +1 -0
- package/dist/{types/locale → locale}/zh.d.ts +0 -0
- package/dist/locale/zh.js +47 -0
- package/dist/locale/zh.js.map +1 -0
- package/dist/plugins.d.ts +2 -0
- package/dist/plugins.js +51 -0
- package/dist/plugins.js.map +1 -0
- package/dist/types/color.d.ts +1 -0
- package/dist/{js/modern/features/build/types.js → types/color.js} +0 -0
- package/dist/types/command.d.ts +11 -0
- package/dist/{js/modern/schema/types.js → types/command.js} +0 -0
- package/dist/types/config/index.d.ts +95 -0
- package/dist/types/config/index.js +19 -0
- package/dist/types/config/index.js.map +1 -0
- package/dist/types/config/style.d.ts +12 -0
- package/dist/{js/modern/types.js → types/config/style.js} +0 -0
- package/dist/types/context.d.ts +5 -0
- package/dist/{js/node/features/build/types.js → types/context.js} +0 -0
- package/dist/types/copy.d.ts +15 -0
- package/dist/{js/node/schema/types.js → types/copy.js} +0 -0
- package/dist/types/{utils/tsconfig.d.ts → dts.d.ts} +11 -3
- package/dist/{js/node/types.js → types/dts.js} +0 -0
- package/dist/types/hooks.d.ts +25 -0
- package/dist/types/hooks.js +0 -0
- package/dist/types/index.d.ts +17 -6
- package/dist/types/index.js +23 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/utils.d.ts +7 -0
- package/dist/types/utils.js +0 -0
- package/dist/utils/builder.d.ts +8 -0
- package/dist/utils/builder.js +117 -0
- package/dist/utils/builder.js.map +1 -0
- package/dist/utils/config.d.ts +6 -0
- package/dist/utils/config.js +172 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/context.d.ts +7 -0
- package/dist/utils/context.js +68 -0
- package/dist/utils/context.js.map +1 -0
- package/dist/utils/dts.d.ts +14 -0
- package/dist/utils/dts.js +197 -0
- package/dist/utils/dts.js.map +1 -0
- package/dist/utils/input.d.ts +16 -0
- package/dist/utils/input.js +124 -0
- package/dist/utils/input.js.map +1 -0
- package/dist/utils/language.d.ts +2 -0
- package/dist/utils/language.js +75 -0
- package/dist/utils/language.js.map +1 -0
- package/dist/utils/libuild-plugins.d.ts +6 -0
- package/dist/utils/libuild-plugins.js +90 -0
- package/dist/utils/libuild-plugins.js.map +1 -0
- package/dist/utils/log.d.ts +2 -0
- package/dist/utils/log.js +76 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/onExit.d.ts +1 -0
- package/dist/utils/onExit.js +71 -0
- package/dist/utils/onExit.js.map +1 -0
- package/dist/utils/path.d.ts +1 -0
- package/dist/utils/path.js +73 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/style.d.ts +31 -0
- package/dist/utils/style.js +134 -0
- package/dist/utils/style.js.map +1 -0
- package/dist/{types/utils/tspaths-transform/index.d.ts → utils/tspaths-transform.d.ts} +0 -0
- package/dist/utils/tspaths-transform.js +115 -0
- package/dist/utils/tspaths-transform.js.map +1 -0
- package/package.json +45 -72
- package/dist/js/modern/cli/build.js +0 -11
- package/dist/js/modern/cli/dev.js +0 -11
- package/dist/js/modern/cli/index.js +0 -3
- package/dist/js/modern/cli/new.js +0 -13
- package/dist/js/modern/commands/build.js +0 -69
- package/dist/js/modern/commands/dev.js +0 -43
- package/dist/js/modern/commands/index.js +0 -2
- package/dist/js/modern/features/build/build-platform.js +0 -69
- package/dist/js/modern/features/build/bundle/index.js +0 -9
- package/dist/js/modern/features/build/bundle/runRollup.js +0 -136
- package/dist/js/modern/features/build/bundle/runSpeedy.js +0 -176
- package/dist/js/modern/features/build/bundleless/copy-assets.js +0 -75
- package/dist/js/modern/features/build/bundleless/generator-dts/index.js +0 -106
- package/dist/js/modern/features/build/bundleless/generator-dts/utils.js +0 -94
- package/dist/js/modern/features/build/bundleless/index.js +0 -21
- package/dist/js/modern/features/build/bundleless/runBabel.js +0 -242
- package/dist/js/modern/features/build/bundleless/style.js +0 -241
- package/dist/js/modern/features/build/constants.js +0 -98
- package/dist/js/modern/features/build/error.js +0 -127
- package/dist/js/modern/features/build/index.js +0 -117
- package/dist/js/modern/features/build/legacy-constants.js +0 -103
- package/dist/js/modern/features/build/logger/index.js +0 -2
- package/dist/js/modern/features/build/logger/logText.js +0 -56
- package/dist/js/modern/features/build/logger/loggerManager.js +0 -93
- package/dist/js/modern/features/build/normalize.js +0 -277
- package/dist/js/modern/features/build/utils.js +0 -92
- package/dist/js/modern/features/dev/index.js +0 -47
- package/dist/js/modern/hooks/build.js +0 -20
- package/dist/js/modern/hooks/dev.js +0 -14
- package/dist/js/modern/hooks/index.js +0 -15
- package/dist/js/modern/index.js +0 -63
- package/dist/js/modern/locale/en.js +0 -25
- package/dist/js/modern/locale/index.js +0 -10
- package/dist/js/modern/locale/zh.js +0 -25
- package/dist/js/modern/schema/build-config.js +0 -117
- package/dist/js/modern/schema/index.js +0 -4
- package/dist/js/modern/schema/output.js +0 -45
- package/dist/js/modern/schema/source.js +0 -7
- package/dist/js/modern/schema/tools.js +0 -6
- package/dist/js/modern/utils/babel.js +0 -84
- package/dist/js/modern/utils/color.js +0 -2
- package/dist/js/modern/utils/constants.js +0 -3
- package/dist/js/modern/utils/copy.js +0 -70
- package/dist/js/modern/utils/init-env.js +0 -13
- package/dist/js/modern/utils/json.js +0 -13
- package/dist/js/modern/utils/language.js +0 -6
- package/dist/js/modern/utils/logger.js +0 -96
- package/dist/js/modern/utils/readline.js +0 -17
- package/dist/js/modern/utils/tsconfig.js +0 -13
- package/dist/js/modern/utils/tspaths-transform/constants.js +0 -5
- package/dist/js/modern/utils/tspaths-transform/index.js +0 -113
- package/dist/js/modern/utils/tspaths-transform/utils.js +0 -18
- package/dist/js/modern/utils/valide.js +0 -26
- package/dist/js/node/cli/build.js +0 -18
- package/dist/js/node/cli/dev.js +0 -18
- package/dist/js/node/cli/index.js +0 -38
- package/dist/js/node/cli/new.js +0 -20
- package/dist/js/node/commands/build.js +0 -80
- package/dist/js/node/commands/dev.js +0 -52
- package/dist/js/node/commands/index.js +0 -19
- package/dist/js/node/features/build/build-platform.js +0 -76
- package/dist/js/node/features/build/bundle/index.js +0 -17
- package/dist/js/node/features/build/bundle/runRollup.js +0 -145
- package/dist/js/node/features/build/bundle/runSpeedy.js +0 -186
- package/dist/js/node/features/build/bundleless/copy-assets.js +0 -84
- package/dist/js/node/features/build/bundleless/generator-dts/index.js +0 -114
- package/dist/js/node/features/build/bundleless/generator-dts/utils.js +0 -105
- package/dist/js/node/features/build/bundleless/index.js +0 -29
- package/dist/js/node/features/build/bundleless/runBabel.js +0 -255
- package/dist/js/node/features/build/bundleless/style.js +0 -254
- package/dist/js/node/features/build/constants.js +0 -116
- package/dist/js/node/features/build/error.js +0 -139
- package/dist/js/node/features/build/index.js +0 -128
- package/dist/js/node/features/build/legacy-constants.js +0 -111
- package/dist/js/node/features/build/logger/index.js +0 -27
- package/dist/js/node/features/build/logger/logText.js +0 -66
- package/dist/js/node/features/build/logger/loggerManager.js +0 -95
- package/dist/js/node/features/build/normalize.js +0 -288
- package/dist/js/node/features/build/utils.js +0 -107
- package/dist/js/node/features/dev/index.js +0 -56
- package/dist/js/node/hooks/build.js +0 -32
- package/dist/js/node/hooks/dev.js +0 -24
- package/dist/js/node/hooks/index.js +0 -36
- package/dist/js/node/index.js +0 -83
- package/dist/js/node/locale/en.js +0 -32
- package/dist/js/node/locale/index.js +0 -17
- package/dist/js/node/locale/zh.js +0 -32
- package/dist/js/node/schema/build-config.js +0 -126
- package/dist/js/node/schema/index.js +0 -11
- package/dist/js/node/schema/output.js +0 -52
- package/dist/js/node/schema/source.js +0 -14
- package/dist/js/node/schema/tools.js +0 -13
- package/dist/js/node/utils/babel.js +0 -93
- package/dist/js/node/utils/color.js +0 -9
- package/dist/js/node/utils/constants.js +0 -11
- package/dist/js/node/utils/copy.js +0 -79
- package/dist/js/node/utils/init-env.js +0 -20
- package/dist/js/node/utils/json.js +0 -20
- package/dist/js/node/utils/language.js +0 -12
- package/dist/js/node/utils/logger.js +0 -107
- package/dist/js/node/utils/readline.js +0 -25
- package/dist/js/node/utils/tsconfig.js +0 -21
- package/dist/js/node/utils/tspaths-transform/constants.js +0 -12
- package/dist/js/node/utils/tspaths-transform/index.js +0 -123
- package/dist/js/node/utils/tspaths-transform/utils.js +0 -25
- package/dist/js/node/utils/valide.js +0 -34
- package/dist/types/cli/build.d.ts +0 -3
- package/dist/types/cli/dev.d.ts +0 -3
- package/dist/types/cli/index.d.ts +0 -3
- package/dist/types/cli/new.d.ts +0 -2
- package/dist/types/commands/build.d.ts +0 -17
- package/dist/types/commands/dev.d.ts +0 -5
- package/dist/types/commands/index.d.ts +0 -2
- package/dist/types/features/build/build-platform.d.ts +0 -7
- package/dist/types/features/build/bundle/index.d.ts +0 -3
- package/dist/types/features/build/bundle/runRollup.d.ts +0 -3
- package/dist/types/features/build/bundle/runSpeedy.d.ts +0 -10
- package/dist/types/features/build/bundleless/copy-assets.d.ts +0 -3
- package/dist/types/features/build/bundleless/generator-dts/index.d.ts +0 -3
- package/dist/types/features/build/bundleless/generator-dts/utils.d.ts +0 -21
- package/dist/types/features/build/bundleless/index.d.ts +0 -4
- package/dist/types/features/build/bundleless/runBabel.d.ts +0 -32
- package/dist/types/features/build/bundleless/style.d.ts +0 -25
- package/dist/types/features/build/constants.d.ts +0 -18
- package/dist/types/features/build/index.d.ts +0 -12
- package/dist/types/features/build/legacy-constants.d.ts +0 -8
- package/dist/types/features/build/logger/index.d.ts +0 -2
- package/dist/types/features/build/logger/logText.d.ts +0 -39
- package/dist/types/features/build/logger/loggerManager.d.ts +0 -40
- package/dist/types/features/build/normalize.d.ts +0 -19
- package/dist/types/features/build/types.d.ts +0 -15
- package/dist/types/features/build/utils.d.ts +0 -36
- package/dist/types/features/dev/index.d.ts +0 -9
- package/dist/types/hooks/build.d.ts +0 -46
- package/dist/types/hooks/dev.d.ts +0 -20
- package/dist/types/hooks/index.d.ts +0 -30
- package/dist/types/schema/build-config.d.ts +0 -205
- package/dist/types/schema/index.d.ts +0 -217
- package/dist/types/schema/output.d.ts +0 -215
- package/dist/types/schema/source.d.ts +0 -6
- package/dist/types/schema/tools.d.ts +0 -6
- package/dist/types/schema/types.d.ts +0 -45
- package/dist/types/types.d.ts +0 -51
- package/dist/types/utils/babel.d.ts +0 -8
- package/dist/types/utils/color.d.ts +0 -2
- package/dist/types/utils/constants.d.ts +0 -2
- package/dist/types/utils/copy.d.ts +0 -5
- package/dist/types/utils/init-env.d.ts +0 -21
- package/dist/types/utils/json.d.ts +0 -4
- package/dist/types/utils/language.d.ts +0 -1
- package/dist/types/utils/logger.d.ts +0 -58
- package/dist/types/utils/readline.d.ts +0 -9
- package/dist/types/utils/tspaths-transform/constants.d.ts +0 -1
- package/dist/types/utils/tspaths-transform/utils.d.ts +0 -4
- package/dist/types/utils/valide.d.ts +0 -12
- package/types.d.ts +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
addExitListener: () => addExitListener
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var __create = Object.create;
|
|
24
|
+
var __defProp2 = Object.defineProperty;
|
|
25
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
26
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
27
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
28
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
29
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
30
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames2(from))
|
|
32
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
33
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return to;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
|
|
38
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
41
|
+
var __async = (__this, __arguments, generator) => {
|
|
42
|
+
return new Promise((resolve, reject) => {
|
|
43
|
+
var fulfilled = (value) => {
|
|
44
|
+
try {
|
|
45
|
+
step(generator.next(value));
|
|
46
|
+
} catch (e) {
|
|
47
|
+
reject(e);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
var rejected = (value) => {
|
|
51
|
+
try {
|
|
52
|
+
step(generator.throw(value));
|
|
53
|
+
} catch (e) {
|
|
54
|
+
reject(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
58
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const addExitListener = (fn) => __async(void 0, null, function* () {
|
|
62
|
+
const { default: onExit } = yield Promise.resolve().then(() => __toESM(require("../../compiled/signal-exit")));
|
|
63
|
+
onExit((code) => __async(void 0, null, function* () {
|
|
64
|
+
if (code === 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
yield fn();
|
|
68
|
+
}));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=onExit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,kBAAkB,CAAO,OAA4B;AAChE,QAAM,EAAE,SAAS,OAAO,IAAI,MAAM,6CAAO;AAEzC,SAAO,CAAM,SAAQ;AACnB,QAAI,SAAS,GAAG;AACd;AAAA,IACF;AAEA,UAAM,GAAG;AAAA,EACX,EAAC;AACH;","names":[],"sources":["../../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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCompiledPath: (packageName: string) => Promise<string>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var stdin_exports = {};
|
|
25
|
+
__export(stdin_exports, {
|
|
26
|
+
getCompiledPath: () => getCompiledPath
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
29
|
+
var import_path = __toESM(require("path"));
|
|
30
|
+
var __create2 = Object.create;
|
|
31
|
+
var __defProp2 = Object.defineProperty;
|
|
32
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
33
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
34
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
35
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
36
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
37
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
38
|
+
for (let key of __getOwnPropNames2(from))
|
|
39
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
40
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
41
|
+
}
|
|
42
|
+
return to;
|
|
43
|
+
};
|
|
44
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
|
|
45
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
46
|
+
mod
|
|
47
|
+
));
|
|
48
|
+
var __async = (__this, __arguments, generator) => {
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
var fulfilled = (value) => {
|
|
51
|
+
try {
|
|
52
|
+
step(generator.next(value));
|
|
53
|
+
} catch (e) {
|
|
54
|
+
reject(e);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var rejected = (value) => {
|
|
58
|
+
try {
|
|
59
|
+
step(generator.throw(value));
|
|
60
|
+
} catch (e) {
|
|
61
|
+
reject(e);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
65
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
const getCompiledPath = (packageName) => __async(void 0, null, function* () {
|
|
69
|
+
const { slash } = yield Promise.resolve().then(() => __toESM2(require("@modern-js/utils")));
|
|
70
|
+
return slash(import_path.default.join(__dirname, "../../compiled", packageName));
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEV,MAAM,kBAAkB,CAAO,gBAAwB;AAC5D,QAAM,EAAE,MAAM,IAAI,MAAM,8CAAO;AAC/B,SAAO,MAAM,oBAAK,KAAK,WAAW,kBAAkB,WAAW,CAAC;AAClE;","names":[],"sources":["../../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"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="less" />
|
|
2
|
+
import type { PostcssOptions } from '@modern-js/libuild';
|
|
3
|
+
import type { PartialBaseBuildConfig } from '../types';
|
|
4
|
+
export declare const getLessConfig: (config: PartialBaseBuildConfig) => Promise<{
|
|
5
|
+
additionalData?: (string | ((filePath: string) => string)) | undefined;
|
|
6
|
+
implementation?: string | object | undefined;
|
|
7
|
+
lessOptions?: Less.Options | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const getSassConfig: (config: PartialBaseBuildConfig) => Promise<{
|
|
10
|
+
additionalData?: (string | ((filePath: string) => string)) | undefined;
|
|
11
|
+
implementation?: string | object | undefined;
|
|
12
|
+
sassOptions?: import("@modern-js/libuild").sassOptions | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const getPostcssConfig: (config: PartialBaseBuildConfig) => Promise<PostcssOptions & {
|
|
15
|
+
$$tools?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const getStyleConfig: (config: PartialBaseBuildConfig) => Promise<{
|
|
18
|
+
less: {
|
|
19
|
+
additionalData?: (string | ((filePath: string) => string)) | undefined;
|
|
20
|
+
implementation?: string | object | undefined;
|
|
21
|
+
lessOptions?: Less.Options | undefined;
|
|
22
|
+
};
|
|
23
|
+
sass: {
|
|
24
|
+
additionalData?: (string | ((filePath: string) => string)) | undefined;
|
|
25
|
+
implementation?: string | object | undefined;
|
|
26
|
+
sassOptions?: import("@modern-js/libuild").sassOptions | undefined;
|
|
27
|
+
};
|
|
28
|
+
postcss: PostcssOptions & {
|
|
29
|
+
$$tools?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
getLessConfig: () => getLessConfig,
|
|
21
|
+
getPostcssConfig: () => getPostcssConfig,
|
|
22
|
+
getSassConfig: () => getSassConfig,
|
|
23
|
+
getStyleConfig: () => getStyleConfig
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
26
|
+
var __create = Object.create;
|
|
27
|
+
var __defProp2 = Object.defineProperty;
|
|
28
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
29
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
30
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
31
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
32
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
33
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
34
|
+
for (let key of __getOwnPropNames2(from))
|
|
35
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
36
|
+
__defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
37
|
+
}
|
|
38
|
+
return to;
|
|
39
|
+
};
|
|
40
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
|
|
41
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
|
+
mod
|
|
43
|
+
));
|
|
44
|
+
var __async = (__this, __arguments, generator) => {
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
var fulfilled = (value) => {
|
|
47
|
+
try {
|
|
48
|
+
step(generator.next(value));
|
|
49
|
+
} catch (e) {
|
|
50
|
+
reject(e);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var rejected = (value) => {
|
|
54
|
+
try {
|
|
55
|
+
step(generator.throw(value));
|
|
56
|
+
} catch (e) {
|
|
57
|
+
reject(e);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
61
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const getLessConfig = (config) => __async(void 0, null, function* () {
|
|
65
|
+
var _a;
|
|
66
|
+
const { applyOptionsChain } = yield Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
|
|
67
|
+
const { getCompiledPath } = yield Promise.resolve().then(() => __toESM(require("./path")));
|
|
68
|
+
const mergedOptions = applyOptionsChain(
|
|
69
|
+
{
|
|
70
|
+
lessOptions: { javascriptEnabled: true },
|
|
71
|
+
implementation: yield getCompiledPath("less")
|
|
72
|
+
},
|
|
73
|
+
((_a = config == null ? void 0 : config.style) == null ? void 0 : _a.less) || {}
|
|
74
|
+
);
|
|
75
|
+
return mergedOptions;
|
|
76
|
+
});
|
|
77
|
+
const getSassConfig = (config) => __async(void 0, null, function* () {
|
|
78
|
+
var _a;
|
|
79
|
+
const { applyOptionsChain } = yield Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
|
|
80
|
+
const { getCompiledPath } = yield Promise.resolve().then(() => __toESM(require("./path")));
|
|
81
|
+
const mergedOptions = applyOptionsChain(
|
|
82
|
+
{
|
|
83
|
+
implementation: yield getCompiledPath("sass")
|
|
84
|
+
},
|
|
85
|
+
((_a = config == null ? void 0 : config.style) == null ? void 0 : _a.sass) || {}
|
|
86
|
+
);
|
|
87
|
+
return mergedOptions;
|
|
88
|
+
});
|
|
89
|
+
const getPostcssConfig = (config) => __async(void 0, null, function* () {
|
|
90
|
+
var _a;
|
|
91
|
+
const { applyOptionsChain } = yield Promise.resolve().then(() => __toESM(require("@modern-js/utils")));
|
|
92
|
+
const { getCompiledPath } = yield Promise.resolve().then(() => __toESM(require("./path")));
|
|
93
|
+
const extraPlugins = [];
|
|
94
|
+
const utils = {
|
|
95
|
+
addPlugins(plugins) {
|
|
96
|
+
if (Array.isArray(plugins)) {
|
|
97
|
+
extraPlugins.push(...plugins);
|
|
98
|
+
} else {
|
|
99
|
+
extraPlugins.push(plugins);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const mergedConfig = applyOptionsChain(
|
|
104
|
+
{
|
|
105
|
+
plugins: [
|
|
106
|
+
require(yield getCompiledPath("postcss-flexbugs-fixes")),
|
|
107
|
+
require(yield getCompiledPath("postcss-custom-properties")),
|
|
108
|
+
require(yield getCompiledPath("postcss-initial")),
|
|
109
|
+
require(yield getCompiledPath("postcss-page-break")),
|
|
110
|
+
require(yield getCompiledPath("postcss-font-variant")),
|
|
111
|
+
require(yield getCompiledPath("postcss-media-minmax")),
|
|
112
|
+
require(yield getCompiledPath("postcss-nesting"))
|
|
113
|
+
].filter(Boolean)
|
|
114
|
+
},
|
|
115
|
+
((_a = config == null ? void 0 : config.style) == null ? void 0 : _a.postcss) || {},
|
|
116
|
+
utils
|
|
117
|
+
);
|
|
118
|
+
if (extraPlugins.length) {
|
|
119
|
+
mergedConfig.plugins.push(...extraPlugins);
|
|
120
|
+
}
|
|
121
|
+
return mergedConfig;
|
|
122
|
+
});
|
|
123
|
+
const getStyleConfig = (config) => __async(void 0, null, function* () {
|
|
124
|
+
const postcssConfig = yield getPostcssConfig(config);
|
|
125
|
+
const lessConfig = yield getLessConfig(config);
|
|
126
|
+
const sassConfig = yield getSassConfig(config);
|
|
127
|
+
return {
|
|
128
|
+
less: lessConfig,
|
|
129
|
+
sass: sassConfig,
|
|
130
|
+
postcss: postcssConfig
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASO,MAAM,gBAAgB,CAAO,WAAmC;AATvE;AAUE,QAAM,EAAE,kBAAkB,IAAI,MAAM,6CAAO;AAC3C,QAAM,EAAE,gBAAgB,IAAI,MAAM,6CAAO;AAEzC,QAAM,gBAAgB;AAAA,IACpB;AAAA,MACE,aAAa,EAAE,mBAAmB,KAAK;AAAA,MACvC,gBAAgB,MAAM,gBAAgB,MAAM;AAAA,IAC9C;AAAA,MACA,sCAAQ,UAAR,mBAAe,SAAQ,CAAC;AAAA,EAC1B;AAEA,SAAO;AACT;AAEO,MAAM,gBAAgB,CAAO,WAAmC;AAxBvE;AAyBE,QAAM,EAAE,kBAAkB,IAAI,MAAM,6CAAO;AAC3C,QAAM,EAAE,gBAAgB,IAAI,MAAM,6CAAO;AAEzC,QAAM,gBAAgB;AAAA,IACpB;AAAA,MACE,gBAAgB,MAAM,gBAAgB,MAAM;AAAA,IAC9C;AAAA,MACA,sCAAQ,UAAR,mBAAe,SAAQ,CAAC;AAAA,EAC1B;AAEA,SAAO;AACT;AAEO,MAAM,mBAAmB,CAAO,WAAmC;AAtC1E;AAuCE,QAAM,EAAE,kBAAkB,IAAI,MAAM,6CAAO;AAC3C,QAAM,EAAE,gBAAgB,IAAI,MAAM,6CAAO;AACzC,QAAM,eAAiC,CAAC;AAExC,QAAM,QAAQ;AAAA,IACZ,WAAW,SAA4C;AACrD,UAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,qBAAa,KAAK,GAAG,OAAO;AAAA,MAC9B,OAAO;AACL,qBAAa,KAAK,OAAO;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe;AAAA,IAInB;AAAA,MAGE,SAAS;AAAA,QACP,QAAQ,MAAM,gBAAgB,wBAAwB,CAAC;AAAA,QACvD,QAAQ,MAAM,gBAAgB,2BAA2B,CAAC;AAAA,QAC1D,QAAQ,MAAM,gBAAgB,iBAAiB,CAAC;AAAA,QAChD,QAAQ,MAAM,gBAAgB,oBAAoB,CAAC;AAAA,QACnD,QAAQ,MAAM,gBAAgB,sBAAsB,CAAC;AAAA,QACrD,QAAQ,MAAM,gBAAgB,sBAAsB,CAAC;AAAA,QACrD,QAAQ,MAAM,gBAAgB,iBAAiB,CAAC;AAAA,MAClD,EAAE,OAAO,OAAO;AAAA,IAClB;AAAA,MACA,sCAAQ,UAAR,mBAAe,YAAW,CAAC;AAAA,IAC3B;AAAA,EACF;AACA,MAAI,aAAa,QAAQ;AACvB,iBAAa,QAAS,KAAK,GAAG,YAAY;AAAA,EAC5C;AAEA,SAAO;AACT;AAEO,MAAM,iBAAiB,CAAO,WAAmC;AACtE,QAAM,gBAAgB,MAAM,iBAAiB,MAAM;AACnD,QAAM,aAAa,MAAM,cAAc,MAAM;AAC7C,QAAM,aAAa,MAAM,cAAc,MAAM;AAC7C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF;","names":[],"sources":["../../src/utils/style.ts"],"sourcesContent":["import type { AcceptedPlugin } from 'postcss';\nimport type { PostcssOptions } from '@modern-js/libuild';\nimport type {\n PartialBaseBuildConfig,\n PostCSSConfigUtils,\n LessOptions,\n SassOptions,\n} from '../types';\n\nexport const getLessConfig = async (config: PartialBaseBuildConfig) => {\n const { applyOptionsChain } = await import('@modern-js/utils');\n const { getCompiledPath } = await import('./path');\n\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 { applyOptionsChain } = await import('@modern-js/utils');\n const { getCompiledPath } = await import('./path');\n\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 { applyOptionsChain } = await import('@modern-js/utils');\n const { getCompiledPath } = await import('./path');\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 mergedConfig = applyOptionsChain<\n PostcssOptions & { $$tools?: string },\n PostCSSConfigUtils\n >(\n {\n // TODO: when schema support redefine\n // $$tools: 'module-tools',\n plugins: [\n require(await getCompiledPath('postcss-flexbugs-fixes')),\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 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"]}
|
|
File without changes
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
+
mod
|
|
22
|
+
));
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
var stdin_exports = {};
|
|
25
|
+
__export(stdin_exports, {
|
|
26
|
+
transformDtsAlias: () => transformDtsAlias
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
29
|
+
var path = __toESM(require("path"));
|
|
30
|
+
var import_tsconfig_paths = require("@modern-js/utils/tsconfig-paths");
|
|
31
|
+
var import_utils = require("@modern-js/utils");
|
|
32
|
+
var parser = __toESM(require("../../compiled/@babel/parser"));
|
|
33
|
+
var import_generator = __toESM(require("../../compiled/@babel/generator"));
|
|
34
|
+
var t = __toESM(require("../../compiled/@babel/types"));
|
|
35
|
+
var import_traverse = __toESM(require("../../compiled/@babel/traverse"));
|
|
36
|
+
var import_file = require("../constants/file");
|
|
37
|
+
function mapPathString(nodePath, { filename, baseUrl, paths }) {
|
|
38
|
+
if (!t.isStringLiteral(nodePath)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const sourcePath = nodePath.node.value;
|
|
42
|
+
const currentFile = filename;
|
|
43
|
+
const matchPath = (0, import_tsconfig_paths.createMatchPath)(
|
|
44
|
+
baseUrl,
|
|
45
|
+
paths,
|
|
46
|
+
["index"]
|
|
47
|
+
);
|
|
48
|
+
const result = matchPath(
|
|
49
|
+
sourcePath,
|
|
50
|
+
(packageJsonPath) => {
|
|
51
|
+
if (!import_utils.fs.existsSync(packageJsonPath)) {
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
return import_utils.fs.readJSONSync(packageJsonPath);
|
|
55
|
+
},
|
|
56
|
+
(filePath) => import_utils.fs.existsSync(filePath),
|
|
57
|
+
import_file.dtsAliasExts
|
|
58
|
+
);
|
|
59
|
+
if (result) {
|
|
60
|
+
const relativePath = path.relative(
|
|
61
|
+
path.dirname(currentFile),
|
|
62
|
+
path.dirname(result)
|
|
63
|
+
);
|
|
64
|
+
const fileName = path.basename(result);
|
|
65
|
+
const filePath = path.normalize(
|
|
66
|
+
`${relativePath.length === 0 ? "." : relativePath}/${fileName}`
|
|
67
|
+
);
|
|
68
|
+
const replaceString = filePath.startsWith(".") ? filePath : `./${filePath}`;
|
|
69
|
+
nodePath.replaceWith(t.stringLiteral(replaceString));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const transformImport = (option) => (nodePath) => {
|
|
73
|
+
mapPathString(nodePath.get("source"), option);
|
|
74
|
+
};
|
|
75
|
+
const transformExport = (option) => (nodePath) => {
|
|
76
|
+
mapPathString(nodePath.get("source"), option);
|
|
77
|
+
};
|
|
78
|
+
const transformSingleFileAlias = ({
|
|
79
|
+
filename,
|
|
80
|
+
baseUrl,
|
|
81
|
+
paths
|
|
82
|
+
}) => {
|
|
83
|
+
const sourceCode = import_utils.fs.readFileSync(filename, "utf-8");
|
|
84
|
+
const ast = parser.parse(sourceCode, {
|
|
85
|
+
sourceType: "module",
|
|
86
|
+
errorRecovery: true,
|
|
87
|
+
plugins: ["typescript"]
|
|
88
|
+
});
|
|
89
|
+
(0, import_traverse.default)(ast, {
|
|
90
|
+
ImportDeclaration: transformImport({
|
|
91
|
+
filename,
|
|
92
|
+
baseUrl,
|
|
93
|
+
paths
|
|
94
|
+
}),
|
|
95
|
+
ExportDeclaration: transformExport({
|
|
96
|
+
filename,
|
|
97
|
+
baseUrl,
|
|
98
|
+
paths
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
return (0, import_generator.default)(ast).code;
|
|
102
|
+
};
|
|
103
|
+
const transformDtsAlias = (option) => {
|
|
104
|
+
const { filenames = [], baseUrl, paths } = option;
|
|
105
|
+
const transformResult = [];
|
|
106
|
+
for (const filename of filenames) {
|
|
107
|
+
transformResult.push({
|
|
108
|
+
path: filename,
|
|
109
|
+
content: transformSingleFileAlias({ filename, baseUrl, paths })
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return transformResult;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=tspaths-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,4BAAgC;AAChC,mBAAmB;AACnB,aAAwB;AACxB,uBAAsB;AACtB,QAAmB;AACnB,sBAAmC;AACnC,kBAA6B;AAU7B,SAAS,cACP,UACA,EAAE,UAAU,SAAS,MAAM,GAC3B;AACA,MAAI,CAAC,EAAE,gBAAgB,QAAQ,GAAG;AAChC;AAAA,EACF;AAEA,QAAM,aAAa,SAAS,KAAK;AACjC,QAAM,cAAc;AACpB,QAAM,gBAAY;AAAA,IAChB;AAAA,IACA;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AACA,QAAM,SAAS;AAAA,IACb;AAAA,IACA,qBAAmB;AACjB,UAAI,CAAC,gBAAG,WAAW,eAAe,GAAG;AACnC,eAAO;AAAA,MACT;AACA,aAAO,gBAAG,aAAa,eAAe;AAAA,IACxC;AAAA,IACA,cAAY,gBAAG,WAAW,QAAQ;AAAA,IAClC;AAAA,EACF;AACA,MAAI,QAAQ;AACV,UAAM,eAAe,KAAK;AAAA,MACxB,KAAK,QAAQ,WAAW;AAAA,MACxB,KAAK,QAAQ,MAAM;AAAA,IACrB;AACA,UAAM,WAAW,KAAK,SAAS,MAAM;AAErC,UAAM,WAAW,KAAK;AAAA,MACpB,GAAG,aAAa,WAAW,IAAI,MAAM,gBAAgB;AAAA,IACvD;AACA,UAAM,gBAAgB,SAAS,WAAW,GAAG,IAAI,WAAW,KAAK;AACjE,aAAS,YAAY,EAAE,cAAc,aAAa,CAAC;AAAA,EACrD;AACF;AAgBA,MAAM,kBACJ,CAAC,WAA4B,CAAC,aAA4C;AACxE,gBAAc,SAAS,IAAI,QAAQ,GAAG,MAAM;AAC9C;AAEF,MAAM,kBACJ,CAAC,WAA4B,CAAC,aAA4C;AACxE,gBAAc,SAAS,IAAI,QAAQ,GAAgC,MAAM;AAC3E;AAEF,MAAM,2BAA2B,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,QAAM,aAAa,gBAAG,aAAa,UAAU,OAAO;AACpD,QAAM,MAAM,OAAO,MAAM,YAAY;AAAA,IACnC,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,SAAS,CAAC,YAAY;AAAA,EACxB,CAAC;AACD,+BAAS,KAAK;AAAA,IAGZ,mBAAmB,gBAAgB;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,mBAAmB,gBAAgB;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACD,aAAO,0BAAU,GAAG,EAAE;AACxB;AAOO,MAAM,oBAAoB,CAAC,WAAoC;AACpE,QAAM,EAAE,YAAY,CAAC,GAAG,SAAS,MAAM,IAAI;AAC3C,QAAM,kBAAuD,CAAC;AAC9D,aAAW,YAAY,WAAW;AAChC,oBAAgB,KAAK;AAAA,MACnB,MAAM;AAAA,MACN,SAAS,yBAAyB,EAAE,UAAU,SAAS,MAAM,CAAC;AAAA,IAChE,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[],"sources":["../../src/utils/tspaths-transform.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 '../../compiled/@babel/parser';\nimport generator from '../../compiled/@babel/generator';\nimport * as t from '../../compiled/@babel/types';\nimport traverse, { NodePath } from '../../compiled/@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<t.StringLiteral>,\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"]}
|
package/package.json
CHANGED
|
@@ -6,38 +6,21 @@
|
|
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"keywords": [
|
|
9
|
-
"react",
|
|
10
|
-
"framework",
|
|
11
9
|
"modern",
|
|
12
|
-
"modern.js"
|
|
10
|
+
"modern.js",
|
|
11
|
+
"module-tools",
|
|
12
|
+
"lib-tools"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.0.0-beta.
|
|
14
|
+
"version": "2.0.0-beta.4",
|
|
15
15
|
"bin": {
|
|
16
16
|
"modern": "./bin/modern.js",
|
|
17
17
|
"modern-module": "./bin/modern.js"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"main": "./dist/js/node/index.js",
|
|
22
|
-
"module": "./dist/js/treeshaking/index.js",
|
|
23
|
-
"jsnext:modern": "./dist/js/modern/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"main": "./dist/index.js",
|
|
24
21
|
"exports": {
|
|
25
|
-
".":
|
|
26
|
-
|
|
27
|
-
"jsnext:source": "./src/index.ts",
|
|
28
|
-
"import": "./dist/js/modern/index.js",
|
|
29
|
-
"require": "./dist/js/node/index.js"
|
|
30
|
-
},
|
|
31
|
-
"default": "./dist/js/treeshaking/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./cli": {
|
|
34
|
-
"jsnext:source": "./src/index.ts",
|
|
35
|
-
"default": "./dist/js/node/index.js"
|
|
36
|
-
},
|
|
37
|
-
"./build": {
|
|
38
|
-
"jsnext:source": "./src/build.ts",
|
|
39
|
-
"default": "./dist/js/node/build.js"
|
|
40
|
-
}
|
|
22
|
+
".": "./dist/index.js",
|
|
23
|
+
"./defineConfig": "./dist/config/defineConfig.js"
|
|
41
24
|
},
|
|
42
25
|
"typesVersions": {
|
|
43
26
|
"*": {
|
|
@@ -46,69 +29,59 @@
|
|
|
46
29
|
],
|
|
47
30
|
"type": [
|
|
48
31
|
"./lib/types.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"defineConfig": [
|
|
34
|
+
"./dist/config/defineConfig.d.ts"
|
|
49
35
|
]
|
|
50
36
|
}
|
|
51
37
|
},
|
|
52
38
|
"dependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@modern-js/
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"process.argv": "^0.6.0",
|
|
66
|
-
"rollup": "^2.70.2",
|
|
67
|
-
"rollup-plugin-dts": "^4.2.1",
|
|
68
|
-
"rollup-plugin-hashbang": "^3.0.0",
|
|
69
|
-
"signal-exit": "^3.0.7",
|
|
70
|
-
"@modern-js/babel-compiler": "2.0.0-beta.3",
|
|
71
|
-
"@modern-js/babel-preset-module": "2.0.0-beta.3",
|
|
72
|
-
"@modern-js/core": "2.0.0-beta.3",
|
|
73
|
-
"@modern-js/new-action": "2.0.0-beta.3",
|
|
74
|
-
"@modern-js/upgrade": "2.0.0-beta.3",
|
|
75
|
-
"@modern-js/plugin": "2.0.0-beta.3",
|
|
76
|
-
"@modern-js/plugin-changeset": "2.0.0-beta.3",
|
|
77
|
-
"@modern-js/plugin-i18n": "2.0.0-beta.3",
|
|
78
|
-
"@modern-js/plugin-lint": "2.0.0-beta.3",
|
|
79
|
-
"@modern-js/style-compiler": "2.0.0-beta.3",
|
|
80
|
-
"@modern-js/utils": "2.0.0-beta.3"
|
|
39
|
+
"@modern-js/libuild": "0.6.0",
|
|
40
|
+
"@modern-js/libuild-plugin-umd": "0.5.2",
|
|
41
|
+
"@modern-js/libuild-plugin-es5": "0.5.2",
|
|
42
|
+
"@modern-js/libuild-plugin-swc": "0.6.0",
|
|
43
|
+
"@modern-js/core": "2.0.0-beta.4",
|
|
44
|
+
"@modern-js/new-action": "2.0.0-beta.4",
|
|
45
|
+
"@modern-js/plugin": "2.0.0-beta.4",
|
|
46
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.4",
|
|
47
|
+
"@modern-js/upgrade": "2.0.0-beta.4",
|
|
48
|
+
"@modern-js/utils": "2.0.0-beta.4",
|
|
49
|
+
"@modern-js/plugin-changeset": "2.0.0-beta.4",
|
|
50
|
+
"@modern-js/plugin-lint": "2.0.0-beta.4"
|
|
81
51
|
},
|
|
82
52
|
"devDependencies": {
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"@types/babel__traverse": "^7.14.2",
|
|
86
|
-
"@types/glob": "^7.1.4",
|
|
53
|
+
"@babel/core": "7.20.2",
|
|
54
|
+
"@modern-js/self": "npm:@modern-js/module-tools@*",
|
|
87
55
|
"@types/jest": "^27",
|
|
88
56
|
"@types/node": "^14",
|
|
89
|
-
"@types/
|
|
90
|
-
"
|
|
57
|
+
"@types/fs-extra": "9.0.13",
|
|
58
|
+
"fs-extra": "10.1.0",
|
|
91
59
|
"jest": "^27",
|
|
60
|
+
"path-browserify": "1.0.1",
|
|
61
|
+
"postcss": "8.4.6",
|
|
62
|
+
"postcss-alias": "2.0.0",
|
|
63
|
+
"react": "17",
|
|
92
64
|
"typescript": "^4",
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"@scripts/build": "2.0.0-beta.3",
|
|
96
|
-
"@scripts/jest-config": "2.0.0-beta.3"
|
|
97
|
-
},
|
|
98
|
-
"sideEffects": false,
|
|
99
|
-
"modernConfig": {
|
|
100
|
-
"output": {
|
|
101
|
-
"packageMode": "node-js"
|
|
102
|
-
}
|
|
65
|
+
"@scripts/build": "2.0.0-beta.4",
|
|
66
|
+
"@scripts/jest-config": "2.0.0-beta.4"
|
|
103
67
|
},
|
|
104
68
|
"publishConfig": {
|
|
105
69
|
"registry": "https://registry.npmjs.org/",
|
|
106
70
|
"access": "public"
|
|
107
71
|
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"typescript": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"typescript": "^4"
|
|
79
|
+
},
|
|
108
80
|
"scripts": {
|
|
109
|
-
"new": "modern-lib new",
|
|
110
81
|
"build": "modern-lib build",
|
|
111
|
-
"
|
|
112
|
-
"
|
|
82
|
+
"dev": "modern-lib build --watch",
|
|
83
|
+
"test": "jest",
|
|
84
|
+
"test:update": "jest --updateSnapshot",
|
|
85
|
+
"new": "modern-lib new"
|
|
113
86
|
}
|
|
114
87
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Import } from '@modern-js/utils';
|
|
2
|
-
const local = Import.lazy('../locale/index', require);
|
|
3
|
-
const command = Import.lazy('../commands/build', require);
|
|
4
|
-
export const buildCli = (program, api) => {
|
|
5
|
-
return program.command('build').usage('[options]').description(local.i18n.t(local.localeKeys.command.build.describe)).option('-w, --watch', local.i18n.t(local.localeKeys.command.build.watch)).option('--tsconfig [tsconfig]', local.i18n.t(local.localeKeys.command.build.tsconfig), './tsconfig.json').option('--style-only', local.i18n.t(local.localeKeys.command.build.style_only)).option('-p, --platform [platform]', local.i18n.t(local.localeKeys.command.build.platform))
|
|
6
|
-
// @deprecated
|
|
7
|
-
// The `--no-tsc` option has been superceded by the `--no-dts` option.
|
|
8
|
-
.option('--no-tsc', local.i18n.t(local.localeKeys.command.build.no_tsc)).option('--dts', local.i18n.t(local.localeKeys.command.build.dts)).option('--no-clear', local.i18n.t(local.localeKeys.command.build.no_clear)).option('-c --config <config>', local.i18n.t(local.localeKeys.command.build.config)).action(async subCommand => {
|
|
9
|
-
await command.build(api, subCommand);
|
|
10
|
-
});
|
|
11
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Import } from '@modern-js/utils';
|
|
2
|
-
const local = Import.lazy('../locale', require);
|
|
3
|
-
const commands = Import.lazy('../commands', require);
|
|
4
|
-
export const devCli = (program, api) => {
|
|
5
|
-
program.command('dev [subCmd]').usage('[options]').description(local.i18n.t(local.localeKeys.command.dev.describe)).option('--tsconfig [tsconfig]', local.i18n.t(local.localeKeys.command.build.tsconfig), './tsconfig.json').action(async (subCmd, params) => {
|
|
6
|
-
await commands.dev(api, params, subCmd);
|
|
7
|
-
// support plugin-proxy
|
|
8
|
-
const runner = api.useHookRunners();
|
|
9
|
-
await runner.afterDev();
|
|
10
|
-
});
|
|
11
|
-
};
|