Skip to content

Commit b7e974b

Browse files
committed
Initialize TypeScript package template with essential configurations and workflows
1 parent 8819a61 commit b7e974b

28 files changed

Lines changed: 8892 additions & 1 deletion

.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+
}

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm"
7+
8+
// Features to add to the dev container. More info: https://containers.dev/features.
9+
// "features": {},
10+
11+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
12+
// "forwardPorts": [],
13+
14+
// Use 'postCreateCommand' to run commands after the container is created.
15+
// "postCreateCommand": "yarn install",
16+
17+
// Configure tool-specific properties.
18+
// "customizations": {},
19+
20+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
21+
// "remoteUser": "root"
22+
}

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.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: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
- run: pnpm codegen
26+
- name: Check source state
27+
run: git add src && git diff-index --cached HEAD --exit-code src
28+
29+
types:
30+
name: Types
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 10
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Install dependencies
36+
uses: ./.github/actions/setup
37+
- run: pnpm check
38+
39+
lint:
40+
name: Lint
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 10
43+
steps:
44+
- uses: actions/checkout@v4
45+
- name: Install dependencies
46+
uses: ./.github/actions/setup
47+
- run: pnpm lint
48+
49+
test:
50+
name: Test
51+
runs-on: ubuntu-latest
52+
timeout-minutes: 10
53+
steps:
54+
- uses: actions/checkout@v4
55+
- name: Install dependencies
56+
uses: ./.github/actions/setup
57+
- run: pnpm test

.github/workflows/release.yml

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

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
coverage/
2+
*.tsbuildinfo
3+
node_modules/
4+
.DS_Store
5+
tmp/
6+
dist/
7+
build/
8+
docs/
9+
scratchpad/*
10+
!scratchpad/tsconfig.json
11+
.direnv/
12+
.idea/
13+
.env
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local

.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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"typescript.enablePromptUseWorkspaceTsdk": true,
4+
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.formatOnSave": true,
6+
}

0 commit comments

Comments
 (0)