@decohere/forge 0.0.1-dev.19 → 0.0.1-dev.20261105.103

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.
Files changed (179) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +152 -0
  3. package/es6/src/actions/build.action.js +3 -7
  4. package/es6/src/actions/clean.action.js +3 -6
  5. package/es6/src/actions/commit.action.js +3 -6
  6. package/es6/src/actions/copy.action.js +61 -12
  7. package/es6/src/actions/dependency-report.action.js +7 -7
  8. package/es6/src/actions/dependency-sync.action.js +8 -6
  9. package/es6/src/actions/docker.action.js +194 -0
  10. package/es6/src/actions/index.js +4 -2
  11. package/es6/src/actions/link.action.js +2 -5
  12. package/es6/src/actions/package.action.js +219 -0
  13. package/es6/src/actions/paths.action.js +97 -0
  14. package/es6/src/actions/publish.action.js +3 -6
  15. package/es6/src/actions/sync-lock-file.action.js +2 -4
  16. package/es6/src/actions/tag.action.js +5 -9
  17. package/es6/src/actions/typecheck.action.js +52 -0
  18. package/es6/src/actions/unlink.action.js +1 -3
  19. package/es6/src/actions/version.action.js +69 -17
  20. package/es6/src/actions/watch.action.js +2 -5
  21. package/es6/src/commands/build.command.js +4 -3
  22. package/es6/src/commands/dependency.command.js +1 -3
  23. package/es6/src/commands/docker.command.js +16 -0
  24. package/es6/src/commands/forge.command.js +1 -3
  25. package/es6/src/commands/index.js +4 -2
  26. package/es6/src/commands/link.command.js +4 -3
  27. package/es6/src/commands/package.command.js +26 -0
  28. package/es6/src/commands/paths.command.js +14 -0
  29. package/es6/src/commands/publish.command.js +1 -3
  30. package/es6/src/commands/tag.command.js +1 -3
  31. package/es6/src/commands/typecheck.command.js +14 -0
  32. package/es6/src/commands/version.command.js +3 -3
  33. package/es6/src/const.js +0 -2
  34. package/es6/src/create-workspace.js +26 -0
  35. package/es6/src/errors.js +1 -3
  36. package/es6/src/extensions/project.extensions.js +5 -7
  37. package/es6/src/factories/swc-config.factory.js +29 -9
  38. package/es6/src/forge.module.js +17 -20
  39. package/es6/src/index.js +2 -2
  40. package/es6/src/packaging/dependency-pinner.service.js +103 -0
  41. package/es6/src/packaging/deployable.js +21 -0
  42. package/es6/src/packaging/import-graph.service.js +122 -0
  43. package/es6/src/packaging/release-exports.js +80 -0
  44. package/es6/src/packaging/ui-assets.js +49 -0
  45. package/es6/src/semver/index.js +1 -0
  46. package/es6/src/semver/semver.js +75 -0
  47. package/es6/src/services/dependency-resolver.service.js +70 -26
  48. package/es6/src/services/file-writer.service.js +2 -11
  49. package/es6/src/services/incremental-watch.js +18 -0
  50. package/es6/src/services/output-cache.js +29 -0
  51. package/es6/src/services/swc-transpiler.js +85 -99
  52. package/es6/src/services/transpile-cache.js +29 -0
  53. package/es6/src/services/ts-compiler-options.js +39 -0
  54. package/es6/src/services/ts-program-host.js +4 -6
  55. package/es6/src/services/type-emission-program.js +25 -10
  56. package/es6/src/services/type-emitter.js +57 -20
  57. package/es6/src/transpile/index.js +6 -0
  58. package/es6/src/types/build-target.type.js +0 -2
  59. package/es6/src/types/configuration.type.js +0 -2
  60. package/es6/src/types/dependency.types.js +0 -2
  61. package/es6/src/types/swc-config.type.js +0 -2
  62. package/es6/src/types/transform-response.model.js +0 -7
  63. package/es6/src/types/transformer.type.js +0 -2
  64. package/es6/src/types/workspace-config.type.js +0 -2
  65. package/es6/src/vitest/forge-build.plugin.js +27 -43
  66. package/es6/src/vitest/index.js +0 -2
  67. package/es6/src/workspace.config.js +26 -6
  68. package/package.json +21 -10
  69. package/types/src/actions/build.action.d.ts +4 -4
  70. package/types/src/actions/clean.action.d.ts +3 -3
  71. package/types/src/actions/commit.action.d.ts +3 -3
  72. package/types/src/actions/copy.action.d.ts +18 -3
  73. package/types/src/actions/dependency-report.action.d.ts +3 -3
  74. package/types/src/actions/dependency-sync.action.d.ts +3 -3
  75. package/types/src/actions/docker.action.d.ts +38 -0
  76. package/types/src/actions/index.d.ts +4 -0
  77. package/types/src/actions/link.action.d.ts +3 -3
  78. package/types/src/actions/package.action.d.ts +38 -0
  79. package/types/src/actions/paths.action.d.ts +28 -0
  80. package/types/src/actions/publish.action.d.ts +4 -4
  81. package/types/src/actions/sync-lock-file.action.d.ts +2 -2
  82. package/types/src/actions/tag.action.d.ts +3 -3
  83. package/types/src/actions/typecheck.action.d.ts +14 -0
  84. package/types/src/actions/unlink.action.d.ts +2 -2
  85. package/types/src/actions/version.action.d.ts +14 -4
  86. package/types/src/actions/watch.action.d.ts +3 -3
  87. package/types/src/commands/build.command.d.ts +3 -2
  88. package/types/src/commands/dependency.command.d.ts +2 -2
  89. package/types/src/commands/docker.command.d.ts +6 -0
  90. package/types/src/commands/forge.command.d.ts +2 -2
  91. package/types/src/commands/index.d.ts +4 -0
  92. package/types/src/commands/link.command.d.ts +3 -2
  93. package/types/src/commands/package.command.d.ts +11 -0
  94. package/types/src/commands/paths.command.d.ts +6 -0
  95. package/types/src/commands/publish.command.d.ts +1 -1
  96. package/types/src/commands/tag.command.d.ts +1 -1
  97. package/types/src/commands/typecheck.command.d.ts +6 -0
  98. package/types/src/commands/version.command.d.ts +1 -1
  99. package/types/src/create-workspace.d.ts +7 -0
  100. package/types/src/errors.d.ts +1 -1
  101. package/types/src/extensions/project.extensions.d.ts +2 -2
  102. package/types/src/factories/swc-config.factory.d.ts +3 -2
  103. package/types/src/forge.module.d.ts +12 -4
  104. package/types/src/index.d.ts +2 -0
  105. package/types/src/packaging/dependency-pinner.service.d.ts +20 -0
  106. package/types/src/packaging/deployable.d.ts +17 -0
  107. package/types/src/packaging/import-graph.service.d.ts +33 -0
  108. package/types/src/packaging/release-exports.d.ts +18 -0
  109. package/types/src/packaging/ui-assets.d.ts +21 -0
  110. package/types/src/semver/index.d.ts +1 -0
  111. package/types/src/semver/semver.d.ts +20 -0
  112. package/types/src/services/dependency-resolver.service.d.ts +8 -1
  113. package/types/src/services/file-writer.service.d.ts +1 -2
  114. package/types/src/services/incremental-watch.d.ts +13 -0
  115. package/types/src/services/output-cache.d.ts +10 -0
  116. package/types/src/services/swc-transpiler.d.ts +28 -15
  117. package/types/src/services/transpile-cache.d.ts +17 -0
  118. package/types/src/services/ts-compiler-options.d.ts +8 -0
  119. package/types/src/services/ts-program-host.d.ts +2 -2
  120. package/types/src/services/type-emission-program.d.ts +10 -3
  121. package/types/src/services/type-emitter.d.ts +21 -8
  122. package/types/src/transpile/index.d.ts +6 -0
  123. package/types/src/types/configuration.type.d.ts +6 -1
  124. package/types/src/types/dependency.types.d.ts +8 -9
  125. package/types/src/types/swc-config.type.d.ts +7 -1
  126. package/types/src/types/transform-response.model.d.ts +2 -7
  127. package/types/src/types/transformer.type.d.ts +3 -12
  128. package/types/src/types/workspace-config.type.d.ts +3 -3
  129. package/types/src/vitest/forge-build.plugin.d.ts +0 -2
  130. package/commonjs/src/actions/build.action.js +0 -116
  131. package/commonjs/src/actions/clean.action.js +0 -55
  132. package/commonjs/src/actions/commit.action.js +0 -87
  133. package/commonjs/src/actions/copy.action.js +0 -83
  134. package/commonjs/src/actions/dependency-report.action.js +0 -142
  135. package/commonjs/src/actions/dependency-sync.action.js +0 -100
  136. package/commonjs/src/actions/index.js +0 -32
  137. package/commonjs/src/actions/link.action.js +0 -156
  138. package/commonjs/src/actions/publish.action.js +0 -156
  139. package/commonjs/src/actions/sync-lock-file.action.js +0 -43
  140. package/commonjs/src/actions/tag.action.js +0 -76
  141. package/commonjs/src/actions/unlink.action.js +0 -76
  142. package/commonjs/src/actions/version.action.js +0 -209
  143. package/commonjs/src/actions/watch.action.js +0 -51
  144. package/commonjs/src/commands/build.command.js +0 -49
  145. package/commonjs/src/commands/dependency.command.js +0 -88
  146. package/commonjs/src/commands/forge.command.js +0 -24
  147. package/commonjs/src/commands/index.js +0 -26
  148. package/commonjs/src/commands/link.command.js +0 -89
  149. package/commonjs/src/commands/publish.command.js +0 -32
  150. package/commonjs/src/commands/tag.command.js +0 -28
  151. package/commonjs/src/commands/version.command.js +0 -36
  152. package/commonjs/src/const.js +0 -81
  153. package/commonjs/src/errors.js +0 -39
  154. package/commonjs/src/extensions/project.extensions.js +0 -94
  155. package/commonjs/src/factories/swc-config.factory.js +0 -98
  156. package/commonjs/src/forge.module.js +0 -113
  157. package/commonjs/src/index.js +0 -46
  158. package/commonjs/src/mixins/caches-outputs.mixin.js +0 -44
  159. package/commonjs/src/mixins/incremental-transform.mixin.js +0 -36
  160. package/commonjs/src/services/dependency-resolver.service.js +0 -172
  161. package/commonjs/src/services/file-writer.service.js +0 -232
  162. package/commonjs/src/services/swc-transpiler.js +0 -235
  163. package/commonjs/src/services/ts-program-host.js +0 -135
  164. package/commonjs/src/services/type-emission-program.js +0 -160
  165. package/commonjs/src/services/type-emitter.js +0 -141
  166. package/commonjs/src/types/build-target.type.js +0 -17
  167. package/commonjs/src/types/configuration.type.js +0 -6
  168. package/commonjs/src/types/dependency.types.js +0 -6
  169. package/commonjs/src/types/swc-config.type.js +0 -17
  170. package/commonjs/src/types/transform-response.model.js +0 -65
  171. package/commonjs/src/types/transformer.type.js +0 -13
  172. package/commonjs/src/types/workspace-config.type.js +0 -6
  173. package/commonjs/src/vitest/forge-build.plugin.js +0 -129
  174. package/commonjs/src/vitest/index.js +0 -13
  175. package/commonjs/src/workspace.config.js +0 -75
  176. package/es6/src/mixins/caches-outputs.mixin.js +0 -34
  177. package/es6/src/mixins/incremental-transform.mixin.js +0 -26
  178. package/types/src/mixins/caches-outputs.mixin.d.ts +0 -7
  179. package/types/src/mixins/incremental-transform.mixin.d.ts +0 -13
@@ -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,10 +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";
7
8
  export * from "./link.action.js";
9
+ export * from "./package.action.js";
10
+ export * from "./paths.action.js";
8
11
  export * from "./publish.action.js";
9
12
  export * from "./sync-lock-file.action.js";
10
13
  export * from "./tag.action.js";
14
+ export * from "./typecheck.action.js";
11
15
  export * from "./unlink.action.js";
12
16
  export * from "./version.action.js";
13
17
  export * from "./watch.action.js";
@@ -1,6 +1,6 @@
1
- import { Workspace } from "@decohere/mesh";
2
- import type { Action } from "@decohere/nexus/cli";
3
- import { ActionResponse } from "@decohere/nexus/cli";
1
+ import { Workspace } from "@decohere/workspace";
2
+ import type { Action } from "@decohere/devkit/cli";
3
+ import { ActionResponse } from "@decohere/devkit/cli";
4
4
  import "../extensions/project.extensions.js";
5
5
  export declare const LINK_MANIFEST = ".forge-link.json";
6
6
  export type LinkOptions = {
@@ -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/mesh";
2
- import { Workspace } from "@decohere/mesh";
3
- import type { Action, ResultStatus } from "@decohere/nexus/cli";
4
- import { ActionResponse } from "@decohere/nexus/cli";
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/nexus/cli";
2
- import { ActionResponse } from "@decohere/nexus/cli";
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/mesh";
2
- import type { Action } from "@decohere/nexus/cli";
3
- import { ActionResponse } from "@decohere/nexus/cli";
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
+ }
@@ -1,5 +1,5 @@
1
- import type { Action } from "@decohere/nexus/cli";
2
- import { ActionResponse } from "@decohere/nexus/cli";
1
+ import type { Action } from "@decohere/devkit/cli";
2
+ import { ActionResponse } from "@decohere/devkit/cli";
3
3
  export type UnlinkOptions = {
4
4
  targetDir: string;
5
5
  };
@@ -1,7 +1,7 @@
1
- import { Workspace } from "@decohere/mesh";
2
- import type { Action, ResultStatus } from "@decohere/nexus/cli";
3
- import { ActionResponse } from "@decohere/nexus/cli";
4
- import { type VersionType } from "@decohere/nexus/semver";
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
  };
@@ -11,6 +11,12 @@ export type VersionOptions = {
11
11
  releaseType?: VersionType;
12
12
  channel?: string;
13
13
  version?: string;
14
+ /** A CI run number: the version becomes `<base>-<channel>.<commit's UTC date>.<number>`. */
15
+ buildNumber?: string;
16
+ /** Copy the version from the built packages, failing if they don't all match. */
17
+ fromBuild?: boolean;
18
+ /** The build `fromBuild` reads. */
19
+ configuration?: string;
14
20
  dryRun?: boolean;
15
21
  commit?: boolean;
16
22
  message?: string;
@@ -23,6 +29,10 @@ export declare class Version implements Action<VersionOptions> {
23
29
  constructor(workspace: Workspace);
24
30
  run(options: VersionOptions): Promise<ActionResponse>;
25
31
  version(workspace: Workspace, options?: VersionOptions): Promise<ActionResponse<VersionResponse>>;
32
+ private resolveNextVersion;
33
+ private versionFromBuildNumber;
34
+ private versionFromBuild;
35
+ private readBuiltVersion;
26
36
  private resolveBaseVersion;
27
37
  private resolveVersionFromGitTag;
28
38
  /**
@@ -1,6 +1,6 @@
1
- import { Workspace } from "@decohere/mesh";
2
- import type { Action } from "@decohere/nexus/cli";
3
- import { ActionResponse } from "@decohere/nexus/cli";
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/nexus/cli";
2
- import { CommandResponse, DecohereCommand } from "@decohere/nexus/cli";
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/nexus/cli";
2
- import { DecohereCommand } from "@decohere/nexus/cli";
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
  }
@@ -0,0 +1,6 @@
1
+ import { DecohereCommand } from "@decohere/devkit/cli";
2
+ import { Docker } from "../actions/docker.action.js";
3
+ export declare class DockerCommand extends DecohereCommand {
4
+ get actions(): (typeof Docker)[];
5
+ constructor(name: string);
6
+ }
@@ -1,5 +1,5 @@
1
- import type { Actions } from "@decohere/nexus/cli";
2
- import { type CommandHandler, type CommandResponse, type CommandType, DecohereCommand } from "@decohere/nexus/cli";
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,7 +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";
4
5
  export * from "./link.command.js";
6
+ export * from "./package.command.js";
7
+ export * from "./paths.command.js";
5
8
  export * from "./publish.command.js";
6
9
  export * from "./tag.command.js";
10
+ export * from "./typecheck.command.js";
7
11
  export * from "./version.command.js";
@@ -1,5 +1,5 @@
1
- import type { CommandHandler, MergeOptions } from "@decohere/nexus/cli";
2
- import { CommandResponse, DecohereCommand } from "@decohere/nexus/cli";
1
+ import type { CommandHandler, MergeOptions } from "@decohere/devkit/cli";
2
+ import { CommandResponse, DecohereCommand } from "@decohere/devkit/cli";
3
3
  import { Build } from "../actions/build.action.js";
4
4
  import { Clean } from "../actions/clean.action.js";
5
5
  import { Copy } from "../actions/copy.action.js";
@@ -19,6 +19,7 @@ type UnlinkActions = {
19
19
  export declare class LinkCommand extends DecohereCommand<LinkActions> {
20
20
  get actions(): (typeof Build | typeof Clean | typeof Copy | typeof Link | typeof Watch)[];
21
21
  constructor(name?: string);
22
+ runsUntilStopped(options: Record<string, unknown>): boolean;
22
23
  run: (actions: LinkActions, options: MergeOptions<LinkActions>) => Promise<CommandResponse<LinkActions>>;
23
24
  }
24
25
  export declare class UnlinkCommand extends DecohereCommand<UnlinkActions> {
@@ -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,6 @@
1
+ import { DecohereCommand } from "@decohere/devkit/cli";
2
+ import { Paths } from "../actions/paths.action.js";
3
+ export declare class PathsCommand extends DecohereCommand {
4
+ get actions(): (typeof Paths)[];
5
+ constructor(name: string);
6
+ }
@@ -1,4 +1,4 @@
1
- import { DecohereCommand } from "@decohere/nexus/cli";
1
+ import { DecohereCommand } from "@decohere/devkit/cli";
2
2
  import { Publish } from "../actions/publish.action.js";
3
3
  export declare class PublishCommand extends DecohereCommand {
4
4
  get actions(): (typeof Publish)[];
@@ -1,4 +1,4 @@
1
- import { DecohereCommand } from "@decohere/nexus/cli";
1
+ import { DecohereCommand } from "@decohere/devkit/cli";
2
2
  import { Tag } from "../actions/tag.action.js";
3
3
  export declare class TagCommand extends DecohereCommand {
4
4
  get actions(): (typeof Tag)[];
@@ -0,0 +1,6 @@
1
+ import { DecohereCommand } from "@decohere/devkit/cli";
2
+ import { TypeCheck } from "../actions/typecheck.action.js";
3
+ export declare class TypeCheckCommand extends DecohereCommand {
4
+ get actions(): (typeof TypeCheck)[];
5
+ constructor(name: string);
6
+ }
@@ -1,4 +1,4 @@
1
- import { DecohereCommand } from "@decohere/nexus/cli";
1
+ import { DecohereCommand } from "@decohere/devkit/cli";
2
2
  import { SyncLockFile } from "../actions/sync-lock-file.action.js";
3
3
  import { Version } from "../actions/version.action.js";
4
4
  type VersionActions = {
@@ -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>;
@@ -1,4 +1,4 @@
1
- export { WorkspaceConfigurationError } from "@decohere/mesh";
1
+ export { WorkspaceConfigurationError } from "@decohere/workspace";
2
2
  export declare class ForgeError extends Error {
3
3
  }
4
4
  export declare function formatUnknownError(reason: unknown): string;
@@ -1,7 +1,7 @@
1
- import { Project } from "@decohere/mesh";
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/mesh" {
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/nexus/io";
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/nexus/cli";
2
- import { ModuleManifest } from "@decohere/nexus/cli";
3
- import type { ContainerBuilder } from "@decohere/nexus/composition";
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,6 +19,8 @@ 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;
21
25
  link: typeof Actions.Link;
22
26
  unlink: typeof Actions.Unlink;
@@ -25,11 +29,15 @@ export declare class ForgeModule extends ModuleManifest {
25
29
  build: typeof Commands.BuildCommand;
26
30
  publish: typeof Commands.PublishCommand;
27
31
  dependencies: typeof Commands.DependencyCommand;
32
+ docker: typeof Commands.DockerCommand;
33
+ package: typeof Commands.PackageCommand;
28
34
  version: typeof Commands.VersionCommand;
29
35
  tag: typeof Commands.TagCommand;
36
+ paths: typeof Commands.PathsCommand;
37
+ typecheck: typeof Commands.TypeCheckCommand;
30
38
  link: typeof Commands.LinkCommand;
31
39
  unlink: typeof Commands.UnlinkCommand;
32
40
  };
33
41
  registerServices(builder: ContainerBuilder): void;
34
- createWorkspace(options: WorkspaceFactoryOptions): Promise<import("@decohere/mesh").Workspace>;
42
+ createWorkspace(options: WorkspaceFactoryOptions): Promise<import("@decohere/workspace").Workspace>;
35
43
  }
@@ -1,7 +1,9 @@
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";
@@ -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
+ }
@@ -0,0 +1,17 @@
1
+ import type { Project } from "@decohere/workspace";
2
+ /** Where `forge package` writes a deployable's output: inside the project, the Docker build context. */
3
+ export declare const PACKAGE_DIR = ".package";
4
+ /**
5
+ * A deployable is a project with a Dockerfile: `docker.dockerfile` from `.decohere.js`,
6
+ * or `Dockerfile` in the project folder. `forge docker` and `forge package` share this
7
+ * rule so they always agree on which projects are deployables.
8
+ */
9
+ declare function dockerfileName(project: Project): string;
10
+ declare function dockerfilePath(project: Project): string;
11
+ declare function isDeployable(project: Project): Promise<boolean>;
12
+ export declare const deployable: {
13
+ dockerfileName: typeof dockerfileName;
14
+ dockerfilePath: typeof dockerfilePath;
15
+ isDeployable: typeof isDeployable;
16
+ };
17
+ export {};
@@ -0,0 +1,33 @@
1
+ import type { PackageJson } from "@decohere/workspace";
2
+ /** A workspace project as the packager sees it: its manifest and its release build. */
3
+ export type ReleaseProject = {
4
+ /** The package name, e.g. `@app/kernel`. */
5
+ name: string;
6
+ pkg: PackageJson;
7
+ /** Absolute path of the project folder (source). */
8
+ projectRoot: string;
9
+ /** Absolute path of the project's release output (holds `es6/`). */
10
+ releaseDir: string;
11
+ };
12
+ export type ReachedPackages = {
13
+ /** Workspace packages the entry reaches, including the entry's own project. */
14
+ workspace: Set<string>;
15
+ /**
16
+ * Third-party package name to the workspace packages whose code imports it. Not what
17
+ * ships (declared dependencies do); only used to fail on an import nothing ships.
18
+ */
19
+ thirdParty: Map<string, Set<string>>;
20
+ };
21
+ /**
22
+ * Walks the compiled (release) import graph from a deployable's entry point and reports which
23
+ * workspace and third-party packages the code actually reaches. Code that nothing imports (a
24
+ * library's `testing/` folder, say) is never opened, so its dependencies are not collected.
25
+ */
26
+ export declare class ImportGraph {
27
+ #private;
28
+ walk(entry: ReleaseProject, projects: ReadonlyMap<string, ReleaseProject>): Promise<ReachedPackages>;
29
+ private follow;
30
+ private importsOf;
31
+ /** Compiled output keeps explicit `.js` paths; tolerate extensionless and folder imports. */
32
+ private resolveRelative;
33
+ }
@@ -0,0 +1,18 @@
1
+ import { type PackageJson } from "@decohere/workspace";
2
+ /** Release `exports`: subpath (`.`, `./testing`) to a file path inside the release output. */
3
+ export type ReleaseExports = Record<string, string>;
4
+ /** `src/main.ts` becomes `src/main.js` (`.mts` `.mjs`, `.cts` `.cjs`), with any leading `./` dropped. */
5
+ declare function toJs(filePath: string): string;
6
+ /**
7
+ * The `exports` a library needs once only its `es6/` output is shipped: the library's own
8
+ * map (or its `main`) with every path pointed at `./es6/...js`.
9
+ */
10
+ declare function build(pkg: PackageJson): ReleaseExports;
11
+ /** The file one subpath (`""` for the package root, `/testing`) points at, or undefined. */
12
+ declare function resolve(exports: ReleaseExports, subpath: string): string | undefined;
13
+ export declare const releaseExports: {
14
+ build: typeof build;
15
+ resolve: typeof resolve;
16
+ toJs: typeof toJs;
17
+ };
18
+ export {};
@@ -0,0 +1,21 @@
1
+ import type { Project } from "@decohere/workspace";
2
+ export declare const DEFAULT_UI_OUTPUT = "dist";
3
+ export declare const DEFAULT_UI_TARGET = "ui";
4
+ export type UiAssets = {
5
+ /** The UI project's name. */
6
+ project: string;
7
+ /** Absolute path of the built UI. */
8
+ from: string;
9
+ /** Folder name inside `.package/`. */
10
+ to: string;
11
+ };
12
+ /**
13
+ * What the deployable's `ui` declaration (`.decohere.js`) asks for, checked before anything
14
+ * is written: the UI project exists and has been built. Forge does not build it (see ADR 0007).
15
+ * Returns `undefined` when the deployable declares no UI.
16
+ */
17
+ declare function resolve(deployable: Project, projects: readonly Project[]): Promise<UiAssets | undefined>;
18
+ export declare const uiAssets: {
19
+ resolve: typeof resolve;
20
+ };
21
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./semver.js";
@@ -0,0 +1,20 @@
1
+ export type VersionType = "major" | "minor" | "patch" | "prerelease";
2
+ export declare const VersionTypes: {
3
+ major: "major";
4
+ minor: "minor";
5
+ patch: "patch";
6
+ prerelease: "prerelease";
7
+ };
8
+ export declare class SemverError extends Error {
9
+ constructor(message: string);
10
+ }
11
+ export declare class Semver {
12
+ private version;
13
+ constructor(version: string);
14
+ increment(versionType: VersionType, preid?: string): Semver;
15
+ /** This version's major.minor.patch with `prerelease` in place of any it has now. */
16
+ withPrerelease(prerelease: string): Semver;
17
+ toString(): string;
18
+ private ensureValid;
19
+ private parse;
20
+ }
@@ -1,4 +1,4 @@
1
- import type { PackageJson, Project, Workspace } from "@decohere/mesh";
1
+ import type { PackageJson, Project, Workspace } from "@decohere/workspace";
2
2
  import type { DependencyWarning, DriftEntry, Package } from "../types/dependency.types.js";
3
3
  export type ProjectDependencies = {
4
4
  project: Project;
@@ -9,6 +9,13 @@ export declare class DependencyResolver {
9
9
  computeDrift(current: PackageJson, computed: PackageJson): DriftEntry | null;
10
10
  getWorkspacePackages(workspace: Workspace, projects: readonly Project[]): Promise<Map<string, Package>>;
11
11
  computeProjectDependencies(project: Project, workspacePackages: Map<string, Package>): Promise<ProjectDependencies>;
12
+ /**
13
+ * A package declares its peers by name in its own `peerDependencies` (and marks optional ones in
14
+ * `peerDependenciesMeta`, which sync leaves as written). The root owns every version, so each
15
+ * peer gets the root's range; a peer the root doesn't list is an error. A declared peer stays
16
+ * even when no code imports it: a pino transport, say, is loaded by name.
17
+ */
18
+ private getPeerDependencies;
12
19
  private getDependencies;
13
20
  private getDependencyFrom;
14
21
  private getFileImports;