@smoothbricks/cli 0.10.2 → 0.10.4
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 +31 -23
- package/dist/bun/preload.d.ts +13 -0
- package/dist/bun/preload.d.ts.map +1 -0
- package/dist/bun/preload.js +12 -0
- package/dist/cli.js +36 -4
- package/dist/generate/index.d.ts.map +1 -1
- package/dist/generate/index.js +0 -6
- package/dist/github-ci/index.d.ts +17 -2
- package/dist/github-ci/index.d.ts.map +1 -1
- package/dist/github-ci/index.js +192 -26
- package/dist/github-ci/outputs.d.ts +22 -0
- package/dist/github-ci/outputs.d.ts.map +1 -0
- package/dist/github-ci/outputs.js +648 -0
- package/dist/lib/cli-package.js +2 -2
- package/dist/lib/json.d.ts +118 -11
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/json.js +317 -29
- package/dist/lib/workspace.d.ts +7 -14
- package/dist/lib/workspace.d.ts.map +1 -1
- package/dist/lib/workspace.js +76 -82
- package/dist/monorepo/ci-workflow.d.ts +2 -0
- package/dist/monorepo/ci-workflow.d.ts.map +1 -1
- package/dist/monorepo/ci-workflow.js +28 -2
- package/dist/monorepo/git-config.js +2 -2
- package/dist/monorepo/index.d.ts +3 -1
- package/dist/monorepo/index.d.ts.map +1 -1
- package/dist/monorepo/index.js +6 -2
- package/dist/monorepo/lockfile.d.ts +13 -1
- package/dist/monorepo/lockfile.d.ts.map +1 -1
- package/dist/monorepo/lockfile.js +33 -21
- package/dist/monorepo/managed-files.d.ts +12 -0
- package/dist/monorepo/managed-files.d.ts.map +1 -1
- package/dist/monorepo/managed-files.js +86 -28
- package/dist/monorepo/package-policy.d.ts.map +1 -1
- package/dist/monorepo/package-policy.js +78 -45
- package/dist/monorepo/packed-manifest.d.ts +5 -2
- package/dist/monorepo/packed-manifest.d.ts.map +1 -1
- package/dist/monorepo/packed-manifest.js +16 -47
- package/dist/monorepo/packed-package.d.ts.map +1 -1
- package/dist/monorepo/packed-package.js +28 -16
- package/dist/monorepo/packs/index.d.ts +3 -0
- package/dist/monorepo/packs/index.d.ts.map +1 -1
- package/dist/monorepo/packs/index.js +18 -6
- package/dist/monorepo/publish-workflow.d.ts +1 -0
- package/dist/monorepo/publish-workflow.d.ts.map +1 -1
- package/dist/monorepo/publish-workflow.js +242 -3
- package/dist/monorepo/runtime.d.ts +15 -0
- package/dist/monorepo/runtime.d.ts.map +1 -1
- package/dist/monorepo/runtime.js +66 -12
- package/dist/monorepo/tool-validation.d.ts.map +1 -1
- package/dist/monorepo/tool-validation.js +32 -23
- package/dist/monorepo/wrangler.d.ts.map +1 -1
- package/dist/monorepo/wrangler.js +13 -13
- package/dist/nx/index.d.ts +12 -4
- package/dist/nx/index.d.ts.map +1 -1
- package/dist/nx/index.js +86 -19
- package/dist/pr/index.d.ts.map +1 -1
- package/dist/pr/index.js +28 -32
- package/dist/release/candidates.d.ts +3 -2
- package/dist/release/candidates.d.ts.map +1 -1
- package/dist/release/candidates.js +4 -5
- package/dist/release/github-release.d.ts +3 -0
- package/dist/release/github-release.d.ts.map +1 -1
- package/dist/release/github-release.js +11 -0
- package/dist/release/index.d.ts +20 -1
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js +221 -89
- package/dist/release/orchestration.d.ts +8 -1
- package/dist/release/orchestration.d.ts.map +1 -1
- package/dist/release/orchestration.js +38 -1
- package/dist/wrangler/prepare-env.d.ts +0 -1
- package/dist/wrangler/prepare-env.d.ts.map +1 -1
- package/dist/wrangler/prepare-env.js +100 -51
- package/dist/wrangler/scaffold.d.ts.map +1 -1
- package/dist/wrangler/scaffold.js +12 -12
- package/managed/raw/git-format-staged.yml +19 -1
- package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +6 -0
- package/managed/raw/tooling/direnv/merge-newer-pins.sh +3 -3
- package/managed/raw/tooling/direnv/setup-environment.ts +187 -19
- package/managed/raw/tooling/git-hooks/pre-commit.sh +0 -6
- package/managed/templates/github/actions/cache-nix-devenv/action.yml +12 -10
- package/managed/templates/github/actions/cache-node-modules/action.yml +6 -2
- package/managed/templates/github/actions/cache-nx/action.yml +2 -2
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +19 -0
- package/managed/templates/github/actions/save-nix-devenv/action.yml +11 -3
- package/managed/templates/github/actions/setup-devenv/action.yml +5 -0
- package/managed/templates/github/workflows/managed-files.yml +80 -0
- package/package.json +18 -4
- package/src/bun/preload.ts +12 -0
- package/src/cli.ts +49 -11
- package/src/generate/index.ts +0 -6
- package/src/github-ci/index.test.ts +486 -0
- package/src/github-ci/index.ts +220 -30
- package/src/github-ci/outputs.ts +505 -0
- package/src/lib/cli-package.ts +2 -2
- package/src/lib/json.ts +291 -32
- package/src/lib/workspace.ts +88 -100
- package/src/monorepo/__tests__/ci-workflow.test.ts +14 -3
- package/src/monorepo/__tests__/publish-workflow.test.ts +222 -1
- package/src/monorepo/ci-workflow.ts +28 -2
- package/src/monorepo/git-config.ts +2 -2
- package/src/monorepo/index.ts +6 -2
- package/src/monorepo/lockfile.test.ts +35 -36
- package/src/monorepo/lockfile.ts +48 -24
- package/src/monorepo/managed-files.test.ts +63 -0
- package/src/monorepo/managed-files.ts +94 -34
- package/src/monorepo/package-policy.test.ts +70 -51
- package/src/monorepo/package-policy.ts +104 -59
- package/src/monorepo/packed-manifest.ts +18 -52
- package/src/monorepo/packed-package.ts +43 -22
- package/src/monorepo/packs/index.test.ts +18 -1
- package/src/monorepo/packs/index.ts +20 -7
- package/src/monorepo/publish-workflow.ts +482 -3
- package/src/monorepo/runtime.test.ts +42 -3
- package/src/monorepo/runtime.ts +90 -12
- package/src/monorepo/tool-validation.ts +35 -25
- package/src/monorepo/wrangler.test.ts +11 -15
- package/src/monorepo/wrangler.ts +15 -15
- package/src/nx/index.test.ts +43 -0
- package/src/nx/index.ts +110 -23
- package/src/pr/index.ts +42 -36
- package/src/release/__tests__/candidates.test.ts +5 -4
- package/src/release/__tests__/fixture-repo.test.ts +18 -16
- package/src/release/__tests__/github-release.test.ts +11 -0
- package/src/release/__tests__/orchestration.test.ts +57 -2
- package/src/release/__tests__/trust-publisher.test.ts +98 -2
- package/src/release/candidates.ts +10 -17
- package/src/release/github-release.ts +12 -0
- package/src/release/index.ts +321 -112
- package/src/release/orchestration.ts +55 -3
- package/src/wrangler/prepare-env.ts +75 -54
- package/src/wrangler/scaffold.test.ts +9 -12
- package/src/wrangler/scaffold.ts +13 -13
|
@@ -33,10 +33,10 @@ runs:
|
|
|
33
33
|
~/.local/state/nix/profiles
|
|
34
34
|
~/.cache/nix
|
|
35
35
|
key:
|
|
36
|
-
${{ runner.os }}-nix-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
37
|
-
'tooling/direnv/devenv.lock') }}
|
|
36
|
+
${{ runner.os }}-${{ runner.arch }}-nix-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
37
|
+
'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.lock') }}
|
|
38
38
|
restore-keys: |
|
|
39
|
-
${{ runner.os }}-nix-v3-
|
|
39
|
+
${{ runner.os }}-${{ runner.arch }}-nix-v3-
|
|
40
40
|
|
|
41
41
|
- name: Save Nix profiles and store NAR
|
|
42
42
|
if: ${{ inputs.segment == 'nix' && inputs.mode == 'save' }}
|
|
@@ -48,8 +48,8 @@ runs:
|
|
|
48
48
|
~/.local/state/nix/profiles
|
|
49
49
|
~/.cache/nix
|
|
50
50
|
key:
|
|
51
|
-
${{ runner.os }}-nix-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
52
|
-
'tooling/direnv/devenv.lock') }}
|
|
51
|
+
${{ runner.os }}-${{ runner.arch }}-nix-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
52
|
+
'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.lock') }}
|
|
53
53
|
|
|
54
54
|
# .devenv/.direnv are small, but they contain absolute /nix/store pointers.
|
|
55
55
|
# Workflows restore this segment only after an exact Nix cache hit.
|
|
@@ -62,10 +62,11 @@ runs:
|
|
|
62
62
|
${{ github.workspace }}/tooling/direnv/.devenv
|
|
63
63
|
${{ github.workspace }}/tooling/direnv/.direnv
|
|
64
64
|
key:
|
|
65
|
-
${{ runner.os }}-devenv-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
66
|
-
'tooling/direnv/devenv.
|
|
65
|
+
${{ runner.os }}-${{ runner.arch }}-devenv-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
66
|
+
'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.lock', 'tooling/direnv/envrc.sh',
|
|
67
|
+
'tooling/direnv/setup-environment.ts') }}
|
|
67
68
|
restore-keys: |
|
|
68
|
-
${{ runner.os }}-devenv-v3-
|
|
69
|
+
${{ runner.os }}-${{ runner.arch }}-devenv-v3-
|
|
69
70
|
|
|
70
71
|
- name: Save devenv and direnv state
|
|
71
72
|
if: ${{ inputs.segment == 'devenv' && inputs.mode == 'save' }}
|
|
@@ -75,5 +76,6 @@ runs:
|
|
|
75
76
|
${{ github.workspace }}/tooling/direnv/.devenv
|
|
76
77
|
${{ github.workspace }}/tooling/direnv/.direnv
|
|
77
78
|
key:
|
|
78
|
-
${{ runner.os }}-devenv-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
79
|
-
'tooling/direnv/devenv.
|
|
79
|
+
${{ runner.os }}-${{ runner.arch }}-devenv-v3-${{ hashFiles('tooling/direnv/devenv.yaml',
|
|
80
|
+
'tooling/direnv/devenv.nix', 'tooling/direnv/devenv.lock', 'tooling/direnv/envrc.sh',
|
|
81
|
+
'tooling/direnv/setup-environment.ts') }}
|
|
@@ -7,7 +7,11 @@ runs:
|
|
|
7
7
|
- name: Cache node_modules
|
|
8
8
|
uses: actions/cache@v5.0.5
|
|
9
9
|
with:
|
|
10
|
+
# Dependencies only. ttsc plugin/GOCACHE live under $TTSC_CACHE_DIR
|
|
11
|
+
# (.cache/ttsc), not inside node_modules.
|
|
12
|
+
# v2 isolates restore-keys from older Darwin caches with a broken TS dual-package hoist.
|
|
10
13
|
path: node_modules
|
|
11
|
-
|
|
14
|
+
# prettier-ignore
|
|
15
|
+
key: ${{ runner.os }}-${{ runner.arch }}-node-v2-{{NODE_MODULES_CACHE_KEY}}
|
|
12
16
|
restore-keys: |
|
|
13
|
-
${{ runner.os }}-node-
|
|
17
|
+
${{ runner.os }}-${{ runner.arch }}-node-v2-
|
|
@@ -16,6 +16,6 @@ runs:
|
|
|
16
16
|
path: |
|
|
17
17
|
.nx/cache
|
|
18
18
|
.nx/workspace-data/*.db*
|
|
19
|
-
key: ${{ runner.os }}-nx-db-v1-${{ github.sha }}
|
|
19
|
+
key: ${{ runner.os }}-${{ runner.arch }}-nx-db-v1-${{ github.sha }}
|
|
20
20
|
restore-keys: |
|
|
21
|
-
${{ runner.os }}-nx-db-v1-
|
|
21
|
+
${{ runner.os }}-${{ runner.arch }}-nx-db-v1-
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Cache ttsc plugins
|
|
2
|
+
description: >
|
|
3
|
+
Restore/save compiled ttsc native plugin binaries (typia, etc.). These are content-keyed under TTSC_CACHE_DIR/plugins
|
|
4
|
+
and skip the multi-minute `go build` when the cache key matches. The Go object cache (go-build/) is NOT cached — it is
|
|
5
|
+
multi-GB and only helps when the plugin key misses.
|
|
6
|
+
|
|
7
|
+
runs:
|
|
8
|
+
using: composite
|
|
9
|
+
steps:
|
|
10
|
+
- name: Cache ttsc plugin binaries
|
|
11
|
+
uses: actions/cache@v5.0.5
|
|
12
|
+
with:
|
|
13
|
+
# Only the compiled plugin binaries (~30MB each). Path is relative to the
|
|
14
|
+
# workspace; devenv sets TTSC_CACHE_DIR to <repo>/.cache/ttsc.
|
|
15
|
+
path: .cache/ttsc/plugins
|
|
16
|
+
# prettier-ignore
|
|
17
|
+
key: ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-${{ hashFiles('bun.lock', 'package.json', 'patches/ttsc@*.patch', 'tooling/direnv/devenv.lock') }}
|
|
18
|
+
restore-keys: |
|
|
19
|
+
${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-
|
|
@@ -14,13 +14,21 @@ inputs:
|
|
|
14
14
|
runs:
|
|
15
15
|
using: composite
|
|
16
16
|
steps:
|
|
17
|
-
- name: 🧹
|
|
17
|
+
- name: 🧹 Prepare Nix/devenv cache save
|
|
18
18
|
id: cleanup-cache
|
|
19
19
|
shell: bash
|
|
20
20
|
working-directory: tooling/direnv
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
env:
|
|
22
|
+
NIX_CACHE_HIT: ${{ inputs.nix-cache-hit }}
|
|
23
|
+
# An exact Nix cache hit is immutable and cannot be overwritten by
|
|
24
|
+
# actions/cache. Avoid rebuilding its ~2 GB NAR just to discard it.
|
|
25
|
+
# build-shell normally adds repo paths to GITHUB_PATH, but cleanup must
|
|
26
|
+
# still run after a cache miss when build-shell fails before that happens.
|
|
23
27
|
run: |
|
|
28
|
+
if [[ "$NIX_CACHE_HIT" == 'true' ]]; then
|
|
29
|
+
echo 'cache-ready=true' >> "$GITHUB_OUTPUT"
|
|
30
|
+
exit 0
|
|
31
|
+
fi
|
|
24
32
|
export PATH="$(../../tooling/direnv/repo-path)"
|
|
25
33
|
smoo github-ci cleanup-cache
|
|
26
34
|
|
|
@@ -51,6 +51,11 @@ runs:
|
|
|
51
51
|
- name: 📦 Cache node_modules
|
|
52
52
|
uses: ./.github/actions/cache-node-modules
|
|
53
53
|
|
|
54
|
+
# Restores compiled ttsc native plugins into .cache/ttsc/plugins. TTSC_CACHE_DIR
|
|
55
|
+
# is set by devenv enterShell (+ bootstrap GITHUB_ENV for later steps).
|
|
56
|
+
- name: 🧊 Cache ttsc plugins
|
|
57
|
+
uses: ./.github/actions/cache-ttsc-plugins
|
|
58
|
+
|
|
54
59
|
- name: 🐚 Build devenv shell
|
|
55
60
|
shell: bash
|
|
56
61
|
working-directory: tooling/direnv
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Managed by @smoothbricks/cli (smoo monorepo update) - do not edit by hand.
|
|
2
|
+
#
|
|
3
|
+
# Self-healing loop for smoo-managed files: ci.yml runs the authoritative
|
|
4
|
+
# `smoo monorepo check` on every default-branch push (devenv is already up
|
|
5
|
+
# there, so the check is ~free) and dispatches THIS workflow only when real
|
|
6
|
+
# drift exists - typically after a @smoothbricks/cli pin bump. It runs
|
|
7
|
+
# `smoo monorepo update` and pushes the result to ONE persistent review branch
|
|
8
|
+
# (chore/managed-files) with ONE PR. The PR is NEVER auto-merged: a template
|
|
9
|
+
# change is upstream code that deserves a human look before it lands. Re-runs
|
|
10
|
+
# refresh the same branch in place.
|
|
11
|
+
#
|
|
12
|
+
# NOTE: managed files include .github/workflows/*, and the default GITHUB_TOKEN
|
|
13
|
+
# is server-side forbidden to push workflow-file changes. Configure a GitHub App
|
|
14
|
+
# or PAT token with contents:write + workflows:write as MANAGED_FILES_TOKEN;
|
|
15
|
+
# without it, runs that touch workflow files fail at push with a clear error.
|
|
16
|
+
name: Managed files
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
workflow_dispatch:
|
|
20
|
+
|
|
21
|
+
permissions:
|
|
22
|
+
contents: write
|
|
23
|
+
pull-requests: write
|
|
24
|
+
|
|
25
|
+
concurrency:
|
|
26
|
+
group: managed-files
|
|
27
|
+
cancel-in-progress: true
|
|
28
|
+
|
|
29
|
+
defaults:
|
|
30
|
+
run:
|
|
31
|
+
working-directory: tooling/direnv
|
|
32
|
+
|
|
33
|
+
jobs:
|
|
34
|
+
update:
|
|
35
|
+
runs-on: ubuntu-latest
|
|
36
|
+
timeout-minutes: 30
|
|
37
|
+
steps:
|
|
38
|
+
- name: 📥 Checkout
|
|
39
|
+
uses: actions/checkout@v6.0.2
|
|
40
|
+
with:
|
|
41
|
+
filter: blob:none
|
|
42
|
+
fetch-depth: 0
|
|
43
|
+
persist-credentials: true
|
|
44
|
+
token: ${{ secrets.MANAGED_FILES_TOKEN || github.token }}
|
|
45
|
+
|
|
46
|
+
- name: 🧱 Setup Nix/devenv
|
|
47
|
+
id: setup
|
|
48
|
+
uses: ./.github/actions/setup-devenv
|
|
49
|
+
|
|
50
|
+
- name: 🔄 Regenerate managed files
|
|
51
|
+
run: smoo monorepo update
|
|
52
|
+
|
|
53
|
+
- name: 📤 Push review branch and open PR
|
|
54
|
+
env:
|
|
55
|
+
GH_TOKEN: ${{ secrets.MANAGED_FILES_TOKEN || github.token }}
|
|
56
|
+
run: |
|
|
57
|
+
cd "$(git rev-parse --show-toplevel)"
|
|
58
|
+
if [ -z "$(git status --porcelain)" ]; then
|
|
59
|
+
echo "Managed files are in sync; nothing to do."
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
git config user.name "github-actions[bot]"
|
|
63
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
64
|
+
git switch -C chore/managed-files
|
|
65
|
+
git add -A
|
|
66
|
+
git commit -m "chore: regenerate smoo-managed files"
|
|
67
|
+
git push --force origin chore/managed-files
|
|
68
|
+
gh pr create \
|
|
69
|
+
--head chore/managed-files \
|
|
70
|
+
--base "${GITHUB_REF_NAME}" \
|
|
71
|
+
--title "chore: regenerate smoo-managed files" \
|
|
72
|
+
--body "Automated refresh of smoo-managed files after drift (usually a @smoothbricks/cli pin bump). One persistent PR; re-runs force-push this branch in place. Review the template changes - do NOT enable auto-merge." \
|
|
73
|
+
2>/dev/null || echo "PR already open; branch refreshed in place."
|
|
74
|
+
|
|
75
|
+
- name: 🧹 Cleanup and cache Nix/devenv
|
|
76
|
+
if: ${{ always() }}
|
|
77
|
+
uses: ./.github/actions/save-nix-devenv
|
|
78
|
+
with:
|
|
79
|
+
nix-cache-hit: ${{ steps.setup.outputs.nix-cache-hit }}
|
|
80
|
+
devenv-cache-hit: ${{ steps.setup.outputs.devenv-cache-hit }}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smoothbricks/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "SmoothBricks monorepo automation CLI",
|
|
6
6
|
"bin": {
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
"import": "./dist/index.js",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./bun/preload": {
|
|
24
|
+
"types": "./dist/bun/preload.d.ts",
|
|
25
|
+
"bun": "./src/bun/preload.ts",
|
|
26
|
+
"development": "./src/bun/preload.ts",
|
|
27
|
+
"import": "./dist/bun/preload.js",
|
|
28
|
+
"default": "./dist/bun/preload.js"
|
|
29
|
+
},
|
|
23
30
|
"./monorepo/runtime": {
|
|
24
31
|
"types": "./dist/monorepo/runtime.d.ts",
|
|
25
32
|
"bun": "./src/monorepo/runtime.ts",
|
|
@@ -42,6 +49,10 @@
|
|
|
42
49
|
"default": "./dist/wrangler/prepare-env.js"
|
|
43
50
|
}
|
|
44
51
|
},
|
|
52
|
+
"sideEffects": [
|
|
53
|
+
"./dist/bun/preload.js",
|
|
54
|
+
"./src/bun/preload.ts"
|
|
55
|
+
],
|
|
45
56
|
"files": [
|
|
46
57
|
"README.md",
|
|
47
58
|
"bin",
|
|
@@ -52,14 +63,17 @@
|
|
|
52
63
|
],
|
|
53
64
|
"dependencies": {
|
|
54
65
|
"@arethetypeswrong/core": "^0.18.2",
|
|
55
|
-
"@
|
|
56
|
-
"@smoothbricks/
|
|
66
|
+
"@prettier/sync": "^0.6.1",
|
|
67
|
+
"@smoothbricks/nx-plugin": "0.3.3",
|
|
68
|
+
"@smoothbricks/validation": "0.1.4",
|
|
57
69
|
"commander": "^14.0.3",
|
|
70
|
+
"prettier": "^3.6.1",
|
|
58
71
|
"publint": "^0.3.18",
|
|
59
72
|
"semver": "^7.7.4",
|
|
60
73
|
"sherif": "^1.11.1",
|
|
61
74
|
"toml-eslint-parser": "^1.0.3",
|
|
62
|
-
"tslib": "^2.8.1"
|
|
75
|
+
"tslib": "^2.8.1",
|
|
76
|
+
"typia": "13.1.19"
|
|
63
77
|
},
|
|
64
78
|
"devDependencies": {
|
|
65
79
|
"fast-check": "^4.4.0"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun runtime preload for consumers of `@smoothbricks/cli`.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports the Typia/ttsc transform preload from `@smoothbricks/validation`.
|
|
5
|
+
* External repos depend on the CLI package only — they must not need a direct
|
|
6
|
+
* `@smoothbricks/validation` dependency just to run `smoo` against source.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* import '@smoothbricks/cli/bun/preload';
|
|
10
|
+
* // or bunfig.toml: preload = ["@smoothbricks/cli/bun/preload"]
|
|
11
|
+
*/
|
|
12
|
+
import '@smoothbricks/validation/bun/preload';
|
package/src/cli.ts
CHANGED
|
@@ -61,10 +61,13 @@ function buildProgram(): Command {
|
|
|
61
61
|
const { updateManagedFiles } = await import('./monorepo/index.js');
|
|
62
62
|
updateManagedFiles(await findRepoRoot());
|
|
63
63
|
});
|
|
64
|
-
monorepo
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
monorepo
|
|
65
|
+
.command('check')
|
|
66
|
+
.option('--warn', 'report drift as warnings (GitHub annotations) instead of failing')
|
|
67
|
+
.action(async (options: { warn?: boolean }) => {
|
|
68
|
+
const { checkManagedFiles } = await import('./monorepo/index.js');
|
|
69
|
+
checkManagedFiles(await findRepoRoot(), { warn: options.warn });
|
|
70
|
+
});
|
|
68
71
|
monorepo.command('diff').action(async () => {
|
|
69
72
|
const { diffManagedFiles } = await import('./monorepo/index.js');
|
|
70
73
|
diffManagedFiles(await findRepoRoot());
|
|
@@ -78,10 +81,19 @@ function buildProgram(): Command {
|
|
|
78
81
|
});
|
|
79
82
|
monorepo
|
|
80
83
|
.command('sync-bun-lockfile-versions')
|
|
81
|
-
.option('--stage', 'stage bun.lock when versions were resynced
|
|
82
|
-
.
|
|
84
|
+
.option('--stage', 'stage bun.lock when versions were resynced; quiet when clean')
|
|
85
|
+
.option(
|
|
86
|
+
'--mode <mode>',
|
|
87
|
+
'install: match package.json (CI); publish: map unpublished -next to last stable tag (pre-pack)',
|
|
88
|
+
'publish',
|
|
89
|
+
)
|
|
90
|
+
.action(async (options: { stage?: boolean; mode?: 'install' | 'publish' }) => {
|
|
83
91
|
const { syncBunLockfileVersions } = await import('./monorepo/index.js');
|
|
84
|
-
|
|
92
|
+
const mode = options.mode === 'install' ? 'install' : 'publish';
|
|
93
|
+
syncBunLockfileVersions(await findRepoRoot(), {
|
|
94
|
+
mode,
|
|
95
|
+
...(options.stage ? { log: false, stage: true } : {}),
|
|
96
|
+
});
|
|
85
97
|
});
|
|
86
98
|
monorepo
|
|
87
99
|
.command('list-release-packages')
|
|
@@ -147,10 +159,25 @@ function buildProgram(): Command {
|
|
|
147
159
|
.command('repair-pending')
|
|
148
160
|
.description('Repair incomplete older release commits before releasing the current HEAD')
|
|
149
161
|
.option('--dry-run [dryRun]', 'run without pushing, publishing, or writing GitHub Releases')
|
|
150
|
-
.
|
|
162
|
+
.option('--ref <ref>', 'fixed release graph ref to inspect')
|
|
163
|
+
.option('--platform-outputs <path>', 'cross-platform repair outputs grouped by release SHA')
|
|
164
|
+
.action(async (options: { dryRun?: string | boolean; platformOutputs?: string; ref?: string }) => {
|
|
165
|
+
// The source self-hosting shim has no Typia transform; release commands import transformed output validators.
|
|
151
166
|
const { releaseRepairPending } = await import('./release/index.js');
|
|
152
167
|
await releaseRepairPending(await findRepoRoot(), { ...options, dryRun: booleanOption(options.dryRun) });
|
|
153
168
|
});
|
|
169
|
+
release
|
|
170
|
+
.command('build-platform-outputs')
|
|
171
|
+
.description('Build selected current and pending-release platform outputs')
|
|
172
|
+
.requiredOption('--bump <bump>', 'auto, patch, minor, major, or prerelease')
|
|
173
|
+
.requiredOption('--targets <targets>', 'comma-separated Nx platform target names or globs')
|
|
174
|
+
.requiredOption('--output <path>', 'output directory for current and repair artifacts')
|
|
175
|
+
.option('--ref <ref>', 'fixed release graph ref to inspect')
|
|
176
|
+
.action(async (options: { bump: string; output: string; ref?: string; targets: string }) => {
|
|
177
|
+
// The source self-hosting shim has no Typia transform; release commands import transformed output validators.
|
|
178
|
+
const { releaseCollectPlatformOutputs } = await import('./release/index.js');
|
|
179
|
+
await releaseCollectPlatformOutputs(await findRepoRoot(), options);
|
|
180
|
+
});
|
|
154
181
|
release
|
|
155
182
|
.command('version')
|
|
156
183
|
.option('--bump <bump>', 'auto, patch, minor, major, or prerelease', 'auto')
|
|
@@ -322,9 +349,20 @@ function buildProgram(): Command {
|
|
|
322
349
|
.requiredOption('--targets <targets>')
|
|
323
350
|
.option('--projects <projects>')
|
|
324
351
|
.option('--configuration <configuration>')
|
|
325
|
-
.
|
|
326
|
-
|
|
327
|
-
|
|
352
|
+
.option('--collect-outputs <directory>')
|
|
353
|
+
.action(
|
|
354
|
+
async (options: { targets: string; projects?: string; configuration?: string; collectOutputs?: string }) => {
|
|
355
|
+
const { githubCiNxRunMany } = await import('./github-ci/index.js');
|
|
356
|
+
await githubCiNxRunMany(await findRepoRoot(), options);
|
|
357
|
+
},
|
|
358
|
+
);
|
|
359
|
+
githubCi
|
|
360
|
+
.command('apply-outputs <directories...>')
|
|
361
|
+
.requiredOption('--source-sha <sha>', 'expected source commit SHA')
|
|
362
|
+
.action(async (directories: string[], options: { sourceSha: string }) => {
|
|
363
|
+
// GitHub CI commands stay lazy so source self-hosting can initialize Typia only at manifest boundaries.
|
|
364
|
+
const { githubCiApplyOutputs } = await import('./github-ci/index.js');
|
|
365
|
+
await githubCiApplyOutputs(await findRepoRoot(), directories, options.sourceSha);
|
|
328
366
|
});
|
|
329
367
|
githubCi
|
|
330
368
|
.command('nx-deploy')
|
package/src/generate/index.ts
CHANGED
|
@@ -42,12 +42,6 @@ export const variants: Record<string, GenerateVariant> = {
|
|
|
42
42
|
args: (name) => ['--name', name, '--variant', 'ts-lib'],
|
|
43
43
|
options: [{ flag: '--public', description: 'configure for npm publication' }],
|
|
44
44
|
},
|
|
45
|
-
'ts-zig': {
|
|
46
|
-
generator: 'create-package',
|
|
47
|
-
description: 'Create a TypeScript + Zig/WASM hybrid package',
|
|
48
|
-
args: (name) => ['--name', name, '--variant', 'ts-zig'],
|
|
49
|
-
options: [{ flag: '--public', description: 'configure for npm publication' }],
|
|
50
|
-
},
|
|
51
45
|
'make-public': {
|
|
52
46
|
generator: 'make-public',
|
|
53
47
|
description: 'Promote a private package to npm publication',
|