@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/chunk-WXCGZDUK.js +1740 -0
- package/dist/cli.js +12 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
saveReport,
|
|
10
10
|
scan,
|
|
11
11
|
verify
|
|
12
|
-
} from "./chunk-
|
|
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
|
|
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
package/package.json
CHANGED