wormajs 0.2.6 → 0.2.7

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 CHANGED
@@ -85,8 +85,8 @@ Effective contributions will win you a certain reputation in the worma community
85
85
 
86
86
  ## Contributors
87
87
 
88
- <a href="https://github.com/alovajs/alova/graphs/contributors">
89
- <img src="https://contrib.rocks/image?repo=alovajs/alova&max=30&columns=10" />
88
+ <a href="https://github.com/alovajs/devtools/graphs/contributors">
89
+ <img src="https://contrib.rocks/image?repo=alovajs/devtools&max=30&columns=10" />
90
90
  </a>
91
91
 
92
92
  ## LICENSE
@@ -146,9 +146,11 @@ class TemplateParser {
146
146
  const tsWp = node_path_1.default.resolve(__dirname, '../../workerPool/worker.ts');
147
147
  const { existsSync: fex } = await Promise.resolve().then(() => __importStar(require('node:fs')));
148
148
  const workerScript = fex(jsWp) ? jsWp : tsWp;
149
- // P2: Reuse worker pool via PoolManager singleton avoids create/destroy overhead across repeated generate() calls
149
+ // Reuse workers only within the same generator output. The workerData document is immutable after spawn,
150
+ // so generators in the same project must not share a pool.
151
+ const outputDir = node_path_1.default.resolve(this.options.projectPath, this.options.generatorConfig.output);
150
152
  const pool = poolManager_1.PoolManager.getInstance().get({
151
- key: `schemaWorker_${this.options.projectPath}`,
153
+ key: `schemaWorker_${outputDir}`,
152
154
  workerScript,
153
155
  sharedContext: {
154
156
  document: this.document,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wormajs",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "A modern OpenAPI code generator - Generate type-safe API clients from OpenAPI specs",
5
5
  "author": "worma",
6
6
  "license": "MIT",