Skip to content

Commit

Permalink
fix: update template based on @kubb changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Jul 7, 2023
1 parent 77c84f1 commit 0fa37f3
Show file tree
Hide file tree
Showing 52 changed files with 3,461 additions and 5,053 deletions.
6 changes: 6 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": ["packages/core", "packages/demo"],
"sandboxes": [],
"node": "18",
"installCommand": "install:csb"
}
9 changes: 9 additions & 0 deletions .codesandbox/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://codesandbox.io/schemas/tasks.json",
"setupTasks": [
{
"name": "Install Dependencies",
"command": "corepack enable && pnpm install --frozen-lockfile"
}
]
}
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
}
}
12 changes: 7 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[*]
indent_style = space
indent_size = 2
end_of_line = LF
tab_width = 2
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = LF
tab_width = 2
15 changes: 9 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
umd
build
config
esnext
es
lib
dist/**
dist
**/dist/**
coverage/**
**/coverage/**
mocks/**
**/mocks/**
*.d.ts
**.d.ts
94 changes: 0 additions & 94 deletions .eslintrc.cjs

This file was deleted.

56 changes: 41 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ name: ci

on:
push:
paths:
- 'packages/**'
branches:
- main
- 'releases/**'
pull_request:
workflow_dispatch:

workflow_dispatch:

jobs:
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest
# To use Remote Caching, uncomment the next lines and follow the steps below.
# env:
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
# TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

steps:
- name: Check out code
Expand All @@ -26,28 +24,56 @@ jobs:

- uses: pnpm/[email protected]
with:
version: 7.14.2
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: pnpm install

run: pnpm install --prefer-offline

- uses: dtinth/setup-github-actions-caching-for-turbo@v1
with:
# Set the prefix for the cache keys.
cache-prefix: kubb_

- name: Build
run: pnpm build

run: bun run build --concurrency=1

- name: Typecheck
run: bun run typecheck --concurrency=1

- name: Test
run: pnpm test
run: bun run test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Release
if: ${{ success() && (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }}
id: release
continue-on-error: true
if: ${{ success() && github.ref == 'refs/heads/main' && (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: bun run release

- name: Release canary
continue-on-error: true
if: steps.release.outcome == 'failure'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm release --filter=[HEAD^1]
run: |
bun run release:canary --concurrency=1
138 changes: 87 additions & 51 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,56 +1,92 @@
name: pr

on:
pull_request:
workflow_dispatch:

# inputs:
# os:
# description: Choose os
# required: true
# type: choice
# options:
# - ubuntu-latest
# - macos-latest
# - windows-latest

jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 16.14.2
registry-url: https://registry.npmjs.org
cache: 'pnpm'
- name: Install dependencies
run: pnpm --prefer-offline install
- run: pnpm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
lint:
name: 'Lint'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 16.14.2
registry-url: https://registry.npmjs.org
cache: 'pnpm'
- name: Install dependencies
run: pnpm --prefer-offline install
- run: pnpm run lint
typecheck:
name: 'Typecheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 16.14.2
registry-url: https://registry.npmjs.org
cache: 'pnpm'
- name: Install dependencies
run: pnpm --prefer-offline install
- run: pnpm run typecheck
build:
name: Build and Test
timeout-minutes: 15
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
node-version: [18]
experimental: [false]
## comment out for support of node 19,20
# include:
# - os: ubuntu-latest
# node-version: 19
# experimental: true
# - os: ubuntu-latest
# node-version: 20
# experimental: true

runs-on: ${{ matrix.os || 'ubuntu-latest' }}
continue-on-error: ${{ matrix.experimental || false }}

steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: pnpm/[email protected]
with:
version: 8

- name: Setup Node.js(${{ matrix.node-version }}) environment
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Install dependencies
run: pnpm install --prefer-offline

- uses: dtinth/setup-github-actions-caching-for-turbo@v1
with:
# Set the prefix for the cache keys.
cache-prefix: kubb_

- name: Build
run: bun run build --concurrency=1

- name: Typecheck
run: bun run typecheck --concurrency=1

- name: Linting
env:
NODE_OPTIONS: "--max_old_space_size=4096"
continue-on-error: true
run: bun run lint:ci

- name: Test
run: bun run test

- name: Test with Bun
continue-on-error: true
run: bun run test:bun

- name: Test with Jest
continue-on-error: true
run: bun run test:jest

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit 0fa37f3

Please sign in to comment.