@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,41 @@
|
|
|
1
|
+
import { FilterPattern } from '../@rollup/pluginutils';
|
|
2
|
+
import { Plugin } from '../rollup';
|
|
3
|
+
|
|
4
|
+
export interface RollupJsonOptions {
|
|
5
|
+
/**
|
|
6
|
+
* All JSON files will be parsed by default,
|
|
7
|
+
* but you can also specifically include files
|
|
8
|
+
*/
|
|
9
|
+
include?: FilterPattern;
|
|
10
|
+
/**
|
|
11
|
+
* All JSON files will be parsed by default,
|
|
12
|
+
* but you can also specifically exclude files
|
|
13
|
+
*/
|
|
14
|
+
exclude?: FilterPattern;
|
|
15
|
+
/**
|
|
16
|
+
* For tree-shaking, properties will be declared as variables, using
|
|
17
|
+
* either `var` or `const`.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
preferConst?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Specify indentation for the generated default export
|
|
23
|
+
* @default '\t'
|
|
24
|
+
*/
|
|
25
|
+
indent?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Ignores indent and generates the smallest code
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
compact?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Generate a named export for every property of the JSON object
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
namedExports?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Convert .json files to ES6 modules
|
|
40
|
+
*/
|
|
41
|
+
export default function json(options?: RollupJsonOptions): Plugin;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
2
|
+
import {Options as LocatePathOptions} from './locate-path';
|
|
3
|
+
|
|
4
|
+
declare const stop: unique symbol;
|
|
5
|
+
|
|
6
|
+
declare namespace findUp {
|
|
7
|
+
interface Options extends LocatePathOptions {}
|
|
8
|
+
|
|
9
|
+
type StopSymbol = typeof stop;
|
|
10
|
+
|
|
11
|
+
type Match = string | StopSymbol | undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const findUp: {
|
|
15
|
+
sync: {
|
|
16
|
+
/**
|
|
17
|
+
Synchronously check if a path exists.
|
|
18
|
+
|
|
19
|
+
@param path - Path to the file or directory.
|
|
20
|
+
@returns Whether the path exists.
|
|
21
|
+
|
|
22
|
+
@example
|
|
23
|
+
```
|
|
24
|
+
import findUp = require('./find-up');
|
|
25
|
+
|
|
26
|
+
console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png'));
|
|
27
|
+
//=> true
|
|
28
|
+
```
|
|
29
|
+
*/
|
|
30
|
+
exists: (path: string) => boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
Synchronously find a file or directory by walking up parent directories.
|
|
34
|
+
|
|
35
|
+
@param name - Name of the file or directory to find. Can be multiple.
|
|
36
|
+
@returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found.
|
|
37
|
+
*/
|
|
38
|
+
(name: string | readonly string[], options?: findUp.Options): string | undefined;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
Synchronously find a file or directory by walking up parent directories.
|
|
42
|
+
|
|
43
|
+
@param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search.
|
|
44
|
+
@returns The first path found or `undefined` if none could be found.
|
|
45
|
+
|
|
46
|
+
@example
|
|
47
|
+
```
|
|
48
|
+
import path = require('path');
|
|
49
|
+
import findUp = require('./find-up');
|
|
50
|
+
|
|
51
|
+
console.log(findUp.sync(directory => {
|
|
52
|
+
const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png'));
|
|
53
|
+
return hasUnicorns && directory;
|
|
54
|
+
}, {type: 'directory'}));
|
|
55
|
+
//=> '/Users/sindresorhus'
|
|
56
|
+
```
|
|
57
|
+
*/
|
|
58
|
+
(matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
Check if a path exists.
|
|
63
|
+
|
|
64
|
+
@param path - Path to a file or directory.
|
|
65
|
+
@returns Whether the path exists.
|
|
66
|
+
|
|
67
|
+
@example
|
|
68
|
+
```
|
|
69
|
+
import findUp = require('./find-up');
|
|
70
|
+
|
|
71
|
+
(async () => {
|
|
72
|
+
console.log(await findUp.exists('/Users/sindresorhus/unicorn.png'));
|
|
73
|
+
//=> true
|
|
74
|
+
})();
|
|
75
|
+
```
|
|
76
|
+
*/
|
|
77
|
+
exists: (path: string) => Promise<boolean>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`.
|
|
81
|
+
*/
|
|
82
|
+
readonly stop: findUp.StopSymbol;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
Find a file or directory by walking up parent directories.
|
|
86
|
+
|
|
87
|
+
@param name - Name of the file or directory to find. Can be multiple.
|
|
88
|
+
@returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found.
|
|
89
|
+
|
|
90
|
+
@example
|
|
91
|
+
```
|
|
92
|
+
// /
|
|
93
|
+
// └── Users
|
|
94
|
+
// └── sindresorhus
|
|
95
|
+
// ├── unicorn.png
|
|
96
|
+
// └── foo
|
|
97
|
+
// └── bar
|
|
98
|
+
// ├── baz
|
|
99
|
+
// └── example.js
|
|
100
|
+
|
|
101
|
+
// example.js
|
|
102
|
+
import findUp = require('./find-up');
|
|
103
|
+
|
|
104
|
+
(async () => {
|
|
105
|
+
console.log(await findUp('unicorn.png'));
|
|
106
|
+
//=> '/Users/sindresorhus/unicorn.png'
|
|
107
|
+
|
|
108
|
+
console.log(await findUp(['rainbow.png', 'unicorn.png']));
|
|
109
|
+
//=> '/Users/sindresorhus/unicorn.png'
|
|
110
|
+
})();
|
|
111
|
+
```
|
|
112
|
+
*/
|
|
113
|
+
(name: string | readonly string[], options?: findUp.Options): Promise<string | undefined>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
Find a file or directory by walking up parent directories.
|
|
117
|
+
|
|
118
|
+
@param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search.
|
|
119
|
+
@returns The first path found or `undefined` if none could be found.
|
|
120
|
+
|
|
121
|
+
@example
|
|
122
|
+
```
|
|
123
|
+
import path = require('path');
|
|
124
|
+
import findUp = require('./find-up');
|
|
125
|
+
|
|
126
|
+
(async () => {
|
|
127
|
+
console.log(await findUp(async directory => {
|
|
128
|
+
const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png'));
|
|
129
|
+
return hasUnicorns && directory;
|
|
130
|
+
}, {type: 'directory'}));
|
|
131
|
+
//=> '/Users/sindresorhus'
|
|
132
|
+
})();
|
|
133
|
+
```
|
|
134
|
+
*/
|
|
135
|
+
(matcher: (directory: string) => (findUp.Match | Promise<findUp.Match>), options?: findUp.Options): Promise<string | undefined>;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export = findUp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={586:(e,t,r)=>{"use strict";const s=r(17);const n=r(417);const c=r(896);const i=Symbol("findUp.stop");e.exports=async(e,t={})=>{let r=s.resolve(t.cwd||"");const{root:c}=s.parse(r);const o=[].concat(e);const runMatcher=async t=>{if(typeof e!=="function"){return n(o,t)}const r=await e(t.cwd);if(typeof r==="string"){return n([r],t)}return r};while(true){const e=await runMatcher({...t,cwd:r});if(e===i){return}if(e){return s.resolve(r,e)}if(r===c){return}r=s.dirname(r)}};e.exports.sync=(e,t={})=>{let r=s.resolve(t.cwd||"");const{root:c}=s.parse(r);const o=[].concat(e);const runMatcher=t=>{if(typeof e!=="function"){return n.sync(o,t)}const r=e(t.cwd);if(typeof r==="string"){return n.sync([r],t)}return r};while(true){const e=runMatcher({...t,cwd:r});if(e===i){return}if(e){return s.resolve(r,e)}if(r===c){return}r=s.dirname(r)}};e.exports.exists=c;e.exports.sync.exists=c.sync;e.exports.stop=i},417:(e,t,r)=>{"use strict";const s=r(17);const n=r(147);const{promisify:c}=r(837);const i=r(721);const o=c(n.stat);const a=c(n.lstat);const u={directory:"isDirectory",file:"isFile"};function checkType({type:e}){if(e in u){return}throw new Error(`Invalid type specified: ${e}`)}const matchType=(e,t)=>e===undefined||t[u[e]]();e.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:true,...t};checkType(t);const r=t.allowSymlinks?o:a;return i(e,(async e=>{try{const n=await r(s.resolve(t.cwd,e));return matchType(t.type,n)}catch{return false}}),t)};e.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:true,type:"file",...t};checkType(t);const r=t.allowSymlinks?n.statSync:n.lstatSync;for(const n of e){try{const e=r(s.resolve(t.cwd,n));if(matchType(t.type,e)){return n}}catch{}}}},629:(e,t,r)=>{"use strict";const s=r(301);const pLimit=e=>{if(!((Number.isInteger(e)||e===Infinity)&&e>0)){throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const t=new s;let r=0;const next=()=>{r--;if(t.size>0){t.dequeue()()}};const run=async(e,t,...s)=>{r++;const n=(async()=>e(...s))();t(n);try{await n}catch{}next()};const enqueue=(s,n,...c)=>{t.enqueue(run.bind(null,s,n,...c));(async()=>{await Promise.resolve();if(r<e&&t.size>0){t.dequeue()()}})()};const generator=(e,...t)=>new Promise((r=>{enqueue(e,r,...t)}));Object.defineProperties(generator,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}});return generator};e.exports=pLimit},721:(e,t,r)=>{"use strict";const s=r(629);class EndError extends Error{constructor(e){super();this.value=e}}const testElement=async(e,t)=>t(await e);const finder=async e=>{const t=await Promise.all(e);if(t[1]===true){throw new EndError(t[0])}return false};const pLocate=async(e,t,r)=>{r={concurrency:Infinity,preserveOrder:true,...r};const n=s(r.concurrency);const c=[...e].map((e=>[e,n(testElement,e,t)]));const i=s(r.preserveOrder?1:Infinity);try{await Promise.all(c.map((e=>i(finder,e))))}catch(e){if(e instanceof EndError){return e.value}throw e}};e.exports=pLocate},896:(e,t,r)=>{"use strict";const s=r(147);const{promisify:n}=r(837);const c=n(s.access);e.exports=async e=>{try{await c(e);return true}catch(e){return false}};e.exports.sync=e=>{try{s.accessSync(e);return true}catch(e){return false}}},301:e=>{class Node{constructor(e){this.value=e;this.next=undefined}}class Queue{constructor(){this.clear()}enqueue(e){const t=new Node(e);if(this._head){this._tail.next=t;this._tail=t}else{this._head=t;this._tail=t}this._size++}dequeue(){const e=this._head;if(!e){return}this._head=this._head.next;this._size--;return e.value}clear(){this._head=undefined;this._tail=undefined;this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;while(e){yield e.value;e=e.next}}}e.exports=Queue},147:e=>{"use strict";e.exports=require("fs")},17:e=>{"use strict";e.exports=require("path")},837:e=>{"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(r){var s=t[r];if(s!==undefined){return s.exports}var n=t[r]={exports:{}};var c=true;try{e[r](n,n.exports,__nccwpck_require__);c=false}finally{if(c)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(586);module.exports=r})();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare namespace locatePath {
|
|
2
|
+
interface Options {
|
|
3
|
+
/**
|
|
4
|
+
Current working directory.
|
|
5
|
+
|
|
6
|
+
@default process.cwd()
|
|
7
|
+
*/
|
|
8
|
+
readonly cwd?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
Type of path to match.
|
|
12
|
+
|
|
13
|
+
@default 'file'
|
|
14
|
+
*/
|
|
15
|
+
readonly type?: 'file' | 'directory';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
Allow symbolic links to match if they point to the requested path type.
|
|
19
|
+
|
|
20
|
+
@default true
|
|
21
|
+
*/
|
|
22
|
+
readonly allowSymlinks?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface AsyncOptions extends Options {
|
|
26
|
+
/**
|
|
27
|
+
Number of concurrently pending promises. Minimum: `1`.
|
|
28
|
+
|
|
29
|
+
@default Infinity
|
|
30
|
+
*/
|
|
31
|
+
readonly concurrency?: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
Preserve `paths` order when searching.
|
|
35
|
+
|
|
36
|
+
Disable this to improve performance if you don't care about the order.
|
|
37
|
+
|
|
38
|
+
@default true
|
|
39
|
+
*/
|
|
40
|
+
readonly preserveOrder?: boolean;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const locatePath: {
|
|
45
|
+
/**
|
|
46
|
+
Synchronously get the first path that exists on disk of multiple paths.
|
|
47
|
+
|
|
48
|
+
@param paths - Paths to check.
|
|
49
|
+
@returns The first path that exists or `undefined` if none exists.
|
|
50
|
+
*/
|
|
51
|
+
sync: (
|
|
52
|
+
paths: Iterable<string>,
|
|
53
|
+
options?: locatePath.Options
|
|
54
|
+
) => string | undefined;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
Get the first path that exists on disk of multiple paths.
|
|
58
|
+
|
|
59
|
+
@param paths - Paths to check.
|
|
60
|
+
@returns The first path that exists or `undefined` if none exists.
|
|
61
|
+
|
|
62
|
+
@example
|
|
63
|
+
```
|
|
64
|
+
import locatePath = require('../locate-path');
|
|
65
|
+
|
|
66
|
+
const files = [
|
|
67
|
+
'unicorn.png',
|
|
68
|
+
'rainbow.png', // Only this one actually exists on disk
|
|
69
|
+
'pony.png'
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
(async () => {
|
|
73
|
+
console(await locatePath(files));
|
|
74
|
+
//=> 'rainbow'
|
|
75
|
+
})();
|
|
76
|
+
```
|
|
77
|
+
*/
|
|
78
|
+
(paths: Iterable<string>, options?: locatePath.AsyncOptions): Promise<
|
|
79
|
+
string | undefined
|
|
80
|
+
>;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export = locatePath;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"find-up","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"version":"5.0.0","funding":"https://github.com/sponsors/sindresorhus","license":"MIT"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// Type definitions for LESS 3.x
|
|
2
|
+
// Project: http://lesscss.org/
|
|
3
|
+
// Definitions by: Tom Hasner <https://github.com/thasner>
|
|
4
|
+
// Pranay Prakash <https://github.com/pranaygp>
|
|
5
|
+
// Daniel Waxweiler <https://github.com/dwaxweiler>
|
|
6
|
+
// Richard Lea <https://github.com/chigix>
|
|
7
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
8
|
+
|
|
9
|
+
declare namespace Less {
|
|
10
|
+
// https://github.com/less/less.js/blob/master/lib/less/import-manager.js#L10
|
|
11
|
+
interface RootFileInfo {
|
|
12
|
+
/** whether to adjust URL's to be relative */
|
|
13
|
+
rewriteUrls?: boolean | undefined;
|
|
14
|
+
/** full resolved filename of current file */
|
|
15
|
+
filename: string;
|
|
16
|
+
relativeUrls: boolean;
|
|
17
|
+
/** path to append to normal URLs for this node */
|
|
18
|
+
rootpath: string;
|
|
19
|
+
/** path to the current file, absolute */
|
|
20
|
+
currentDirectory: string;
|
|
21
|
+
/** absolute path to the entry file */
|
|
22
|
+
entryPath: string;
|
|
23
|
+
/** filename of the base file */
|
|
24
|
+
rootFilename: string;
|
|
25
|
+
/** whether the file should not be output and only output parts that are referenced */
|
|
26
|
+
reference: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
class PluginManager {
|
|
30
|
+
constructor(less: LessStatic);
|
|
31
|
+
|
|
32
|
+
addPreProcessor(preProcessor: PreProcessor, priority?: number): void;
|
|
33
|
+
|
|
34
|
+
addFileManager(fileManager: FileManager): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface Plugin {
|
|
38
|
+
install: (less: LessStatic, pluginManager: PluginManager) => void;
|
|
39
|
+
minVersion?: [number, number, number] | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface PreProcessor {
|
|
43
|
+
process: (src: string, extra: PreProcessorExtraInfo) => string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface PreProcessorExtraInfo {
|
|
47
|
+
context: {
|
|
48
|
+
pluginManager: PluginManager;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
fileInfo: RootFileInfo;
|
|
52
|
+
|
|
53
|
+
imports: {
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface FileLoadResult {
|
|
59
|
+
/** Full resolved path to file. */
|
|
60
|
+
filename: string;
|
|
61
|
+
|
|
62
|
+
/** The contents of the file, as a string. */
|
|
63
|
+
contents: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface FileLoadError {
|
|
67
|
+
/** Error object if an error occurs. */
|
|
68
|
+
error: unknown;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
class FileManager extends AbstractFileManager {
|
|
72
|
+
/**
|
|
73
|
+
* Returns whether this file manager supports this file for file retrieval
|
|
74
|
+
* If true is returned, loadFile will then be called with the file.
|
|
75
|
+
*/
|
|
76
|
+
supports(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Loads a file asynchronously. Expects a promise that either rejects with an error or fulfills with a FileLoadResult.
|
|
80
|
+
*/
|
|
81
|
+
loadFile(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): Promise<FileLoadResult>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Loads a file synchronously. Expects an immediate return with wither a FileLoadResult or FileLoadError.
|
|
85
|
+
*/
|
|
86
|
+
loadFileSync(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): FileLoadResult | FileLoadError;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
class AbstractFileManager {
|
|
90
|
+
/**
|
|
91
|
+
* Given the full path to a file, return the path component.
|
|
92
|
+
*/
|
|
93
|
+
getPath(filename: string): string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Append a .less extension if appropriate. Only called if less thinks one could be added.
|
|
97
|
+
*/
|
|
98
|
+
tryAppendLessExtension(filename: string): string;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Whether the rootpath should be converted to be absolute.
|
|
102
|
+
* The browser ovverides this to return true because urls must be absolute.
|
|
103
|
+
*/
|
|
104
|
+
alwaysMakePathsAbsolute(): boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Returns whether a path is absolute.
|
|
108
|
+
*/
|
|
109
|
+
isPathAbsolute(path: string): boolean;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Joins together 2 paths.
|
|
113
|
+
*/
|
|
114
|
+
join(basePath: string, laterPath: string): string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns the difference between 2 paths
|
|
118
|
+
* E.g. url = a/ baseUrl = a/b/ returns ../
|
|
119
|
+
* url = a/b/ baseUrl = a/ returns b/
|
|
120
|
+
*/
|
|
121
|
+
pathDiff(url: string, baseUrl: string): string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Returns whether this file manager supports this file for syncronous file retrieval
|
|
125
|
+
* If true is returned, loadFileSync will then be called with the file.
|
|
126
|
+
*/
|
|
127
|
+
supportsSync(filename: string, currentDirectory: string, options: LoadFileOptions, environment: Environment): boolean;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface LoadFileOptions {
|
|
131
|
+
paths?: string[] | undefined;
|
|
132
|
+
prefixes?: string[] | undefined;
|
|
133
|
+
ext?: string | undefined;
|
|
134
|
+
rawBuffer?: any;
|
|
135
|
+
syncImport?: boolean | undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
interface Environment {
|
|
139
|
+
/**
|
|
140
|
+
* Converts a string to a base 64 string
|
|
141
|
+
*/
|
|
142
|
+
encodeBase64(str: string): string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Lookup the mime-type of a filename
|
|
146
|
+
*/
|
|
147
|
+
mimeLookup(filename: string): string;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Look up the charset of a mime type
|
|
151
|
+
*/
|
|
152
|
+
charsetLookup(mime: string): string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Gets a source map generator
|
|
156
|
+
*/
|
|
157
|
+
getSourceMapGenerator(): any;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface SourceMapOption {
|
|
161
|
+
sourceMapURL?: string | undefined;
|
|
162
|
+
sourceMapBasepath?: string | undefined;
|
|
163
|
+
sourceMapRootpath?: string | undefined;
|
|
164
|
+
outputSourceFiles?: boolean | undefined;
|
|
165
|
+
sourceMapFileInline?: boolean | undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface StaticOptions {
|
|
169
|
+
async: boolean;
|
|
170
|
+
fileAsync: boolean;
|
|
171
|
+
modifyVars: { [variable: string]: string };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface ImportManager {
|
|
175
|
+
contents: { [fileName: string]: string };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Reference to:
|
|
180
|
+
* * https://github.com/less/less.js/blob/master/bin/lessc
|
|
181
|
+
* * http://lesscss.org/usage/#less-options
|
|
182
|
+
*
|
|
183
|
+
* @interface Options
|
|
184
|
+
*/
|
|
185
|
+
interface Options {
|
|
186
|
+
sourceMap?: SourceMapOption | undefined;
|
|
187
|
+
/** Filename of the main file to be passed to less.render() */
|
|
188
|
+
filename?: string | undefined;
|
|
189
|
+
/** The locations for less looking for files in @import rules */
|
|
190
|
+
paths?: string[] | undefined;
|
|
191
|
+
/** True, if run the less parser and just reports errors without any output. */
|
|
192
|
+
lint?: boolean | undefined;
|
|
193
|
+
/** Pre-load global Less.js plugins */
|
|
194
|
+
plugins?: Plugin[] | undefined;
|
|
195
|
+
/** @deprecated If true, compress using less built-in compression. */
|
|
196
|
+
compress?: boolean | undefined;
|
|
197
|
+
strictImports?: boolean | undefined;
|
|
198
|
+
/** If true, allow imports from insecure https hosts. */
|
|
199
|
+
insecure?: boolean | undefined;
|
|
200
|
+
depends?: boolean | undefined;
|
|
201
|
+
maxLineLen?: number | undefined;
|
|
202
|
+
/** @deprecated If false, No color in compiling. */
|
|
203
|
+
color?: boolean | undefined;
|
|
204
|
+
/** @deprecated False by default. */
|
|
205
|
+
ieCompat?: boolean | undefined;
|
|
206
|
+
/** @deprecated If true, enable evaluation of JavaScript inline in `.less` files. */
|
|
207
|
+
javascriptEnabled?: boolean | undefined;
|
|
208
|
+
/** Whether output file information and line numbers in compiled CSS code. */
|
|
209
|
+
dumpLineNumbers?: "comment" | string | undefined;
|
|
210
|
+
/** Add a path to every generated import and url in output css files. */
|
|
211
|
+
rootpath?: string | undefined;
|
|
212
|
+
/** Math mode options for avoiding symbol conficts on math expressions. */
|
|
213
|
+
math?: 'always' | 'strict' | 'parens-division' | 'parens' | 'strict-legacy' | number | undefined;
|
|
214
|
+
/** If true, stops any warnings from being shown. */
|
|
215
|
+
silent?: boolean | undefined;
|
|
216
|
+
/** Without this option, Less attempts to guess at the output unit when it does maths. */
|
|
217
|
+
strictUnits?: boolean | undefined;
|
|
218
|
+
/** Defines a variable that can be referenced by the file. */
|
|
219
|
+
globalVars?: {
|
|
220
|
+
[key: string] : string,
|
|
221
|
+
} | undefined;
|
|
222
|
+
/** Puts Var declaration at the end of base file. */
|
|
223
|
+
modifyVars?: {
|
|
224
|
+
[key: string] : string,
|
|
225
|
+
} | undefined;
|
|
226
|
+
/** Read files synchronously in Node.js */
|
|
227
|
+
syncImport?: boolean | undefined;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface RenderError {
|
|
231
|
+
column: number;
|
|
232
|
+
extract: string[];
|
|
233
|
+
filename: string;
|
|
234
|
+
index: number;
|
|
235
|
+
line: number;
|
|
236
|
+
message: string;
|
|
237
|
+
type: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface RenderOutput {
|
|
241
|
+
css: string;
|
|
242
|
+
map: string;
|
|
243
|
+
imports: string[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface RefreshOutput {
|
|
247
|
+
endTime: Date;
|
|
248
|
+
startTime: Date;
|
|
249
|
+
sheets: number;
|
|
250
|
+
totalMilliseconds: number;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
interface LessStatic {
|
|
255
|
+
options: Less.StaticOptions;
|
|
256
|
+
|
|
257
|
+
importManager?: Less.ImportManager | undefined;
|
|
258
|
+
sheets: HTMLLinkElement[];
|
|
259
|
+
|
|
260
|
+
modifyVars(vars: { [name: string]: string }): Promise<Less.RefreshOutput>;
|
|
261
|
+
|
|
262
|
+
refreshStyles(): void;
|
|
263
|
+
|
|
264
|
+
render(input: string, callback: (error: Less.RenderError, output: Less.RenderOutput | undefined) => void): void;
|
|
265
|
+
render(input: string, options: Less.Options, callback: (error: Less.RenderError, output: Less.RenderOutput | undefined) => void): void;
|
|
266
|
+
|
|
267
|
+
render(input: string): Promise<Less.RenderOutput>;
|
|
268
|
+
render(input: string, options: Less.Options): Promise<Less.RenderOutput>;
|
|
269
|
+
|
|
270
|
+
refresh(reload?: boolean, modifyVars?: { [variable: string]: string }, clearFileCache?: boolean): Promise<Less.RefreshOutput>;
|
|
271
|
+
|
|
272
|
+
version: number[];
|
|
273
|
+
|
|
274
|
+
watch(): void;
|
|
275
|
+
|
|
276
|
+
FileManager: typeof Less.FileManager;
|
|
277
|
+
PluginManager: typeof Less.PluginManager;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export = Less;
|
|
281
|
+
|
|
282
|
+
declare var less: LessStatic;
|