Skip to content

Commit

Permalink
Merge pull request #10 from napolab/chore/add-sideeffects-false
Browse files Browse the repository at this point in the history
Chore/add-sideeffects-false
  • Loading branch information
naporin0624 authored Oct 15, 2024
2 parents dbef1dc + 959a7a0 commit a1f3b76
Show file tree
Hide file tree
Showing 15 changed files with 3,522 additions and 70 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-glasses-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"durabcast": patch
---

sideeffect false
68 changes: 48 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
required: true
default: "main"

env:
PNPM_VERSION: 9.12.1

jobs:
setup:
runs-on: ubuntu-latest
Expand All @@ -21,16 +24,21 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

test:
runs-on: ubuntu-latest
Expand All @@ -40,19 +48,24 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Run tests
run: bun run test
run: pnpm run test

lint:
runs-on: ubuntu-latest
Expand All @@ -62,19 +75,24 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Run linter
run: bun run lint
run: pnpm run lint

typecheck:
runs-on: ubuntu-latest
Expand All @@ -84,19 +102,24 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Run typecheck
run: bun run typecheck
run: pnpm run typecheck

build:
runs-on: ubuntu-latest
Expand All @@ -106,18 +129,23 @@ jobs:
with:
ref: ${{ github.head_ref || github.event.inputs.branch }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: actions/setup-node@v4
with:
node-version-file: package.json

- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Build
run: |
bun run build
bunx publint
pnpm run build
pnpx publint
14 changes: 10 additions & 4 deletions .github/workflows/package-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PNPM_VERSION: 9.12.1

jobs:
pkg-size-report:
name: Package Size Report
Expand All @@ -16,10 +19,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

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

- uses: pnpm/action-setup@v4
with:
node-version: "20.x"
version: ${{ env.PNPM_VERSION }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -32,7 +38,7 @@ jobs:
- name: Package size report
uses: preactjs/compressed-size-action@v2
with:
install-script: "bun install"
install-script: "pnpm install"
build-script: "build"
pattern: "./dist/**/*.{js}"
exclude: "{**/*.map,**/node_modules/**}"
17 changes: 10 additions & 7 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PNPM_VERSION: 9.12.1

jobs:
pre-release:
runs-on: ubuntu-latest
Expand All @@ -14,23 +17,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Build
run: bun run build
run: pnpm run build

- run: bunx pkg-pr-new publish
- run: pnpx pkg-pr-new publish
21 changes: 12 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
PNPM_VERSION: 9.12.1

jobs:
release:
name: Release
Expand All @@ -18,32 +21,32 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json

- name: Set up Bun
uses: oven-sh/setup-bun@v2
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache node_modules
uses: ./.github/actions/cache-node-modules
with:
path: "**/node_modules"

- name: Install dependencies
run: bun install
run: pnpm install

- name: Build
run: |
bun run build
bunx publint
pnpm run build
pnpx publint
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
publish: bun run release
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
pnpm = "9.12.1"
Binary file removed bun.lockb
Binary file not shown.
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.cts",
"sideEffects": false,
"exports": {
".": {
"import": {
Expand Down Expand Up @@ -37,11 +38,7 @@
}
}
},
"files": [
"dist",
"README.md",
"package.json"
],
"files": ["dist", "README.md", "package.json"],
"private": false,
"license": "MIT",
"publishConfig": {
Expand All @@ -57,12 +54,12 @@
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@changesets/cli": "^2.27.7",
"@cloudflare/vitest-pool-workers": "^0.4.16",
"@cloudflare/vitest-pool-workers": "^0.5.18",
"@cloudflare/workers-types": "^4.20240529.0",
"hono": "^4.5.3",
"tsup": "^8.2.3",
"typescript": "^5.5.4",
"vitest": "1.5.0",
"vitest": "2.1.3",
"wrangler": "^3.67.1"
},
"scripts": {
Expand All @@ -81,5 +78,6 @@
"dependencies": {
"@hono/zod-validator": "^0.2.2",
"zod": "^3.23.8"
}
},
"packageManager": "pnpm@9.12.1"
}
Loading

0 comments on commit a1f3b76

Please sign in to comment.