@svgrid/studio 0.1.2 → 0.1.3

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/dist/cli.js +13 -0
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -157,6 +157,19 @@ async function main() {
157
157
  process.exit(1);
158
158
  }
159
159
  process.stdout.write(`Installed ${driver}.\n`);
160
+ // The install child process can report success before the new module is
161
+ // reliably resolvable (seen on Windows - antivirus/file-sync tools can
162
+ // briefly hold the just-written files). Poll rather than racing straight
163
+ // into connect(), which would resolve the driver too early and crash.
164
+ const deadline = Date.now() + 5000;
165
+ while (!isDriverInstalled(opts.db, cwd) && Date.now() < deadline) {
166
+ await new Promise((r) => setTimeout(r, 200));
167
+ }
168
+ if (!isDriverInstalled(opts.db, cwd)) {
169
+ process.stderr.write(`svgrid-studio: installed "${driver}" but it's still not resolvable from this directory.\n` +
170
+ `Something (antivirus, a file-sync tool) may be holding a lock on the new files. Try running the command again.\n`);
171
+ process.exit(1);
172
+ }
160
173
  }
161
174
  const execute = await connect(opts.db, opts.url);
162
175
  // A dialect dataSource emits a fully-connected +server.ts (driver + DATABASE_URL);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svgrid/studio",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "SvGrid Studio CLI: scaffold a full CRUD screen (grid + edit panel + SvelteKit API route) from a Drizzle schema in one command.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "jQWidgets <sales@jqwidgets.com>",