create-message-kit 1.2.15 → 1.2.16
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +7 -5
- package/package.json +1 -1
package/index.js
CHANGED
@@ -7,7 +7,7 @@ import { default as fs } from "fs-extra";
|
|
7
7
|
import { isCancel } from "@clack/prompts";
|
8
8
|
import { detect } from "detect-package-manager";
|
9
9
|
import pc from "picocolors";
|
10
|
-
const defVersion = "1.2.
|
10
|
+
const defVersion = "1.2.16";
|
11
11
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
12
12
|
|
13
13
|
// Read package.json to get the version
|
@@ -78,8 +78,9 @@ Powered by XMTP`;
|
|
78
78
|
program.parse(process.argv);
|
79
79
|
|
80
80
|
async function updatePackagejson(destDir, templateType) {
|
81
|
-
//
|
82
|
-
const
|
81
|
+
// Remove 'templates/' prefix if it exists in templateType
|
82
|
+
const cleanTemplatePath = templateType.replace("templates/", "");
|
83
|
+
const templateDir = resolve(__dirname, `templates/${cleanTemplatePath}`);
|
83
84
|
const packageTemplate = fs.readJsonSync(`${templateDir}/package.json`);
|
84
85
|
|
85
86
|
packageTemplate.dependencies["@xmtp/message-kit"] = "latest";
|
@@ -114,8 +115,9 @@ async function gatherProjectInfo() {
|
|
114
115
|
process.exit(0);
|
115
116
|
}
|
116
117
|
|
117
|
-
//
|
118
|
-
const
|
118
|
+
// Clean up template path and ensure correct directory structure
|
119
|
+
const cleanTemplatePath = templateType.replace("templates/", "");
|
120
|
+
const templateDir = resolve(__dirname, `templates/${cleanTemplatePath}`);
|
119
121
|
|
120
122
|
// Ensure the template directory exists
|
121
123
|
if (!fs.existsSync(templateDir)) {
|