@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,173 @@
|
|
|
1
|
+
import {List, ValueObject} from 'immutable';
|
|
2
|
+
|
|
3
|
+
import {SassBoolean} from './boolean';
|
|
4
|
+
import {SassColor} from './color';
|
|
5
|
+
import {SassFunction} from './function';
|
|
6
|
+
import {ListSeparator} from './list';
|
|
7
|
+
import {SassMap} from './map';
|
|
8
|
+
import {SassNumber} from './number';
|
|
9
|
+
import {SassString} from './string';
|
|
10
|
+
|
|
11
|
+
export {SassArgumentList} from './argument_list';
|
|
12
|
+
export {SassBoolean, sassTrue, sassFalse} from './boolean';
|
|
13
|
+
export {SassColor} from './color';
|
|
14
|
+
export {SassFunction} from './function';
|
|
15
|
+
export {SassList, ListSeparator} from './list';
|
|
16
|
+
export {SassMap} from './map';
|
|
17
|
+
export {SassNumber} from './number';
|
|
18
|
+
export {SassString} from './string';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Sass's [`null` value](https://sass-lang.com/documentation/values/null).
|
|
22
|
+
*
|
|
23
|
+
* @category Custom Function
|
|
24
|
+
*/
|
|
25
|
+
export const sassNull: Value;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The abstract base class of Sass's value types.
|
|
29
|
+
*
|
|
30
|
+
* This is passed to and returned by [[CustomFunction]]s, which are passed into
|
|
31
|
+
* the Sass implementation using [[Options.functions]].
|
|
32
|
+
*
|
|
33
|
+
* @category Custom Function
|
|
34
|
+
*/
|
|
35
|
+
export abstract class Value implements ValueObject {
|
|
36
|
+
protected constructor();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* This value as a list.
|
|
40
|
+
*
|
|
41
|
+
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
|
42
|
+
* and all other values count as single-value lists.
|
|
43
|
+
*
|
|
44
|
+
* @returns An immutable [[List]] from the [`immutable`
|
|
45
|
+
* package](https://immutable-js.com/).
|
|
46
|
+
*/
|
|
47
|
+
get asList(): List<Value>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Whether this value as a list has brackets.
|
|
51
|
+
*
|
|
52
|
+
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
|
53
|
+
* and all other values count as single-value lists.
|
|
54
|
+
*/
|
|
55
|
+
get hasBrackets(): boolean;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Whether the value counts as `true` in an `@if` statement and other
|
|
59
|
+
* contexts.
|
|
60
|
+
*/
|
|
61
|
+
get isTruthy(): boolean;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns JavaScript's `null` value if this is [[sassNull]], and returns
|
|
65
|
+
* `this` otherwise.
|
|
66
|
+
*/
|
|
67
|
+
get realNull(): null | Value;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The separator for this value as a list.
|
|
71
|
+
*
|
|
72
|
+
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
|
73
|
+
* and all other values count as single-value lists.
|
|
74
|
+
*/
|
|
75
|
+
get separator(): ListSeparator;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Converts `sassIndex` into a JavaScript-style index into the list returned
|
|
79
|
+
* by [[asList]].
|
|
80
|
+
*
|
|
81
|
+
* Sass indexes are one-based, while JavaScript indexes are zero-based. Sass
|
|
82
|
+
* indexes may also be negative in order to index from the end of the list.
|
|
83
|
+
*
|
|
84
|
+
* @param sassIndex - The Sass-style index into this as a list.
|
|
85
|
+
* @param name - The name of the function argument `sassIndex` came from
|
|
86
|
+
* (without the `$`) if it came from an argument. Used for error reporting.
|
|
87
|
+
* @throws `Error` If `sassIndex` isn't a number, if that number isn't an
|
|
88
|
+
* integer, or if that integer isn't a valid index for [[asList]].
|
|
89
|
+
*/
|
|
90
|
+
sassIndexToListIndex(sassIndex: Value, name?: string): number;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Returns the value at index `index` in this value as a list, or `undefined`
|
|
94
|
+
* if `index` isn't valid for this list.
|
|
95
|
+
*
|
|
96
|
+
* All SassScript values can be used as lists. Maps count as lists of pairs,
|
|
97
|
+
* and all other values count as single-value lists.
|
|
98
|
+
*
|
|
99
|
+
* This is a shorthand for `this.asList.get(index)`, although it may be more
|
|
100
|
+
* efficient in some cases.
|
|
101
|
+
*
|
|
102
|
+
* **Heads up!** This method uses the same indexing conventions as the
|
|
103
|
+
* `immutable` package: unlike Sass the index of the first element is 0, but
|
|
104
|
+
* like Sass negative numbers index from the end of the list.
|
|
105
|
+
*/
|
|
106
|
+
get(index: number): Value | undefined;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Throws if `this` isn't a [[SassBoolean]].
|
|
110
|
+
*
|
|
111
|
+
* **Heads up!** Functions should generally use [[isTruthy]] rather than
|
|
112
|
+
* requiring a literal boolean.
|
|
113
|
+
*
|
|
114
|
+
* @param name - The name of the function argument `this` came from (without
|
|
115
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
116
|
+
*/
|
|
117
|
+
assertBoolean(name?: string): SassBoolean;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Throws if `this` isn't a [[SassColor]].
|
|
121
|
+
*
|
|
122
|
+
* @param name - The name of the function argument `this` came from (without
|
|
123
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
124
|
+
*/
|
|
125
|
+
assertColor(name?: string): SassColor;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Throws if `this` isn't a [[SassFunction]].
|
|
129
|
+
*
|
|
130
|
+
* @param name - The name of the function argument `this` came from (without
|
|
131
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
132
|
+
*/
|
|
133
|
+
assertFunction(name?: string): SassFunction;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Throws if `this` isn't a [[SassMap]].
|
|
137
|
+
*
|
|
138
|
+
* @param name - The name of the function argument `this` came from (without
|
|
139
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
140
|
+
*/
|
|
141
|
+
assertMap(name?: string): SassMap;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Throws if `this` isn't a [[SassNumber]].
|
|
145
|
+
*
|
|
146
|
+
* @param name - The name of the function argument `this` came from (without
|
|
147
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
148
|
+
*/
|
|
149
|
+
assertNumber(name?: string): SassNumber;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Throws if `this` isn't a [[SassString]].
|
|
153
|
+
*
|
|
154
|
+
* @param name - The name of the function argument `this` came from (without
|
|
155
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
156
|
+
*/
|
|
157
|
+
assertString(name?: string): SassString;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Returns `this` as a map if it counts as one (empty lists count as empty
|
|
161
|
+
* maps) or `null` if it doesn't.
|
|
162
|
+
*/
|
|
163
|
+
tryMap(): SassMap | null;
|
|
164
|
+
|
|
165
|
+
/** Returns whether `this` represents the same value as `other`. */
|
|
166
|
+
equals(other: Value): boolean;
|
|
167
|
+
|
|
168
|
+
/** Returns a hash code that can be used to store `this` in a hash map. */
|
|
169
|
+
hashCode(): number;
|
|
170
|
+
|
|
171
|
+
/** @hidden */
|
|
172
|
+
toString(): string;
|
|
173
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {List} from 'immutable';
|
|
2
|
+
|
|
3
|
+
import {Value} from './index';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Possible separators used by Sass lists. The special separator `null` is only
|
|
7
|
+
* used for lists with fewer than two elements, and indicates that the separator
|
|
8
|
+
* has not yet been decided for this list.
|
|
9
|
+
*
|
|
10
|
+
* @category Custom Function
|
|
11
|
+
*/
|
|
12
|
+
export type ListSeparator = ',' | '/' | ' ' | null;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Sass's [list type](https://sass-lang.com/documentation/values/lists).
|
|
16
|
+
*
|
|
17
|
+
* @category Custom Function
|
|
18
|
+
*/
|
|
19
|
+
export class SassList extends Value {
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new list.
|
|
22
|
+
*
|
|
23
|
+
* @param contents - The contents of the list. This may be either a plain
|
|
24
|
+
* JavaScript array or an immutable [[List]] from the [`immutable`
|
|
25
|
+
* package](https://immutable-js.com/).
|
|
26
|
+
*
|
|
27
|
+
* @param options.separator - The separator to use between elements of this
|
|
28
|
+
* list. Defaults to `','`.
|
|
29
|
+
*
|
|
30
|
+
* @param options.brackets - Whether the list has square brackets. Defaults to
|
|
31
|
+
* `false`.
|
|
32
|
+
*/
|
|
33
|
+
constructor(
|
|
34
|
+
contents: Value[] | List<Value>,
|
|
35
|
+
options?: {
|
|
36
|
+
separator?: ListSeparator;
|
|
37
|
+
brackets?: boolean;
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Creates an empty list.
|
|
43
|
+
*
|
|
44
|
+
* @param options.separator - The separator to use between elements of this
|
|
45
|
+
* list. Defaults to `','`.
|
|
46
|
+
*
|
|
47
|
+
* @param options.brackets - Whether the list has square brackets. Defaults to
|
|
48
|
+
* `false`.
|
|
49
|
+
*/
|
|
50
|
+
constructor(options?: {separator?: ListSeparator; brackets?: boolean});
|
|
51
|
+
|
|
52
|
+
/** @hidden */
|
|
53
|
+
get separator(): ListSeparator;
|
|
54
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {OrderedMap} from 'immutable';
|
|
2
|
+
|
|
3
|
+
import {SassList} from './list';
|
|
4
|
+
import {Value} from './index';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Sass's [map type](https://sass-lang.com/documentation/values/maps).
|
|
8
|
+
*
|
|
9
|
+
* @category Custom Function
|
|
10
|
+
*/
|
|
11
|
+
export class SassMap extends Value {
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new map.
|
|
14
|
+
*
|
|
15
|
+
* @param contents - The contents of the map. This is an immutable
|
|
16
|
+
* [[OrderedMap]] from the [`immutable` package](https://immutable-js.com/).
|
|
17
|
+
* Defaults to an empty map.
|
|
18
|
+
*/
|
|
19
|
+
constructor(contents?: OrderedMap<Value, Value>);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns the contents of this map as an immutable [[OrderedMap]] from the
|
|
23
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
24
|
+
*/
|
|
25
|
+
get contents(): OrderedMap<Value, Value>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns the value associated with `key` in this map, or `undefined` if
|
|
29
|
+
* `key` isn't in the map.
|
|
30
|
+
*
|
|
31
|
+
* This is a shorthand for `this.contents.get(key)`, although it may be more
|
|
32
|
+
* efficient in some cases.
|
|
33
|
+
*/
|
|
34
|
+
get(key: Value): Value | undefined;
|
|
35
|
+
|
|
36
|
+
/** Inherited from [[Value.get]]. */
|
|
37
|
+
get(index: number): SassList | undefined;
|
|
38
|
+
|
|
39
|
+
/** @hidden */
|
|
40
|
+
tryMap(): SassMap;
|
|
41
|
+
}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import {List} from 'immutable';
|
|
2
|
+
|
|
3
|
+
import {Value} from './index';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sass's [number type](https://sass-lang.com/documentation/values/numbers).
|
|
7
|
+
*
|
|
8
|
+
* @category Custom Function
|
|
9
|
+
*/
|
|
10
|
+
export class SassNumber extends Value {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new number with more complex units than just a single numerator.
|
|
13
|
+
*
|
|
14
|
+
* Upon construction, any compatible numerator and denominator units are
|
|
15
|
+
* simplified away according to the conversion factor between them.
|
|
16
|
+
*
|
|
17
|
+
* @param value - The number's numeric value.
|
|
18
|
+
*
|
|
19
|
+
* @param unit - If this is a string, it's used as the single numerator unit
|
|
20
|
+
* for the number.
|
|
21
|
+
*
|
|
22
|
+
* @param unit.numeratorUnits - If passed, these are the numerator units to
|
|
23
|
+
* use for the number. This may be either a plain JavaScript array or an
|
|
24
|
+
* immutable [[List]] from the [`immutable`
|
|
25
|
+
* package](https://immutable-js.com/).
|
|
26
|
+
*
|
|
27
|
+
* @param unit.denominatorUnits - If passed, these are the denominator units
|
|
28
|
+
* to use for the number. This may be either a plain JavaScript array or an
|
|
29
|
+
* immutable [[List]] from the [`immutable`
|
|
30
|
+
* package](https://immutable-js.com/).
|
|
31
|
+
*/
|
|
32
|
+
constructor(
|
|
33
|
+
value: number,
|
|
34
|
+
unit?:
|
|
35
|
+
| string
|
|
36
|
+
| {
|
|
37
|
+
numeratorUnits?: string[] | List<string>;
|
|
38
|
+
denominatorUnits?: string[] | List<string>;
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
/** This number's numeric value. */
|
|
43
|
+
get value(): number;
|
|
44
|
+
|
|
45
|
+
/** Whether [[value]] is an integer according to Sass's equality logic. */
|
|
46
|
+
get isInt(): boolean;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* If [[value]] is an integer according to [[isInt]], returns [[value]]
|
|
50
|
+
* rounded to that integer. If it's not an integer, returns `null`.
|
|
51
|
+
*/
|
|
52
|
+
get asInt(): number | null;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* This number's numerator units as an immutable [[List]] from the
|
|
56
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
57
|
+
*/
|
|
58
|
+
get numeratorUnits(): List<string>;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* This number's denominator units as an immutable [[List]] from the
|
|
62
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
63
|
+
*/
|
|
64
|
+
get denominatorUnits(): List<string>;
|
|
65
|
+
|
|
66
|
+
/** Whether this number has any numerator or denominator units. */
|
|
67
|
+
get hasUnits(): boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* If [[value]] is an integer according to [[isInt]], returns it rounded to
|
|
71
|
+
* that integer. Otherwise, throws an error.
|
|
72
|
+
*
|
|
73
|
+
* @param name - The name of the function argument `this` came from (without
|
|
74
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
75
|
+
*/
|
|
76
|
+
assertInt(name?: string): number;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Returns [[value]] if it's within `min` and `max`. If [[value]] is equal to
|
|
80
|
+
* `min` or `max` according to Sass's equality, returns `min` or `max`
|
|
81
|
+
* respectively. Otherwise, throws an error.
|
|
82
|
+
*
|
|
83
|
+
* @param name - The name of the function argument `this` came from (without
|
|
84
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
85
|
+
*/
|
|
86
|
+
assertInRange(min: number, max: number, name?: string): number;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* If this number has no units, returns it. Otherwise, throws an error.
|
|
90
|
+
*
|
|
91
|
+
* @param name - The name of the function argument `this` came from (without
|
|
92
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
93
|
+
*/
|
|
94
|
+
assertNoUnits(name?: string): SassNumber;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* If this number has `unit` as its only unit (and as a numerator), returns
|
|
98
|
+
* this number. Otherwise, throws an error.
|
|
99
|
+
*
|
|
100
|
+
* @param name - The name of the function argument `this` came from (without
|
|
101
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
102
|
+
*/
|
|
103
|
+
assertUnit(unit: string, name?: string): SassNumber;
|
|
104
|
+
|
|
105
|
+
/** Whether this number has `unit` as its only unit (and as a numerator). */
|
|
106
|
+
hasUnit(unit: string): boolean;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Whether this has exactly one numerator unit, and that unit is compatible
|
|
110
|
+
* with `unit`.
|
|
111
|
+
*/
|
|
112
|
+
compatibleWithUnit(unit: string): boolean;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Returns a copy of this number, converted to the units represented by
|
|
116
|
+
* `newNumerators` and `newDenominators`.
|
|
117
|
+
*
|
|
118
|
+
* @throws `Error` if this number's units are incompatible with
|
|
119
|
+
* `newNumerators` and `newDenominators`; or if this number is unitless and
|
|
120
|
+
* either `newNumerators` or `newDenominators` are not empty, or vice-versa.
|
|
121
|
+
*
|
|
122
|
+
* @param newNumerators - The numerator units to convert this number to. This
|
|
123
|
+
* may be either a plain JavaScript array or an immutable [[List]] from the
|
|
124
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
125
|
+
*
|
|
126
|
+
* @param newDenominators - The denominator units to convert this number to.
|
|
127
|
+
* This may be either a plain JavaScript array or an immutable [[List]] from
|
|
128
|
+
* the [`immutable` package](https://immutable-js.com/).
|
|
129
|
+
*
|
|
130
|
+
* @param name - The name of the function argument `this` came from (without
|
|
131
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
132
|
+
*/
|
|
133
|
+
convert(
|
|
134
|
+
newNumerators: string[] | List<string>,
|
|
135
|
+
newDenominators: string[] | List<string>,
|
|
136
|
+
name?: string
|
|
137
|
+
): SassNumber;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Returns a copy of this number, converted to the same units as `other`.
|
|
141
|
+
*
|
|
142
|
+
* @throws `Error` if this number's units are incompatible with `other`'s
|
|
143
|
+
* units, or if either number is unitless but the other is not.
|
|
144
|
+
*
|
|
145
|
+
* @param name - The name of the function argument `this` came from (without
|
|
146
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
147
|
+
*
|
|
148
|
+
* @param otherName - The name of the function argument `other` came from
|
|
149
|
+
* (without the `$`) if it came from an argument. Used for error reporting.
|
|
150
|
+
*/
|
|
151
|
+
convertToMatch(
|
|
152
|
+
other: SassNumber,
|
|
153
|
+
name?: string,
|
|
154
|
+
otherName?: string
|
|
155
|
+
): SassNumber;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Returns [[value]], converted to the units represented by `newNumerators`
|
|
159
|
+
* and `newDenominators`.
|
|
160
|
+
*
|
|
161
|
+
* @throws `Error` if this number's units are incompatible with
|
|
162
|
+
* `newNumerators` and `newDenominators`; or if this number is unitless and
|
|
163
|
+
* either `newNumerators` or `newDenominators` are not empty, or vice-versa.
|
|
164
|
+
*
|
|
165
|
+
* @param newNumerators - The numerator units to convert [[value]] to. This
|
|
166
|
+
* may be either a plain JavaScript array or an immutable [[List]] from the
|
|
167
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
168
|
+
*
|
|
169
|
+
* @param newDenominators - The denominator units to convert [[value]] to.
|
|
170
|
+
* This may be either a plain JavaScript array or an immutable [[List]] from
|
|
171
|
+
* the [`immutable` package](https://immutable-js.com/).
|
|
172
|
+
*
|
|
173
|
+
* @param name - The name of the function argument `this` came from (without
|
|
174
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
175
|
+
*/
|
|
176
|
+
convertValue(
|
|
177
|
+
newNumerators: string[] | List<string>,
|
|
178
|
+
newDenominators: string[] | List<string>,
|
|
179
|
+
name?: string
|
|
180
|
+
): number;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns [[value]], converted to the same units as `other`.
|
|
184
|
+
*
|
|
185
|
+
* @throws `Error` if this number's units are incompatible with `other`'s
|
|
186
|
+
* units, or if either number is unitless but the other is not.
|
|
187
|
+
*
|
|
188
|
+
* @param name - The name of the function argument `this` came from (without
|
|
189
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
190
|
+
*
|
|
191
|
+
* @param otherName - The name of the function argument `other` came from
|
|
192
|
+
* (without the `$`) if it came from an argument. Used for error reporting.
|
|
193
|
+
*/
|
|
194
|
+
convertValueToMatch(
|
|
195
|
+
other: SassNumber,
|
|
196
|
+
name?: string,
|
|
197
|
+
otherName?: string
|
|
198
|
+
): number;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Returns a copy of this number, converted to the units represented by
|
|
202
|
+
* `newNumerators` and `newDenominators`.
|
|
203
|
+
*
|
|
204
|
+
* Unlike [[convert]] this does *not* throw an error if this number is
|
|
205
|
+
* unitless and either `newNumerators` or `newDenominators` are not empty, or
|
|
206
|
+
* vice-versa. Instead, it treats all unitless numbers as convertible to and
|
|
207
|
+
* from all units without changing the value.
|
|
208
|
+
*
|
|
209
|
+
* @throws `Error` if this number's units are incompatible with
|
|
210
|
+
* `newNumerators` and `newDenominators`.
|
|
211
|
+
*
|
|
212
|
+
* @param newNumerators - The numerator units to convert this number to. This
|
|
213
|
+
* may be either a plain JavaScript array or an immutable [[List]] from the
|
|
214
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
215
|
+
*
|
|
216
|
+
* @param newDenominators - The denominator units to convert this number to.
|
|
217
|
+
* This may be either a plain JavaScript array or an immutable [[List]] from
|
|
218
|
+
* the [`immutable` package](https://immutable-js.com/).
|
|
219
|
+
*
|
|
220
|
+
* @param name - The name of the function argument `this` came from (without
|
|
221
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
222
|
+
*/
|
|
223
|
+
coerce(
|
|
224
|
+
newNumerators: string[] | List<string>,
|
|
225
|
+
newDenominators: string[] | List<string>,
|
|
226
|
+
name?: string
|
|
227
|
+
): SassNumber;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Returns a copy of this number, converted to the units represented by
|
|
231
|
+
* `newNumerators` and `newDenominators`.
|
|
232
|
+
*
|
|
233
|
+
* Unlike [[convertToMatch]] this does *not* throw an error if this number is
|
|
234
|
+
* unitless and either `newNumerators` or `newDenominators` are not empty, or
|
|
235
|
+
* vice-versa. Instead, it treats all unitless numbers as convertible to and
|
|
236
|
+
* from all units without changing the value.
|
|
237
|
+
*
|
|
238
|
+
* @throws `Error` if this number's units are incompatible with `other`'s
|
|
239
|
+
* units.
|
|
240
|
+
*
|
|
241
|
+
* @param name - The name of the function argument `this` came from (without
|
|
242
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
243
|
+
*
|
|
244
|
+
* @param otherName - The name of the function argument `other` came from
|
|
245
|
+
* (without the `$`) if it came from an argument. Used for error reporting.
|
|
246
|
+
*/
|
|
247
|
+
coerceToMatch(
|
|
248
|
+
other: SassNumber,
|
|
249
|
+
name?: string,
|
|
250
|
+
otherName?: string
|
|
251
|
+
): SassNumber;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Returns [[value]], converted to the units represented by `newNumerators` and
|
|
255
|
+
* `newDenominators`.
|
|
256
|
+
*
|
|
257
|
+
* Unlike [[convertValue]] this does *not* throw an error if this number is
|
|
258
|
+
* unitless and either `newNumerators` or `newDenominators` are not empty, or
|
|
259
|
+
* vice-versa. Instead, it treats all unitless numbers as convertible to and
|
|
260
|
+
* from all units without changing the value.
|
|
261
|
+
*
|
|
262
|
+
* @throws `Error` if this number's units are incompatible with
|
|
263
|
+
* `newNumerators` and `newDenominators`.
|
|
264
|
+
*
|
|
265
|
+
* @param newNumerators - The numerator units to convert [[value]] to. This
|
|
266
|
+
* may be either a plain JavaScript array or an immutable [[List]] from the
|
|
267
|
+
* [`immutable` package](https://immutable-js.com/).
|
|
268
|
+
*
|
|
269
|
+
* @param newDenominators - The denominator units to convert [[value]] to.
|
|
270
|
+
* This may be either a plain JavaScript array or an immutable [[List]] from
|
|
271
|
+
* the [`immutable` package](https://immutable-js.com/).
|
|
272
|
+
*
|
|
273
|
+
* @param name - The name of the function argument `this` came from (without
|
|
274
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
275
|
+
*/
|
|
276
|
+
coerceValue(
|
|
277
|
+
newNumerators: string[] | List<string>,
|
|
278
|
+
newDenominators: string[] | List<string>,
|
|
279
|
+
name?: string
|
|
280
|
+
): number;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Returns [[value]], converted to the units represented by `newNumerators`
|
|
284
|
+
* and `newDenominators`.
|
|
285
|
+
*
|
|
286
|
+
* Unlike [[convertValueToMatch]] this does *not* throw an error if this
|
|
287
|
+
* number is unitless and either `newNumerators` or `newDenominators` are not
|
|
288
|
+
* empty, or vice-versa. Instead, it treats all unitless numbers as
|
|
289
|
+
* convertible to and from all units without changing the value.
|
|
290
|
+
*
|
|
291
|
+
* @throws `Error` if this number's units are incompatible with `other`'s
|
|
292
|
+
* units.
|
|
293
|
+
*
|
|
294
|
+
* @param name - The name of the function argument `this` came from (without
|
|
295
|
+
* the `$`) if it came from an argument. Used for error reporting.
|
|
296
|
+
*
|
|
297
|
+
* @param otherName - The name of the function argument `other` came from
|
|
298
|
+
* (without the `$`) if it came from an argument. Used for error reporting.
|
|
299
|
+
*/
|
|
300
|
+
coerceValueToMatch(
|
|
301
|
+
other: SassNumber,
|
|
302
|
+
name?: string,
|
|
303
|
+
otherName?: string
|
|
304
|
+
): number;
|
|
305
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {Value} from './index';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sass's [string type](https://sass-lang.com/documentation/values/strings).
|
|
5
|
+
*
|
|
6
|
+
* @category Custom Function
|
|
7
|
+
*/
|
|
8
|
+
export class SassString extends Value {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new string.
|
|
11
|
+
*
|
|
12
|
+
* @param text - The contents of the string. For quoted strings, this is the
|
|
13
|
+
* semantic content—any escape sequences that were been written in the source
|
|
14
|
+
* text are resolved to their Unicode values. For unquoted strings, though,
|
|
15
|
+
* escape sequences are preserved as literal backslashes.
|
|
16
|
+
*
|
|
17
|
+
* @param options.quotes - Whether the string is quoted. Defaults to `true`.
|
|
18
|
+
*/
|
|
19
|
+
constructor(
|
|
20
|
+
text: string,
|
|
21
|
+
options?: {
|
|
22
|
+
quotes?: boolean;
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates an empty string.
|
|
28
|
+
*
|
|
29
|
+
* @param options.quotes - Whether the string is quoted. Defaults to `true`.
|
|
30
|
+
*/
|
|
31
|
+
constructor(options?: {quotes?: boolean});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The contents of the string.
|
|
35
|
+
*
|
|
36
|
+
* For quoted strings, this is the semantic content—any escape sequences that
|
|
37
|
+
* were been written in the source text are resolved to their Unicode values.
|
|
38
|
+
* For unquoted strings, though, escape sequences are preserved as literal
|
|
39
|
+
* backslashes.
|
|
40
|
+
*
|
|
41
|
+
* This difference allows us to distinguish between identifiers with escapes,
|
|
42
|
+
* such as `url\u28 http://example.com\u29`, and unquoted strings that contain
|
|
43
|
+
* characters that aren't valid in identifiers, such as
|
|
44
|
+
* `url(http://example.com)`. Unfortunately, it also means that we don't
|
|
45
|
+
* consider `foo` and `f\6F\6F` the same string.
|
|
46
|
+
*/
|
|
47
|
+
get text(): string;
|
|
48
|
+
|
|
49
|
+
/** Whether this string has quotes. */
|
|
50
|
+
get hasQuotes(): boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Sass's notion of this string's length.
|
|
54
|
+
*
|
|
55
|
+
* Sass treats strings as a series of Unicode code points while JavaScript
|
|
56
|
+
* treats them as a series of UTF-16 code units. For example, the character
|
|
57
|
+
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
|
|
58
|
+
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
|
59
|
+
* JavaScript, `"n😊b".length` returns `4`, whereas in Sass
|
|
60
|
+
* `string.length("n😊b")` returns `3`.
|
|
61
|
+
*/
|
|
62
|
+
get sassLength(): number;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Converts `sassIndex` to a JavaScript index into [[text]].
|
|
66
|
+
*
|
|
67
|
+
* Sass indices are one-based, while JavaScript indices are zero-based. Sass
|
|
68
|
+
* indices may also be negative in order to index from the end of the string.
|
|
69
|
+
*
|
|
70
|
+
* In addition, Sass indices refer to Unicode code points while JavaScript
|
|
71
|
+
* string indices refer to UTF-16 code units. For example, the character
|
|
72
|
+
* U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
|
|
73
|
+
* is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
|
|
74
|
+
* JavaScript, `"n😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
|
|
75
|
+
* `string.slice("n😊b", 1, 1)` returns `"😊"`.
|
|
76
|
+
*
|
|
77
|
+
* This function converts Sass's code point indices to JavaScript's code unit
|
|
78
|
+
* indices. This means it's O(n) in the length of `text`.
|
|
79
|
+
*
|
|
80
|
+
* @throws `Error` - If `sassIndex` isn't a number, if that number isn't an
|
|
81
|
+
* integer, or if that integer isn't a valid index for this string.
|
|
82
|
+
*/
|
|
83
|
+
sassIndexToStringIndex(sassIndex: Value, name?: string): number;
|
|
84
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Type definitions for signal-exit 3.0
|
|
2
|
+
// Project: https://github.com/tapjs/signal-exit
|
|
3
|
+
// Definitions by: BendingBender <https://github.com/BendingBender>
|
|
4
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
// TypeScript Version: 2.1
|
|
6
|
+
|
|
7
|
+
export = signalExit;
|
|
8
|
+
|
|
9
|
+
declare function signalExit(
|
|
10
|
+
callback: (code: number | null, signal: signalExit.Signal | null) => void,
|
|
11
|
+
options?: signalExit.Options
|
|
12
|
+
): () => void;
|
|
13
|
+
|
|
14
|
+
declare namespace signalExit {
|
|
15
|
+
function load(): void;
|
|
16
|
+
function unload(): void;
|
|
17
|
+
function signals(): Signal[];
|
|
18
|
+
|
|
19
|
+
type Signal = 'SIGABRT' | 'SIGALRM' | 'SIGHUP' | 'SIGINT' | 'SIGTERM' | string;
|
|
20
|
+
|
|
21
|
+
interface Options {
|
|
22
|
+
alwaysLast?: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={580:(e,t,r)=>{var i=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(i)){e.exports=function(){return function(){}}}else{var n=r(491);var o=r(357);var a=/^win/i.test(i.platform);var f=r(361);if(typeof f!=="function"){f=f.EventEmitter}var l;if(i.__signal_exit_emitter__){l=i.__signal_exit_emitter__}else{l=i.__signal_exit_emitter__=new f;l.count=0;l.emitted={}}if(!l.infinite){l.setMaxListeners(Infinity);l.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}n.equal(typeof e,"function","a callback must be provided for exit handler");if(p===false){_()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){l.removeListener(r,e);if(l.listeners("exit").length===0&&l.listeners("afterexit").length===0){s()}};l.on(r,e);return remove};var s=function unload(){if(!p||!processOk(global.process)){return}p=false;o.forEach((function(e){try{i.removeListener(e,c[e])}catch(e){}}));i.emit=d;i.reallyExit=x;l.count-=1};e.exports.unload=s;var u=function emit(e,t,r){if(l.emitted[e]){return}l.emitted[e]=true;l.emit(e,t,r)};var c={};o.forEach((function(e){c[e]=function listener(){if(!processOk(global.process)){return}var t=i.listeners(e);if(t.length===l.count){s();u("exit",null,e);u("afterexit",null,e);if(a&&e==="SIGHUP"){e="SIGINT"}i.kill(i.pid,e)}}}));e.exports.signals=function(){return o};var p=false;var _=function load(){if(p||!processOk(global.process)){return}p=true;l.count+=1;o=o.filter((function(e){try{i.on(e,c[e]);return true}catch(e){return false}}));i.emit=I;i.reallyExit=v};e.exports.load=_;var x=i.reallyExit;var v=function processReallyExit(e){if(!processOk(global.process)){return}i.exitCode=e||0;u("exit",i.exitCode,null);u("afterexit",i.exitCode,null);x.call(i,i.exitCode)};var d=i.emit;var I=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){i.exitCode=t}var r=d.apply(this,arguments);u("exit",i.exitCode,null);u("afterexit",i.exitCode,null);return r}else{return d.apply(this,arguments)}}}},357:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},491:e=>{"use strict";e.exports=require("assert")},361:e=>{"use strict";e.exports=require("events")}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={exports:{}};var o=true;try{e[r](n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(580);module.exports=r})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"signal-exit","author":"Ben Coe <ben@npmjs.com>","version":"3.0.7","license":"ISC"}
|