Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.vscode
.github
dist
coverage
node_modules
*.js
*.log
.gitignore
.gitattributes
.npmrc
.npmignore
*.json
*.yml
*.config.ts
14 changes: 14 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install deps and build (with cache)
uses: pnpm/action-setup@v2.0.1
with:
version: 6.3.0
version: 6.6.2
run_install: true

- name: Lint
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish

on:
release:
types: [published]

jobs:
npmjs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install deps and build (with cache)
uses: pnpm/action-setup@v2.0.1
with:
version: 6.6.2
run_install: true

- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

github:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Install deps and build (with cache)
uses: pnpm/action-setup@v2.0.1
with:
version: 6.6.2
run_install: true

- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com

- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_GITHUB_TOKEN}}
12 changes: 0 additions & 12 deletions .github/workflows/size.yml

This file was deleted.

11 changes: 11 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
collectCoverageFrom: [
'./src/**/*.ts',
],
testPathIgnorePatterns: [
'/node_modules/'
]
};
38 changes: 25 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"version": "0.0.2",
"version": "0.1.0",
"license": "MIT",
"name": "using-try-catch",
"module": "dist/using-try-catch.esm.js",
"module": "dist/esm/index.js",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"description": "Simplify the use of try-catch",
Expand All @@ -21,20 +21,32 @@
"url": "https://github.com/Oda2/using-try-catch"
},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"coverage": "tsdx test --coverage",
"lint": "tsdx lint",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why"
"start": "tsc --watch --outDir dist ./src/**.ts",
"build": "rimraf dist && pnpm run build:umd && pnpm run build:cjs && pnpm run build:esm && pnpm run build:es2015",
"build:cjs": "tsc -p tsconfig.json",
"build:esm": "tsc -p tsconfig-esm.json",
"build:es2015": "tsc -p tsconfig-es.json",
"build:umd": "rollup -c rollup.config.ts",
"test": "jest .",
"coverage": "jest . --coverage",
"lint": "eslint ."
},
"devDependencies": {
"@size-limit/preset-small-lib": "^4.10.2",
"@rollup/plugin-typescript": "^8.2.1",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"size-limit": "^4.10.2",
"tsdx": "^0.14.1",
"jest": "26.6.3",
"jest-circus": "26.6.3",
"prettier": "^2.3.0",
"rimraf": "^3.0.2",
"rollup": "^2.50.5",
"rollup-plugin-cleanup": "^3.2.1",
"ts-jest": "26.5.5",
"tslib": "^2.2.0",
"typescript": "^4.2.4"
},
Expand Down
Loading