@mannyc1/ts-release 0.0.0 → 0.0.2
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/ARCHITECTURE.md +53 -0
- package/README.md +243 -43
- package/SPEC.md +8 -1
- package/dist/cli/command.d.ts +1 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js +116 -33
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/main.js +3 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/domain/evidence.d.ts +49 -3
- package/dist/domain/evidence.d.ts.map +1 -1
- package/dist/domain/evidence.js +43 -2
- package/dist/domain/evidence.js.map +1 -1
- package/dist/domain/operation.d.ts +56 -2
- package/dist/domain/operation.d.ts.map +1 -1
- package/dist/domain/operation.js +78 -2
- package/dist/domain/operation.js.map +1 -1
- package/dist/domain/release.d.ts +4 -4
- package/dist/domain/remote-state.d.ts +90 -0
- package/dist/domain/remote-state.d.ts.map +1 -0
- package/dist/domain/remote-state.js +85 -0
- package/dist/domain/remote-state.js.map +1 -0
- package/dist/domain/status.d.ts +43 -0
- package/dist/domain/status.d.ts.map +1 -0
- package/dist/domain/status.js +50 -0
- package/dist/domain/status.js.map +1 -0
- package/dist/domain/target.d.ts +63 -3
- package/dist/domain/target.d.ts.map +1 -1
- package/dist/domain/target.js +75 -5
- package/dist/domain/target.js.map +1 -1
- package/dist/host/host.d.ts +7 -23
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.js +3 -22
- package/dist/host/host.js.map +1 -1
- package/dist/host/http-live.d.ts +6 -0
- package/dist/host/http-live.d.ts.map +1 -0
- package/dist/host/http-live.js +82 -0
- package/dist/host/http-live.js.map +1 -0
- package/dist/host/http.d.ts +40 -0
- package/dist/host/http.d.ts.map +1 -0
- package/dist/host/http.js +56 -0
- package/dist/host/http.js.map +1 -0
- package/dist/host/platform.d.ts +10 -0
- package/dist/host/platform.d.ts.map +1 -0
- package/dist/host/platform.js +121 -0
- package/dist/host/platform.js.map +1 -0
- package/dist/host/test.d.ts +6 -3
- package/dist/host/test.d.ts.map +1 -1
- package/dist/host/test.js +111 -25
- package/dist/host/test.js.map +1 -1
- package/dist/planner/artifact-inventory.d.ts +9 -0
- package/dist/planner/artifact-inventory.d.ts.map +1 -0
- package/dist/planner/artifact-inventory.js +66 -0
- package/dist/planner/artifact-inventory.js.map +1 -0
- package/dist/planner/create-release-plan.d.ts +1 -1
- package/dist/planner/create-release-plan.d.ts.map +1 -1
- package/dist/planner/errors.d.ts +41 -3
- package/dist/planner/errors.d.ts.map +1 -1
- package/dist/planner/errors.js +35 -3
- package/dist/planner/errors.js.map +1 -1
- package/dist/planner/evidence-recorder.d.ts +16 -8
- package/dist/planner/evidence-recorder.d.ts.map +1 -1
- package/dist/planner/evidence-recorder.js +244 -17
- package/dist/planner/evidence-recorder.js.map +1 -1
- package/dist/planner/executor.d.ts +54 -15
- package/dist/planner/executor.d.ts.map +1 -1
- package/dist/planner/executor.js +117 -38
- package/dist/planner/executor.js.map +1 -1
- package/dist/planner/normalize-release.d.ts +2 -2
- package/dist/planner/normalize-release.d.ts.map +1 -1
- package/dist/planner/normalize-release.js +80 -42
- package/dist/planner/normalize-release.js.map +1 -1
- package/dist/planner/reconcile.d.ts +17 -0
- package/dist/planner/reconcile.d.ts.map +1 -0
- package/dist/planner/reconcile.js +280 -0
- package/dist/planner/reconcile.js.map +1 -0
- package/dist/planner/release-eligibility.d.ts +33 -0
- package/dist/planner/release-eligibility.d.ts.map +1 -0
- package/dist/planner/release-eligibility.js +172 -0
- package/dist/planner/release-eligibility.js.map +1 -0
- package/dist/planner/render-plan.d.ts.map +1 -1
- package/dist/planner/render-plan.js +30 -0
- package/dist/planner/render-plan.js.map +1 -1
- package/dist/planner/status.d.ts +40 -0
- package/dist/planner/status.d.ts.map +1 -0
- package/dist/planner/status.js +336 -0
- package/dist/planner/status.js.map +1 -0
- package/dist/runtime/bun.d.ts +9 -0
- package/dist/runtime/bun.d.ts.map +1 -0
- package/dist/runtime/bun.js +10 -0
- package/dist/runtime/bun.js.map +1 -0
- package/dist/targets/adapter-helpers.d.ts +31 -0
- package/dist/targets/adapter-helpers.d.ts.map +1 -0
- package/dist/targets/adapter-helpers.js +67 -0
- package/dist/targets/adapter-helpers.js.map +1 -0
- package/dist/targets/adapter.d.ts +3 -1
- package/dist/targets/adapter.d.ts.map +1 -1
- package/dist/targets/github.d.ts +2 -2
- package/dist/targets/github.d.ts.map +1 -1
- package/dist/targets/github.js +74 -83
- package/dist/targets/github.js.map +1 -1
- package/dist/targets/homebrew.d.ts +2 -2
- package/dist/targets/homebrew.d.ts.map +1 -1
- package/dist/targets/homebrew.js +45 -75
- package/dist/targets/homebrew.js.map +1 -1
- package/dist/targets/live.d.ts.map +1 -1
- package/dist/targets/live.js +10 -0
- package/dist/targets/live.js.map +1 -1
- package/dist/targets/npm.d.ts +2 -3
- package/dist/targets/npm.d.ts.map +1 -1
- package/dist/targets/npm.js +90 -55
- package/dist/targets/npm.js.map +1 -1
- package/dist/targets/pypi.d.ts +11 -0
- package/dist/targets/pypi.d.ts.map +1 -0
- package/dist/targets/pypi.js +115 -0
- package/dist/targets/pypi.js.map +1 -0
- package/dist/targets/registry.d.ts +3 -3
- package/dist/targets/registry.d.ts.map +1 -1
- package/dist/targets/scoop.d.ts +11 -0
- package/dist/targets/scoop.d.ts.map +1 -0
- package/dist/targets/scoop.js +93 -0
- package/dist/targets/scoop.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/workflows/config.d.ts +81 -0
- package/dist/workflows/config.d.ts.map +1 -0
- package/dist/workflows/config.js +191 -0
- package/dist/workflows/config.js.map +1 -0
- package/dist/workflows/evidence.d.ts +21 -0
- package/dist/workflows/evidence.d.ts.map +1 -0
- package/dist/workflows/evidence.js +45 -0
- package/dist/workflows/evidence.js.map +1 -0
- package/dist/workflows/live.d.ts +7 -0
- package/dist/workflows/live.d.ts.map +1 -0
- package/dist/workflows/live.js +5 -0
- package/dist/workflows/live.js.map +1 -0
- package/examples/README.md +20 -3
- package/examples/github-release/release.config.json +2 -1
- package/examples/multi-target/artifacts/release-example-multi-target-0.1.0.tgz +1 -0
- package/examples/multi-target/index.js +1 -0
- package/examples/multi-target/package.json +7 -0
- package/examples/multi-target/release.config.json +67 -0
- package/examples/non-strict-skips/release.config.json +1 -0
- package/examples/npm-first-publish/release.config.json +32 -0
- package/examples/npm-only/release.config.json +6 -1
- package/examples/pypi-registry/artifacts/release_example_pypi-0.1.0-py3-none-any.whl +1 -0
- package/examples/pypi-registry/release.config.json +30 -0
- package/examples/scoop-bucket/artifacts/release-example-scoop-0.1.0.zip +1 -0
- package/examples/scoop-bucket/release.config.json +36 -0
- package/package.json +48 -9
- package/dist/cli/programmatic.d.ts +0 -25
- package/dist/cli/programmatic.d.ts.map +0 -1
- package/dist/cli/programmatic.js +0 -48
- package/dist/cli/programmatic.js.map +0 -1
- package/dist/host/bun.d.ts +0 -9
- package/dist/host/bun.d.ts.map +0 -1
- package/dist/host/bun.js +0 -156
- package/dist/host/bun.js.map +0 -1
package/examples/README.md
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
# release examples
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Start with the coordinated release example:
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
cd examples/
|
|
6
|
+
cd examples/multi-target
|
|
7
7
|
bun ../../dist/cli/main.js plan --config release.config.json --format text
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
That plan shows one release split across the target classes this package models:
|
|
11
|
+
a release host (`github`), package registries (`npm`, `pypi`), and installer
|
|
12
|
+
catalogs (`homebrew`, `scoop`). Inspect the artifact inventory, target
|
|
13
|
+
capabilities, `argv` lines, approval gates, and generated catalog-file
|
|
14
|
+
operations. `plan` is safe: publish operations stay data until a caller passes
|
|
15
|
+
explicit execution approval.
|
|
11
16
|
|
|
17
|
+
Focused examples:
|
|
18
|
+
|
|
19
|
+
- `multi-target`: one release coordinated across GitHub Releases, npm, and Homebrew.
|
|
12
20
|
- `npm-only`: npm package directory with native npm dry-run validation.
|
|
21
|
+
- `npm-first-publish`: token-based npm bootstrap config for the first version before switching to trusted publishing.
|
|
13
22
|
- `github-release`: GitHub release asset with simulated GitHub dry-run validation.
|
|
14
23
|
- `homebrew-tap`: Homebrew tap formula rendering with simulated formula validation.
|
|
24
|
+
- `pypi-registry`: prebuilt Python distribution planned for TestPyPI with Twine.
|
|
25
|
+
- `scoop-bucket`: Scoop bucket manifest rendering with simulated validation.
|
|
15
26
|
- `non-strict-skips`: non-strict config that records skipped dry-run evidence.
|
|
27
|
+
|
|
28
|
+
`npm-first-publish` demonstrates only the bootstrap shape for a package that
|
|
29
|
+
does not exist on npm yet. Replace it with trusted publishing after the first
|
|
30
|
+
version exists. TestPyPI is still a real registry publish target, not a dry-run.
|
|
31
|
+
The examples only render plans; do not run publish operations without
|
|
32
|
+
intentional credentials and approval flags.
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
"_tag": "GitHubReleaseTarget",
|
|
20
20
|
"id": "github",
|
|
21
21
|
"repository": "owner/repo",
|
|
22
|
+
"tokenEnv": "GH_TOKEN",
|
|
22
23
|
"draft": true,
|
|
23
24
|
"prerelease": false,
|
|
24
|
-
"dryRunSupport": "
|
|
25
|
+
"dryRunSupport": "simulated",
|
|
25
26
|
"mutability": "mutable-release",
|
|
26
27
|
"recovery": "delete-and-recreate"
|
|
27
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
example multi-target release artifact
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const message = "release example"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identity": {
|
|
3
|
+
"name": "release-example-multi-target",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"commit": "example",
|
|
6
|
+
"tag": "v0.1.0",
|
|
7
|
+
"notes": "Example coordinated release"
|
|
8
|
+
},
|
|
9
|
+
"artifacts": [
|
|
10
|
+
{
|
|
11
|
+
"id": "package",
|
|
12
|
+
"path": ".",
|
|
13
|
+
"format": "directory",
|
|
14
|
+
"consumers": ["npm"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "archive",
|
|
18
|
+
"path": "artifacts/release-example-multi-target-0.1.0.tgz",
|
|
19
|
+
"format": "tarball",
|
|
20
|
+
"consumers": ["github", "homebrew"]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"targets": [
|
|
24
|
+
{
|
|
25
|
+
"_tag": "GitHubReleaseTarget",
|
|
26
|
+
"id": "github",
|
|
27
|
+
"repository": "owner/release-example-multi-target",
|
|
28
|
+
"tokenEnv": "GH_TOKEN",
|
|
29
|
+
"draft": true,
|
|
30
|
+
"prerelease": false,
|
|
31
|
+
"dryRunSupport": "simulated",
|
|
32
|
+
"mutability": "mutable-release",
|
|
33
|
+
"recovery": "delete-and-recreate"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"_tag": "NpmRegistryTarget",
|
|
37
|
+
"id": "npm",
|
|
38
|
+
"registry": "https://registry.npmjs.org",
|
|
39
|
+
"packageName": "release-example-multi-target",
|
|
40
|
+
"packagePath": ".",
|
|
41
|
+
"trustedPublishing": {
|
|
42
|
+
"provider": "github-actions",
|
|
43
|
+
"workflow": "release.yml",
|
|
44
|
+
"packageExists": true
|
|
45
|
+
},
|
|
46
|
+
"dryRunSupport": "native",
|
|
47
|
+
"mutability": "immutable",
|
|
48
|
+
"recovery": "publish-new-version"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"_tag": "HomebrewTapTarget",
|
|
52
|
+
"id": "homebrew",
|
|
53
|
+
"repository": "owner/homebrew-tap",
|
|
54
|
+
"formulaName": "release-example-multi-target",
|
|
55
|
+
"formulaPath": ".release/generated/release-example-multi-target.rb",
|
|
56
|
+
"artifactId": "archive",
|
|
57
|
+
"homepage": "https://github.com/owner/release-example-multi-target",
|
|
58
|
+
"url": "https://github.com/owner/release-example-multi-target/releases/download/v0.1.0/release-example-multi-target-0.1.0.tgz",
|
|
59
|
+
"installPath": "bin/release-example-multi-target",
|
|
60
|
+
"dryRunSupport": "simulated",
|
|
61
|
+
"mutability": "mutable-index",
|
|
62
|
+
"recovery": "manual"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"strict": true,
|
|
66
|
+
"evidenceDirectory": ".release/evidence"
|
|
67
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identity": {
|
|
3
|
+
"name": "@scope/release-example-first",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"commit": "example",
|
|
6
|
+
"tag": "v0.1.0"
|
|
7
|
+
},
|
|
8
|
+
"artifacts": [
|
|
9
|
+
{
|
|
10
|
+
"id": "package",
|
|
11
|
+
"path": ".",
|
|
12
|
+
"format": "directory",
|
|
13
|
+
"consumers": ["npm"]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"targets": [
|
|
17
|
+
{
|
|
18
|
+
"_tag": "NpmRegistryTarget",
|
|
19
|
+
"id": "npm",
|
|
20
|
+
"registry": "https://registry.npmjs.org",
|
|
21
|
+
"packageName": "@scope/release-example-first",
|
|
22
|
+
"packagePath": ".",
|
|
23
|
+
"tokenEnv": "NPM_TOKEN",
|
|
24
|
+
"access": "public",
|
|
25
|
+
"dryRunSupport": "native",
|
|
26
|
+
"mutability": "immutable",
|
|
27
|
+
"recovery": "publish-new-version"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"strict": true,
|
|
31
|
+
"evidenceDirectory": ".release/evidence"
|
|
32
|
+
}
|
|
@@ -18,8 +18,13 @@
|
|
|
18
18
|
"_tag": "NpmRegistryTarget",
|
|
19
19
|
"id": "npm",
|
|
20
20
|
"registry": "https://registry.npmjs.org",
|
|
21
|
+
"packageName": "release-example-npm-only",
|
|
21
22
|
"packagePath": ".",
|
|
22
|
-
"
|
|
23
|
+
"trustedPublishing": {
|
|
24
|
+
"provider": "github-actions",
|
|
25
|
+
"workflow": "release.yml",
|
|
26
|
+
"packageExists": true
|
|
27
|
+
},
|
|
23
28
|
"dryRunSupport": "native",
|
|
24
29
|
"mutability": "immutable",
|
|
25
30
|
"recovery": "publish-new-version"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
example pypi distribution artifact
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identity": {
|
|
3
|
+
"name": "release-example-pypi",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"commit": "example",
|
|
6
|
+
"tag": "v0.1.0"
|
|
7
|
+
},
|
|
8
|
+
"artifacts": [
|
|
9
|
+
{
|
|
10
|
+
"id": "wheel",
|
|
11
|
+
"path": "artifacts/release_example_pypi-0.1.0-py3-none-any.whl",
|
|
12
|
+
"format": "file",
|
|
13
|
+
"consumers": ["pypi"]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"targets": [
|
|
17
|
+
{
|
|
18
|
+
"_tag": "PyPiRegistryTarget",
|
|
19
|
+
"id": "pypi",
|
|
20
|
+
"repositoryUrl": "https://test.pypi.org/legacy/",
|
|
21
|
+
"usernameEnv": "TWINE_USERNAME",
|
|
22
|
+
"passwordEnv": "TWINE_PASSWORD",
|
|
23
|
+
"dryRunSupport": "native",
|
|
24
|
+
"mutability": "immutable",
|
|
25
|
+
"recovery": "publish-new-version"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"strict": true,
|
|
29
|
+
"evidenceDirectory": ".release/evidence"
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
example scoop release artifact
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identity": {
|
|
3
|
+
"name": "release-example-scoop",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"commit": "example",
|
|
6
|
+
"tag": "v0.1.0"
|
|
7
|
+
},
|
|
8
|
+
"artifacts": [
|
|
9
|
+
{
|
|
10
|
+
"id": "archive",
|
|
11
|
+
"path": "artifacts/release-example-scoop-0.1.0.zip",
|
|
12
|
+
"format": "zip",
|
|
13
|
+
"consumers": ["scoop"]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"targets": [
|
|
17
|
+
{
|
|
18
|
+
"_tag": "ScoopBucketTarget",
|
|
19
|
+
"id": "scoop",
|
|
20
|
+
"repository": "owner/scoop-bucket",
|
|
21
|
+
"manifestName": "release-example-scoop",
|
|
22
|
+
"manifestPath": ".release/generated/release-example-scoop.json",
|
|
23
|
+
"artifactId": "archive",
|
|
24
|
+
"homepage": "https://github.com/owner/release-example-scoop",
|
|
25
|
+
"description": "Example Scoop manifest for a release artifact",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"url": "https://github.com/owner/release-example-scoop/releases/download/v0.1.0/release-example-scoop-0.1.0.zip",
|
|
28
|
+
"bin": "release-example-scoop.exe",
|
|
29
|
+
"dryRunSupport": "simulated",
|
|
30
|
+
"mutability": "mutable-index",
|
|
31
|
+
"recovery": "manual"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"strict": true,
|
|
35
|
+
"evidenceDirectory": ".release/evidence"
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mannyc1/ts-release",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "bun@1.3.14",
|
|
6
6
|
"description": "Plan-first release orchestration with explicit validation, evidence, and execution gates.",
|
|
@@ -46,10 +46,6 @@
|
|
|
46
46
|
"types": "./dist/cli/command.d.ts",
|
|
47
47
|
"default": "./dist/cli/command.js"
|
|
48
48
|
},
|
|
49
|
-
"./cli/programmatic": {
|
|
50
|
-
"types": "./dist/cli/programmatic.d.ts",
|
|
51
|
-
"default": "./dist/cli/programmatic.js"
|
|
52
|
-
},
|
|
53
49
|
"./config/errors": {
|
|
54
50
|
"types": "./dist/config/errors.d.ts",
|
|
55
51
|
"default": "./dist/config/errors.js"
|
|
@@ -78,6 +74,10 @@
|
|
|
78
74
|
"types": "./dist/domain/release.d.ts",
|
|
79
75
|
"default": "./dist/domain/release.js"
|
|
80
76
|
},
|
|
77
|
+
"./domain/status": {
|
|
78
|
+
"types": "./dist/domain/status.d.ts",
|
|
79
|
+
"default": "./dist/domain/status.js"
|
|
80
|
+
},
|
|
81
81
|
"./domain/target": {
|
|
82
82
|
"types": "./dist/domain/target.d.ts",
|
|
83
83
|
"default": "./dist/domain/target.js"
|
|
@@ -86,9 +86,17 @@
|
|
|
86
86
|
"types": "./dist/host/host.d.ts",
|
|
87
87
|
"default": "./dist/host/host.js"
|
|
88
88
|
},
|
|
89
|
-
"./host/
|
|
90
|
-
"types": "./dist/host/
|
|
91
|
-
"default": "./dist/host/
|
|
89
|
+
"./host/http": {
|
|
90
|
+
"types": "./dist/host/http.d.ts",
|
|
91
|
+
"default": "./dist/host/http.js"
|
|
92
|
+
},
|
|
93
|
+
"./host/http-live": {
|
|
94
|
+
"types": "./dist/host/http-live.d.ts",
|
|
95
|
+
"default": "./dist/host/http-live.js"
|
|
96
|
+
},
|
|
97
|
+
"./host/platform": {
|
|
98
|
+
"types": "./dist/host/platform.d.ts",
|
|
99
|
+
"default": "./dist/host/platform.js"
|
|
92
100
|
},
|
|
93
101
|
"./host/test": {
|
|
94
102
|
"types": "./dist/host/test.d.ts",
|
|
@@ -118,6 +126,14 @@
|
|
|
118
126
|
"types": "./dist/planner/render-plan.d.ts",
|
|
119
127
|
"default": "./dist/planner/render-plan.js"
|
|
120
128
|
},
|
|
129
|
+
"./planner/status": {
|
|
130
|
+
"types": "./dist/planner/status.d.ts",
|
|
131
|
+
"default": "./dist/planner/status.js"
|
|
132
|
+
},
|
|
133
|
+
"./runtime/bun": {
|
|
134
|
+
"types": "./dist/runtime/bun.d.ts",
|
|
135
|
+
"default": "./dist/runtime/bun.js"
|
|
136
|
+
},
|
|
121
137
|
"./targets/adapter": {
|
|
122
138
|
"types": "./dist/targets/adapter.d.ts",
|
|
123
139
|
"default": "./dist/targets/adapter.js"
|
|
@@ -138,12 +154,33 @@
|
|
|
138
154
|
"types": "./dist/targets/npm.d.ts",
|
|
139
155
|
"default": "./dist/targets/npm.js"
|
|
140
156
|
},
|
|
157
|
+
"./targets/pypi": {
|
|
158
|
+
"types": "./dist/targets/pypi.d.ts",
|
|
159
|
+
"default": "./dist/targets/pypi.js"
|
|
160
|
+
},
|
|
141
161
|
"./targets/registry": {
|
|
142
162
|
"types": "./dist/targets/registry.d.ts",
|
|
143
163
|
"default": "./dist/targets/registry.js"
|
|
164
|
+
},
|
|
165
|
+
"./targets/scoop": {
|
|
166
|
+
"types": "./dist/targets/scoop.d.ts",
|
|
167
|
+
"default": "./dist/targets/scoop.js"
|
|
168
|
+
},
|
|
169
|
+
"./workflows/config": {
|
|
170
|
+
"types": "./dist/workflows/config.d.ts",
|
|
171
|
+
"default": "./dist/workflows/config.js"
|
|
172
|
+
},
|
|
173
|
+
"./workflows/evidence": {
|
|
174
|
+
"types": "./dist/workflows/evidence.d.ts",
|
|
175
|
+
"default": "./dist/workflows/evidence.js"
|
|
176
|
+
},
|
|
177
|
+
"./workflows/live": {
|
|
178
|
+
"types": "./dist/workflows/live.d.ts",
|
|
179
|
+
"default": "./dist/workflows/live.js"
|
|
144
180
|
}
|
|
145
181
|
},
|
|
146
182
|
"files": [
|
|
183
|
+
"ARCHITECTURE.md",
|
|
147
184
|
"dist",
|
|
148
185
|
"examples",
|
|
149
186
|
"SPEC.md",
|
|
@@ -160,9 +197,11 @@
|
|
|
160
197
|
"check:effect-imports": "bun run scripts/check-effect-imports.ts",
|
|
161
198
|
"check:tree-shaking": "bun run scripts/check-tree-shaking.ts",
|
|
162
199
|
"check:examples": "bun run scripts/check-examples.ts",
|
|
200
|
+
"check:readme": "bun run scripts/check-readme.ts",
|
|
163
201
|
"check:self-release-config": "bun run scripts/check-self-release-config.ts",
|
|
164
|
-
"check:portable": "bun run check && bun test && bun audit && bun run check:effect-imports && bun run check:tree-shaking && bun run build && bun run check:examples && bun run check:package-exports && bun dist/cli/main.js --help",
|
|
202
|
+
"check:portable": "bun run check && bun test && bun audit && bun run check:effect-imports && bun run check:tree-shaking && bun run build && bun run check:examples && bun run check:readme && bun run check:package-exports && bun dist/cli/main.js --help",
|
|
165
203
|
"check:release": "bun run check:self-release-config && bun run check:portable",
|
|
204
|
+
"release:artifacts": "bun run scripts/build-release-artifacts.ts",
|
|
166
205
|
"cli": "bun run src/cli/main.ts"
|
|
167
206
|
},
|
|
168
207
|
"dependencies": {
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import { ReleasePlan } from "../domain/release.js";
|
|
4
|
-
export type * from "../types/effect-internal.js";
|
|
5
|
-
export declare const DEFAULT_RELEASE_CLI_VERSION = "0.0.0";
|
|
6
|
-
export declare const ReleasePlanFormat: Schema.Literals<readonly ["json", "text"]>;
|
|
7
|
-
export type ReleasePlanFormat = typeof ReleasePlanFormat.Type;
|
|
8
|
-
declare const ReleaseCliOptions_base: Schema.Class<ReleaseCliOptions, Schema.Struct<{
|
|
9
|
-
readonly root: Schema.optionalKey<Schema.String>;
|
|
10
|
-
readonly version: Schema.optionalKey<Schema.String>;
|
|
11
|
-
}>, {}>;
|
|
12
|
-
export declare class ReleaseCliOptions extends ReleaseCliOptions_base {
|
|
13
|
-
}
|
|
14
|
-
declare const PlanReleaseConfigOptions_base: Schema.Class<PlanReleaseConfigOptions, Schema.Struct<{
|
|
15
|
-
readonly root: Schema.optionalKey<Schema.String>;
|
|
16
|
-
readonly configPath: Schema.optionalKey<Schema.String>;
|
|
17
|
-
readonly format: Schema.optionalKey<Schema.Literals<readonly ["json", "text"]>>;
|
|
18
|
-
}>, {}>;
|
|
19
|
-
export declare class PlanReleaseConfigOptions extends PlanReleaseConfigOptions_base {
|
|
20
|
-
}
|
|
21
|
-
export declare const planReleaseConfig: (options?: PlanReleaseConfigOptions | undefined) => Effect.Effect<ReleasePlan, import("../config/errors.js").ConfigParseError | import("../config/errors.js").ConfigValidationError | import("../host/host.js").HostError | import("../planner/errors.js").ReleaseNormalizationError | import("../planner/errors.js").PlanConstructionError | import("../targets/registry.js").MissingTargetAdapterError, never>;
|
|
22
|
-
export declare const renderReleaseConfigPlan: (options?: PlanReleaseConfigOptions | undefined) => Effect.Effect<string, import("../config/errors.js").ConfigParseError | import("../config/errors.js").ConfigValidationError | import("../host/host.js").HostError | import("../planner/errors.js").ReleaseNormalizationError | import("../planner/errors.js").PlanConstructionError | import("../targets/registry.js").MissingTargetAdapterError, never>;
|
|
23
|
-
export declare const runReleaseCli: (args: readonly string[], options?: ReleaseCliOptions | undefined) => Effect.Effect<void, import("effect/unstable/cli/CliError").CliError | import("../domain/operation.js").ExecutionApprovalError | import("../config/errors.js").ConfigParseError | import("../config/errors.js").ConfigValidationError | import("../host/host.js").HostError | import("../planner/errors.js").ReleaseNormalizationError | import("../planner/errors.js").PlanConstructionError | import("../planner/errors.js").EvidenceWriteError | import("../planner/errors.js").OperationFailedError | import("../targets/registry.js").MissingTargetAdapterError, never>;
|
|
24
|
-
export type ProgrammaticReleasePlan = ReleasePlan;
|
|
25
|
-
//# sourceMappingURL=programmatic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"programmatic.d.ts","sourceRoot":"","sources":["../../src/cli/programmatic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAIvC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAQlD,mBAAmB,6BAA6B,CAAA;AAEhD,eAAO,MAAM,2BAA2B,UAAU,CAAA;AAElD,eAAO,MAAM,iBAAiB,4CAAoC,CAAA;AAClE,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;;;;;AAE7D,qBAAa,iBAAkB,SAAQ,sBAGrC;CAAG;;;;;;AAEL,qBAAa,wBAAyB,SAAQ,6BAI5C;CAAG;AAoBL,eAAO,MAAM,iBAAiB,kZAM5B,CAAA;AAEF,eAAO,MAAM,uBAAuB,6YAOlC,CAAA;AAEF,eAAO,MAAM,aAAa,mnBAOxB,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAA"}
|
package/dist/cli/programmatic.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as BunServices from "@effect/platform-bun/BunServices";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
|
-
import * as Command from "effect/unstable/cli/Command";
|
|
6
|
-
import { parseReleaseIntent } from "../config/load.js";
|
|
7
|
-
import { DEFAULT_CONFIG_PATH } from "../config/schema.js";
|
|
8
|
-
import { makeBunReleaseHostLayer } from "../host/bun.js";
|
|
9
|
-
import { ReleaseHost } from "../host/host.js";
|
|
10
|
-
import { createReleasePlan } from "../planner/create-release-plan.js";
|
|
11
|
-
import { renderPlanJson, renderPlanText } from "../planner/render-plan.js";
|
|
12
|
-
import { LiveTargetRegistryLayer } from "../targets/live.js";
|
|
13
|
-
import { cli } from "./command.js";
|
|
14
|
-
export const DEFAULT_RELEASE_CLI_VERSION = "0.0.0";
|
|
15
|
-
export const ReleasePlanFormat = Schema.Literals(["json", "text"]);
|
|
16
|
-
export class ReleaseCliOptions extends Schema.Class("ReleaseCliOptions")({
|
|
17
|
-
root: Schema.optionalKey(Schema.String),
|
|
18
|
-
version: Schema.optionalKey(Schema.String)
|
|
19
|
-
}) {
|
|
20
|
-
}
|
|
21
|
-
export class PlanReleaseConfigOptions extends Schema.Class("PlanReleaseConfigOptions")({
|
|
22
|
-
root: Schema.optionalKey(Schema.String),
|
|
23
|
-
configPath: Schema.optionalKey(Schema.String),
|
|
24
|
-
format: Schema.optionalKey(ReleasePlanFormat)
|
|
25
|
-
}) {
|
|
26
|
-
}
|
|
27
|
-
const programmaticLayer = (root) => Layer.mergeAll(makeBunReleaseHostLayer({ root }), LiveTargetRegistryLayer, BunServices.layer);
|
|
28
|
-
const loadPlanFromOptions = Effect.fn("cli.programmatic.loadPlanFromOptions")(function* (options) {
|
|
29
|
-
const root = options.root ?? ".";
|
|
30
|
-
const configPath = options.configPath ?? DEFAULT_CONFIG_PATH;
|
|
31
|
-
const host = yield* ReleaseHost;
|
|
32
|
-
const contents = yield* host.readFileString(configPath);
|
|
33
|
-
const intent = yield* parseReleaseIntent(contents, configPath);
|
|
34
|
-
return yield* createReleasePlan(intent, root, configPath);
|
|
35
|
-
});
|
|
36
|
-
export const planReleaseConfig = Effect.fn("planReleaseConfig")(function* (options = PlanReleaseConfigOptions.make({})) {
|
|
37
|
-
return yield* loadPlanFromOptions(options).pipe(Effect.provide(programmaticLayer(options.root)));
|
|
38
|
-
});
|
|
39
|
-
export const renderReleaseConfigPlan = Effect.fn("renderReleaseConfigPlan")(function* (options = PlanReleaseConfigOptions.make({})) {
|
|
40
|
-
const plan = yield* planReleaseConfig(options);
|
|
41
|
-
return (options.format ?? "text") === "json"
|
|
42
|
-
? renderPlanJson(plan)
|
|
43
|
-
: renderPlanText(plan);
|
|
44
|
-
});
|
|
45
|
-
export const runReleaseCli = Effect.fn("runReleaseCli")(function* (args, options = ReleaseCliOptions.make({})) {
|
|
46
|
-
yield* Command.runWith(cli, { version: options.version ?? DEFAULT_RELEASE_CLI_VERSION })([...args]).pipe(Effect.provide(programmaticLayer(options.root)));
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=programmatic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"programmatic.js","sourceRoot":"","sources":["../../src/cli/programmatic.ts"],"names":[],"mappings":"AA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C,CAAC,QAAQ,CAAC,EACnF,UAAoC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAErE,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAC9C,OAAO,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,MAAM;QAC1C,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC;QACtB,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAC/D,IAA2B,EAC3B,UAA6B,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IAEvD,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,2BAA2B,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CACtG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAChD,CAAA;AACH,CAAC,CAAC,CAAA"}
|
package/dist/host/bun.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as Layer from "effect/Layer";
|
|
2
|
-
import { ReleaseHost } from "./host.js";
|
|
3
|
-
export type * from "../types/effect-internal.js";
|
|
4
|
-
export interface BunReleaseHostOptions {
|
|
5
|
-
readonly root?: string | undefined;
|
|
6
|
-
}
|
|
7
|
-
export declare const makeBunReleaseHostLayer: (options?: BunReleaseHostOptions) => Layer.Layer<ReleaseHost>;
|
|
8
|
-
export declare const BunReleaseHostLayer: Layer.Layer<ReleaseHost>;
|
|
9
|
-
//# sourceMappingURL=bun.d.ts.map
|
package/dist/host/bun.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../../src/host/bun.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAKrC,OAAO,EAAsC,WAAW,EAAE,MAAM,WAAW,CAAA;AAE3E,mBAAmB,6BAA6B,CAAA;AAKhD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACnC;AAmED,eAAO,MAAM,uBAAuB,GAAI,UAAS,qBAA0B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAoHpG,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAA6B,CAAA"}
|
package/dist/host/bun.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Layer from "effect/Layer";
|
|
3
|
-
import { mkdir, stat as fsStat } from "node:fs/promises";
|
|
4
|
-
import { dirname, isAbsolute, resolve } from "node:path";
|
|
5
|
-
import { CommandResult, FileInfo, HostError, ReleaseHost } from "./host.js";
|
|
6
|
-
const formatUnknown = (cause) => cause instanceof Error ? cause.message : String(cause);
|
|
7
|
-
const checksumName = (algorithm) => algorithm === "sha256" ? "SHA-256" : "SHA-512";
|
|
8
|
-
const toHex = (bytes) => {
|
|
9
|
-
let output = "";
|
|
10
|
-
for (const byte of bytes) {
|
|
11
|
-
output += byte.toString(16).padStart(2, "0");
|
|
12
|
-
}
|
|
13
|
-
return output;
|
|
14
|
-
};
|
|
15
|
-
const streamText = async (stream) => {
|
|
16
|
-
if (stream === null) {
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
-
return await new Response(stream).text();
|
|
20
|
-
};
|
|
21
|
-
const inheritedEnvNames = [
|
|
22
|
-
"PATH",
|
|
23
|
-
"HOME",
|
|
24
|
-
"USERPROFILE",
|
|
25
|
-
"SystemRoot",
|
|
26
|
-
"TEMP",
|
|
27
|
-
"TMP"
|
|
28
|
-
];
|
|
29
|
-
const commandEnv = (command) => {
|
|
30
|
-
const names = new Set([
|
|
31
|
-
...inheritedEnvNames,
|
|
32
|
-
...command.requiredEnv,
|
|
33
|
-
...command.redactedEnv
|
|
34
|
-
]);
|
|
35
|
-
const env = {};
|
|
36
|
-
for (const name of names) {
|
|
37
|
-
const value = Bun.env[name];
|
|
38
|
-
if (value !== undefined) {
|
|
39
|
-
env[name] = value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return env;
|
|
43
|
-
};
|
|
44
|
-
const validateEnv = (command) => Effect.sync(() => {
|
|
45
|
-
const missing = [];
|
|
46
|
-
for (const name of command.requiredEnv) {
|
|
47
|
-
if (Bun.env[name] === undefined) {
|
|
48
|
-
missing.push(name);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return missing;
|
|
52
|
-
}).pipe(Effect.flatMap((missing) => missing.length === 0
|
|
53
|
-
? Effect.void
|
|
54
|
-
: Effect.fail(HostError.make({
|
|
55
|
-
operation: "runCommand",
|
|
56
|
-
reason: `Missing required environment variables: ${missing.join(", ")}`
|
|
57
|
-
}))));
|
|
58
|
-
export const makeBunReleaseHostLayer = (options = {}) => {
|
|
59
|
-
const hostPath = (path) => options.root === undefined || isAbsolute(path) ? path : resolve(options.root, path);
|
|
60
|
-
const commandCwd = (command) => command.cwd === undefined
|
|
61
|
-
? options.root
|
|
62
|
-
: hostPath(command.cwd);
|
|
63
|
-
return Layer.succeed(ReleaseHost)({
|
|
64
|
-
readFileString: (path) => Effect.tryPromise({
|
|
65
|
-
try: () => Bun.file(hostPath(path)).text(),
|
|
66
|
-
catch: (cause) => HostError.make({
|
|
67
|
-
operation: "readFileString",
|
|
68
|
-
path,
|
|
69
|
-
reason: formatUnknown(cause)
|
|
70
|
-
})
|
|
71
|
-
}),
|
|
72
|
-
writeFileString: (path, contents) => Effect.tryPromise({
|
|
73
|
-
try: async () => {
|
|
74
|
-
const targetPath = hostPath(path);
|
|
75
|
-
await mkdir(dirname(targetPath), { recursive: true });
|
|
76
|
-
await Bun.write(targetPath, contents);
|
|
77
|
-
},
|
|
78
|
-
catch: (cause) => HostError.make({
|
|
79
|
-
operation: "writeFileString",
|
|
80
|
-
path,
|
|
81
|
-
reason: formatUnknown(cause)
|
|
82
|
-
})
|
|
83
|
-
}),
|
|
84
|
-
stat: (path) => Effect.tryPromise({
|
|
85
|
-
try: async () => {
|
|
86
|
-
const info = await fsStat(hostPath(path));
|
|
87
|
-
return FileInfo.make({
|
|
88
|
-
path,
|
|
89
|
-
sizeBytes: Number(info.size),
|
|
90
|
-
kind: info.isDirectory() ? "directory" : info.isFile() ? "file" : "other"
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
catch: (cause) => HostError.make({
|
|
94
|
-
operation: "stat",
|
|
95
|
-
path,
|
|
96
|
-
reason: formatUnknown(cause)
|
|
97
|
-
})
|
|
98
|
-
}),
|
|
99
|
-
hashFile: (path, algorithm) => Effect.tryPromise({
|
|
100
|
-
try: async () => {
|
|
101
|
-
const targetPath = hostPath(path);
|
|
102
|
-
const info = await fsStat(targetPath);
|
|
103
|
-
if (!info.isFile()) {
|
|
104
|
-
throw new Error("Only file artifacts can be hashed");
|
|
105
|
-
}
|
|
106
|
-
const buffer = await Bun.file(targetPath).arrayBuffer();
|
|
107
|
-
const hash = await crypto.subtle.digest(checksumName(algorithm), buffer);
|
|
108
|
-
return toHex(new Uint8Array(hash));
|
|
109
|
-
},
|
|
110
|
-
catch: (cause) => HostError.make({
|
|
111
|
-
operation: "hashFile",
|
|
112
|
-
path,
|
|
113
|
-
reason: formatUnknown(cause)
|
|
114
|
-
})
|
|
115
|
-
}),
|
|
116
|
-
readEnv: (name) => Effect.sync(() => Bun.env[name]),
|
|
117
|
-
runCommand: (command) => Effect.gen(function* () {
|
|
118
|
-
yield* validateEnv(command);
|
|
119
|
-
const startedAt = new Date().toISOString();
|
|
120
|
-
const started = performance.now();
|
|
121
|
-
return yield* Effect.tryPromise({
|
|
122
|
-
try: async () => {
|
|
123
|
-
const cwd = commandCwd(command);
|
|
124
|
-
const subprocess = Bun.spawn([command.executable, ...command.args], {
|
|
125
|
-
...(cwd === undefined ? {} : { cwd }),
|
|
126
|
-
env: commandEnv(command),
|
|
127
|
-
stdout: "pipe",
|
|
128
|
-
stderr: "pipe"
|
|
129
|
-
});
|
|
130
|
-
const stdoutPromise = streamText(subprocess.stdout);
|
|
131
|
-
const stderrPromise = streamText(subprocess.stderr);
|
|
132
|
-
const exitCode = await subprocess.exited;
|
|
133
|
-
const stdout = await stdoutPromise;
|
|
134
|
-
const stderr = await stderrPromise;
|
|
135
|
-
const endedAt = new Date().toISOString();
|
|
136
|
-
return CommandResult.make({
|
|
137
|
-
command,
|
|
138
|
-
exitCode,
|
|
139
|
-
stdout,
|
|
140
|
-
stderr,
|
|
141
|
-
startedAt,
|
|
142
|
-
endedAt,
|
|
143
|
-
durationMillis: Math.round(performance.now() - started)
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
catch: (cause) => HostError.make({
|
|
147
|
-
operation: "runCommand",
|
|
148
|
-
reason: formatUnknown(cause)
|
|
149
|
-
})
|
|
150
|
-
});
|
|
151
|
-
}),
|
|
152
|
-
now: Effect.sync(() => new Date().toISOString())
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
export const BunReleaseHostLayer = makeBunReleaseHostLayer();
|
|
156
|
-
//# sourceMappingURL=bun.js.map
|
package/dist/host/bun.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bun.js","sourceRoot":"","sources":["../../src/host/bun.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MA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