@ohos-ports/rspack-core 1.7.11-beta.1 → 2.2.9-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/compiled/@rspack/lite-tapable/dist/index.d.ts +190 -0
- package/compiled/@rspack/lite-tapable/license +22 -0
- package/compiled/@rspack/lite-tapable/package.json +1 -0
- package/compiled/@swc/types/index.d.ts +161 -11
- package/compiled/@swc/types/package.json +1 -1
- package/compiled/connect-next/index.d.ts +57 -0
- package/compiled/connect-next/license +26 -0
- package/compiled/connect-next/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +455 -0
- package/compiled/{browserslist-load-config → http-proxy-middleware}/license +3 -2
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/open/index.d.ts +161 -0
- package/compiled/open/package.json +1 -0
- package/compiled/tinypool/README.md +196 -2
- package/compiled/tinypool/dist/{common-Qw-RoVFD.js → common-Bo3KCGim.js} +4 -1
- package/compiled/tinypool/dist/entry/worker.js +1 -1
- package/compiled/tinypool/dist/index.d.ts +9 -4
- package/compiled/tinypool/dist/index.js +17 -53
- package/compiled/tinypool/package.json +22 -6
- package/compiled/watchpack/index.d.ts +3 -217
- package/compiled/watchpack/index.js +1778 -1091
- package/compiled/watchpack/package.json +8 -1
- package/compiled/watchpack/types/DirectoryWatcher.d.ts +335 -0
- package/compiled/watchpack/types/LinkResolver.d.ts +10 -0
- package/compiled/watchpack/types/getWatcherManager.d.ts +62 -0
- package/compiled/watchpack/types/index.d.ts +269 -0
- package/compiled/watchpack/types/reducePlan.d.ts +34 -0
- package/compiled/watchpack/types/util/globToRegExp.d.ts +2 -0
- package/compiled/watchpack/types/watchEventSource.d.ts +53 -0
- package/compiled/watchpack/types/watchpack.d.ts +2 -0
- package/compiled/webpack-sources/index.d.ts +61 -0
- package/compiled/webpack-sources/index.js +2370 -576
- package/compiled/webpack-sources/package.json +8 -1
- package/compiled/webpack-sources/types/CachedSource.d.ts +192 -0
- package/compiled/webpack-sources/types/CompatSource.d.ts +87 -0
- package/compiled/webpack-sources/types/ConcatSource.d.ts +75 -0
- package/compiled/webpack-sources/types/OriginalSource.d.ts +87 -0
- package/compiled/webpack-sources/types/PrefixSource.d.ts +59 -0
- package/compiled/webpack-sources/types/RawSource.d.ts +75 -0
- package/compiled/webpack-sources/types/ReplaceSource.d.ts +107 -0
- package/compiled/webpack-sources/types/SizeOnlySource.d.ts +24 -0
- package/compiled/webpack-sources/types/Source.d.ts +189 -0
- package/compiled/webpack-sources/types/SourceMapSource.d.ts +136 -0
- package/compiled/webpack-sources/types/helpers/createMappingsSerializer.d.ts +60 -0
- package/compiled/webpack-sources/types/helpers/getFromStreamChunks.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/getGeneratedSourceInfo.d.ts +31 -0
- package/compiled/webpack-sources/types/helpers/getName.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/getSource.d.ts +15 -0
- package/compiled/webpack-sources/types/helpers/readMappings.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/scopes.d.ts +119 -0
- package/compiled/webpack-sources/types/helpers/splitIntoLines.d.ts +6 -0
- package/compiled/webpack-sources/types/helpers/splitIntoPotentialTokens.d.ts +37 -0
- package/compiled/webpack-sources/types/helpers/streamAndGetSourceAndMap.d.ts +39 -0
- package/compiled/webpack-sources/types/helpers/streamChunks.d.ts +56 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfCombinedSourceMap.d.ts +42 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfRawSource.d.ts +16 -0
- package/compiled/webpack-sources/types/helpers/streamChunksOfSourceMap.d.ts +19 -0
- package/compiled/webpack-sources/types/helpers/stringBufferUtils.d.ts +55 -0
- package/compiled/webpack-sources/types/index.d.ts +50 -0
- package/dist/BuildInfo.d.ts +3 -1
- package/dist/ChunkGraph.d.ts +1 -1
- package/dist/CodeGenerationResults.d.ts +6 -1
- package/dist/Compilation.d.ts +60 -89
- package/dist/Compiler.d.ts +25 -22
- package/dist/ContextModuleFactory.d.ts +2 -2
- package/dist/Diagnostics.d.ts +2 -6
- package/dist/ExecuteModulePlugin.d.ts +1 -1
- package/dist/ExportsInfo.d.ts +1 -1
- package/dist/ExternalModule.d.ts +15 -1
- package/dist/FileSystem.d.ts +4 -2
- package/dist/FileSystemDependencies.d.ts +15 -0
- package/dist/Module.d.ts +9 -6
- package/dist/ModuleGraph.d.ts +11 -8
- package/dist/ModuleGraphConnection.d.ts +10 -0
- package/dist/Modules.d.ts +3 -0
- package/dist/MultiCompiler.d.ts +9 -9
- package/dist/MultiStats.d.ts +3 -3
- package/dist/MultiWatching.d.ts +3 -3
- package/dist/NativeWatchFileSystem.d.ts +31 -2
- package/dist/NormalModule.d.ts +4 -5
- package/dist/NormalModuleFactory.d.ts +5 -4
- package/dist/Resolver.d.ts +10 -2
- package/dist/ResolverFactory.d.ts +2 -2
- package/dist/RuntimeGlobals.d.ts +61 -56
- package/dist/RuntimeModule.d.ts +3 -3
- package/dist/RuntimeTemplate.d.ts +151 -0
- package/dist/Stats.d.ts +4 -4
- package/dist/VirtualModulesPlugin.d.ts +1 -1
- package/dist/Watching.d.ts +5 -5
- package/dist/builtin-loader/lightningcss/index.d.ts +11 -14
- package/dist/builtin-loader/lightningcss/target.d.ts +4 -0
- package/dist/builtin-loader/swc/index.d.ts +3 -5
- package/dist/builtin-loader/swc/pluginImport.d.ts +1 -1
- package/dist/builtin-loader/swc/types.d.ts +36 -65
- package/dist/builtin-plugin/APIPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ArrayPushCallbackChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AssetModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/AsyncWebAssemblyModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BannerPlugin.d.ts +3 -3
- package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CaseSensitivePlugin.d.ts +3 -3
- package/dist/builtin-plugin/ChunkPrefetchPreloadPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CircularCheckRspackPlugin.d.ts +33 -0
- package/dist/builtin-plugin/CircularDependencyRspackPlugin.d.ts +10 -4
- package/dist/builtin-plugin/CircularModulesInfoPlugin.d.ts +7 -0
- package/dist/builtin-plugin/CommonJsChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CompactHashedChunkIdsPlugin.d.ts +12 -0
- package/dist/builtin-plugin/CompactHashedModuleIdsPlugin.d.ts +12 -0
- package/dist/builtin-plugin/ContextReplacementPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CopyRspackPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssChunkingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/CssHttpExternalsRspackPlugin.d.ts +9 -0
- package/dist/builtin-plugin/CssModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DataUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DefinePlugin.d.ts +3 -3
- package/dist/builtin-plugin/DeterministicChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/DeterministicModuleIdsPlugin.d.ts +13 -2
- package/dist/builtin-plugin/DllEntryPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DllReferenceAgencyPlugin.d.ts +3 -3
- package/dist/builtin-plugin/DynamicEntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/ElectronTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnableChunkLoadingPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableLibraryPlugin.d.ts +2 -2
- package/dist/builtin-plugin/EnableWasmLoadingPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EnsureChunkConditionsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/EntryPlugin.d.ts +4 -4
- package/dist/builtin-plugin/EsmLibraryPlugin.d.ts +7 -2
- package/dist/builtin-plugin/EsmNodeTargetPlugin.d.ts +9 -0
- package/dist/builtin-plugin/EvalDevToolModulePlugin.d.ts +3 -3
- package/dist/builtin-plugin/EvalSourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ExternalsPlugin.d.ts +4 -3
- package/dist/builtin-plugin/FetchCompileAsyncWasmPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FileUriPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagAllModulesAsUsedPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/FlagDependencyUsagePlugin.d.ts +2 -2
- package/dist/builtin-plugin/HashedModuleIdsPlugin.d.ts +10 -0
- package/dist/builtin-plugin/HotModuleReplacementPlugin.d.ts +2 -2
- package/dist/builtin-plugin/HttpExternalsRspackPlugin.d.ts +5 -5
- package/dist/builtin-plugin/HttpUriPlugin.d.ts +7 -3
- package/dist/builtin-plugin/IgnorePlugin.d.ts +3 -3
- package/dist/builtin-plugin/InferAsyncModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/InlineExportsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/JavascriptModulesPlugin.d.ts +21 -6
- package/dist/builtin-plugin/JsLoaderRspackPlugin.d.ts +2 -2
- package/dist/builtin-plugin/JsonModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LibManifestPlugin.d.ts +3 -3
- package/dist/builtin-plugin/LightningCssMinimizerRspackPlugin.d.ts +7 -11
- package/dist/builtin-plugin/LimitChunkCountPlugin.d.ts +3 -3
- package/dist/builtin-plugin/MangleExportsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/MergeDuplicateChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleChunkFormatPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ModuleConcatenationPlugin.d.ts +2 -2
- package/dist/builtin-plugin/ModuleInfoHeaderPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NamedModuleIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NaturalChunkIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NaturalModuleIdsPlugin.d.ts +2 -2
- package/dist/builtin-plugin/NoEmitOnErrorsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NodeTargetPlugin.d.ts +3 -3
- package/dist/builtin-plugin/NormalModuleReplacementPlugin.d.ts +4 -4
- package/dist/builtin-plugin/OccurrenceChunkIdsPlugin.d.ts +3 -3
- package/dist/builtin-plugin/ProgressPlugin.d.ts +8 -7
- package/dist/builtin-plugin/ProvidePlugin.d.ts +3 -3
- package/dist/builtin-plugin/RealContentHashPlugin.d.ts +15 -4
- package/dist/builtin-plugin/RemoveDuplicateModulesPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RemoveEmptyChunksPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RsdoctorPlugin.d.ts +8 -11
- package/dist/builtin-plugin/RslibPlugin.d.ts +5 -6
- package/dist/builtin-plugin/RstestPlugin.d.ts +3 -4
- package/dist/builtin-plugin/RuntimeChunkPlugin.d.ts +3 -3
- package/dist/builtin-plugin/RuntimePlugin.d.ts +7 -11
- package/dist/builtin-plugin/SideEffectsFlagPlugin.d.ts +9 -9
- package/dist/builtin-plugin/SizeLimitsPlugin.d.ts +5 -5
- package/dist/builtin-plugin/SourceMapDevToolPlugin.d.ts +3 -3
- package/dist/builtin-plugin/SplitChunksPlugin.d.ts +6 -5
- package/dist/builtin-plugin/SubresourceIntegrityPlugin.d.ts +2 -2
- package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +7 -6
- package/dist/builtin-plugin/SyncModuleIdsPlugin.d.ts +16 -0
- package/dist/builtin-plugin/URLPlugin.d.ts +3 -3
- package/dist/builtin-plugin/WorkerPlugin.d.ts +4 -4
- package/dist/builtin-plugin/base.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/index.d.ts +3 -3
- package/dist/builtin-plugin/css-extract/loader.d.ts +1 -1
- package/dist/builtin-plugin/css-extract/utils.d.ts +8 -1
- package/dist/builtin-plugin/html-plugin/hooks.d.ts +3 -3
- package/dist/builtin-plugin/html-plugin/index.d.ts +2 -2
- package/dist/builtin-plugin/html-plugin/options.d.ts +2 -7
- package/dist/builtin-plugin/html-plugin/plugin.d.ts +5 -9
- package/dist/builtin-plugin/html-plugin/taps.d.ts +1 -1
- package/dist/builtin-plugin/index.d.ts +92 -84
- package/dist/builtin-plugin/lazy-compilation/lazyCompilation.d.ts +6 -6
- package/dist/builtin-plugin/lazy-compilation/middleware.d.ts +4 -4
- package/dist/builtin-plugin/rsc/Coordinator.d.ts +8 -0
- package/dist/builtin-plugin/rsc/RscClientPlugin.d.ts +13 -0
- package/dist/builtin-plugin/rsc/RscServerPlugin.d.ts +47 -0
- package/dist/builtin-plugin/rsc/index.d.ts +24 -0
- package/dist/checkNodeVersion.d.ts +1 -0
- package/dist/config/adapter.d.ts +4 -4
- package/dist/config/adapterRuleUse.d.ts +89 -55
- package/dist/config/browserslistTargetHandler.d.ts +1 -1
- package/dist/config/defaults.d.ts +5 -3
- package/dist/config/devServer.d.ts +103 -238
- package/dist/config/index.d.ts +5 -5
- package/dist/config/normalization.d.ts +26 -47
- package/dist/config/target.d.ts +19 -12
- package/dist/config/types.d.ts +615 -256
- package/dist/container/ContainerPlugin.d.ts +4 -4
- package/dist/container/ContainerReferencePlugin.d.ts +4 -4
- package/dist/container/ModuleFederationManifestPlugin.d.ts +12 -5
- package/dist/container/ModuleFederationPlugin.d.ts +22 -5
- package/dist/container/ModuleFederationPluginV1.d.ts +10 -6
- package/dist/container/ModuleFederationRuntimePlugin.d.ts +3 -3
- package/dist/cssExtractHmr.js +2 -27
- package/dist/cssExtractLoader.js +24 -65
- package/dist/exports.d.ts +98 -84
- package/dist/index.d.ts +4 -3
- package/dist/index.js +14201 -11810
- package/dist/lib/AbstractMethodError.d.ts +1 -1
- package/dist/lib/Cache.d.ts +5 -2
- package/dist/lib/CacheFacade.d.ts +4 -4
- package/dist/lib/DllPlugin.d.ts +2 -2
- package/dist/lib/DllReferencePlugin.d.ts +3 -3
- package/dist/lib/EntryOptionPlugin.d.ts +2 -2
- package/dist/lib/EnvironmentPlugin.d.ts +3 -3
- package/dist/lib/HookWebpackError.d.ts +2 -3
- package/dist/lib/IgnoreWarningsPlugin.d.ts +1 -1
- package/dist/lib/LoaderOptionsPlugin.d.ts +2 -2
- package/dist/lib/LoaderTargetPlugin.d.ts +2 -2
- package/dist/lib/WebpackError.d.ts +2 -2
- package/dist/lib/cache/MemoryCachePlugin.d.ts +1 -1
- package/dist/lib/cache/getLazyHashedEtag.d.ts +2 -2
- package/dist/lib/cache/mergeEtags.d.ts +1 -2
- package/dist/loader-runner/ModuleError.d.ts +1 -1
- package/dist/loader-runner/cache.d.ts +27 -0
- package/dist/loader-runner/dependencies.d.ts +23 -0
- package/dist/loader-runner/index.d.ts +10 -11
- package/dist/loader-runner/loadLoader.d.ts +2 -2
- package/dist/loader-runner/service.d.ts +10 -1
- package/dist/loader-runner/utils.d.ts +3 -3
- package/dist/loader-runner/worker.d.ts +1 -1
- package/dist/logging/createConsoleLogger.d.ts +2 -2
- package/dist/l~0.js +34 -0
- package/dist/l~3.js +34 -0
- package/dist/moduleFederationDefaultRuntime.js +1 -1
- package/dist/node/NodeEnvironmentPlugin.d.ts +2 -2
- package/dist/node/NodeTemplatePlugin.d.ts +1 -1
- package/dist/node/NodeWatchFileSystem.d.ts +15 -3
- package/dist/node/nodeConsole.d.ts +1 -1
- package/dist/rspack.d.ts +7 -8
- package/dist/rspackOptionsApply.d.ts +1 -1
- package/dist/runtime/cssExtractHmr.d.ts +2 -2
- package/dist/runtime/moduleFederationDefaultRuntime.d.ts +1 -2
- package/dist/sharing/CollectSharedEntryPlugin.d.ts +22 -0
- package/dist/sharing/ConsumeSharedPlugin.d.ts +18 -6
- package/dist/sharing/IndependentSharedPlugin.d.ts +37 -0
- package/dist/sharing/ProvideSharedPlugin.d.ts +22 -3
- package/dist/sharing/SharePlugin.d.ts +51 -3
- package/dist/sharing/ShareRuntimePlugin.d.ts +2 -2
- package/dist/sharing/SharedContainerPlugin.d.ts +23 -0
- package/dist/sharing/SharedUsedExportsOptimizerPlugin.d.ts +14 -0
- package/dist/sharing/TreeShakingSharedPlugin.d.ts +19 -0
- package/dist/sharing/utils.d.ts +1 -0
- package/dist/stats/DefaultStatsFactoryPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPresetPlugin.d.ts +1 -1
- package/dist/stats/DefaultStatsPrinterPlugin.d.ts +1 -1
- package/dist/stats/StatsFactory.d.ts +7 -5
- package/dist/stats/StatsPrinter.d.ts +7 -7
- package/dist/stats/statsFactoryUtils.d.ts +15 -19
- package/dist/swc.d.ts +2 -2
- package/dist/taps/compilation.d.ts +1 -1
- package/dist/taps/compiler.d.ts +1 -1
- package/dist/taps/contextModuleFactory.d.ts +1 -1
- package/dist/taps/externalModule.d.ts +2 -0
- package/dist/taps/index.d.ts +7 -6
- package/dist/taps/javascriptModules.d.ts +1 -1
- package/dist/taps/normalModuleFactory.d.ts +1 -1
- package/dist/taps/types.d.ts +2 -2
- package/dist/trace/index.d.ts +1 -0
- package/dist/trace/traceHookPlugin.d.ts +1 -1
- package/dist/util/bindingHelpers.d.ts +7 -0
- package/dist/util/comparators.d.ts +1 -1
- package/dist/util/createHash.d.ts +2 -2
- package/dist/util/fs.d.ts +19 -18
- package/dist/util/hash/md4.d.ts +1 -1
- package/dist/util/hash/xxhash64.d.ts +1 -1
- package/dist/util/identifier.d.ts +35 -9
- package/dist/util/index.d.ts +2 -2
- package/dist/util/source.d.ts +3 -3
- package/dist/util/supportsColor.d.ts +6 -0
- package/dist/util/targetsVersion.d.ts +2 -0
- package/dist/util/validateConfig.d.ts +1 -1
- package/dist/util/watchTimeInfo.d.ts +7 -0
- package/dist/web/JsonpTemplatePlugin.d.ts +13 -0
- package/dist/webworker/WebWorkerTemplatePlugin.d.ts +13 -0
- package/dist/worker.js +935 -907
- package/hot/dev-server.js +12 -11
- package/hot/emitter.js +3 -1
- package/hot/lazy-compilation-node.js +4 -1
- package/hot/lazy-compilation-web.js +2 -3
- package/hot/log-apply-result.js +8 -5
- package/hot/log.js +18 -10
- package/hot/only-dev-server.js +13 -12
- package/hot/poll.js +10 -9
- package/hot/signal.js +12 -10
- package/module.d.ts +39 -2
- package/package.json +15 -39
- package/compiled/browserslist-load-config/index.d.ts +0 -21
- package/compiled/browserslist-load-config/index.js +0 -252
- package/compiled/browserslist-load-config/package.json +0 -1
- package/compiled/webpack-sources/types.d.ts +0 -458
- package/dist/builtin-loader/index.d.ts +0 -1
- package/dist/builtin-plugin/WebWorkerTemplatePlugin.d.ts +0 -7
- package/dist/container/index.d.ts +0 -4
- package/dist/util/MergeCaller.d.ts +0 -10
- package/dist/util/fake.d.ts +0 -14
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# @rspack/core
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Fast Rust-based bundler for the web with a modernized webpack API.
|
|
8
8
|
|
|
9
9
|
## Documentation
|
|
10
10
|
|
|
@@ -13,3 +13,13 @@ See <https://rspack.rs> for details.
|
|
|
13
13
|
## License
|
|
14
14
|
|
|
15
15
|
Rspack is [MIT licensed](https://github.com/web-infra-dev/rspack/blob/main/LICENSE).
|
|
16
|
+
|
|
17
|
+
## OpenHarmony port
|
|
18
|
+
|
|
19
|
+
`@ohos-ports` distribution of `@rspack/core@2.2.9`. Identical JS content;
|
|
20
|
+
the `@rspack/binding` dependency is aliased to `@ohos-ports/rspack-binding`
|
|
21
|
+
(`"@rspack/binding": "npm:@ohos-ports/rspack-binding@2.2.9-beta.0"`), so the
|
|
22
|
+
bundled dist code's `require('@rspack/binding')` transparently resolves to
|
|
23
|
+
the ported loader, which probes the OpenHarmony arm64 native binary slot
|
|
24
|
+
`@ohos-ports/rspack-binding-openharmony-arm64` (compiled from rspack v2.2.9
|
|
25
|
+
Rust source for `aarch64-unknown-linux-ohos`, signed).
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
type FixedSizeArray<T extends number, U> = T extends 0 ? undefined[] : ReadonlyArray<U> & {
|
|
2
|
+
0: U;
|
|
3
|
+
length: T;
|
|
4
|
+
};
|
|
5
|
+
type Measure<T extends number> = T extends 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 ? T : never;
|
|
6
|
+
type Append<T extends any[], U> = {
|
|
7
|
+
0: [U];
|
|
8
|
+
1: [T[0], U];
|
|
9
|
+
2: [T[0], T[1], U];
|
|
10
|
+
3: [T[0], T[1], T[2], U];
|
|
11
|
+
4: [T[0], T[1], T[2], T[3], U];
|
|
12
|
+
5: [T[0], T[1], T[2], T[3], T[4], U];
|
|
13
|
+
6: [T[0], T[1], T[2], T[3], T[4], T[5], U];
|
|
14
|
+
7: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], U];
|
|
15
|
+
8: [T[0], T[1], T[2], T[3], T[4], T[5], T[6], T[7], U];
|
|
16
|
+
}[Measure<T['length']>];
|
|
17
|
+
export type AsArray<T> = T extends any[] ? T : [T];
|
|
18
|
+
export type Fn<T, R> = (...args: AsArray<T>) => R;
|
|
19
|
+
export type FnAsync<T, R> = (...args: Append<AsArray<T>, InnerCallback<Error, R>>) => void;
|
|
20
|
+
export type FnPromise<T, R> = (...args: AsArray<T>) => Promise<R>;
|
|
21
|
+
export type TapFunction = (...args: any[]) => any;
|
|
22
|
+
type UnsetAdditionalOptions = {
|
|
23
|
+
_UnsetAdditionalOptions: true;
|
|
24
|
+
};
|
|
25
|
+
type IfSet<X> = X extends UnsetAdditionalOptions ? unknown : X;
|
|
26
|
+
export type Callback<E, T> = (error: E | null, result?: T) => void;
|
|
27
|
+
type InnerCallback<E, T> = (error?: E | null | false, result?: T) => void;
|
|
28
|
+
export type FullTap = Tap & {
|
|
29
|
+
type: 'sync' | 'async' | 'promise';
|
|
30
|
+
fn: TapFunction;
|
|
31
|
+
};
|
|
32
|
+
export type Tap = TapOptions & {
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
type TapOptions = {
|
|
36
|
+
before?: string;
|
|
37
|
+
stage?: number;
|
|
38
|
+
};
|
|
39
|
+
export type Options<AdditionalOptions = UnsetAdditionalOptions> = string | (Tap & IfSet<AdditionalOptions>);
|
|
40
|
+
export interface HookInterceptor<_T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
41
|
+
name?: string;
|
|
42
|
+
tap?: (tap: FullTap & IfSet<AdditionalOptions>) => void;
|
|
43
|
+
call?: (...args: any[]) => void;
|
|
44
|
+
loop?: (...args: any[]) => void;
|
|
45
|
+
error?: (err: Error) => void;
|
|
46
|
+
result?: (result: R) => void;
|
|
47
|
+
done?: () => void;
|
|
48
|
+
register?: (tap: FullTap & IfSet<AdditionalOptions>) => FullTap & IfSet<AdditionalOptions>;
|
|
49
|
+
}
|
|
50
|
+
type ArgumentNames<T extends any[]> = FixedSizeArray<T['length'], string>;
|
|
51
|
+
type ExtractHookArgs<H> = H extends Hook<infer T, any> ? T : never;
|
|
52
|
+
type ExtractHookReturn<H> = H extends Hook<any, infer R> ? R : never;
|
|
53
|
+
type ExtractHookAdditionalOptions<H> = H extends Hook<any, any, infer A> ? A : never;
|
|
54
|
+
export interface Hook<T = any, R = any, AdditionalOptions = UnsetAdditionalOptions> {
|
|
55
|
+
name?: string;
|
|
56
|
+
tap(opt: Options<AdditionalOptions>, fn: Fn<T, R>): void;
|
|
57
|
+
tapAsync(opt: Options<AdditionalOptions>, fn: FnAsync<T, R>): void;
|
|
58
|
+
tapPromise(opt: Options<AdditionalOptions>, fn: FnPromise<T, R>): void;
|
|
59
|
+
intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
|
|
60
|
+
isUsed(): boolean;
|
|
61
|
+
withOptions(opt: TapOptions & IfSet<AdditionalOptions>): Hook<T, R, AdditionalOptions>;
|
|
62
|
+
queryStageRange(stageRange: StageRange): QueriedHook<T, R, AdditionalOptions>;
|
|
63
|
+
}
|
|
64
|
+
type AllStageTaps<Tap> = {
|
|
65
|
+
source: Tap[];
|
|
66
|
+
length: number;
|
|
67
|
+
taps: Tap[];
|
|
68
|
+
};
|
|
69
|
+
export declare class HookBase<T, R, AdditionalOptions = UnsetAdditionalOptions> implements Hook<T, R, AdditionalOptions> {
|
|
70
|
+
args: ArgumentNames<AsArray<T>>;
|
|
71
|
+
name?: string;
|
|
72
|
+
taps: (FullTap & IfSet<AdditionalOptions>)[];
|
|
73
|
+
interceptors: HookInterceptor<T, R, AdditionalOptions>[];
|
|
74
|
+
_allStageTaps: AllStageTaps<FullTap & IfSet<AdditionalOptions>> | undefined;
|
|
75
|
+
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
76
|
+
intercept(interceptor: HookInterceptor<T, R, AdditionalOptions>): void;
|
|
77
|
+
_runRegisterInterceptors(options: FullTap & IfSet<AdditionalOptions>): FullTap & IfSet<AdditionalOptions>;
|
|
78
|
+
_runCallInterceptors(...args: any[]): void;
|
|
79
|
+
_runErrorInterceptors(e: Error): void;
|
|
80
|
+
_runTapInterceptors(tap: FullTap & IfSet<AdditionalOptions>): void;
|
|
81
|
+
_runDoneInterceptors(): void;
|
|
82
|
+
_runResultInterceptors(r: R): void;
|
|
83
|
+
withOptions(options: TapOptions & IfSet<AdditionalOptions>): Hook<T, R, AdditionalOptions>;
|
|
84
|
+
isUsed(): boolean;
|
|
85
|
+
queryStageRange(stageRange: StageRange): QueriedHook<T, R, AdditionalOptions>;
|
|
86
|
+
callAsyncStageRange(_queried: QueriedHook<T, R, AdditionalOptions>, ..._args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
87
|
+
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
88
|
+
promiseStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: AsArray<T>): Promise<R>;
|
|
89
|
+
promise(...args: AsArray<T>): Promise<R>;
|
|
90
|
+
tap(options: Options<AdditionalOptions>, fn: Fn<T, R>): void;
|
|
91
|
+
tapAsync(options: Options<AdditionalOptions>, fn: FnAsync<T, R>): void;
|
|
92
|
+
tapPromise(options: Options<AdditionalOptions>, fn: FnPromise<T, R>): void;
|
|
93
|
+
_tap(type: 'sync' | 'async' | 'promise', options: Options<AdditionalOptions>, fn: TapFunction): void;
|
|
94
|
+
_insert(item: FullTap & IfSet<AdditionalOptions>): void;
|
|
95
|
+
/**
|
|
96
|
+
* The taps `queryStageRange(allStageRange)` would select, reused across calls.
|
|
97
|
+
*
|
|
98
|
+
* `tap()` always grows `this.taps`, and code that replaces or splices it changes its
|
|
99
|
+
* identity or length, so both are checked. An interceptor's `register` rewrites taps in
|
|
100
|
+
* place, but hooks with interceptors never take the path that reads this.
|
|
101
|
+
*/
|
|
102
|
+
_tapsInAllStages(): (FullTap & IfSet<AdditionalOptions>)[];
|
|
103
|
+
_prepareArgs(args: AsArray<T>): (T | undefined)[];
|
|
104
|
+
}
|
|
105
|
+
export type StageRange = readonly [number, number];
|
|
106
|
+
export declare const minStage: number;
|
|
107
|
+
export declare const maxStage: number;
|
|
108
|
+
export declare const safeStage: (stage: number) => number;
|
|
109
|
+
export declare class QueriedHook<T, R, AdditionalOptions = UnsetAdditionalOptions> {
|
|
110
|
+
stageRange: StageRange;
|
|
111
|
+
hook: HookBase<T, R, AdditionalOptions>;
|
|
112
|
+
tapsInRange: (FullTap & IfSet<AdditionalOptions>)[];
|
|
113
|
+
constructor(stageRange: StageRange, hook: HookBase<T, R, AdditionalOptions>);
|
|
114
|
+
isUsed(): boolean;
|
|
115
|
+
call(...args: AsArray<T>): R;
|
|
116
|
+
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
117
|
+
promise(...args: AsArray<T>): Promise<R>;
|
|
118
|
+
}
|
|
119
|
+
export declare class SyncHook<T, R = void, AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, R, AdditionalOptions> {
|
|
120
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
121
|
+
call(...args: AsArray<T>): R;
|
|
122
|
+
callStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: AsArray<T>): R;
|
|
123
|
+
tapAsync(): never;
|
|
124
|
+
tapPromise(): never;
|
|
125
|
+
}
|
|
126
|
+
export declare class SyncBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, R, AdditionalOptions> {
|
|
127
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
128
|
+
call(...args: AsArray<T>): R;
|
|
129
|
+
callStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: AsArray<T>): R;
|
|
130
|
+
tapAsync(): never;
|
|
131
|
+
tapPromise(): never;
|
|
132
|
+
}
|
|
133
|
+
export declare class SyncWaterfallHook<T, R = AsArray<T>[0], AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, R, AdditionalOptions> {
|
|
134
|
+
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
135
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
136
|
+
call(...args: AsArray<T>): R;
|
|
137
|
+
callStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: AsArray<T>): R;
|
|
138
|
+
tapAsync(): never;
|
|
139
|
+
tapPromise(): never;
|
|
140
|
+
}
|
|
141
|
+
export declare class AsyncParallelHook<T, AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, void, AdditionalOptions> {
|
|
142
|
+
callAsyncStageRange(queried: QueriedHook<T, void, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, void>>): void;
|
|
143
|
+
}
|
|
144
|
+
export declare class AsyncSeriesHook<T, AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, void, AdditionalOptions> {
|
|
145
|
+
callAsyncStageRange(queried: QueriedHook<T, void, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, void>>): void;
|
|
146
|
+
}
|
|
147
|
+
export declare class AsyncSeriesBailHook<T, R, AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, R, AdditionalOptions> {
|
|
148
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
149
|
+
}
|
|
150
|
+
export declare class AsyncSeriesWaterfallHook<T, R = AsArray<T>[0], AdditionalOptions = UnsetAdditionalOptions> extends HookBase<T, R, AdditionalOptions> {
|
|
151
|
+
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
|
|
152
|
+
callAsyncStageRange(queried: QueriedHook<T, R, AdditionalOptions>, ...args: Append<AsArray<T>, Callback<Error, R>>): void;
|
|
153
|
+
}
|
|
154
|
+
export type HookMapKey = any;
|
|
155
|
+
export type HookFactory<H> = (key: HookMapKey, hook?: H) => H;
|
|
156
|
+
export interface HookMapInterceptor<H> {
|
|
157
|
+
factory?: HookFactory<H>;
|
|
158
|
+
}
|
|
159
|
+
export declare class HookMap<H extends Hook> {
|
|
160
|
+
_map: Map<HookMapKey, H>;
|
|
161
|
+
_factory: HookFactory<H>;
|
|
162
|
+
name?: string;
|
|
163
|
+
_interceptors: HookMapInterceptor<H>[];
|
|
164
|
+
constructor(factory: HookFactory<H>, name?: string);
|
|
165
|
+
get(key: HookMapKey): H | undefined;
|
|
166
|
+
for(key: HookMapKey): H;
|
|
167
|
+
intercept(interceptor: HookMapInterceptor<H>): void;
|
|
168
|
+
isUsed(): boolean;
|
|
169
|
+
queryStageRange(stageRange: StageRange): QueriedHookMap<H>;
|
|
170
|
+
}
|
|
171
|
+
export declare class QueriedHookMap<H extends Hook> {
|
|
172
|
+
stageRange: StageRange;
|
|
173
|
+
hookMap: HookMap<H>;
|
|
174
|
+
constructor(stageRange: StageRange, hookMap: HookMap<H>);
|
|
175
|
+
get(key: HookMapKey): QueriedHook<any, any, UnsetAdditionalOptions> | undefined;
|
|
176
|
+
for(key: HookMapKey): QueriedHook<any, any, UnsetAdditionalOptions>;
|
|
177
|
+
isUsed(): boolean;
|
|
178
|
+
}
|
|
179
|
+
export declare class MultiHook<H extends Hook> {
|
|
180
|
+
hooks: H[];
|
|
181
|
+
name?: string;
|
|
182
|
+
constructor(hooks: H[], name?: string);
|
|
183
|
+
tap(options: Options<ExtractHookAdditionalOptions<Hook>>, fn: Fn<ExtractHookArgs<Hook>, ExtractHookReturn<Hook>>): void;
|
|
184
|
+
tapAsync(options: Options<ExtractHookAdditionalOptions<Hook>>, fn: FnAsync<ExtractHookArgs<Hook>, ExtractHookReturn<Hook>>): void;
|
|
185
|
+
tapPromise(options: Options<ExtractHookAdditionalOptions<Hook>>, fn: FnPromise<ExtractHookArgs<Hook>, ExtractHookReturn<Hook>>): void;
|
|
186
|
+
isUsed(): boolean;
|
|
187
|
+
intercept(interceptor: HookInterceptor<ExtractHookArgs<Hook>, ExtractHookReturn<Hook>, ExtractHookAdditionalOptions<Hook>>): void;
|
|
188
|
+
withOptions(options: TapOptions & IfSet<ExtractHookAdditionalOptions<Hook>>): MultiHook<Hook<any, any, UnsetAdditionalOptions>>;
|
|
189
|
+
}
|
|
190
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-present Bytedance, Inc. and its affiliates.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"@rspack/lite-tapable","version":"1.3.0","license":"MIT","types":"./dist/index.d.ts","type":"module"}
|
|
@@ -113,6 +113,13 @@ interface JsMinifyOptions {
|
|
|
113
113
|
safari10?: boolean;
|
|
114
114
|
toplevel?: boolean;
|
|
115
115
|
sourceMap?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Serializable subset of terser-webpack-plugin's `extractComments`.
|
|
118
|
+
* `true` behaves like `'some'`.
|
|
119
|
+
*/
|
|
120
|
+
extractComments?: boolean | "some" | "all" | {
|
|
121
|
+
regex: string;
|
|
122
|
+
};
|
|
116
123
|
outputPath?: string;
|
|
117
124
|
inlineSourcesContent?: boolean;
|
|
118
125
|
}
|
|
@@ -293,6 +300,8 @@ interface TerserCompressOptions {
|
|
|
293
300
|
unsafe_proto?: boolean;
|
|
294
301
|
unsafe_regexp?: boolean;
|
|
295
302
|
unsafe_undefined?: boolean;
|
|
303
|
+
unsafe_hoist_static_method_alias?: boolean;
|
|
304
|
+
unsafe_hoist_global_objects_alias?: boolean;
|
|
296
305
|
unused?: boolean;
|
|
297
306
|
const_to_let?: boolean;
|
|
298
307
|
module?: boolean;
|
|
@@ -386,27 +395,27 @@ interface Options extends Config {
|
|
|
386
395
|
*
|
|
387
396
|
* "root" - Passes the "root" value through as unchanged.
|
|
388
397
|
* "upward" - Walks upward from the "root" directory, looking for a directory
|
|
389
|
-
* containing a
|
|
398
|
+
* containing a .swcrc file, and throws an error if a .swcrc
|
|
390
399
|
* is not found.
|
|
391
400
|
* "upward-optional" - Walk upward from the "root" directory, looking for
|
|
392
|
-
* a directory containing a
|
|
393
|
-
* if a
|
|
401
|
+
* a directory containing a .swcrc file, and falls back to "root"
|
|
402
|
+
* if a .swcrc is not found.
|
|
394
403
|
*
|
|
395
404
|
*
|
|
396
405
|
* "root" is the default mode because it avoids the risk that Swc
|
|
397
|
-
* will accidentally load a
|
|
406
|
+
* will accidentally load a .swcrc that is entirely outside
|
|
398
407
|
* of the current project folder. If you use "upward-optional",
|
|
399
408
|
* be aware that it will walk up the directory structure all the
|
|
400
409
|
* way to the filesystem root, and it is always possible that someone
|
|
401
|
-
* will have a forgotten
|
|
410
|
+
* will have a forgotten .swcrc in their home directory,
|
|
402
411
|
* which could cause unexpected errors in your builds.
|
|
403
412
|
*
|
|
404
413
|
*
|
|
405
414
|
* Users with monorepo project structures that run builds/tests on a
|
|
406
415
|
* per-package basis may well want to use "upward" since monorepos
|
|
407
|
-
* often have a
|
|
416
|
+
* often have a .swcrc in the project root. Running Swc
|
|
408
417
|
* in a monorepo subdirectory without "upward", will cause Swc
|
|
409
|
-
* to skip loading any
|
|
418
|
+
* to skip loading any .swcrc files in the project root,
|
|
410
419
|
* which can lead to unexpected errors and compilation failure.
|
|
411
420
|
*/
|
|
412
421
|
rootMode?: "root" | "upward" | "upward-optional";
|
|
@@ -595,6 +604,10 @@ interface JscConfig {
|
|
|
595
604
|
* This option only works when `keepImportAttributes` is `true`.
|
|
596
605
|
*/
|
|
597
606
|
emitAssertForImportAttributes?: boolean;
|
|
607
|
+
/**
|
|
608
|
+
* Emit ECMA-426 source-map scopes metadata.
|
|
609
|
+
*/
|
|
610
|
+
emitSourceMapScopes?: boolean;
|
|
598
611
|
/**
|
|
599
612
|
* Specify the location where SWC stores its intermediate cache files.
|
|
600
613
|
* Currently only transform plugin uses this. If not specified, SWC will
|
|
@@ -648,7 +661,7 @@ interface JscConfig {
|
|
|
648
661
|
};
|
|
649
662
|
}
|
|
650
663
|
type JscTarget = "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "esnext";
|
|
651
|
-
type ParserConfig = TsParserConfig | EsParserConfig;
|
|
664
|
+
type ParserConfig = TsParserConfig | EsParserConfig | FlowParserConfig;
|
|
652
665
|
interface TsParserConfig {
|
|
653
666
|
syntax: "typescript";
|
|
654
667
|
/**
|
|
@@ -664,6 +677,37 @@ interface TsParserConfig {
|
|
|
664
677
|
*/
|
|
665
678
|
dynamicImport?: boolean;
|
|
666
679
|
}
|
|
680
|
+
interface FlowParserConfig {
|
|
681
|
+
syntax: "flow";
|
|
682
|
+
/**
|
|
683
|
+
* Defaults to `false`.
|
|
684
|
+
*/
|
|
685
|
+
jsx?: boolean;
|
|
686
|
+
/**
|
|
687
|
+
* Defaults to `false`.
|
|
688
|
+
*/
|
|
689
|
+
all?: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Defaults to `false`.
|
|
692
|
+
*/
|
|
693
|
+
requireDirective?: boolean;
|
|
694
|
+
/**
|
|
695
|
+
* Defaults to `false`.
|
|
696
|
+
*/
|
|
697
|
+
enums?: boolean;
|
|
698
|
+
/**
|
|
699
|
+
* Defaults to `false`.
|
|
700
|
+
*/
|
|
701
|
+
decorators?: boolean;
|
|
702
|
+
/**
|
|
703
|
+
* Defaults to `false`.
|
|
704
|
+
*/
|
|
705
|
+
components?: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* Defaults to `false`.
|
|
708
|
+
*/
|
|
709
|
+
patternMatching?: boolean;
|
|
710
|
+
}
|
|
667
711
|
interface EsParserConfig {
|
|
668
712
|
syntax: "ecmascript";
|
|
669
713
|
/**
|
|
@@ -759,6 +803,7 @@ interface TransformConfig {
|
|
|
759
803
|
* Effective only if `syntax` supports ƒ.
|
|
760
804
|
*/
|
|
761
805
|
react?: ReactConfig;
|
|
806
|
+
reactCompiler?: boolean | ReactCompilerOptions;
|
|
762
807
|
constModules?: ConstModulesConfig;
|
|
763
808
|
/**
|
|
764
809
|
* Defaults to null, which skips optimizer pass.
|
|
@@ -775,7 +820,7 @@ interface TransformConfig {
|
|
|
775
820
|
/**
|
|
776
821
|
* https://swc.rs/docs/configuration/compilation#jsctransformdecoratorversion
|
|
777
822
|
*/
|
|
778
|
-
decoratorVersion?: "2021-12" | "2022-03";
|
|
823
|
+
decoratorVersion?: "2021-12" | "2022-03" | "2023-11";
|
|
779
824
|
treatConstEnumAsEnum?: boolean;
|
|
780
825
|
/**
|
|
781
826
|
* https://www.typescriptlang.org/tsconfig#useDefineForClassFields
|
|
@@ -787,6 +832,107 @@ interface TransformConfig {
|
|
|
787
832
|
verbatimModuleSyntax?: boolean;
|
|
788
833
|
tsEnumIsMutable?: boolean;
|
|
789
834
|
}
|
|
835
|
+
interface ReactCompilerOptions {
|
|
836
|
+
/**
|
|
837
|
+
* Which functions to compile.
|
|
838
|
+
*
|
|
839
|
+
* Defaults to `"infer"`.
|
|
840
|
+
*/
|
|
841
|
+
compilationMode?: "infer" | "syntax" | "annotation" | "all";
|
|
842
|
+
/**
|
|
843
|
+
* What to do when a function cannot be compiled.
|
|
844
|
+
*
|
|
845
|
+
* Defaults to `"none"`.
|
|
846
|
+
*/
|
|
847
|
+
panicThreshold?: "none" | "critical_errors" | "all_errors";
|
|
848
|
+
/**
|
|
849
|
+
* React runtime version target.
|
|
850
|
+
*
|
|
851
|
+
* Defaults to `"19"`.
|
|
852
|
+
*/
|
|
853
|
+
target?: "17" | "18" | "19";
|
|
854
|
+
/**
|
|
855
|
+
* Analyze and report diagnostics only; emit no transformed code.
|
|
856
|
+
*
|
|
857
|
+
* Defaults to `false`.
|
|
858
|
+
*/
|
|
859
|
+
noEmit?: boolean;
|
|
860
|
+
/**
|
|
861
|
+
* Defaults to `"client"`.
|
|
862
|
+
*/
|
|
863
|
+
outputMode?: "client" | "ssr" | "lint";
|
|
864
|
+
/**
|
|
865
|
+
* Compile even functions marked with opt-out directives.
|
|
866
|
+
*
|
|
867
|
+
* Defaults to `false`.
|
|
868
|
+
*/
|
|
869
|
+
ignoreUseNoForget?: boolean;
|
|
870
|
+
/**
|
|
871
|
+
* Treat Flow suppression comments as opt-outs.
|
|
872
|
+
*
|
|
873
|
+
* Defaults to `true`.
|
|
874
|
+
*/
|
|
875
|
+
flowSuppressions?: boolean;
|
|
876
|
+
/**
|
|
877
|
+
* Enable react-native-reanimated support.
|
|
878
|
+
*
|
|
879
|
+
* Defaults to `false`.
|
|
880
|
+
*/
|
|
881
|
+
enableReanimated?: boolean;
|
|
882
|
+
/**
|
|
883
|
+
* Development mode.
|
|
884
|
+
*
|
|
885
|
+
* Defaults to `false`.
|
|
886
|
+
*/
|
|
887
|
+
isDev?: boolean;
|
|
888
|
+
/**
|
|
889
|
+
* ESLint rules whose suppressions opt a function out of compilation.
|
|
890
|
+
*/
|
|
891
|
+
eslintSuppressionRules?: string[];
|
|
892
|
+
/**
|
|
893
|
+
* Extra directives that opt a function out of compilation.
|
|
894
|
+
*/
|
|
895
|
+
customOptOutDirectives?: string[];
|
|
896
|
+
/**
|
|
897
|
+
* Emit a gated version of each compiled function.
|
|
898
|
+
*/
|
|
899
|
+
gating?: ReactCompilerGatingConfig;
|
|
900
|
+
/**
|
|
901
|
+
* Dynamically-gated compilation.
|
|
902
|
+
*/
|
|
903
|
+
dynamicGating?: ReactCompilerDynamicGatingConfig;
|
|
904
|
+
/**
|
|
905
|
+
* Curated subset of the compiler's `environment` options.
|
|
906
|
+
*
|
|
907
|
+
* Unset fields leave the compiler defaults intact.
|
|
908
|
+
*/
|
|
909
|
+
environment?: ReactCompilerEnvironmentConfig;
|
|
910
|
+
}
|
|
911
|
+
interface ReactCompilerGatingConfig {
|
|
912
|
+
/**
|
|
913
|
+
* Module the gating import comes from.
|
|
914
|
+
*/
|
|
915
|
+
source: string;
|
|
916
|
+
/**
|
|
917
|
+
* Imported specifier used as the gate.
|
|
918
|
+
*/
|
|
919
|
+
importSpecifierName: string;
|
|
920
|
+
}
|
|
921
|
+
interface ReactCompilerDynamicGatingConfig {
|
|
922
|
+
/**
|
|
923
|
+
* Module the gating import comes from.
|
|
924
|
+
*/
|
|
925
|
+
source: string;
|
|
926
|
+
}
|
|
927
|
+
interface ReactCompilerEnvironmentConfig {
|
|
928
|
+
/**
|
|
929
|
+
* Extract anonymous functions that do not close over local variables into
|
|
930
|
+
* top-level helper functions.
|
|
931
|
+
*
|
|
932
|
+
* Defaults to `true`.
|
|
933
|
+
*/
|
|
934
|
+
enableFunctionOutlining?: boolean;
|
|
935
|
+
}
|
|
790
936
|
interface ReactConfig {
|
|
791
937
|
/**
|
|
792
938
|
* Replace the function used when compiling JSX expressions.
|
|
@@ -1117,6 +1263,10 @@ interface Output {
|
|
|
1117
1263
|
* Sourcemap (**not** base64 encoded)
|
|
1118
1264
|
*/
|
|
1119
1265
|
map?: string;
|
|
1266
|
+
/**
|
|
1267
|
+
* Extracted comments collected during minification.
|
|
1268
|
+
*/
|
|
1269
|
+
extractedComments?: string[];
|
|
1120
1270
|
}
|
|
1121
1271
|
interface MatchPattern {
|
|
1122
1272
|
}
|
|
@@ -1443,7 +1593,7 @@ interface JSXAttribute extends Node, HasSpan {
|
|
|
1443
1593
|
value?: JSXAttrValue;
|
|
1444
1594
|
}
|
|
1445
1595
|
type JSXAttributeName = Identifier | JSXNamespacedName;
|
|
1446
|
-
type JSXAttrValue =
|
|
1596
|
+
type JSXAttrValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
|
|
1447
1597
|
interface JSXText extends Node, HasSpan {
|
|
1448
1598
|
type: "JSXText";
|
|
1449
1599
|
value: string;
|
|
@@ -2131,4 +2281,4 @@ type WasmAnalysisOptions = {
|
|
|
2131
2281
|
};
|
|
2132
2282
|
type WasmPlugin = [wasmPackage: string, config: Record<string, any>];
|
|
2133
2283
|
|
|
2134
|
-
export type { Accessibility, AmdConfig, Argument, ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentPatternProperty, AssignmentProperty, AwaitExpression, BaseModuleConfig, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CallerOptions, CatchClause, Class, ClassDeclaration, ClassExpression, ClassMember, ClassMethod, ClassMethodBase, ClassProperty, ClassPropertyBase, CommonJsConfig, ComputedPropName, ConditionalExpression, Config, ConstModulesConfig, Constructor, ContinueStatement, DebuggerStatement, Declaration, Decorator, DefaultDecl, DoWhileStatement, EmptyStatement, EnvConfig, Es6Config, EsParserConfig, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultExpression, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, ExprOrSpread, Expression, ExpressionStatement, Fn, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, GetterProperty, GlobalPassOption, HasDecorator, HasSpan, Identifier, IfStatement, Import, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, Invalid, JSXAttrValue, JSXAttribute, JSXAttributeName, JSXAttributeOrSpread, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXMemberExpression, JSXNamespacedName, JSXObject, JSXOpeningElement, JSXOpeningFragment, JSXSpreadChild, JSXText, JsFormatOptions, JsMinifyOptions, JscConfig, JscTarget, KeyValuePatternProperty, KeyValueProperty, LabeledStatement, Literal, MatchPattern, MemberExpression, MetaProperty, MethodKind, MethodProperty, Module, ModuleConfig, ModuleDeclaration, ModuleExportName, ModuleItem, NamedExportSpecifier, NamedImportSpecifier, NewExpression, Node, NodeNextConfig, NullLiteral, NumericLiteral, ObjectExpression, ObjectPattern, ObjectPatternProperty, OptimizerConfig, OptionalChainingCall, OptionalChainingExpression, Options, Output, Param, ParenthesisExpression, ParseOptions, ParserConfig, Pattern, Plugin, PrivateMethod, PrivateName, PrivateProperty, Program, Property, PropertyName, ReactConfig, RegExpLiteral, RestElement, ReturnStatement, Script, SequenceExpression, SetterProperty, Span, SpreadElement, Statement, StaticBlock, StringLiteral, Super, SuperPropExpression, Swcrc, SwitchCase, SwitchStatement, SystemjsConfig, TaggedTemplateExpression, TemplateElement, TemplateLiteral, TerserCompressOptions, TerserEcmaVersion, TerserMangleOptions, TerserManglePropertiesOptions, ThisExpression, ThrowStatement, TransformConfig, TruePlusMinus, TryStatement, TsArrayType, TsAsExpression, TsCallSignatureDeclaration, TsConditionalType, TsConstAssertion, TsConstructSignatureDeclaration, TsConstructorType, TsEntityName, TsEnumDeclaration, TsEnumMember, TsEnumMemberId, TsExportAssignment, TsExpressionWithTypeArguments, TsExternalModuleReference, TsFnOrConstructorType, TsFnParameter, TsFunctionType, TsGetterSignature, TsImportEqualsDeclaration, TsImportType, TsIndexSignature, TsIndexedAccessType, TsInferType, TsInstantiation, TsInterfaceBody, TsInterfaceDeclaration, TsIntersectionType, TsKeywordType, TsKeywordTypeKind, TsLiteral, TsLiteralType, TsMappedType, TsMethodSignature, TsModuleBlock, TsModuleDeclaration, TsModuleName, TsModuleReference, TsNamespaceBody, TsNamespaceDeclaration, TsNamespaceExportDeclaration, TsNonNullExpression, TsOptionalType, TsParameterProperty, TsParameterPropertyParameter, TsParenthesizedType, TsParserConfig, TsPropertySignature, TsQualifiedName, TsRestType, TsSatisfiesExpression, TsSetterSignature, TsTemplateLiteralType, TsThisType, TsThisTypeOrIdent, TsTupleElement, TsTupleType, TsType, TsTypeAliasDeclaration, TsTypeAnnotation, TsTypeAssertion, TsTypeElement, TsTypeLiteral, TsTypeOperator, TsTypeOperatorOp, TsTypeParameter, TsTypeParameterDeclaration, TsTypeParameterInstantiation, TsTypePredicate, TsTypeQuery, TsTypeQueryExpr, TsTypeReference, TsUnionOrIntersectionType, TsUnionType, UmdConfig, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WasmAnalysisOptions, WasmPlugin, WhileStatement, WithStatement, YieldExpression };
|
|
2284
|
+
export type { Accessibility, AmdConfig, Argument, ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentPatternProperty, AssignmentProperty, AwaitExpression, BaseModuleConfig, BigIntLiteral, BinaryExpression, BinaryOperator, BindingIdentifier, BlockStatement, BooleanLiteral, BreakStatement, CallExpression, CallerOptions, CatchClause, Class, ClassDeclaration, ClassExpression, ClassMember, ClassMethod, ClassMethodBase, ClassProperty, ClassPropertyBase, CommonJsConfig, ComputedPropName, ConditionalExpression, Config, ConstModulesConfig, Constructor, ContinueStatement, DebuggerStatement, Declaration, Decorator, DefaultDecl, DoWhileStatement, EmptyStatement, EnvConfig, Es6Config, EsParserConfig, ExportAllDeclaration, ExportDeclaration, ExportDefaultDeclaration, ExportDefaultExpression, ExportDefaultSpecifier, ExportNamedDeclaration, ExportNamespaceSpecifier, ExportSpecifier, ExprOrSpread, Expression, ExpressionStatement, FlowParserConfig, Fn, ForInStatement, ForOfStatement, ForStatement, FunctionDeclaration, FunctionExpression, GetterProperty, GlobalPassOption, HasDecorator, HasSpan, Identifier, IfStatement, Import, ImportDeclaration, ImportDefaultSpecifier, ImportNamespaceSpecifier, ImportSpecifier, Invalid, JSXAttrValue, JSXAttribute, JSXAttributeName, JSXAttributeOrSpread, JSXClosingElement, JSXClosingFragment, JSXElement, JSXElementChild, JSXElementName, JSXEmptyExpression, JSXExpression, JSXExpressionContainer, JSXFragment, JSXMemberExpression, JSXNamespacedName, JSXObject, JSXOpeningElement, JSXOpeningFragment, JSXSpreadChild, JSXText, JsFormatOptions, JsMinifyOptions, JscConfig, JscTarget, KeyValuePatternProperty, KeyValueProperty, LabeledStatement, Literal, MatchPattern, MemberExpression, MetaProperty, MethodKind, MethodProperty, Module, ModuleConfig, ModuleDeclaration, ModuleExportName, ModuleItem, NamedExportSpecifier, NamedImportSpecifier, NewExpression, Node, NodeNextConfig, NullLiteral, NumericLiteral, ObjectExpression, ObjectPattern, ObjectPatternProperty, OptimizerConfig, OptionalChainingCall, OptionalChainingExpression, Options, Output, Param, ParenthesisExpression, ParseOptions, ParserConfig, Pattern, Plugin, PrivateMethod, PrivateName, PrivateProperty, Program, Property, PropertyName, ReactCompilerDynamicGatingConfig, ReactCompilerEnvironmentConfig, ReactCompilerGatingConfig, ReactCompilerOptions, ReactConfig, RegExpLiteral, RestElement, ReturnStatement, Script, SequenceExpression, SetterProperty, Span, SpreadElement, Statement, StaticBlock, StringLiteral, Super, SuperPropExpression, Swcrc, SwitchCase, SwitchStatement, SystemjsConfig, TaggedTemplateExpression, TemplateElement, TemplateLiteral, TerserCompressOptions, TerserEcmaVersion, TerserMangleOptions, TerserManglePropertiesOptions, ThisExpression, ThrowStatement, TransformConfig, TruePlusMinus, TryStatement, TsArrayType, TsAsExpression, TsCallSignatureDeclaration, TsConditionalType, TsConstAssertion, TsConstructSignatureDeclaration, TsConstructorType, TsEntityName, TsEnumDeclaration, TsEnumMember, TsEnumMemberId, TsExportAssignment, TsExpressionWithTypeArguments, TsExternalModuleReference, TsFnOrConstructorType, TsFnParameter, TsFunctionType, TsGetterSignature, TsImportEqualsDeclaration, TsImportType, TsIndexSignature, TsIndexedAccessType, TsInferType, TsInstantiation, TsInterfaceBody, TsInterfaceDeclaration, TsIntersectionType, TsKeywordType, TsKeywordTypeKind, TsLiteral, TsLiteralType, TsMappedType, TsMethodSignature, TsModuleBlock, TsModuleDeclaration, TsModuleName, TsModuleReference, TsNamespaceBody, TsNamespaceDeclaration, TsNamespaceExportDeclaration, TsNonNullExpression, TsOptionalType, TsParameterProperty, TsParameterPropertyParameter, TsParenthesizedType, TsParserConfig, TsPropertySignature, TsQualifiedName, TsRestType, TsSatisfiesExpression, TsSetterSignature, TsTemplateLiteralType, TsThisType, TsThisTypeOrIdent, TsTupleElement, TsTupleType, TsType, TsTypeAliasDeclaration, TsTypeAnnotation, TsTypeAssertion, TsTypeElement, TsTypeLiteral, TsTypeOperator, TsTypeOperatorOp, TsTypeParameter, TsTypeParameterDeclaration, TsTypeParameterInstantiation, TsTypePredicate, TsTypeQuery, TsTypeQueryExpr, TsTypeReference, TsUnionOrIntersectionType, TsUnionType, UmdConfig, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WasmAnalysisOptions, WasmPlugin, WhileStatement, WithStatement, YieldExpression };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@swc/types","author":"강동윤 <kdy1997.dev@gmail.com>","version":"0.1.
|
|
1
|
+
{"name":"@swc/types","author":"강동윤 <kdy1997.dev@gmail.com>","version":"0.1.28","license":"Apache-2.0","types":"index.d.ts","type":"commonjs"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import * as http from 'node:http';
|
|
3
|
+
import { ListenOptions } from 'node:net';
|
|
4
|
+
|
|
5
|
+
/*!
|
|
6
|
+
* connect
|
|
7
|
+
* Copyright(c) 2010 Sencha Inc.
|
|
8
|
+
* Copyright(c) 2011 TJ Holowaychuk
|
|
9
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
10
|
+
* Copyright(c) 2025 Rstackjs
|
|
11
|
+
* MIT Licensed
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Public and internal Connect types.
|
|
16
|
+
*/
|
|
17
|
+
interface IncomingMessage extends http.IncomingMessage {
|
|
18
|
+
originalUrl?: http.IncomingMessage['url'] | undefined;
|
|
19
|
+
}
|
|
20
|
+
type NextFunction = (err?: any) => void;
|
|
21
|
+
type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => unknown;
|
|
22
|
+
type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => unknown;
|
|
23
|
+
type ErrorHandleFunction = (err: any, req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => unknown;
|
|
24
|
+
type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
|
|
25
|
+
type ServerHandle = HandleFunction | http.Server;
|
|
26
|
+
type ListenCallback = () => void;
|
|
27
|
+
interface ServerStackItem {
|
|
28
|
+
route: string;
|
|
29
|
+
handle: ServerHandle;
|
|
30
|
+
}
|
|
31
|
+
interface Server extends EventEmitter {
|
|
32
|
+
(req: http.IncomingMessage, res: http.ServerResponse, next?: NextFunction): void;
|
|
33
|
+
route: string;
|
|
34
|
+
stack: ServerStackItem[];
|
|
35
|
+
handle(req: http.IncomingMessage, res: http.ServerResponse, next?: NextFunction): void;
|
|
36
|
+
use(fn: NextHandleFunction): Server;
|
|
37
|
+
use(fn: HandleFunction): Server;
|
|
38
|
+
use(fn: http.Server): Server;
|
|
39
|
+
use(route: string, fn: NextHandleFunction): Server;
|
|
40
|
+
use(route: string, fn: HandleFunction): Server;
|
|
41
|
+
use(route: string, fn: http.Server): Server;
|
|
42
|
+
listen(port: number, hostname?: string, backlog?: number, callback?: ListenCallback): http.Server;
|
|
43
|
+
listen(port: number, hostname?: string, callback?: ListenCallback): http.Server;
|
|
44
|
+
listen(path: string, callback?: ListenCallback): http.Server;
|
|
45
|
+
listen(options: ListenOptions, callback?: ListenCallback): http.Server;
|
|
46
|
+
listen(handle: unknown, listeningListener?: ListenCallback): http.Server;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a new connect server.
|
|
50
|
+
*
|
|
51
|
+
* @return {function}
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
declare function connect(): Server;
|
|
55
|
+
|
|
56
|
+
export { connect };
|
|
57
|
+
export type { ErrorHandleFunction, HandleFunction, IncomingMessage, NextFunction, NextHandleFunction, Server, ServerHandle, ServerStackItem, SimpleHandleFunction };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2010 Sencha Inc.
|
|
4
|
+
Copyright (c) 2011 LearnBoost
|
|
5
|
+
Copyright (c) 2011-2014 TJ Holowaychuk
|
|
6
|
+
Copyright (c) 2015 Douglas Christopher Wilson
|
|
7
|
+
Copyright (c) 2025 Rstackjs
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
10
|
+
a copy of this software and associated documentation files (the
|
|
11
|
+
'Software'), to deal in the Software without restriction, including
|
|
12
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
13
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
14
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
15
|
+
the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be
|
|
18
|
+
included in all copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
21
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
22
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
23
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
24
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
25
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
26
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"connect-next","author":"TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)","version":"5.0.0","license":"MIT","types":"index.d.ts","type":"module"}
|