@patterkit/core 0.1.3 → 0.1.5
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/dist/index.cjs +3 -6
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -376,22 +376,19 @@ function validateAuthoring(files, project, allIds, issues) {
|
|
|
376
376
|
}
|
|
377
377
|
for (const file of files) {
|
|
378
378
|
for (const [id, value] of Object.entries(file.writing ?? {})) {
|
|
379
|
-
if (!allIds.has(id))
|
|
379
|
+
if (!allIds.has(id)) continue;
|
|
380
380
|
if (!writingLadder.has(value)) {
|
|
381
381
|
issues.push({ code: "invalid-status-value", message: `writing status '${value}' on '${id}' is not in the project ladder`, id });
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
for (const [id, value] of Object.entries(file.recording ?? {})) {
|
|
385
|
-
if (!allIds.has(id))
|
|
385
|
+
if (!allIds.has(id)) continue;
|
|
386
386
|
if (!recordingLadder.has(value)) {
|
|
387
387
|
issues.push({ code: "invalid-status-value", message: `recording status '${value}' on '${id}' is not in the project ladder`, id });
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
for (const id of Object.keys(file.cut ?? {})) {
|
|
391
|
-
if (!allIds.has(id)) issues.push({ code: "unknown-status-id", message: `cut flag set on unknown id '${id}'`, id });
|
|
392
|
-
}
|
|
393
390
|
for (const [id, lines] of Object.entries(file.documentation ?? {})) {
|
|
394
|
-
if (!allIds.has(id))
|
|
391
|
+
if (!allIds.has(id)) continue;
|
|
395
392
|
for (const line of lines) {
|
|
396
393
|
if (line.type !== void 0 && !docClasses.has(line.type)) {
|
|
397
394
|
issues.push({ code: "unknown-doc-class", message: `documentation class '${line.type}' on '${id}' is not declared (project documentationClasses)`, id });
|
package/dist/index.d.cts
CHANGED
|
@@ -23,7 +23,7 @@ interface StringifyOptions {
|
|
|
23
23
|
declare function canonicalStringify(value: unknown, opts?: StringifyOptions): string;
|
|
24
24
|
|
|
25
25
|
interface ValidationIssue {
|
|
26
|
-
code: "duplicate-id" | "missing-id" | "malformed-node" | "missing-name" | "empty-scene" | "empty-snippet" | "empty-container" | "dangling-jump" | "jump-into-non-addressable" | "invalid-gameid" | "duplicate-gameid" | "unknown-character" | "invalid-temporary" | "invalid-declaration" | "invalid-status-ladder" | "invalid-locales" | "invalid-captions" | "missing-prompt" | "invalid-prompt" | "multiple-fallbacks" | "choice-can-empty" | "invalid-status-value" | "unknown-
|
|
26
|
+
code: "duplicate-id" | "missing-id" | "malformed-node" | "missing-name" | "empty-scene" | "empty-snippet" | "empty-container" | "dangling-jump" | "jump-into-non-addressable" | "invalid-gameid" | "duplicate-gameid" | "unknown-character" | "invalid-temporary" | "invalid-declaration" | "invalid-status-ladder" | "invalid-locales" | "invalid-captions" | "missing-prompt" | "invalid-prompt" | "multiple-fallbacks" | "choice-can-empty" | "invalid-status-value" | "unknown-doc-class" | "invalid-tag" | "invalid-gamedata-field";
|
|
27
27
|
message: string;
|
|
28
28
|
/** Id of the offending node/beat, where applicable. */
|
|
29
29
|
id?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface StringifyOptions {
|
|
|
23
23
|
declare function canonicalStringify(value: unknown, opts?: StringifyOptions): string;
|
|
24
24
|
|
|
25
25
|
interface ValidationIssue {
|
|
26
|
-
code: "duplicate-id" | "missing-id" | "malformed-node" | "missing-name" | "empty-scene" | "empty-snippet" | "empty-container" | "dangling-jump" | "jump-into-non-addressable" | "invalid-gameid" | "duplicate-gameid" | "unknown-character" | "invalid-temporary" | "invalid-declaration" | "invalid-status-ladder" | "invalid-locales" | "invalid-captions" | "missing-prompt" | "invalid-prompt" | "multiple-fallbacks" | "choice-can-empty" | "invalid-status-value" | "unknown-
|
|
26
|
+
code: "duplicate-id" | "missing-id" | "malformed-node" | "missing-name" | "empty-scene" | "empty-snippet" | "empty-container" | "dangling-jump" | "jump-into-non-addressable" | "invalid-gameid" | "duplicate-gameid" | "unknown-character" | "invalid-temporary" | "invalid-declaration" | "invalid-status-ladder" | "invalid-locales" | "invalid-captions" | "missing-prompt" | "invalid-prompt" | "multiple-fallbacks" | "choice-can-empty" | "invalid-status-value" | "unknown-doc-class" | "invalid-tag" | "invalid-gamedata-field";
|
|
27
27
|
message: string;
|
|
28
28
|
/** Id of the offending node/beat, where applicable. */
|
|
29
29
|
id?: string;
|
package/dist/index.js
CHANGED
|
@@ -331,22 +331,19 @@ function validateAuthoring(files, project, allIds, issues) {
|
|
|
331
331
|
}
|
|
332
332
|
for (const file of files) {
|
|
333
333
|
for (const [id, value] of Object.entries(file.writing ?? {})) {
|
|
334
|
-
if (!allIds.has(id))
|
|
334
|
+
if (!allIds.has(id)) continue;
|
|
335
335
|
if (!writingLadder.has(value)) {
|
|
336
336
|
issues.push({ code: "invalid-status-value", message: `writing status '${value}' on '${id}' is not in the project ladder`, id });
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
for (const [id, value] of Object.entries(file.recording ?? {})) {
|
|
340
|
-
if (!allIds.has(id))
|
|
340
|
+
if (!allIds.has(id)) continue;
|
|
341
341
|
if (!recordingLadder.has(value)) {
|
|
342
342
|
issues.push({ code: "invalid-status-value", message: `recording status '${value}' on '${id}' is not in the project ladder`, id });
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
for (const id of Object.keys(file.cut ?? {})) {
|
|
346
|
-
if (!allIds.has(id)) issues.push({ code: "unknown-status-id", message: `cut flag set on unknown id '${id}'`, id });
|
|
347
|
-
}
|
|
348
345
|
for (const [id, lines] of Object.entries(file.documentation ?? {})) {
|
|
349
|
-
if (!allIds.has(id))
|
|
346
|
+
if (!allIds.has(id)) continue;
|
|
350
347
|
for (const line of lines) {
|
|
351
348
|
if (line.type !== void 0 && !docClasses.has(line.type)) {
|
|
352
349
|
issues.push({ code: "unknown-doc-class", message: `documentation class '${line.type}' on '${id}' is not declared (project documentationClasses)`, id });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patterkit/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Patter core: stable id generation, readable-handle computation, canonical (de)serialisation, and the structural validator.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patterkit/model": "0.2.
|
|
37
|
+
"@patterkit/model": "0.2.1",
|
|
38
38
|
"json5": "^2.2.3"
|
|
39
39
|
}
|
|
40
40
|
}
|