@basementuniverse/jsonpad-cli 1.2.0 → 1.3.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.
- package/CHANGELOG.md +8 -0
- package/README.md +10 -12
- package/build/realtime.js +2 -22
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,14 @@ and this package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
Dates are npm publish dates.
|
|
9
9
|
|
|
10
|
+
## [1.3.0] - 2026-09-16
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- The `xmlhttprequest-ssl` dependency. `jsonpad listen` needed it only because
|
|
15
|
+
`@basementuniverse/jsonpad-realtime-sdk` couldn't connect from Node before
|
|
16
|
+
version 1.6.0.
|
|
17
|
+
|
|
10
18
|
## [1.2.0] - 2026-09-16
|
|
11
19
|
|
|
12
20
|
### Added
|
package/README.md
CHANGED
|
@@ -6,6 +6,9 @@ Use it to manage lists, indexes, items and identities from the command line,
|
|
|
6
6
|
and to sync schema documents (lists and their indexes) with your account, e.g.
|
|
7
7
|
in a deploy script or CI.
|
|
8
8
|
|
|
9
|
+
There's a guide to it in the JSONPad docs:
|
|
10
|
+
[Command line tool](https://jsonpad.io/docs/command-line-tool).
|
|
11
|
+
|
|
9
12
|
## Install
|
|
10
13
|
|
|
11
14
|
The tool needs Node.js 22.12 or later.
|
|
@@ -314,9 +317,9 @@ The schema commands (`sync-schema`, `export-schema`, `move-lists`) and
|
|
|
314
317
|
|
|
315
318
|
## Moving from the SDK's `jsonpad` command
|
|
316
319
|
|
|
317
|
-
Versions 1.12
|
|
318
|
-
command
|
|
319
|
-
|
|
320
|
+
Versions 1.12 to 1.14 of `@basementuniverse/jsonpad-sdk` included a `jsonpad`
|
|
321
|
+
command, which was removed in SDK 2.0.0. This package has the same commands,
|
|
322
|
+
options, output and exit codes, so to switch, replace
|
|
320
323
|
`npx @basementuniverse/jsonpad-sdk` with `npx @basementuniverse/jsonpad-cli`.
|
|
321
324
|
|
|
322
325
|
If you installed the SDK globally to get the command, uninstall it first.
|
|
@@ -339,15 +342,10 @@ npm run reference # regenerates REFERENCE.md after changing a command
|
|
|
339
342
|
`npm test` fails when `REFERENCE.md` is out of date.
|
|
340
343
|
|
|
341
344
|
The parity tests check that the commands ported from the SDK behave exactly as
|
|
342
|
-
the SDK's
|
|
343
|
-
|
|
344
|
-
`test/parity/golden
|
|
345
|
-
|
|
346
|
-
```bash
|
|
347
|
-
npm run record-parity -- ../jsonpad-sdk-js/bin/jsonpad.js
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
Only re-record them to add scenarios while the SDK still has its command.
|
|
345
|
+
the SDK's command did. They run each scenario against a fake API and compare
|
|
346
|
+
the output, exit code, requests and files against golden files in
|
|
347
|
+
`test/parity/golden`, which were recorded from the SDK's command before it was
|
|
348
|
+
removed.
|
|
351
349
|
|
|
352
350
|
### Publishing
|
|
353
351
|
|
package/build/realtime.js
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
1
|
import realtime from '@basementuniverse/jsonpad-realtime-sdk';
|
|
3
|
-
//
|
|
2
|
+
// The realtime SDK's Node build is CommonJS, so an ES module only sees its
|
|
4
3
|
// exports object as the default import
|
|
5
|
-
const
|
|
6
|
-
/**
|
|
7
|
-
* The realtime SDK's build contains socket.io-client's browser build, which
|
|
8
|
-
* connects with XMLHttpRequest. Node doesn't have one, so without this the
|
|
9
|
-
* client never connects (and never says why). xmlhttprequest-ssl is what
|
|
10
|
-
* socket.io-client's own Node build uses
|
|
11
|
-
*/
|
|
12
|
-
function provideXMLHttpRequest() {
|
|
13
|
-
if (!('XMLHttpRequest' in globalThis)) {
|
|
14
|
-
const require = createRequire(import.meta.url);
|
|
15
|
-
globalThis.XMLHttpRequest =
|
|
16
|
-
require('xmlhttprequest-ssl').XMLHttpRequest;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export const JSONPadRealtime = new Proxy(RealtimeClientClass, {
|
|
20
|
-
construct(target, args) {
|
|
21
|
-
provideXMLHttpRequest();
|
|
22
|
-
return Reflect.construct(target, args);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
4
|
+
export const JSONPadRealtime = realtime.default;
|
|
25
5
|
export const REALTIME_EVENT_TYPES = [
|
|
26
6
|
'list-created',
|
|
27
7
|
'list-updated',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basementuniverse/jsonpad-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Command line tool for JSONPad",
|
|
5
5
|
"author": "Gordon Larrigan <gordonlarrigan@gmail.com> (https://gordonlarrigan.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,14 +35,12 @@
|
|
|
35
35
|
"build": "rm -rf build && tsc -p tsconfig.build.json && chmod +x build/cli.js",
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
37
|
"test": "npm run build && node --test \"test/**/*.test.ts\"",
|
|
38
|
-
"reference": "node scripts/generate-reference.ts"
|
|
39
|
-
"record-parity": "npm run build && node scripts/record-parity.ts"
|
|
38
|
+
"reference": "node scripts/generate-reference.ts"
|
|
40
39
|
},
|
|
41
40
|
"dependencies": {
|
|
42
41
|
"@basementuniverse/jsonpad-realtime-sdk": "^1.6.0",
|
|
43
|
-
"@basementuniverse/jsonpad-sdk": "^
|
|
44
|
-
"commander": "^15.0.0"
|
|
45
|
-
"xmlhttprequest-ssl": "~2.1.2"
|
|
42
|
+
"@basementuniverse/jsonpad-sdk": "^2.0.0",
|
|
43
|
+
"commander": "^15.0.0"
|
|
46
44
|
},
|
|
47
45
|
"devDependencies": {
|
|
48
46
|
"@types/node": "^22.20.3",
|