@utoo/pack 1.4.17 → 1.4.18-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.
package/cjs/binding.d.ts CHANGED
@@ -125,6 +125,18 @@ export interface NapiTurboEngineOptions {
125
125
  dependencyTracking?: boolean
126
126
  /** Hint that this turbo-tasks instance is for a short-lived one-shot session. */
127
127
  isShortSession?: boolean
128
+ /** Turbopack memory eviction mode for the persistent cache. */
129
+ turbopackMemoryEviction?: MemoryEvictionMode
130
+ }
131
+ /** Turbopack's memory eviction strategy for the persistent cache. */
132
+ export const enum MemoryEvictionMode {
133
+ /** Never evict. */
134
+ Off = "off",
135
+ /**
136
+ * After every snapshot, evict all evictable tasks from memory, reloading
137
+ * them from disk on demand.
138
+ */
139
+ Full = "full"
128
140
  }
129
141
  export declare function projectNew(options: NapiProjectOptions, turboEngineOptions: NapiTurboEngineOptions, napiCallbacks: NapiTurbopackCallbacksJsObject): Promise<{ __napiType: "Project" }>
130
142
  export declare function projectUpdate(project: { __napiType: "Project" }, options: NapiPartialProjectOptions): Promise<void>
@@ -39,6 +39,7 @@ async function buildInternal(bundleOptions, projectPath, rootPath) {
39
39
  const resolvedProjectPath = projectPath || process.cwd();
40
40
  const resolvedRootPath = rootPath || projectPath || process.cwd();
41
41
  const persistentCaching = (_a = bundleOptions.config.persistentCaching) !== null && _a !== void 0 ? _a : true;
42
+ const turbopackMemoryEviction = (bundleOptions.config.turbopackMemoryEviction === false ? "off" : "full");
42
43
  const shouldCreateWebpackStats = Boolean(process.env.ANALYZE) || Boolean(bundleOptions.config.stats);
43
44
  (0, htmlEntry_1.processHtmlEntry)(bundleOptions.config, resolvedProjectPath);
44
45
  (0, validateEntry_1.validateEntryPaths)(bundleOptions.config, resolvedProjectPath);
@@ -65,6 +66,7 @@ async function buildInternal(bundleOptions, projectPath, rootPath) {
65
66
  packPath: (0, common_1.getPackPath)(),
66
67
  }, {
67
68
  persistentCaching,
69
+ turbopackMemoryEviction,
68
70
  // Build mode is a short-lived, one-shot compilation, so avoid paying
69
71
  // dependency graph bookkeeping cost unless the persistent cache needs it.
70
72
  dependencyTracking: persistentCaching,
package/cjs/core/hmr.js CHANGED
@@ -63,6 +63,7 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
63
63
  await (0, cleanOutput_1.cleanOutput)(bundleOptions.config, resolvedProjectPath);
64
64
  const createProject = (0, project_1.projectFactory)();
65
65
  const persistentCaching = (_a = bundleOptions.config.persistentCaching) !== null && _a !== void 0 ? _a : true;
66
+ const turbopackMemoryEviction = (bundleOptions.config.turbopackMemoryEviction === false ? "off" : "full");
66
67
  const persistentCacheLock = await (0, lockfile_1.acquirePersistentCacheLock)(resolvedProjectPath, "utoo pack dev", persistentCaching);
67
68
  const htmlConfigs = [
68
69
  ...(Array.isArray(bundleOptions.config.html)
@@ -102,6 +103,7 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
102
103
  packPath: (0, common_1.getPackPath)(),
103
104
  }, {
104
105
  persistentCaching,
106
+ turbopackMemoryEviction,
105
107
  });
106
108
  }
107
109
  catch (error) {
@@ -222,6 +222,17 @@
222
222
  "string",
223
223
  "null"
224
224
  ]
225
+ },
226
+ "turbopackMemoryEviction": {
227
+ "description": "Turbopack memory eviction mode for the persistent cache",
228
+ "anyOf": [
229
+ {
230
+ "$ref": "#/definitions/SchemaTurbopackMemoryEviction"
231
+ },
232
+ {
233
+ "type": "null"
234
+ }
235
+ ]
225
236
  }
226
237
  },
227
238
  "definitions": {
@@ -1751,6 +1762,23 @@
1751
1762
  }
1752
1763
  ]
1753
1764
  },
1765
+ "SchemaTurbopackMemoryEviction": {
1766
+ "description": "Turbopack memory eviction mode.",
1767
+ "anyOf": [
1768
+ {
1769
+ "type": "boolean"
1770
+ },
1771
+ {
1772
+ "$ref": "#/definitions/SchemaTurbopackMemoryEvictionMode"
1773
+ }
1774
+ ]
1775
+ },
1776
+ "SchemaTurbopackMemoryEvictionMode": {
1777
+ "type": "string",
1778
+ "enum": [
1779
+ "full"
1780
+ ]
1781
+ },
1754
1782
  "SchemaTurbopackModuleType": {
1755
1783
  "description": "Module type for a module rule (`type` / `moduleType` field).\n\nValues must match pack-core / Turbopack's `ConfiguredModuleType::parse()`.",
1756
1784
  "type": "string",
package/esm/binding.d.ts CHANGED
@@ -125,6 +125,18 @@ export interface NapiTurboEngineOptions {
125
125
  dependencyTracking?: boolean
126
126
  /** Hint that this turbo-tasks instance is for a short-lived one-shot session. */
127
127
  isShortSession?: boolean
128
+ /** Turbopack memory eviction mode for the persistent cache. */
129
+ turbopackMemoryEviction?: MemoryEvictionMode
130
+ }
131
+ /** Turbopack's memory eviction strategy for the persistent cache. */
132
+ export const enum MemoryEvictionMode {
133
+ /** Never evict. */
134
+ Off = "off",
135
+ /**
136
+ * After every snapshot, evict all evictable tasks from memory, reloading
137
+ * them from disk on demand.
138
+ */
139
+ Full = "full"
128
140
  }
129
141
  export declare function projectNew(options: NapiProjectOptions, turboEngineOptions: NapiTurboEngineOptions, napiCallbacks: NapiTurbopackCallbacksJsObject): Promise<{ __napiType: "Project" }>
130
142
  export declare function projectUpdate(project: { __napiType: "Project" }, options: NapiPartialProjectOptions): Promise<void>
@@ -33,6 +33,7 @@ async function buildInternal(bundleOptions, projectPath, rootPath) {
33
33
  const resolvedProjectPath = projectPath || process.cwd();
34
34
  const resolvedRootPath = rootPath || projectPath || process.cwd();
35
35
  const persistentCaching = (_a = bundleOptions.config.persistentCaching) !== null && _a !== void 0 ? _a : true;
36
+ const turbopackMemoryEviction = (bundleOptions.config.turbopackMemoryEviction === false ? "off" : "full");
36
37
  const shouldCreateWebpackStats = Boolean(process.env.ANALYZE) || Boolean(bundleOptions.config.stats);
37
38
  processHtmlEntry(bundleOptions.config, resolvedProjectPath);
38
39
  validateEntryPaths(bundleOptions.config, resolvedProjectPath);
@@ -59,6 +60,7 @@ async function buildInternal(bundleOptions, projectPath, rootPath) {
59
60
  packPath: getPackPath(),
60
61
  }, {
61
62
  persistentCaching,
63
+ turbopackMemoryEviction,
62
64
  // Build mode is a short-lived, one-shot compilation, so avoid paying
63
65
  // dependency graph bookkeeping cost unless the persistent cache needs it.
64
66
  dependencyTracking: persistentCaching,
package/esm/core/hmr.js CHANGED
@@ -58,6 +58,7 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
58
58
  await cleanOutput(bundleOptions.config, resolvedProjectPath);
59
59
  const createProject = projectFactory();
60
60
  const persistentCaching = (_a = bundleOptions.config.persistentCaching) !== null && _a !== void 0 ? _a : true;
61
+ const turbopackMemoryEviction = (bundleOptions.config.turbopackMemoryEviction === false ? "off" : "full");
61
62
  const persistentCacheLock = await acquirePersistentCacheLock(resolvedProjectPath, "utoo pack dev", persistentCaching);
62
63
  const htmlConfigs = [
63
64
  ...(Array.isArray(bundleOptions.config.html)
@@ -97,6 +98,7 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
97
98
  packPath: getPackPath(),
98
99
  }, {
99
100
  persistentCaching,
101
+ turbopackMemoryEviction,
100
102
  });
101
103
  }
102
104
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack",
3
- "version": "1.4.17",
3
+ "version": "1.4.18-alpha.0",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "esm/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "@hono/node-server": "^1.19.11",
42
42
  "@hono/node-ws": "^1.3.0",
43
43
  "@swc/helpers": "0.5.15",
44
- "@utoo/pack-shared": "1.4.17",
44
+ "@utoo/pack-shared": "1.4.18-alpha.0",
45
45
  "domparser-rs": "^0.0.7",
46
46
  "find-up": "4.1.0",
47
47
  "get-port": "5.1.1",
@@ -96,12 +96,12 @@
96
96
  "directory": "packages/pack"
97
97
  },
98
98
  "optionalDependencies": {
99
- "@utoo/pack-darwin-arm64": "1.4.17",
100
- "@utoo/pack-darwin-x64": "1.4.17",
101
- "@utoo/pack-linux-arm64-gnu": "1.4.17",
102
- "@utoo/pack-linux-arm64-musl": "1.4.17",
103
- "@utoo/pack-linux-x64-gnu": "1.4.17",
104
- "@utoo/pack-linux-x64-musl": "1.4.17",
105
- "@utoo/pack-win32-x64-msvc": "1.4.17"
99
+ "@utoo/pack-darwin-arm64": "1.4.18-alpha.0",
100
+ "@utoo/pack-darwin-x64": "1.4.18-alpha.0",
101
+ "@utoo/pack-linux-arm64-gnu": "1.4.18-alpha.0",
102
+ "@utoo/pack-linux-arm64-musl": "1.4.18-alpha.0",
103
+ "@utoo/pack-linux-x64-gnu": "1.4.18-alpha.0",
104
+ "@utoo/pack-linux-x64-musl": "1.4.18-alpha.0",
105
+ "@utoo/pack-win32-x64-msvc": "1.4.18-alpha.0"
106
106
  }
107
107
  }