-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(monorepo): added typescript templates into extension-template #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
poshinchen
merged 1 commit into
strands-agents:main
from
poshinchen:refactor/monorepo-python-typescript
May 22, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: CI - TypeScript | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'typescript/**' | ||
| - '.github/workflows/ci-typescript.yml' | ||
| push: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'typescript/**' | ||
| - '.github/workflows/ci-typescript.yml' | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: typescript | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test - Node ${{ matrix.node-version }} | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| node-version: ['20', '22'] | ||
| fail-fast: false | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| cache: 'npm' | ||
| cache-dependency-path: typescript/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run tests | ||
| run: npm test | ||
|
|
||
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: 'npm' | ||
| cache-dependency-path: typescript/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Check formatting | ||
| run: npm run format:check | ||
|
|
||
| - name: Run linter | ||
| run: npm run lint | ||
|
|
||
| - name: Type check | ||
| run: npm run type-check |
52 changes: 37 additions & 15 deletions
52
.github/workflows/publish.yml → .github/workflows/publish-python.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,79 +1,101 @@ | ||
| name: Publish to PyPI | ||
| name: Publish Python to PyPI | ||
|
|
||
| # Triggered when a release is published with a tag prefixed `python-v` | ||
| # (e.g. `python-v0.1.0`). The prefix is stripped by hatch-vcs so the | ||
| # package version remains a clean SemVer string. | ||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: python | ||
|
|
||
| jobs: | ||
| check-tag: | ||
| name: Check tag is python-v* | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| should_publish: ${{ steps.check.outputs.should_publish }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ github.event.release.tag_name }}" == python-v* ]]; then | ||
| echo "should_publish=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "should_publish=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| check: | ||
| name: Run checks | ||
| needs: check-tag | ||
| if: needs.check-tag.outputs.should_publish == 'true' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install hatch | ||
| run: pip install hatch | ||
|
|
||
| - name: Run checks | ||
| run: hatch run prepare | ||
|
|
||
| build: | ||
| name: Build distribution | ||
| needs: check | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install hatch | ||
| run: pip install hatch twine | ||
|
|
||
| - name: Build package | ||
| run: hatch build | ||
|
|
||
| - name: Check distribution | ||
| run: twine check dist/* | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
| path: python/dist/ | ||
|
|
||
| publish: | ||
| name: Publish to PyPI | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/p/${{ github.event.repository.name }} | ||
| permissions: | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Download distributions | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Publish TypeScript to npm | ||
|
|
||
| # Triggered when a release is published with a tag prefixed `typescript-v` | ||
| # (e.g. `typescript-v0.1.0`). The version that gets published is whatever is | ||
| # currently in typescript/package.json — bump it before tagging. | ||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: typescript | ||
|
|
||
| jobs: | ||
| check-tag: | ||
| name: Check tag is typescript-v* | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| should_publish: ${{ steps.check.outputs.should_publish }} | ||
| steps: | ||
| - id: check | ||
| run: | | ||
| if [[ "${{ github.event.release.tag_name }}" == typescript-v* ]]; then | ||
| echo "should_publish=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "should_publish=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| check: | ||
| name: Run checks | ||
| needs: check-tag | ||
| if: needs.check-tag.outputs.should_publish == 'true' | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: 'npm' | ||
| cache-dependency-path: typescript/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run checks | ||
| run: npm run check | ||
|
|
||
| publish: | ||
| name: Publish to npm | ||
| needs: check | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| cache: 'npm' | ||
| cache-dependency-path: typescript/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build | ||
| run: npm run build | ||
|
|
||
| - name: Publish | ||
| run: npm publish --access public --provenance | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.