@ontrails/trails 1.0.0-beta.2 → 1.0.0-beta.22
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 +647 -0
- package/README.md +26 -0
- package/package.json +28 -7
- package/src/app.ts +86 -2
- package/src/clack.ts +22 -0
- package/src/cli.ts +330 -11
- package/src/completions.ts +240 -0
- package/src/lifecycle-source-io.ts +33 -0
- package/src/load-app-mirror.ts +202 -0
- package/src/local-state-io.ts +153 -0
- package/src/mcp-app.ts +30 -0
- package/src/mcp-options.ts +77 -0
- package/src/mcp.ts +8 -0
- package/src/project-writes.ts +377 -0
- package/src/release/bindings.ts +39 -0
- package/src/release/check.ts +818 -0
- package/src/release/config.ts +63 -0
- package/src/release/contract-facts.ts +425 -0
- package/src/release/index.ts +85 -0
- package/src/release/native-bun-publish.ts +651 -0
- package/src/release/native-bun-registry.ts +350 -0
- package/src/release/packed-artifacts-smoke.ts +236 -0
- package/src/release/smoke.ts +46 -0
- package/src/release/wayfinder-dogfood-smoke.ts +226 -0
- package/src/retired-topo-command.ts +36 -0
- package/src/run-adapter-check.ts +76 -0
- package/src/run-collision.ts +126 -0
- package/src/run-completions-install.ts +179 -0
- package/src/run-example.ts +149 -0
- package/src/run-examples.ts +148 -0
- package/src/run-quiet.ts +75 -0
- package/src/run-release-check.ts +74 -0
- package/src/run-trace.ts +273 -0
- package/src/run-warden.ts +39 -0
- package/src/run-watch.ts +432 -0
- package/src/scaffold-version-sync.ts +183 -0
- package/src/scaffold-versions.generated.ts +12 -0
- package/src/trails/adapter-check.ts +244 -0
- package/src/trails/add-surface.ts +94 -40
- package/src/trails/add-trail.ts +79 -41
- package/src/trails/add-verify.ts +95 -25
- package/src/trails/compile.ts +67 -0
- package/src/trails/completions-complete.ts +165 -0
- package/src/trails/completions.ts +47 -0
- package/src/trails/create-adapter.ts +1084 -0
- package/src/trails/create-scaffold.ts +399 -104
- package/src/trails/create-versions.ts +62 -0
- package/src/trails/create.ts +185 -71
- package/src/trails/deprecate.ts +59 -0
- package/src/trails/dev-clean.ts +82 -0
- package/src/trails/dev-reset.ts +50 -0
- package/src/trails/dev-stats.ts +72 -0
- package/src/trails/dev-support.ts +340 -0
- package/src/trails/doctor.ts +56 -0
- package/src/trails/draft-promote.ts +949 -0
- package/src/trails/guide.ts +74 -68
- package/src/trails/load-app.ts +1143 -15
- package/src/trails/project.ts +17 -3
- package/src/trails/release-check.ts +104 -0
- package/src/trails/release-smoke.ts +48 -0
- package/src/trails/revise.ts +53 -0
- package/src/trails/root-dir.ts +21 -0
- package/src/trails/run-example.ts +491 -0
- package/src/trails/run-examples.ts +145 -0
- package/src/trails/run.ts +410 -0
- package/src/trails/scaffold-json.ts +58 -0
- package/src/trails/survey.ts +881 -226
- package/src/trails/topo-activation.ts +385 -0
- package/src/trails/topo-constants.ts +2 -0
- package/src/trails/topo-history.ts +47 -0
- package/src/trails/topo-output-schemas.ts +248 -0
- package/src/trails/topo-pin.ts +52 -0
- package/src/trails/topo-read-support.ts +313 -0
- package/src/trails/topo-reports.ts +807 -0
- package/src/trails/topo-store-support.ts +174 -0
- package/src/trails/topo-support.ts +220 -0
- package/src/trails/topo-unpin.ts +61 -0
- package/src/trails/topo.ts +106 -0
- package/src/trails/validate.ts +38 -0
- package/src/trails/version-lifecycle-support.ts +945 -0
- package/src/trails/warden-guide.ts +129 -0
- package/src/trails/warden.ts +165 -58
- package/src/versions.ts +31 -0
- package/.turbo/turbo-build.log +0 -1
- package/.turbo/turbo-lint.log +0 -3
- package/.turbo/turbo-typecheck.log +0 -1
- package/__tests__/examples.test.ts +0 -6
- package/dist/bin/trails.d.ts +0 -3
- package/dist/bin/trails.d.ts.map +0 -1
- package/dist/bin/trails.js +0 -4
- package/dist/bin/trails.js.map +0 -1
- package/dist/src/app.d.ts +0 -2
- package/dist/src/app.d.ts.map +0 -1
- package/dist/src/app.js +0 -11
- package/dist/src/app.js.map +0 -1
- package/dist/src/clack.d.ts +0 -9
- package/dist/src/clack.d.ts.map +0 -1
- package/dist/src/clack.js +0 -62
- package/dist/src/clack.js.map +0 -1
- package/dist/src/cli.d.ts +0 -2
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -13
- package/dist/src/cli.js.map +0 -1
- package/dist/src/trails/add-surface.d.ts +0 -13
- package/dist/src/trails/add-surface.d.ts.map +0 -1
- package/dist/src/trails/add-surface.js +0 -88
- package/dist/src/trails/add-surface.js.map +0 -1
- package/dist/src/trails/add-trail.d.ts +0 -11
- package/dist/src/trails/add-trail.d.ts.map +0 -1
- package/dist/src/trails/add-trail.js +0 -85
- package/dist/src/trails/add-trail.js.map +0 -1
- package/dist/src/trails/add-verify.d.ts +0 -10
- package/dist/src/trails/add-verify.d.ts.map +0 -1
- package/dist/src/trails/add-verify.js +0 -67
- package/dist/src/trails/add-verify.js.map +0 -1
- package/dist/src/trails/create-scaffold.d.ts +0 -15
- package/dist/src/trails/create-scaffold.d.ts.map +0 -1
- package/dist/src/trails/create-scaffold.js +0 -288
- package/dist/src/trails/create-scaffold.js.map +0 -1
- package/dist/src/trails/create.d.ts +0 -22
- package/dist/src/trails/create.d.ts.map +0 -1
- package/dist/src/trails/create.js +0 -121
- package/dist/src/trails/create.js.map +0 -1
- package/dist/src/trails/guide.d.ts +0 -11
- package/dist/src/trails/guide.d.ts.map +0 -1
- package/dist/src/trails/guide.js +0 -80
- package/dist/src/trails/guide.js.map +0 -1
- package/dist/src/trails/load-app.d.ts +0 -4
- package/dist/src/trails/load-app.d.ts.map +0 -1
- package/dist/src/trails/load-app.js +0 -24
- package/dist/src/trails/load-app.js.map +0 -1
- package/dist/src/trails/project.d.ts +0 -8
- package/dist/src/trails/project.d.ts.map +0 -1
- package/dist/src/trails/project.js +0 -43
- package/dist/src/trails/project.js.map +0 -1
- package/dist/src/trails/survey.d.ts +0 -33
- package/dist/src/trails/survey.d.ts.map +0 -1
- package/dist/src/trails/survey.js +0 -225
- package/dist/src/trails/survey.js.map +0 -1
- package/dist/src/trails/warden.d.ts +0 -19
- package/dist/src/trails/warden.d.ts.map +0 -1
- package/dist/src/trails/warden.js +0 -88
- package/dist/src/trails/warden.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/__tests__/create.test.ts +0 -349
- package/src/__tests__/guide.test.ts +0 -91
- package/src/__tests__/load-app.test.ts +0 -15
- package/src/__tests__/survey.test.ts +0 -161
- package/src/__tests__/warden.test.ts +0 -74
- package/tsconfig.json +0 -9
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `add.surface` trail -- Add a surface to an existing project.
|
|
3
|
-
*
|
|
4
|
-
* Generates the CLI or MCP entry point and updates package.json dependencies.
|
|
5
|
-
*/
|
|
6
|
-
import { existsSync, mkdirSync } from 'node:fs';
|
|
7
|
-
import { basename, dirname, join, resolve } from 'node:path';
|
|
8
|
-
import { Result, trail } from '@ontrails/core';
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
import { findTopoPath } from './project.js';
|
|
11
|
-
const generateCliEntry = (appImportPath) => `import { blaze } from '@ontrails/cli/commander';
|
|
12
|
-
|
|
13
|
-
import { app } from '${appImportPath}';
|
|
14
|
-
|
|
15
|
-
blaze(app);
|
|
16
|
-
`;
|
|
17
|
-
const generateMcpEntry = (appImportPath) => `import { blaze } from '@ontrails/mcp';
|
|
18
|
-
|
|
19
|
-
import { app } from '${appImportPath}';
|
|
20
|
-
|
|
21
|
-
await blaze(app);
|
|
22
|
-
`;
|
|
23
|
-
/** Resolve the entry file for a surface. */
|
|
24
|
-
const getEntryFile = (surface) => surface === 'cli' ? 'src/cli.ts' : 'src/mcp.ts';
|
|
25
|
-
// ---------------------------------------------------------------------------
|
|
26
|
-
// Trail definition
|
|
27
|
-
// ---------------------------------------------------------------------------
|
|
28
|
-
/** Patch deps and optionally bin in a parsed package.json. */
|
|
29
|
-
const patchPkgDeps = (pkg, surface, cwd) => {
|
|
30
|
-
const depName = surface === 'cli' ? '@ontrails/cli' : '@ontrails/mcp';
|
|
31
|
-
const deps = (pkg['dependencies'] ?? {});
|
|
32
|
-
deps[depName] = 'workspace:*';
|
|
33
|
-
if (surface === 'cli') {
|
|
34
|
-
deps['commander'] = '^14.0.0';
|
|
35
|
-
pkg['bin'] = {
|
|
36
|
-
[pkg['name'] ?? basename(cwd)]: './src/cli.ts',
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
pkg['dependencies'] = Object.fromEntries(Object.entries(deps).toSorted(([a], [b]) => a.localeCompare(b)));
|
|
40
|
-
return depName;
|
|
41
|
-
};
|
|
42
|
-
/** Update package.json with surface dependency and CLI bin if needed. */
|
|
43
|
-
const updatePkgJsonForSurface = async (cwd, surface) => {
|
|
44
|
-
const pkgPath = join(cwd, 'package.json');
|
|
45
|
-
if (!existsSync(pkgPath)) {
|
|
46
|
-
return surface === 'cli' ? '@ontrails/cli' : '@ontrails/mcp';
|
|
47
|
-
}
|
|
48
|
-
const pkg = (await Bun.file(pkgPath).json());
|
|
49
|
-
const depName = patchPkgDeps(pkg, surface, cwd);
|
|
50
|
-
await Bun.write(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
51
|
-
return depName;
|
|
52
|
-
};
|
|
53
|
-
/** Create the entry file for a surface and return the relative path. */
|
|
54
|
-
const writeSurfaceEntry = async (cwd, surface) => {
|
|
55
|
-
const entryFile = getEntryFile(surface);
|
|
56
|
-
const fullEntryPath = join(cwd, entryFile);
|
|
57
|
-
const appImport = (await findTopoPath(cwd)) ?? './app.js';
|
|
58
|
-
const content = surface === 'cli'
|
|
59
|
-
? generateCliEntry(appImport)
|
|
60
|
-
: generateMcpEntry(appImport);
|
|
61
|
-
mkdirSync(dirname(fullEntryPath), { recursive: true });
|
|
62
|
-
await Bun.write(fullEntryPath, content);
|
|
63
|
-
return entryFile;
|
|
64
|
-
};
|
|
65
|
-
export const addSurface = trail('add.surface', {
|
|
66
|
-
description: 'Add a surface to an existing project',
|
|
67
|
-
implementation: async (input) => {
|
|
68
|
-
const cwd = resolve(input.dir ?? '.');
|
|
69
|
-
const { surface } = input;
|
|
70
|
-
const entryFile = getEntryFile(surface);
|
|
71
|
-
if (existsSync(join(cwd, entryFile))) {
|
|
72
|
-
return Result.err(new Error(`${surface.toUpperCase()} is already blazed. Nothing to do.`));
|
|
73
|
-
}
|
|
74
|
-
return Result.ok({
|
|
75
|
-
created: await writeSurfaceEntry(cwd, surface),
|
|
76
|
-
dependency: await updatePkgJsonForSurface(cwd, surface),
|
|
77
|
-
});
|
|
78
|
-
},
|
|
79
|
-
input: z.object({
|
|
80
|
-
dir: z.string().optional().describe('Project directory'),
|
|
81
|
-
surface: z.enum(['cli', 'mcp']).describe('Surface to add'),
|
|
82
|
-
}),
|
|
83
|
-
output: z.object({
|
|
84
|
-
created: z.string(),
|
|
85
|
-
dependency: z.string(),
|
|
86
|
-
}),
|
|
87
|
-
});
|
|
88
|
-
//# sourceMappingURL=add-surface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-surface.js","sourceRoot":"","sources":["../../../src/trails/add-surface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,gBAAgB,GAAG,CAAC,aAAqB,EAAU,EAAE,CACzD;;uBAEqB,aAAa;;;CAGnC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,aAAqB,EAAU,EAAE,CACzD;;uBAEqB,aAAa;;;CAGnC,CAAC;AAEF,4CAA4C;AAC5C,MAAM,YAAY,GAAG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AC,CAAC;QACtC,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QAC1B,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QAExC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;YACrC,OAAO,MAAM,CAAC,GAAG,CACf,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,oCAAoC,CAAC,CACxE,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,EAAE,CAAC;YACf,OAAO,EAAE,MAAM,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC;YAC9C,UAAU,EAAE,MAAM,uBAAuB,CAAC,GAAG,EAAE,OAAO,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QACxD,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KAC3D,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;KACvB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `add.trail` trail -- Scaffold a new trail file with tests.
|
|
3
|
-
*/
|
|
4
|
-
export declare const addTrail: import("@ontrails/core").Trail<{
|
|
5
|
-
destructive: boolean;
|
|
6
|
-
id: string;
|
|
7
|
-
readOnly: boolean;
|
|
8
|
-
}, {
|
|
9
|
-
created: string[];
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=add-trail.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-trail.d.ts","sourceRoot":"","sources":["../../../src/trails/add-trail.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuEH,eAAO,MAAM,QAAQ;;;;;;EA6BnB,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `add.trail` trail -- Scaffold a new trail file with tests.
|
|
3
|
-
*/
|
|
4
|
-
import { mkdirSync } from 'node:fs';
|
|
5
|
-
import { dirname, join, resolve } from 'node:path';
|
|
6
|
-
import { Result, trail } from '@ontrails/core';
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Helpers
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
const generateTrailFile = (id, readOnly, destructive) => {
|
|
12
|
-
const markers = [];
|
|
13
|
-
if (readOnly) {
|
|
14
|
-
markers.push(' readOnly: true,');
|
|
15
|
-
}
|
|
16
|
-
if (destructive) {
|
|
17
|
-
markers.push(' destructive: true,');
|
|
18
|
-
}
|
|
19
|
-
const markerBlock = markers.length > 0 ? `\n${markers.join('\n')}` : '';
|
|
20
|
-
return `import { Result, trail } from '@ontrails/core';
|
|
21
|
-
import { z } from 'zod';
|
|
22
|
-
|
|
23
|
-
export const ${id.replaceAll('.', '_')} = trail('${id}', {
|
|
24
|
-
description: 'TODO: describe this trail',
|
|
25
|
-
examples: [
|
|
26
|
-
{
|
|
27
|
-
input: {},
|
|
28
|
-
name: 'TODO: add example',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
implementation: async (input) => {
|
|
32
|
-
return Result.ok({ message: 'TODO' });
|
|
33
|
-
},
|
|
34
|
-
input: z.object({}),${markerBlock}
|
|
35
|
-
output: z.object({ message: z.string() }),
|
|
36
|
-
});
|
|
37
|
-
`;
|
|
38
|
-
};
|
|
39
|
-
const generateTestFile = (id) => {
|
|
40
|
-
const moduleName = id.replaceAll('.', '-');
|
|
41
|
-
const trailName = id.replaceAll('.', '_');
|
|
42
|
-
return `import { testTrail } from '@ontrails/testing';
|
|
43
|
-
import { ${trailName} } from '../src/trails/${moduleName}.js';
|
|
44
|
-
|
|
45
|
-
testTrail(${trailName}, [
|
|
46
|
-
{ description: 'basic test', input: {}, expectOk: true },
|
|
47
|
-
]);
|
|
48
|
-
`;
|
|
49
|
-
};
|
|
50
|
-
// ---------------------------------------------------------------------------
|
|
51
|
-
// Trail definition
|
|
52
|
-
// ---------------------------------------------------------------------------
|
|
53
|
-
/** Write a file, creating parent directories as needed. */
|
|
54
|
-
const writeWithDirs = async (filePath, content) => {
|
|
55
|
-
mkdirSync(dirname(filePath), { recursive: true });
|
|
56
|
-
await Bun.write(filePath, content);
|
|
57
|
-
};
|
|
58
|
-
export const addTrail = trail('add.trail', {
|
|
59
|
-
description: 'Scaffold a new trail with tests and examples',
|
|
60
|
-
implementation: async (input, ctx) => {
|
|
61
|
-
const { id } = input;
|
|
62
|
-
const moduleName = id.replaceAll('.', '-');
|
|
63
|
-
const cwd = resolve(ctx.cwd ?? '.');
|
|
64
|
-
const files = new Map([
|
|
65
|
-
[
|
|
66
|
-
`src/trails/${moduleName}.ts`,
|
|
67
|
-
generateTrailFile(id, input.readOnly, input.destructive),
|
|
68
|
-
],
|
|
69
|
-
[`__tests__/${moduleName}.test.ts`, generateTestFile(id)],
|
|
70
|
-
]);
|
|
71
|
-
for (const [relativePath, content] of files) {
|
|
72
|
-
await writeWithDirs(join(cwd, relativePath), content);
|
|
73
|
-
}
|
|
74
|
-
return Result.ok({ created: [...files.keys()] });
|
|
75
|
-
},
|
|
76
|
-
input: z.object({
|
|
77
|
-
destructive: z.boolean().default(false).describe('Destructive trail'),
|
|
78
|
-
id: z.string().describe('Trail ID (e.g., entity.update)'),
|
|
79
|
-
readOnly: z.boolean().default(false).describe('Read-only trail'),
|
|
80
|
-
}),
|
|
81
|
-
output: z.object({
|
|
82
|
-
created: z.array(z.string()),
|
|
83
|
-
}),
|
|
84
|
-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,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QACrE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;QACzD,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC;KACjE,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `add.verify` trail -- Add testing + warden setup to a project.
|
|
3
|
-
*/
|
|
4
|
-
export declare const addVerify: import("@ontrails/core").Trail<{
|
|
5
|
-
name: string;
|
|
6
|
-
dir?: string | undefined;
|
|
7
|
-
}, {
|
|
8
|
-
created: string[];
|
|
9
|
-
}>;
|
|
10
|
-
//# sourceMappingURL=add-verify.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-verify.d.ts","sourceRoot":"","sources":["../../../src/trails/add-verify.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsDH,eAAO,MAAM,SAAS;;;;;EA8BpB,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `add.verify` trail -- Add testing + warden setup to a project.
|
|
3
|
-
*/
|
|
4
|
-
import { existsSync, mkdirSync } from 'node:fs';
|
|
5
|
-
import { dirname, join, resolve } from 'node:path';
|
|
6
|
-
import { Result, trail } from '@ontrails/core';
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Content generators
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
const generateTestFile = () => `import { testAll } from '@ontrails/testing';
|
|
12
|
-
import { app } from '../src/app.js';
|
|
13
|
-
|
|
14
|
-
testAll(app);
|
|
15
|
-
`;
|
|
16
|
-
const generateLefthookYml = () => `pre-push:
|
|
17
|
-
commands:
|
|
18
|
-
warden:
|
|
19
|
-
run: bunx trails warden --exit-code
|
|
20
|
-
`;
|
|
21
|
-
/** Add testing and warden devDependencies to package.json when present. */
|
|
22
|
-
const patchVerifyDeps = (pkg) => {
|
|
23
|
-
const devDeps = (pkg['devDependencies'] ?? {});
|
|
24
|
-
devDeps['@ontrails/testing'] = 'workspace:*';
|
|
25
|
-
devDeps['@ontrails/warden'] = 'workspace:*';
|
|
26
|
-
devDeps['lefthook'] = '^2.1.1';
|
|
27
|
-
pkg['devDependencies'] = Object.fromEntries(Object.entries(devDeps).toSorted(([a], [b]) => a.localeCompare(b)));
|
|
28
|
-
};
|
|
29
|
-
/** Update package.json in the target project with verify dependencies. */
|
|
30
|
-
const updatePackageJsonForVerify = async (projectDir) => {
|
|
31
|
-
const pkgPath = join(projectDir, 'package.json');
|
|
32
|
-
if (!existsSync(pkgPath)) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const pkg = (await Bun.file(pkgPath).json());
|
|
36
|
-
patchVerifyDeps(pkg);
|
|
37
|
-
await Bun.write(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
|
|
38
|
-
};
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
// Trail definition
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
export const addVerify = trail('add.verify', {
|
|
43
|
-
description: 'Add testing and warden verification',
|
|
44
|
-
implementation: async (input) => {
|
|
45
|
-
const projectDir = resolve(input.dir ?? '.', input.name);
|
|
46
|
-
const files = [];
|
|
47
|
-
const writeFile = async (relativePath, content) => {
|
|
48
|
-
const fullPath = join(projectDir, relativePath);
|
|
49
|
-
mkdirSync(dirname(fullPath), { recursive: true });
|
|
50
|
-
await Bun.write(fullPath, content);
|
|
51
|
-
files.push(relativePath);
|
|
52
|
-
};
|
|
53
|
-
await writeFile('__tests__/examples.test.ts', generateTestFile());
|
|
54
|
-
await writeFile('lefthook.yml', generateLefthookYml());
|
|
55
|
-
await updatePackageJsonForVerify(projectDir);
|
|
56
|
-
return Result.ok({ created: files });
|
|
57
|
-
},
|
|
58
|
-
input: z.object({
|
|
59
|
-
dir: z.string().optional().describe('Parent directory'),
|
|
60
|
-
name: z.string().describe('Project name'),
|
|
61
|
-
}),
|
|
62
|
-
markers: { internal: true },
|
|
63
|
-
output: z.object({
|
|
64
|
-
created: z.array(z.string()),
|
|
65
|
-
}),
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=add-verify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-verify.js","sourceRoot":"","sources":["../../../src/trails/add-verify.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,MAAM,gBAAgB,GAAG,GAAW,EAAE,CACpC;;;;CAID,CAAC;AAEF,MAAM,mBAAmB,GAAG,GAAW,EAAE,CACvC;;;;CAID,CAAC;AAEF,2EAA2E;AAC3E,MAAM,eAAe,GAAG,CAAC,GAA4B,EAAQ,EAAE;IAC7D,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAA2B,CAAC;IACzE,OAA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,MAAM,SAAS,GAAG,KAAK,EACrB,YAAoB,EACpB,OAAe,EACA,EAAE;YACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;YAChD,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,MAAM,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEF,MAAM,SAAS,CAAC,4BAA4B,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAClE,MAAM,SAAS,CAAC,cAAc,EAAE,mBAAmB,EAAE,CAAC,CAAC;QACvD,MAAM,0BAA0B,CAAC,UAAU,CAAC,CAAC;QAE7C,OAAO,MAAM,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACvD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;KAC1C,CAAC;IACF,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `create.scaffold` trail -- Creates base project structure.
|
|
3
|
-
*
|
|
4
|
-
* Generates package.json, tsconfig, app.ts, starter trails, and .trails/ directory.
|
|
5
|
-
*/
|
|
6
|
-
export declare const createScaffold: import("@ontrails/core").Trail<{
|
|
7
|
-
name: string;
|
|
8
|
-
starter: "empty" | "entity" | "hello";
|
|
9
|
-
dir?: string | undefined;
|
|
10
|
-
}, {
|
|
11
|
-
created: string[];
|
|
12
|
-
dir: string;
|
|
13
|
-
name: string;
|
|
14
|
-
}>;
|
|
15
|
-
//# sourceMappingURL=create-scaffold.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-scaffold.d.ts","sourceRoot":"","sources":["../../../src/trails/create-scaffold.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8TH,eAAO,MAAM,cAAc;;;;;;;;EA6BzB,CAAC"}
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `create.scaffold` trail -- Creates base project structure.
|
|
3
|
-
*
|
|
4
|
-
* Generates package.json, tsconfig, app.ts, starter trails, and .trails/ directory.
|
|
5
|
-
*/
|
|
6
|
-
import { mkdirSync } from 'node:fs';
|
|
7
|
-
import { dirname, join, resolve } from 'node:path';
|
|
8
|
-
import { Result, trail } from '@ontrails/core';
|
|
9
|
-
import { z } from 'zod';
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
// Content generators
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
const generatePackageJson = (name) => {
|
|
14
|
-
const deps = {
|
|
15
|
-
'@ontrails/core': 'workspace:*',
|
|
16
|
-
zod: '^4.0.0',
|
|
17
|
-
};
|
|
18
|
-
const pkg = {
|
|
19
|
-
dependencies: Object.fromEntries(Object.entries(deps).toSorted(([a], [b]) => a.localeCompare(b))),
|
|
20
|
-
name,
|
|
21
|
-
scripts: {
|
|
22
|
-
build: 'tsc -b',
|
|
23
|
-
lint: 'oxlint ./src',
|
|
24
|
-
test: 'bun test',
|
|
25
|
-
typecheck: 'tsc --noEmit',
|
|
26
|
-
},
|
|
27
|
-
type: 'module',
|
|
28
|
-
version: '0.1.0',
|
|
29
|
-
};
|
|
30
|
-
return JSON.stringify(pkg, null, 2);
|
|
31
|
-
};
|
|
32
|
-
const TSCONFIG_CONTENT = JSON.stringify({
|
|
33
|
-
compilerOptions: {
|
|
34
|
-
declaration: true,
|
|
35
|
-
module: 'ESNext',
|
|
36
|
-
moduleResolution: 'bundler',
|
|
37
|
-
noUncheckedIndexedAccess: true,
|
|
38
|
-
outDir: 'dist',
|
|
39
|
-
rootDir: 'src',
|
|
40
|
-
skipLibCheck: true,
|
|
41
|
-
strict: true,
|
|
42
|
-
target: 'ESNext',
|
|
43
|
-
verbatimModuleSyntax: true,
|
|
44
|
-
},
|
|
45
|
-
include: ['src'],
|
|
46
|
-
}, null, 2);
|
|
47
|
-
const GITIGNORE_CONTENT = `node_modules/
|
|
48
|
-
dist/
|
|
49
|
-
*.tsbuildinfo
|
|
50
|
-
.trails/_surface.json
|
|
51
|
-
`;
|
|
52
|
-
const OXLINTRC_CONTENT = JSON.stringify({
|
|
53
|
-
extends: ['ultracite'],
|
|
54
|
-
}, null, 2);
|
|
55
|
-
const OXFMTRC_CONTENT = `{
|
|
56
|
-
// ultracite defaults
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
const generateHelloTrail = () => `import { Result, trail } from '@ontrails/core';
|
|
60
|
-
import { z } from 'zod';
|
|
61
|
-
|
|
62
|
-
export const hello = trail('hello', {
|
|
63
|
-
description: 'Say hello',
|
|
64
|
-
examples: [
|
|
65
|
-
{
|
|
66
|
-
expected: { message: 'Hello, world!' },
|
|
67
|
-
input: {},
|
|
68
|
-
name: 'Default greeting',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
expected: { message: 'Hello, Trails!' },
|
|
72
|
-
input: { name: 'Trails' },
|
|
73
|
-
name: 'Named greeting',
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
implementation: (input) => {
|
|
77
|
-
const name = input.name ?? 'world';
|
|
78
|
-
return Result.ok({ message: \`Hello, \${name}!\` });
|
|
79
|
-
},
|
|
80
|
-
input: z.object({
|
|
81
|
-
name: z.string().optional(),
|
|
82
|
-
}),
|
|
83
|
-
output: z.object({
|
|
84
|
-
message: z.string(),
|
|
85
|
-
}),
|
|
86
|
-
readOnly: true,
|
|
87
|
-
});
|
|
88
|
-
`;
|
|
89
|
-
const generateEntityTrails = () => `import { Result, trail } from '@ontrails/core';
|
|
90
|
-
import { z } from 'zod';
|
|
91
|
-
|
|
92
|
-
const entitySchema = z.object({
|
|
93
|
-
id: z.string(),
|
|
94
|
-
name: z.string(),
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
export const show = trail('entity.show', {
|
|
98
|
-
description: 'Show an entity by ID',
|
|
99
|
-
examples: [
|
|
100
|
-
{
|
|
101
|
-
expected: { id: '1', name: 'Example' },
|
|
102
|
-
input: { id: '1' },
|
|
103
|
-
name: 'Show entity',
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
implementation: (input) => {
|
|
107
|
-
return Result.ok({ id: input.id, name: 'Example' });
|
|
108
|
-
},
|
|
109
|
-
input: z.object({ id: z.string() }),
|
|
110
|
-
output: entitySchema,
|
|
111
|
-
readOnly: true,
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
export const add = trail('entity.add', {
|
|
115
|
-
description: 'Add a new entity',
|
|
116
|
-
examples: [
|
|
117
|
-
{
|
|
118
|
-
expected: { id: '1', name: 'New' },
|
|
119
|
-
input: { name: 'New' },
|
|
120
|
-
name: 'Add entity',
|
|
121
|
-
},
|
|
122
|
-
],
|
|
123
|
-
implementation: (input) => {
|
|
124
|
-
return Result.ok({ id: '1', name: input.name });
|
|
125
|
-
},
|
|
126
|
-
input: z.object({ name: z.string() }),
|
|
127
|
-
output: entitySchema,
|
|
128
|
-
});
|
|
129
|
-
`;
|
|
130
|
-
const generateSearchTrail = () => `import { Result, trail } from '@ontrails/core';
|
|
131
|
-
import { z } from 'zod';
|
|
132
|
-
|
|
133
|
-
export const search = trail('search', {
|
|
134
|
-
description: 'Search entities by query',
|
|
135
|
-
examples: [
|
|
136
|
-
{
|
|
137
|
-
expected: { results: [] },
|
|
138
|
-
input: { query: 'test' },
|
|
139
|
-
name: 'Search entities',
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
implementation: () => {
|
|
143
|
-
return Result.ok({ results: [] });
|
|
144
|
-
},
|
|
145
|
-
input: z.object({ query: z.string() }),
|
|
146
|
-
output: z.object({
|
|
147
|
-
results: z.array(z.object({ id: z.string(), name: z.string() })),
|
|
148
|
-
}),
|
|
149
|
-
readOnly: true,
|
|
150
|
-
});
|
|
151
|
-
`;
|
|
152
|
-
const generateOnboardHike = () => `import { Result, hike } from '@ontrails/core';
|
|
153
|
-
import { z } from 'zod';
|
|
154
|
-
|
|
155
|
-
export const onboard = hike('entity.onboard', {
|
|
156
|
-
description: 'Onboard a new entity end-to-end',
|
|
157
|
-
follows: ['entity.add'],
|
|
158
|
-
implementation: async (input, ctx) => {
|
|
159
|
-
const result = await ctx.follow('entity.add', { name: input.name });
|
|
160
|
-
if (result.isErr()) {
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
|
-
return Result.ok({ onboarded: true });
|
|
164
|
-
},
|
|
165
|
-
input: z.object({ name: z.string() }),
|
|
166
|
-
output: z.object({ onboarded: z.boolean() }),
|
|
167
|
-
});
|
|
168
|
-
`;
|
|
169
|
-
const generateEntityEvents = () => `import { event } from '@ontrails/core';
|
|
170
|
-
import { z } from 'zod';
|
|
171
|
-
|
|
172
|
-
export const entityUpdated = event('entity.updated', {
|
|
173
|
-
description: 'Fired when an entity is updated',
|
|
174
|
-
payload: z.object({
|
|
175
|
-
entityId: z.string(),
|
|
176
|
-
updatedAt: z.string(),
|
|
177
|
-
}),
|
|
178
|
-
});
|
|
179
|
-
`;
|
|
180
|
-
const generateStore = () => `/** In-memory store for entities. */
|
|
181
|
-
|
|
182
|
-
interface Entity {
|
|
183
|
-
readonly id: string;
|
|
184
|
-
readonly name: string;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const store = new Map<string, Entity>();
|
|
188
|
-
|
|
189
|
-
export const getEntity = (id: string): Entity | undefined => store.get(id);
|
|
190
|
-
export const addEntity = (entity: Entity): void => {
|
|
191
|
-
store.set(entity.id, entity);
|
|
192
|
-
};
|
|
193
|
-
export const deleteEntity = (id: string): boolean => store.delete(id);
|
|
194
|
-
export const listEntities = (): Entity[] => Array.from(store.values());
|
|
195
|
-
`;
|
|
196
|
-
const starterImports = {
|
|
197
|
-
empty: { imports: [], modules: [] },
|
|
198
|
-
entity: {
|
|
199
|
-
imports: [
|
|
200
|
-
"import * as entity from './trails/entity.js';",
|
|
201
|
-
"import * as search from './trails/search.js';",
|
|
202
|
-
"import * as onboard from './trails/onboard.js';",
|
|
203
|
-
"import * as entityEvents from './events/entity-events.js';",
|
|
204
|
-
],
|
|
205
|
-
modules: ['entity', 'search', 'onboard', 'entityEvents'],
|
|
206
|
-
},
|
|
207
|
-
hello: {
|
|
208
|
-
imports: ["import * as hello from './trails/hello.js';"],
|
|
209
|
-
modules: ['hello'],
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
const generateAppTs = (name, starter) => {
|
|
213
|
-
const { imports, modules } = starterImports[starter];
|
|
214
|
-
const topoArgs = modules.length > 0 ? `'${name}', ${modules.join(', ')}` : `'${name}'`;
|
|
215
|
-
return [
|
|
216
|
-
"import { topo } from '@ontrails/core';",
|
|
217
|
-
...imports,
|
|
218
|
-
'',
|
|
219
|
-
`export const app = topo(${topoArgs});`,
|
|
220
|
-
'',
|
|
221
|
-
].join('\n');
|
|
222
|
-
};
|
|
223
|
-
// ---------------------------------------------------------------------------
|
|
224
|
-
// File collection and writing
|
|
225
|
-
// ---------------------------------------------------------------------------
|
|
226
|
-
const starterFileGenerators = {
|
|
227
|
-
empty: () => [['src/trails/.gitkeep', '']],
|
|
228
|
-
entity: () => [
|
|
229
|
-
['src/trails/entity.ts', generateEntityTrails()],
|
|
230
|
-
['src/trails/search.ts', generateSearchTrail()],
|
|
231
|
-
['src/trails/onboard.ts', generateOnboardHike()],
|
|
232
|
-
['src/events/entity-events.ts', generateEntityEvents()],
|
|
233
|
-
['src/store.ts', generateStore()],
|
|
234
|
-
],
|
|
235
|
-
hello: () => [['src/trails/hello.ts', generateHelloTrail()]],
|
|
236
|
-
};
|
|
237
|
-
const collectScaffoldFiles = (name, starter) => new Map([
|
|
238
|
-
['package.json', generatePackageJson(name)],
|
|
239
|
-
['tsconfig.json', TSCONFIG_CONTENT],
|
|
240
|
-
['.gitignore', GITIGNORE_CONTENT],
|
|
241
|
-
['.oxlintrc.json', OXLINTRC_CONTENT],
|
|
242
|
-
['.oxfmtrc.jsonc', OXFMTRC_CONTENT],
|
|
243
|
-
['src/app.ts', generateAppTs(name, starter)],
|
|
244
|
-
...starterFileGenerators[starter](),
|
|
245
|
-
]);
|
|
246
|
-
const writeScaffoldFiles = async (projectDir, fileMap) => {
|
|
247
|
-
const files = [];
|
|
248
|
-
for (const [relativePath, content] of fileMap) {
|
|
249
|
-
const fullPath = join(projectDir, relativePath);
|
|
250
|
-
mkdirSync(dirname(fullPath), { recursive: true });
|
|
251
|
-
await Bun.write(fullPath, content);
|
|
252
|
-
files.push(relativePath);
|
|
253
|
-
}
|
|
254
|
-
return files;
|
|
255
|
-
};
|
|
256
|
-
// ---------------------------------------------------------------------------
|
|
257
|
-
// Trail definition
|
|
258
|
-
// ---------------------------------------------------------------------------
|
|
259
|
-
export const createScaffold = trail('create.scaffold', {
|
|
260
|
-
description: 'Scaffold a new Trails project',
|
|
261
|
-
implementation: async (input) => {
|
|
262
|
-
const projectDir = resolve(input.dir ?? '.', input.name);
|
|
263
|
-
const starter = (input.starter ?? 'hello');
|
|
264
|
-
const fileMap = collectScaffoldFiles(input.name, starter);
|
|
265
|
-
const files = await writeScaffoldFiles(projectDir, fileMap);
|
|
266
|
-
mkdirSync(join(projectDir, '.trails'), { recursive: true });
|
|
267
|
-
return Result.ok({
|
|
268
|
-
created: files,
|
|
269
|
-
dir: projectDir,
|
|
270
|
-
name: input.name,
|
|
271
|
-
});
|
|
272
|
-
},
|
|
273
|
-
input: z.object({
|
|
274
|
-
dir: z.string().optional().describe('Parent directory'),
|
|
275
|
-
name: z.string().describe('Project name'),
|
|
276
|
-
starter: z
|
|
277
|
-
.enum(['hello', 'entity', 'empty'])
|
|
278
|
-
.default('hello')
|
|
279
|
-
.describe('Starter trail'),
|
|
280
|
-
}),
|
|
281
|
-
markers: { internal: true },
|
|
282
|
-
output: z.object({
|
|
283
|
-
created: z.array(z.string()),
|
|
284
|
-
dir: z.string(),
|
|
285
|
-
name: z.string(),
|
|
286
|
-
}),
|
|
287
|
-
});
|
|
288
|
-
//# sourceMappingURL=create-scaffold.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-scaffold.js","sourceRoot":"","sources":["../../../src/trails/create-scaffold.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAU,EAAE;IACnD,MAAM,IAAI,GAA2B;QACnC,gBAAgB,EAAE,aAAa;QAC/B,GAAG,EAAE,QAAQ;KACd,CAAC;IAEF,MAAM,GAAG,GAA4B;QACnC,YAAY,EAAE,MAAM,CAAC,WAAW,CAC9B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAChE;QACD,IAAI;QACJ,OAAO,EAAE;YACP,KAAK,EAAE,QA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AC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `create` route -- Create a new Trails project.
|
|
3
|
-
*
|
|
4
|
-
* Composes create.scaffold, add.surface, and add.verify sub-trails
|
|
5
|
-
* via ctx.follow().
|
|
6
|
-
*/
|
|
7
|
-
type Starter = 'empty' | 'entity' | 'hello';
|
|
8
|
-
type Surface = 'cli' | 'mcp';
|
|
9
|
-
interface BlazeInput {
|
|
10
|
-
readonly dir?: string | undefined;
|
|
11
|
-
readonly name: string;
|
|
12
|
-
readonly starter: Starter;
|
|
13
|
-
readonly surfaces: readonly Surface[];
|
|
14
|
-
readonly verify: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare const createRoute: import("@ontrails/core").Hike<BlazeInput, {
|
|
17
|
-
created: string[];
|
|
18
|
-
dir: string;
|
|
19
|
-
name: string;
|
|
20
|
-
}>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/trails/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,KAAK,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC5C,KAAK,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;AAE7B,UAAU,UAAU;IAClB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AA4HD,eAAO,MAAM,WAAW;aAnCK,MAAM,EAAE;SAAO,MAAM;UAAQ,MAAM;EAyF9D,CAAC"}
|