Skip to content

Commit beafa7b

Browse files
committed
chore(build): adopt pnpm and changesets tooling
1 parent 06d6602 commit beafa7b

12 files changed

Lines changed: 4190 additions & 5674 deletions

File tree

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "<PLACEHOLDER>"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "restricted",
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": []
16+
}

.github/actions/setup/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Setup
2+
description: Perform standard setup and install dependencies using pnpm.
3+
inputs:
4+
node-version:
5+
description: The version of Node.js to install
6+
required: true
7+
default: 20.16.0
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v3
14+
- name: Install node
15+
uses: actions/setup-node@v4
16+
with:
17+
cache: pnpm
18+
node-version: ${{ inputs.node-version }}
19+
- name: Install dependencies
20+
shell: bash
21+
run: pnpm install

.github/workflows/check.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Check
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions: {}
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Install dependencies
24+
uses: ./.github/actions/setup
25+
26+
types:
27+
name: Types
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 10
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Install dependencies
33+
uses: ./.github/actions/setup
34+
- run: pnpm check
35+
36+
lint:
37+
name: Lint
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 10
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Install dependencies
43+
uses: ./.github/actions/setup
44+
- run: pnpm lint
45+
46+
test:
47+
name: Test
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 10
50+
steps:
51+
- uses: actions/checkout@v4
52+
- name: Install dependencies
53+
uses: ./.github/actions/setup
54+
- run: pnpm test

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
9+
permissions: {}
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
permissions:
17+
contents: write
18+
id-token: write
19+
pull-requests: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Install dependencies
23+
uses: ./.github/actions/setup
24+
- name: Create Release Pull Request or Publish
25+
uses: changesets/action@v1
26+
with:
27+
version: pnpm changeset-version
28+
publish: pnpm changeset-publish
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/snapshot.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Snapshot
2+
3+
on:
4+
pull_request:
5+
branches: [main, next-minor, next-major]
6+
workflow_dispatch:
7+
8+
permissions: {}
9+
10+
jobs:
11+
snapshot:
12+
name: Snapshot
13+
if: github.repository_owner == 'Effect-Ts'
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install dependencies
19+
uses: ./.github/actions/setup
20+
- name: Build package
21+
run: pnpm build
22+
- name: Create snapshot
23+
id: snapshot
24+
run: pnpx pkg-pr-new@0.0.24 publish --pnpm --comment=off

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"effectful-tech.effect-vscode",
4+
"dbaeumer.vscode-eslint"
5+
]
6+
}

.vscode/settings.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"typescript.preferences.importModuleSpecifier": "relative",
4+
"typescript.enablePromptUseWorkspaceTsdk": true,
5+
"editor.formatOnSave": true,
6+
"eslint.format.enable": true,
7+
"[json]": {
8+
"editor.defaultFormatter": "vscode.json-language-features"
9+
},
10+
"[markdown]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"prettier.semi": false,
13+
"prettier.trailingComma": "none"
14+
},
15+
"[javascript]": {
16+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
17+
},
18+
"[javascriptreact]": {
19+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
20+
},
21+
"[typescript]": {
22+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
23+
},
24+
"[typescriptreact]": {
25+
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
26+
},
27+
"eslint.validate": ["markdown", "javascript", "typescript"],
28+
"editor.codeActionsOnSave": {
29+
"source.fixAll.eslint": "explicit"
30+
},
31+
"editor.quickSuggestions": {
32+
"other": true,
33+
"comments": false,
34+
"strings": false
35+
},
36+
"editor.acceptSuggestionOnCommitCharacter": true,
37+
"editor.acceptSuggestionOnEnter": "on",
38+
"editor.quickSuggestionsDelay": 10,
39+
"editor.suggestOnTriggerCharacters": true,
40+
"editor.tabCompletion": "off",
41+
"editor.suggest.localityBonus": true,
42+
"editor.suggestSelection": "recentlyUsed",
43+
"editor.wordBasedSuggestions": "matchingDocuments",
44+
"editor.parameterHints.enabled": true,
45+
"files.insertFinalNewline": true
46+
}

flake.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
4+
};
5+
outputs = {nixpkgs, ...}: let
6+
forAllSystems = function:
7+
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed
8+
(system: function nixpkgs.legacyPackages.${system});
9+
in {
10+
formatter = forAllSystems (pkgs: pkgs.alejandra);
11+
devShells = forAllSystems (pkgs: {
12+
default = pkgs.mkShell {
13+
packages = with pkgs; [
14+
corepack
15+
nodejs_22
16+
# For systems that do not ship with Python by default (required by `node-gyp`)
17+
python3
18+
];
19+
};
20+
});
21+
};
22+
}

0 commit comments

Comments
 (0)