@decohere/forge 0.0.1-dev.115 → 0.0.1-dev.116
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 +11 -11
- package/commonjs/src/actions/build.action.js +4 -4
- package/commonjs/src/actions/clean.action.js +4 -4
- package/commonjs/src/actions/commit.action.js +4 -4
- package/commonjs/src/actions/copy.action.js +5 -5
- package/commonjs/src/actions/dependency-report.action.js +4 -4
- package/commonjs/src/actions/dependency-sync.action.js +3 -3
- package/commonjs/src/actions/docker.action.js +5 -5
- package/commonjs/src/actions/link.action.js +3 -3
- package/commonjs/src/actions/package.action.js +5 -5
- package/commonjs/src/actions/paths.action.js +4 -4
- package/commonjs/src/actions/publish.action.js +4 -4
- package/commonjs/src/actions/sync-lock-file.action.js +2 -2
- package/commonjs/src/actions/tag.action.js +4 -4
- package/commonjs/src/actions/typecheck.action.js +4 -4
- package/commonjs/src/actions/unlink.action.js +1 -1
- package/commonjs/src/actions/version.action.js +5 -5
- package/commonjs/src/actions/watch.action.js +3 -3
- package/commonjs/src/commands/build.command.js +1 -1
- package/commonjs/src/commands/dependency.command.js +1 -1
- package/commonjs/src/commands/docker.command.js +1 -1
- package/commonjs/src/commands/forge.command.js +1 -1
- package/commonjs/src/commands/link.command.js +1 -1
- package/commonjs/src/commands/package.command.js +1 -1
- package/commonjs/src/commands/paths.command.js +1 -1
- package/commonjs/src/commands/publish.command.js +1 -1
- package/commonjs/src/commands/tag.command.js +1 -1
- package/commonjs/src/commands/typecheck.command.js +1 -1
- package/commonjs/src/commands/version.command.js +1 -1
- package/commonjs/src/create-workspace.js +5 -5
- package/commonjs/src/errors.js +2 -2
- package/commonjs/src/extensions/project.extensions.js +10 -10
- package/commonjs/src/factories/swc-config.factory.js +4 -4
- package/commonjs/src/forge.module.js +1 -1
- package/commonjs/src/packaging/dependency-pinner.service.js +1 -1
- package/commonjs/src/packaging/deployable.js +1 -1
- package/commonjs/src/packaging/import-graph.service.js +1 -1
- package/commonjs/src/packaging/release-exports.js +2 -2
- package/commonjs/src/packaging/ui-assets.js +1 -1
- package/commonjs/src/services/dependency-resolver.service.js +1 -1
- package/commonjs/src/services/file-writer.service.js +2 -2
- package/commonjs/src/services/output-cache.js +1 -1
- package/commonjs/src/services/swc-transpiler.js +5 -5
- package/commonjs/src/services/ts-program-host.js +2 -2
- package/commonjs/src/services/type-emission-program.js +1 -1
- package/commonjs/src/services/type-emitter.js +4 -4
- package/commonjs/src/vitest/forge-build.plugin.js +4 -4
- package/commonjs/src/workspace.config.js +2 -2
- package/es6/src/actions/build.action.js +3 -3
- package/es6/src/actions/clean.action.js +3 -3
- package/es6/src/actions/commit.action.js +3 -3
- package/es6/src/actions/copy.action.js +4 -4
- package/es6/src/actions/dependency-report.action.js +3 -3
- package/es6/src/actions/dependency-sync.action.js +2 -2
- package/es6/src/actions/docker.action.js +4 -4
- package/es6/src/actions/link.action.js +2 -2
- package/es6/src/actions/package.action.js +4 -4
- package/es6/src/actions/paths.action.js +2 -2
- package/es6/src/actions/publish.action.js +3 -3
- package/es6/src/actions/sync-lock-file.action.js +2 -2
- package/es6/src/actions/tag.action.js +3 -3
- package/es6/src/actions/typecheck.action.js +3 -3
- package/es6/src/actions/unlink.action.js +1 -1
- package/es6/src/actions/version.action.js +4 -4
- package/es6/src/actions/watch.action.js +2 -2
- package/es6/src/commands/build.command.js +1 -1
- package/es6/src/commands/dependency.command.js +1 -1
- package/es6/src/commands/docker.command.js +1 -1
- package/es6/src/commands/forge.command.js +1 -1
- package/es6/src/commands/link.command.js +1 -1
- package/es6/src/commands/package.command.js +1 -1
- package/es6/src/commands/paths.command.js +1 -1
- package/es6/src/commands/publish.command.js +1 -1
- package/es6/src/commands/tag.command.js +1 -1
- package/es6/src/commands/typecheck.command.js +1 -1
- package/es6/src/commands/version.command.js +1 -1
- package/es6/src/create-workspace.js +1 -1
- package/es6/src/errors.js +1 -1
- package/es6/src/extensions/project.extensions.js +4 -4
- package/es6/src/factories/swc-config.factory.js +3 -3
- package/es6/src/forge.module.js +1 -1
- package/es6/src/packaging/dependency-pinner.service.js +1 -1
- package/es6/src/packaging/deployable.js +1 -1
- package/es6/src/packaging/import-graph.service.js +1 -1
- package/es6/src/packaging/release-exports.js +1 -1
- package/es6/src/packaging/ui-assets.js +1 -1
- package/es6/src/services/dependency-resolver.service.js +1 -1
- package/es6/src/services/file-writer.service.js +2 -2
- package/es6/src/services/output-cache.js +1 -1
- package/es6/src/services/swc-transpiler.js +4 -4
- package/es6/src/services/ts-program-host.js +2 -2
- package/es6/src/services/type-emission-program.js +1 -1
- package/es6/src/services/type-emitter.js +4 -4
- package/es6/src/vitest/forge-build.plugin.js +2 -2
- package/es6/src/workspace.config.js +1 -1
- package/package.json +5 -5
- package/types/src/actions/build.action.d.ts +4 -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 +3 -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 +3 -3
- package/types/src/actions/link.action.d.ts +3 -3
- package/types/src/actions/package.action.d.ts +3 -3
- package/types/src/actions/paths.action.d.ts +4 -4
- 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 +3 -3
- package/types/src/actions/unlink.action.d.ts +2 -2
- 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 +2 -2
- package/types/src/commands/dependency.command.d.ts +2 -2
- package/types/src/commands/docker.command.d.ts +1 -1
- package/types/src/commands/forge.command.d.ts +2 -2
- package/types/src/commands/link.command.d.ts +2 -2
- package/types/src/commands/package.command.d.ts +1 -1
- package/types/src/commands/paths.command.d.ts +1 -1
- 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 +1 -1
- package/types/src/commands/version.command.d.ts +1 -1
- package/types/src/create-workspace.d.ts +2 -2
- 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 +1 -1
- package/types/src/forge.module.d.ts +4 -4
- package/types/src/packaging/dependency-pinner.service.d.ts +1 -1
- package/types/src/packaging/deployable.d.ts +1 -1
- package/types/src/packaging/import-graph.service.d.ts +1 -1
- package/types/src/packaging/release-exports.d.ts +1 -1
- package/types/src/packaging/ui-assets.d.ts +1 -1
- package/types/src/services/dependency-resolver.service.d.ts +1 -1
- package/types/src/services/file-writer.service.d.ts +1 -1
- package/types/src/services/incremental-watch.d.ts +1 -1
- package/types/src/services/swc-transpiler.d.ts +2 -2
- package/types/src/services/ts-program-host.d.ts +1 -1
- package/types/src/services/type-emission-program.d.ts +2 -2
- package/types/src/services/type-emitter.d.ts +3 -3
- package/types/src/types/configuration.type.d.ts +1 -1
- package/types/src/types/dependency.types.d.ts +1 -1
- package/types/src/types/swc-config.type.d.ts +1 -1
- package/types/src/types/transform-response.model.d.ts +2 -2
- package/types/src/types/transformer.type.d.ts +2 -2
- package/types/src/types/workspace-config.type.d.ts +3 -3
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@ Build system (SWC). `forge build --configuration debug` rewrites workspace impor
|
|
|
8
8
|
|
|
9
9
|
## Debug path aliases (not `node_modules` links)
|
|
10
10
|
|
|
11
|
-
Forge debug (`aliasPaths: true`) asks
|
|
11
|
+
Forge debug (`aliasPaths: true`) asks the workspace package for a map of `package.json` `name` → source `main` (`Workspace.getPackageAliases`) and feeds it to SWC as `jsc.paths`. Flux uses the same map in its resolve hook only, and compiles without `jsc.paths` or `resolveFully`, so imports are resolved once (#513).
|
|
12
12
|
|
|
13
|
-
`tsc` can't read
|
|
13
|
+
`tsc` can't read the workspace alias map, and without `node_modules` links it finds workspace packages only through tsconfig `paths`. `forge paths` writes the map to `tsconfig.paths.json` for the root tsconfig to extend, and `forge paths --check` fails when the file is out of date (#518).
|
|
14
14
|
|
|
15
15
|
That is a **debug** rule. Release does not rewrite aliases: production must resolve like any other Node app (installed packages, `exports` / `main` pointing at emitted JS).
|
|
16
16
|
|
|
@@ -19,8 +19,8 @@ That is a **debug** rule. Release does not rewrite aliases: production must reso
|
|
|
19
19
|
npm/pnpm/yarn already put workspace packages in `node_modules` as symlinks. Node then follows `exports` / `main` — the **published** shape. That is correct after `forge` release. It is the wrong graph while you are editing `.ts`:
|
|
20
20
|
|
|
21
21
|
- Specifiers land on built JS (often missing or stale) instead of the file you saved.
|
|
22
|
-
- Flux’s HMR map is keyed by
|
|
23
|
-
- The installer layout (hoist vs isolated, which packages got linked) becomes a second workspace next to
|
|
22
|
+
- Flux’s HMR map is keyed by workspace project paths (`projects/…/src/…`). A `node_modules/@scope/pkg/…` URL is a different path, so the load hook and the watch graph miss it.
|
|
23
|
+
- The installer layout (hoist vs isolated, which packages got linked) becomes a second workspace graph next to `@decohere/workspace`'s. Those drift.
|
|
24
24
|
|
|
25
25
|
Aliases always point at source `main`. Adding a package is discovering its `package.json`; debug does not wait on a reinstall. `forge link` is a different job: symlink **emit** into a consumer’s `node_modules`. Do not use that for Flux/debug source.
|
|
26
26
|
|
|
@@ -66,17 +66,17 @@ shop.api/main.ts
|
|
|
66
66
|
import "@app/shop.domain"
|
|
67
67
|
│
|
|
68
68
|
▼
|
|
69
|
-
|
|
69
|
+
Workspace map: "@app/shop.domain" → projects/shop.domain/src/index.ts
|
|
70
70
|
│
|
|
71
71
|
▼
|
|
72
|
-
SWC transpile + Flux HMR graph (same path
|
|
72
|
+
SWC transpile + Flux HMR graph (same path the workspace watches)
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
Save `src/index.ts` → Flux reboots `shop.api`. No pre-build of `shop.domain`, no `node_modules` link required for that import.
|
|
76
76
|
|
|
77
77
|
## `forge package`: one folder a plain `node` can run
|
|
78
78
|
|
|
79
|
-
`forge build --configuration release` keeps bare imports such as `@app/shop.domain`, so a deployable that imports a workspace library cannot run from `dist/release` on its own: there is no
|
|
79
|
+
`forge build --configuration release` keeps bare imports such as `@app/shop.domain`, so a deployable that imports a workspace library cannot run from `dist/release` on its own: there is no workspace package in production, and Node can only find those packages in `node_modules`. `forge package` makes that folder instead of symlinking `node_modules` into `dist` (what `forge link` does, for development).
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
forge build --configuration release
|
|
@@ -97,7 +97,7 @@ projects/shop.api/.package/
|
|
|
97
97
|
config/ the workspace's config/ folder (YamlDataSource reads ./config)
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
- **Which libraries.** Forge walks the compiled import graph from the deployable's `main`, following relative imports and bare imports that
|
|
100
|
+
- **Which libraries.** Forge walks the compiled import graph from the deployable's `main`, following relative imports and bare imports that the workspace package resolves to a workspace project (including subpath `exports` such as `@app/kernel/testing`, and transitively through copied libraries). Only those libraries are copied. A library nothing reaches, and its dependencies, stay out.
|
|
101
101
|
- **Which third-party packages.** What is **declared** ships: the union of `dependencies` (never `devDependencies`) of the deployable, every copied library and the workspace root `package.json`. They do not have to be imported, so a module loaded by name at run time (a pino transport `target: "pino-roll"`) ships as long as it is declared. Removing dependencies nothing uses is the author's job; a warning-only unused-dependency analysis is planned in [#635](https://github.com/typesmiths/decohere/issues/635).
|
|
102
102
|
- **Versions.** Each shipped package is pinned to the exact version installed in the workspace (so the image runs what the tests ran). A declared package that is not installed fails the command.
|
|
103
103
|
- **Imports that would crash.** If packaged code imports a third-party package that is only a `devDependency`, or declared nowhere, the command fails and names the package and who imports it.
|
|
@@ -115,10 +115,10 @@ CMD ["node", "es6/src/main.js"]
|
|
|
115
115
|
|
|
116
116
|
### Shipping the UI with the API
|
|
117
117
|
|
|
118
|
-
A module deploys its API and its UI as one image: the API serves the UI's build ([`withStatic` in
|
|
118
|
+
A module deploys its API and its UI as one image: the API serves the UI's build ([`withStatic` in `@decohere/http`](../http/README.md#serving-a-built-ui)). To put that build in the package, declare the UI project on the deployable in `.decohere.js`, next to `docker`:
|
|
119
119
|
|
|
120
120
|
```js
|
|
121
|
-
/** @type {import("@decohere/
|
|
121
|
+
/** @type {import("@decohere/workspace").WorkspaceOptions} */
|
|
122
122
|
export default {
|
|
123
123
|
projects: {
|
|
124
124
|
"@app/shop.api": {
|
|
@@ -132,7 +132,7 @@ export default {
|
|
|
132
132
|
};
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
`forge package @app/shop.api` then copies `projects/shop.web/dist/` to `projects/shop.api/.package/ui/` (real files, never links). The API calls `.withStatic("/ui/", "ui")` and the Dockerfile stays `COPY .package/ ./`. `forge package` does **not** build the UI: if the folder is missing it fails and tells you to build the UI first. `to` must be a new folder inside `.package/` (not `es6`, `node_modules` or `config`). Running the UI's own toolchain from `forge build` is [#381](https://github.com/typesmiths/decohere/issues/381); see [ADR 0007](../../docs/adr/0007-serving-a-built-ui-from-
|
|
135
|
+
`forge package @app/shop.api` then copies `projects/shop.web/dist/` to `projects/shop.api/.package/ui/` (real files, never links). The API calls `.withStatic("/ui/", "ui")` and the Dockerfile stays `COPY .package/ ./`. `forge package` does **not** build the UI: if the folder is missing it fails and tells you to build the UI first. `to` must be a new folder inside `.package/` (not `es6`, `node_modules` or `config`). Running the UI's own toolchain from `forge build` is [#381](https://github.com/typesmiths/decohere/issues/381); see [ADR 0007](../../docs/adr/0007-serving-a-built-ui-from-http.md).
|
|
136
136
|
|
|
137
137
|
Design record: [ADR 0006](../../docs/adr/0006-forge-package-deployables.md).
|
|
138
138
|
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "Build", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
14
|
-
const _diagnostics = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
|
+
const _diagnostics = require("@decohere/core/diagnostics");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
const _errors = require("../errors.js");
|
|
17
17
|
const _filewriterservice = require("../services/file-writer.service.js");
|
|
@@ -107,7 +107,7 @@ Build = _ts_decorate([
|
|
|
107
107
|
_ts_param(1, (0, _decorators.inject)(_transformertype.TransformerKey)),
|
|
108
108
|
_ts_metadata("design:type", Function),
|
|
109
109
|
_ts_metadata("design:paramtypes", [
|
|
110
|
-
typeof
|
|
110
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace,
|
|
111
111
|
Array,
|
|
112
112
|
typeof _filewriterservice.FileWriterService === "undefined" ? Object : _filewriterservice.FileWriterService
|
|
113
113
|
])
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "Clean", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
14
|
-
const _io = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
|
+
const _io = require("@decohere/core/io");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
function _ts_decorate(decorators, target, key, desc) {
|
|
17
17
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -48,6 +48,6 @@ Clean = _ts_decorate([
|
|
|
48
48
|
(0, _decorators.injectable)(),
|
|
49
49
|
_ts_metadata("design:type", Function),
|
|
50
50
|
_ts_metadata("design:paramtypes", [
|
|
51
|
-
typeof
|
|
51
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
52
52
|
])
|
|
53
53
|
], Clean);
|
|
@@ -10,9 +10,9 @@ Object.defineProperty(exports, "CommitFiles", {
|
|
|
10
10
|
});
|
|
11
11
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
12
12
|
const _decorators = require("@decohere/crucible/decorators");
|
|
13
|
-
const
|
|
14
|
-
const _cli = require("@decohere/
|
|
15
|
-
const _interop = require("@decohere/
|
|
13
|
+
const _workspace = require("@decohere/workspace");
|
|
14
|
+
const _cli = require("@decohere/core/cli");
|
|
15
|
+
const _interop = require("@decohere/core/interop");
|
|
16
16
|
const _scribe = require("@decohere/scribe");
|
|
17
17
|
const _errors = require("../errors.js");
|
|
18
18
|
const _workspaceconfig = require("../workspace.config.js");
|
|
@@ -80,6 +80,6 @@ CommitFiles = _ts_decorate([
|
|
|
80
80
|
(0, _decorators.injectable)(),
|
|
81
81
|
_ts_metadata("design:type", Function),
|
|
82
82
|
_ts_metadata("design:paramtypes", [
|
|
83
|
-
typeof
|
|
83
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
84
84
|
])
|
|
85
85
|
], CommitFiles);
|
|
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "Copy", {
|
|
|
10
10
|
});
|
|
11
11
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
12
12
|
const _decorators = require("@decohere/crucible/decorators");
|
|
13
|
-
const
|
|
14
|
-
const _cli = require("@decohere/
|
|
15
|
-
const _io = require("@decohere/
|
|
16
|
-
const _system = require("@decohere/
|
|
13
|
+
const _workspace = require("@decohere/workspace");
|
|
14
|
+
const _cli = require("@decohere/core/cli");
|
|
15
|
+
const _io = require("@decohere/core/io");
|
|
16
|
+
const _system = require("@decohere/core/system");
|
|
17
17
|
const _scribe = require("@decohere/scribe");
|
|
18
18
|
function _interop_require_default(obj) {
|
|
19
19
|
return obj && obj.__esModule ? obj : {
|
|
@@ -108,6 +108,6 @@ Copy = _ts_decorate([
|
|
|
108
108
|
(0, _decorators.injectable)(),
|
|
109
109
|
_ts_metadata("design:type", Function),
|
|
110
110
|
_ts_metadata("design:paramtypes", [
|
|
111
|
-
typeof
|
|
111
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
112
112
|
])
|
|
113
113
|
], Copy);
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "ReportDependencies", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
14
|
-
const _io = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
|
+
const _io = require("@decohere/core/io");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
const _errors = require("../errors.js");
|
|
17
17
|
const _dependencyresolverservice = require("../services/dependency-resolver.service.js");
|
|
@@ -134,7 +134,7 @@ ReportDependencies = _ts_decorate([
|
|
|
134
134
|
(0, _decorators.injectable)(),
|
|
135
135
|
_ts_metadata("design:type", Function),
|
|
136
136
|
_ts_metadata("design:paramtypes", [
|
|
137
|
-
typeof
|
|
137
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace,
|
|
138
138
|
typeof _dependencyresolverservice.DependencyResolver === "undefined" ? Object : _dependencyresolverservice.DependencyResolver
|
|
139
139
|
])
|
|
140
140
|
], ReportDependencies);
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "SyncDependencies", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
14
|
const _scribe = require("@decohere/scribe");
|
|
15
15
|
const _errors = require("../errors.js");
|
|
16
16
|
const _dependencyresolverservice = require("../services/dependency-resolver.service.js");
|
|
@@ -92,7 +92,7 @@ SyncDependencies = _ts_decorate([
|
|
|
92
92
|
(0, _decorators.injectable)(),
|
|
93
93
|
_ts_metadata("design:type", Function),
|
|
94
94
|
_ts_metadata("design:paramtypes", [
|
|
95
|
-
typeof
|
|
95
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace,
|
|
96
96
|
typeof _dependencyresolverservice.DependencyResolver === "undefined" ? Object : _dependencyresolverservice.DependencyResolver
|
|
97
97
|
])
|
|
98
98
|
], SyncDependencies);
|
|
@@ -10,10 +10,10 @@ Object.defineProperty(exports, "Docker", {
|
|
|
10
10
|
});
|
|
11
11
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
12
12
|
const _decorators = require("@decohere/crucible/decorators");
|
|
13
|
-
const
|
|
14
|
-
const _cli = require("@decohere/
|
|
15
|
-
const _interop = require("@decohere/
|
|
16
|
-
const _io = require("@decohere/
|
|
13
|
+
const _workspace = require("@decohere/workspace");
|
|
14
|
+
const _cli = require("@decohere/core/cli");
|
|
15
|
+
const _interop = require("@decohere/core/interop");
|
|
16
|
+
const _io = require("@decohere/core/io");
|
|
17
17
|
const _scribe = require("@decohere/scribe");
|
|
18
18
|
const _errors = require("../errors.js");
|
|
19
19
|
const _deployable = require("../packaging/deployable.js");
|
|
@@ -204,6 +204,6 @@ Docker = _ts_decorate([
|
|
|
204
204
|
(0, _decorators.injectable)(),
|
|
205
205
|
_ts_metadata("design:type", Function),
|
|
206
206
|
_ts_metadata("design:paramtypes", [
|
|
207
|
-
typeof
|
|
207
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
208
208
|
])
|
|
209
209
|
], Docker);
|
|
@@ -22,8 +22,8 @@ _export(exports, {
|
|
|
22
22
|
const _promises = /*#__PURE__*/ _interop_require_default(require("node:fs/promises"));
|
|
23
23
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
24
24
|
const _decorators = require("@decohere/crucible/decorators");
|
|
25
|
-
const
|
|
26
|
-
const _cli = require("@decohere/
|
|
25
|
+
const _workspace = require("@decohere/workspace");
|
|
26
|
+
const _cli = require("@decohere/core/cli");
|
|
27
27
|
const _scribe = require("@decohere/scribe");
|
|
28
28
|
require("../extensions/project.extensions.js");
|
|
29
29
|
const _errors = require("../errors.js");
|
|
@@ -149,6 +149,6 @@ Link = _ts_decorate([
|
|
|
149
149
|
(0, _decorators.injectable)(),
|
|
150
150
|
_ts_metadata("design:type", Function),
|
|
151
151
|
_ts_metadata("design:paramtypes", [
|
|
152
|
-
typeof
|
|
152
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
153
153
|
])
|
|
154
154
|
], Link);
|
|
@@ -11,10 +11,10 @@ Object.defineProperty(exports, "PackageDeployable", {
|
|
|
11
11
|
const _promises = /*#__PURE__*/ _interop_require_default(require("node:fs/promises"));
|
|
12
12
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
13
13
|
const _decorators = require("@decohere/crucible/decorators");
|
|
14
|
-
const
|
|
15
|
-
const _cli = require("@decohere/
|
|
16
|
-
const _interop = require("@decohere/
|
|
17
|
-
const _io = require("@decohere/
|
|
14
|
+
const _workspace = require("@decohere/workspace");
|
|
15
|
+
const _cli = require("@decohere/core/cli");
|
|
16
|
+
const _interop = require("@decohere/core/interop");
|
|
17
|
+
const _io = require("@decohere/core/io");
|
|
18
18
|
const _scribe = require("@decohere/scribe");
|
|
19
19
|
const _errors = require("../errors.js");
|
|
20
20
|
const _dependencypinnerservice = require("../packaging/dependency-pinner.service.js");
|
|
@@ -227,7 +227,7 @@ PackageDeployable = _ts_decorate([
|
|
|
227
227
|
(0, _decorators.injectable)(),
|
|
228
228
|
_ts_metadata("design:type", Function),
|
|
229
229
|
_ts_metadata("design:paramtypes", [
|
|
230
|
-
typeof
|
|
230
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace,
|
|
231
231
|
typeof _importgraphservice.ImportGraph === "undefined" ? Object : _importgraphservice.ImportGraph,
|
|
232
232
|
typeof _dependencypinnerservice.DependencyPinner === "undefined" ? Object : _dependencypinnerservice.DependencyPinner
|
|
233
233
|
])
|
|
@@ -20,8 +20,8 @@ const _nodefs = require("node:fs");
|
|
|
20
20
|
const _promises = require("node:fs/promises");
|
|
21
21
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
22
22
|
const _decorators = require("@decohere/crucible/decorators");
|
|
23
|
-
const
|
|
24
|
-
const _cli = require("@decohere/
|
|
23
|
+
const _workspace = require("@decohere/workspace");
|
|
24
|
+
const _cli = require("@decohere/core/cli");
|
|
25
25
|
const _scribe = require("@decohere/scribe");
|
|
26
26
|
function _interop_require_default(obj) {
|
|
27
27
|
return obj && obj.__esModule ? obj : {
|
|
@@ -84,7 +84,7 @@ class Paths {
|
|
|
84
84
|
}
|
|
85
85
|
/** The file's content: convention and exported subpaths only, never the tsconfig's own paths. */ static render(workspace) {
|
|
86
86
|
const rootDir = _nodepath.default.resolve(workspace.rootDir);
|
|
87
|
-
const { paths } =
|
|
87
|
+
const { paths } = _workspace.packageAliases.build(workspace.getProjects("debug"), {
|
|
88
88
|
baseUrl: rootDir
|
|
89
89
|
});
|
|
90
90
|
const sorted = Object.fromEntries(Object.keys(paths).sort().map((key)=>[
|
|
@@ -104,6 +104,6 @@ Paths = _ts_decorate([
|
|
|
104
104
|
(0, _decorators.injectable)(),
|
|
105
105
|
_ts_metadata("design:type", Function),
|
|
106
106
|
_ts_metadata("design:paramtypes", [
|
|
107
|
-
typeof
|
|
107
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
108
108
|
])
|
|
109
109
|
], Paths);
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "Publish", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
14
|
-
const _interop = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
|
+
const _interop = require("@decohere/core/interop");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
const _errors = require("../errors.js");
|
|
17
17
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -149,6 +149,6 @@ Publish = _ts_decorate([
|
|
|
149
149
|
(0, _decorators.injectable)(),
|
|
150
150
|
_ts_metadata("design:type", Function),
|
|
151
151
|
_ts_metadata("design:paramtypes", [
|
|
152
|
-
typeof
|
|
152
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
153
153
|
])
|
|
154
154
|
], Publish);
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "SyncLockFile", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const _cli = require("@decohere/
|
|
13
|
-
const _interop = require("@decohere/
|
|
12
|
+
const _cli = require("@decohere/core/cli");
|
|
13
|
+
const _interop = require("@decohere/core/interop");
|
|
14
14
|
const _scribe = require("@decohere/scribe");
|
|
15
15
|
const _errors = require("../errors.js");
|
|
16
16
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "Tag", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
14
|
-
const _interop = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
|
+
const _interop = require("@decohere/core/interop");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
const _errors = require("../errors.js");
|
|
17
17
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -68,6 +68,6 @@ Tag = _ts_decorate([
|
|
|
68
68
|
(0, _decorators.injectable)(),
|
|
69
69
|
_ts_metadata("design:type", Function),
|
|
70
70
|
_ts_metadata("design:paramtypes", [
|
|
71
|
-
typeof
|
|
71
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
72
72
|
])
|
|
73
73
|
], Tag);
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "TypeCheck", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
14
|
-
const _diagnostics = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
|
+
const _diagnostics = require("@decohere/core/diagnostics");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
const _typescript = /*#__PURE__*/ _interop_require_default(require("typescript"));
|
|
17
17
|
const _errors = require("../errors.js");
|
|
@@ -61,7 +61,7 @@ TypeCheck = _ts_decorate([
|
|
|
61
61
|
(0, _decorators.injectable)(),
|
|
62
62
|
_ts_metadata("design:type", Function),
|
|
63
63
|
_ts_metadata("design:paramtypes", [
|
|
64
|
-
typeof
|
|
64
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace,
|
|
65
65
|
typeof _typeemitter.TypeEmitter === "undefined" ? Object : _typeemitter.TypeEmitter
|
|
66
66
|
])
|
|
67
67
|
], TypeCheck);
|
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "Unlink", {
|
|
|
11
11
|
const _promises = /*#__PURE__*/ _interop_require_default(require("node:fs/promises"));
|
|
12
12
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
13
13
|
const _decorators = require("@decohere/crucible/decorators");
|
|
14
|
-
const _cli = require("@decohere/
|
|
14
|
+
const _cli = require("@decohere/core/cli");
|
|
15
15
|
const _scribe = require("@decohere/scribe");
|
|
16
16
|
const _errors = require("../errors.js");
|
|
17
17
|
const _linkaction = require("./link.action.js");
|
|
@@ -23,10 +23,10 @@ const _nodechild_process = require("node:child_process");
|
|
|
23
23
|
const _promises = require("node:fs/promises");
|
|
24
24
|
const _nodepath = require("node:path");
|
|
25
25
|
const _decorators = require("@decohere/crucible/decorators");
|
|
26
|
-
const
|
|
27
|
-
const _cli = require("@decohere/
|
|
28
|
-
const _interop = require("@decohere/
|
|
29
|
-
const _semver = require("@decohere/
|
|
26
|
+
const _workspace = require("@decohere/workspace");
|
|
27
|
+
const _cli = require("@decohere/core/cli");
|
|
28
|
+
const _interop = require("@decohere/core/interop");
|
|
29
|
+
const _semver = require("@decohere/core/semver");
|
|
30
30
|
const _scribe = require("@decohere/scribe");
|
|
31
31
|
const _errors = require("../errors.js");
|
|
32
32
|
function _ts_decorate(decorators, target, key, desc) {
|
|
@@ -200,6 +200,6 @@ Version = _ts_decorate([
|
|
|
200
200
|
(0, _decorators.injectable)(),
|
|
201
201
|
_ts_metadata("design:type", Function),
|
|
202
202
|
_ts_metadata("design:paramtypes", [
|
|
203
|
-
typeof
|
|
203
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
204
204
|
])
|
|
205
205
|
], Version);
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "Watch", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _decorators = require("@decohere/crucible/decorators");
|
|
12
|
-
const
|
|
13
|
-
const _cli = require("@decohere/
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
|
+
const _cli = require("@decohere/core/cli");
|
|
14
14
|
const _scribe = require("@decohere/scribe");
|
|
15
15
|
function _ts_decorate(decorators, target, key, desc) {
|
|
16
16
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -44,6 +44,6 @@ Watch = _ts_decorate([
|
|
|
44
44
|
(0, _decorators.injectable)(),
|
|
45
45
|
_ts_metadata("design:type", Function),
|
|
46
46
|
_ts_metadata("design:paramtypes", [
|
|
47
|
-
typeof
|
|
47
|
+
typeof _workspace.Workspace === "undefined" ? Object : _workspace.Workspace
|
|
48
48
|
])
|
|
49
49
|
], Watch);
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "BuildCommand", {
|
|
|
8
8
|
return BuildCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _auto = /*#__PURE__*/ _interop_require_default(require("async/auto.js"));
|
|
13
13
|
function _interop_require_default(obj) {
|
|
14
14
|
return obj && obj.__esModule ? obj : {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "DependencyCommand", {
|
|
|
8
8
|
return DependencyCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _commitaction = require("../actions/commit.action.js");
|
|
13
13
|
const _dependencyreportaction = require("../actions/dependency-report.action.js");
|
|
14
14
|
const _dependencysyncaction = require("../actions/dependency-sync.action.js");
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "DockerCommand", {
|
|
|
8
8
|
return DockerCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _dockeraction = require("../actions/docker.action.js");
|
|
13
13
|
class DockerCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "ForgeCommand", {
|
|
|
8
8
|
return ForgeCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
class ForgeCommand extends _cli.DecohereCommand {
|
|
13
13
|
constructor(commands, handler){
|
|
14
14
|
super(ForgeCommand);
|
|
@@ -16,7 +16,7 @@ _export(exports, {
|
|
|
16
16
|
return UnlinkCommand;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const _cli = require("@decohere/
|
|
19
|
+
const _cli = require("@decohere/core/cli");
|
|
20
20
|
const _auto = /*#__PURE__*/ _interop_require_default(require("async/auto.js"));
|
|
21
21
|
const _buildaction = require("../actions/build.action.js");
|
|
22
22
|
const _cleanaction = require("../actions/clean.action.js");
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "PackageCommand", {
|
|
|
8
8
|
return PackageCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _packageaction = require("../actions/package.action.js");
|
|
13
13
|
class PackageCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "PathsCommand", {
|
|
|
8
8
|
return PathsCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _pathsaction = require("../actions/paths.action.js");
|
|
13
13
|
class PathsCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "PublishCommand", {
|
|
|
8
8
|
return PublishCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _publishaction = require("../actions/publish.action.js");
|
|
13
13
|
class PublishCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "TagCommand", {
|
|
|
8
8
|
return TagCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _tagaction = require("../actions/tag.action.js");
|
|
13
13
|
class TagCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "TypeCheckCommand", {
|
|
|
8
8
|
return TypeCheckCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _typecheckaction = require("../actions/typecheck.action.js");
|
|
13
13
|
class TypeCheckCommand extends _cli.DecohereCommand {
|
|
14
14
|
get actions() {
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "VersionCommand", {
|
|
|
8
8
|
return VersionCommand;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _cli = require("@decohere/
|
|
11
|
+
const _cli = require("@decohere/core/cli");
|
|
12
12
|
const _synclockfileaction = require("../actions/sync-lock-file.action.js");
|
|
13
13
|
const _versionaction = require("../actions/version.action.js");
|
|
14
14
|
class VersionCommand extends _cli.DecohereCommand {
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "createWorkspace", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _nodepath = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
12
|
-
const
|
|
12
|
+
const _workspace = require("@decohere/workspace");
|
|
13
13
|
const _workspaceconfig = require("./workspace.config.js");
|
|
14
14
|
function _interop_require_default(obj) {
|
|
15
15
|
return obj && obj.__esModule ? obj : {
|
|
@@ -18,16 +18,16 @@ function _interop_require_default(obj) {
|
|
|
18
18
|
}
|
|
19
19
|
async function createWorkspace(options = {}) {
|
|
20
20
|
const rootDir = options.rootDir ?? defaultRootDir();
|
|
21
|
-
const configFile = options.configFile ?? (rootDir === _workspaceconfig.WorkspaceDefaults.rootDir ? undefined : _nodepath.default.join(rootDir,
|
|
21
|
+
const configFile = options.configFile ?? (rootDir === _workspaceconfig.WorkspaceDefaults.rootDir ? undefined : _nodepath.default.join(rootDir, _workspace.WORKSPACE_CONFIG));
|
|
22
22
|
// `projects` is dropped too: forge's defaults set it to undefined, which would override the
|
|
23
23
|
// user's per-project settings (docker, ui) in the merge.
|
|
24
24
|
const { configurations: _, projects: __, ...forgeDefaults } = _workspaceconfig.WorkspaceDefaults;
|
|
25
|
-
const userConfig = await
|
|
25
|
+
const userConfig = await _workspace.UserConfigFactory.getUserConfig(configFile);
|
|
26
26
|
// Only apply forge default configurations when user config doesn't provide any.
|
|
27
27
|
// This ensures user-defined configurations take priority while still providing
|
|
28
28
|
// sensible defaults (debug + release) when no config file is present.
|
|
29
29
|
const configurations = userConfig.configurations?.length ? undefined : _workspaceconfig.DefaultConfigurations;
|
|
30
|
-
return
|
|
30
|
+
return _workspace.WorkspaceFactory.create({
|
|
31
31
|
...forgeDefaults,
|
|
32
32
|
...configurations ? {
|
|
33
33
|
configurations
|
|
@@ -37,6 +37,6 @@ async function createWorkspace(options = {}) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
/** `./` when cwd is the root (keeps paths relative as before), else the root above it. */ function defaultRootDir() {
|
|
40
|
-
const root = (0,
|
|
40
|
+
const root = (0, _workspace.findWorkspaceRoot)(process.cwd());
|
|
41
41
|
return root === process.cwd() ? _workspaceconfig.WorkspaceDefaults.rootDir ?? "./" : root;
|
|
42
42
|
}
|
package/commonjs/src/errors.js
CHANGED
|
@@ -13,13 +13,13 @@ _export(exports, {
|
|
|
13
13
|
return ForgeError;
|
|
14
14
|
},
|
|
15
15
|
get WorkspaceConfigurationError () {
|
|
16
|
-
return
|
|
16
|
+
return _workspace.WorkspaceConfigurationError;
|
|
17
17
|
},
|
|
18
18
|
get formatUnknownError () {
|
|
19
19
|
return formatUnknownError;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const _workspace = require("@decohere/workspace");
|
|
23
23
|
class ForgeError extends Error {
|
|
24
24
|
}
|
|
25
25
|
function formatUnknownError(reason) {
|