@brightsideoy/kama 0.1.0-alpha.110 → 0.1.0-alpha.112

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightsideoy/kama",
3
- "version": "0.1.0-alpha.110",
3
+ "version": "0.1.0-alpha.112",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -161,8 +161,16 @@ const outputContent = `// Auto-generated pre-bundled definitions for Kama Core E
161
161
  export const BUNDLED_DEFINITIONS = ${JSON.stringify(bundled, null, 2)};
162
162
  `;
163
163
 
164
- // 🎯 Write to BOTH package dist/server locations so imports resolve cleanly
164
+ // 🎯 Always ensure target worker directory exists before writing
165
+ const activeWorkerDir = path.resolve(process.cwd(), 'kama-worker');
166
+ if (!fs.existsSync(activeWorkerDir)) {
167
+ fs.mkdirSync(activeWorkerDir, { recursive: true });
168
+ }
169
+
170
+ // 🎯 Write to Kama worker directory as well as package locations
165
171
  const targetDirs = [
172
+ activeWorkerDir,
173
+ path.resolve(process.cwd(), 'cms-worker'), // legacy fallback
166
174
  path.resolve(packageRootDir, 'server/db'),
167
175
  path.resolve(process.cwd(), 'node_modules/@brightsideoy/kama/server/db'),
168
176
  path.resolve(process.cwd(), 'node_modules/@brightsideoy/kama/dist'),
@@ -173,7 +181,7 @@ for (const dir of targetDirs) {
173
181
  if (fs.existsSync(dir)) {
174
182
  const outputPath = path.resolve(dir, 'bundled-definitions.ts');
175
183
  fs.writeFileSync(outputPath, outputContent, 'utf-8');
176
- // Also write .js version for built packages
184
+ // Also write .js version for built packages / worker runtime imports
177
185
  const jsOutputPath = path.resolve(dir, 'bundled-definitions.js');
178
186
  fs.writeFileSync(jsOutputPath, `export const BUNDLED_DEFINITIONS = ${JSON.stringify(bundled, null, 2)};\n`, 'utf-8');
179
187
  }