Skip to content

Commit

Permalink
Merge pull request #97 from authts/switch-to-esbuild
Browse files Browse the repository at this point in the history
switch to esbuild
  • Loading branch information
pamapa authored Oct 11, 2021
2 parents aba6a6a + ed25b74 commit 8cba83d
Show file tree
Hide file tree
Showing 31 changed files with 12,947 additions and 15,086 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = double

[{package,package-lock}.json]
indent_size = 2

[*.{yaml,yml}]
indent_size = 2
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
lib/
57 changes: 0 additions & 57 deletions .eslintrc

This file was deleted.

57 changes: 57 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
plugins:
- "@typescript-eslint"
- testing-library
env:
browser: true
node: true
parserOptions:
ecmaVersion: 2020
sourceType: module
extends:
- eslint:recommended
- plugin:testing-library/dom
rules:
consistent-return: error
indent:
- error
- 4
- SwitchCase: 1
quotes: error
semi: error
keyword-spacing: error
space-before-blocks: error
no-multiple-empty-lines:
- error
- max: 1
maxEOF: 0
overrides:
- files: ["*.ts", "*.tsx"]
parserOptions:
project:
- ./tsconfig.json
- ./test/tsconfig.json
- ./example/tsconfig.json
extends:
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
rules:
indent: "off"
"@typescript-eslint/indent":
- error
- 4
- SwitchCase: 1
"@typescript-eslint/member-delimiter-style": error
"@typescript-eslint/explicit-module-boundary-types":
- error
- allowArgumentsExplicitlyTypedAsAny: true
"@typescript-eslint/object-curly-spacing":
- error
- always
# custom rules to fix code style
"@typescript-eslint/no-explicit-any": "off"
- files: src/**/*
env:
node: false
- files: test/**/*
env:
jest: true
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Set the language for these files to json5 to ensure GitHub doesn't show the comments as errors
/.vscode/*.json linguist-language=JSON5
/api-extractor.json linguist-language=JSON5
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
node-version: 16.x
cache: npm
registry-url: https://registry.npmjs.org

- run: npm install
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41 changes: 28 additions & 13 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,33 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
env:
CI: true

- run: npm install
- run: npm run build
- run: npm run lint
- run: npm test
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
env:
CI: true

- name: Cache incremental builds
uses: actions/cache@v2
with:
path: |
.eslintcache
lib/
**/*.tsbuildinfo
**/node_modules/.cache
key: build-${{ github.head_ref }}-${{ github.sha }}
restore-keys: |
build-${{ github.head_ref }}-
build-refs/heads/main-
# library
- run: npm install
- run: npm run lint
- run: npm test
- run: npm pack --dry-run
36 changes: 25 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,30 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
env:
CI: true

- run: npm install
- run: npm run build
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
env:
CI: true

- name: Cache incremental builds
uses: actions/cache@v2
with:
path: |
.eslintcache
lib/
**/*.tsbuildinfo
**/node_modules/.cache
key: build-${{ github.ref }}-${{ github.sha }}
restore-keys: |
build-${{ github.ref }}-
build-refs/heads/main-
- run: npm install
- run: npm run build
16 changes: 13 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# build artifacts
*.tsbuildinfo
lib/
dist/

# caches
.eslintcache
.cache

# dependencies
node_modules/

*.log
.DS_Store
node_modules
.cache
dist
temp/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
Loading

0 comments on commit 8cba83d

Please sign in to comment.