@wildshard/shard-format 0.68.0 → 0.68.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/package.json +2 -2
- package/src/cli/corpus-deprecations.ts +25 -9
- package/src/cli/corpus-gate.ts +114 -0
- package/src/cli/corpus-migrated.ts +68 -0
- package/src/cli/corpus.ts +2 -2
- package/src/cli/main.ts +12 -3
- package/src/format/creature-layers.ts +4 -0
- package/src/format/deprecations.ts +96 -0
- package/src/format/rows.ts +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/shard-format",
|
|
3
|
-
"version": "0.68.
|
|
3
|
+
"version": "0.68.1",
|
|
4
4
|
"description": "The raw shardfile format: the spec, the validator and a validate CLI. The public, versioned contract every other repo builds on.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
"./shardSchema": "./src/format/shardSchema.ts",
|
|
345
345
|
"./emptyShardfile": "./src/format/empty-shardfile.ts",
|
|
346
346
|
"./migrate": "./src/format/format-migrate.ts",
|
|
347
|
-
"./
|
|
347
|
+
"./formatMigrations": "./src/format/format-migrations.ts",
|
|
348
348
|
"./shardSections": "./src/format/shardSections.ts",
|
|
349
349
|
"./sketch": "./src/format/sketch.ts",
|
|
350
350
|
"./skinAssets": "./src/format/skinAssets.ts",
|
|
@@ -3,20 +3,36 @@ import { createReadStream } from 'node:fs'
|
|
|
3
3
|
|
|
4
4
|
import { nodeStreamPorts } from '../format/shardfile-stream-node.ts'
|
|
5
5
|
import { validateShardfileStream } from '../format/shardfile-stream.ts'
|
|
6
|
+
import { migratedVerdict } from './corpus-migrated.ts'
|
|
6
7
|
|
|
7
8
|
import type { CorpusRow } from './corpus.ts'
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
|
|
10
|
+
/** A valid original's deprecated paths, and the chain steps that made it valid when it was refused as stored. */
|
|
11
|
+
interface StoredVerdict {
|
|
12
|
+
readonly deprecations: readonly string[]
|
|
13
|
+
/** `migrated: <steps>` when the chain's copy is what validated. */
|
|
14
|
+
readonly reason?: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Validate one stored original (brotli unless `plain`) as the API stored it; one the format refuses is judged again
|
|
18
|
+
* through the migration chain (J486). Throws the copy's refusal when that fails too. */
|
|
11
19
|
async function storedDeprecations(
|
|
12
20
|
file: string,
|
|
13
21
|
plain: boolean,
|
|
14
|
-
): Promise<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
): Promise<StoredVerdict> {
|
|
23
|
+
try {
|
|
24
|
+
const validated = await validateShardfileStream(
|
|
25
|
+
(): AsyncIterable<Uint8Array> => createReadStream(file),
|
|
26
|
+
{ ...nodeStreamPorts({ brotli: !plain }), judged: 'stored' },
|
|
27
|
+
)
|
|
28
|
+
return { deprecations: validated.deprecations }
|
|
29
|
+
} catch (error: unknown) {
|
|
30
|
+
const copy = await migratedVerdict(file, plain, error)
|
|
31
|
+
return {
|
|
32
|
+
deprecations: copy.deprecations,
|
|
33
|
+
reason: `migrated: ${copy.applied.join(', ')}`,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
20
36
|
}
|
|
21
37
|
|
|
22
38
|
/** FE7: one line per deprecated path a kept original uses, with how many and which. */
|
|
@@ -38,4 +54,4 @@ function deprecationLines(
|
|
|
38
54
|
)
|
|
39
55
|
}
|
|
40
56
|
|
|
41
|
-
export { deprecationLines, storedDeprecations }
|
|
57
|
+
export { type StoredVerdict, deprecationLines, storedDeprecations }
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
array,
|
|
3
|
+
minLength,
|
|
4
|
+
number,
|
|
5
|
+
parse,
|
|
6
|
+
pipe,
|
|
7
|
+
regex,
|
|
8
|
+
safeInteger,
|
|
9
|
+
strictObject,
|
|
10
|
+
string,
|
|
11
|
+
} from 'valibot'
|
|
12
|
+
|
|
13
|
+
import type { CorpusRow } from './corpus.ts'
|
|
14
|
+
|
|
15
|
+
// SHARD-COMPAT FE5 (meta, J486, Q51): the corpus gates a format release. A stored original that fails blocks the
|
|
16
|
+
// release unless `corpus/known-failures.json` lists it with the row that owns its repair; a listed one that passes
|
|
17
|
+
// again is named as stale, so the list only shrinks.
|
|
18
|
+
|
|
19
|
+
/** A stored original known to fail, and the row that owns its repair. */
|
|
20
|
+
interface KnownFailure {
|
|
21
|
+
readonly hash: string
|
|
22
|
+
readonly slug: string
|
|
23
|
+
readonly revision: number
|
|
24
|
+
readonly owner: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** What the gate decided: the failures that block, the stale entries, and one line for each. */
|
|
28
|
+
interface CorpusGate {
|
|
29
|
+
readonly blocking: readonly CorpusRow[]
|
|
30
|
+
readonly stale: readonly KnownFailure[]
|
|
31
|
+
readonly lines: readonly string[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const HASH = pipe(string(), regex(/^[a-f0-9]{64}$/u))
|
|
35
|
+
const REVISION = pipe(number(), safeInteger())
|
|
36
|
+
const NAMED = 1
|
|
37
|
+
const OWNER = pipe(string(), minLength(NAMED))
|
|
38
|
+
const KnownFailuresSchema = array(
|
|
39
|
+
strictObject({
|
|
40
|
+
hash: HASH,
|
|
41
|
+
slug: string(),
|
|
42
|
+
revision: REVISION,
|
|
43
|
+
owner: OWNER,
|
|
44
|
+
}),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
/** Parse `corpus/known-failures.json`. */
|
|
48
|
+
function readKnownFailures(text: string): readonly KnownFailure[] {
|
|
49
|
+
const input: unknown = JSON.parse(text)
|
|
50
|
+
return parse(KnownFailuresSchema, input)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function named(found: Readonly<{ slug: string; revision: number }>): string {
|
|
54
|
+
return `${found.slug} r${String(found.revision)}`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The failing rows, each with its owner when the list knows it. */
|
|
58
|
+
function failures(
|
|
59
|
+
rows: readonly CorpusRow[],
|
|
60
|
+
owners: ReadonlyMap<string, string>,
|
|
61
|
+
): readonly (readonly [CorpusRow, string | undefined])[] {
|
|
62
|
+
return rows
|
|
63
|
+
.filter((found: Readonly<CorpusRow>): boolean => found.verdict === 'fails')
|
|
64
|
+
.map((found: CorpusRow): readonly [CorpusRow, string | undefined] => [
|
|
65
|
+
found,
|
|
66
|
+
owners.get(found.hash),
|
|
67
|
+
])
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Split the corpus rows by the known failures. */
|
|
71
|
+
function corpusGate(
|
|
72
|
+
rows: readonly CorpusRow[],
|
|
73
|
+
known: readonly KnownFailure[],
|
|
74
|
+
): CorpusGate {
|
|
75
|
+
const owners = new Map(
|
|
76
|
+
known.map((entry: KnownFailure): readonly [string, string] => [
|
|
77
|
+
entry.hash,
|
|
78
|
+
entry.owner,
|
|
79
|
+
]),
|
|
80
|
+
)
|
|
81
|
+
const failing = failures(rows, owners)
|
|
82
|
+
const valid = new Set(
|
|
83
|
+
rows
|
|
84
|
+
.filter(
|
|
85
|
+
(found: Readonly<CorpusRow>): boolean => found.verdict === 'valid',
|
|
86
|
+
)
|
|
87
|
+
.map((found: Readonly<CorpusRow>): string => found.hash),
|
|
88
|
+
)
|
|
89
|
+
const blocking = failing
|
|
90
|
+
.filter(([, owner]): boolean => owner === undefined)
|
|
91
|
+
.map(([found]): CorpusRow => found)
|
|
92
|
+
const stale = known.filter((entry: KnownFailure): boolean =>
|
|
93
|
+
valid.has(entry.hash),
|
|
94
|
+
)
|
|
95
|
+
const lines = [
|
|
96
|
+
...failing
|
|
97
|
+
.filter(([, owner]): boolean => owner !== undefined)
|
|
98
|
+
.map(
|
|
99
|
+
([found, owner]): string =>
|
|
100
|
+
`known failure ${named(found)} (${owner ?? ''})`,
|
|
101
|
+
),
|
|
102
|
+
...stale.map(
|
|
103
|
+
(entry: KnownFailure): string =>
|
|
104
|
+
`stale known failure ${named(entry)}: it passes now; drop it from corpus/known-failures.json`,
|
|
105
|
+
),
|
|
106
|
+
...blocking.map(
|
|
107
|
+
(found: Readonly<CorpusRow>): string =>
|
|
108
|
+
`BLOCKS THE RELEASE: ${named(found)} ${found.reason ?? ''}`,
|
|
109
|
+
),
|
|
110
|
+
]
|
|
111
|
+
return { blocking, stale, lines }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { type CorpusGate, type KnownFailure, corpusGate, readKnownFailures }
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** The corpus judges an older original through the migration chain (J486, SHARD-COMPAT CP1): a file the current
|
|
2
|
+
* format refuses as stored still counts as valid when the chain's copy validates, with the author's own preparation
|
|
3
|
+
* when the steps leave it sealed. */
|
|
4
|
+
import { createHash } from 'node:crypto'
|
|
5
|
+
import { readFile } from 'node:fs/promises'
|
|
6
|
+
import { promisify } from 'node:util'
|
|
7
|
+
import { brotliDecompress } from 'node:zlib'
|
|
8
|
+
|
|
9
|
+
import { migrateShardfile, validateMigrated } from '../format/format-migrate.ts'
|
|
10
|
+
import { prepareAssetDecoders } from '../format/shardfile-assets.ts'
|
|
11
|
+
import { readTar } from '../format/tar.ts'
|
|
12
|
+
|
|
13
|
+
/** What the chain did to a refused original whose copy validates. */
|
|
14
|
+
interface MigratedVerdict {
|
|
15
|
+
readonly applied: readonly string[]
|
|
16
|
+
readonly deprecations: readonly string[]
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const NONE = 0
|
|
20
|
+
const unbrotli = promisify(brotliDecompress)
|
|
21
|
+
|
|
22
|
+
function sha256(bytes: Readonly<Uint8Array>): string {
|
|
23
|
+
return createHash('sha256').update(bytes).digest('hex')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The chain's copy of an original tarball, or `undefined` when it cannot be read or the chain cannot run on it. */
|
|
27
|
+
function tryChain(
|
|
28
|
+
tar: Readonly<Uint8Array>,
|
|
29
|
+
): ReturnType<typeof migrateShardfile> | undefined {
|
|
30
|
+
try {
|
|
31
|
+
return migrateShardfile(readTar(tar), { hash: sha256 })
|
|
32
|
+
} catch {
|
|
33
|
+
return undefined
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The chain's copy of an original, or the stored refusal when the chain cannot run or changes nothing. */
|
|
38
|
+
function chainCopy(
|
|
39
|
+
tar: Readonly<Uint8Array>,
|
|
40
|
+
refused: unknown,
|
|
41
|
+
): ReturnType<typeof migrateShardfile> {
|
|
42
|
+
const copy = tryChain(tar)
|
|
43
|
+
if (copy === undefined || copy.applied.length === NONE) {
|
|
44
|
+
throw refused
|
|
45
|
+
}
|
|
46
|
+
return copy
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Migrate one stored original (brotli unless `plain`) and validate the copy. Throws the copy's refusal; when the chain cannot
|
|
50
|
+
* run or changes nothing, the stored refusal (`refused`). */
|
|
51
|
+
async function migratedVerdict(
|
|
52
|
+
file: string,
|
|
53
|
+
plain: boolean,
|
|
54
|
+
refused: unknown,
|
|
55
|
+
): Promise<MigratedVerdict> {
|
|
56
|
+
const stored = new Uint8Array(await readFile(file))
|
|
57
|
+
const tar = plain ? stored : new Uint8Array(await unbrotli(stored))
|
|
58
|
+
const copy = chainCopy(tar, refused)
|
|
59
|
+
await prepareAssetDecoders()
|
|
60
|
+
const validated = validateMigrated(copy.files, {
|
|
61
|
+
hash: sha256,
|
|
62
|
+
judged: 'stored',
|
|
63
|
+
preparation: copy.preparation === 'stale' ? 'migrated' : 'author',
|
|
64
|
+
})
|
|
65
|
+
return { applied: copy.applied, deprecations: validated.deprecations }
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { type MigratedVerdict, migratedVerdict }
|
package/src/cli/corpus.ts
CHANGED
|
@@ -181,8 +181,8 @@ async function judge(
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
const plain = isPlainTar(await firstBytes(file))
|
|
184
|
-
const
|
|
185
|
-
return { verdict: 'valid',
|
|
184
|
+
const stored = await storedDeprecations(file, plain)
|
|
185
|
+
return { verdict: 'valid', ...stored, transient: false }
|
|
186
186
|
} catch (error: unknown) {
|
|
187
187
|
return { verdict: 'fails', reason: shortReason(error), transient: false }
|
|
188
188
|
} finally {
|
package/src/cli/main.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { readFile } from 'node:fs/promises'
|
|
2
3
|
import { parseArgs } from 'node:util'
|
|
3
4
|
|
|
5
|
+
import { corpusGate, readKnownFailures } from './corpus-gate.ts'
|
|
4
6
|
import { corpusReport, runCorpus } from './corpus.ts'
|
|
5
7
|
import { packFolder } from './pack.ts'
|
|
6
8
|
import { summary, validateShardfile } from './validate.ts'
|
|
@@ -16,6 +18,7 @@ const NONE = 0
|
|
|
16
18
|
const FIRST_CLI_ARG = 2
|
|
17
19
|
const DEFAULT_API = 'https://api.wildshard.io'
|
|
18
20
|
const DEFAULT_CACHE = 'tmp/corpus'
|
|
21
|
+
const KNOWN_FAILURES = 'corpus/known-failures.json'
|
|
19
22
|
|
|
20
23
|
const USAGE = `Usage: shard-format <command> [options]
|
|
21
24
|
|
|
@@ -137,9 +140,15 @@ async function corpus(args: CliArgs): Promise<number> {
|
|
|
137
140
|
validator: await readVersion(),
|
|
138
141
|
})
|
|
139
142
|
process.stdout.write(`${corpusReport(rows)}\n`)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
:
|
|
143
|
+
// SHARD-COMPAT FE5: only a failure not listed with its owner blocks a release.
|
|
144
|
+
const listed = await readFile(KNOWN_FAILURES, 'utf8').catch(
|
|
145
|
+
(): string => '[]',
|
|
146
|
+
)
|
|
147
|
+
const gate = corpusGate(rows, readKnownFailures(listed))
|
|
148
|
+
if (gate.lines.length > NONE) {
|
|
149
|
+
process.stdout.write(`${gate.lines.join('\n')}\n`)
|
|
150
|
+
}
|
|
151
|
+
return gate.blocking.length > NONE ? EXIT_INVALID : EXIT_OK
|
|
143
152
|
}
|
|
144
153
|
|
|
145
154
|
async function runCommand(args: CliArgs): Promise<number> {
|
|
@@ -279,3 +279,7 @@ export {
|
|
|
279
279
|
} from './creature-attackable.ts'
|
|
280
280
|
export type { CreatureAttackable } from './creature-attackable.ts'
|
|
281
281
|
export type { CreatureBody } from './creature-body.ts'
|
|
282
|
+
|
|
283
|
+
// ONE-FORMAT OF30: a declared species row's optional view projection (rows.ts), lent from its own module
|
|
284
|
+
export { ActorProjectionV2Schema } from './actorProjectionV2.ts'
|
|
285
|
+
export type { ActorProjectionV2Rows } from './actorProjectionV2.ts'
|
|
@@ -30,6 +30,15 @@ interface DeprecationRule extends Deprecation {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const LEGACY_SPELLING = '0.1'
|
|
33
|
+
const NONE = 0
|
|
34
|
+
/** Deprecated in the current format with no data change: a shard file of any version may still carry it. */
|
|
35
|
+
const CURRENT = '0.1.0.1'
|
|
36
|
+
/** FORMAT-PRUNE FP15: OF30 cut B leaves these as plain JSON nothing reads. */
|
|
37
|
+
const SPECIES_PROGRAM_FAMILY: readonly string[] = [
|
|
38
|
+
'actors/species-programs',
|
|
39
|
+
'look/hull-book',
|
|
40
|
+
'look/rigged-hulls',
|
|
41
|
+
]
|
|
33
42
|
|
|
34
43
|
function field(value: unknown, key: string): unknown {
|
|
35
44
|
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
@@ -37,6 +46,22 @@ function field(value: unknown, key: string): unknown {
|
|
|
37
46
|
: undefined
|
|
38
47
|
}
|
|
39
48
|
|
|
49
|
+
/** Whether `key` names a field anywhere inside `value`. */
|
|
50
|
+
function hasKey(value: unknown, key: string): boolean {
|
|
51
|
+
const pending: unknown[] = [value]
|
|
52
|
+
while (pending.length > NONE) {
|
|
53
|
+
const next = pending.pop()
|
|
54
|
+
if (typeof next === 'object' && next !== null) {
|
|
55
|
+
if (!Array.isArray(next) && Object.hasOwn(next, key)) {
|
|
56
|
+
return true
|
|
57
|
+
}
|
|
58
|
+
const children: readonly unknown[] = Object.values(next)
|
|
59
|
+
pending.push(...children)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return false
|
|
63
|
+
}
|
|
64
|
+
|
|
40
65
|
const RULES: readonly DeprecationRule[] = [
|
|
41
66
|
{
|
|
42
67
|
id: 'version.two-part',
|
|
@@ -68,6 +93,75 @@ const RULES: readonly DeprecationRule[] = [
|
|
|
68
93
|
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
69
94
|
field(field(shard.index, 'runtime'), 'trust') !== undefined,
|
|
70
95
|
},
|
|
96
|
+
...SPECIES_PROGRAM_FAMILY.map((name: string): DeprecationRule => ({
|
|
97
|
+
id: `section.${name}`,
|
|
98
|
+
path: `sections/${name} (the species-program family, FORMAT-PRUNE FP15)`,
|
|
99
|
+
since: CURRENT,
|
|
100
|
+
replacement:
|
|
101
|
+
'species rows and authored looks (actors/species); nothing reads it once OF30 lands',
|
|
102
|
+
migration: undefined,
|
|
103
|
+
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
104
|
+
shard.sections.has(name),
|
|
105
|
+
})),
|
|
106
|
+
{
|
|
107
|
+
id: 'items.legacySlot',
|
|
108
|
+
path: 'an item equipment row legacySlot: a closed list of engine-native weapon names (FORMAT-PRUNE FP17)',
|
|
109
|
+
since: CURRENT,
|
|
110
|
+
replacement:
|
|
111
|
+
'none yet: it goes with engine native weapon slots, so a new item names no slot',
|
|
112
|
+
migration: undefined,
|
|
113
|
+
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
114
|
+
[...shard.sections.values()].some((section: unknown): boolean =>
|
|
115
|
+
hasKey(section, 'legacySlot'),
|
|
116
|
+
),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: 'admission.server',
|
|
120
|
+
path: 'shard.json admission.server (native assembly, FORMAT-PRUNE FP16)',
|
|
121
|
+
since: CURRENT,
|
|
122
|
+
replacement:
|
|
123
|
+
'the server primitives: the server derives every host (OF17b3)',
|
|
124
|
+
migration: undefined,
|
|
125
|
+
uses: (shard: Readonly<DeprecationInput>): boolean =>
|
|
126
|
+
field(field(shard.index, 'admission'), 'server') !== undefined,
|
|
127
|
+
},
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
/** A `legacy*` field that maps an old save key or saved shape: it stays, undeprecated, until a save wipe (J149), so a
|
|
131
|
+
* shard that keeps old players' saves working is not warned (FORMAT-PRUNE FP17). */
|
|
132
|
+
interface SaveBridge {
|
|
133
|
+
readonly path: string
|
|
134
|
+
/** The engine code that reads old saves through it. */
|
|
135
|
+
readonly reader: string
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** FP17's sort of the `legacy*` fields. `items.legacySlot` is shard data only, so it is a deprecation above; the
|
|
139
|
+
* species book's `piercing.legacy` goes with the species-program family (FP15); none can be migrated by data alone. */
|
|
140
|
+
const SAVE_BRIDGES: readonly SaveBridge[] = [
|
|
141
|
+
{
|
|
142
|
+
path: 'loadout bow.legacyItem',
|
|
143
|
+
reader: 'engine client/game/loadout/held.ts',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
path: 'quest persistence legacyNamespace',
|
|
147
|
+
reader: 'engine shared/game/quest/persistence.ts',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
path: 'quest story repair legacyObservation',
|
|
151
|
+
reader: 'engine client/game/plugin/ui.ts',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
path: 'quest story persistence reward.legacy',
|
|
155
|
+
reader: 'engine shared/game/quest/persistence.ts',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
path: 'elite feature legacy (versions, scripts, stun, upgrades)',
|
|
159
|
+
reader: 'engine server/game/quest/eliteFeature.ts',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
path: 'spawn script legacy (spec, acc, rng, groups)',
|
|
163
|
+
reader: 'engine server/game/population/spawnScript.ts',
|
|
164
|
+
},
|
|
71
165
|
]
|
|
72
166
|
|
|
73
167
|
/** Every deprecated path, without its test. */
|
|
@@ -123,6 +217,8 @@ function deprecationReport(
|
|
|
123
217
|
|
|
124
218
|
export {
|
|
125
219
|
DEPRECATIONS,
|
|
220
|
+
SAVE_BRIDGES,
|
|
221
|
+
type SaveBridge,
|
|
126
222
|
type DeprecationReport,
|
|
127
223
|
deprecationReport,
|
|
128
224
|
type Deprecation,
|
package/src/format/rows.ts
CHANGED
|
@@ -7,8 +7,8 @@ import * as v from 'valibot';
|
|
|
7
7
|
import { isJsonData } from './json.ts';
|
|
8
8
|
import { sketchReference } from './sketch.ts';
|
|
9
9
|
import { JournalRowSchema, journalRowRules } from './compendiumRows.ts';
|
|
10
|
-
import { CreatureAttackableSchema, CreatureMountSchema, creatureMountRules, CreatureTypeSchema, CreatureBodySchema, CreatureTemperamentSchema, CreatureSensesSchema, CreatureAbilitySchema, CreaturePresentationSchema } from './creature-layers.ts';
|
|
11
|
-
import type { CreatureAbilityInput, CreatureLayers } from './creature-layers.ts';
|
|
10
|
+
import { ActorProjectionV2Schema, CreatureAttackableSchema, CreatureMountSchema, creatureMountRules, CreatureTypeSchema, CreatureBodySchema, CreatureTemperamentSchema, CreatureSensesSchema, CreatureAbilitySchema, CreaturePresentationSchema } from './creature-layers.ts';
|
|
11
|
+
import type { ActorProjectionV2Rows, CreatureAbilityInput, CreatureLayers } from './creature-layers.ts';
|
|
12
12
|
import { creatureSizeRules } from './creature-sizes.ts';
|
|
13
13
|
import { SKIN_CLIPS_RECIPE, SkinClipMapSchema } from './skins.ts';
|
|
14
14
|
import type { SkinClipMap } from './skins.ts';
|
|
@@ -74,7 +74,9 @@ const species = v.strictObject({ id, kind: id, label: text, capExempt: v.exactOp
|
|
|
74
74
|
type: v.exactOptional(CreatureTypeSchema), body: v.exactOptional(CreatureBodySchema),
|
|
75
75
|
temperament: v.exactOptional(CreatureTemperamentSchema), senses: v.exactOptional(CreatureSensesSchema),
|
|
76
76
|
abilities: v.exactOptional(abilities), presentation: v.exactOptional(CreaturePresentationSchema), mount: v.exactOptional(CreatureMountSchema),
|
|
77
|
-
attackable: v.exactOptional(CreatureAttackableSchema)
|
|
77
|
+
attackable: v.exactOptional(CreatureAttackableSchema),
|
|
78
|
+
// ONE-FORMAT OF30: a declared species may carry its view projection (Nalati's balbal guest), so no species programme holds it
|
|
79
|
+
projection: v.exactOptional(ActorProjectionV2Schema) });
|
|
78
80
|
const parameter = v.union([finite, v.boolean(), text, v.pipe(v.array(finite), v.maxLength(16))]);
|
|
79
81
|
const animationParameters = v.record(id, parameter);
|
|
80
82
|
const lookAnimation = v.strictObject({
|
|
@@ -153,7 +155,7 @@ type ShardRows = { strikes: (StrikeRows)[]; weather: (({ id: string; states: ({
|
|
|
153
155
|
type SpeciesRowInput = Omit<SpeciesRow, "abilities"> & { abilities?: CreatureAbilityInput[] };
|
|
154
156
|
|
|
155
157
|
/** A species keeps its old fields, with optional explicit creature layers. */
|
|
156
|
-
interface SpeciesRow extends CreatureLayers { capExempt?: boolean; harvest?: HarvestDrop[]; id: string; kind: string; label: string; aggressive: boolean; lockable: boolean; dims: { bodyY: number; bodyHalfLen: number; bodyRadius: number; headRadius: number; legLen: number; feet: ([number, number])[]; halfWidth: number; capsuleAxis?: 'y' | 'z'; }; flight?: { altitude: number; above?: 'ground' | 'world'; climbRate: number; diveRate: number; lockRange?: number; bank?: number; }; variants: ({ id: string; label: string; rarity: 'common' | 'uncommon' | 'rare' | 'legendary'; weight: number; scale: [number, number]; hp: number; mods: { speed: number; chargeDist: number; damageTaken: number; chargeDamage: number; relentless: boolean; }; })[]; }
|
|
158
|
+
interface SpeciesRow extends CreatureLayers { capExempt?: boolean; projection?: ActorProjectionV2Rows; harvest?: HarvestDrop[]; id: string; kind: string; label: string; aggressive: boolean; lockable: boolean; dims: { bodyY: number; bodyHalfLen: number; bodyRadius: number; headRadius: number; legLen: number; feet: ([number, number])[]; halfWidth: number; capsuleAxis?: 'y' | 'z'; }; flight?: { altitude: number; above?: 'ground' | 'world'; climbRate: number; diveRate: number; lockRange?: number; bank?: number; }; variants: ({ id: string; label: string; rarity: 'common' | 'uncommon' | 'rare' | 'legendary'; weight: number; scale: [number, number]; hp: number; mods: { speed: number; chargeDist: number; damageTaken: number; chargeDamage: number; relentless: boolean; }; })[]; }
|
|
157
159
|
|
|
158
160
|
export { rowRules, RowsSchema, parseRows };
|
|
159
161
|
export type { StrikeRowsInput, StrikeRows, ShardRowsInput, ShardRows, SpeciesRow };
|