@dwizi/create-dzx 0.1.7 → 0.1.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/bin/index.js +9 -6
- package/package.json +2 -2
package/bin/index.js
CHANGED
|
@@ -253,14 +253,17 @@ function printKeyValueList(items) {
|
|
|
253
253
|
*/
|
|
254
254
|
async function getDzxVersion() {
|
|
255
255
|
try {
|
|
256
|
-
const {
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
|
|
256
|
+
const { createRequire } = await import("node:module");
|
|
257
|
+
const require = createRequire(import.meta.url);
|
|
258
|
+
const dzxPkgJsonPath = require.resolve("@dwizi/dzx/package.json", { paths: [process.cwd()] });
|
|
259
|
+
const dzxPkg = JSON.parse(fs.readFileSync(dzxPkgJsonPath, "utf8"));
|
|
260
|
+
if (dzxPkg && typeof dzxPkg.version === "string" && dzxPkg.version.trim()) {
|
|
261
|
+
return dzxPkg.version.trim();
|
|
262
|
+
}
|
|
260
263
|
} catch {
|
|
261
|
-
// Fallback version if npm query fails
|
|
262
|
-
return "latest";
|
|
263
264
|
}
|
|
265
|
+
// Fallback version if we cannot resolve an installed @dwizi/dzx
|
|
266
|
+
return "*";
|
|
264
267
|
}
|
|
265
268
|
|
|
266
269
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dwizi/create-dzx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"node": ">=24"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@dwizi/dzx": "
|
|
32
|
+
"@dwizi/dzx": "*"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "node scripts/build.mjs",
|