@windrun-huaiin/dev-scripts 11.0.1 → 11.0.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"backend-core.d.ts","sourceRoot":"","sources":["../../src/commands/backend-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAYnC,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAiCD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QAkF3D;AAED,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,OAAe,EACtB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,EAAE,CAAC,CAuB5B;AAED,wBAAgB,qBAAqB,SAKpC;AAED,wBAAsB,qBAAqB,CACzC,eAAe,EAAE,MAAM,EACvB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA0CjB;AAED,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,MAAM,EACpB,UAAU,GAAE,MAAiB,EAC7B,KAAK,GAAE,OAAe,EACtB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,EAAE,CAAC,CAqC5B"}
1
+ {"version":3,"file":"backend-core.d.ts","sourceRoot":"","sources":["../../src/commands/backend-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAYnC,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAiCD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QAkF3D;AAED,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,OAAe,EACtB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,EAAE,CAAC,CAuB5B;AAED,wBAAgB,qBAAqB,SAKpC;AAED,wBAAsB,qBAAqB,CACzC,eAAe,EAAE,MAAM,EACvB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA0CjB;AAED,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,MAAM,EACpB,UAAU,GAAE,MAAiB,EAC7B,KAAK,GAAE,OAAe,EACtB,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,eAAe,EAAE,CAAC,CA6C5B"}
@@ -190,7 +190,16 @@ async function syncBackendCoreMigrations(destDirInput, schemaName = 'nextai', fo
190
190
  }
191
191
  // Read SQL content and replace schema name
192
192
  const sqlContent = await fs.promises.readFile(from, 'utf8');
193
- const updatedContent = sqlContent.replace(/nextai\./g, `${schemaName}.`);
193
+ // Diff handle init-schema.sql file
194
+ let updatedContent;
195
+ if (file.name === 'init-schema.sql') {
196
+ // Just use 'schemaName' to replace 'nextai'
197
+ updatedContent = sqlContent.replace(/\bnextai\b/g, schemaName);
198
+ }
199
+ else {
200
+ // Others use 'schemaName.' to replace 'nextai.'
201
+ updatedContent = sqlContent.replace(/nextai\./g, `${schemaName}.`);
202
+ }
194
203
  await fs.promises.writeFile(to, updatedContent, 'utf8');
195
204
  results.push({ file: to, status: exists ? 'overwritten' : 'copied' });
196
205
  }
@@ -188,7 +188,16 @@ async function syncBackendCoreMigrations(destDirInput, schemaName = 'nextai', fo
188
188
  }
189
189
  // Read SQL content and replace schema name
190
190
  const sqlContent = await promises.readFile(from, 'utf8');
191
- const updatedContent = sqlContent.replace(/nextai\./g, `${schemaName}.`);
191
+ // Diff handle init-schema.sql file
192
+ let updatedContent;
193
+ if (file.name === 'init-schema.sql') {
194
+ // Just use 'schemaName' to replace 'nextai'
195
+ updatedContent = sqlContent.replace(/\bnextai\b/g, schemaName);
196
+ }
197
+ else {
198
+ // Others use 'schemaName.' to replace 'nextai.'
199
+ updatedContent = sqlContent.replace(/nextai\./g, `${schemaName}.`);
200
+ }
192
201
  await promises.writeFile(to, updatedContent, 'utf8');
193
202
  results.push({ file: to, status: exists ? 'overwritten' : 'copied' });
194
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windrun-huaiin/dev-scripts",
3
- "version": "11.0.1",
3
+ "version": "11.0.3",
4
4
  "description": "Development scripts for multilingual projects",
5
5
  "main": "dist/index.js",
6
6
  "bin": {