tangled
alpha
login
or
join now
danabra.mov
/
typelex
56
fork
atom
An experimental TypeSpec syntax for Lexicon
56
fork
atom
overview
issues
1
pulls
2
pipelines
deps first
danabra.mov
5 months ago
8d38144f
50477420
+14
-16
1 changed file
expand all
collapse all
unified
split
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
50
-
51
51
-
// Prompt for namespace
52
52
-
let namespace = await promptNamespace();
53
53
-
54
54
-
// Validate namespace format
55
55
-
while (!namespace.endsWith(".*")) {
56
56
-
console.error(`Error: namespace must end with .*`);
57
57
-
console.error(`Got: ${namespace}\n`);
58
58
-
namespace = await promptNamespace();
59
59
-
}
60
60
-
61
61
-
// Remove the .* suffix for use in template
62
62
-
const namespacePrefix = namespace.slice(0, -2);
63
63
-
64
64
-
// Install dependencies first
65
65
-
console.log("\nInstalling dependencies...\n");
50
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
92
+
93
93
+
// Prompt for namespace after successful installation
94
94
+
let namespace = await promptNamespace();
95
95
+
96
96
+
// Validate namespace format
97
97
+
while (!namespace.endsWith(".*")) {
98
98
+
console.error(`Error: namespace must end with .*`);
99
99
+
console.error(`Got: ${namespace}\n`);
100
100
+
namespace = await promptNamespace();
101
101
+
}
102
102
+
103
103
+
// Remove the .* suffix for use in template
104
104
+
const namespacePrefix = namespace.slice(0, -2);
107
105
108
106
// Create typelex directory
109
107
await mkdir(typelexDir, { recursive: true });