@playcraft/build 0.1.96-test-a → 0.1.98
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/base-builder.js +2 -41
- package/dist/engines/engine-detector.js +0 -4
- package/dist/engines/generic-adapter.js +19 -14
- package/dist/index.d.ts +4 -19
- package/dist/index.js +2 -11
- package/dist/platforms/adikteev.js +0 -1
- package/dist/platforms/applovin.js +0 -1
- package/dist/platforms/base.js +2 -2
- package/dist/platforms/bigo.js +0 -1
- package/dist/platforms/facebook.js +0 -1
- package/dist/platforms/google.js +0 -1
- package/dist/platforms/inmobi.js +0 -1
- package/dist/platforms/ironsource.js +0 -1
- package/dist/platforms/liftoff.js +0 -1
- package/dist/platforms/mintegral.js +0 -1
- package/dist/platforms/moloco.js +0 -1
- package/dist/platforms/playcraft.js +0 -1
- package/dist/platforms/remerge.js +0 -1
- package/dist/platforms/snapchat.js +0 -1
- package/dist/platforms/tiktok.js +0 -1
- package/dist/platforms/unity.js +0 -1
- package/dist/types.d.ts +0 -5
- package/dist/validation/html-validator.d.ts +0 -5
- package/dist/validation/html-validator.js +17 -19
- package/dist/validation/index.d.ts +0 -4
- package/dist/validation/index.js +0 -4
- package/dist/validation/package-validator.d.ts +0 -2
- package/dist/validation/package-validator.js +64 -25
- package/dist/validation/profiles.d.ts +1 -13
- package/dist/validation/profiles.js +0 -27
- package/dist/validation/source-scanner.d.ts +0 -11
- package/dist/validation/source-scanner.js +2 -32
- package/dist/validation/types.d.ts +2 -178
- package/dist/validation/types.js +1 -1
- package/dist/validation/validation-runner.d.ts +2 -22
- package/dist/validation/validation-runner.js +3 -64
- package/dist/validation/zip-reader.d.ts +0 -7
- package/dist/validation/zip-reader.js +26 -159
- package/dist/vite/config-builder-generic.d.ts +1 -3
- package/dist/vite/config-builder-generic.js +7 -9
- package/dist/vite/config-builder.js +1 -1
- package/dist/vite/plugin-platform.js +54 -30
- package/dist/vite/plugin-source-builder.d.ts +14 -2
- package/dist/vite/plugin-source-builder.js +997 -61
- package/dist/vite-builder.d.ts +5 -4
- package/dist/vite-builder.js +34 -33
- package/package.json +4 -16
- package/dist/audio-source-files.d.ts +0 -5
- package/dist/audio-source-files.js +0 -135
- package/dist/delivery/agent-build-runner.d.ts +0 -44
- package/dist/delivery/agent-build-runner.js +0 -365
- package/dist/delivery/agent-build-source.d.ts +0 -8
- package/dist/delivery/agent-build-source.js +0 -25
- package/dist/delivery/artifact-descriptor.d.ts +0 -31
- package/dist/delivery/artifact-descriptor.js +0 -237
- package/dist/delivery/artifact-package.d.ts +0 -43
- package/dist/delivery/artifact-package.js +0 -283
- package/dist/delivery/build-plan.d.ts +0 -4
- package/dist/delivery/build-plan.js +0 -189
- package/dist/delivery/build-plan.types.d.ts +0 -51
- package/dist/delivery/build-plan.types.js +0 -1
- package/dist/delivery/command-isolation.d.ts +0 -21
- package/dist/delivery/command-isolation.js +0 -327
- package/dist/delivery/commands.d.ts +0 -5
- package/dist/delivery/commands.js +0 -146
- package/dist/delivery/files.d.ts +0 -9
- package/dist/delivery/files.js +0 -144
- package/dist/delivery/git-source-fingerprint.d.ts +0 -2
- package/dist/delivery/git-source-fingerprint.js +0 -58
- package/dist/delivery/isolated-source.d.ts +0 -5
- package/dist/delivery/isolated-source.js +0 -131
- package/dist/delivery/output-publication.d.ts +0 -21
- package/dist/delivery/output-publication.js +0 -444
- package/dist/delivery/project-delivery.d.ts +0 -6
- package/dist/delivery/project-delivery.js +0 -287
- package/dist/delivery/recipe-build-plan.d.ts +0 -4
- package/dist/delivery/recipe-build-plan.js +0 -53
- package/dist/delivery/recipe.d.ts +0 -20
- package/dist/delivery/recipe.js +0 -211
- package/dist/delivery/safe-path.d.ts +0 -2
- package/dist/delivery/safe-path.js +0 -18
- package/dist/delivery/types.d.ts +0 -76
- package/dist/delivery/types.js +0 -1
- package/dist/production-animation-presence.d.ts +0 -2
- package/dist/production-animation-presence.js +0 -146
- package/dist/production-inputs.d.ts +0 -30
- package/dist/production-inputs.js +0 -262
- package/dist/production-source-paths.d.ts +0 -5
- package/dist/production-source-paths.js +0 -27
- package/dist/validation/artifact-qa.d.ts +0 -36
- package/dist/validation/artifact-qa.js +0 -261
- package/dist/validation/artifact-rules.d.ts +0 -39
- package/dist/validation/artifact-rules.js +0 -451
- package/dist/validation/artifact.d.ts +0 -14
- package/dist/validation/artifact.js +0 -188
- package/dist/validation/runtime-load.d.ts +0 -94
- package/dist/validation/runtime-load.js +0 -653
- package/dist/vite/source-builder-asset-paths.d.ts +0 -25
- package/dist/vite/source-builder-asset-paths.js +0 -154
- package/dist/vite/source-builder-esm.d.ts +0 -7
- package/dist/vite/source-builder-esm.js +0 -877
- package/dist/vite/source-builder-types.d.ts +0 -14
- package/dist/vite/source-builder-types.js +0 -1
- package/dist/vite/workspace.d.ts +0 -6
- package/dist/vite/workspace.js +0 -41
- package/dist/workspace-css-imports.d.ts +0 -2
- package/dist/workspace-css-imports.js +0 -139
- package/dist/workspace-model-source.d.ts +0 -14
- package/dist/workspace-model-source.js +0 -184
- package/dist/workspace-public-imports.d.ts +0 -11
- package/dist/workspace-public-imports.js +0 -232
- package/dist/workspace-public-source.d.ts +0 -15
- package/dist/workspace-public-source.js +0 -564
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ImportMapAsset } from '../loaders/playcanvas-loader.js';
|
|
2
|
-
export interface SourceBuilderPluginOptions {
|
|
3
|
-
projectDir: string;
|
|
4
|
-
outputDir: string;
|
|
5
|
-
selectedScenes?: string[];
|
|
6
|
-
buildMode?: 'classic' | 'esm';
|
|
7
|
-
importMap?: ImportMapAsset;
|
|
8
|
-
}
|
|
9
|
-
export interface UserScript {
|
|
10
|
-
id: string;
|
|
11
|
-
path: string;
|
|
12
|
-
code: string;
|
|
13
|
-
name: string;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/vite/workspace.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Trusted Runtime/Runner-only paths. Never expose these through BuildOptions or model input. */
|
|
2
|
-
export type ViteWorkspace = {
|
|
3
|
-
intermediateDir: string;
|
|
4
|
-
finalOutputDir: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function resolveViteWorkspace(baseBuildDir: string, workspace: ViteWorkspace): ViteWorkspace;
|
package/dist/vite/workspace.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
function inside(root, candidate) {
|
|
4
|
-
const relative = path.relative(root, candidate);
|
|
5
|
-
return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));
|
|
6
|
-
}
|
|
7
|
-
function canonicalDirectory(value, field) {
|
|
8
|
-
if (!path.isAbsolute(value))
|
|
9
|
-
throw new Error(`${field} must be an absolute Runtime workspace path`);
|
|
10
|
-
const requested = path.resolve(value);
|
|
11
|
-
const parent = path.dirname(requested);
|
|
12
|
-
const parentInfo = fs.lstatSync(parent);
|
|
13
|
-
if (!parentInfo.isDirectory() || parentInfo.isSymbolicLink()) {
|
|
14
|
-
throw new Error(`${field} must have a real parent directory`);
|
|
15
|
-
}
|
|
16
|
-
const canonical = path.join(fs.realpathSync.native(parent), path.basename(requested));
|
|
17
|
-
if (fs.existsSync(requested)) {
|
|
18
|
-
const info = fs.lstatSync(requested);
|
|
19
|
-
if (!info.isDirectory() || info.isSymbolicLink() || fs.realpathSync.native(requested) !== canonical) {
|
|
20
|
-
throw new Error(`${field} must be a real non-aliased directory`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return canonical;
|
|
24
|
-
}
|
|
25
|
-
export function resolveViteWorkspace(baseBuildDir, workspace) {
|
|
26
|
-
const source = fs.realpathSync.native(baseBuildDir);
|
|
27
|
-
const requestedIntermediate = path.resolve(workspace.intermediateDir);
|
|
28
|
-
const requestedFinal = path.resolve(workspace.finalOutputDir);
|
|
29
|
-
if (inside(requestedIntermediate, requestedFinal) || inside(requestedFinal, requestedIntermediate)) {
|
|
30
|
-
throw new Error('Vite intermediate and final directories must not overlap');
|
|
31
|
-
}
|
|
32
|
-
const intermediateDir = canonicalDirectory(workspace.intermediateDir, 'intermediateDir');
|
|
33
|
-
const finalOutputDir = canonicalDirectory(workspace.finalOutputDir, 'finalOutputDir');
|
|
34
|
-
if (inside(source, intermediateDir) || inside(source, finalOutputDir)) {
|
|
35
|
-
throw new Error('Injected Vite workspace directories must be outside the source directory');
|
|
36
|
-
}
|
|
37
|
-
if (inside(intermediateDir, finalOutputDir) || inside(finalOutputDir, intermediateDir)) {
|
|
38
|
-
throw new Error('Vite intermediate and final directories must not overlap');
|
|
39
|
-
}
|
|
40
|
-
return { intermediateDir, finalOutputDir };
|
|
41
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import parse from 'css-tree/parser';
|
|
2
|
-
import walk from 'css-tree/walker';
|
|
3
|
-
import { tokenize, tokenTypes } from 'css-tree/tokenizer';
|
|
4
|
-
import { ident } from 'css-tree/utils';
|
|
5
|
-
const atRules = new Set([
|
|
6
|
-
'charset', 'import', 'namespace', 'media', 'supports', 'container', 'layer',
|
|
7
|
-
'font-face', 'font-feature-values', 'font-palette-values', 'keyframes', 'page',
|
|
8
|
-
'counter-style', 'property', 'scope', 'starting-style', 'view-transition',
|
|
9
|
-
'position-try', 'document', 'custom-media',
|
|
10
|
-
]);
|
|
11
|
-
const scopedAtRules = new Map([
|
|
12
|
-
['font-feature-values', new Set(['stylistic', 'styleset', 'character-variant', 'swash', 'ornaments', 'annotation'])],
|
|
13
|
-
['page', new Set([
|
|
14
|
-
'top-left-corner', 'top-left', 'top-center', 'top-right', 'top-right-corner',
|
|
15
|
-
'bottom-left-corner', 'bottom-left', 'bottom-center', 'bottom-right', 'bottom-right-corner',
|
|
16
|
-
'left-top', 'left-middle', 'left-bottom', 'right-top', 'right-middle', 'right-bottom',
|
|
17
|
-
])],
|
|
18
|
-
]);
|
|
19
|
-
const atRuleName = (name) => name.toLowerCase().replace(/^-(?:webkit|moz|ms|o)-/, '');
|
|
20
|
-
/** Validate actual CSS tokens before the parser can recover an unterminated string/block at EOF. */
|
|
21
|
-
function strictSource(text, fail) {
|
|
22
|
-
const closing = [];
|
|
23
|
-
const replacements = [];
|
|
24
|
-
let cursor = 0;
|
|
25
|
-
tokenize(text, (type, start, end) => {
|
|
26
|
-
const raw = text.slice(start, end);
|
|
27
|
-
const terminated = (character) => {
|
|
28
|
-
if (!raw.endsWith(character))
|
|
29
|
-
fail();
|
|
30
|
-
let escapes = 0;
|
|
31
|
-
for (let index = raw.length - 2; index >= 0 && raw[index] === '\\'; index--)
|
|
32
|
-
escapes++;
|
|
33
|
-
if (escapes % 2)
|
|
34
|
-
fail();
|
|
35
|
-
};
|
|
36
|
-
if (type === tokenTypes.BadString || type === tokenTypes.BadUrl)
|
|
37
|
-
fail();
|
|
38
|
-
if (type === tokenTypes.String)
|
|
39
|
-
terminated(raw[0]);
|
|
40
|
-
if (type === tokenTypes.Url)
|
|
41
|
-
terminated(')');
|
|
42
|
-
if (type === tokenTypes.Comment && !raw.endsWith('*/'))
|
|
43
|
-
fail();
|
|
44
|
-
if (type === tokenTypes.Function || type === tokenTypes.LeftParenthesis)
|
|
45
|
-
closing.push(tokenTypes.RightParenthesis);
|
|
46
|
-
else if (type === tokenTypes.LeftCurlyBracket)
|
|
47
|
-
closing.push(tokenTypes.RightCurlyBracket);
|
|
48
|
-
else if (type === tokenTypes.LeftSquareBracket)
|
|
49
|
-
closing.push(tokenTypes.RightSquareBracket);
|
|
50
|
-
else if ([tokenTypes.RightParenthesis, tokenTypes.RightCurlyBracket, tokenTypes.RightSquareBracket].includes(type) && closing.pop() !== type)
|
|
51
|
-
fail();
|
|
52
|
-
if (closing.length > 128)
|
|
53
|
-
fail();
|
|
54
|
-
if (type === tokenTypes.Function || type === tokenTypes.AtKeyword) {
|
|
55
|
-
const normalized = type === tokenTypes.Function ? `${ident.decode(raw.slice(0, -1))}(` : `@${ident.decode(raw.slice(1))}`;
|
|
56
|
-
if (normalized !== raw) {
|
|
57
|
-
replacements.push(text.slice(cursor, start), normalized);
|
|
58
|
-
cursor = end;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
if (closing.length)
|
|
63
|
-
fail();
|
|
64
|
-
return replacements.length ? replacements.join('') + text.slice(cursor) : text;
|
|
65
|
-
}
|
|
66
|
-
/** Pure static extraction shared by save, frozen source and the self-contained delivery Runner. */
|
|
67
|
-
export function workspaceCssResourceSpecifiers(text, fail) {
|
|
68
|
-
const ast = parse(strictSource(text, fail), { parseCustomProperty: true, onParseError: fail });
|
|
69
|
-
const result = [];
|
|
70
|
-
const imageSet = (node, add) => {
|
|
71
|
-
let first = true;
|
|
72
|
-
const descriptors = new Set();
|
|
73
|
-
for (const child of node.children) {
|
|
74
|
-
if (child.type === 'Operator' && child.value === ',') {
|
|
75
|
-
if (first)
|
|
76
|
-
fail();
|
|
77
|
-
first = true;
|
|
78
|
-
descriptors.clear();
|
|
79
|
-
}
|
|
80
|
-
else if (first) {
|
|
81
|
-
if (child.type === 'String')
|
|
82
|
-
add(child.value);
|
|
83
|
-
else if (child.type !== 'Url' && !(child.type === 'Function' && /^(?:(?:repeating-)?(?:linear|radial|conic)-gradient|-webkit-image-set|image-set|cross-fade)$/i.test(child.name)))
|
|
84
|
-
fail();
|
|
85
|
-
first = false;
|
|
86
|
-
}
|
|
87
|
-
else if (child.type === 'Dimension' && /^(?:x|dpi|dpcm|dppx)$/i.test(ident.decode(child.unit)) && Number(child.value) >= 0) {
|
|
88
|
-
if (descriptors.has('resolution'))
|
|
89
|
-
fail();
|
|
90
|
-
descriptors.add('resolution');
|
|
91
|
-
}
|
|
92
|
-
else if (child.type === 'Function' && child.name.toLowerCase() === 'type' && child.children.size === 1 && child.children.first?.type === 'String') {
|
|
93
|
-
if (descriptors.has('type'))
|
|
94
|
-
fail();
|
|
95
|
-
descriptors.add('type');
|
|
96
|
-
}
|
|
97
|
-
else
|
|
98
|
-
fail();
|
|
99
|
-
}
|
|
100
|
-
if (first)
|
|
101
|
-
fail();
|
|
102
|
-
};
|
|
103
|
-
walk(ast, function (node) {
|
|
104
|
-
const add = (specifier) => {
|
|
105
|
-
// A relative custom-property URL is resolved at var()'s use site, which may
|
|
106
|
-
// belong to a different stylesheet; preserve the previous parser's refusal.
|
|
107
|
-
if (this.declaration?.property.startsWith('--') && !/^(?:[a-z][a-z\d+.-]*:|\/|#)/i.test(specifier))
|
|
108
|
-
fail();
|
|
109
|
-
result.push(specifier);
|
|
110
|
-
};
|
|
111
|
-
if (node.type === 'Raw')
|
|
112
|
-
fail();
|
|
113
|
-
// Namespace identifiers and supports/media feature-test URLs do not fetch files.
|
|
114
|
-
if (node.type === 'Url' && (!this.atrulePrelude ||
|
|
115
|
-
this.atrule?.name.toLowerCase() === 'import' && this.atrulePrelude.children.first === node))
|
|
116
|
-
add(node.value);
|
|
117
|
-
if (node.type === 'Declaration' && !node.property.startsWith('--') && node.value.type === 'Value' && node.value.children.isEmpty)
|
|
118
|
-
fail();
|
|
119
|
-
if (node.type === 'Atrule' && !atRules.has(atRuleName(node.name)) &&
|
|
120
|
-
!scopedAtRules.get(atRuleName(this.atrule?.name ?? ''))?.has(node.name.toLowerCase()))
|
|
121
|
-
fail();
|
|
122
|
-
if (node.type === 'Atrule' && node.name.toLowerCase() === 'import') {
|
|
123
|
-
const first = node.prelude?.type === 'AtrulePrelude' ? node.prelude.children.first : undefined;
|
|
124
|
-
if (first?.type === 'String')
|
|
125
|
-
add(first.value);
|
|
126
|
-
else if (first?.type !== 'Url')
|
|
127
|
-
fail();
|
|
128
|
-
}
|
|
129
|
-
if (node.type === 'Function') {
|
|
130
|
-
const name = node.name.toLowerCase();
|
|
131
|
-
if (!this.atrulePrelude && ['image-set', '-webkit-image-set'].includes(name))
|
|
132
|
-
imageSet(node, add);
|
|
133
|
-
// These resource-bearing syntaxes need their own explicit static grammar.
|
|
134
|
-
if (['src', 'image', 'url'].includes(name))
|
|
135
|
-
fail();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type SourceFile = {
|
|
2
|
-
body: Buffer;
|
|
3
|
-
mode: '100644' | '100755';
|
|
4
|
-
};
|
|
5
|
-
/** Only the public parameter declaration can activate this model-specific hidden closure. */
|
|
6
|
-
export declare function readWorkspaceModelSourceClosure(input: {
|
|
7
|
-
dataPath: string | undefined;
|
|
8
|
-
workspaceProjection?: Buffer;
|
|
9
|
-
readFile: (path: string, maximum?: number) => Promise<SourceFile>;
|
|
10
|
-
}): Promise<{
|
|
11
|
-
files: Map<string, SourceFile>;
|
|
12
|
-
requiredPaths: string[];
|
|
13
|
-
}>;
|
|
14
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
import { canonicalModelAdaptation, modelProductionRecipeSchema, workspaceAssetProvenanceDocumentSchema, workspaceModelAdaptationLineageSchema, workspaceModelAdaptationSchema, workspaceModelBuildInputsSchema, workspaceModelPreparationSourceLineageSchema, workspaceModelPreparationSourceToolSchema, workspaceRelativePathSchema, } from '@playcraft/common/cloud-workspace/runtime';
|
|
3
|
-
const DATA = '.playcraft/model-adaptation.json';
|
|
4
|
-
const LINEAGE = '.playcraft/model-adaptation-lineage.json';
|
|
5
|
-
const BUILD = '.playcraft/model-build-inputs.json';
|
|
6
|
-
const PROVENANCE = '.playcraft/asset-provenance.json';
|
|
7
|
-
const WORKSPACE = '.playcraft/workspace.json';
|
|
8
|
-
const hash = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
9
|
-
const same = (left, right) => canonicalModelAdaptation(left) === canonicalModelAdaptation(right);
|
|
10
|
-
/** Only the public parameter declaration can activate this model-specific hidden closure. */
|
|
11
|
-
export async function readWorkspaceModelSourceClosure(input) {
|
|
12
|
-
const files = new Map(), required = new Set();
|
|
13
|
-
if (input.dataPath !== DATA)
|
|
14
|
-
return { files, requiredPaths: [] };
|
|
15
|
-
let bytesRead = 0;
|
|
16
|
-
function fail(code, path) {
|
|
17
|
-
throw new Error(`${code}: ${path}`);
|
|
18
|
-
}
|
|
19
|
-
const ordinary = (path) => {
|
|
20
|
-
if (!workspaceRelativePathSchema.safeParse(path).success ||
|
|
21
|
-
path.split('/').some((part) => part.toLowerCase() === '.playcraft'))
|
|
22
|
-
fail('workspace_public_model_path_unsupported', path);
|
|
23
|
-
};
|
|
24
|
-
const read = async (path, expected, maximum = 64 * 1024 * 1024) => {
|
|
25
|
-
let file = files.get(path);
|
|
26
|
-
if (!file) {
|
|
27
|
-
file = await input.readFile(path, maximum);
|
|
28
|
-
bytesRead += file.body.length;
|
|
29
|
-
if (file.body.length > maximum || files.size >= 512 || bytesRead > 256 * 1024 * 1024)
|
|
30
|
-
fail('workspace_public_model_input_limit', path);
|
|
31
|
-
files.set(path, file);
|
|
32
|
-
}
|
|
33
|
-
if (file.body.length > maximum)
|
|
34
|
-
fail('workspace_public_model_input_limit', path);
|
|
35
|
-
required.add(path);
|
|
36
|
-
if (expected !== undefined && hash(file.body) !== expected)
|
|
37
|
-
fail('workspace_public_model_input_changed', path);
|
|
38
|
-
return file;
|
|
39
|
-
};
|
|
40
|
-
const optional = async (path, maximum) => {
|
|
41
|
-
try {
|
|
42
|
-
return await read(path, undefined, maximum);
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
if (error.code === 'ENOENT')
|
|
46
|
-
return undefined;
|
|
47
|
-
throw error;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const parse = (path, file, parser) => {
|
|
51
|
-
try {
|
|
52
|
-
return parser.parse(JSON.parse(file.body.toString('utf8')));
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
return fail('workspace_public_model_declaration_invalid', path);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const plan = parse(DATA, await read(DATA, undefined, 1024 * 1024), workspaceModelAdaptationSchema);
|
|
59
|
-
const lineage = parse(LINEAGE, await read(LINEAGE, undefined, 1024 * 1024), workspaceModelAdaptationLineageSchema);
|
|
60
|
-
if (!same(plan.source, lineage.derivedSource))
|
|
61
|
-
fail('workspace_public_model_source_changed', DATA);
|
|
62
|
-
// derivedPlanHash records creation, not the current editable scalar parameters.
|
|
63
|
-
const parentPath = '.playcraft/parent-model-adaptation.json';
|
|
64
|
-
const parent = parse(parentPath, await read(parentPath, lineage.parentPlanHash, 1024 * 1024), workspaceModelAdaptationSchema);
|
|
65
|
-
if (!same(parent.source, lineage.parentSource) ||
|
|
66
|
-
!same(plan.source, {
|
|
67
|
-
...parent.source,
|
|
68
|
-
path: `source/${parent.source.path}`,
|
|
69
|
-
files: parent.source.files.map((file) => ({ ...file, path: `source/${file.path}` })),
|
|
70
|
-
}))
|
|
71
|
-
fail('workspace_public_model_source_changed', LINEAGE);
|
|
72
|
-
for (const file of plan.source.files) {
|
|
73
|
-
ordinary(file.path);
|
|
74
|
-
await read(file.path, file.contentHash);
|
|
75
|
-
}
|
|
76
|
-
await read('src/assets/packed-model.glb', lineage.packedHash);
|
|
77
|
-
await read('src/runtime/model-adaptation-core.js', lineage.coreHash);
|
|
78
|
-
const rawBuild = lineage.buildBindingVersion === 2
|
|
79
|
-
? await read(BUILD, undefined, 512 * 1024)
|
|
80
|
-
: await optional(BUILD, 512 * 1024);
|
|
81
|
-
const declaration = rawBuild && parse(BUILD, rawBuild, workspaceModelBuildInputsSchema);
|
|
82
|
-
if (declaration &&
|
|
83
|
-
(declaration.models.length !== 1 || !same(declaration.models[0].source, plan.source)))
|
|
84
|
-
fail('workspace_public_model_source_changed', BUILD);
|
|
85
|
-
const adaptationFiles = declaration?.models[0].adaptationFiles ?? [];
|
|
86
|
-
const declared = new Map(adaptationFiles.map((file) => [file.path, file]));
|
|
87
|
-
const proofRoots = new Set();
|
|
88
|
-
for (const file of adaptationFiles) {
|
|
89
|
-
if (!file.path.startsWith('.playcraft/model-production/'))
|
|
90
|
-
continue;
|
|
91
|
-
const match = /^\.playcraft\/model-production\/([a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12})\//i.exec(file.path);
|
|
92
|
-
if (!match || !file.contentHash)
|
|
93
|
-
fail('workspace_public_model_path_unsupported', file.path);
|
|
94
|
-
proofRoots.add(`.playcraft/model-production/${match[1]}`);
|
|
95
|
-
}
|
|
96
|
-
const allowedProofs = new Map();
|
|
97
|
-
for (const prefix of proofRoots) {
|
|
98
|
-
const path = `${prefix}/lineage.json`, entry = declared.get(path);
|
|
99
|
-
if (!entry?.contentHash)
|
|
100
|
-
fail('workspace_public_model_lineage_missing', path);
|
|
101
|
-
const proof = parse(path, await read(path, entry.contentHash, 4 * 1024 * 1024), workspaceModelPreparationSourceLineageSchema);
|
|
102
|
-
if (prefix !== `.playcraft/model-production/${proof.pipelineId}` ||
|
|
103
|
-
!same(proof.outputSource, plan.source) ||
|
|
104
|
-
!same(proof.actualInspection.plan.source, proof.actualInspection.source) ||
|
|
105
|
-
!same(proof.outputSource, {
|
|
106
|
-
...proof.actualInspection.source,
|
|
107
|
-
path: `source/${proof.actualInspection.source.path}`,
|
|
108
|
-
files: proof.actualInspection.source.files.map((file) => ({
|
|
109
|
-
...file,
|
|
110
|
-
path: `source/${file.path}`,
|
|
111
|
-
})),
|
|
112
|
-
}))
|
|
113
|
-
fail('workspace_public_model_source_changed', path);
|
|
114
|
-
const names = [
|
|
115
|
-
'lineage.json',
|
|
116
|
-
'recipe.json',
|
|
117
|
-
'tool.json',
|
|
118
|
-
'inspect-model.glb',
|
|
119
|
-
'inspect-source-inspection.json',
|
|
120
|
-
];
|
|
121
|
-
if (proof.recipe.repair)
|
|
122
|
-
names.push('repair-model.glb', 'repair-repair-manifest.json');
|
|
123
|
-
if (proof.recipe.split)
|
|
124
|
-
names.push('split-model.glb', 'split-split-manifest.json', 'split-exterior-trace.json');
|
|
125
|
-
if (proof.recipe.optimize)
|
|
126
|
-
names.push('optimize-model.glb', 'optimize-optimization.json');
|
|
127
|
-
for (const original of proof.parentSource.files) {
|
|
128
|
-
ordinary(original.path);
|
|
129
|
-
names.push(`original/${original.path}`);
|
|
130
|
-
const originalEntry = declared.get(`${prefix}/original/${original.path}`);
|
|
131
|
-
if (originalEntry?.contentHash !== original.contentHash)
|
|
132
|
-
fail('workspace_public_model_input_changed', `${prefix}/original/${original.path}`);
|
|
133
|
-
}
|
|
134
|
-
for (const name of names) {
|
|
135
|
-
const path = `${prefix}/${name}`, expected = declared.get(path)?.contentHash;
|
|
136
|
-
if (!expected)
|
|
137
|
-
fail('workspace_public_model_lineage_missing', path);
|
|
138
|
-
allowedProofs.set(path, expected);
|
|
139
|
-
}
|
|
140
|
-
const recipePath = `${prefix}/recipe.json`;
|
|
141
|
-
const recipe = parse(recipePath, await read(recipePath, allowedProofs.get(recipePath), 1024 * 1024), modelProductionRecipeSchema);
|
|
142
|
-
if (!same(recipe, proof.recipe))
|
|
143
|
-
fail('workspace_public_model_input_changed', recipePath);
|
|
144
|
-
const toolPath = `${prefix}/tool.json`;
|
|
145
|
-
const tool = parse(toolPath, await read(toolPath, allowedProofs.get(toolPath), 4 * 1024 * 1024), workspaceModelPreparationSourceToolSchema);
|
|
146
|
-
if (tool.toolHash !== proof.toolHash ||
|
|
147
|
-
!same(tool.actualInspector, proof.actualInspection.tool) ||
|
|
148
|
-
(tool.manifest &&
|
|
149
|
-
(tool.manifest.toolHash !== tool.toolHash ||
|
|
150
|
-
hash(canonicalModelAdaptation(tool.manifest.files)) !== tool.toolHash)))
|
|
151
|
-
fail('workspace_public_model_input_changed', toolPath);
|
|
152
|
-
}
|
|
153
|
-
const fixed = new Set([DATA, LINEAGE, PROVENANCE, WORKSPACE, parentPath]);
|
|
154
|
-
for (const file of adaptationFiles) {
|
|
155
|
-
if (file.path.split('/').some((part) => part.toLowerCase() === '.playcraft') &&
|
|
156
|
-
!fixed.has(file.path) &&
|
|
157
|
-
!allowedProofs.has(file.path))
|
|
158
|
-
fail('workspace_public_model_path_unsupported', file.path);
|
|
159
|
-
if (!file.path.startsWith('.playcraft/'))
|
|
160
|
-
ordinary(file.path);
|
|
161
|
-
const observed = await read(file.path, file.contentHash);
|
|
162
|
-
if (file.path === WORKSPACE &&
|
|
163
|
-
file.contentHash &&
|
|
164
|
-
(!input.workspaceProjection ||
|
|
165
|
-
hash(input.workspaceProjection) !== file.contentHash ||
|
|
166
|
-
hash(observed.body) !== file.contentHash))
|
|
167
|
-
fail('workspace_public_model_projection_unsupported', file.path);
|
|
168
|
-
}
|
|
169
|
-
const provenanceRaw = await optional(PROVENANCE, 16 * 1024 * 1024);
|
|
170
|
-
if (provenanceRaw) {
|
|
171
|
-
const provenance = parse(PROVENANCE, provenanceRaw, workspaceAssetProvenanceDocumentSchema);
|
|
172
|
-
for (const asset of provenance.assets) {
|
|
173
|
-
ordinary(asset.path);
|
|
174
|
-
await read(asset.path, asset.provenance.modelSha256);
|
|
175
|
-
if (asset.licensePath !== `licenses/assets/${hash(asset.provenance.licenseText)}.txt`)
|
|
176
|
-
fail('workspace_public_model_license_changed', asset.licensePath);
|
|
177
|
-
if (!(await read(asset.licensePath, undefined, 64 * 1024)).body.equals(Buffer.from(asset.provenance.licenseText)))
|
|
178
|
-
fail('workspace_public_model_license_changed', asset.licensePath);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// The caller owns the canonical public projection; raw private workspace bytes never escape here.
|
|
182
|
-
files.delete(WORKSPACE);
|
|
183
|
-
return { files, requiredPaths: [...required].sort() };
|
|
184
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type PublicSourceDependency = {
|
|
2
|
-
specifier: string;
|
|
3
|
-
kind: 'module' | 'resource' | 'types';
|
|
4
|
-
};
|
|
5
|
-
export declare class WorkspacePublicSourceError extends Error {
|
|
6
|
-
readonly code: string;
|
|
7
|
-
readonly file?: string | undefined;
|
|
8
|
-
constructor(code: string, file?: string | undefined);
|
|
9
|
-
}
|
|
10
|
-
/** Static syntax only. No project config, plugin, module or package code is executed. */
|
|
11
|
-
export declare function workspacePublicSourceDependencies(path: string, body: Buffer): PublicSourceDependency[];
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
2
|
-
import { parse } from 'parse5';
|
|
3
|
-
import { workspaceCssResourceSpecifiers } from './workspace-css-imports.js';
|
|
4
|
-
import JSON5 from 'json5';
|
|
5
|
-
export class WorkspacePublicSourceError extends Error {
|
|
6
|
-
constructor(code, file) {
|
|
7
|
-
super(file ? `${code}:${file}` : code);
|
|
8
|
-
this.code = code;
|
|
9
|
-
this.file = file;
|
|
10
|
-
this.name = 'WorkspacePublicSourceError';
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function unsupported(path) {
|
|
14
|
-
throw new WorkspacePublicSourceError('workspace_public_dependency_unsupported', path);
|
|
15
|
-
}
|
|
16
|
-
function scriptDependencies(path, text) {
|
|
17
|
-
const file = ts.createSourceFile(path, text, ts.ScriptTarget.Latest, true, /\.tsx$/i.test(path) ? ts.ScriptKind.TSX : /\.jsx$/i.test(path) ? ts.ScriptKind.JSX : /\.[cm]?ts$/i.test(path) ? ts.ScriptKind.TS : ts.ScriptKind.JS);
|
|
18
|
-
if (file.parseDiagnostics.length)
|
|
19
|
-
unsupported(path);
|
|
20
|
-
const result = [];
|
|
21
|
-
for (const reference of file.referencedFiles) {
|
|
22
|
-
if (/^(?:\/|[a-z][a-z\d+.-]*:)/i.test(reference.fileName) || reference.fileName.includes('\\'))
|
|
23
|
-
unsupported(path);
|
|
24
|
-
result.push({ specifier: reference.fileName.startsWith('.') ? reference.fileName : './' + reference.fileName, kind: 'module' });
|
|
25
|
-
}
|
|
26
|
-
for (const reference of file.typeReferenceDirectives)
|
|
27
|
-
result.push({ specifier: reference.fileName, kind: 'types' });
|
|
28
|
-
// Compiler-provided lib files require a toolchain contract, not a project file lookup.
|
|
29
|
-
if (file.libReferenceDirectives.length)
|
|
30
|
-
unsupported(path);
|
|
31
|
-
const literal = (node) => node && (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) ? node.text : undefined;
|
|
32
|
-
const add = (node, kind = 'module') => {
|
|
33
|
-
const specifier = literal(node);
|
|
34
|
-
if (specifier === undefined)
|
|
35
|
-
unsupported(path);
|
|
36
|
-
result.push({ specifier, kind });
|
|
37
|
-
};
|
|
38
|
-
const isImportMeta = (node) => ts.isMetaProperty(node) && node.keywordToken === ts.SyntaxKind.ImportKeyword;
|
|
39
|
-
const visit = (node) => {
|
|
40
|
-
if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) && node.moduleSpecifier)
|
|
41
|
-
add(node.moduleSpecifier);
|
|
42
|
-
else if (ts.isImportTypeNode(node) && ts.isLiteralTypeNode(node.argument))
|
|
43
|
-
add(node.argument.literal);
|
|
44
|
-
else if (ts.isImportEqualsDeclaration(node) && ts.isExternalModuleReference(node.moduleReference))
|
|
45
|
-
add(node.moduleReference.expression);
|
|
46
|
-
else if (ts.isCallExpression(node)) {
|
|
47
|
-
if (node.expression.kind === ts.SyntaxKind.ImportKeyword || ts.isIdentifier(node.expression) && node.expression.text === 'require') {
|
|
48
|
-
if (node.arguments.length !== 1 && node.expression.kind !== ts.SyntaxKind.ImportKeyword)
|
|
49
|
-
unsupported(path);
|
|
50
|
-
add(node.arguments[0]);
|
|
51
|
-
}
|
|
52
|
-
else if (ts.isPropertyAccessExpression(node.expression)) {
|
|
53
|
-
if (isImportMeta(node.expression.expression) && ['glob', 'globEager'].includes(node.expression.name.text))
|
|
54
|
-
unsupported(path);
|
|
55
|
-
if (ts.isIdentifier(node.expression.expression) && node.expression.expression.text === 'require' && node.expression.name.text === 'resolve')
|
|
56
|
-
add(node.arguments[0]);
|
|
57
|
-
}
|
|
58
|
-
if (ts.isIdentifier(node.expression) && node.expression.text === 'fetch') {
|
|
59
|
-
const value = literal(node.arguments[0]);
|
|
60
|
-
if (value && /^(?:\.{0,2}\/|[^:?#]+\.[a-z0-9]+(?:[?#]|$))/i.test(value))
|
|
61
|
-
result.push({ specifier: value, kind: 'resource' });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else if (ts.isNewExpression(node) && ts.isIdentifier(node.expression)) {
|
|
65
|
-
if (node.expression.text === 'URL' && node.arguments?.[1] && ts.isPropertyAccessExpression(node.arguments[1]) &&
|
|
66
|
-
isImportMeta(node.arguments[1].expression) && node.arguments[1].name.text === 'url') {
|
|
67
|
-
const directoryLocator = ['.', './'].includes(literal(node.arguments[0]) ?? '') && ts.isCallExpression(node.parent) &&
|
|
68
|
-
ts.isIdentifier(node.parent.expression) && node.parent.expression.text === 'fileURLToPath' && node.parent.arguments[0] === node;
|
|
69
|
-
if (!directoryLocator)
|
|
70
|
-
add(node.arguments[0], 'resource');
|
|
71
|
-
}
|
|
72
|
-
if (['Worker', 'SharedWorker'].includes(node.expression.text)) {
|
|
73
|
-
const value = node.arguments?.[0];
|
|
74
|
-
if (value && ts.isNewExpression(value) && ts.isIdentifier(value.expression) && value.expression.text === 'URL') {
|
|
75
|
-
// The nested URL expression is inspected independently.
|
|
76
|
-
}
|
|
77
|
-
else
|
|
78
|
-
add(value);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
ts.forEachChild(node, visit);
|
|
82
|
-
};
|
|
83
|
-
visit(file);
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
function cssDependencies(path, text) {
|
|
87
|
-
try {
|
|
88
|
-
return workspaceCssResourceSpecifiers(text, () => unsupported(path))
|
|
89
|
-
.map(specifier => ({ specifier, kind: 'resource' }));
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
return unsupported(path);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function htmlDependencies(path, text) {
|
|
96
|
-
const result = [];
|
|
97
|
-
const visit = (node) => {
|
|
98
|
-
if ('tagName' in node) {
|
|
99
|
-
const attrs = new Map(node.attrs.map(item => [item.name, item.value]));
|
|
100
|
-
if (node.tagName === 'base' && attrs.has('href'))
|
|
101
|
-
unsupported(path);
|
|
102
|
-
const add = (attribute, kind = 'resource') => {
|
|
103
|
-
const specifier = attrs.get(attribute);
|
|
104
|
-
if (specifier)
|
|
105
|
-
result.push({ specifier, kind });
|
|
106
|
-
};
|
|
107
|
-
if (node.tagName === 'script') {
|
|
108
|
-
if (attrs.has('src'))
|
|
109
|
-
add('src', 'module');
|
|
110
|
-
else {
|
|
111
|
-
const type = attrs.get('type') ?? 'text/javascript';
|
|
112
|
-
if (['module', 'text/javascript', 'application/javascript'].includes(type))
|
|
113
|
-
result.push(...scriptDependencies(path + '.js', node.childNodes.filter(child => 'value' in child).map(child => 'value' in child ? child.value : '').join('')));
|
|
114
|
-
else if (type === 'importmap')
|
|
115
|
-
unsupported(path);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (node.tagName === 'link' && /(?:stylesheet|icon|preload|modulepreload)/.test(attrs.get('rel') ?? ''))
|
|
119
|
-
add('href');
|
|
120
|
-
if (['img', 'source', 'audio', 'video', 'track', 'iframe', 'embed', 'input'].includes(node.tagName))
|
|
121
|
-
add('src');
|
|
122
|
-
if (node.tagName === 'video')
|
|
123
|
-
add('poster');
|
|
124
|
-
if (node.tagName === 'object')
|
|
125
|
-
add('data');
|
|
126
|
-
if (['image', 'use'].includes(node.tagName)) {
|
|
127
|
-
add('href');
|
|
128
|
-
add('xlink:href');
|
|
129
|
-
}
|
|
130
|
-
if (attrs.has('srcset')) {
|
|
131
|
-
if (attrs.get('srcset').includes('data:'))
|
|
132
|
-
unsupported(path);
|
|
133
|
-
for (const candidate of attrs.get('srcset').split(',')) {
|
|
134
|
-
const specifier = candidate.trim().split(/\s+/)[0];
|
|
135
|
-
if (specifier)
|
|
136
|
-
result.push({ specifier, kind: 'resource' });
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (attrs.has('style'))
|
|
140
|
-
result.push(...cssDependencies(path, `x{${attrs.get('style')}}`));
|
|
141
|
-
if (node.tagName === 'style')
|
|
142
|
-
result.push(...cssDependencies(path, node.childNodes.filter(child => 'value' in child).map(child => 'value' in child ? child.value : '').join('')));
|
|
143
|
-
if (node.tagName === 'template')
|
|
144
|
-
visit(node.content);
|
|
145
|
-
}
|
|
146
|
-
if ('childNodes' in node)
|
|
147
|
-
node.childNodes.forEach(visit);
|
|
148
|
-
};
|
|
149
|
-
visit(parse(text));
|
|
150
|
-
return result;
|
|
151
|
-
}
|
|
152
|
-
function jsonDependencies(path, text) {
|
|
153
|
-
let value;
|
|
154
|
-
try {
|
|
155
|
-
value = JSON5.parse(text);
|
|
156
|
-
}
|
|
157
|
-
catch {
|
|
158
|
-
return unsupported(path);
|
|
159
|
-
}
|
|
160
|
-
const result = [];
|
|
161
|
-
const visit = (node, depth = 0) => {
|
|
162
|
-
if (depth > 128)
|
|
163
|
-
unsupported(path);
|
|
164
|
-
if (Array.isArray(node)) {
|
|
165
|
-
node.forEach(item => visit(item, depth + 1));
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (!node || typeof node !== 'object')
|
|
169
|
-
return;
|
|
170
|
-
for (const [key, item] of Object.entries(node)) {
|
|
171
|
-
if (key === '$ref' || key === '$schema') {
|
|
172
|
-
if (typeof item !== 'string')
|
|
173
|
-
unsupported(path);
|
|
174
|
-
if (key === '$schema' && /^https?:\/\/(?:json-schema\.org|www\.json-schema\.org)\/(?:draft-0[467]\/schema|draft\/20(?:19-09|20-12)\/schema)#?$/.test(item))
|
|
175
|
-
continue;
|
|
176
|
-
if (/^[a-z][a-z\d+.-]*:/i.test(item) || item.startsWith('//'))
|
|
177
|
-
unsupported(path);
|
|
178
|
-
if (!item.startsWith('#'))
|
|
179
|
-
result.push({ specifier: item, kind: 'resource' });
|
|
180
|
-
}
|
|
181
|
-
else
|
|
182
|
-
visit(item, depth + 1);
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
visit(value);
|
|
186
|
-
return result;
|
|
187
|
-
}
|
|
188
|
-
function modelDependencies(path, body) {
|
|
189
|
-
let bytes = body;
|
|
190
|
-
if (/\.glb$/i.test(path)) {
|
|
191
|
-
if (body.length < 20 || body.readUInt32LE(0) !== 0x46546c67 || body.readUInt32LE(4) !== 2 || body.readUInt32LE(8) !== body.length || body.readUInt32LE(16) !== 0x4e4f534a)
|
|
192
|
-
return unsupported(path);
|
|
193
|
-
const size = body.readUInt32LE(12);
|
|
194
|
-
if (size < 2 || size > 8 * 1024 * 1024 || size + 20 > body.length)
|
|
195
|
-
return unsupported(path);
|
|
196
|
-
bytes = body.subarray(20, 20 + size);
|
|
197
|
-
}
|
|
198
|
-
let value;
|
|
199
|
-
try {
|
|
200
|
-
value = JSON.parse(bytes.toString('utf8').replace(/\0+$/, ''));
|
|
201
|
-
}
|
|
202
|
-
catch {
|
|
203
|
-
return unsupported(path);
|
|
204
|
-
}
|
|
205
|
-
if (!value || value.asset?.version !== '2.0' || value.images !== undefined && !Array.isArray(value.images) || value.buffers !== undefined && !Array.isArray(value.buffers))
|
|
206
|
-
return unsupported(path);
|
|
207
|
-
const result = [];
|
|
208
|
-
for (const item of [...value.images ?? [], ...value.buffers ?? []]) {
|
|
209
|
-
if (item?.uri === undefined)
|
|
210
|
-
continue;
|
|
211
|
-
if (typeof item.uri !== 'string')
|
|
212
|
-
return unsupported(path);
|
|
213
|
-
result.push({ specifier: item.uri, kind: 'resource' });
|
|
214
|
-
}
|
|
215
|
-
return result;
|
|
216
|
-
}
|
|
217
|
-
/** Static syntax only. No project config, plugin, module or package code is executed. */
|
|
218
|
-
export function workspacePublicSourceDependencies(path, body) {
|
|
219
|
-
if (/\.[cm]?[jt]sx?$/i.test(path))
|
|
220
|
-
return scriptDependencies(path, body.toString('utf8'));
|
|
221
|
-
if (/\.css$/i.test(path))
|
|
222
|
-
return cssDependencies(path, body.toString('utf8'));
|
|
223
|
-
if (/\.(?:html?|svg)$/i.test(path))
|
|
224
|
-
return htmlDependencies(path, body.toString('utf8'));
|
|
225
|
-
if (/\.json5?$/i.test(path))
|
|
226
|
-
return jsonDependencies(path, body.toString('utf8'));
|
|
227
|
-
if (/\.(?:glb|gltf)$/i.test(path))
|
|
228
|
-
return modelDependencies(path, body);
|
|
229
|
-
if (/\.(?:scss|sass|less|vue|svelte)$/i.test(path))
|
|
230
|
-
return unsupported(path);
|
|
231
|
-
return [];
|
|
232
|
-
}
|