@rspack/core 0.7.6-canary-1a0d77d-20240627143904 → 1.0.0-alpha.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.
Files changed (64) hide show
  1. package/README.md +2 -2
  2. package/compiled/webpack-sources/index.d.ts +130 -0
  3. package/compiled/webpack-sources/index.js +3520 -0
  4. package/compiled/webpack-sources/license +21 -0
  5. package/compiled/webpack-sources/package.json +1 -0
  6. package/dist/Chunk.d.ts +19 -14
  7. package/dist/Chunk.js +22 -17
  8. package/dist/ChunkGraph.d.ts +1 -1
  9. package/dist/ChunkGraph.js +5 -5
  10. package/dist/ChunkGroup.d.ts +17 -7
  11. package/dist/ChunkGroup.js +12 -2
  12. package/dist/Compilation.d.ts +19 -23
  13. package/dist/Compilation.js +20 -43
  14. package/dist/Compiler.d.ts +1 -1
  15. package/dist/Compiler.js +32 -2
  16. package/dist/Entrypoint.d.ts +1 -1
  17. package/dist/Entrypoint.js +2 -2
  18. package/dist/Module.d.ts +12 -7
  19. package/dist/Module.js +1 -0
  20. package/dist/NormalModule.d.ts +0 -1
  21. package/dist/NormalModule.js +0 -7
  22. package/dist/NormalModuleFactory.d.ts +1 -0
  23. package/dist/NormalModuleFactory.js +1 -22
  24. package/dist/RspackError.d.ts +8 -0
  25. package/dist/RspackError.js +21 -0
  26. package/dist/Stats.d.ts +2 -2
  27. package/dist/Template.d.ts +1 -1
  28. package/dist/Template.js +2 -2
  29. package/dist/builtin-loader/swc/index.d.ts +0 -4
  30. package/dist/builtin-loader/swc/index.js +1 -5
  31. package/dist/builtin-loader/swc/preact.d.ts +3 -4
  32. package/dist/builtin-loader/swc/types.d.ts +2 -17
  33. package/dist/builtin-plugin/BundlerInfoRspackPlugin.d.ts +1 -0
  34. package/dist/builtin-plugin/BundlerInfoRspackPlugin.js +1 -0
  35. package/dist/builtin-plugin/SwcJsMinimizerPlugin.d.ts +0 -28
  36. package/dist/builtin-plugin/SwcJsMinimizerPlugin.js +20 -69
  37. package/dist/builtin-plugin/css-extract/index.d.ts +2 -2
  38. package/dist/config/adapter.js +23 -10
  39. package/dist/config/adapterRuleUse.js +0 -11
  40. package/dist/config/defaults.js +22 -30
  41. package/dist/config/normalization.js +13 -5
  42. package/dist/config/zod.d.ts +168 -43
  43. package/dist/config/zod.js +23 -11
  44. package/dist/container/ModuleFederationPlugin.js +1 -1
  45. package/dist/container/default.runtime.js +1 -170
  46. package/dist/exports.d.ts +1 -1
  47. package/dist/exports.js +1 -1
  48. package/dist/lite-tapable/index.js +2 -2
  49. package/dist/loader-runner/index.js +28 -7
  50. package/dist/rspackOptionsApply.js +3 -0
  51. package/dist/stats/DefaultStatsFactoryPlugin.js +35 -11
  52. package/dist/stats/DefaultStatsPrinterPlugin.js +2 -2
  53. package/dist/stats/statsFactoryUtils.d.ts +13 -4
  54. package/dist/util/index.d.ts +2 -2
  55. package/dist/util/index.js +4 -3
  56. package/dist/util/memoize.js +5 -1
  57. package/dist/util/source.d.ts +1 -1
  58. package/dist/util/source.js +1 -1
  59. package/package.json +12 -7
  60. package/dist/builtin-loader/swc/emotion.d.ts +0 -17
  61. package/dist/builtin-loader/swc/emotion.js +0 -22
  62. package/dist/builtin-loader/swc/relay.d.ts +0 -5
  63. package/dist/builtin-loader/swc/relay.js +0 -48
  64. package/dist/container/default.runtime.d.ts +0 -2
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "0.7.6-canary-1a0d77d-20240627143904",
3
+ "version": "1.0.0-alpha.0",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "provenance": true
12
+ },
9
13
  "exports": {
10
14
  ".": {
11
15
  "default": "./dist/index.js"
@@ -72,17 +76,17 @@
72
76
  "tsc-alias": "^1.8.8",
73
77
  "wast-loader": "^1.11.4",
74
78
  "watchpack": "^2.4.0",
79
+ "webpack-sources": "3.2.3",
75
80
  "zod": "^3.21.4",
76
81
  "zod-validation-error": "1.3.1",
77
- "@rspack/core": "0.7.6-canary-1a0d77d-20240627143904",
78
- "@rspack/plugin-minify": "^0.7.6-canary-1a0d77d-20240627143904"
82
+ "@rspack/core": "1.0.0-alpha.0",
83
+ "@rspack/plugin-minify": "^1.0.0-alpha.0"
79
84
  },
80
85
  "dependencies": {
81
86
  "@module-federation/runtime-tools": "0.1.6",
82
87
  "caniuse-lite": "^1.0.30001616",
83
88
  "tapable": "2.2.1",
84
- "webpack-sources": "3.2.3",
85
- "@rspack/binding": "0.7.6-canary-1a0d77d-20240627143904"
89
+ "@rspack/binding": "1.0.0-alpha.0"
86
90
  },
87
91
  "peerDependencies": {
88
92
  "@swc/helpers": ">=0.5.1"
@@ -93,9 +97,10 @@
93
97
  }
94
98
  },
95
99
  "scripts": {
96
- "build": "prebundle && tsc -b ./tsconfig.build.json && tsc-alias -p tsconfig.build.json",
97
- "build:force": "prebundle && tsc -b ./tsconfig.build.json --force && tsc-alias -p tsconfig.build.json",
100
+ "build": "prebundle && tsc -b ./tsconfig.build.json && tsc-alias -p tsconfig.build.json && npm run prepare-container-runtime",
101
+ "build:force": "prebundle && tsc -b ./tsconfig.build.json --force && tsc-alias -p tsconfig.build.json && npm run prepare-container-runtime",
98
102
  "dev": "prebundle && tsc -w",
103
+ "prepare-container-runtime": "node ./scripts/prepare-container-runtime.js",
99
104
  "doc-coverage": "node scripts/check-documentation-coverage.mjs",
100
105
  "api-extractor": "api-extractor run --verbose",
101
106
  "api-extractor:ci": "api-extractor run --verbose || diff temp/api.md etc/api.md"
@@ -1,17 +0,0 @@
1
- type EmotionConfigImportMap = {
2
- [packageName: string]: {
3
- [exportName: string]: {
4
- canonicalImport?: [string, string];
5
- };
6
- };
7
- };
8
- type EmotionConfig = {
9
- sourceMap?: boolean;
10
- autoLabel?: "never" | "dev-only" | "always";
11
- labelFormat?: string;
12
- importMap?: EmotionConfigImportMap;
13
- };
14
- type EmotionOptions = boolean | EmotionConfig | undefined;
15
- declare function resolveEmotion(emotion: EmotionOptions, isProduction: boolean): EmotionConfig | undefined;
16
- export { resolveEmotion };
17
- export type { EmotionOptions };
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveEmotion = void 0;
4
- function resolveEmotion(emotion, isProduction) {
5
- if (!emotion) {
6
- return undefined;
7
- }
8
- if (emotion === true) {
9
- emotion = {};
10
- }
11
- const autoLabel = emotion?.autoLabel ?? "dev-only";
12
- const emotionConfig = {
13
- enabled: true,
14
- // @ts-expect-error autoLabel is string for JavaScript interface, however is boolean for Rust interface
15
- autoLabel: autoLabel === "dev-only" ? !isProduction : autoLabel === "always",
16
- importMap: emotion?.importMap,
17
- labelFormat: emotion?.labelFormat ?? "[local]",
18
- sourcemap: isProduction ? false : emotion?.sourceMap ?? true
19
- };
20
- return emotionConfig;
21
- }
22
- exports.resolveEmotion = resolveEmotion;
@@ -1,5 +0,0 @@
1
- import type { RawRelayConfig } from "@rspack/binding";
2
- type RelayOptions = boolean | RawRelayConfig | undefined;
3
- declare function resolveRelay(relay: RelayOptions, rootDir: string): RawRelayConfig | undefined;
4
- export { resolveRelay };
5
- export type { RelayOptions };
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.resolveRelay = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- function getRelayConfigFromProject(rootDir) {
9
- for (const configName of [
10
- "relay.config.json",
11
- "relay.config.js",
12
- "package.json"
13
- ]) {
14
- const configPath = path_1.default.join(rootDir, configName);
15
- try {
16
- let config = require(configPath);
17
- let finalConfig;
18
- if (configName === "package.json") {
19
- finalConfig = config?.relay;
20
- }
21
- else {
22
- finalConfig = config;
23
- }
24
- if (finalConfig) {
25
- return {
26
- language: finalConfig.language,
27
- artifactDirectory: finalConfig.artifactDirectory
28
- };
29
- }
30
- }
31
- catch (_) { }
32
- }
33
- }
34
- function resolveRelay(relay, rootDir) {
35
- if (!relay) {
36
- return undefined;
37
- }
38
- // Search relay config based on
39
- if (relay === true) {
40
- return (getRelayConfigFromProject(rootDir) || {
41
- language: "javascript"
42
- });
43
- }
44
- else {
45
- return relay;
46
- }
47
- }
48
- exports.resolveRelay = resolveRelay;
@@ -1,2 +0,0 @@
1
- declare function _exports(): void;
2
- export = _exports;