@gxp-dev/tools 2.0.66 → 2.0.67
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 +11 -0
- package/package.json +1 -1
- package/runtime/index.html +1 -1
- package/runtime/logo.png +0 -0
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
|