@wildshard/shard-format 0.4.6 → 0.4.7
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/shard-format",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
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": {
|
|
@@ -5,9 +5,10 @@ import memoryGates from './memoryGates.json' with { type: 'json' };
|
|
|
5
5
|
export const CHUNK_SIZE = 500; // metres, square
|
|
6
6
|
/** Half a cell width in metres. */
|
|
7
7
|
export const CHUNK_HALF: number = CHUNK_SIZE / 2;
|
|
8
|
-
/** Signed placement radius of the finite platform catalogue (SF88)
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
/** Signed placement radius of the finite platform catalogue (SF88): 7×7 since J314, J305's 5×5 at its centre and the
|
|
9
|
+
* outer ring void until a shard is placed there; residency budgets stay independent. */
|
|
10
|
+
export const GRID_RADIUS = 3;
|
|
11
|
+
/** Most placements, including open plots, the finite square platform holds; a grid may leave cells empty. */
|
|
11
12
|
export const GRID_CELL_COUNT: number = (2 * GRID_RADIUS + 1) ** 2;
|
|
12
13
|
/** Legal midpoint entry opening in metres. */
|
|
13
14
|
export const ENTRY_WIDTH = 8;
|
|
@@ -223,15 +223,16 @@ const gridShape = strictObject({
|
|
|
223
223
|
emptyNeighbour,
|
|
224
224
|
})
|
|
225
225
|
|
|
226
|
-
/** Placement data, independent of package content and solo coordinates.
|
|
226
|
+
/** Placement data, independent of package content and solo coordinates. Since J314 a
|
|
227
|
+
* cell may stay empty: the void a new shard's first upload is placed into. */
|
|
227
228
|
const GridCatalogueSchema: GenericSchema<GridCatalogueInput, GridCatalogue> =
|
|
228
229
|
pipe(
|
|
229
230
|
gridShape,
|
|
230
231
|
check(
|
|
231
232
|
// oxlint-disable-next-line typescript/prefer-readonly-parameter-types -- valibot's check takes the schema's own type
|
|
232
233
|
(grid: InferOutput<typeof gridShape>): boolean =>
|
|
233
|
-
uniquePlaces(grid.cells)
|
|
234
|
-
'unique stable instance identities and
|
|
234
|
+
uniquePlaces(grid.cells),
|
|
235
|
+
'unique stable instance identities and cells',
|
|
235
236
|
),
|
|
236
237
|
)
|
|
237
238
|
|