linked-rolls 0.49.0 → 0.50.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.
Files changed (2) hide show
  1. package/lib/validate.js +4 -1
  2. package/package.json +4 -3
package/lib/validate.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import Ajv from "ajv";
2
- import * as schema from "./schema.json" with { type: 'json' };
2
+ // A default import, not a namespace one: Node's ESM gives a JSON module
3
+ // only a default export, so `import * as` hands ajv the namespace object
4
+ // and it compiles a schema that constrains nothing.
5
+ import schema from "./schema.json" with { type: 'json' };
3
6
  const compileEditionSchema = () => new Ajv({ strict: false, formats: { "date": true } }).compile(schema);
4
7
  /**
5
8
  * Compiling costs enough that a consumer which never validates should not
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linked-rolls",
3
- "version": "0.49.0",
3
+ "version": "0.50.0",
4
4
  "description": "Digital editions of piano rolls: import, collation, editorial assumptions, JSON-LD export, and emulation through a reproducing system",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,10 +38,11 @@
38
38
  ],
39
39
  "scripts": {
40
40
  "build": "npm run build:schema && rm -rf lib && tsc",
41
- "prepublishOnly": "npm run build && vitest run",
41
+ "prepublishOnly": "npm run build && vitest run && npm run smoke",
42
42
  "test": "vitest",
43
43
  "build:schema": "npx ts-json-schema-generator --additional-properties --validation-keywords see --path 'src/**/*.ts' --type 'Edition' > schema_.json && node schema/postprocess.js && rm schema_.json && mv schema.json src/schema.json",
44
- "build:docs": "node schema/docs/generate.ts src/schema.json docs/index.html"
44
+ "build:docs": "node schema/docs/generate.ts src/schema.json docs/index.html",
45
+ "smoke": "node scripts/smoke.mjs"
45
46
  },
46
47
  "devDependencies": {
47
48
  "@types/jsonld": "^1.5.15",