Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,6 +46,35 @@ jobs:
if: matrix.node-version == 24
run: npm run lint

cli:
runs-on: ${{ (startsWith(vars.CI_RUNNER, 'blacksmith-') && vars.CI_RUNNER) || 'blacksmith-4vcpu-ubuntu-2404' }}
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
steps:
- uses: useblacksmith/checkout@v1
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install workspace deps
run: npm ci
- name: Build SDK (workspace dependency)
run: npm run build --workspace @terminal49/sdk
- name: Build CLI
run: npm run build --workspace @terminal49/cli
- name: Type-check CLI
run: npm run type-check --workspace @terminal49/cli
- name: Test CLI
run: npm run test --workspace @terminal49/cli
# oxlint/oxfmt require Node 20+; lint is static so it only needs one
# modern runtime. Build/test still cover the full matrix for consumers.
- name: Lint CLI (oxlint + oxfmt)
if: matrix.node-version == 24
run: npm run lint --workspace @terminal49/cli

mcp:
runs-on: ${{ (startsWith(vars.CI_RUNNER, 'blacksmith-') && vars.CI_RUNNER) || 'blacksmith-4vcpu-ubuntu-2404' }}
steps:
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/publish_typescript_cli.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
name: Publish TypeScript CLI

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: Release tag to publish, for example cli-v-v0.1.0
required: true
type: string

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-24.04
steps:
- name: Resolve release tag
id: release-tag
run: echo "tag=${{ github.event.release.tag_name || inputs.tag }}" >> "$GITHUB_OUTPUT"

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.release-tag.outputs.tag }}

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org/
cache: npm
cache-dependency-path: package-lock.json

- name: Read CLI version
id: cli-version
run: |
version=$(node -p "require('./sdks/typescript-sdk-cli/package.json').version")
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Check release tag matches CLI version
id: tag-check
run: |
tag="${{ steps.release-tag.outputs.tag }}"
version="${{ steps.cli-version.outputs.version }}"
if [[ "$tag" == "v$version" || "$tag" == "cli-v$version" || "$tag" == "$version" || "$tag" == "cli-v-v$version" ]]; then
echo "publish=true" >> "$GITHUB_OUTPUT"
else
echo "publish=false" >> "$GITHUB_OUTPUT"
echo "Release tag $tag does not match CLI version $version; skipping publish."
fi

- name: Install workspace dependencies
if: steps.tag-check.outputs.publish == 'true'
run: npm ci

- name: Build SDK (workspace dependency)
if: steps.tag-check.outputs.publish == 'true'
run: npm run build --workspace @terminal49/sdk

- name: Build CLI
if: steps.tag-check.outputs.publish == 'true'
run: npm run build --workspace @terminal49/cli

- name: Test CLI
if: steps.tag-check.outputs.publish == 'true'
run: npm run test --workspace @terminal49/cli

- name: Publish
if: steps.tag-check.outputs.publish == 'true'
working-directory: sdks/typescript-sdk-cli
run: npm publish --access public
10 changes: 9 additions & 1 deletion .github/workflows/release_please_sdk.yml
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
name: Release Please — TypeScript SDK
name: Release Please — TypeScript SDK + CLI

on:
push:
branches: [main]
paths:
- "sdks/typescript-sdk/**"
- "sdks/typescript-sdk-cli/**"

permissions:
actions: write
Expand All@@ -27,3 +28,10 @@ jobs:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.release.outputs['sdks/typescript-sdk--tag_name'] }}
run: gh workflow run publish_typescript_sdk.yml --repo "$GITHUB_REPOSITORY" --ref main -f tag="$RELEASE_TAG"

- name: Dispatch CLI publish
if: ${{ steps.release.outputs['sdks/typescript-sdk-cli--release_created'] == 'true' }}
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ steps.release.outputs['sdks/typescript-sdk-cli--tag_name'] }}
run: gh workflow run publish_typescript_cli.yml --repo "$GITHUB_REPOSITORY" --ref main -f tag="$RELEASE_TAG"
14 changes: 14 additions & 0 deletions .release-please-config.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,8 +29,22 @@
"type": "json",
"path": "packages/mcp/package-lock.json",
"jsonpath": "$.packages[''].dependencies['@terminal49/sdk']"
},
{
"type": "json",
"path": "sdks/typescript-sdk-cli/package.json",
"jsonpath": "$.dependencies['@terminal49/sdk']"
Comment on lines +33 to +36

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the root lock dependency during SDK releases

When Release Please bumps the SDK, this updater changes the CLI's exact @terminal49/sdk dependency but does not update the corresponding dependency under packages['sdks/typescript-sdk-cli'] in the authoritative root lockfile. The resulting release PR and CLI publish tag run root npm ci, which rejects the package/lock mismatch before building; add an adjacent root-lock extra-files updater for that dependency.

AGENTS.md reference: AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

}
]
Comment on lines +34 to 38

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1CLI lockfile dependency stays stale

When release-please bumps the SDK, this entry updates the CLI package's @terminal49/sdk dependency without updating the corresponding CLI workspace dependency in the root lockfile. The subsequent root-level npm ci used by CLI CI and publishing rejects the inconsistent manifest and lockfile, preventing the CLI from building or publishing.

Knowledge Base Used:Repo Tooling and CI

Prompt To Fix With AI
This is a comment left during a code review.
Path: .release-please-config.json
Line: 34-38
Comment:
**CLI lockfile dependency stays stale**
When release-please bumps the SDK, this entry updates the CLI package's `@terminal49/sdk` dependency without updating the corresponding CLI workspace dependency in the root lockfile. The subsequent root-level `npm ci` used by CLI CI and publishing rejects the inconsistent manifest and lockfile, preventing the CLI from building or publishing.
**Knowledge Base Used:**[Repo Tooling and CI](https://app.greptile.com/terminal49/-/custom-context/knowledge-base/terminal49/api/-/docs/repo-tooling-ci.md)---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in CodexFix in Claude Code

},
"sdks/typescript-sdk-cli": {
"package-name": "@terminal49/cli",
"release-type": "node",
"changelog-path": "CHANGELOG.md",
"bump-minor-pre-major": true,
Comment on lines +40 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the root lock version during CLI releases

When Release Please increments the CLI package version, this package configuration has no updater for package-lock.json's packages['sdks/typescript-sdk-cli'].version. Because the publish workflow checks out that tag and runs root npm ci, every such CLI release will fail on the stale workspace version before it reaches npm publish; include the root lock entry in extra-files.

AGENTS.md reference: AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

"tag-separator": "-",
"include-component-in-tag": true,
"component": "cli-v"
}
}
}
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
{
"sdks/typescript-sdk": "0.3.1"
"sdks/typescript-sdk": "0.3.1",
"sdks/typescript-sdk-cli": "0.1.0"
}
Loading
Loading