@bleedingdev/modern-js-plugin 3.9.3-ultramodern.9 → 3.11.3-ultramodern.10

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.
@@ -37,7 +37,6 @@ var __webpack_require__ = {};
37
37
  var __webpack_exports__ = {};
38
38
  __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
- clearFilesOverTime: ()=>clearFilesOverTime,
41
40
  getConfigFilePath: ()=>getConfigFilePath,
42
41
  loadConfig: ()=>loadConfig,
43
42
  loadTypeScriptFile: ()=>loadTypeScriptFile
@@ -51,18 +50,6 @@ const getConfigFilePath = (appDirectory, configFilePath)=>{
51
50
  if (external_path_default().isAbsolute(configFilePath)) return configFilePath;
52
51
  return external_path_default().resolve(appDirectory, configFilePath);
53
52
  };
54
- const clearFilesOverTime = async (targetDir, overtime)=>{
55
- try {
56
- const files = await (0, utils_namespaceObject.globby)(`${targetDir}/**/*`, {
57
- stats: true,
58
- absolute: true
59
- });
60
- const currentTime = Date.now();
61
- if (files.length > 0) {
62
- for (const file of files)if (currentTime - file.stats.birthtimeMs >= 1000 * overtime) utils_namespaceObject.fs.unlinkSync(file.path);
63
- }
64
- } catch (err) {}
65
- };
66
53
  async function loadConfigContent(configFile) {
67
54
  const jitiFrom = __filename;
68
55
  const jiti = (0, external_jiti_namespaceObject.createJiti)(jitiFrom, {
@@ -103,12 +90,10 @@ const loadConfig = async (appDirectory, configFile)=>{
103
90
  config
104
91
  };
105
92
  };
106
- exports.clearFilesOverTime = __webpack_exports__.clearFilesOverTime;
107
93
  exports.getConfigFilePath = __webpack_exports__.getConfigFilePath;
108
94
  exports.loadConfig = __webpack_exports__.loadConfig;
109
95
  exports.loadTypeScriptFile = __webpack_exports__.loadTypeScriptFile;
110
96
  for(var __rspack_i in __webpack_exports__)if (-1 === [
111
- "clearFilesOverTime",
112
97
  "getConfigFilePath",
113
98
  "loadConfig",
114
99
  "loadTypeScriptFile"
package/dist/cjs/hooks.js CHANGED
@@ -146,13 +146,13 @@ function createAsyncPipelineHook() {
146
146
  call
147
147
  };
148
148
  }
149
- __webpack_require__.d(__webpack_exports__, {
150
- createAsyncHook: ()=>createAsyncHook,
151
- createAsyncInterruptHook: ()=>createAsyncInterruptHook,
152
- createAsyncPipelineHook: ()=>createAsyncPipelineHook,
153
- createCollectAsyncHook: ()=>createCollectAsyncHook,
154
- createCollectSyncHook: ()=>createCollectSyncHook,
155
- createSyncHook: ()=>createSyncHook
149
+ __webpack_require__.d(__webpack_exports__, {}, {
150
+ createAsyncHook: createAsyncHook,
151
+ createAsyncInterruptHook: createAsyncInterruptHook,
152
+ createAsyncPipelineHook: createAsyncPipelineHook,
153
+ createCollectAsyncHook: createCollectAsyncHook,
154
+ createCollectSyncHook: createCollectSyncHook,
155
+ createSyncHook: createSyncHook
156
156
  });
157
157
  exports.createAsyncHook = __webpack_exports__.createAsyncHook;
158
158
  exports.createAsyncInterruptHook = __webpack_exports__.createAsyncInterruptHook;
@@ -127,8 +127,8 @@ function createPluginManager() {
127
127
  isPluginExists: (name)=>plugins.has(name)
128
128
  };
129
129
  }
130
- __webpack_require__.d(__webpack_exports__, {
131
- createPluginManager: ()=>createPluginManager
130
+ __webpack_require__.d(__webpack_exports__, {}, {
131
+ createPluginManager: createPluginManager
132
132
  });
133
133
  exports.createPluginManager = __webpack_exports__.createPluginManager;
134
134
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -1,4 +1,4 @@
1
- import { compatibleRequire, fs, globby } from "@modern-js/utils";
1
+ import { compatibleRequire, fs } from "@modern-js/utils";
2
2
  import { createJiti } from "jiti";
3
3
  import path from "path";
4
4
  const getConfigFilePath = (appDirectory, configFilePath)=>{
@@ -6,18 +6,6 @@ const getConfigFilePath = (appDirectory, configFilePath)=>{
6
6
  if (path.isAbsolute(configFilePath)) return configFilePath;
7
7
  return path.resolve(appDirectory, configFilePath);
8
8
  };
9
- const clearFilesOverTime = async (targetDir, overtime)=>{
10
- try {
11
- const files = await globby(`${targetDir}/**/*`, {
12
- stats: true,
13
- absolute: true
14
- });
15
- const currentTime = Date.now();
16
- if (files.length > 0) {
17
- for (const file of files)if (currentTime - file.stats.birthtimeMs >= 1000 * overtime) fs.unlinkSync(file.path);
18
- }
19
- } catch (err) {}
20
- };
21
9
  async function loadConfigContent(configFile) {
22
10
  const jitiFrom = import.meta.url;
23
11
  const jiti = createJiti(jitiFrom, {
@@ -58,4 +46,4 @@ const loadConfig = async (appDirectory, configFile)=>{
58
46
  config
59
47
  };
60
48
  };
61
- export { clearFilesOverTime, getConfigFilePath, loadConfig, loadTypeScriptFile };
49
+ export { getConfigFilePath, loadConfig, loadTypeScriptFile };
@@ -1,5 +1,5 @@
1
1
  import "node:module";
2
- import { compatibleRequire, fs, globby } from "@modern-js/utils";
2
+ import { compatibleRequire, fs } from "@modern-js/utils";
3
3
  import { createJiti } from "jiti";
4
4
  import path from "path";
5
5
  import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
@@ -9,18 +9,6 @@ const getConfigFilePath = (appDirectory, configFilePath)=>{
9
9
  if (path.isAbsolute(configFilePath)) return configFilePath;
10
10
  return path.resolve(appDirectory, configFilePath);
11
11
  };
12
- const clearFilesOverTime = async (targetDir, overtime)=>{
13
- try {
14
- const files = await globby(`${targetDir}/**/*`, {
15
- stats: true,
16
- absolute: true
17
- });
18
- const currentTime = Date.now();
19
- if (files.length > 0) {
20
- for (const file of files)if (currentTime - file.stats.birthtimeMs >= 1000 * overtime) fs.unlinkSync(file.path);
21
- }
22
- } catch (err) {}
23
- };
24
12
  async function loadConfigContent(configFile) {
25
13
  const jitiFrom = import.meta.url;
26
14
  const jiti = createJiti(jitiFrom, {
@@ -61,4 +49,4 @@ const loadConfig = async (appDirectory, configFile)=>{
61
49
  config
62
50
  };
63
51
  };
64
- export { clearFilesOverTime, getConfigFilePath, loadConfig, loadTypeScriptFile };
52
+ export { getConfigFilePath, loadConfig, loadTypeScriptFile };
@@ -1,10 +1,4 @@
1
1
  export declare const getConfigFilePath: (appDirectory: string, configFilePath: string | false) => string | false;
2
- /**
3
- *
4
- * @param targetDir target dir
5
- * @param overtime Unit of second
6
- */
7
- export declare const clearFilesOverTime: (targetDir: string, overtime: number) => Promise<void>;
8
2
  /**
9
3
  * Parse and load user config file, support extensions like .ts, mjs, js, ejs.
10
4
  * @param appDirectory - App root directory, from which start search user config file.
@@ -1,4 +1,4 @@
1
- import type { FSWatcher } from '@modern-js/utils/watch-options';
1
+ import { chokidar } from '@modern-js/utils';
2
2
  import type { InternalContext } from '../../../types/cli/context.js';
3
3
  import type { CLIPluginExtends } from '../../../types/cli/plugin.js';
4
4
  /**
@@ -9,4 +9,4 @@ import type { CLIPluginExtends } from '../../../types/cli/plugin.js';
9
9
  * Treat a vanished file as "nothing to read" instead of rethrowing.
10
10
  */
11
11
  export declare const safeReadFileSync: (filePath: string) => string | undefined;
12
- export declare const createFileWatcher: <Extends extends CLIPluginExtends>(appContext: InternalContext<Extends>) => Promise<FSWatcher | undefined>;
12
+ export declare const createFileWatcher: <Extends extends CLIPluginExtends>(appContext: InternalContext<Extends>) => Promise<ReturnType<typeof chokidar.watch> | undefined>;
@@ -136,6 +136,8 @@ export interface StreamSSRExtender extends SSRRenderLifecycle {
136
136
  getStyleTags?: () => string;
137
137
  processStream?: (stream: NodeJS.ReadWriteStream) => NodeJS.ReadWriteStream;
138
138
  processReadableStream?: (stream: ReadableStream<Uint8Array>) => ReadableStream<Uint8Array>;
139
+ /** Runs after document assembly; cancellation must propagate to the input. */
140
+ processResponseStream?: (stream: ReadableStream<Uint8Array>) => ReadableStream<Uint8Array>;
139
141
  /** Body transforms run after all render transforms, preserving order in each phase. */
140
142
  streamPhase?: 'render' | 'body';
141
143
  }
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.9.3-ultramodern.9",
20
+ "version": "3.11.3-ultramodern.10",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -79,17 +79,17 @@
79
79
  }
80
80
  },
81
81
  "dependencies": {
82
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.3-ultramodern.9",
83
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.3-ultramodern.9",
84
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.3-ultramodern.9",
85
- "@rsbuild/core": "2.2.13",
86
- "@swc/helpers": "^0.5.23",
82
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.11.3-ultramodern.10",
83
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.11.3-ultramodern.10",
84
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.11.3-ultramodern.10",
85
+ "@rsbuild/core": "2.3.3",
86
+ "@swc/helpers": "^0.5.24",
87
87
  "jiti": "2.7.0"
88
88
  },
89
89
  "devDependencies": {
90
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.9.3-ultramodern.9",
91
- "@rslib/core": "1.0.3",
92
- "@types/node": "^26.6.5",
90
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.11.3-ultramodern.10",
91
+ "@rslib/core": "1.0.7",
92
+ "@types/node": "^26.6.6",
93
93
  "@types/react": "^19.3.0",
94
94
  "typescript": "7.0.2"
95
95
  },