@synchronized-studio/cmsassets-agent 0.3.8 → 0.3.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.
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  saveReport,
10
10
  scan,
11
11
  verify
12
- } from "./chunk-6B2ZEEDF.js";
12
+ } from "./chunk-WXCGZDUK.js";
13
13
  import "./chunk-KYRW5D2O.js";
14
14
  import "./chunk-E74TGIFQ.js";
15
15
  import "./chunk-QGM4M3NI.js";
@@ -75,12 +75,22 @@ function injectNuxtRuntimeConfig(projectRoot) {
75
75
  }
76
76
  const externalResult = tryInjectInExternalRuntimeConfig(absPath, content, projectRoot);
77
77
  if (externalResult) return externalResult;
78
+ if (hasRuntimeConfigShorthand(content)) {
79
+ return {
80
+ added: false,
81
+ reason: "runtimeConfig appears as a shorthand property (likely imported as a variable) but source file could not be resolved. Add cmsAssetsUrl manually."
82
+ };
83
+ }
78
84
  return injectInline(absPath, configFile, content);
79
85
  }
80
86
  var ENTRY = `cmsAssetsUrl: process.env.CMS_ASSETS_URL || ''`;
87
+ function hasRuntimeConfigShorthand(content) {
88
+ return /\bruntimeConfig\s*[,\n]/.test(content) && !/runtimeConfig\s*:/.test(content);
89
+ }
81
90
  function tryInjectInExternalRuntimeConfig(nuxtConfigPath, content, projectRoot) {
82
91
  const importRe = /import\s+runtimeConfig\s+from\s+["']([^"']+)["']/;
83
- const importMatch = content.match(importRe);
92
+ const requireRe = /(?:const|let|var)\s+runtimeConfig\s*=\s*require\s*\(\s*["']([^"']+)["']\s*\)/;
93
+ const importMatch = content.match(importRe) || content.match(requireRe);
84
94
  if (!importMatch) return null;
85
95
  const importPath = importMatch[1];
86
96
  const configDir = dirname(nuxtConfigPath);
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  saveReport,
27
27
  scan,
28
28
  verify
29
- } from "./chunk-6B2ZEEDF.js";
29
+ } from "./chunk-WXCGZDUK.js";
30
30
  import {
31
31
  aiReviewAll
32
32
  } from "./chunk-Q3VHF32G.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synchronized-studio/cmsassets-agent",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "CLI agent that auto-integrates @synchronized-studio/response-transformer into any JS/TS project.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",