create-message-kit 1.2.15 → 1.2.16

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.
Files changed (2) hide show
  1. package/index.js +7 -5
  2. 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.15";
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
- // Create package.json based on the template
82
- const templateDir = resolve(__dirname, `./templates/${templateType}`);
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
- // Fix: Use templates directory with the selected href
118
- const templateDir = resolve(__dirname, `./${templateType}`);
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)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-message-kit",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "index.js",