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
3 changes: 0 additions & 3 deletions .codesandbox/ci.json

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup
description: Setup the environment

runs:
using: composite
steps:
- name: Setup PNPM
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: .node-version
cache: pnpm

- name: Install Dependencies
shell: bash
run: pnpm i
24 changes: 0 additions & 24 deletions .github/dependabot.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Preview Release

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
preview-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/setup

- name: Bump Version
run: pnpm -s changeset version

- name: Build
run: pnpm -s prepublishOnly

- name: Publish Preview Release
run: pnpx pkg-pr-new publish --compact
69 changes: 10 additions & 59 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- channel/*

permissions:
contents: write
Expand All @@ -24,74 +25,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Install Dependencies
run: npm ci

- name: Get Commit ID
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-commit-id
run: |
echo "short-commit-id=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
echo "commit-id=$(git rev-parse $GITHUB_SHA)" >> $GITHUB_OUTPUT
- name: Setup
uses: ./.github/actions/setup

- name: Get Package Name
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-package-name
run: echo "package-name=$(npm pkg get name | jq -r)" >> $GITHUB_OUTPUT

- name: Get Normalized Package Name
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-normalized-package-name
uses: frabert/replace-string-action@v2
with:
pattern: "^.*?([^/]+)$"
string: ${{ steps.get-package-name.outputs.package-name }}
replace-with: "$1"

- name: Patch package.json
if: ${{ github.event_name == 'workflow_dispatch' }}
run: npm pkg set version=${{ steps.get-commit-id.outputs.short-commit-id }}

- name: Build and Pack
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
npm run prepublishOnly
npm pack

- name: Draft Release
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ steps.get-normalized-package-name.outputs.replaced }}-${{ steps.get-commit-id.outputs.short-commit-id }}.tgz"
artifactContentType: application/gzip
body: "This is a draft release of ${{ steps.get-package-name.outputs.package-name }}: ${{ steps.get-commit-id.outputs.short-commit-id }}."
commit: ${{ steps.get-commit-id.outputs.commit-id }}
tag: "draft"
draft: true
name: "draft"
removeArtifacts: true
- name: Test
run: pnpm -s test

- name: Get Next Package Version
if: ${{ github.event_name != 'workflow_dispatch' }}
id: package-version
run: echo "version=$(npx changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT
run: echo "version=$(pnpm -s changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT

- name: Create Release Pull Request or Publish to NPM
if: ${{ github.event_name != 'workflow_dispatch' }}
id: changesets
uses: changesets/action@v1
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
with:
version: npm run bump
publish: npx changeset publish
publish: pnpm -s changeset publish
commit: "chore(release): v${{ steps.package-version.outputs.version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/setup

- name: Test
run: pnpm -s test
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"*.{js,ts,cjs,mjs,cts,mts,d.cts,d.mts,jsx,tsx,json,jsonc}": [
"biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true"
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
],
"*.{md,yml,yaml,css,html}": ["prettier --write"]
}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public-hoist-pattern[]=@changesets/config
public-hoist-pattern[]=sh-syntax
public-hoist-pattern[]=sql-formatter
public-hoist-pattern[]=sql-parser-cst
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .simple-git-hooks.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"pre-commit": "npx lint-staged"
"pre-commit": "pnpm -s lint-staged"
}
10 changes: 9 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["./tests/code/**/*"],
"ignore": ["./tests/**/fixtures/**/*"],
"ignoreUnknown": true
},
"organizeImports": {
Expand Down Expand Up @@ -38,6 +38,14 @@
"allowTrailingCommas": true
}
}
},
{
"include": ["package.json", ".all-contributorsrc"],
"json": {
"formatter": {
"lineWidth": 1
}
}
}
]
}
Loading