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
21 changes: 21 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "../node_modules/@changesets/config/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "k0d13/saykit" }],
"commit": false,
"fixed": [
[
"saykit",
"@saykit/react",
"@saykit/carbon",
"@saykit/config",
"@saykit/format-po",
"@saykit/babel-plugin",
"unplugin-saykit"
]
],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
2 changes: 1 addition & 1 deletion .github/actions/node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- uses: pnpm/action-setup@v4

- name: Setup Node.js environment
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
Expand Down
39 changes: 39 additions & 0 deletions .github/labeller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'dependencies':
- changed-files:
- any-glob-to-any-file: ['pnpm-lock.yaml']

'examples':
- changed-files:
- any-glob-to-any-file: ['examples/**']

'tests':
- changed-files:
- any-glob-to-any-file: ['packages/**/*.test.ts']

'package: core':
- changed-files:
- any-glob-to-any-file: ['packages/integration/**']

'package: react':
- changed-files:
- any-glob-to-any-file: ['packages/integration-react/**']

'package: carbon':
- changed-files:
- any-glob-to-any-file: ['packages/integration-carbon/**']

'package: config':
- changed-files:
- any-glob-to-any-file: ['packages/config/**']

'package: format-po':
- changed-files:
- any-glob-to-any-file: ['packages/format-po/**']

'package: babel-plugin':
- changed-files:
- any-glob-to-any-file: ['packages/plugin-babel/**']

'package: unplugin':
- changed-files:
- any-glob-to-any-file: ['packages/unplugin/**']
63 changes: 63 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Labels primarily for issues

- name: bug
description: Something is broken or not working as expected
color: d73a4a

- name: request
description: A request for a new feature or a change in behaviour
color: 0075ca

# Labels primarily for pull requests

- name: dependencies
description: Updates or changes related to project dependencies
color: ffb300

- name: examples
description: Updates or additions to example apps
color: 009688

- name: tests
description: Modifications, additions, or fixes related to testing
color: 00bfa5

# Package labels

- name: 'package: core'
description: Related to the core saykit package
color: 6f42c1

- name: 'package: react'
description: Related to @saykit/react
color: 61dafb

- name: 'package: carbon'
description: Related to @saykit/carbon
color: 5865f2

- name: 'package: config'
description: Related to @saykit/config and the CLI
color: f97316

- name: 'package: format-po'
description: Related to @saykit/format-po
color: 84cc16

- name: 'package: babel-plugin'
description: Related to @saykit/babel-plugin
color: f59e0b

- name: 'package: unplugin'
description: Related to unplugin-saykit
color: 06b6d4

# Labels primarily for both issues and pull requests

- name: blocked
description: Progress is halted due to a dependency or required action
color: d73a4a

- name: duplicate
description: This issue or pull request already exists
color: cfd3d7
24 changes: 24 additions & 0 deletions .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Label Sync

on:
workflow_dispatch:
push:
branches: [main]
paths: [.github/labels.yml]

jobs:
sync:
name: Label Sync
runs-on: ubuntu-latest
permissions:
contents: read
issues: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Sync labels
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
174 changes: 174 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: Pipeline
on:
push:
branches: [main]
paths:
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'turbo.json'
- 'packages/**/src/**'
- 'packages/**/package.json'
- '.changeset/**'
- '.github/workflows/pipeline.yml'
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
paths:
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'turbo.json'
- 'packages/**/src/**'
- 'packages/**/package.json'
- '.changeset/**'
- '.github/workflows/pipeline.yml'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Cancel in-progress runs on PRs (new push makes old run irrelevant)
# but never cancel on main (could interrupt a release)
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
name: Building
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/node

- name: Build all packages
run: pnpm build

- name: Upload dist artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: packages/*/dist/
retention-days: 1

check:
name: Type Checking
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/node

- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: packages

- name: Run the type checker
run: pnpm check --filter "./packages/*"

lint:
name: Linting
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/node

- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: packages

- name: Run the linter
run: pnpm lint

test:
name: Testing
needs: [build]
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/node

- name: Download dist artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: packages

- name: Run tests
run: pnpm test

- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage
path: packages/*/.coverage/
retention-days: 7

process:
name: Processing Changesets
needs: [check, lint, test]
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
permissions:
contents: write
id-token: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/node

- name: Process changesets
id: changesets
uses: changesets/action@v1
with:
version: pnpm run release:version
publish: pnpm run release:publish
title: 'Pending Releases'
commit: 'Update changelog and release'

- run: |
echo "published=${{ steps.changesets.outputs.published }}" >> $GITHUB_OUTPUT

snapshot:
name: Releasing Snapshot
needs: [process]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.process.outputs.published == 'false' }}
permissions:
contents: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/node

- name: Publish snapshot version
run: |
pnpm run release:snapshot:version
pnpm run release:snapshot:publish
21 changes: 21 additions & 0 deletions .github/workflows/pull-request-triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pull Request Triage

on:
- pull_request_target

jobs:
label:
name: Label Pull Request
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Apply pull request labels
uses: actions/labeler@v5
with:
configuration-path: .github/labeller.yml
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@
"coverage": "turbo run coverage",
"build": "turbo run build --filter=\"./packages/*\"",
"dev": "turbo watch build --filter=\"./packages/*\"",
"prepare": "husky & ts-patch install"
"prepare": "husky & ts-patch install",
"release:version": "changeset version",
"release:publish": "changeset publish",
"release:snapshot:version": "changeset version --snapshot",
"release:snapshot:publish": "changeset publish --tag beta"
},
"devDependencies": {
"@changesets/changelog-github": "^0.6.0",
"@changesets/cli": "^2.30.0",
"@changesets/config": "^3.1.3",
"@types/node": "^25.2.3",
"@vitest/coverage-v8": "^4.0.18",
"husky": "^9.1.7",
Expand Down
17 changes: 17 additions & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
{
"name": "@saykit/config",
"version": "0.0.0",
"description": "CLI and configuration tooling for saykit",
"keywords": [
"cli",
"config",
"i18n",
"saykit"
],
"homepage": "https://github.com/k0d13/saykit#readme",
"bugs": {
"url": "https://github.com/k0d13/saykit/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/k0d13/saykit.git",
"directory": "packages/config"
},
"bin": {
"saykit": "./dist/commands/index.mjs"
},
Expand Down
Loading
Loading