@gxp-dev/tools 2.0.66 → 2.0.68
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/bin/lib/utils/files.js
CHANGED
|
@@ -48,6 +48,7 @@ function createPackageJson(projectPath, projectName, description = "") {
|
|
|
48
48
|
version: "1.0.0",
|
|
49
49
|
description: description || `GxP Plugin: ${projectName}`,
|
|
50
50
|
main: "main.js",
|
|
51
|
+
type: "module",
|
|
51
52
|
scripts: {
|
|
52
53
|
...DEFAULT_SCRIPTS,
|
|
53
54
|
placeholder:
|
|
@@ -132,6 +133,16 @@ function updateExistingProject(projectPath) {
|
|
|
132
133
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"))
|
|
133
134
|
let updated = false
|
|
134
135
|
|
|
136
|
+
// Ensure "type": "module" so vite.extend.js (and other ESM files) don't
|
|
137
|
+
// trigger Node's MODULE_TYPELESS_PACKAGE_JSON reparse warning.
|
|
138
|
+
// Only set it if the field is missing — don't silently flip a project
|
|
139
|
+
// that has explicitly chosen "commonjs".
|
|
140
|
+
if (!packageJson.type) {
|
|
141
|
+
packageJson.type = "module"
|
|
142
|
+
console.log(' + Setting "type": "module"')
|
|
143
|
+
updated = true
|
|
144
|
+
}
|
|
145
|
+
|
|
135
146
|
// Check and add/update dependencies
|
|
136
147
|
if (!packageJson.dependencies) {
|
|
137
148
|
packageJson.dependencies = {}
|
package/package.json
CHANGED
package/runtime/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/
|
|
5
|
+
<link rel="icon" type="image/png" href="/@gx-runtime/logo.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>GxP Plugin Builder</title>
|
|
8
8
|
<script type="module">
|
package/runtime/logo.png
ADDED
|
Binary file
|
|
@@ -56,6 +56,7 @@ function getApiConfig() {
|
|
|
56
56
|
// Mock API: use local dev server with random token
|
|
57
57
|
const protocol = useHttps ? "https" : "http"
|
|
58
58
|
return {
|
|
59
|
+
apiDocsBaseUrl: `${ENVIRONMENT_URLS.production.apiBaseUrl}`,
|
|
59
60
|
apiBaseUrl: `${protocol}://localhost:${mockPort}/mock-api`,
|
|
60
61
|
authToken: generateMockToken(),
|
|
61
62
|
projectId: "team/project",
|
|
@@ -137,6 +138,7 @@ export const useGxpStore = defineStore("gxp-portal-app", () => {
|
|
|
137
138
|
|
|
138
139
|
// API configuration - initialized from environment
|
|
139
140
|
const apiConfig = getApiConfig()
|
|
141
|
+
const apiDocsBaseUrl = ref(apiConfig.apiDocsBaseUrl ?? apiConfig.apiBaseUrl)
|
|
140
142
|
const apiBaseUrl = ref(apiConfig.apiBaseUrl)
|
|
141
143
|
const authToken = ref(apiConfig.authToken)
|
|
142
144
|
pluginVars.value.projectId = apiConfig.projectId
|
|
@@ -325,8 +327,6 @@ export const useGxpStore = defineStore("gxp-portal-app", () => {
|
|
|
325
327
|
// Operations are built from OpenAPI spec paths
|
|
326
328
|
// Structure: { [operationId]: { method, path, parameters } }
|
|
327
329
|
try {
|
|
328
|
-
const apiDocsBaseUrl =
|
|
329
|
-
apiEnv === "mock" ? "https://api.gramercy.cloud" : apiBaseUrl.value
|
|
330
330
|
const specUrl = `${apiDocsBaseUrl}/api-specs/openapi.json`
|
|
331
331
|
const response = await axios.get(specUrl)
|
|
332
332
|
const spec = response.data
|