@wildshard/engine 0.1.17 → 0.1.18
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/lint/engine-sides.json +7 -0
- package/lint/host-callback-syntax.mjs +2 -1
- package/lint/host-callbacks.mjs +3 -3
- package/lint/host-files.mjs +5 -4
- package/lint/no-base64.mjs +3 -1
- package/lint/shard-imports.mjs +6 -7
- package/lint/shard-source.d.mts +9 -0
- package/lint/shard-source.mjs +91 -0
- package/lint/shardfile-boundaries.mjs +10 -8
- package/lint/sim-closure.mjs +6 -3
- package/lint/wildshard-plugin.d.ts +4 -0
- package/lint/wildshard-plugin.js +22 -23
- package/package.json +9 -2
- package/scripts/app-build/outputProducts.d.mts +3 -0
- package/scripts/app-build/outputProducts.mjs +31 -0
- package/scripts/app-build-pipeline.mjs +3 -0
- package/scripts/check-devserver.mjs +1 -1
- package/scripts/chromium-keychain-check.mjs +4 -2
- package/scripts/chromium-keychain.mjs +3 -1
- package/scripts/cook.mjs +7 -3
- package/scripts/devices.d.mts +4 -0
- package/scripts/devices.mjs +39 -0
- package/scripts/devserver-client.d.mts +4 -2
- package/scripts/devserver-client.mjs +25 -8
- package/scripts/doctor-proof.mjs +1 -1
- package/scripts/e2e-faults.mjs +159 -0
- package/scripts/grid-crossing-walk-proof.mjs +14 -3
- package/scripts/memory-proof.mjs +158 -0
- package/scripts/offline-proof-rules.d.mts +4 -2
- package/scripts/offline-proof-rules.mjs +21 -5
- package/scripts/offline-proof.mjs +15 -6
- package/scripts/tier-textures-proof.mjs +101 -0
- package/scripts/tier-textures.mjs +60 -0
- package/scripts/tsconfig.json +1 -0
- package/scripts/vps/wildshard-config +79 -23
- package/scripts/worker-client-play.mjs +1 -0
- package/scripts/worker-client-proof.mjs +1 -1
- package/scripts/worker-client-slug.mjs +44 -0
- package/src/client/app/entry.ts +37 -10
- package/src/client/engine/boot/parsedPages.ts +127 -58
- package/src/client/engine/build.d.ts +2 -0
- package/src/client/engine/core/Game.ts +18 -0
- package/src/client/engine/core/bootstrap.ts +4 -1
- package/src/client/engine/debug/probe.ts +18 -1
- package/src/client/engine/fx/LightPool.ts +41 -1
- package/src/client/engine/pwa/sw.js +12 -3
- package/src/client/engine/render/precompile.ts +20 -14
- package/src/client/engine/telemetry/browserErrors.ts +4 -1
- package/src/client/engine/telemetry/deviceSnapshot.ts +155 -0
- package/src/client/game/boot/audio.generated.ts +0 -102
- package/src/client/game/boot/bytes.generated.ts +42 -60
- package/src/client/game/boot/versions.generated.ts +0 -2
- package/src/client/game/grid/area.ts +38 -0
- package/src/client/game/grid/live.ts +28 -2
- package/src/client/game/grid/liveSession.ts +14 -3
- package/src/client/game/grid/menu.ts +4 -0
- package/src/client/game/grid/neighbourPanels.ts +10 -1
- package/src/client/game/grid/placedCards.ts +55 -0
- package/src/client/game/grid/placedCells.ts +131 -0
- package/src/client/game/grid/regionalRuntime.ts +6 -0
- package/src/client/game/grid/regionalWorld.ts +15 -2
- package/src/client/game/grid/roadCull.ts +44 -14
- package/src/client/game/grid/roadTileBacking.ts +13 -3
- package/src/client/game/grid/session.ts +9 -0
- package/src/client/game/grid/shardfileFar.ts +9 -3
- package/src/client/game/session/finish.ts +5 -1
- package/src/client/game/shard/titleList.ts +6 -2
- package/src/client/game/shardfile/clientWorker.ts +2 -1
- package/src/client/game/titleDeck.ts +4 -3
- package/src/client/host/online/shell.ts +14 -0
- package/src/cook/game/shardCook.ts +38 -8
- package/src/cook/game/tierTextures.ts +276 -0
- package/src/e2e/smoke/game.ts +19 -14
- package/src/e2e/smoke/page-globals.d.ts +9 -8
- package/src/e2e/smoke/template2.spec.ts +8 -7
- package/src/server/host/dedicated/placementFile.ts +1 -17
- package/src/server/host/dedicated/socketTransport.ts +2 -1
- package/src/server/host/dedicated/world.ts +30 -1
- package/src/shared/engine/net/deviceWord.ts +138 -0
- package/src/shared/engine/net/socketFrames.ts +7 -4
- package/src/shared/game/grid/catalogueSlot.ts +7 -0
- package/src/shared/game/grid/placementRows.ts +33 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,14 @@ run `../repo-kit/release.sh vX.Y.Z --prepare` and `--finish` as before (the help
|
|
|
9
9
|
`scripts/changelog.mjs` checks the format; the pre-push hook and CI refuse a push whose `package.json` version has no
|
|
10
10
|
valid section, and a `vX.Y.Z` tag whose commit has none.
|
|
11
11
|
|
|
12
|
+
## v0.1.18 (2026-11-13)
|
|
13
|
+
|
|
14
|
+
- Share a shard with a link: play.wildshard.io/slug/driftwood-isle opens that shard and shows its name and picture in chat previews.
|
|
15
|
+
- New shards placed on the world grid after a release, like Thin Ice, get their own card in Shard select and you can walk in.
|
|
16
|
+
- iPhones use less memory: Driftwood loads compressed textures, and the world file loads with far fewer allocations.
|
|
17
|
+
- Walking off a shard's edge no longer stalls while the next shard builds, and Driftwood Isle and Pine Hollow have their sounds back.
|
|
18
|
+
- Behind the scenes: we log each player's device to find crashes, and shard authors can prepare a release without the engine source.
|
|
19
|
+
|
|
12
20
|
## v0.1.17 (2026-11-13)
|
|
13
21
|
|
|
14
22
|
- Crossing is on: walk off one shard's edge into the next at full speed, with no invisible walls at chunk edges or seams.
|
package/lint/engine-sides.json
CHANGED
|
@@ -419,6 +419,7 @@
|
|
|
419
419
|
"src/client/engine/script/client.ts": "client",
|
|
420
420
|
"src/client/engine/telemetry/bootInbox.ts": "client",
|
|
421
421
|
"src/client/engine/telemetry/browserErrors.ts": "client",
|
|
422
|
+
"src/client/engine/telemetry/deviceSnapshot.ts": "client",
|
|
422
423
|
"src/client/engine/telemetry/screenOutbox.ts": "client",
|
|
423
424
|
"src/client/engine/telemetry/staleBuildReport.ts": "client",
|
|
424
425
|
"src/client/engine/telemetry/crossroads.ts": "client",
|
|
@@ -613,6 +614,7 @@
|
|
|
613
614
|
"src/client/game/grid/admissionPriority.ts": "client",
|
|
614
615
|
"src/client/game/grid/admissionYield.ts": "client",
|
|
615
616
|
"src/client/game/grid/approachProductInputs.ts": "client",
|
|
617
|
+
"src/client/game/grid/area.ts": "client",
|
|
616
618
|
"src/client/game/grid/assetResidency.ts": "client",
|
|
617
619
|
"src/client/game/grid/borderShimmer.ts": "client",
|
|
618
620
|
"src/client/game/grid/budgetOverlay.ts": "client",
|
|
@@ -659,6 +661,8 @@
|
|
|
659
661
|
"src/client/game/grid/neighbourPanels.ts": "client",
|
|
660
662
|
"src/client/game/grid/neighbourRows.ts": "client",
|
|
661
663
|
"src/client/game/grid/oneWayIn.ts": "client",
|
|
664
|
+
"src/client/game/grid/placedCells.ts": "client",
|
|
665
|
+
"src/client/game/grid/placedCards.ts": "client",
|
|
662
666
|
"src/client/game/grid/pageEntry.ts": "client",
|
|
663
667
|
"src/client/game/grid/pageResidency.ts": "client",
|
|
664
668
|
"src/client/game/grid/pageShell.ts": "client",
|
|
@@ -1111,6 +1115,7 @@
|
|
|
1111
1115
|
"src/cook/game/shardCook.ts": "cook",
|
|
1112
1116
|
"src/cook/game/spawnParts.ts": "cook",
|
|
1113
1117
|
"src/cook/game/stripPack.ts": "cook",
|
|
1118
|
+
"src/cook/game/tierTextures.ts": "cook",
|
|
1114
1119
|
"src/server/engine/ai/bossContenders.ts": "server",
|
|
1115
1120
|
"src/server/engine/ai/burstFlyer.ts": "server",
|
|
1116
1121
|
"src/server/engine/ai/challengeGrazer.ts": "server",
|
|
@@ -1455,6 +1460,7 @@
|
|
|
1455
1460
|
"src/shared/engine/net/schema.ts": "shared",
|
|
1456
1461
|
"src/shared/engine/net/shardNet.ts": "shared",
|
|
1457
1462
|
"src/shared/engine/net/socketFrames.ts": "shared",
|
|
1463
|
+
"src/shared/engine/net/deviceWord.ts": "shared",
|
|
1458
1464
|
"src/shared/engine/net/transport.ts": "shared",
|
|
1459
1465
|
"src/shared/engine/net/wireFrames.ts": "shared",
|
|
1460
1466
|
"src/shared/engine/net/wireMessages.ts": "shared",
|
|
@@ -1619,6 +1625,7 @@
|
|
|
1619
1625
|
"src/shared/game/grid/catalogue.ts": "shared",
|
|
1620
1626
|
"src/shared/game/grid/catalogueDocument.ts": "shared",
|
|
1621
1627
|
"src/shared/game/grid/catalogueSlot.ts": "shared",
|
|
1628
|
+
"src/shared/game/grid/placementRows.ts": "shared",
|
|
1622
1629
|
"src/shared/game/grid/cellEvents.ts": "shared",
|
|
1623
1630
|
"src/shared/game/grid/collisionStrips.ts": "shared",
|
|
1624
1631
|
"src/shared/game/grid/compiledStrips.ts": "shared",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// G642: callback admission from syntax; the typed catalogue is a separate build tool.
|
|
2
2
|
import { hostPlayFile } from './host-files.mjs';
|
|
3
|
+
import { shardFile } from './shard-source.mjs';
|
|
3
4
|
import { createSyntaxGraph, syntaxChild as child,
|
|
4
5
|
syntaxFunctions as functions, syntaxClasses as classes } from './syntax-values.mjs';
|
|
5
6
|
|
|
6
7
|
const platform = file => /^src\/(?:engine|game|sdk|sharddev)\//u.test(file);
|
|
7
|
-
const shard = file => file.startsWith('src/shards/');
|
|
8
8
|
const keyOf = node => node?.type === 'Identifier' ? node.name : node?.type === 'Literal' ? String(node.value) : null;
|
|
9
9
|
const unwrap = input => {
|
|
10
10
|
let node = input;
|
|
@@ -16,6 +16,7 @@ const unwrap = input => {
|
|
|
16
16
|
export function hostCallbackSites(root, file, program) {
|
|
17
17
|
if (!hostPlayFile(root, file)) return [];
|
|
18
18
|
const { primary, make, values } = createSyntaxGraph(root, file, program);
|
|
19
|
+
const shard = path => shardFile(root, path) !== null;
|
|
19
20
|
function leaves(ref, label, seen = new Set()) {
|
|
20
21
|
const node = unwrap(ref.node);
|
|
21
22
|
if (!node || seen.has(node)) return [];
|
package/lint/host-callbacks.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { existsSync } from 'node:fs';
|
|
|
3
3
|
import { relative, resolve } from 'node:path';
|
|
4
4
|
import ts from '@typescript/typescript6';
|
|
5
5
|
import { hostPlayFile } from './host-files.mjs';
|
|
6
|
+
import { shardFile, shardSourceDirs } from './shard-source.mjs';
|
|
6
7
|
import { formatSource } from '../scripts/format-package.mjs';
|
|
7
8
|
|
|
8
9
|
const projects = new Map();
|
|
9
10
|
const localPath = (root, file) => relative(root, file).replaceAll('\\', '/');
|
|
10
11
|
const platform = file => /^src\/(?:engine|game|sdk|sharddev)\//u.test(file);
|
|
11
|
-
const shard = file => /^src\/shards\/([^/]+)\/(.+)$/u.exec(file);
|
|
12
12
|
/** One compiler/checker per immutable tree; no diagnostics or emit, only binding/signature resolution. */
|
|
13
13
|
export function hostAnalysis(inputRoot) {
|
|
14
14
|
const root = resolve(inputRoot);
|
|
@@ -16,7 +16,7 @@ export function hostAnalysis(inputRoot) {
|
|
|
16
16
|
const configFile = resolve(root, 'tsconfig.json');
|
|
17
17
|
const config = existsSync(configFile) ? ts.readConfigFile(configFile, file => ts.sys.readFile(file)).config : {};
|
|
18
18
|
const parsed = ts.parseJsonConfigFileContent(config, ts.sys, root);
|
|
19
|
-
const files = ts.sys.readDirectory(resolve(root,
|
|
19
|
+
const files = shardSourceDirs(root).flatMap(dir => ts.sys.readDirectory(resolve(root, dir), ['.ts', '.tsx', '.mts', '.cts'], ['**/node_modules/**', '**/dist/**']))
|
|
20
20
|
.filter(file => hostPlayFile(root, localPath(root, file)));
|
|
21
21
|
const sectionRegistry = formatSource(root, 'sections.ts');
|
|
22
22
|
const program = ts.createProgram([...files, ...existsSync(sectionRegistry) ? [sectionRegistry] : []], { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.ESNext,
|
|
@@ -49,7 +49,7 @@ export function hostAnalysis(inputRoot) {
|
|
|
49
49
|
if (type.getCallSignatures().length > 0) return [label];
|
|
50
50
|
return checker.getPropertiesOfType(type).flatMap(property => {
|
|
51
51
|
const decl = property.valueDeclaration;
|
|
52
|
-
if (!decl ||
|
|
52
|
+
if (!decl || shardFile(root, pathOf(decl)) === null) return [];
|
|
53
53
|
return typeLeaves(checker.getTypeOfSymbolAtLocation(property, node), node, `${label}.${property.name}`, next);
|
|
54
54
|
});
|
|
55
55
|
}
|
package/lint/host-files.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Path-only play boundary, shared by lint and the typed catalogue builder.
|
|
2
|
+
import { shardFile } from './shard-source.mjs';
|
|
2
3
|
|
|
3
|
-
/** Build-only functions are not play callbacks. */
|
|
4
|
-
export function hostPlayFile(
|
|
5
|
-
const
|
|
6
|
-
return
|
|
4
|
+
/** Build-only functions are not play callbacks. `file` is relative to `root`, in either shard layout (SA45). */
|
|
5
|
+
export function hostPlayFile(root, file) {
|
|
6
|
+
const shard = shardFile(root, file);
|
|
7
|
+
return shard !== null && !/^(?:data|generators|behaviour|assets|blender)\/|^shard\.config\.|\.d\.ts$|\.generated\./u.test(shard.local);
|
|
7
8
|
}
|
package/lint/no-base64.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// G649 B3: syntactic calls only; no TypeScript program or import-graph walk.
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
|
+
import { lintFile } from './shard-source.mjs';
|
|
4
5
|
|
|
5
6
|
const unwrap = node => ['TSAsExpression', 'TSTypeAssertion', 'TSNonNullExpression', 'ChainExpression', 'ParenthesizedExpression'].includes(node?.type)
|
|
6
7
|
? unwrap(node.expression) : node;
|
|
@@ -98,7 +99,8 @@ export function noBase64Rule(policyFile) {
|
|
|
98
99
|
meta: { type: 'problem', docs: { description: 'Keep binary content binary; never encode or decode base64 (G649)' },
|
|
99
100
|
schema: [{ type: 'object', properties: { count: { type: 'boolean' } }, additionalProperties: false }] },
|
|
100
101
|
create(context) {
|
|
101
|
-
|
|
102
|
+
// SA24 / SA45: shard source is keyed by its source path (src/shards/<slug>/<local>) in either layout, as the other shard rules read it
|
|
103
|
+
const shard = lintFile(context.filename, process.cwd()), file = shard.shard === null ? base64Path(context.filename) : shard.path;
|
|
102
104
|
if (!/^(?:src|scripts)\//u.test(file)) return {};
|
|
103
105
|
const limit = context.options[0]?.count === true ? 0 : Object.hasOwn(policy.files, file) ? policy.files[file] : 0;
|
|
104
106
|
let found = 0;
|
package/lint/shard-imports.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
3
|
+
import { shardOfFilename } from './shard-source.mjs';
|
|
3
4
|
|
|
4
5
|
/** The file Node loads for relative `source` (a URL resolve, query and hash dropped), without a trailing slash; null when it cannot. */
|
|
5
6
|
const nodePath = (filename, source) => {
|
|
@@ -25,8 +26,7 @@ export function shardGameImport(filename, source) {
|
|
|
25
26
|
|
|
26
27
|
/** G307: a game's exports map is its plugin surface, never a parallel SDK facade allowlist. */
|
|
27
28
|
export function gamePluginImportViolation(filename, source, exports) {
|
|
28
|
-
const
|
|
29
|
-
const local = /(?:^|\/)src\/shards\/[^/]+\/(.+)$/u.exec(path)?.[1];
|
|
29
|
+
const local = shardOfFilename(filename)?.local;
|
|
30
30
|
if (local === undefined || !shardGameImport(filename, source)) return null;
|
|
31
31
|
if (!local.startsWith('runtime/')) return 'game imports belong only in runtime/';
|
|
32
32
|
if (!source.startsWith('@wildshard/game/')) return 'use the defining @wildshard/game package export';
|
|
@@ -72,12 +72,12 @@ function encodedImportViolation(filename, rawSource) {
|
|
|
72
72
|
* (bake commands, Blender sources, declarations) imports by a plain relative path or a package name: an escaped,
|
|
73
73
|
* absolute or file: path would slip past the layer rules, which read it with path.resolve. */
|
|
74
74
|
export function generatorImportViolation(filename, rawSource) {
|
|
75
|
-
const path=resolve(filename).replaceAll('\\','/'),
|
|
76
|
-
if(
|
|
75
|
+
const path=resolve(filename).replaceAll('\\','/'), shard=shardOfFilename(path);
|
|
76
|
+
if(shard===null || typeof rawSource!=='string')return null;
|
|
77
77
|
const encoded=encodedImportViolation(filename,rawSource);
|
|
78
78
|
if(encoded!==null)return encoded;
|
|
79
79
|
const source=pathPart(rawSource);
|
|
80
|
-
if(!(/^(?:generators|data|quests)\//u.test(
|
|
80
|
+
if(!(/^(?:generators|data|quests)\//u.test(shard.local) || shard.local==='shard.config.ts'))
|
|
81
81
|
return isAbsolute(source) || source.startsWith('file:') ? 'shard files import by relative path or package name, never an absolute path or file: URL' : null;
|
|
82
82
|
// Test runners and Node fixture tools never become producer imports.
|
|
83
83
|
if(path.endsWith('.test.ts') && source!=='<computed>' && !source.startsWith('.')
|
|
@@ -85,7 +85,6 @@ export function generatorImportViolation(filename, rawSource) {
|
|
|
85
85
|
if(/^@wildshard\/sharddev\/runtime(?:\/|$)/u.test(source))return 'trusted SDK runtime code is not an authoring import';
|
|
86
86
|
if(source==='three' || source.startsWith('three/') || /^@wildshard\/(?:engine\/host|sdk|sharddev|commons)(?:\/|$)/u.test(source))return null;
|
|
87
87
|
const local=source.startsWith('.') ? resolve(dirname(filename),source).replaceAll('\\','/') : '';
|
|
88
|
-
|
|
89
|
-
if(local.startsWith(boundary))return null;
|
|
88
|
+
if(local.startsWith(shard.dir))return null;
|
|
90
89
|
return 'author folders import only three, sdk, commons or their own shard files';
|
|
91
90
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** SA45: a file in shard source, in either layout (`src/shards/<slug>/` or a single-shard repo's `src/`). */
|
|
2
|
+
export interface ShardFile { readonly slug: string; readonly local: string; readonly base: string; readonly path: string }
|
|
3
|
+
export interface LintFile { readonly root: string; readonly file: string; readonly path: string; readonly shard: ShardFile | null }
|
|
4
|
+
export function repoShardSlug(repo: string): string | null;
|
|
5
|
+
export function shardFile(root: string, file: string): ShardFile | null;
|
|
6
|
+
export function shardSourceDirs(root: string): string[];
|
|
7
|
+
export function lintFile(filename: string, base: string): LintFile;
|
|
8
|
+
export function sourcePath(filename: string, base: string): string;
|
|
9
|
+
export function shardOfFilename(filename: string): { readonly slug: string; readonly local: string; readonly dir: string } | null;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// SA45 (J317, J329): the one answer to "is this file shard source, which shard, and where is its root", for both
|
|
2
|
+
// layouts. Engine and multi-shard repos keep `src/shards/<slug>/`; a single-shard repo keeps its one shard at `src/`
|
|
3
|
+
// (`src/shard.config.ts`, or a hand-written `src/shard.json`), the rule sharddev's shardSource.ts (SA16) uses.
|
|
4
|
+
//
|
|
5
|
+
// Lint rules match one layout: a single-shard file `src/<local>` reads as `src/shards/<slug>/<local>` (its source path).
|
|
6
|
+
// Debt keys (lint/ratchet.json, runtime-performance.json) use that form too, so a repo's keys survive the move to `src/`.
|
|
7
|
+
// Anything that opens the file on disk uses its real path; scripts/blender/targets.json may name either form.
|
|
8
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
9
|
+
import { basename, relative, resolve, sep } from 'node:path';
|
|
10
|
+
|
|
11
|
+
const SHARD_CONFIG = 'shard.config.ts';
|
|
12
|
+
const SHARD_INDEX = 'shard.json';
|
|
13
|
+
const slash = path => path.replaceAll('\\', '/');
|
|
14
|
+
const readJson = (file) => {
|
|
15
|
+
try { return JSON.parse(readFileSync(file, 'utf8')); } catch { return null; }
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const repoSlugs = new Map();
|
|
19
|
+
/** The slug of the one shard whose source is `<repo>/src`, or null when that `src/` is no shard source. Like
|
|
20
|
+
* sharddev's shardFolderName: a hand-written source's `identity.slug`, else `manifest.json`'s `slug`, else the repo folder. */
|
|
21
|
+
export function repoShardSlug(repo) {
|
|
22
|
+
const key = resolve(repo);
|
|
23
|
+
if (repoSlugs.has(key)) return repoSlugs.get(key);
|
|
24
|
+
const src = resolve(key, 'src'), config = existsSync(resolve(src, SHARD_CONFIG));
|
|
25
|
+
const handwritten = !config && existsSync(resolve(src, SHARD_INDEX));
|
|
26
|
+
let slug = null;
|
|
27
|
+
if (config || handwritten) {
|
|
28
|
+
const named = (handwritten ? readJson(resolve(src, SHARD_INDEX))?.identity?.slug : undefined) ?? readJson(resolve(src, 'manifest.json'))?.slug;
|
|
29
|
+
slug = typeof named === 'string' && named !== '' ? named : basename(key);
|
|
30
|
+
}
|
|
31
|
+
repoSlugs.set(key, slug);
|
|
32
|
+
return slug;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** `file` (relative to the repo `root`, real layout) as shard source: its slug, its shard-local path, its shard root
|
|
36
|
+
* relative to `root` (`src` or `src/shards/<slug>`) and its source path (`src/shards/<slug>/<local>`); else null. */
|
|
37
|
+
export function shardFile(root, file) {
|
|
38
|
+
const path = slash(file);
|
|
39
|
+
if (!path.startsWith('src/')) return null;
|
|
40
|
+
const single = repoShardSlug(root);
|
|
41
|
+
if (single !== null) {
|
|
42
|
+
const local = path.slice('src/'.length);
|
|
43
|
+
return local === '' ? null : { slug: single, local, base: 'src', path: `src/shards/${single}/${local}` };
|
|
44
|
+
}
|
|
45
|
+
const match = /^src\/shards\/([^/]+)\/(.+)$/u.exec(path);
|
|
46
|
+
return match === null ? null : { slug: match[1], local: match[2], base: `src/shards/${match[1]}`, path };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The folders (relative to `root`) that hold shard source: `src` in a single-shard repo, else `src/shards`. */
|
|
50
|
+
export function shardSourceDirs(root) {
|
|
51
|
+
return repoShardSlug(root) === null ? ['src/shards'] : ['src'];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The innermost single-shard repo holding absolute `abs` (the folder above one of its `/src/` segments), or null. */
|
|
55
|
+
function singleRepoOf(abs) {
|
|
56
|
+
const path = slash(abs);
|
|
57
|
+
for (let index = path.lastIndexOf('/src/'); index > 0; index = path.lastIndexOf('/src/', index - 1)) {
|
|
58
|
+
if (repoShardSlug(path.slice(0, index)) !== null) return path.slice(0, index);
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Absolute `filename` as lint sees it: `file` its repo-relative real path from the last `/src/` (or relative to
|
|
64
|
+
* `base` when it has none), `path` its source path, `root` the repo root, and `shard` its shardFile (or null). */
|
|
65
|
+
export function lintFile(filename, base) {
|
|
66
|
+
const abs = resolve(filename), repo = singleRepoOf(abs);
|
|
67
|
+
if (repo !== null) {
|
|
68
|
+
const file = slash(relative(repo, abs)), shard = shardFile(repo, file);
|
|
69
|
+
return { root: repo.split('/').join(sep), file, path: shard?.path ?? file, shard };
|
|
70
|
+
}
|
|
71
|
+
const path = slash(relative(base, abs)), index = path.lastIndexOf('/src/');
|
|
72
|
+
const file = index === -1 ? path : path.slice(index + 1);
|
|
73
|
+
const absolute = slash(abs), marker = absolute.lastIndexOf('/src/');
|
|
74
|
+
const root = marker === -1 ? resolve(base) : abs.slice(0, marker);
|
|
75
|
+
const match = /^src\/shards\/([^/]+)\/(.+)$/u.exec(file);
|
|
76
|
+
return { root, file, path: file, shard: match === null ? null : { slug: match[1], local: match[2], base: `src/shards/${match[1]}`, path: file } };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Absolute `filename`'s source path (see lintFile). */
|
|
80
|
+
export const sourcePath = (filename, base) => lintFile(filename, base).path;
|
|
81
|
+
|
|
82
|
+
/** Absolute `filename`'s shard: slug, shard-local path and the absolute shard root folder; null outside shard source. */
|
|
83
|
+
export function shardOfFilename(filename) {
|
|
84
|
+
const abs = slash(resolve(filename)), repo = singleRepoOf(abs);
|
|
85
|
+
if (repo !== null) {
|
|
86
|
+
const local = abs.slice(repo.length + '/src/'.length);
|
|
87
|
+
return local === '' ? null : { slug: repoShardSlug(repo), local, dir: `${repo}/src/` };
|
|
88
|
+
}
|
|
89
|
+
const match = /(?:^|\/)src\/shards\/([^/]+)\/(.+)$/u.exec(abs);
|
|
90
|
+
return match === null ? null : { slug: match[1], local: match[2], dir: abs.slice(0, abs.length - match[2].length) };
|
|
91
|
+
}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { existsSync, readFileSync } from 'node:fs';
|
|
3
3
|
import { dirname, relative, resolve } from 'node:path';
|
|
4
4
|
import { parseSync } from 'vite';
|
|
5
|
+
import { shardFile } from './shard-source.mjs';
|
|
5
6
|
|
|
6
7
|
const BUILD = /^(?:data|generators|bake|behaviour|assets|blender)(?:\/|$)|^shard\.config(?:\.[cm]?[jt]s)?$/u;
|
|
7
8
|
const PLAY = /^(?:runtime|world|look|models|weapons|quest|quests|combat|species|creatures|npc|loadout|ride|vm|grapple|life|compendium|boot|debug|dev|playground|explore|audio|loot|onboarding)(?:\/|$)/u;
|
|
8
|
-
|
|
9
|
+
/** [source path, slug, shard-local path] for `path` (relative to `root`, either layout, SA45), or null. */
|
|
10
|
+
const shard = (root, path) => { const found = shardFile(root, path); return found === null ? null : [found.path, found.slug, found.local]; };
|
|
9
11
|
const text = node => node?.type === 'Literal' && typeof node.value === 'string' ? node.value
|
|
10
12
|
: node?.type === 'TemplateLiteral' && node.expressions.length === 0 ? node.quasis[0]?.value.cooked ?? null : null;
|
|
11
13
|
const prefix = node => text(node) ?? (node?.type === 'TemplateLiteral' ? node.quasis[0]?.value.cooked
|
|
@@ -34,8 +36,8 @@ function target(root, file, source) {
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
function violation(root, file, source, computed, glob, rule) {
|
|
37
|
-
const own = shard(file), dest = source === null ? null : target(root, file, source);
|
|
38
|
-
const other = dest === null ? null : shard(dest);
|
|
39
|
+
const own = shard(root, file), dest = source === null ? null : target(root, file, source);
|
|
40
|
+
const other = dest === null ? null : shard(root, dest);
|
|
39
41
|
const build = own !== null && BUILD.test(own[2]);
|
|
40
42
|
if (rule === 'runtime-standalone') {
|
|
41
43
|
if (own === null || !own[2].startsWith('runtime/')) return null;
|
|
@@ -43,14 +45,14 @@ function violation(root, file, source, computed, glob, rule) {
|
|
|
43
45
|
if (/[?#]/u.test(source)) return 'runtime/ cannot import assets, JSON, ?raw or ?url; read the admitted product instead';
|
|
44
46
|
if (/\.[^/]+$/u.test(source) && !/\.[cm]?[jt]sx?$/u.test(source)) return `runtime/ cannot import JSON or assets: ${source}; read the admitted product instead`;
|
|
45
47
|
if (dest === null) return publicPackage(root, source) ? null : `runtime/ imports only its own files and public engine/game/SDK/format, three or valibot modules: ${source}`;
|
|
46
|
-
if (!
|
|
48
|
+
if (other?.[1] !== own[1] || !other[2].startsWith('runtime/')) return `runtime/ is standalone: ${source} leaves its own runtime/; read a built section or move play code into runtime/`;
|
|
47
49
|
if (/\.[^/]+$/u.test(dest) && !/\.[cm]?tsx?$/u.test(dest) || glob && !/\.[cm]?tsx?$/u.test(dest)) return `runtime/ cannot import JSON or assets: ${source}; read the admitted product instead`;
|
|
48
50
|
return null;
|
|
49
51
|
}
|
|
50
52
|
if (rule === 'no-build-time-import') {
|
|
51
53
|
if (!file.startsWith('src/') || file.startsWith('src/commons/') || /^src\/sharddev\/(?:cli|bake)\//u.test(file)) return null;
|
|
52
54
|
if (other === null || !BUILD.test(other[2])) {
|
|
53
|
-
return computed && dest?.startsWith('src/shards/') && !build ? `Play code cannot compute a path into shard build-time folders: ${source}` : null;
|
|
55
|
+
return computed && (other !== null || dest?.startsWith('src/shards/') === true) && !build ? `Play code cannot compute a path into shard build-time folders: ${source}` : null;
|
|
54
56
|
}
|
|
55
57
|
if (build && own[1] === other[1]) return null;
|
|
56
58
|
return `Play code cannot import build-time code: ${source}; read it from the built shard's sections or blobs`;
|
|
@@ -64,7 +66,7 @@ function violation(root, file, source, computed, glob, rule) {
|
|
|
64
66
|
|
|
65
67
|
/** Same AST visitors for the linter and copier. Type-only, lazy and resource imports are all boundaries. */
|
|
66
68
|
export function shardfileBoundaryVisitors(root, file, rule, report) {
|
|
67
|
-
const own = shard(file);
|
|
69
|
+
const own = shard(root, file);
|
|
68
70
|
if (rule === 'runtime-standalone' && !own?.[2].startsWith('runtime/')) return {};
|
|
69
71
|
if (rule === 'no-runtime-in-build' && (own === null || !BUILD.test(own[2]))) return {};
|
|
70
72
|
const check = (node, raw, glob = false) => {
|
|
@@ -83,7 +85,7 @@ export function shardfileBoundaryVisitors(root, file, rule, report) {
|
|
|
83
85
|
if (node.callee.type === 'Identifier' && node.callee.name === 'require') check(node, node.arguments[0]);
|
|
84
86
|
if ((member(node.callee, 'glob') || member(node.callee, 'globEager')) && importMeta(node.callee.object)) {
|
|
85
87
|
const raw = node.arguments[0], patterns = raw?.type === 'ArrayExpression' ? raw.elements : [raw];
|
|
86
|
-
if (rule === 'runtime-standalone' &&
|
|
88
|
+
if (rule === 'runtime-standalone' && own?.[2].startsWith('runtime/') && node.arguments[1]?.type === 'ObjectExpression'
|
|
87
89
|
&& node.arguments[1].properties.some(property => ['query', 'as'].includes(property.key?.name ?? text(property.key)))) {
|
|
88
90
|
report(node, 'runtime/ globs cannot transform modules into assets with query/as');
|
|
89
91
|
}
|
|
@@ -99,7 +101,7 @@ export function shardfileBoundaryVisitors(root, file, rule, report) {
|
|
|
99
101
|
};
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
/** Raw violations, without migration allowances. `file` is
|
|
104
|
+
/** Raw violations, without migration allowances. `file` is relative to `root`: src/shards/<slug>/... or a single-shard src/... (SA45).
|
|
103
105
|
* @returns {{rule: string, message: string, start: number, end: number}[]} */
|
|
104
106
|
export function shardfileBoundaryViolations(root, file, source) {
|
|
105
107
|
const parsed = parseSync(file, source);
|
package/lint/sim-closure.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { currentSources, sourceStamp } from './source-stamps.mjs';
|
|
|
4
4
|
import { existsSync, readFileSync, globSync, statSync } from 'node:fs';
|
|
5
5
|
import { dirname, resolve, relative } from 'node:path';
|
|
6
6
|
import { parseSync } from 'vite';
|
|
7
|
+
import { shardFile } from './shard-source.mjs';
|
|
7
8
|
|
|
8
9
|
const VIEW = /^src\/(?:client|cook|server|shared)\/engine\/(?:app\/view\/|ai\/view\/|combat\/view\/|quest\/view(?:\/|\.ts$)|saves\/view\/|entities\/AnimalView\.ts$)/u;
|
|
9
10
|
const FORBIDDEN = /^src\/(?:client|cook|server|shared)\/engine\/(?:app\/runtime(?:\.ts)?$|core\/(?:tier|frameCost)(?:\.ts)?$|render\/|ui\/|fx\/|anim\/)/u;
|
|
@@ -61,7 +62,9 @@ export function reference(node, parent) {
|
|
|
61
62
|
return true;
|
|
62
63
|
}
|
|
63
64
|
const closureResults = new Map();
|
|
64
|
-
|
|
65
|
+
/** simRoot of `path` (relative to `root`) read in the one shard layout, so a single-shard repo's src/data/ counts (SA45). */
|
|
66
|
+
const simRootIn = (root, path) => simRoot(shardFile(root, path)?.path ?? path);
|
|
67
|
+
export function simClosure(root, entries = globSync('src/**/*.ts', { cwd: root }).filter(path => simRootIn(root, path))) {
|
|
65
68
|
const key = JSON.stringify([root, entries]), cached = closureResults.get(key);
|
|
66
69
|
const copy = rows => rows.map(row => ({ ...row, trace: [...row.trace] }));
|
|
67
70
|
if (cached !== undefined && currentSources(cached.observed)) return copy(cached.rows);
|
|
@@ -78,7 +81,7 @@ export function simClosure(root, entries = globSync('src/**/*.ts', { cwd: root }
|
|
|
78
81
|
};
|
|
79
82
|
const inspect = (node, parent) => {
|
|
80
83
|
if (['ImportDeclaration', 'ExportNamedDeclaration', 'ExportAllDeclaration', 'ImportExpression'].includes(node.type)) {
|
|
81
|
-
if (
|
|
84
|
+
if (simRootIn(root, path) && value(node.source) === 'three' && node.importKind === 'type' && node.specifiers?.some((s) => s.type !== 'ImportSpecifier' || !MATH.has(s.imported.name))) add('import', 'three');
|
|
82
85
|
if (node.importKind === 'type' || node.exportKind === 'type' || (node.specifiers?.length && node.specifiers.every((s) => s.importKind === 'type'))) return;
|
|
83
86
|
const source = value(node.source);
|
|
84
87
|
if (source === null) { if (node.source) add('import', 'dynamic'); return; }
|
|
@@ -97,7 +100,7 @@ export function simClosure(root, entries = globSync('src/**/*.ts', { cwd: root }
|
|
|
97
100
|
if (FORBIDDEN.test(destPath) || VIEW.test(destPath)) add('import', destPath);
|
|
98
101
|
else if (/\.[cm]?[jt]s$/u.test(destPath)) next.push(destPath);
|
|
99
102
|
}
|
|
100
|
-
if (
|
|
103
|
+
if (simRootIn(root, path) && node.type === 'Identifier' && ['HTMLElement', 'HTMLCanvasElement'].includes(node.name) && parent?.type === 'TSTypeReference') add('global', node.name);
|
|
101
104
|
if (node.type === 'MemberExpression' && ['window', 'globalThis'].includes(node.object?.name) && DOM.has(node.property?.name) && node.property?.name !== 'window') add('global', node.property.name);
|
|
102
105
|
if (node.type === 'Identifier' && reference(node, parent) && DOM.has(node.name)) add('global', node.name);
|
|
103
106
|
};
|
|
@@ -11,3 +11,7 @@ export const VIEW_PATHS: readonly string[];
|
|
|
11
11
|
|
|
12
12
|
/** G645 product-surface rules that do not apply to colocated test fixtures. */
|
|
13
13
|
export const TEST_DOMAIN_RUNTIME_RULES: readonly string[];
|
|
14
|
+
|
|
15
|
+
/** The oxlint JS plugin: its name and every rule, keyed without the `wildshard/` prefix. */
|
|
16
|
+
declare const plugin: { readonly meta: { readonly name: string }; readonly rules: Readonly<Record<string, unknown>> };
|
|
17
|
+
export default plugin;
|
package/lint/wildshard-plugin.js
CHANGED
|
@@ -23,7 +23,7 @@ import { declarationConfigProgram } from './declaration-config.mjs';
|
|
|
23
23
|
// parameter it is (`num('scale', 1)`) — anything else is an error;
|
|
24
24
|
// · raw parsing of `location.search` (`.includes`, `.match`, regex `.test`, …) that dodges the above.
|
|
25
25
|
import { existsSync, readFileSync } from 'node:fs';
|
|
26
|
-
import { dirname,
|
|
26
|
+
import { dirname, resolve } from 'node:path';
|
|
27
27
|
import { fileURLToPath } from 'node:url';
|
|
28
28
|
import { simClosure, simRoot } from './sim-closure.mjs';
|
|
29
29
|
import { authoredHtmlSites } from './authored-html.mjs';
|
|
@@ -32,6 +32,7 @@ import { shardGameImport, shardEngineImport, sharddevRuntimeImport, generatorImp
|
|
|
32
32
|
import { shardfileBoundaryVisitors } from './shardfile-boundaries.mjs';
|
|
33
33
|
import { hostCallbackSites } from './host-callback-syntax.mjs';
|
|
34
34
|
import { hostPlayFile } from './host-files.mjs';
|
|
35
|
+
import { lintFile } from './shard-source.mjs';
|
|
35
36
|
|
|
36
37
|
const REPO = fileURLToPath(new URL('../', import.meta.url));
|
|
37
38
|
/** E432: the layers are workspace packages, `@wildshard/<layer>[/<sub>]` → `src/<layer>/<sub | index>`. Whether a
|
|
@@ -289,23 +290,23 @@ const noUrlSwitch = {
|
|
|
289
290
|
|
|
290
291
|
// E357 F4: syntactic ratchets; their scope and patterns are 01 §24 / 02 F4's contract.
|
|
291
292
|
// Filenames and lexical import paths are immutable during one plugin process.
|
|
293
|
+
// SA45: a single-shard repo's `src/<local>` reads as `src/shards/<slug>/<local>` (lint/shard-source.mjs), so every shard
|
|
294
|
+
// rule below matches one layout; `fileOf` keeps the real repo root and path for the rules that open files on disk.
|
|
292
295
|
const filenamePaths = new Map(), modulePaths = new Map();
|
|
293
|
-
const
|
|
296
|
+
const fileOf = (context) => {
|
|
294
297
|
const cached = filenamePaths.get(context.filename);
|
|
295
298
|
if (cached !== undefined) return cached;
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
filenamePaths.set(context.filename, normalized);
|
|
300
|
-
return normalized;
|
|
299
|
+
const file = lintFile(context.filename, REPO);
|
|
300
|
+
filenamePaths.set(context.filename, file);
|
|
301
|
+
return file;
|
|
301
302
|
};
|
|
303
|
+
const pathOf = (context) => fileOf(context).path;
|
|
302
304
|
const modulePath = (filename, source) => {
|
|
303
305
|
let paths = modulePaths.get(filename);
|
|
304
306
|
if (paths === undefined) { paths = new Map(); modulePaths.set(filename, paths); }
|
|
305
307
|
if (paths.has(source)) return paths.get(source);
|
|
306
308
|
const target = packageTarget(source);
|
|
307
|
-
const path = target ?? (!source.startsWith('.') ? source
|
|
308
|
-
: relative(REPO, resolve(dirname(filename), source)).replaceAll('\\', '/').replace(/^.*\/src\//u, 'src/'));
|
|
309
|
+
const path = target ?? (!source.startsWith('.') ? source : lintFile(resolve(dirname(filename), source), REPO).path);
|
|
309
310
|
paths.set(source, path);
|
|
310
311
|
return path;
|
|
311
312
|
};
|
|
@@ -579,9 +580,8 @@ const simAllow = JSON.parse(readFileSync(new URL('sim-closure.json', import.meta
|
|
|
579
580
|
const simNoRender = rule('Headless simulation checks its complete runtime import closure (SF3a)', (context) => {
|
|
580
581
|
if (!simRoot(pathOf(context))) return {};
|
|
581
582
|
return { Program(node) {
|
|
582
|
-
const
|
|
583
|
-
const
|
|
584
|
-
for (const item of simClosure(root, [pathOf(context)])) {
|
|
583
|
+
const { root, file } = fileOf(context);
|
|
584
|
+
for (const item of simClosure(root, [file])) {
|
|
585
585
|
const allowance = root === REPO.replace(/\/$/u, '') ? simAllow[item.id]?.count ?? 0 : 0;
|
|
586
586
|
if (item.count > allowance) report(context, node, `Simulation closure: ${item.id} (${item.count} > ${allowance}); ${item.trace.join(' → ')}`);
|
|
587
587
|
}
|
|
@@ -976,14 +976,12 @@ const shardHostCallback = {
|
|
|
976
976
|
meta: { type: 'problem', docs: { description: 'Shard host APIs take data, not TS callbacks (G454)' },
|
|
977
977
|
schema: [{ type: 'object', properties: { count: { type: 'boolean' } }, additionalProperties: false }] },
|
|
978
978
|
create(context) {
|
|
979
|
-
const file =
|
|
979
|
+
const { root, file: real, path: file } = fileOf(context);
|
|
980
980
|
if (!file.startsWith('src/shards/')) return {};
|
|
981
|
-
|
|
982
|
-
const root = index === -1 ? REPO : context.filename.slice(0, index);
|
|
983
|
-
if (!hostPlayFile(root, file)) return {};
|
|
981
|
+
if (!hostPlayFile(root, real)) return {};
|
|
984
982
|
const limit = context.options[0]?.count === true ? 0 : shardfileDebt['wildshard/no-shard-host-callback']?.[file] ?? 0;
|
|
985
983
|
return { 'Program:exit'(program) {
|
|
986
|
-
for (const issue of hostCallbackSites(root,
|
|
984
|
+
for (const issue of hostCallbackSites(root, real, program).slice(limit)) context.report({
|
|
987
985
|
loc: { start: context.sourceCode.getLocFromIndex(issue.start), end: context.sourceCode.getLocFromIndex(issue.end) }, message: issue.message,
|
|
988
986
|
});
|
|
989
987
|
} };
|
|
@@ -993,15 +991,13 @@ const shardfileBoundaryRule = name => ({
|
|
|
993
991
|
meta: { type: 'problem', docs: { description: `Shardfile source boundary: ${name} (G450)` },
|
|
994
992
|
schema: [{ type: 'object', properties: { count: { type: 'boolean' }, closedShards: { type: 'array', items: { type: 'string' }, uniqueItems: true } }, additionalProperties: false }] },
|
|
995
993
|
create(context) {
|
|
996
|
-
const file =
|
|
994
|
+
const { root, file: real, path: file } = fileOf(context);
|
|
997
995
|
if (name === 'runtime-standalone') return {};
|
|
998
|
-
const index = context.filename.replaceAll('\\', '/').lastIndexOf('/src/');
|
|
999
|
-
const root = index === -1 ? REPO : context.filename.slice(0, index);
|
|
1000
996
|
const slug = /^src\/shards\/([^/]+)\//u.exec(file)?.[1];
|
|
1001
997
|
const closed = context.options[0]?.closedShards?.includes(slug) === true;
|
|
1002
998
|
const limit = closed || context.options[0]?.count === true ? 0 : shardfileDebt[`wildshard/${name}`]?.[file] ?? 0;
|
|
1003
999
|
let count = 0;
|
|
1004
|
-
return shardfileBoundaryVisitors(root,
|
|
1000
|
+
return shardfileBoundaryVisitors(root, real, name, (node, message) => {
|
|
1005
1001
|
count += 1;
|
|
1006
1002
|
if (count > limit) report(context, node, message);
|
|
1007
1003
|
});
|
|
@@ -1014,8 +1010,11 @@ const shardfileBoundaryRule = name => ({
|
|
|
1014
1010
|
const blenderTargetsFile = resolve(process.cwd(), 'scripts/blender/targets.json'); // Shard lint: blender sources left with the shards.
|
|
1015
1011
|
const blenderTargets = existsSync(blenderTargetsFile) ? JSON.parse(readFileSync(blenderTargetsFile, 'utf8')).targets : [];
|
|
1016
1012
|
const blenderSources = new Set();
|
|
1017
|
-
for (const target of Object.values(blenderTargets)) for (const
|
|
1018
|
-
|
|
1013
|
+
for (const target of Object.values(blenderTargets)) for (const entry of [target.script, target.post, ...(target.sources ?? [])]) {
|
|
1014
|
+
// SA45: an entry names the real file (`src/blender/…` in a single-shard repo) or already the source path.
|
|
1015
|
+
const file = typeof entry !== 'string' ? null : entry.startsWith('src/shards/') ? entry : lintFile(resolve(process.cwd(), entry), REPO).path;
|
|
1016
|
+
if (file !== null && /^src\/shards\/[^/]+\/blender\/.+\.[cm]?[jt]sx?$/u.test(file)) blenderSources.add(file);
|
|
1017
|
+
}
|
|
1019
1018
|
|
|
1020
1019
|
// F3: hard structural boundary. No count option or debt allowance exists.
|
|
1021
1020
|
const noShardRuntime = rule('Primary shards contain authoring and declarations only (G694 F3)', context => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildshard/engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "The Wildshard engine: one repo with shared, client, server and cook code and three build targets (client, dedicated server, standalone listen server), shaped like Unreal or Source.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"format:check": "npr oxfmt -c src/.oxfmtrc.json --check src/cli src/tools src/e2e src/scripts",
|
|
30
30
|
"test": "pnpm test:kit && pnpm test:fast",
|
|
31
31
|
"test:e2e": "playwright test --config src/e2e/playwright.config.ts",
|
|
32
|
+
"test:e2e:faults": "node scripts/e2e-faults.mjs",
|
|
32
33
|
"check:sides": "node src/scripts/check-sides.mjs && node scripts/check-engine-sides.mjs",
|
|
33
34
|
"check:asks": "node src/scripts/asks.mjs check",
|
|
34
35
|
"check:agents": "node .githooks/agents-md.mjs lint",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"ring:1": "bash scripts/ring1.sh all",
|
|
57
58
|
"lint:typed": "node scripts/lint-all.mjs",
|
|
58
59
|
"test:checks": "pnpm gen && node scripts/check-graph.mjs --source-only && node scripts/check-engine-sides.mjs && node scripts/check-sim-players.mjs",
|
|
59
|
-
"build:game": "python3 scripts/heavy-lane.py build -- bash -c 'node scripts/pins.ts install && node scripts/gen.mjs --inputs-only && npr tsc -b tsconfig.layers.json --builders 1 && WILDSHARD_CATALOGUE
|
|
60
|
+
"build:game": "python3 scripts/heavy-lane.py build -- bash -c 'node scripts/pins.ts install && node scripts/gen.mjs --inputs-only && npr tsc -b tsconfig.layers.json --builders 1 && WILDSHARD_CATALOGUE=\"${WILDSHARD_CATALOGUE:-test/pins/catalogue.json}\" node scripts/build-app.mjs && node scripts/check-devserver.mjs dist && node scripts/app-build/splitOutput.mjs dist && node scripts/page-size.mjs dist --gate'",
|
|
60
61
|
"tools:install": "npr install --frozen"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
@@ -245,6 +246,7 @@
|
|
|
245
246
|
"./ai/director": "./src/shared/engine/ai/director.ts",
|
|
246
247
|
"./fx/effectField": "./src/client/engine/fx/effectField.ts",
|
|
247
248
|
"./core/deflate": "./src/client/engine/core/deflate.ts",
|
|
249
|
+
"./core/apiOrigin": "./src/client/engine/core/apiOrigin.ts",
|
|
248
250
|
"./world/weatherContinuation": "./src/shared/engine/world/weatherContinuation.ts",
|
|
249
251
|
"./audio/declaredAmbience": "./src/client/engine/audio/declaredAmbience.ts",
|
|
250
252
|
"./audio/declaredBank": "./src/client/engine/audio/declaredBank.ts",
|
|
@@ -792,6 +794,7 @@
|
|
|
792
794
|
"./ui/StartTitle": "./src/client/engine/ui/StartTitle.ts",
|
|
793
795
|
"./telemetry/browserErrors": "./src/client/engine/telemetry/browserErrors.ts",
|
|
794
796
|
"./telemetry/runtime": "./src/client/engine/telemetry/runtime.ts",
|
|
797
|
+
"./telemetry/deviceSnapshot": "./src/client/engine/telemetry/deviceSnapshot.ts",
|
|
795
798
|
"./practice/TrainingDummy": "./src/client/engine/practice/TrainingDummy.ts",
|
|
796
799
|
"./practice/DummyMotion": "./src/client/engine/practice/DummyMotion.ts",
|
|
797
800
|
"./practice/DummyClips": "./src/client/engine/practice/DummyClips.ts",
|
|
@@ -889,6 +892,9 @@
|
|
|
889
892
|
"./game/grid/voidFloor": "./src/shared/game/grid/voidFloor.ts",
|
|
890
893
|
"./game/grid/assembly": "./src/shared/game/grid/assembly.ts",
|
|
891
894
|
"./game/grid/catalogueSlot": "./src/shared/game/grid/catalogueSlot.ts",
|
|
895
|
+
"./game/grid/placedCells": "./src/client/game/grid/placedCells.ts",
|
|
896
|
+
"./game/grid/placedCards": "./src/client/game/grid/placedCards.ts",
|
|
897
|
+
"./game/grid/placementRows": "./src/shared/game/grid/placementRows.ts",
|
|
892
898
|
"./game/grid/catalogueDocument": "./src/shared/game/grid/catalogueDocument.ts",
|
|
893
899
|
"./game/grid/room": "./src/server/game/grid/room.ts",
|
|
894
900
|
"./game/grid/roomNet": "./src/server/game/grid/roomNet.ts",
|
|
@@ -1277,6 +1283,7 @@
|
|
|
1277
1283
|
"./net/chatFilter": "./src/shared/engine/net/chatFilter.ts",
|
|
1278
1284
|
"./net/redial": "./src/client/engine/net/redial.ts",
|
|
1279
1285
|
"./net/socketFrames": "./src/shared/engine/net/socketFrames.ts",
|
|
1286
|
+
"./net/deviceWord": "./src/shared/engine/net/deviceWord.ts",
|
|
1280
1287
|
"./net/webSocketTransport": "./src/client/engine/net/webSocketTransport.ts",
|
|
1281
1288
|
"./net/otherPlayers": "./src/client/engine/net/otherPlayers.ts",
|
|
1282
1289
|
"./net/hurtOther": "./src/client/engine/net/hurtOther.ts",
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/** The app publishes its data products, never their temporary TypeScript sources. */
|
|
2
2
|
export function copyOutputProducts(root: string, outDir: string): void;
|
|
3
3
|
|
|
4
|
+
/** Refuse a public/ copy of a product mount whose bytes differ from the product's; returns the mounts checked. */
|
|
5
|
+
export function checkPublishedMounts(root: string): number;
|
|
6
|
+
|
|
4
7
|
/** DL20: drop the loose files only a part needs to hold; a default manifest's files stay. */
|
|
5
8
|
export function pruneLooseCopies(outDir: string): { files: number; bytes: number };
|
|
6
9
|
|