Skip to content

Commit efcd7ff

Browse files
committed
chore: add package boilerplate
Adds initial Node.js package boilerplate. Here's a highlight of what's included: - Uses `npm` package manager for managing dependencies and scripts - Dual-module system support via TypeScript transpilation - Uses `gts` for linting - Uses `typescript` package to transpile TypeScript files - Uses `c8` for coverage support - Uses `tap` test runner - Setup initial GitHub Actions workflow for running ci tests
1 parent deb9f72 commit efcd7ff

15 files changed

+7134
-0
lines changed

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
insert_final_newline = true

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
scripts/

.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./node_modules/gts/"
3+
}

.github/workflows/ci.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: Test
8+
strategy:
9+
matrix:
10+
node-version: [v14.x, v16.x, v18.x, v19.x]
11+
platform:
12+
- os: ubuntu-latest
13+
shell: bash
14+
- os: macos-latest
15+
shell: bash
16+
- os: windows-latest
17+
shell: powershell
18+
fail-fast: false
19+
20+
runs-on: ${{ matrix.platform.os }}
21+
defaults:
22+
run:
23+
shell: ${{ matrix.platform.shell }}
24+
25+
steps:
26+
- name: Checkout Repository
27+
uses: actions/checkout@v3
28+
29+
- name: Use Nodejs ${{ matrix.node-version }}
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Transpile TypeScript
38+
run: npm run compile
39+
40+
- name: Run Tests
41+
run: npm --ignore-scripts test -- -c -t0
42+
timeout-minutes: 5
43+
44+
lint:
45+
name: Lint
46+
strategy:
47+
fail-fast: false
48+
49+
runs-on: ubuntu-latest
50+
defaults:
51+
run:
52+
shell: bash
53+
54+
steps:
55+
- name: Checkout Repository
56+
uses: actions/checkout@v3
57+
58+
- name: Use Nodejs v18.x
59+
uses: actions/setup-node@v3
60+
with:
61+
node-version: v18.x
62+
63+
- name: Install dependencies
64+
run: npm install
65+
66+
- name: Run Lint
67+
run: npm run lint
68+

.gitignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ignore most things, include a handful of others
2+
/*
3+
/.*
4+
!/src
5+
!/docs
6+
!/package.json
7+
!/package-lock.json
8+
!/README.md
9+
!/LICENSE{,.*}
10+
!/example
11+
!/scripts
12+
!/tap-snapshots
13+
!/test
14+
!/.editorconfig
15+
!/.eslintignore
16+
!/.eslintrc.json
17+
!/.prettierrc.js
18+
!/.gitignore
19+
!/.github
20+
!/.gitattributes
21+
!/tsconfig*.json

.prettierrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('gts/.prettierrc.json')
3+
}

0 commit comments

Comments
 (0)