Merge commit '3c60637c1a27da8ba66888de518d58d5707801f2' as 'repos/effect-smol'
This commit is contained in:
33
repos/effect-smol/.github/actions/setup/action.yaml
vendored
Normal file
33
repos/effect-smol/.github/actions/setup/action.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: Setup
|
||||
description: Perform standard setup and install dependencies using pnpm.
|
||||
inputs:
|
||||
deno-version:
|
||||
description: The version of Deno to install
|
||||
required: false
|
||||
bun-version:
|
||||
description: The version of Bun to install
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: pnpm
|
||||
node-version: 26.4.0
|
||||
- name: Install deno
|
||||
uses: denoland/setup-deno@v2
|
||||
if: ${{ inputs.deno-version != '' }}
|
||||
with:
|
||||
deno-version: ${{ inputs.deno-version }}
|
||||
- name: Install bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
if: ${{ inputs.bun-version != '' }}
|
||||
with:
|
||||
bun-version: ${{ inputs.bun-version }}
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm install
|
||||
66
repos/effect-smol/.github/workflows/ai-codegen.yml
vendored
Normal file
66
repos/effect-smol/.github/workflows/ai-codegen.yml
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
name: Nightly AI Codegen
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * *" # Midnight UTC daily
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
codegen:
|
||||
name: AI Codegen
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
|
||||
- name: Run AI Codegen
|
||||
run: node packages/tools/ai-codegen/src/bin.ts generate
|
||||
|
||||
- name: Check for changes
|
||||
id: changes
|
||||
run: |
|
||||
# Only consider changes in packages/ai/
|
||||
providers=$(git diff --name-only | grep "^packages/ai/" | cut -d'/' -f3 | sort -u | sed 's/^/- /' || true)
|
||||
if [ -z "$providers" ]; then
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
{
|
||||
echo "updated_providers<<EOF"
|
||||
echo "$providers"
|
||||
echo "EOF"
|
||||
} >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Pull Request
|
||||
if: steps.changes.outputs.has_changes == 'true'
|
||||
uses: peter-evans/create-pull-request@v8
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: chore/ai-codegen-update
|
||||
delete-branch: true
|
||||
title: "chore: update AI codegen generated files"
|
||||
body: |
|
||||
Automated update of AI provider generated code.
|
||||
|
||||
## Updated Providers
|
||||
|
||||
${{ steps.changes.outputs.updated_providers }}
|
||||
|
||||
---
|
||||
|
||||
*This PR was automatically generated by the nightly codegen workflow.*
|
||||
commit-message: "chore: regenerate AI provider code"
|
||||
labels: automated
|
||||
72
repos/effect-smol/.github/workflows/bundle-comment.yml
vendored
Normal file
72
repos/effect-smol/.github/workflows/bundle-comment.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Bundle Size Comment
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Check"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
name: Bundle
|
||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
pull-requests: write
|
||||
timeout-minutes: 1
|
||||
steps:
|
||||
- name: Download Artifact
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: bundle-stats
|
||||
path: bundle-stats
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Get stats
|
||||
id: stats
|
||||
run: |
|
||||
{
|
||||
echo 'stats<<EOF'
|
||||
cat bundle-stats/stats.txt
|
||||
echo EOF
|
||||
} >> $GITHUB_OUTPUT
|
||||
# https://github.com/orgs/community/discussions/25220#discussioncomment-11300118
|
||||
- name: Get PR number
|
||||
id: pr-context
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PR_TARGET_REPO: ${{ github.repository }}
|
||||
PR_BRANCH: |-
|
||||
${{
|
||||
(github.event.workflow_run.head_repository.owner.login != github.event.workflow_run.repository.owner.login)
|
||||
&& format('{0}:{1}', github.event.workflow_run.head_repository.owner.login, github.event.workflow_run.head_branch)
|
||||
|| github.event.workflow_run.head_branch
|
||||
}}
|
||||
run: gh pr view --repo "${PR_TARGET_REPO}" "${PR_BRANCH}" --json 'number' --jq '"number=\(.number)"' >> "${GITHUB_OUTPUT}"
|
||||
- name: Find Comment
|
||||
id: find-comment
|
||||
uses: peter-evans/find-comment@v4
|
||||
with:
|
||||
issue-number: ${{ steps.pr-context.outputs.number }}
|
||||
comment-author: "github-actions[bot]"
|
||||
body-includes: <!-- This comment was auto-generated by GitHub Actions to display bundle size statistics -->
|
||||
- name: Create Comment
|
||||
id: comment
|
||||
uses: peter-evans/create-or-update-comment@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BUNDLE_STATS: "${{ steps.stats.outputs.stats }}"
|
||||
with:
|
||||
comment-id: ${{ steps.find-comment.outputs.comment-id }}
|
||||
issue-number: ${{ steps.pr-context.outputs.number }}
|
||||
edit-mode: replace
|
||||
body: |
|
||||
<!-- This comment was auto-generated by GitHub Actions to display bundle size statistics -->
|
||||
## Bundle Size Analysis
|
||||
${{ env.BUNDLE_STATS }}
|
||||
195
repos/effect-smol/.github/workflows/check.yml
vendored
Normal file
195
repos/effect-smol/.github/workflows/check.yml
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
name: Check
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- run: pnpm lint
|
||||
|
||||
types:
|
||||
name: Types
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- run: pnpm check
|
||||
- run: pnpm test-types --target '>=5.9'
|
||||
|
||||
build:
|
||||
name: Build
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Set strip internals config
|
||||
run: |
|
||||
sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
|
||||
- run: pnpm build
|
||||
|
||||
types-deno:
|
||||
name: Types on Deno
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
deno-version: v2.8.3
|
||||
- name: Set strip internals config
|
||||
run: |
|
||||
sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
|
||||
- run: deno check .
|
||||
|
||||
bundle:
|
||||
name: Bundle
|
||||
if: github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
pull-requests: write
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Clone base ref
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
path: base
|
||||
ref: ${{ github.event.pull_request.base.ref }}
|
||||
- name: Set strip internals config
|
||||
run: |
|
||||
sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
|
||||
sed -i 's/"stripInternal": false/"stripInternal": true/' base/tsconfig.base.json
|
||||
- name: Build
|
||||
run: |
|
||||
pnpm build &
|
||||
cd base && pnpm install && pnpm build &
|
||||
wait
|
||||
- name: Compare bundle size
|
||||
run: node ./packages/tools/bundle/src/bin.ts compare --base-dir base/packages/tools/bundle/fixtures
|
||||
- name: Upload stats artifact
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bundle-stats
|
||||
path: stats.txt
|
||||
if-no-files-found: error
|
||||
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
shard: [1/2, 2/2]
|
||||
runtime: [Node, Deno]
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Pre-pull test container images
|
||||
run: |
|
||||
docker pull testcontainers/ryuk:0.14.0 &
|
||||
docker pull ghcr.io/tursodatabase/libsql-server:main &
|
||||
docker pull postgres:alpine &
|
||||
docker pull mysql:lts &
|
||||
docker pull vitess/vttestserver:mysql80 &
|
||||
docker pull redis:alpine &
|
||||
wait
|
||||
|
||||
- name: Install dependencies
|
||||
if: matrix.runtime == 'Node'
|
||||
uses: ./.github/actions/setup
|
||||
- name: Test
|
||||
if: matrix.runtime == 'Node'
|
||||
run: pnpm test --shard ${{ matrix.shard }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: matrix.runtime == 'Deno'
|
||||
uses: ./.github/actions/setup
|
||||
with:
|
||||
deno-version: v2.8.3
|
||||
- name: Test
|
||||
if: matrix.runtime == 'Deno'
|
||||
run: deno task test --shard ${{ matrix.shard }}
|
||||
|
||||
docgen:
|
||||
name: Documentation Generation
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Generate Documentation
|
||||
run: pnpm docgen
|
||||
|
||||
ai-docgen:
|
||||
name: AI Documentation Generation
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Generate AI Documentation
|
||||
run: pnpm ai-docgen
|
||||
- name: Verify AI Documentation is up-to-date
|
||||
run: |
|
||||
if [ -n "$(git status --short)" ]; then
|
||||
git status --short
|
||||
echo "Run 'pnpm ai-docgen' and commit generated changes."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
circular:
|
||||
name: Circular Dependencies
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Check for circular dependencies
|
||||
run: pnpm circular
|
||||
47
repos/effect-smol/.github/workflows/release.yml
vendored
Normal file
47
repos/effect-smol/.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Release
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
if: github.repository_owner == 'Effect-Ts'
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
packages: write
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
# This is required to ensure the `GITHUB_TOKEN` we provide below is
|
||||
# **always** used when pushing updates to the changesets release branch.
|
||||
# Otherwise the default token will be used, and actions on that versioned
|
||||
# release branch will not be triggered.
|
||||
persist-credentials: false
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Upgrade npm for OIDC support
|
||||
run: npm install -g npm@11
|
||||
- name: Set strip internals config
|
||||
run: |
|
||||
sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
|
||||
- name: Create Release Pull Request or Publish
|
||||
uses: changesets/action@v1
|
||||
with:
|
||||
version: pnpm changeset-version
|
||||
publish: pnpm changeset-publish
|
||||
env:
|
||||
# Use a personal access token instead of the one that GitHub generates
|
||||
# automatically to ensure workflows get triggered on the changesets
|
||||
# release branch.
|
||||
GITHUB_TOKEN: ${{ secrets.CHANGESET_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
34
repos/effect-smol/.github/workflows/snapshot.yml
vendored
Normal file
34
repos/effect-smol/.github/workflows/snapshot.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Snapshot
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
snapshot:
|
||||
name: Snapshot
|
||||
if: github.repository_owner == 'Effect-Ts'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/setup
|
||||
- name: Set strip internals config
|
||||
run: |
|
||||
sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json
|
||||
- name: Run codemods
|
||||
run: pnpm codemod
|
||||
- name: Build package
|
||||
run: pnpm build
|
||||
- name: Create snapshot
|
||||
id: snapshot
|
||||
run: pnpx pkg-pr-new@0.0.62 publish --pnpm --comment=off ./packages/* ./packages/atom/* ./packages/ai/* ./packages/sql/* ./packages/tools/*
|
||||
Reference in New Issue
Block a user