@svgrid/studio 0.1.3 → 0.2.0

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.
@@ -16,7 +16,7 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
16
16
  import { dirname, join, normalize, resolve, extname } from 'node:path';
17
17
  import { createRequire } from 'node:module';
18
18
  import { spawn } from 'node:child_process';
19
- import { createProject, parseProject, serializeProject, introspectDatabase, listDatabaseTables, probeConnection, linkRelationLabels, buildConnectionString, getSampleApp, } from '@svgrid/enterprise/studio';
19
+ import { createProject, parseProject, serializeProject, introspectDatabase, listDatabaseTables, probeConnection, linkRelationLabels, buildConnectionString, getSampleApp, skipUserOwned, } from '@svgrid/enterprise/studio';
20
20
  import { connect } from './db-connect.js';
21
21
  import { DRIVER_FOR, installDriver, isDriverInstalled } from './driver-install.js';
22
22
  const MIME = {
@@ -97,10 +97,17 @@ function serveStatic(res, dir, urlPath) {
97
97
  }
98
98
  /** Write the generated app bundle to disk and add any runtime deps it imports. */
99
99
  async function writeBundle(outDir, files) {
100
+ let written = 0;
100
101
  for (const f of files) {
101
102
  const full = join(outDir, f.path);
103
+ // User-owned companions (a screen's handlers.ts) are scaffolded once, then the
104
+ // developer's forever: never overwrite one that already exists on disk. This is
105
+ // the make-or-break round-trip guarantee. See HANDLERS-DESIGN.md.
106
+ if (skipUserOwned(f, existsSync(full)))
107
+ continue;
102
108
  await mkdir(dirname(full), { recursive: true });
103
109
  await writeFile(full, f.contents);
110
+ written++;
104
111
  }
105
112
  const allSource = files.map((f) => f.contents).join('\n');
106
113
  const pkgPath = join(outDir, 'package.json');
@@ -121,7 +128,7 @@ async function writeBundle(outDir, files) {
121
128
  // leave package.json untouched if it isn't valid JSON
122
129
  }
123
130
  }
124
- return files.length;
131
+ return written;
125
132
  }
126
133
  /** Best-effort open the default browser (no dependency). */
127
134
  function openBrowser(url) {
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@svgrid/studio",
3
- "version": "0.1.3",
3
+ "funding": {
4
+ "type": "commercial",
5
+ "url": "https://svgrid.com/pricing"
6
+ },
7
+ "version": "0.2.0",
4
8
  "description": "SvGrid Studio CLI: scaffold a full CRUD screen (grid + edit panel + SvelteKit API route) from a Drizzle schema in one command.",
5
9
  "license": "SEE LICENSE IN LICENSE",
6
10
  "author": "jQWidgets <sales@jqwidgets.com>",
@@ -23,7 +27,7 @@
23
27
  "access": "public"
24
28
  },
25
29
  "dependencies": {
26
- "@svgrid/enterprise": "^2.0.1"
30
+ "@svgrid/enterprise": "^2.2.0"
27
31
  },
28
32
  "devDependencies": {
29
33
  "@types/node": "^22.10.7",