@weave-apps/sdk 0.1.2 → 0.1.4
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/init.js +36 -5
- package/package.json +1 -1
package/bin/init.js
CHANGED
|
@@ -26,6 +26,37 @@ if (fs.existsSync(sdkPackageJsonPath)) {
|
|
|
26
26
|
const args = process.argv.slice(2);
|
|
27
27
|
const appName = args[0];
|
|
28
28
|
|
|
29
|
+
// Help command
|
|
30
|
+
if (appName === '--help') {
|
|
31
|
+
console.log(`
|
|
32
|
+
|
|
33
|
+
🚀 Weave Apps SDK Help
|
|
34
|
+
|
|
35
|
+
Usage:
|
|
36
|
+
weave-init <app-name> Create a new Weave app
|
|
37
|
+
weave-init --help Show this help message
|
|
38
|
+
|
|
39
|
+
Examples:
|
|
40
|
+
weave-init my-app
|
|
41
|
+
weave-init my-custom-app
|
|
42
|
+
weave-init dashboard
|
|
43
|
+
|
|
44
|
+
Requirements:
|
|
45
|
+
• App name must be in kebab-case (lowercase with hyphens)
|
|
46
|
+
• App name must start with a letter
|
|
47
|
+
• Directory with that name must not already exist
|
|
48
|
+
|
|
49
|
+
After initialization:
|
|
50
|
+
cd <app-name>
|
|
51
|
+
npm install
|
|
52
|
+
npm run build
|
|
53
|
+
|
|
54
|
+
Learn more:
|
|
55
|
+
https://www.npmjs.com/package/@weave-apps/sdk
|
|
56
|
+
`);
|
|
57
|
+
process.exit(0);
|
|
58
|
+
}
|
|
59
|
+
|
|
29
60
|
if (!appName) {
|
|
30
61
|
console.error('❌ Error: App name is required');
|
|
31
62
|
console.log('Usage: npx weave-init <app-name>');
|
|
@@ -223,13 +254,13 @@ if (fs.existsSync(readmePath)) {
|
|
|
223
254
|
console.warn('⚠️ Warning: README.md template not found in SDK templates');
|
|
224
255
|
}
|
|
225
256
|
|
|
226
|
-
// Copy
|
|
227
|
-
const specPath = path.join(__dirname, '..', 'templates', '
|
|
257
|
+
// Copy WEAVE_SPEC.md from SDK templates
|
|
258
|
+
const specPath = path.join(__dirname, '..', 'templates', 'WEAVE_SPEC.md');
|
|
228
259
|
if (fs.existsSync(specPath)) {
|
|
229
260
|
const specContent = fs.readFileSync(specPath, 'utf8');
|
|
230
|
-
fs.writeFileSync(path.join(projectDir, '
|
|
261
|
+
fs.writeFileSync(path.join(projectDir, 'WEAVE_SPEC.md'), specContent);
|
|
231
262
|
} else {
|
|
232
|
-
console.warn('⚠️ Warning:
|
|
263
|
+
console.warn('⚠️ Warning: WEAVE_SPEC.md not found in SDK templates');
|
|
233
264
|
}
|
|
234
265
|
|
|
235
266
|
// Create .gitignore
|
|
@@ -248,7 +279,7 @@ console.log(' ├── src/');
|
|
|
248
279
|
console.log(' │ └── app.ts');
|
|
249
280
|
console.log(' ├── package.json');
|
|
250
281
|
console.log(' ├── tsconfig.json (extends SDK config)');
|
|
251
|
-
console.log(' ├──
|
|
282
|
+
console.log(' ├── WEAVE_SPEC.md (AI assistant guide)');
|
|
252
283
|
console.log(' └── README.md\n');
|
|
253
284
|
console.log('🚀 Next steps:');
|
|
254
285
|
console.log(` cd ${appName}`);
|