@svgrid/studio 0.1.0 → 0.1.1
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/LICENSE +46 -0
- package/dist/cli.js +42 -2
- package/package.json +39 -36
package/LICENSE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
This repository is a multi-package workspace. Different packages ship
|
|
2
|
+
under different licenses. The authoritative license for each package is
|
|
3
|
+
the LICENSE file inside that package directory.
|
|
4
|
+
|
|
5
|
+
------------------------------------------------------------------------
|
|
6
|
+
Per-package licensing
|
|
7
|
+
------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
packages/grid/ MIT (terms below, and packages/grid/LICENSE)
|
|
10
|
+
packages/enterprise/ Commercial - see packages/enterprise/LICENSE
|
|
11
|
+
packages/mcp/ Commercial - see packages/mcp/LICENSE
|
|
12
|
+
website/ Proprietary - see website/LICENSE
|
|
13
|
+
|
|
14
|
+
Only `@svgrid/grid` is open source. Everything else in this
|
|
15
|
+
repository (the Pro feature pack, the MCP server, the marketing +
|
|
16
|
+
docs website, and any other package added later that does not ship
|
|
17
|
+
its own MIT LICENSE) is proprietary and may not be copied, modified,
|
|
18
|
+
or redistributed without a paid license. Source is visible in this
|
|
19
|
+
repository for transparency and for paying customers; visibility does
|
|
20
|
+
not grant a license.
|
|
21
|
+
|
|
22
|
+
------------------------------------------------------------------------
|
|
23
|
+
MIT License (applies ONLY to packages/grid)
|
|
24
|
+
------------------------------------------------------------------------
|
|
25
|
+
|
|
26
|
+
MIT License
|
|
27
|
+
|
|
28
|
+
Copyright (c) 2026 jQWidgets Ltd
|
|
29
|
+
|
|
30
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
31
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
32
|
+
in the Software without restriction, including without limitation the rights
|
|
33
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
34
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
35
|
+
furnished to do so, subject to the following conditions:
|
|
36
|
+
|
|
37
|
+
The above copyright notice and this permission notice shall be included in all
|
|
38
|
+
copies or substantial portions of the Software.
|
|
39
|
+
|
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
41
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
42
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
43
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
44
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
45
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
46
|
+
SOFTWARE.
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
14
14
|
import { dirname } from 'node:path';
|
|
15
|
-
import { introspectDatabase, listDatabaseTables, resolveSchemas, runStudioAdd, runStudioAddApp, summarizeVerify, } from '@svgrid/enterprise/studio';
|
|
15
|
+
import { buildStudioBugReport, introspectDatabase, listDatabaseTables, parseProject, resolveSchemas, runStudioAdd, runStudioAddApp, summarizeVerify, } from '@svgrid/enterprise/studio';
|
|
16
16
|
import { connect } from './db-connect.js';
|
|
17
17
|
import { startDesignerServer } from './designer-server.js';
|
|
18
18
|
const io = {
|
|
@@ -190,7 +190,47 @@ async function main() {
|
|
|
190
190
|
report(result.schema.name, result.written, summarizeVerify(result.verify));
|
|
191
191
|
process.stdout.write(`\nRun \`npm run dev\` and open /${opts.route ?? result.schema.name}\n`);
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
/** Best-effort: read the CLI's own version from its package.json. */
|
|
194
|
+
async function cliVersion() {
|
|
195
|
+
try {
|
|
196
|
+
const pkg = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
|
|
197
|
+
return pkg.version ?? 'unknown';
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
return 'unknown';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* On an uncaught crash, write a SANITIZED bug report (studio.config.json from
|
|
205
|
+
* cwd is attached with credentials + seed data stripped) and print a prefilled
|
|
206
|
+
* GitHub issue link. Reporting must never mask the original error.
|
|
207
|
+
*/
|
|
208
|
+
async function writeCrashReport(err) {
|
|
209
|
+
let project;
|
|
210
|
+
try {
|
|
211
|
+
project = parseProject(await readFile('studio.config.json', 'utf8'));
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
/* no config in cwd - a plain crash report */
|
|
215
|
+
}
|
|
216
|
+
const report = buildStudioBugReport({
|
|
217
|
+
project,
|
|
218
|
+
error: err instanceof Error ? err : { message: String(err) },
|
|
219
|
+
action: `svgrid-studio ${process.argv.slice(2).join(' ')}`.trim(),
|
|
220
|
+
env: { studioVersion: await cliVersion(), node: process.version, os: process.platform },
|
|
221
|
+
});
|
|
222
|
+
await writeFile('svgrid-studio-report.md', report.markdown, 'utf8');
|
|
223
|
+
const removed = report.redactions.length ? ` (${report.redactions.length} secret/data item(s) removed)` : '';
|
|
224
|
+
process.stderr.write(`\nThat looks like a bug. A sanitized report was written to svgrid-studio-report.md${removed}.\n` +
|
|
225
|
+
`Report it (opens a prefilled GitHub issue):\n${report.issueUrl}\n`);
|
|
226
|
+
}
|
|
227
|
+
main().catch(async (err) => {
|
|
194
228
|
process.stderr.write(`svgrid-studio: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
229
|
+
try {
|
|
230
|
+
await writeCrashReport(err);
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
/* never let reporting swallow the real failure */
|
|
234
|
+
}
|
|
195
235
|
process.exit(1);
|
|
196
236
|
});
|
package/package.json
CHANGED
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@svgrid/studio",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "SvGrid Studio CLI: scaffold a full CRUD screen (grid + edit panel + SvelteKit API route) from a Drizzle schema in one command.",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"author": "jQWidgets <sales@jqwidgets.com>",
|
|
7
|
-
"homepage": "https://svgrid.com",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/sv-grid/sv-grid.git",
|
|
11
|
-
"directory": "packages/studio"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"bin": {
|
|
15
|
-
"svgrid-studio": "dist/cli.js"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"README.md",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
],
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@svgrid/studio",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "SvGrid Studio CLI: scaffold a full CRUD screen (grid + edit panel + SvelteKit API route) from a Drizzle schema in one command.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"author": "jQWidgets <sales@jqwidgets.com>",
|
|
7
|
+
"homepage": "https://svgrid.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/sv-grid/sv-grid.git",
|
|
11
|
+
"directory": "packages/studio"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"bin": {
|
|
15
|
+
"svgrid-studio": "dist/cli.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@svgrid/enterprise": "^2.0.1"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^22.10.7",
|
|
30
|
+
"typescript": "6.0.3"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"test:types": "tsc -p tsconfig.json --noEmit"
|
|
38
|
+
}
|
|
39
|
+
}
|