@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,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@babel/types","author":"The Babel Team (https://babel.dev/team)","version":"7.18.4","license":"MIT","types":"./lib/index-legacy.d.ts"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-unresolved
|
|
2
|
+
import { BaseNode } from '../../estree';
|
|
3
|
+
|
|
4
|
+
export interface AttachedScope {
|
|
5
|
+
parent?: AttachedScope;
|
|
6
|
+
isBlockScope: boolean;
|
|
7
|
+
declarations: { [key: string]: boolean };
|
|
8
|
+
addDeclaration(node: BaseNode, isBlockDeclaration: boolean, isVar: boolean): void;
|
|
9
|
+
contains(name: string): boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface DataToEsmOptions {
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
indent?: string;
|
|
15
|
+
namedExports?: boolean;
|
|
16
|
+
objectShorthand?: boolean;
|
|
17
|
+
preferConst?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A valid `minimatch` pattern, or array of patterns.
|
|
22
|
+
*/
|
|
23
|
+
export type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Adds an extension to a module ID if one does not exist.
|
|
27
|
+
*/
|
|
28
|
+
export function addExtension(filename: string, ext?: string): string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Attaches `Scope` objects to the relevant nodes of an AST.
|
|
32
|
+
* Each `Scope` object has a `scope.contains(name)` method that returns `true`
|
|
33
|
+
* if a given name is defined in the current scope or a parent scope.
|
|
34
|
+
*/
|
|
35
|
+
export function attachScopes(ast: BaseNode, propertyName?: string): AttachedScope;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a filter function which can be used to determine whether or not
|
|
39
|
+
* certain modules should be operated upon.
|
|
40
|
+
* @param include If `include` is omitted or has zero length, filter will return `true` by default.
|
|
41
|
+
* @param exclude ID must not match any of the `exclude` patterns.
|
|
42
|
+
* @param options Optionally resolves the patterns against a directory other than `process.cwd()`.
|
|
43
|
+
* If a `string` is specified, then the value will be used as the base directory.
|
|
44
|
+
* Relative paths will be resolved against `process.cwd()` first.
|
|
45
|
+
* If `false`, then the patterns will not be resolved against any directory.
|
|
46
|
+
* This can be useful if you want to create a filter for virtual module names.
|
|
47
|
+
*/
|
|
48
|
+
export function createFilter(
|
|
49
|
+
include?: FilterPattern,
|
|
50
|
+
exclude?: FilterPattern,
|
|
51
|
+
options?: { resolve?: string | false | null }
|
|
52
|
+
): (id: string | unknown) => boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Transforms objects into tree-shakable ES Module imports.
|
|
56
|
+
* @param data An object to transform into an ES module.
|
|
57
|
+
*/
|
|
58
|
+
export function dataToEsm(data: unknown, options?: DataToEsmOptions): string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Extracts the names of all assignment targets based upon specified patterns.
|
|
62
|
+
* @param param An `acorn` AST Node.
|
|
63
|
+
*/
|
|
64
|
+
export function extractAssignedNames(param: BaseNode): string[];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Constructs a bundle-safe identifier from a `string`.
|
|
68
|
+
*/
|
|
69
|
+
export function makeLegalIdentifier(str: string): string;
|
|
70
|
+
|
|
71
|
+
export type AddExtension = typeof addExtension;
|
|
72
|
+
export type AttachScopes = typeof attachScopes;
|
|
73
|
+
export type CreateFilter = typeof createFilter;
|
|
74
|
+
export type ExtractAssignedNames = typeof extractAssignedNames;
|
|
75
|
+
export type MakeLegalIdentifier = typeof makeLegalIdentifier;
|
|
76
|
+
export type DataToEsm = typeof dataToEsm;
|
|
77
|
+
|
|
78
|
+
declare const defaultExport: {
|
|
79
|
+
addExtension: AddExtension;
|
|
80
|
+
attachScopes: AttachScopes;
|
|
81
|
+
createFilter: CreateFilter;
|
|
82
|
+
dataToEsm: DataToEsm;
|
|
83
|
+
extractAssignedNames: ExtractAssignedNames;
|
|
84
|
+
makeLegalIdentifier: MakeLegalIdentifier;
|
|
85
|
+
};
|
|
86
|
+
export default defaultExport;
|
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
// Type definitions for ESTree AST specification
|
|
2
|
+
// Project: https://github.com/estree/estree
|
|
3
|
+
// Definitions by: RReverser <https://github.com/RReverser>
|
|
4
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
|
|
6
|
+
// This definition file follows a somewhat unusual format. ESTree allows
|
|
7
|
+
// runtime type checks based on the `type` parameter. In order to explain this
|
|
8
|
+
// to typescript we want to use discriminated union types:
|
|
9
|
+
// https://github.com/Microsoft/TypeScript/pull/9163
|
|
10
|
+
//
|
|
11
|
+
// For ESTree this is a bit tricky because the high level interfaces like
|
|
12
|
+
// Node or Function are pulling double duty. We want to pass common fields down
|
|
13
|
+
// to the interfaces that extend them (like Identifier or
|
|
14
|
+
// ArrowFunctionExpression), but you can't extend a type union or enforce
|
|
15
|
+
// common fields on them. So we've split the high level interfaces into two
|
|
16
|
+
// types, a base type which passes down inhereted fields, and a type union of
|
|
17
|
+
// all types which extend the base type. Only the type union is exported, and
|
|
18
|
+
// the union is how other types refer to the collection of inheriting types.
|
|
19
|
+
//
|
|
20
|
+
// This makes the definitions file here somewhat more difficult to maintain,
|
|
21
|
+
// but it has the notable advantage of making ESTree much easier to use as
|
|
22
|
+
// an end user.
|
|
23
|
+
|
|
24
|
+
interface BaseNodeWithoutComments {
|
|
25
|
+
// Every leaf interface that extends BaseNode must specify a type property.
|
|
26
|
+
// The type property should be a string literal. For example, Identifier
|
|
27
|
+
// has: `type: "Identifier"`
|
|
28
|
+
type: string;
|
|
29
|
+
loc?: SourceLocation | null;
|
|
30
|
+
range?: [number, number];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface BaseNode extends BaseNodeWithoutComments {
|
|
34
|
+
leadingComments?: Array<Comment>;
|
|
35
|
+
trailingComments?: Array<Comment>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type Node =
|
|
39
|
+
Identifier | Literal | Program | Function | SwitchCase | CatchClause |
|
|
40
|
+
VariableDeclarator | Statement | Expression | Property |
|
|
41
|
+
AssignmentProperty | Super | TemplateElement | SpreadElement | Pattern |
|
|
42
|
+
ClassBody | Class | MethodDefinition | ModuleDeclaration | ModuleSpecifier;
|
|
43
|
+
|
|
44
|
+
export interface Comment extends BaseNodeWithoutComments {
|
|
45
|
+
type: "Line" | "Block";
|
|
46
|
+
value: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface SourceLocation {
|
|
50
|
+
source?: string | null;
|
|
51
|
+
start: Position;
|
|
52
|
+
end: Position;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface Position {
|
|
56
|
+
/** >= 1 */
|
|
57
|
+
line: number;
|
|
58
|
+
/** >= 0 */
|
|
59
|
+
column: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface Program extends BaseNode {
|
|
63
|
+
type: "Program";
|
|
64
|
+
sourceType: "script" | "module";
|
|
65
|
+
body: Array<Statement | ModuleDeclaration>;
|
|
66
|
+
comments?: Array<Comment>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface BaseFunction extends BaseNode {
|
|
70
|
+
params: Array<Pattern>;
|
|
71
|
+
generator?: boolean;
|
|
72
|
+
async?: boolean;
|
|
73
|
+
// The body is either BlockStatement or Expression because arrow functions
|
|
74
|
+
// can have a body that's either. FunctionDeclarations and
|
|
75
|
+
// FunctionExpressions have only BlockStatement bodies.
|
|
76
|
+
body: BlockStatement | Expression;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type Function =
|
|
80
|
+
FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
|
81
|
+
|
|
82
|
+
export type Statement =
|
|
83
|
+
ExpressionStatement | BlockStatement | EmptyStatement |
|
|
84
|
+
DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement |
|
|
85
|
+
BreakStatement | ContinueStatement | IfStatement | SwitchStatement |
|
|
86
|
+
ThrowStatement | TryStatement | WhileStatement | DoWhileStatement |
|
|
87
|
+
ForStatement | ForInStatement | ForOfStatement | Declaration;
|
|
88
|
+
|
|
89
|
+
interface BaseStatement extends BaseNode { }
|
|
90
|
+
|
|
91
|
+
export interface EmptyStatement extends BaseStatement {
|
|
92
|
+
type: "EmptyStatement";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface BlockStatement extends BaseStatement {
|
|
96
|
+
type: "BlockStatement";
|
|
97
|
+
body: Array<Statement>;
|
|
98
|
+
innerComments?: Array<Comment>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface ExpressionStatement extends BaseStatement {
|
|
102
|
+
type: "ExpressionStatement";
|
|
103
|
+
expression: Expression;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface IfStatement extends BaseStatement {
|
|
107
|
+
type: "IfStatement";
|
|
108
|
+
test: Expression;
|
|
109
|
+
consequent: Statement;
|
|
110
|
+
alternate?: Statement | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface LabeledStatement extends BaseStatement {
|
|
114
|
+
type: "LabeledStatement";
|
|
115
|
+
label: Identifier;
|
|
116
|
+
body: Statement;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface BreakStatement extends BaseStatement {
|
|
120
|
+
type: "BreakStatement";
|
|
121
|
+
label?: Identifier | null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface ContinueStatement extends BaseStatement {
|
|
125
|
+
type: "ContinueStatement";
|
|
126
|
+
label?: Identifier | null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface WithStatement extends BaseStatement {
|
|
130
|
+
type: "WithStatement";
|
|
131
|
+
object: Expression;
|
|
132
|
+
body: Statement;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface SwitchStatement extends BaseStatement {
|
|
136
|
+
type: "SwitchStatement";
|
|
137
|
+
discriminant: Expression;
|
|
138
|
+
cases: Array<SwitchCase>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface ReturnStatement extends BaseStatement {
|
|
142
|
+
type: "ReturnStatement";
|
|
143
|
+
argument?: Expression | null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface ThrowStatement extends BaseStatement {
|
|
147
|
+
type: "ThrowStatement";
|
|
148
|
+
argument: Expression;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface TryStatement extends BaseStatement {
|
|
152
|
+
type: "TryStatement";
|
|
153
|
+
block: BlockStatement;
|
|
154
|
+
handler?: CatchClause | null;
|
|
155
|
+
finalizer?: BlockStatement | null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface WhileStatement extends BaseStatement {
|
|
159
|
+
type: "WhileStatement";
|
|
160
|
+
test: Expression;
|
|
161
|
+
body: Statement;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface DoWhileStatement extends BaseStatement {
|
|
165
|
+
type: "DoWhileStatement";
|
|
166
|
+
body: Statement;
|
|
167
|
+
test: Expression;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface ForStatement extends BaseStatement {
|
|
171
|
+
type: "ForStatement";
|
|
172
|
+
init?: VariableDeclaration | Expression | null;
|
|
173
|
+
test?: Expression | null;
|
|
174
|
+
update?: Expression | null;
|
|
175
|
+
body: Statement;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
interface BaseForXStatement extends BaseStatement {
|
|
179
|
+
left: VariableDeclaration | Pattern;
|
|
180
|
+
right: Expression;
|
|
181
|
+
body: Statement;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface ForInStatement extends BaseForXStatement {
|
|
185
|
+
type: "ForInStatement";
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface DebuggerStatement extends BaseStatement {
|
|
189
|
+
type: "DebuggerStatement";
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type Declaration =
|
|
193
|
+
FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
|
194
|
+
|
|
195
|
+
interface BaseDeclaration extends BaseStatement { }
|
|
196
|
+
|
|
197
|
+
export interface FunctionDeclaration extends BaseFunction, BaseDeclaration {
|
|
198
|
+
type: "FunctionDeclaration";
|
|
199
|
+
/** It is null when a function declaration is a part of the `export default function` statement */
|
|
200
|
+
id: Identifier | null;
|
|
201
|
+
body: BlockStatement;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface VariableDeclaration extends BaseDeclaration {
|
|
205
|
+
type: "VariableDeclaration";
|
|
206
|
+
declarations: Array<VariableDeclarator>;
|
|
207
|
+
kind: "var" | "let" | "const";
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface VariableDeclarator extends BaseNode {
|
|
211
|
+
type: "VariableDeclarator";
|
|
212
|
+
id: Pattern;
|
|
213
|
+
init?: Expression | null;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
type Expression =
|
|
217
|
+
ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression |
|
|
218
|
+
ArrowFunctionExpression | YieldExpression | Literal | UnaryExpression |
|
|
219
|
+
UpdateExpression | BinaryExpression | AssignmentExpression |
|
|
220
|
+
LogicalExpression | MemberExpression | ConditionalExpression |
|
|
221
|
+
CallExpression | NewExpression | SequenceExpression | TemplateLiteral |
|
|
222
|
+
TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier |
|
|
223
|
+
AwaitExpression;
|
|
224
|
+
|
|
225
|
+
export interface BaseExpression extends BaseNode { }
|
|
226
|
+
|
|
227
|
+
export interface ThisExpression extends BaseExpression {
|
|
228
|
+
type: "ThisExpression";
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface ArrayExpression extends BaseExpression {
|
|
232
|
+
type: "ArrayExpression";
|
|
233
|
+
elements: Array<Expression | SpreadElement>;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface ObjectExpression extends BaseExpression {
|
|
237
|
+
type: "ObjectExpression";
|
|
238
|
+
properties: Array<Property>;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface Property extends BaseNode {
|
|
242
|
+
type: "Property";
|
|
243
|
+
key: Expression;
|
|
244
|
+
value: Expression | Pattern; // Could be an AssignmentProperty
|
|
245
|
+
kind: "init" | "get" | "set";
|
|
246
|
+
method: boolean;
|
|
247
|
+
shorthand: boolean;
|
|
248
|
+
computed: boolean;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface FunctionExpression extends BaseFunction, BaseExpression {
|
|
252
|
+
id?: Identifier | null;
|
|
253
|
+
type: "FunctionExpression";
|
|
254
|
+
body: BlockStatement;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface SequenceExpression extends BaseExpression {
|
|
258
|
+
type: "SequenceExpression";
|
|
259
|
+
expressions: Array<Expression>;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export interface UnaryExpression extends BaseExpression {
|
|
263
|
+
type: "UnaryExpression";
|
|
264
|
+
operator: UnaryOperator;
|
|
265
|
+
prefix: true;
|
|
266
|
+
argument: Expression;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface BinaryExpression extends BaseExpression {
|
|
270
|
+
type: "BinaryExpression";
|
|
271
|
+
operator: BinaryOperator;
|
|
272
|
+
left: Expression;
|
|
273
|
+
right: Expression;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export interface AssignmentExpression extends BaseExpression {
|
|
277
|
+
type: "AssignmentExpression";
|
|
278
|
+
operator: AssignmentOperator;
|
|
279
|
+
left: Pattern | MemberExpression;
|
|
280
|
+
right: Expression;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export interface UpdateExpression extends BaseExpression {
|
|
284
|
+
type: "UpdateExpression";
|
|
285
|
+
operator: UpdateOperator;
|
|
286
|
+
argument: Expression;
|
|
287
|
+
prefix: boolean;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface LogicalExpression extends BaseExpression {
|
|
291
|
+
type: "LogicalExpression";
|
|
292
|
+
operator: LogicalOperator;
|
|
293
|
+
left: Expression;
|
|
294
|
+
right: Expression;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface ConditionalExpression extends BaseExpression {
|
|
298
|
+
type: "ConditionalExpression";
|
|
299
|
+
test: Expression;
|
|
300
|
+
alternate: Expression;
|
|
301
|
+
consequent: Expression;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
interface BaseCallExpression extends BaseExpression {
|
|
305
|
+
callee: Expression | Super;
|
|
306
|
+
arguments: Array<Expression | SpreadElement>;
|
|
307
|
+
}
|
|
308
|
+
export type CallExpression = SimpleCallExpression | NewExpression;
|
|
309
|
+
|
|
310
|
+
export interface SimpleCallExpression extends BaseCallExpression {
|
|
311
|
+
type: "CallExpression";
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export interface NewExpression extends BaseCallExpression {
|
|
315
|
+
type: "NewExpression";
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export interface MemberExpression extends BaseExpression, BasePattern {
|
|
319
|
+
type: "MemberExpression";
|
|
320
|
+
object: Expression | Super;
|
|
321
|
+
property: Expression;
|
|
322
|
+
computed: boolean;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export type Pattern =
|
|
326
|
+
Identifier | ObjectPattern | ArrayPattern | RestElement |
|
|
327
|
+
AssignmentPattern | MemberExpression;
|
|
328
|
+
|
|
329
|
+
interface BasePattern extends BaseNode { }
|
|
330
|
+
|
|
331
|
+
export interface SwitchCase extends BaseNode {
|
|
332
|
+
type: "SwitchCase";
|
|
333
|
+
test?: Expression | null;
|
|
334
|
+
consequent: Array<Statement>;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export interface CatchClause extends BaseNode {
|
|
338
|
+
type: "CatchClause";
|
|
339
|
+
param: Pattern;
|
|
340
|
+
body: BlockStatement;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface Identifier extends BaseNode, BaseExpression, BasePattern {
|
|
344
|
+
type: "Identifier";
|
|
345
|
+
name: string;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export type Literal = SimpleLiteral | RegExpLiteral;
|
|
349
|
+
|
|
350
|
+
export interface SimpleLiteral extends BaseNode, BaseExpression {
|
|
351
|
+
type: "Literal";
|
|
352
|
+
value: string | boolean | number | null;
|
|
353
|
+
raw?: string;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface RegExpLiteral extends BaseNode, BaseExpression {
|
|
357
|
+
type: "Literal";
|
|
358
|
+
value?: RegExp | null;
|
|
359
|
+
regex: {
|
|
360
|
+
pattern: string;
|
|
361
|
+
flags: string;
|
|
362
|
+
};
|
|
363
|
+
raw?: string;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export type UnaryOperator =
|
|
367
|
+
"-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
|
368
|
+
|
|
369
|
+
export type BinaryOperator =
|
|
370
|
+
"==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" |
|
|
371
|
+
">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" |
|
|
372
|
+
"instanceof";
|
|
373
|
+
|
|
374
|
+
export type LogicalOperator = "||" | "&&";
|
|
375
|
+
|
|
376
|
+
export type AssignmentOperator =
|
|
377
|
+
"=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" |
|
|
378
|
+
"|=" | "^=" | "&=";
|
|
379
|
+
|
|
380
|
+
export type UpdateOperator = "++" | "--";
|
|
381
|
+
|
|
382
|
+
export interface ForOfStatement extends BaseForXStatement {
|
|
383
|
+
type: "ForOfStatement";
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export interface Super extends BaseNode {
|
|
387
|
+
type: "Super";
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export interface SpreadElement extends BaseNode {
|
|
391
|
+
type: "SpreadElement";
|
|
392
|
+
argument: Expression;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
|
|
396
|
+
type: "ArrowFunctionExpression";
|
|
397
|
+
expression: boolean;
|
|
398
|
+
body: BlockStatement | Expression;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export interface YieldExpression extends BaseExpression {
|
|
402
|
+
type: "YieldExpression";
|
|
403
|
+
argument?: Expression | null;
|
|
404
|
+
delegate: boolean;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface TemplateLiteral extends BaseExpression {
|
|
408
|
+
type: "TemplateLiteral";
|
|
409
|
+
quasis: Array<TemplateElement>;
|
|
410
|
+
expressions: Array<Expression>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface TaggedTemplateExpression extends BaseExpression {
|
|
414
|
+
type: "TaggedTemplateExpression";
|
|
415
|
+
tag: Expression;
|
|
416
|
+
quasi: TemplateLiteral;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export interface TemplateElement extends BaseNode {
|
|
420
|
+
type: "TemplateElement";
|
|
421
|
+
tail: boolean;
|
|
422
|
+
value: {
|
|
423
|
+
cooked: string;
|
|
424
|
+
raw: string;
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export interface AssignmentProperty extends Property {
|
|
429
|
+
value: Pattern;
|
|
430
|
+
kind: "init";
|
|
431
|
+
method: boolean; // false
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export interface ObjectPattern extends BasePattern {
|
|
435
|
+
type: "ObjectPattern";
|
|
436
|
+
properties: Array<AssignmentProperty>;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export interface ArrayPattern extends BasePattern {
|
|
440
|
+
type: "ArrayPattern";
|
|
441
|
+
elements: Array<Pattern>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export interface RestElement extends BasePattern {
|
|
445
|
+
type: "RestElement";
|
|
446
|
+
argument: Pattern;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface AssignmentPattern extends BasePattern {
|
|
450
|
+
type: "AssignmentPattern";
|
|
451
|
+
left: Pattern;
|
|
452
|
+
right: Expression;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
export type Class = ClassDeclaration | ClassExpression;
|
|
456
|
+
interface BaseClass extends BaseNode {
|
|
457
|
+
superClass?: Expression | null;
|
|
458
|
+
body: ClassBody;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export interface ClassBody extends BaseNode {
|
|
462
|
+
type: "ClassBody";
|
|
463
|
+
body: Array<MethodDefinition>;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface MethodDefinition extends BaseNode {
|
|
467
|
+
type: "MethodDefinition";
|
|
468
|
+
key: Expression;
|
|
469
|
+
value: FunctionExpression;
|
|
470
|
+
kind: "constructor" | "method" | "get" | "set";
|
|
471
|
+
computed: boolean;
|
|
472
|
+
static: boolean;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export interface ClassDeclaration extends BaseClass, BaseDeclaration {
|
|
476
|
+
type: "ClassDeclaration";
|
|
477
|
+
/** It is null when a class declaration is a part of the `export default class` statement */
|
|
478
|
+
id: Identifier | null;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface ClassExpression extends BaseClass, BaseExpression {
|
|
482
|
+
type: "ClassExpression";
|
|
483
|
+
id?: Identifier | null;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export interface MetaProperty extends BaseExpression {
|
|
487
|
+
type: "MetaProperty";
|
|
488
|
+
meta: Identifier;
|
|
489
|
+
property: Identifier;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export type ModuleDeclaration =
|
|
493
|
+
ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration |
|
|
494
|
+
ExportAllDeclaration;
|
|
495
|
+
interface BaseModuleDeclaration extends BaseNode { }
|
|
496
|
+
|
|
497
|
+
export type ModuleSpecifier =
|
|
498
|
+
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier |
|
|
499
|
+
ExportSpecifier;
|
|
500
|
+
interface BaseModuleSpecifier extends BaseNode {
|
|
501
|
+
local: Identifier;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export interface ImportDeclaration extends BaseModuleDeclaration {
|
|
505
|
+
type: "ImportDeclaration";
|
|
506
|
+
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
|
507
|
+
source: Literal;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface ImportSpecifier extends BaseModuleSpecifier {
|
|
511
|
+
type: "ImportSpecifier";
|
|
512
|
+
imported: Identifier;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export interface ImportDefaultSpecifier extends BaseModuleSpecifier {
|
|
516
|
+
type: "ImportDefaultSpecifier";
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
export interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
|
|
520
|
+
type: "ImportNamespaceSpecifier";
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
export interface ExportNamedDeclaration extends BaseModuleDeclaration {
|
|
524
|
+
type: "ExportNamedDeclaration";
|
|
525
|
+
declaration?: Declaration | null;
|
|
526
|
+
specifiers: Array<ExportSpecifier>;
|
|
527
|
+
source?: Literal | null;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
export interface ExportSpecifier extends BaseModuleSpecifier {
|
|
531
|
+
type: "ExportSpecifier";
|
|
532
|
+
exported: Identifier;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export interface ExportDefaultDeclaration extends BaseModuleDeclaration {
|
|
536
|
+
type: "ExportDefaultDeclaration";
|
|
537
|
+
declaration: Declaration | Expression;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export interface ExportAllDeclaration extends BaseModuleDeclaration {
|
|
541
|
+
type: "ExportAllDeclaration";
|
|
542
|
+
source: Literal;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
export interface AwaitExpression extends BaseExpression {
|
|
546
|
+
type: "AwaitExpression";
|
|
547
|
+
argument: Expression;
|
|
548
|
+
}
|