+14
-16
packages/cli/src/commands/init.ts
+14
-16
packages/cli/src/commands/init.ts
···
47
47
const externalsTspPath = resolve(typelexDir, "externals.tsp");
48
48
49
49
console.log("Initializing typelex project...\n");
50
-
51
-
// Prompt for namespace
52
-
let namespace = await promptNamespace();
53
-
54
-
// Validate namespace format
55
-
while (!namespace.endsWith(".*")) {
56
-
console.error(`Error: namespace must end with .*`);
57
-
console.error(`Got: ${namespace}\n`);
58
-
namespace = await promptNamespace();
59
-
}
60
-
61
-
// Remove the .* suffix for use in template
62
-
const namespacePrefix = namespace.slice(0, -2);
63
-
64
-
// Install dependencies first
65
-
console.log("\nInstalling dependencies...\n");
50
+
console.log("Installing dependencies...\n");
66
51
67
52
// Detect package manager
68
53
let packageManager = "npm";
···
104
89
reject(err);
105
90
});
106
91
});
92
+
93
+
// Prompt for namespace after successful installation
94
+
let namespace = await promptNamespace();
95
+
96
+
// Validate namespace format
97
+
while (!namespace.endsWith(".*")) {
98
+
console.error(`Error: namespace must end with .*`);
99
+
console.error(`Got: ${namespace}\n`);
100
+
namespace = await promptNamespace();
101
+
}
102
+
103
+
// Remove the .* suffix for use in template
104
+
const namespacePrefix = namespace.slice(0, -2);
107
105
108
106
// Create typelex directory
109
107
await mkdir(typelexDir, { recursive: true });