@drawcall/create 0.1.2 → 0.1.3
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/constants.d.ts +2 -1
- package/dist/constants.js +9 -3
- package/dist/create.js +3 -1
- package/dist/scaffold.js +17 -7
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export type HarnessName = (typeof HARNESS_NAMES)[number];
|
|
|
3
3
|
export declare const STAGES: readonly ["scaffold", "template", "survey-assets", "survey-technology", "goal", "plan", "build", "full"];
|
|
4
4
|
export type Stage = (typeof STAGES)[number];
|
|
5
5
|
export declare const PARALLEL_STAGES: readonly ["survey-assets", "survey-technology"];
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const GITHUB_SKILLS: readonly ["drawcall-ai/vitexec", "drawcall-ai/uikitml", "drawcall-ai/speech", "drawcall-ai/flipbook", "drawcall-ai/skills"];
|
|
7
|
+
export declare const PACKAGE_SKILLS: readonly ["@drawcall/acta", "@drawcall/market"];
|
|
7
8
|
export declare const PACKAGES: readonly ["vitexec@latest", "@drawcall/uikitml@latest", "@drawcall/acta@latest", "@drawcall/market@latest", "@drawcall/flipbook@latest", "@pmndrs/uikit@latest", "@pmndrs/pointer-events@latest", "@pmndrs/viverse@latest", "navcat@^0.4.1", "three@^0.184.0", "vite@^8.0.16", "typescript@^6.0.3", "elics@^3.4.2", "postprocessing@^6.39.1"];
|
|
8
9
|
export declare const PACKAGE_NAMES: readonly ["vitexec", "@drawcall/uikitml", "@drawcall/acta", "@drawcall/market", "@drawcall/flipbook", "@pmndrs/uikit", "@pmndrs/pointer-events", "@pmndrs/viverse", "navcat", "three", "vite", "typescript", "elics"];
|
|
9
10
|
export declare const MAX_BUILD_TURNS = 10;
|
package/dist/constants.js
CHANGED
|
@@ -21,15 +21,21 @@ export const STAGES = [
|
|
|
21
21
|
// applied state (they write disjoint gitignored scratch files and don't depend on each other) and
|
|
22
22
|
// share a barrier before the goal stage.
|
|
23
23
|
export const PARALLEL_STAGES = ["survey-assets", "survey-technology"];
|
|
24
|
-
|
|
24
|
+
// Skills whose source repos are public: the `skills` CLI clones them from GitHub at scaffold time.
|
|
25
|
+
export const GITHUB_SKILLS = [
|
|
25
26
|
"drawcall-ai/vitexec",
|
|
26
27
|
"drawcall-ai/uikitml",
|
|
27
|
-
"drawcall-ai/acta",
|
|
28
|
-
"drawcall-ai/market",
|
|
29
28
|
"drawcall-ai/speech",
|
|
30
29
|
"drawcall-ai/flipbook",
|
|
31
30
|
"drawcall-ai/skills"
|
|
32
31
|
];
|
|
32
|
+
// Skills whose source repos are private. Their npm packages ship the SKILL.md inside the published
|
|
33
|
+
// tarball, so once dependencies are installed the skill already sits at
|
|
34
|
+
// node_modules/<pkg>/skills/<name>/SKILL.md. We point `skills add` at that local path instead of
|
|
35
|
+
// cloning the (inaccessible) GitHub repo — no network, no auth, and the skill is always in lockstep
|
|
36
|
+
// with the installed package version. Each entry is the installed npm package directory under
|
|
37
|
+
// node_modules; `skills add <dir>` discovers the bundled SKILL.md and installs it like any other.
|
|
38
|
+
export const PACKAGE_SKILLS = ["@drawcall/acta", "@drawcall/market"];
|
|
33
39
|
export const PACKAGES = [
|
|
34
40
|
"vitexec@latest",
|
|
35
41
|
"@drawcall/uikitml@latest",
|
package/dist/create.js
CHANGED
|
@@ -159,8 +159,10 @@ async function runScaffoldStage(harnessRunner, progressLog) {
|
|
|
159
159
|
await ensureNpmrc(projectDir);
|
|
160
160
|
await ensureBaseProjectDirectories(projectDir);
|
|
161
161
|
await initNpmProject(projectDir, runner);
|
|
162
|
-
|
|
162
|
+
// Dependencies first: the private-repo skills are installed from their package directory under
|
|
163
|
+
// node_modules, which installDependencies creates (see installSkills / PACKAGE_SKILLS).
|
|
163
164
|
await installDependencies(projectDir, runner);
|
|
165
|
+
await installSkills(projectDir, harness, runner);
|
|
164
166
|
await commitAll(projectDir, runner, "chore: set up project scaffolding");
|
|
165
167
|
progressLog.succeed("scaffolding");
|
|
166
168
|
}
|
package/dist/scaffold.js
CHANGED
|
@@ -2,7 +2,7 @@ import { randomBytes } from "node:crypto";
|
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
4
|
import { basename, dirname, join } from "node:path";
|
|
5
|
-
import { GITIGNORE_ENTRIES,
|
|
5
|
+
import { GITHUB_SKILLS, GITIGNORE_ENTRIES, PACKAGE_SKILLS, PACKAGES } from "./constants.js";
|
|
6
6
|
import { assertExitCode } from "./subprocess.js";
|
|
7
7
|
export function generateProjectName() {
|
|
8
8
|
return `dc-${randomBytes(3).toString("hex")}`;
|
|
@@ -109,13 +109,23 @@ const SKILLS_AGENT = {
|
|
|
109
109
|
// Verify forge actually discovers the installed skills in its e2e run and adjust if it misses.
|
|
110
110
|
forge: "universal"
|
|
111
111
|
};
|
|
112
|
+
// Must run after installDependencies: the PACKAGE_SKILLS are installed from their package directory
|
|
113
|
+
// under node_modules, which only exists once dependencies are installed.
|
|
112
114
|
export async function installSkills(cwd, harness, runner) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const agent = SKILLS_AGENT[harness];
|
|
116
|
+
const addSkill = (source, label) => assertExitCode(runner({
|
|
117
|
+
command: "npx",
|
|
118
|
+
args: ["--yes", "skills", "add", source, "-y", "--agent", agent],
|
|
119
|
+
cwd
|
|
120
|
+
}), `failed to install skill ${label}`);
|
|
121
|
+
for (const skill of GITHUB_SKILLS) {
|
|
122
|
+
await addSkill(skill, skill);
|
|
123
|
+
}
|
|
124
|
+
// Install the private-repo skills from their already-installed npm package (see PACKAGE_SKILLS).
|
|
125
|
+
// An absolute path is unambiguous — a bare "node_modules/@drawcall/acta" would be read as an
|
|
126
|
+
// owner/repo GitHub slug.
|
|
127
|
+
for (const pkg of PACKAGE_SKILLS) {
|
|
128
|
+
await addSkill(join(cwd, "node_modules", pkg), pkg);
|
|
119
129
|
}
|
|
120
130
|
}
|
|
121
131
|
export async function installDependencies(cwd, runner) {
|