Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.

Commit 44edddd

Browse files
committed
Initial commit
0 parents  commit 44edddd

18 files changed

+7013
-0
lines changed

.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
env: {
3+
es2021: true,
4+
node: true,
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/recommended',
9+
],
10+
parser: '@typescript-eslint/parser',
11+
parserOptions: {
12+
ecmaVersion: 12,
13+
sourceType: 'module',
14+
},
15+
plugins: [
16+
'@typescript-eslint',
17+
],
18+
rules: {
19+
indent: [
20+
'error',
21+
2,
22+
],
23+
'linebreak-style': [
24+
'error',
25+
'unix',
26+
],
27+
quotes: [
28+
'error',
29+
'single',
30+
],
31+
semi: [
32+
'error',
33+
'never',
34+
],
35+
'quote-props': ['error', 'as-needed'],
36+
'no-param-reassign': 'error',
37+
'comma-dangle': ['error', 'always-multiline'],
38+
'space-infix-ops': ['error'],
39+
'no-multi-spaces': ['error'],
40+
},
41+
}

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Basic set up for three package managers
2+
3+
version: 2
4+
updates:
5+
# Maintain dependencies for GitHub Actions
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"
10+
open-pull-requests-limit: 10
11+
12+
# Maintain dependencies for npm
13+
- package-ecosystem: "npm"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
open-pull-requests-limit: 10

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
- run: npm ci
16+
- name: Release
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
run: npx semantic-release

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
push:
5+
jobs:
6+
test:
7+
name: Test
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: 14
14+
- run: npm ci
15+
- name: Test
16+
run: npm run test
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: 14
25+
- run: npm ci
26+
- name: Lint
27+
run: npm run lint

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
dist-ts
4+
.vscode

.npmignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.eslintrc.js
2+
.github
3+
.gitignore
4+
.travis.yml
5+
.vscode
6+
api-extractor.json
7+
bundle-types.ts
8+
dist-ts
9+
lib
10+
package-lock.json
11+
rollup.config.js
12+
tsconfig-build.json
13+
tsconfig.json

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Francis Gulotta
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Typescript Library Template
2+
3+
[![Release](https://github.com/reconbot/typescript-library-template/actions/workflows/test.yml/badge.svg)](https://github.com/reconbot/typescript-library-template/actions/workflows/test.yml)
4+
5+
This is an example project for shipping typescript using the rules layed out by [@southpolesteve](https://twitter.com/southpolesteve) in his ["Shipping Typescript to NPM"](https://speakerdeck.com/southpolesteve/shipping-typescript-to-npm?slide=10) talk that he gave at NYC typescript.
6+
7+
It gives you a library in UMD and ESM that's rolled up with rollup and includes rolled up types. It makes browser users, node users and me very happy.
8+
9+
Also includes eslint, mocha, semantic-release and github actions. Now updated to include the exports directive in the package.json.
10+
11+
## Guide
12+
13+
- Set the repo secret `NPM_TOKEN` before your first push so that you can publish to npm.
14+
- Change all references in package.json to your own project name
15+
- If you want external dependencies, add them to the `external` section in the `rollup.config.js` otherwise they will be bundled in the library.

0 commit comments

Comments
 (0)