gencow 0.1.192 → 0.1.193

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.
@@ -74,11 +74,15 @@ export function addDeployAppToConfigSource(src, appName) {
74
74
  if (src.includes("deploy:")) return src;
75
75
 
76
76
  const deployBlock = ` deploy: {\n app: "${appName}",\n },\n`;
77
- const defineConfigSource = src.replace(/}\s*\)\s*;?\s*$/, `${deployBlock}});\n`);
78
- if (defineConfigSource !== src) return defineConfigSource;
77
+ const insertBeforeClosingObject = (pattern) => {
78
+ const match = src.match(pattern);
79
+ if (!match || match.index == null) return null;
80
+ const prefix = src.slice(0, match.index).trimEnd();
81
+ const separator = prefix.endsWith(",") || prefix.endsWith("{") ? "\n" : ",\n";
82
+ return `${prefix}${separator}${deployBlock}${src.slice(match.index)}`;
83
+ };
79
84
 
80
- const objectExportSource = src.replace(/}\s*;?\s*$/, `${deployBlock}};\n`);
81
- return objectExportSource;
85
+ return insertBeforeClosingObject(/\}\s*\)\s*;?\s*$/u) ?? insertBeforeClosingObject(/\}\s*;?\s*$/u) ?? src;
82
86
  }
83
87
 
84
88
  export { resolveCreatedAppId };
@@ -110,6 +110,7 @@ export function validateServerRuntimeBundle(source, options = {}) {
110
110
  String.raw`(?:resolve|join|new\s+URL)\([^;\n]{0,640}(?:${repositorySourcePath}|["'](?:platform|server|route-gateway)["']\s*,\s*["']src["'])`,
111
111
  "iu",
112
112
  ),
113
+ /resolve\([^;\n]{0,320}\bfunctionsPath\b[^;\n]{0,320}["']\.\.\/src\/platform-api-surface\.ts["']/iu,
113
114
  ];
114
115
  const errors = repositorySourceImportPatterns.some((pattern) => pattern.test(source))
115
116
  ? [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gencow",
3
- "version": "0.1.192",
3
+ "version": "0.1.193",
4
4
  "description": "Gencow — AI Backend Engine",
5
5
  "type": "module",
6
6
  "bin": {