@playcraft/cli 0.0.43 → 0.0.44
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/commands/build.js +6 -6
- package/dist/index.js +0 -0
- package/package.json +3 -3
- package/dist/commands/prad.js +0 -61
- package/dist/playable/base-builder.js +0 -265
- package/dist/playable/builder.js +0 -1462
- package/dist/playable/converter.js +0 -150
- package/dist/playable/index.js +0 -3
- package/dist/playable/platforms/base.js +0 -12
- package/dist/playable/platforms/facebook.js +0 -37
- package/dist/playable/platforms/index.js +0 -24
- package/dist/playable/platforms/snapchat.js +0 -59
- package/dist/playable/playable-builder.js +0 -521
- package/dist/playable/types.js +0 -1
- package/dist/playable/vite/config-builder.js +0 -136
- package/dist/playable/vite/platform-configs.js +0 -102
- package/dist/playable/vite/plugin-model-compression.js +0 -63
- package/dist/playable/vite/plugin-platform.js +0 -65
- package/dist/playable/vite/plugin-playcanvas.js +0 -454
- package/dist/playable/vite-builder.js +0 -125
- package/dist/prad/atom-ref.js +0 -23
- package/dist/prad/check.js +0 -377
- package/dist/prad/check.test.js +0 -27
- package/dist/prad/explain.js +0 -109
- package/dist/prad/load-spec.js +0 -23
- package/dist/prad/paths.js +0 -83
- package/dist/prad/skills-index.js +0 -60
- package/project-template/.claude/settings.local.json +0 -4
- package/project-template/logs/.gitkeep +0 -0
- package/project-template/ta-workspace/logs/.gitkeep +0 -0
- package/project-template/ta-workspace/tmp/.gitkeep +0 -0
package/dist/prad/paths.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { parseAtomRef } from './atom-ref.js';
|
|
2
|
-
function visitEntities(basePath, entities, out, parentEntityAtom) {
|
|
3
|
-
if (!Array.isArray(entities))
|
|
4
|
-
return;
|
|
5
|
-
for (const raw of entities) {
|
|
6
|
-
if (!raw || typeof raw !== 'object')
|
|
7
|
-
continue;
|
|
8
|
-
const entity = raw;
|
|
9
|
-
const id = entity.id;
|
|
10
|
-
if (typeof id !== 'string')
|
|
11
|
-
continue;
|
|
12
|
-
const entityPath = `${basePath}.${id}`;
|
|
13
|
-
const atomRef = parseAtomRef(entity.atom);
|
|
14
|
-
out.push({ path: entityPath, kind: 'entity', entity, parentEntityAtom });
|
|
15
|
-
const props = entity.props;
|
|
16
|
-
if (props && typeof props === 'object') {
|
|
17
|
-
for (const [key, val] of Object.entries(props)) {
|
|
18
|
-
if (val && typeof val === 'object' && 'atom' in val) {
|
|
19
|
-
out.push({
|
|
20
|
-
path: `${entityPath}.props.${key}`,
|
|
21
|
-
kind: 'media',
|
|
22
|
-
entity,
|
|
23
|
-
parentEntityAtom: atomRef ?? undefined,
|
|
24
|
-
mediaPropKey: key,
|
|
25
|
-
mediaInstance: val,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (Array.isArray(entity.children)) {
|
|
31
|
-
visitEntities(entityPath, entity.children, out, atomRef ?? undefined);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export function walkPradDocument(doc) {
|
|
36
|
-
const out = [];
|
|
37
|
-
const globals = doc.globals;
|
|
38
|
-
if (globals && typeof globals === 'object') {
|
|
39
|
-
for (const [key, val] of Object.entries(globals)) {
|
|
40
|
-
if (val && typeof val === 'object' && 'atom' in val) {
|
|
41
|
-
out.push({
|
|
42
|
-
path: `globals.${key}`,
|
|
43
|
-
kind: 'global',
|
|
44
|
-
globalKey: key,
|
|
45
|
-
mediaInstance: val,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const scenes = doc.scenes;
|
|
51
|
-
if (Array.isArray(scenes)) {
|
|
52
|
-
for (const scene of scenes) {
|
|
53
|
-
if (!scene || typeof scene !== 'object')
|
|
54
|
-
continue;
|
|
55
|
-
const sceneId = scene.id;
|
|
56
|
-
if (typeof sceneId !== 'string')
|
|
57
|
-
continue;
|
|
58
|
-
const layers = scene.layers;
|
|
59
|
-
if (!Array.isArray(layers))
|
|
60
|
-
continue;
|
|
61
|
-
for (const layer of layers) {
|
|
62
|
-
if (!layer || typeof layer !== 'object')
|
|
63
|
-
continue;
|
|
64
|
-
const layerId = layer.id;
|
|
65
|
-
if (typeof layerId !== 'string')
|
|
66
|
-
continue;
|
|
67
|
-
const base = `scenes.${sceneId}.${layerId}`;
|
|
68
|
-
visitEntities(base, layer.entities ?? [], out);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return out;
|
|
73
|
-
}
|
|
74
|
-
export function resolvePath(doc, logicalPath) {
|
|
75
|
-
return walkPradDocument(doc).find((v) => v.path === logicalPath);
|
|
76
|
-
}
|
|
77
|
-
/** Media path `scenes.x.y.z.props.key` → entity path `scenes.x.y.z` */
|
|
78
|
-
export function parentEntityPath(mediaPath) {
|
|
79
|
-
const idx = mediaPath.lastIndexOf('.props.');
|
|
80
|
-
if (idx === -1)
|
|
81
|
-
return undefined;
|
|
82
|
-
return mediaPath.slice(0, idx);
|
|
83
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { resolveSkillsDirs } from '../atom-plan/validate-atom-plan.js';
|
|
5
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
-
function allSkillsDirs(customDir) {
|
|
7
|
-
const dirs = resolveSkillsDirs(customDir);
|
|
8
|
-
const monoFromPrad = path.resolve(__dirname, '..', '..', '..', 'skills', 'skills');
|
|
9
|
-
if (fs.existsSync(monoFromPrad))
|
|
10
|
-
dirs.push(monoFromPrad);
|
|
11
|
-
return [...new Set(dirs)];
|
|
12
|
-
}
|
|
13
|
-
/** Load set of registry atom ids from Skills directories. */
|
|
14
|
-
export function loadRegistryAtomIds(skillsDir) {
|
|
15
|
-
const ids = new Set();
|
|
16
|
-
for (const dir of allSkillsDirs(skillsDir)) {
|
|
17
|
-
if (!fs.existsSync(dir))
|
|
18
|
-
continue;
|
|
19
|
-
for (const name of fs.readdirSync(dir)) {
|
|
20
|
-
const manifestPath = path.join(dir, name, 'manifest.json');
|
|
21
|
-
if (!fs.existsSync(manifestPath))
|
|
22
|
-
continue;
|
|
23
|
-
try {
|
|
24
|
-
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
25
|
-
if (manifest.atomId)
|
|
26
|
-
ids.add(manifest.atomId);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// skip invalid manifest
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return ids;
|
|
34
|
-
}
|
|
35
|
-
export function loadManifestImports(atomId, skillsDir) {
|
|
36
|
-
for (const dir of allSkillsDirs(skillsDir)) {
|
|
37
|
-
const manifestPath = path.join(dir, atomId, 'manifest.json');
|
|
38
|
-
if (!fs.existsSync(manifestPath))
|
|
39
|
-
continue;
|
|
40
|
-
try {
|
|
41
|
-
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
42
|
-
const bindAsSet = new Set();
|
|
43
|
-
for (const imp of manifest.imports ?? []) {
|
|
44
|
-
if (imp.bindAs)
|
|
45
|
-
bindAsSet.add(imp.bindAs);
|
|
46
|
-
}
|
|
47
|
-
return { atomId: manifest.atomId ?? atomId, bindAsSet };
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
/** Effective atom id for compile: draft uses substitute when present. */
|
|
56
|
-
export function effectiveAtomId(ref) {
|
|
57
|
-
if (ref.resolve === 'draft' && ref.substitute)
|
|
58
|
-
return ref.substitute;
|
|
59
|
-
return ref.id;
|
|
60
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|