@decohere/forge 0.0.1-dev.13 → 0.0.1-dev.130
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/LICENSE +15 -0
- package/README.md +150 -0
- package/commonjs/src/actions/build.action.js +8 -6
- package/commonjs/src/actions/clean.action.js +6 -8
- package/commonjs/src/actions/commit.action.js +4 -6
- package/commonjs/src/actions/copy.action.js +62 -12
- package/commonjs/src/actions/dependency-report.action.js +8 -6
- package/commonjs/src/actions/dependency-sync.action.js +9 -5
- package/commonjs/src/actions/docker.action.js +209 -0
- package/commonjs/src/actions/index.js +6 -2
- package/commonjs/src/actions/link.action.js +154 -0
- package/commonjs/src/actions/package.action.js +234 -0
- package/commonjs/src/actions/paths.action.js +120 -0
- package/commonjs/src/actions/publish.action.js +4 -6
- package/commonjs/src/actions/sync-lock-file.action.js +2 -4
- package/commonjs/src/actions/tag.action.js +6 -9
- package/commonjs/src/actions/typecheck.action.js +67 -0
- package/commonjs/src/actions/unlink.action.js +74 -0
- package/commonjs/src/actions/version.action.js +14 -16
- package/commonjs/src/actions/watch.action.js +3 -5
- package/commonjs/src/commands/build.command.js +4 -3
- package/commonjs/src/commands/dependency.command.js +1 -3
- package/commonjs/src/commands/docker.command.js +26 -0
- package/commonjs/src/commands/forge.command.js +1 -3
- package/commonjs/src/commands/index.js +5 -2
- package/commonjs/src/commands/link.command.js +90 -0
- package/commonjs/src/commands/package.command.js +36 -0
- package/commonjs/src/commands/paths.command.js +24 -0
- package/commonjs/src/commands/publish.command.js +1 -3
- package/commonjs/src/commands/tag.command.js +1 -3
- package/commonjs/src/commands/typecheck.command.js +24 -0
- package/commonjs/src/commands/version.command.js +1 -3
- package/commonjs/src/const.js +0 -2
- package/commonjs/src/create-workspace.js +38 -0
- package/commonjs/src/errors.js +2 -4
- package/commonjs/src/extensions/project.extensions.js +11 -13
- package/commonjs/src/factories/swc-config.factory.js +29 -9
- package/commonjs/src/forge.module.js +23 -22
- package/commonjs/src/index.js +11 -2
- package/commonjs/src/packaging/dependency-pinner.service.js +118 -0
- package/commonjs/src/packaging/deployable.js +44 -0
- package/commonjs/src/packaging/import-graph.service.js +137 -0
- package/commonjs/src/packaging/release-exports.js +90 -0
- package/commonjs/src/packaging/ui-assets.js +75 -0
- package/commonjs/src/semver/index.js +18 -0
- package/commonjs/src/semver/semver.js +92 -0
- package/commonjs/src/services/dependency-resolver.service.js +70 -26
- package/commonjs/src/services/file-writer.service.js +2 -11
- package/commonjs/src/services/incremental-watch.js +24 -0
- package/commonjs/src/services/output-cache.js +39 -0
- package/commonjs/src/services/swc-transpiler.js +85 -99
- package/commonjs/src/services/transpile-cache.js +44 -0
- package/commonjs/src/services/ts-program-host.js +4 -6
- package/commonjs/src/services/type-emission-program.js +24 -9
- package/commonjs/src/services/type-emitter.js +51 -16
- package/commonjs/src/types/build-target.type.js +0 -2
- package/commonjs/src/types/configuration.type.js +0 -2
- package/commonjs/src/types/dependency.types.js +0 -2
- package/commonjs/src/types/swc-config.type.js +0 -2
- package/commonjs/src/types/transform-response.model.js +3 -18
- package/commonjs/src/types/transformer.type.js +0 -2
- package/commonjs/src/types/workspace-config.type.js +0 -2
- package/commonjs/src/vitest/forge-build.plugin.js +28 -44
- package/commonjs/src/vitest/index.js +0 -2
- package/commonjs/src/workspace.config.js +39 -6
- package/es6/src/actions/build.action.js +7 -7
- package/es6/src/actions/clean.action.js +5 -8
- package/es6/src/actions/commit.action.js +3 -6
- package/es6/src/actions/copy.action.js +61 -12
- package/es6/src/actions/dependency-report.action.js +7 -7
- package/es6/src/actions/dependency-sync.action.js +8 -6
- package/es6/src/actions/docker.action.js +194 -0
- package/es6/src/actions/index.js +6 -2
- package/es6/src/actions/link.action.js +128 -0
- package/es6/src/actions/package.action.js +219 -0
- package/es6/src/actions/paths.action.js +97 -0
- package/es6/src/actions/publish.action.js +3 -6
- package/es6/src/actions/sync-lock-file.action.js +2 -4
- package/es6/src/actions/tag.action.js +5 -9
- package/es6/src/actions/typecheck.action.js +52 -0
- package/es6/src/actions/unlink.action.js +59 -0
- package/es6/src/actions/version.action.js +9 -12
- package/es6/src/actions/watch.action.js +2 -5
- package/es6/src/commands/build.command.js +4 -3
- package/es6/src/commands/dependency.command.js +1 -3
- package/es6/src/commands/docker.command.js +16 -0
- package/es6/src/commands/forge.command.js +1 -3
- package/es6/src/commands/index.js +5 -2
- package/es6/src/commands/link.command.js +67 -0
- package/es6/src/commands/package.command.js +26 -0
- package/es6/src/commands/paths.command.js +14 -0
- package/es6/src/commands/publish.command.js +1 -3
- package/es6/src/commands/tag.command.js +1 -3
- package/es6/src/commands/typecheck.command.js +14 -0
- package/es6/src/commands/version.command.js +1 -3
- package/es6/src/const.js +0 -2
- package/es6/src/create-workspace.js +26 -0
- package/es6/src/errors.js +1 -3
- package/es6/src/extensions/project.extensions.js +5 -7
- package/es6/src/factories/swc-config.factory.js +29 -9
- package/es6/src/forge.module.js +23 -22
- package/es6/src/index.js +3 -3
- package/es6/src/packaging/dependency-pinner.service.js +103 -0
- package/es6/src/packaging/deployable.js +21 -0
- package/es6/src/packaging/import-graph.service.js +122 -0
- package/es6/src/packaging/release-exports.js +80 -0
- package/es6/src/packaging/ui-assets.js +49 -0
- package/es6/src/semver/index.js +1 -0
- package/es6/src/semver/semver.js +71 -0
- package/es6/src/services/dependency-resolver.service.js +70 -26
- package/es6/src/services/file-writer.service.js +2 -11
- package/es6/src/services/incremental-watch.js +18 -0
- package/es6/src/services/output-cache.js +29 -0
- package/es6/src/services/swc-transpiler.js +85 -99
- package/es6/src/services/transpile-cache.js +29 -0
- package/es6/src/services/ts-program-host.js +4 -6
- package/es6/src/services/type-emission-program.js +24 -9
- package/es6/src/services/type-emitter.js +48 -16
- package/es6/src/types/build-target.type.js +0 -2
- package/es6/src/types/configuration.type.js +0 -2
- package/es6/src/types/dependency.types.js +0 -2
- package/es6/src/types/swc-config.type.js +0 -2
- package/es6/src/types/transform-response.model.js +0 -7
- package/es6/src/types/transformer.type.js +0 -2
- package/es6/src/types/workspace-config.type.js +0 -2
- package/es6/src/vitest/forge-build.plugin.js +27 -43
- package/es6/src/vitest/index.js +0 -2
- package/es6/src/workspace.config.js +39 -5
- package/package.json +15 -5
- package/types/src/actions/build.action.d.ts +5 -4
- package/types/src/actions/clean.action.d.ts +3 -3
- package/types/src/actions/commit.action.d.ts +3 -3
- package/types/src/actions/copy.action.d.ts +18 -3
- package/types/src/actions/dependency-report.action.d.ts +3 -3
- package/types/src/actions/dependency-sync.action.d.ts +3 -3
- package/types/src/actions/docker.action.d.ts +38 -0
- package/types/src/actions/index.d.ts +6 -0
- package/types/src/actions/link.action.d.ts +25 -0
- package/types/src/actions/package.action.d.ts +38 -0
- package/types/src/actions/paths.action.d.ts +28 -0
- package/types/src/actions/publish.action.d.ts +4 -4
- package/types/src/actions/sync-lock-file.action.d.ts +2 -2
- package/types/src/actions/tag.action.d.ts +3 -3
- package/types/src/actions/typecheck.action.d.ts +14 -0
- package/types/src/actions/unlink.action.d.ts +9 -0
- package/types/src/actions/version.action.d.ts +4 -4
- package/types/src/actions/watch.action.d.ts +3 -3
- package/types/src/commands/build.command.d.ts +3 -2
- package/types/src/commands/dependency.command.d.ts +2 -2
- package/types/src/commands/docker.command.d.ts +6 -0
- package/types/src/commands/forge.command.d.ts +2 -2
- package/types/src/commands/index.d.ts +5 -0
- package/types/src/commands/link.command.d.ts +29 -0
- package/types/src/commands/package.command.d.ts +11 -0
- package/types/src/commands/paths.command.d.ts +6 -0
- package/types/src/commands/publish.command.d.ts +1 -1
- package/types/src/commands/tag.command.d.ts +1 -1
- package/types/src/commands/typecheck.command.d.ts +6 -0
- package/types/src/commands/version.command.d.ts +1 -1
- package/types/src/create-workspace.d.ts +7 -0
- package/types/src/errors.d.ts +1 -1
- package/types/src/extensions/project.extensions.d.ts +2 -2
- package/types/src/factories/swc-config.factory.d.ts +3 -2
- package/types/src/forge.module.d.ts +16 -4
- package/types/src/index.d.ts +3 -1
- package/types/src/packaging/dependency-pinner.service.d.ts +20 -0
- package/types/src/packaging/deployable.d.ts +17 -0
- package/types/src/packaging/import-graph.service.d.ts +33 -0
- package/types/src/packaging/release-exports.d.ts +18 -0
- package/types/src/packaging/ui-assets.d.ts +21 -0
- package/types/src/semver/index.d.ts +1 -0
- package/types/src/semver/semver.d.ts +18 -0
- package/types/src/services/dependency-resolver.service.d.ts +8 -1
- package/types/src/services/file-writer.service.d.ts +1 -2
- package/types/src/services/incremental-watch.d.ts +13 -0
- package/types/src/services/output-cache.d.ts +10 -0
- package/types/src/services/swc-transpiler.d.ts +28 -15
- package/types/src/services/transpile-cache.d.ts +17 -0
- package/types/src/services/ts-program-host.d.ts +2 -2
- package/types/src/services/type-emission-program.d.ts +8 -3
- package/types/src/services/type-emitter.d.ts +21 -8
- package/types/src/types/configuration.type.d.ts +6 -1
- package/types/src/types/dependency.types.d.ts +8 -9
- package/types/src/types/swc-config.type.d.ts +7 -1
- package/types/src/types/transform-response.model.d.ts +2 -7
- package/types/src/types/transformer.type.d.ts +2 -11
- package/types/src/types/workspace-config.type.d.ts +3 -3
- package/types/src/vitest/forge-build.plugin.d.ts +0 -2
- package/types/src/workspace.config.d.ts +6 -0
- package/commonjs/src/mixins/caches-outputs.mixin.js +0 -44
- package/commonjs/src/mixins/incremental-transform.mixin.js +0 -36
- package/es6/src/mixins/caches-outputs.mixin.js +0 -34
- package/es6/src/mixins/incremental-transform.mixin.js +0 -26
- package/types/src/mixins/caches-outputs.mixin.d.ts +0 -7
- package/types/src/mixins/incremental-transform.mixin.d.ts +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decohere/forge",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.130",
|
|
4
4
|
"description": "TypeScript monorepo build system — zero config, fast compilation, streamlined developer workflow",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
"swc",
|
|
11
11
|
"decohere"
|
|
12
12
|
],
|
|
13
|
+
"homepage": "https://github.com/typesmiths/decohere/tree/main/projects/forge#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/typesmiths/decohere/issues"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/typesmiths/decohere.git",
|
|
20
|
+
"directory": "projects/forge"
|
|
21
|
+
},
|
|
13
22
|
"license": "ISC",
|
|
14
23
|
"author": "Typesmiths",
|
|
15
24
|
"type": "module",
|
|
@@ -29,10 +38,11 @@
|
|
|
29
38
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
30
39
|
},
|
|
31
40
|
"dependencies": {
|
|
32
|
-
"@decohere/
|
|
33
|
-
"@decohere/
|
|
34
|
-
"@decohere/
|
|
35
|
-
"@decohere/scribe": "0.0.1-dev.
|
|
41
|
+
"@decohere/core": "0.0.1-dev.130",
|
|
42
|
+
"@decohere/crucible": "0.0.1-dev.130",
|
|
43
|
+
"@decohere/devkit": "0.0.1-dev.130",
|
|
44
|
+
"@decohere/scribe": "0.0.1-dev.130",
|
|
45
|
+
"@decohere/workspace": "0.0.1-dev.130",
|
|
36
46
|
"@swc/core": "^1.11.11",
|
|
37
47
|
"async": "^3.2.6",
|
|
38
48
|
"parse-imports": "^2.2.1",
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { Project } from "@decohere/
|
|
2
|
-
import { Workspace } from "@decohere/
|
|
3
|
-
import type { Action } from "@decohere/
|
|
4
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import type { Project } from "@decohere/workspace";
|
|
2
|
+
import { Workspace } from "@decohere/workspace";
|
|
3
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
4
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
5
5
|
import { FileWriterService } from "../services/file-writer.service.js";
|
|
6
6
|
import type { TransformResponse } from "../types/transform-response.model.js";
|
|
7
7
|
import { type Transformer } from "../types/transformer.type.js";
|
|
8
8
|
export type BuildOptions = {
|
|
9
|
+
build?: boolean;
|
|
9
10
|
configuration: string;
|
|
10
11
|
file: string;
|
|
11
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
export type CleanOptions = {
|
|
5
5
|
clean: boolean;
|
|
6
6
|
configuration: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
export type CommitFilesOptions = {
|
|
5
5
|
configuration?: string;
|
|
6
6
|
commit?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
export type CopyOptions = {
|
|
5
5
|
copy: boolean;
|
|
6
6
|
configuration: string;
|
|
@@ -10,5 +10,20 @@ export declare class Copy implements Action<CopyOptions> {
|
|
|
10
10
|
private readonly workspace;
|
|
11
11
|
constructor(workspace: Workspace);
|
|
12
12
|
run: (options: CopyOptions) => Promise<ActionResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* A package without a LICENSE of its own ships the workspace's, so a monorepo
|
|
15
|
+
* licensed once at the root still puts the license text in every tarball.
|
|
16
|
+
*/
|
|
17
|
+
private copyWorkspaceLicense;
|
|
18
|
+
/**
|
|
19
|
+
* Packed builds emit JS under `<out>/<target>/` (e.g. `es6/`). Assets listed on
|
|
20
|
+
* the *configuration* `copyFiles` (not the workspace defaults) are also copied
|
|
21
|
+
* into each target so `import.meta.url` resolves them beside that JS.
|
|
22
|
+
*
|
|
23
|
+
* Workspace `copyFiles` (e.g. `package.json`) stay root-only — nesting a
|
|
24
|
+
* package manifest under `es6/` makes `npm install --install-links` drop the
|
|
25
|
+
* parent's `es6/` tree when packing `file:` deps.
|
|
26
|
+
*/
|
|
27
|
+
private copyColocatedPackAssets;
|
|
13
28
|
private copyFileToOut;
|
|
14
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
import { DependencyResolver } from "../services/dependency-resolver.service.js";
|
|
5
5
|
import type { DependencyWarning, DriftEntry } from "../types/dependency.types.js";
|
|
6
6
|
type ReportOptions = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
import { DependencyResolver } from "../services/dependency-resolver.service.js";
|
|
5
5
|
import type { SyncprojectResult } from "../types/dependency.types.js";
|
|
6
6
|
export type DependenciesOptions = {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action, ResultStatus } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
|
+
export type DockerOptions = {
|
|
5
|
+
configuration: string;
|
|
6
|
+
dryRun?: boolean;
|
|
7
|
+
push?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type DockerResponse = ResultStatus & {
|
|
10
|
+
projectName: string;
|
|
11
|
+
image: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
export declare class Docker implements Action<DockerOptions> {
|
|
16
|
+
#private;
|
|
17
|
+
private readonly workspace;
|
|
18
|
+
private readonly docker;
|
|
19
|
+
constructor(workspace: Workspace);
|
|
20
|
+
run(options: DockerOptions): Promise<ActionResponse<DockerResponse>>;
|
|
21
|
+
private getDockerProjects;
|
|
22
|
+
/**
|
|
23
|
+
* A Dockerfile that copies `.package/` needs `forge package` to have run. Fail before the
|
|
24
|
+
* build with that instruction rather than with Docker's "not found" from deep in a layer.
|
|
25
|
+
*/
|
|
26
|
+
private assertPackaged;
|
|
27
|
+
private buildProject;
|
|
28
|
+
private interpolateBuildArgs;
|
|
29
|
+
/**
|
|
30
|
+
* Keep FORGE_DOCKER_EXTRA_TAGS_JSON scoped to this image so multi-image
|
|
31
|
+
* publishes do not stamp create:latest onto the app Dev Container (and vice versa).
|
|
32
|
+
*/
|
|
33
|
+
private extraTagsForImage;
|
|
34
|
+
private defaultImageName;
|
|
35
|
+
private normalizeDockerRepository;
|
|
36
|
+
private normalizeProjectSlug;
|
|
37
|
+
private parseJsonEnv;
|
|
38
|
+
}
|
|
@@ -4,8 +4,14 @@ export * from "./commit.action.js";
|
|
|
4
4
|
export * from "./copy.action.js";
|
|
5
5
|
export * from "./dependency-report.action.js";
|
|
6
6
|
export * from "./dependency-sync.action.js";
|
|
7
|
+
export * from "./docker.action.js";
|
|
8
|
+
export * from "./link.action.js";
|
|
9
|
+
export * from "./package.action.js";
|
|
10
|
+
export * from "./paths.action.js";
|
|
7
11
|
export * from "./publish.action.js";
|
|
8
12
|
export * from "./sync-lock-file.action.js";
|
|
9
13
|
export * from "./tag.action.js";
|
|
14
|
+
export * from "./typecheck.action.js";
|
|
15
|
+
export * from "./unlink.action.js";
|
|
10
16
|
export * from "./version.action.js";
|
|
11
17
|
export * from "./watch.action.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
|
+
import "../extensions/project.extensions.js";
|
|
5
|
+
export declare const LINK_MANIFEST = ".forge-link.json";
|
|
6
|
+
export type LinkOptions = {
|
|
7
|
+
configuration: string;
|
|
8
|
+
targetDir: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_LINK_CONFIGURATION = "link";
|
|
11
|
+
export type LinkManifest = {
|
|
12
|
+
workspaceRoot: string;
|
|
13
|
+
peerNodeModulesDir?: string;
|
|
14
|
+
links: Array<{
|
|
15
|
+
packageName: string;
|
|
16
|
+
symlinkPath: string;
|
|
17
|
+
originalPath: string | null;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
export declare class Link implements Action<LinkOptions> {
|
|
21
|
+
#private;
|
|
22
|
+
private readonly workspace;
|
|
23
|
+
constructor(workspace: Workspace);
|
|
24
|
+
run: (options: LinkOptions) => Promise<ActionResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action, ResultStatus } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
|
+
import { DependencyPinner } from "../packaging/dependency-pinner.service.js";
|
|
5
|
+
import { ImportGraph } from "../packaging/import-graph.service.js";
|
|
6
|
+
export type PackageOptions = {
|
|
7
|
+
/** Package name of one deployable. Omit to package every project that has a Dockerfile. */
|
|
8
|
+
project?: string;
|
|
9
|
+
};
|
|
10
|
+
export type PackageResponse = ResultStatus & {
|
|
11
|
+
projectName: string;
|
|
12
|
+
outDir: string;
|
|
13
|
+
workspacePackages: string[];
|
|
14
|
+
dependencies: Record<string, string>;
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Turns a deployable's release build into one self-contained folder that plain `node` runs:
|
|
19
|
+
* no symlinks, no workspace tooling. See ADR 0006.
|
|
20
|
+
*/
|
|
21
|
+
export declare class PackageDeployable implements Action<PackageOptions> {
|
|
22
|
+
#private;
|
|
23
|
+
private readonly workspace;
|
|
24
|
+
private readonly importGraph;
|
|
25
|
+
private readonly pinner;
|
|
26
|
+
private readonly npm;
|
|
27
|
+
constructor(workspace: Workspace, importGraph: ImportGraph, pinner: DependencyPinner);
|
|
28
|
+
run(options: PackageOptions): Promise<ActionResponse<PackageResponse>>;
|
|
29
|
+
/** The deployables to package, or the reason a named project cannot be one. */
|
|
30
|
+
private select;
|
|
31
|
+
private releaseProjects;
|
|
32
|
+
private packageProject;
|
|
33
|
+
private write;
|
|
34
|
+
/** Copies file contents, never links: a symlink in the output would break outside the image. */
|
|
35
|
+
private copyTree;
|
|
36
|
+
private writeJson;
|
|
37
|
+
private assertNoSymlinks;
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
|
+
export declare const PATHS_FILE = "tsconfig.paths.json";
|
|
5
|
+
export type PathsOptions = {
|
|
6
|
+
/** Fail if the file is missing or out of date, instead of writing it. */
|
|
7
|
+
check?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type PathsResponse = {
|
|
10
|
+
file: string;
|
|
11
|
+
changed: boolean;
|
|
12
|
+
succeeded: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Writes `tsconfig.paths.json`: tsconfig `paths` for every workspace package and the subpaths it
|
|
17
|
+
* exports, from the workspace aliases. Without `node_modules` links, `tsc` finds workspace
|
|
18
|
+
* packages only through `paths`; generating them keeps them in step with what Flux, the Vitest
|
|
19
|
+
* plugin and builds resolve. The root tsconfig extends the file.
|
|
20
|
+
*/
|
|
21
|
+
export declare class Paths implements Action<PathsOptions> {
|
|
22
|
+
#private;
|
|
23
|
+
private readonly workspace;
|
|
24
|
+
constructor(workspace: Workspace);
|
|
25
|
+
run(options: PathsOptions): Promise<ActionResponse<PathsResponse>>;
|
|
26
|
+
/** The file's content: convention and exported subpaths only, never the tsconfig's own paths. */
|
|
27
|
+
static render(workspace: Workspace): string;
|
|
28
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Project } from "@decohere/
|
|
2
|
-
import { Workspace } from "@decohere/
|
|
3
|
-
import type { Action, ResultStatus } from "@decohere/
|
|
4
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import type { Project } from "@decohere/workspace";
|
|
2
|
+
import { Workspace } from "@decohere/workspace";
|
|
3
|
+
import type { Action, ResultStatus } from "@decohere/devkit/cli";
|
|
4
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
5
5
|
export type PublishOptions = {
|
|
6
6
|
configuration: string;
|
|
7
7
|
channel?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Action } from "@decohere/
|
|
2
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
2
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
3
3
|
export type SyncLockFileOptions = {
|
|
4
4
|
sync?: boolean;
|
|
5
5
|
dryRun?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
export type TagOptions = {
|
|
5
5
|
prefix?: string;
|
|
6
6
|
dryRun?: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
|
+
import { TypeEmitter } from "../services/type-emitter.js";
|
|
5
|
+
export type TypeCheckOptions = {
|
|
6
|
+
configuration: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class TypeCheck implements Action<TypeCheckOptions> {
|
|
9
|
+
#private;
|
|
10
|
+
private readonly workspace;
|
|
11
|
+
private readonly typeEmitter;
|
|
12
|
+
constructor(workspace: Workspace, typeEmitter: TypeEmitter);
|
|
13
|
+
run: (options: TypeCheckOptions) => Promise<ActionResponse>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
2
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
3
|
+
export type UnlinkOptions = {
|
|
4
|
+
targetDir: string;
|
|
5
|
+
};
|
|
6
|
+
export declare class Unlink implements Action<UnlinkOptions> {
|
|
7
|
+
#private;
|
|
8
|
+
run: (options: UnlinkOptions) => Promise<ActionResponse>;
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action, ResultStatus } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
4
|
-
import { type VersionType } from "
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action, ResultStatus } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
|
+
import { type VersionType } from "../semver/index.js";
|
|
5
5
|
export type VersionResponse = ResultStatus & {
|
|
6
6
|
name: string;
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Workspace } from "@decohere/
|
|
2
|
-
import type { Action } from "@decohere/
|
|
3
|
-
import { ActionResponse } from "@decohere/
|
|
1
|
+
import { Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { Action } from "@decohere/devkit/cli";
|
|
3
|
+
import { ActionResponse } from "@decohere/devkit/cli";
|
|
4
4
|
export type WatchOptions = {
|
|
5
5
|
watch: boolean;
|
|
6
6
|
configuration: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MergeOptions } from "@decohere/
|
|
2
|
-
import { CommandResponse, DecohereCommand } from "@decohere/
|
|
1
|
+
import type { MergeOptions } from "@decohere/devkit/cli";
|
|
2
|
+
import { CommandResponse, DecohereCommand } from "@decohere/devkit/cli";
|
|
3
3
|
import type { Build } from "../actions/build.action.js";
|
|
4
4
|
import type { Clean } from "../actions/clean.action.js";
|
|
5
5
|
import type { Copy } from "../actions/copy.action.js";
|
|
@@ -12,5 +12,6 @@ export type BuildActions = {
|
|
|
12
12
|
};
|
|
13
13
|
export declare class BuildCommand extends DecohereCommand<BuildActions> {
|
|
14
14
|
constructor(name?: string);
|
|
15
|
+
runsUntilStopped(options: Record<string, unknown>): boolean;
|
|
15
16
|
run: (actions: BuildActions, options: MergeOptions<BuildActions>) => Promise<CommandResponse<BuildActions>>;
|
|
16
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CommandHandler } from "@decohere/
|
|
2
|
-
import { DecohereCommand } from "@decohere/
|
|
1
|
+
import type { CommandHandler } from "@decohere/devkit/cli";
|
|
2
|
+
import { DecohereCommand } from "@decohere/devkit/cli";
|
|
3
3
|
export declare class DependencyCommand extends DecohereCommand {
|
|
4
4
|
constructor(name?: string, handler?: CommandHandler);
|
|
5
5
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Actions } from "@decohere/
|
|
2
|
-
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/
|
|
1
|
+
import type { Actions } from "@decohere/devkit/cli";
|
|
2
|
+
import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/devkit/cli";
|
|
3
3
|
export declare class ForgeCommand extends DecohereCommand {
|
|
4
4
|
constructor(commands: Record<string, CommandType>, handler: CommandHandler);
|
|
5
5
|
run(_actions: Actions, _options: never): Promise<CommandResponse>;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export * from "./build.command.js";
|
|
2
2
|
export * from "./dependency.command.js";
|
|
3
|
+
export * from "./docker.command.js";
|
|
3
4
|
export * from "./forge.command.js";
|
|
5
|
+
export * from "./link.command.js";
|
|
6
|
+
export * from "./package.command.js";
|
|
7
|
+
export * from "./paths.command.js";
|
|
4
8
|
export * from "./publish.command.js";
|
|
5
9
|
export * from "./tag.command.js";
|
|
10
|
+
export * from "./typecheck.command.js";
|
|
6
11
|
export * from "./version.command.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandHandler, MergeOptions } from "@decohere/devkit/cli";
|
|
2
|
+
import { CommandResponse, DecohereCommand } from "@decohere/devkit/cli";
|
|
3
|
+
import { Build } from "../actions/build.action.js";
|
|
4
|
+
import { Clean } from "../actions/clean.action.js";
|
|
5
|
+
import { Copy } from "../actions/copy.action.js";
|
|
6
|
+
import { Link } from "../actions/link.action.js";
|
|
7
|
+
import { Unlink } from "../actions/unlink.action.js";
|
|
8
|
+
import { Watch } from "../actions/watch.action.js";
|
|
9
|
+
export type LinkActions = {
|
|
10
|
+
clean: Clean;
|
|
11
|
+
build: Build;
|
|
12
|
+
copy: Copy;
|
|
13
|
+
link: Link;
|
|
14
|
+
watch: Watch;
|
|
15
|
+
};
|
|
16
|
+
type UnlinkActions = {
|
|
17
|
+
unlink: Unlink;
|
|
18
|
+
};
|
|
19
|
+
export declare class LinkCommand extends DecohereCommand<LinkActions> {
|
|
20
|
+
get actions(): (typeof Build | typeof Clean | typeof Copy | typeof Link | typeof Watch)[];
|
|
21
|
+
constructor(name?: string);
|
|
22
|
+
runsUntilStopped(options: Record<string, unknown>): boolean;
|
|
23
|
+
run: (actions: LinkActions, options: MergeOptions<LinkActions>) => Promise<CommandResponse<LinkActions>>;
|
|
24
|
+
}
|
|
25
|
+
export declare class UnlinkCommand extends DecohereCommand<UnlinkActions> {
|
|
26
|
+
get actions(): (typeof Unlink)[];
|
|
27
|
+
constructor(name?: string, handler?: CommandHandler);
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DecohereCommand } from "@decohere/devkit/cli";
|
|
2
|
+
import { PackageDeployable } from "../actions/package.action.js";
|
|
3
|
+
export declare class PackageCommand extends DecohereCommand {
|
|
4
|
+
get actions(): (typeof PackageDeployable)[];
|
|
5
|
+
constructor(name: string);
|
|
6
|
+
/**
|
|
7
|
+
* Commander passes the positional before the options; the CLI host reads only options,
|
|
8
|
+
* so the project name is stashed on them.
|
|
9
|
+
*/
|
|
10
|
+
action(fn: (...args: any[]) => void | Promise<void>): this;
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Workspace } from "@decohere/workspace";
|
|
2
|
+
import type { WorkspaceFactoryOptions } from "@decohere/devkit/cli";
|
|
3
|
+
/**
|
|
4
|
+
* The workspace every Decohere tool sees (forge, the flux CLI and `flux.run`): forge's
|
|
5
|
+
* defaults, the user's `.decohere.js`, and the root: `--root-dir`, else the current folder.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createWorkspace(options?: WorkspaceFactoryOptions): Promise<Workspace>;
|
package/types/src/errors.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Project } from "@decohere/
|
|
1
|
+
import { Project } from "@decohere/workspace";
|
|
2
2
|
import type { ForgeConfiguration } from "../types/configuration.type.js";
|
|
3
3
|
import { SwcConfig } from "../types/swc-config.type.js";
|
|
4
|
-
declare module "@decohere/
|
|
4
|
+
declare module "@decohere/workspace" {
|
|
5
5
|
interface Project {
|
|
6
6
|
getForgeConfiguration(): ForgeConfiguration;
|
|
7
7
|
getSwcConfig(): Promise<SwcConfig>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FileEx } from "@decohere/
|
|
1
|
+
import type { FileEx } from "@decohere/core/io";
|
|
2
2
|
import type { Options } from "@swc/core";
|
|
3
3
|
import type { TranspileTarget } from "../types/build-target.type.js";
|
|
4
4
|
import type { SwcConfigOptions } from "../types/swc-config.type.js";
|
|
@@ -8,8 +8,9 @@ export declare class SwcConfigFactory {
|
|
|
8
8
|
* Call once per (project, target) and then use createFileConfig() per file.
|
|
9
9
|
*/
|
|
10
10
|
createBaseConfig(buildTarget: TranspileTarget, configOptions: SwcConfigOptions): Options;
|
|
11
|
-
/** Stamps a per-file filename onto a pre-built base config. */
|
|
11
|
+
/** Stamps a per-file filename onto a pre-built base config; `.tsx` also turns on JSX. */
|
|
12
12
|
createFileConfig(file: FileEx, baseConfig: Options): Options;
|
|
13
|
+
private static nonemptyPaths;
|
|
13
14
|
/**
|
|
14
15
|
* Validates SWC options against known causes of Rust/NAPI process crashes.
|
|
15
16
|
* Throws a ForgeError with a descriptive message instead of letting the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { WorkspaceFactoryOptions } from "@decohere/
|
|
2
|
-
import { ModuleManifest } from "@decohere/
|
|
3
|
-
import type { ContainerBuilder } from "@decohere/
|
|
1
|
+
import type { WorkspaceFactoryOptions } from "@decohere/devkit/cli";
|
|
2
|
+
import { ModuleManifest } from "@decohere/devkit/cli";
|
|
3
|
+
import type { ContainerBuilder } from "@decohere/core/composition";
|
|
4
4
|
import * as Actions from "./actions/index.js";
|
|
5
5
|
import * as Commands from "./commands/index.js";
|
|
6
6
|
export declare class ForgeModule extends ModuleManifest {
|
|
@@ -9,6 +9,8 @@ export declare class ForgeModule extends ModuleManifest {
|
|
|
9
9
|
readonly actions: {
|
|
10
10
|
clean: typeof Actions.Clean;
|
|
11
11
|
copy: typeof Actions.Copy;
|
|
12
|
+
docker: typeof Actions.Docker;
|
|
13
|
+
package: typeof Actions.PackageDeployable;
|
|
12
14
|
build: typeof Actions.Build;
|
|
13
15
|
watch: typeof Actions.Watch;
|
|
14
16
|
publish: typeof Actions.Publish;
|
|
@@ -17,15 +19,25 @@ export declare class ForgeModule extends ModuleManifest {
|
|
|
17
19
|
reportDependencies: typeof Actions.ReportDependencies;
|
|
18
20
|
version: typeof Actions.Version;
|
|
19
21
|
tag: typeof Actions.Tag;
|
|
22
|
+
paths: typeof Actions.Paths;
|
|
23
|
+
typecheck: typeof Actions.TypeCheck;
|
|
20
24
|
commitFiles: typeof Actions.CommitFiles;
|
|
25
|
+
link: typeof Actions.Link;
|
|
26
|
+
unlink: typeof Actions.Unlink;
|
|
21
27
|
};
|
|
22
28
|
readonly commands: {
|
|
23
29
|
build: typeof Commands.BuildCommand;
|
|
24
30
|
publish: typeof Commands.PublishCommand;
|
|
25
31
|
dependencies: typeof Commands.DependencyCommand;
|
|
32
|
+
docker: typeof Commands.DockerCommand;
|
|
33
|
+
package: typeof Commands.PackageCommand;
|
|
26
34
|
version: typeof Commands.VersionCommand;
|
|
27
35
|
tag: typeof Commands.TagCommand;
|
|
36
|
+
paths: typeof Commands.PathsCommand;
|
|
37
|
+
typecheck: typeof Commands.TypeCheckCommand;
|
|
38
|
+
link: typeof Commands.LinkCommand;
|
|
39
|
+
unlink: typeof Commands.UnlinkCommand;
|
|
28
40
|
};
|
|
29
41
|
registerServices(builder: ContainerBuilder): void;
|
|
30
|
-
createWorkspace(options: WorkspaceFactoryOptions): Promise<import("@decohere/
|
|
42
|
+
createWorkspace(options: WorkspaceFactoryOptions): Promise<import("@decohere/workspace").Workspace>;
|
|
31
43
|
}
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
export { createWorkspace } from "./create-workspace.js";
|
|
1
2
|
export { ForgeError } from "./errors.js";
|
|
2
3
|
export { ForgeModule } from "./forge.module.js";
|
|
3
4
|
export type { TranspileOptions } from "./services/swc-transpiler.js";
|
|
4
5
|
export { SwcTranspiler } from "./services/swc-transpiler.js";
|
|
6
|
+
export { transpileCache } from "./services/transpile-cache.js";
|
|
5
7
|
export type { BuildTarget, TranspileTarget } from "./types/build-target.type.js";
|
|
6
8
|
export { BuildTargets } from "./types/build-target.type.js";
|
|
7
9
|
export type { ForgeConfiguration } from "./types/configuration.type.js";
|
|
8
10
|
export type { WorkspaceOptions } from "./types/workspace-config.type.js";
|
|
9
|
-
export { Debug as DebugConfiguration, DefaultConfigurations, Release as ReleaseConfiguration, WorkspaceDefaults, } from "./workspace.config.js";
|
|
11
|
+
export { Debug as DebugConfiguration, DefaultConfigurations, Link as LinkConfiguration, Release as ReleaseConfiguration, WorkspaceDefaults, } from "./workspace.config.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PackageJson } from "@decohere/workspace";
|
|
2
|
+
import type { ReachedPackages, ReleaseProject } from "./import-graph.service.js";
|
|
3
|
+
/**
|
|
4
|
+
* Chooses the third-party `dependencies` for the packaged `package.json`: the union of
|
|
5
|
+
* `dependencies` (never devDependencies) of the deployable, every library copied in, and the
|
|
6
|
+
* workspace root. Declared is shipped, whether or not code imports it (a runtime-loaded pino
|
|
7
|
+
* transport, say), so removing an unused dependency is the author's job. Each is pinned to the
|
|
8
|
+
* exact version installed in the workspace, so the image runs what the tests ran.
|
|
9
|
+
*
|
|
10
|
+
* Code that imports a third-party package nothing ships is a crash waiting to happen, so that
|
|
11
|
+
* is an error: the package is only a devDependency, or declared nowhere.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DependencyPinner {
|
|
14
|
+
pin(imported: ReachedPackages["thirdParty"], shipped: readonly ReleaseProject[], projects: ReadonlyMap<string, ReleaseProject>, workspaceRoot: {
|
|
15
|
+
dir: string;
|
|
16
|
+
pkg: PackageJson;
|
|
17
|
+
}): Promise<Record<string, string>>;
|
|
18
|
+
private assertImportsAreShipped;
|
|
19
|
+
private installedVersion;
|
|
20
|
+
}
|