@sdxc/kit 0.0.0-pre.1 → 0.0.0-stage
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/README.md +2 -92
- package/package.json +5 -44
- package/LICENSE.md +0 -21
- package/config.schema.json +0 -89
- package/dist/bin.d.ts +0 -9
- package/dist/bin.js +0 -10
- package/dist/cli.d.ts +0 -33
- package/dist/cli.js +0 -58
- package/dist/commands/create.d.ts +0 -20
- package/dist/commands/create.js +0 -164
- package/dist/commands/init.d.ts +0 -16
- package/dist/commands/init.js +0 -27
- package/dist/commands/make.d.ts +0 -335
- package/dist/commands/make.js +0 -152
- package/dist/commands/run.d.ts +0 -23
- package/dist/commands/run.js +0 -51
- package/dist/commands/ui/add.d.ts +0 -23
- package/dist/commands/ui/add.js +0 -50
- package/dist/commands/ui/diff.d.ts +0 -20
- package/dist/commands/ui/diff.js +0 -28
- package/dist/commands/ui/list.d.ts +0 -24
- package/dist/commands/ui/list.js +0 -45
- package/dist/commands/ui/remove.d.ts +0 -22
- package/dist/commands/ui/remove.js +0 -48
- package/dist/commands/ui/update.d.ts +0 -23
- package/dist/commands/ui/update.js +0 -37
- package/dist/commands/upgrade.d.ts +0 -30
- package/dist/commands/upgrade.js +0 -184
- package/dist/config.d.ts +0 -81
- package/dist/config.js +0 -157
- package/dist/contract.d.ts +0 -161
- package/dist/contract.js +0 -308
- package/dist/create/github.d.ts +0 -63
- package/dist/create/github.js +0 -172
- package/dist/create/target.d.ts +0 -31
- package/dist/create/target.js +0 -56
- package/dist/create/templates.d.ts +0 -62
- package/dist/create/templates.js +0 -228
- package/dist/dependencies.d.ts +0 -34
- package/dist/dependencies.js +0 -76
- package/dist/diff.d.ts +0 -14
- package/dist/diff.js +0 -103
- package/dist/format.d.ts +0 -21
- package/dist/format.js +0 -40
- package/dist/init.d.ts +0 -38
- package/dist/init.js +0 -92
- package/dist/lock.d.ts +0 -74
- package/dist/lock.js +0 -214
- package/dist/make/declare.d.ts +0 -54
- package/dist/make/declare.js +0 -495
- package/dist/make/generate.d.ts +0 -56
- package/dist/make/generate.js +0 -139
- package/dist/make/imports.d.ts +0 -43
- package/dist/make/imports.js +0 -104
- package/dist/make/index.d.ts +0 -43
- package/dist/make/index.js +0 -136
- package/dist/make/kinds.d.ts +0 -39
- package/dist/make/kinds.js +0 -95
- package/dist/make/migrations.d.ts +0 -21
- package/dist/make/migrations.js +0 -48
- package/dist/make/names.d.ts +0 -31
- package/dist/make/names.js +0 -47
- package/dist/make/stubs.d.ts +0 -44
- package/dist/make/stubs.js +0 -89
- package/dist/middleware.d.ts +0 -44
- package/dist/middleware.js +0 -49
- package/dist/package-manager.d.ts +0 -41
- package/dist/package-manager.js +0 -80
- package/dist/project.d.ts +0 -19
- package/dist/project.js +0 -42
- package/dist/releases.d.ts +0 -40
- package/dist/releases.js +0 -110
- package/dist/testing.d.ts +0 -47
- package/dist/testing.js +0 -126
- package/dist/ui/commands.d.ts +0 -114
- package/dist/ui/commands.js +0 -432
- package/dist/ui/imports.d.ts +0 -46
- package/dist/ui/imports.js +0 -160
- package/dist/ui/layout.d.ts +0 -48
- package/dist/ui/layout.js +0 -138
- package/dist/ui/registry.d.ts +0 -58
- package/dist/ui/registry.js +0 -82
- package/dist/upgrade/changelog.d.ts +0 -50
- package/dist/upgrade/changelog.js +0 -69
- package/dist/upgrade/project.d.ts +0 -62
- package/dist/upgrade/project.js +0 -132
- package/dist/upgrade/prompt.d.ts +0 -51
- package/dist/upgrade/prompt.js +0 -227
- package/dist/upgrade/registry.d.ts +0 -33
- package/dist/upgrade/registry.js +0 -50
- package/lock.schema.json +0 -60
- package/stubs/command.stub +0 -12
- package/stubs/command.test.stub +0 -18
- package/stubs/controller.form.stub +0 -33
- package/stubs/controller.stub +0 -17
- package/stubs/controller.test.stub +0 -15
- package/stubs/email.stub +0 -44
- package/stubs/email.test.stub +0 -16
- package/stubs/factory.stub +0 -10
- package/stubs/initializer.stub +0 -7
- package/stubs/initializer.test.stub +0 -13
- package/stubs/job.cron.stub +0 -12
- package/stubs/job.stub +0 -11
- package/stubs/job.test.stub +0 -15
- package/stubs/mcp.resource.stub +0 -12
- package/stubs/mcp.stub +0 -10
- package/stubs/mcp.test.stub +0 -15
- package/stubs/middleware.stub +0 -11
- package/stubs/middleware.test.stub +0 -13
- package/stubs/migration.stub +0 -1
- package/stubs/model.stub +0 -24
- package/stubs/model.test.stub +0 -15
- package/stubs/policy.stub +0 -13
- package/stubs/policy.test.stub +0 -17
- package/stubs/service.stub +0 -13
- package/stubs/service.test.stub +0 -14
- package/stubs/validator.stub +0 -14
- package/stubs/validator.test.stub +0 -22
- package/templates/app/README.md +0 -57
- package/templates/app/app/commands/about.test.ts +0 -29
- package/templates/app/app/commands/about.ts +0 -34
- package/templates/app/app/commands/index.ts +0 -15
- package/templates/app/app/http/controllers/home.tsx +0 -22
- package/templates/app/app/http/controllers/not-found.tsx +0 -25
- package/templates/app/app/initializers/assets.ts +0 -11
- package/templates/app/app/initializers/cli.ts +0 -35
- package/templates/app/app/initializers/dispatcher.ts +0 -18
- package/templates/app/app/initializers/logger.ts +0 -10
- package/templates/app/app/initializers/mcp.ts +0 -16
- package/templates/app/app/initializers/router.tsx +0 -65
- package/templates/app/app/jobs/index.ts +0 -10
- package/templates/app/app/mcp/resources/index.ts +0 -9
- package/templates/app/app/mcp/tools/index.ts +0 -10
- package/templates/app/bootstrap/browser.ts +0 -27
- package/templates/app/bootstrap/cli.ts +0 -9
- package/templates/app/bootstrap/worker.ts +0 -31
- package/templates/app/cloudflare.config.ts +0 -28
- package/templates/app/config/router-context.d.ts +0 -20
- package/templates/app/gitignore +0 -9
- package/templates/app/package.json +0 -38
- package/templates/app/resources/layouts/document.tsx +0 -58
- package/templates/app/routes/web.ts +0 -12
- package/templates/app/tsconfig.json +0 -40
- package/templates/app/vite.config.ts +0 -40
package/dist/testing.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds a project from a built-in template the way a consumer's install would see it, for the
|
|
3
|
-
* tests that type check templates and generated code: dependencies are linked from this
|
|
4
|
-
* workspace instead of installed, and the Worker's types are generated as `cf:typegen` does.
|
|
5
|
-
*
|
|
6
|
-
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
-
* @copyright Sergio Xalambrí 2026
|
|
8
|
-
*/
|
|
9
|
-
import type { Result } from "@sdxc/result";
|
|
10
|
-
/** What a spawned command printed and how it exited. */
|
|
11
|
-
export interface Spawned {
|
|
12
|
-
code: number | null;
|
|
13
|
-
output: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Creates `template` as the project `name` inside a fresh temporary directory and links every
|
|
17
|
-
* dependency its `package.json` lists: an `@sdxc/*` package to its workspace directory, anything
|
|
18
|
-
* else to the copy this workspace installed. `sdxc create` reads the npm registry, so the caller
|
|
19
|
-
* answers it, as {@link registryDocument} does. Answers the project directory; the caller removes
|
|
20
|
-
* its parent.
|
|
21
|
-
*/
|
|
22
|
-
export declare function materialize(template: string, name?: string): Promise<Result<string, Error>>;
|
|
23
|
-
/**
|
|
24
|
-
* Links every dependency the project's `package.json` lists and `node_modules` lacks: an
|
|
25
|
-
* `@sdxc/*` package to its workspace directory, anything else to the copy this workspace
|
|
26
|
-
* installed, so a package `sdxc make` added resolves as an install would make it.
|
|
27
|
-
*/
|
|
28
|
-
export declare function linkDependencies(project: string): Promise<Result<void, Error>>;
|
|
29
|
-
/**
|
|
30
|
-
* The npm registry document a test answers for `name` (`/@sdxc%2fjobs`, say): `versions` each
|
|
31
|
-
* published with `remix` 3.0.0 as a peer, and `latest` the newest of them.
|
|
32
|
-
*
|
|
33
|
-
* @example http.get(`${REGISTRY}/*`, ({ request }) => HttpResponse.json(registryDocument(new URL(request.url).pathname.slice(1))))
|
|
34
|
-
*/
|
|
35
|
-
export declare function registryDocument(name: string, versions?: readonly string[]): Record<string, unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* Links what `package.json` gained since, generates the Worker's types with the project's own
|
|
38
|
-
* `cf`, then type checks the project with the workspace's TypeScript, answering what it printed.
|
|
39
|
-
*/
|
|
40
|
-
export declare function typecheck(project: string): Promise<Spawned>;
|
|
41
|
-
/**
|
|
42
|
-
* Runs the project's own command line, `bootstrap/cli.ts`, under Bun with `argv`, as
|
|
43
|
-
* `bun run cli` and `sdxc run` start it, answering both output streams together.
|
|
44
|
-
*/
|
|
45
|
-
export declare function runCommandLine(project: string, argv: string[]): Promise<Spawned>;
|
|
46
|
-
/** Runs the project's own tests with its own Vite+, as `vp test run` inside it does. */
|
|
47
|
-
export declare function testProject(project: string): Promise<Spawned>;
|
package/dist/testing.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Builds a project from a built-in template the way a consumer's install would see it, for the
|
|
3
|
-
* tests that type check templates and generated code: dependencies are linked from this
|
|
4
|
-
* workspace instead of installed, and the Worker's types are generated as `cf:typegen` does.
|
|
5
|
-
*
|
|
6
|
-
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
-
* @copyright Sergio Xalambrí 2026
|
|
8
|
-
*/
|
|
9
|
-
import { spawn } from "node:child_process";
|
|
10
|
-
import { access, lstat, mkdir, mkdtemp, readFile, symlink } from "node:fs/promises";
|
|
11
|
-
import { tmpdir } from "node:os";
|
|
12
|
-
import { dirname, join } from "node:path";
|
|
13
|
-
import { invoke } from "@sdxc/cli/test";
|
|
14
|
-
import { failure, isFailure, isSuccess, success, wrap } from "@sdxc/result";
|
|
15
|
-
import { createSDXC } from "./cli.js";
|
|
16
|
-
import { defaultPackageRoot } from "./create/templates.js";
|
|
17
|
-
/**
|
|
18
|
-
* Creates `template` as the project `name` inside a fresh temporary directory and links every
|
|
19
|
-
* dependency its `package.json` lists: an `@sdxc/*` package to its workspace directory, anything
|
|
20
|
-
* else to the copy this workspace installed. `sdxc create` reads the npm registry, so the caller
|
|
21
|
-
* answers it, as {@link registryDocument} does. Answers the project directory; the caller removes
|
|
22
|
-
* its parent.
|
|
23
|
-
*/
|
|
24
|
-
export async function materialize(template, name = "app") {
|
|
25
|
-
let parent = await mkdtemp(join(tmpdir(), "sdxc-template-"));
|
|
26
|
-
let created = await invoke(createSDXC(), ["create", name, "--template", template, "--no-git"], {
|
|
27
|
-
cwd: parent,
|
|
28
|
-
interactive: false,
|
|
29
|
-
});
|
|
30
|
-
if (created.code !== 0) {
|
|
31
|
-
return failure(new Error(`sdxc create exited with ${created.code}: ${created.stderr}`));
|
|
32
|
-
}
|
|
33
|
-
let project = join(parent, name);
|
|
34
|
-
let linked = await linkDependencies(project);
|
|
35
|
-
if (isFailure(linked))
|
|
36
|
-
return linked;
|
|
37
|
-
return success(project);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Links every dependency the project's `package.json` lists and `node_modules` lacks: an
|
|
41
|
-
* `@sdxc/*` package to its workspace directory, anything else to the copy this workspace
|
|
42
|
-
* installed, so a package `sdxc make` added resolves as an install would make it.
|
|
43
|
-
*/
|
|
44
|
-
export async function linkDependencies(project) {
|
|
45
|
-
let packageRoot = defaultPackageRoot();
|
|
46
|
-
let manifest = JSON.parse(await readFile(join(project, "package.json"), "utf8"));
|
|
47
|
-
let names = Object.keys({ ...manifest.dependencies, ...manifest.devDependencies });
|
|
48
|
-
for (let dependency of names) {
|
|
49
|
-
let link = join(project, "node_modules", dependency);
|
|
50
|
-
if (isSuccess(await wrap(() => lstat(link))))
|
|
51
|
-
continue;
|
|
52
|
-
let source = dependency.startsWith("@sdxc/")
|
|
53
|
-
? success(join(packageRoot, "..", dependency.slice("@sdxc/".length)))
|
|
54
|
-
: await installed(packageRoot, dependency);
|
|
55
|
-
if (isFailure(source))
|
|
56
|
-
return source;
|
|
57
|
-
await mkdir(dirname(link), { recursive: true });
|
|
58
|
-
await symlink(source.data, link, "dir");
|
|
59
|
-
}
|
|
60
|
-
return success(undefined);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The npm registry document a test answers for `name` (`/@sdxc%2fjobs`, say): `versions` each
|
|
64
|
-
* published with `remix` 3.0.0 as a peer, and `latest` the newest of them.
|
|
65
|
-
*
|
|
66
|
-
* @example http.get(`${REGISTRY}/*`, ({ request }) => HttpResponse.json(registryDocument(new URL(request.url).pathname.slice(1))))
|
|
67
|
-
*/
|
|
68
|
-
export function registryDocument(name, versions = ["0.0.1"]) {
|
|
69
|
-
return {
|
|
70
|
-
name: decodeURIComponent(name),
|
|
71
|
-
"dist-tags": { latest: versions.at(-1) },
|
|
72
|
-
versions: Object.fromEntries(versions.map((version) => [version, { version, peerDependencies: { remix: "3.0.0" } }])),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Links what `package.json` gained since, generates the Worker's types with the project's own
|
|
77
|
-
* `cf`, then type checks the project with the workspace's TypeScript, answering what it printed.
|
|
78
|
-
*/
|
|
79
|
-
export async function typecheck(project) {
|
|
80
|
-
let linked = await linkDependencies(project);
|
|
81
|
-
if (isFailure(linked))
|
|
82
|
-
return { code: null, output: linked.error.message };
|
|
83
|
-
let types = await run([join(project, "node_modules/cf/bin/cf"), "workers", "types"], project);
|
|
84
|
-
if (types.code !== 0)
|
|
85
|
-
return types;
|
|
86
|
-
return run([join(project, "node_modules/typescript/bin/tsc"), "--noEmit", "-p", project], project);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Runs the project's own command line, `bootstrap/cli.ts`, under Bun with `argv`, as
|
|
90
|
-
* `bun run cli` and `sdxc run` start it, answering both output streams together.
|
|
91
|
-
*/
|
|
92
|
-
export function runCommandLine(project, argv) {
|
|
93
|
-
return run(["bootstrap/cli.ts", ...argv], project, "bun");
|
|
94
|
-
}
|
|
95
|
-
/** Runs the project's own tests with its own Vite+, as `vp test run` inside it does. */
|
|
96
|
-
export function testProject(project) {
|
|
97
|
-
return run([join(project, "node_modules/vite-plus/bin/vp"), "test", "run"], project);
|
|
98
|
-
}
|
|
99
|
-
/** The directory `dependency` is installed at for this package or, failing that, the workspace. */
|
|
100
|
-
async function installed(packageRoot, dependency) {
|
|
101
|
-
let candidates = [
|
|
102
|
-
join(packageRoot, "node_modules", dependency),
|
|
103
|
-
join(packageRoot, "../../node_modules", dependency),
|
|
104
|
-
];
|
|
105
|
-
for (let candidate of candidates) {
|
|
106
|
-
if (isSuccess(await wrap(() => access(join(candidate, "package.json"))))) {
|
|
107
|
-
return success(candidate);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return failure(new Error(`${dependency} is not installed in this workspace; add it to @sdxc/kit's devDependencies`));
|
|
111
|
-
}
|
|
112
|
-
/** Runs a script with `args` in `cwd` under `runtime`, Node by default, collecting both output streams. */
|
|
113
|
-
function run(args, cwd, runtime = process.execPath) {
|
|
114
|
-
return new Promise((settle) => {
|
|
115
|
-
let output = "";
|
|
116
|
-
let child = spawn(runtime, args, { cwd, shell: false });
|
|
117
|
-
child.stdout.on("data", (chunk) => {
|
|
118
|
-
output += chunk.toString();
|
|
119
|
-
});
|
|
120
|
-
child.stderr.on("data", (chunk) => {
|
|
121
|
-
output += chunk.toString();
|
|
122
|
-
});
|
|
123
|
-
child.once("error", (error) => settle({ code: null, output: error.message }));
|
|
124
|
-
child.once("close", (code) => settle({ code, output }));
|
|
125
|
-
});
|
|
126
|
-
}
|
package/dist/ui/commands.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What each `sdxc ui` command does, as plans over the project: `add`, `update` and `remove`
|
|
3
|
-
* answer every file they would write, edit or delete and the lock entries they would record,
|
|
4
|
-
* so `--dry-run` prints exactly what applying the same plan writes.
|
|
5
|
-
*
|
|
6
|
-
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
-
* @copyright Sergio Xalambrí 2026
|
|
8
|
-
*/
|
|
9
|
-
import type { AnyCommandContext } from "@sdxc/cli";
|
|
10
|
-
import type { Result } from "@sdxc/result";
|
|
11
|
-
import type { Config } from "../config.js";
|
|
12
|
-
import type { Lock } from "../lock.js";
|
|
13
|
-
import type { CopyLayout } from "./layout.js";
|
|
14
|
-
import type { Registry } from "./registry.js";
|
|
15
|
-
/** Everything a `ui` command reads before it plans. */
|
|
16
|
-
export interface UIContext {
|
|
17
|
-
root: string;
|
|
18
|
-
config: Config;
|
|
19
|
-
registry: Registry;
|
|
20
|
-
lock: Lock;
|
|
21
|
-
layout: CopyLayout;
|
|
22
|
-
}
|
|
23
|
-
/** One file a plan touches, relative to the project root; `after: null` deletes it. */
|
|
24
|
-
export interface FileChange {
|
|
25
|
-
before: string | null;
|
|
26
|
-
after: string | null;
|
|
27
|
-
}
|
|
28
|
-
/** A lock entry to record once its files are written. */
|
|
29
|
-
export interface PendingEntry {
|
|
30
|
-
name: string;
|
|
31
|
-
release: string;
|
|
32
|
-
/** Each file relative to `ui.directory`: a hash to keep, or `null` to hash once written. */
|
|
33
|
-
files: Record<string, string | null>;
|
|
34
|
-
}
|
|
35
|
-
/** What `add`, `update` or `remove` would change. */
|
|
36
|
-
export interface Plan {
|
|
37
|
-
files: Map<string, FileChange>;
|
|
38
|
-
record: PendingEntry[];
|
|
39
|
-
forget: string[];
|
|
40
|
-
/** Lines for the user: what the command did, and what it left for them to do. */
|
|
41
|
-
report: string[];
|
|
42
|
-
}
|
|
43
|
-
/** One row of `sdxc ui list`. */
|
|
44
|
-
export interface ListRow {
|
|
45
|
-
name: string;
|
|
46
|
-
/** The release whose commits last touched it, or `null` for a copy the registry lacks. */
|
|
47
|
-
changedIn: string | null;
|
|
48
|
-
copy: {
|
|
49
|
-
release: string;
|
|
50
|
-
edited: boolean;
|
|
51
|
-
behind: boolean;
|
|
52
|
-
} | null;
|
|
53
|
-
}
|
|
54
|
-
/** What a `ui` command's handler runs with: its context, and its prompts, tasks and processes. */
|
|
55
|
-
export type UICommandContext = Pick<AnyCommandContext, "exec" | "task" | "stdout" | "stderr">;
|
|
56
|
-
/**
|
|
57
|
-
* Reads the installed registry, the lock file and the copies' layout of the project at `root`.
|
|
58
|
-
*
|
|
59
|
-
* @param packageRoot - The `@sdxc/kit` package holding the registry.
|
|
60
|
-
*/
|
|
61
|
-
export declare function loadContext(project: {
|
|
62
|
-
root: string;
|
|
63
|
-
config: Config;
|
|
64
|
-
}, packageRoot: string): Promise<Result<UIContext, Error>>;
|
|
65
|
-
/** The hash a lock entry records for a file's content: SHA-256, base64, `sha256-` prefixed. */
|
|
66
|
-
export declare function hashContent(content: string): string;
|
|
67
|
-
/**
|
|
68
|
-
* Every component in the registry, and every copy the registry no longer holds, sorted by
|
|
69
|
-
* name. A copy is edited when a file it recorded is missing or hashes differently, and behind
|
|
70
|
-
* when the component changed in a release after the one it came from.
|
|
71
|
-
*/
|
|
72
|
-
export declare function listComponents(context: UIContext): Promise<ListRow[]>;
|
|
73
|
-
/**
|
|
74
|
-
* Copies `names` (and, with `withDeps`, every component they reach) into `ui.directory`, with
|
|
75
|
-
* their tests under `ui.tests`, and points every project file's imports of them at the copies.
|
|
76
|
-
* A component already copied is reported and left alone; a file in the way stops the plan.
|
|
77
|
-
*/
|
|
78
|
-
export declare function planAdd(context: UIContext, names: readonly string[], options: {
|
|
79
|
-
withDeps: boolean;
|
|
80
|
-
}): Promise<Result<Plan, Error>>;
|
|
81
|
-
/**
|
|
82
|
-
* The difference between the copy of `name` and the installed version, as a unified diff from
|
|
83
|
-
* the installed file to the local one, or an empty string when they match.
|
|
84
|
-
*/
|
|
85
|
-
export declare function diffComponent(context: UIContext, name: string): Promise<Result<string, Error>>;
|
|
86
|
-
/**
|
|
87
|
-
* Replaces each file of each copy whose hash still matches the lock with the installed version.
|
|
88
|
-
* An edited file is replaced only when `overwrite` answers yes for it, and otherwise left alone
|
|
89
|
-
* and reported; the entry moves to the installed release only when every file was replaced.
|
|
90
|
-
*/
|
|
91
|
-
export declare function planUpdate(context: UIContext, names: readonly string[], options: {
|
|
92
|
-
overwrite: (path: string) => Promise<Result<boolean, Error>>;
|
|
93
|
-
}): Promise<Result<Plan, Error>>;
|
|
94
|
-
/**
|
|
95
|
-
* Deletes the copies of `names`, drops their lock entries and points every project file's
|
|
96
|
-
* imports of them back at `@sdxc/ui/<name>`, folded into an existing `@sdxc/ui` import.
|
|
97
|
-
*/
|
|
98
|
-
export declare function planRemove(context: UIContext, names: readonly string[]): Promise<Result<Plan, Error>>;
|
|
99
|
-
/**
|
|
100
|
-
* Writes and deletes the plan's files as a task counting each one, runs `format` over what it
|
|
101
|
-
* wrote, then records the lock entries with each new file hashed as it ended up. A failed
|
|
102
|
-
* `format` is reported, and the hashes are then of the files as written.
|
|
103
|
-
*/
|
|
104
|
-
export declare function applyPlan(ctx: UICommandContext, context: UIContext, plan: Plan): Promise<Result<string[], Error>>;
|
|
105
|
-
/**
|
|
106
|
-
* Lists the `@sdxc/*` packages the plan's files import in `package.json`, then prints the plan's
|
|
107
|
-
* diff on stdout and its report on stderr under `--dry-run`, or applies it and prints its report.
|
|
108
|
-
*/
|
|
109
|
-
export declare function finishPlan(ctx: UICommandContext, context: UIContext, plan: Plan, dryRun: boolean): Promise<Result<void, Error>>;
|
|
110
|
-
/**
|
|
111
|
-
* The diff of every file the plan touches and of the lock file, which is what applying it
|
|
112
|
-
* writes before `format` runs; the lock's hashes are of the files as the CLI writes them.
|
|
113
|
-
*/
|
|
114
|
-
export declare function renderPlan(context: UIContext, plan: Plan): Promise<Result<string, Error>>;
|