Skip to content

Commit

Permalink
build: use @bluelovers/tsdx
Browse files Browse the repository at this point in the history
  • Loading branch information
bluelovers committed Oct 22, 2022
1 parent 979520c commit adb5999
Show file tree
Hide file tree
Showing 5 changed files with 295 additions and 52 deletions.
229 changes: 222 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,224 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
build/
umd/
coverage/
.nyc_output/
.vscode/
.rts2*
dist/
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

/.*/
.idea
node_modules
~ci.list.txt
~ci.log.txt
~ci.errors.txt
*.stackdump
*.bak
*.old
package-lock.json
test/**/*.js
test/**/*.d.ts
test/*.js
test/*.d.ts
test/temp*
test/**/*.map
tests/**/*.js
tests/**/*.d.ts
tests/*.js
tests/*.d.ts
tests/temp*
tests/**/*.map
bin/*.d.ts
bin/**/*.d.ts
/packages/*/bin/*.d.ts
/packages/*/test/**/*.js
/packages/*/test/**/*.d.ts
/packages/*/test/*.js
/packages/*/test/*.d.ts
/packages/*/test/temp*
/packages/*/tests/**/*.js
/packages/*/tests/**/*.d.ts
/packages/*/tests/*.js
/packages/*/tests/*.d.ts
/packages/*/tests/temp*

test/**/*.mjs
test/**/*.d.mts
test/*.mjs
test/*.d.mts
test/temp*
test/**/*.map
tests/**/*.mjs
tests/**/*.d.mts
tests/*.mjs
tests/*.d.mts
tests/temp*
tests/**/*.map
bin/*.d.mts
bin/**/*.d.mts
/packages/*/bin/*.d.mts
/packages/*/test/**/*.mjs
/packages/*/test/**/*.d.mts
/packages/*/test/*.mjs
/packages/*/test/*.d.mts
/packages/*/test/temp*
/packages/*/tests/**/*.mjs
/packages/*/tests/**/*.d.mts
/packages/*/tests/*.mjs
/packages/*/tests/*.d.mts
/packages/*/tests/temp*

test/**/*.cjs
test/**/*.d.cts
test/*.cjs
test/*.d.cts
test/temp*
test/**/*.map
tests/**/*.cjs
tests/**/*.d.cts
tests/*.cjs
tests/*.d.cts
tests/temp*
tests/**/*.map
bin/*.d.cts
bin/**/*.d.cts
/packages/*/bin/*.d.cts
/packages/*/test/**/*.cjs
/packages/*/test/**/*.d.cts
/packages/*/test/*.cjs
/packages/*/test/*.d.cts
/packages/*/test/temp*
/packages/*/tests/**/*.cjs
/packages/*/tests/**/*.d.cts
/packages/*/tests/*.cjs
/packages/*/tests/*.d.cts
/packages/*/tests/temp*

/src/**/*.d.ts
/src/**/*.js
/src/**/*.d.cts
/src/**/*.d.mts
/src/**/*.cjs
/src/**/*.mjs

**/node_modules
*.tgz
/tsconfig.json.tpl
/.eslintrc.json.tpl
!tsconfig.json
!.eslintrc.json
yarn-error.log
*.log
.git
yarn.lock
.env.local
.env.*.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.vue.js
*.vue.d.ts
*.vue.js.map
vue.config.d.ts
vue.config.js.map
.nyc_output
coverage
/*.tpl
!.forestry
!.vuepress
!.github
!.gitee
!.gitlab
.git

*.tsbuildinfo
tsconfig.esm.json.tpl

.browserslistrc
.nvmrc

/.eslintignore
/package.d.ts
.nycrc
.mocharc.yml
#jest.config.js
node_modules/.cache
.yarn-integrity
jest.config.d.ts
jest.config.js.map
/report.*.json
*.js.map
*.cjs.map
*.mjs.map
*.ts.map
*.cts.map
*.mts.map
/now.json
.nyc_output
.coverage-cache
.reify-cache
*.spec.d.ts
*.spec.js
.nowignore
*/**/.github
!/.github
!npm-shrinkwrap.json
*.stat
.vercel
/test/*.tpl
/*.tpl
/report.json

.opt-in
.opt-out
/gradle
.gradle
/out
/build

/_*/
_snowpack
web_modules
tsc-multi.json.tpl

dist/*.umd.*.*s

/__root_ws.d.ts
/__root_ws.js

!/.yarnrc.yml
.turbo
/dist/
3 changes: 3 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"check-leaks": true,
"timeout": 60000,
"throw-deprecation": true,
"spec": [
"test/index.js"
],
"enable-source-maps": true
}
98 changes: 62 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,83 @@
"name": "retry-axios",
"version": "0.0.0",
"description": "Retry HTTP requests with Axios.",
"exports": "./build/src/index.js",
"type": "module",
"types": "./build/src/index.d.ts",
"engines": {
"node": ">=14"
"keywords": [
"axios",
"retry"
],
"homepage": "https://github.com/JustinBeckwith/retry-axios#readme",
"bugs": {
"url": "https://github.com/JustinBeckwith/retry-axios/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/JustinBeckwith/retry-axios.git"
"url": "git+https://github.com/JustinBeckwith/retry-axios.git"
},
"license": "Apache-2.0",
"author": "Justin Beckwith",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.esm.mjs",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json",
"./src/*": "./src/*"
},
"main": "dist/index.cjs",
"unpkg": "dist/index.umd.production.min.cjs",
"module": "dist/index.esm.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"directories": {
"test": "test"
},
"files": [
"dist"
],
"scripts": {
"build": "yarn run build:tsdx && yarn run build:dts:tsc",
"build:dts:bundle": "npx @bluelovers/dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle",
"build:dts:copy": "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts",
"build:dts:tsc": "yarn run build:dts:copy && yarn run build:dts:tsc:emit && yarn run build:dts:copy",
"build:dts:tsc:emit": "tsc --declaration --noEmit false",
"build:tsdx": "npx @bluelovers/tsdx build --target node",
"lint": "gts check",
"clean": "gts clean",
"fix": "gts fix",
"compile": "tsc -p .",
"test": "c8 mocha build/test",
"compile": "yarn run build",
"test": "c8 mocha",
"pretest": "npm run compile",
"license-check": "jsgl --local ."
},
"keywords": [
"axios",
"retry"
],
"author": {
"name": "Justin Beckwith"
},
"license": "Apache-2.0",
"peerDependencies": {
"axios": "*"
},
"devDependencies": {
"@types/mocha": "^10.0.0",
"@types/sinon": "^10.0.11",
"@types/node": "^17.0.31",
"axios": "^0.27.0",
"c8": "^7.11.2",
"gts": "^3.1.0",
"js-green-licenses": "^3.0.1",
"mocha": "^10.0.0",
"nock": "^13.2.4",
"semantic-release": "^19.0.2",
"sinon": "^14.0.0",
"typescript": "~4.8.0"
},
"files": [
"build/src"
],
"c8": {
"exclude": [
"build/test",
"dist"
]
},
"devDependencies": {
"@bluelovers/tsconfig": "*",
"@types/mocha": "^10.0.0",
"@types/node": "^18.11.3",
"@types/sinon": "^10.0.13",
"axios": "^0.27.2",
"c8": "^7.12.0",
"gts": "^3.1.1",
"js-green-licenses": "^3.0.1",
"mocha": "^10.1.0",
"nock": "^13.2.9",
"semantic-release": "^19.0.5",
"sinon": "^14.0.1",
"typescript": "next"
},
"peerDependencies": {
"axios": "*"
},
"packageManager": "yarn@1.22.19",
"engines": {
"node": ">=14"
}
}
8 changes: 5 additions & 3 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import assert from 'assert';
import axios, {AxiosError, AxiosRequestConfig} from 'axios';
import nock from 'nock';
import sinon from 'sinon';
import {describe, it, afterEach} from 'mocha';
import * as rax from '../src/index.js';
import {RaxConfig} from '../src/index.js';
//import {describe, it, afterEach} from 'mocha';
// @ts-ignore
import * as rax from 'retry-axios';
// @ts-ignore
import {RaxConfig} from 'retry-axios';

const url = 'http://test.local';

Expand Down
9 changes: 3 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"extends": "./node_modules/gts/tsconfig-google.json",
"extends": "@bluelovers/tsconfig/tsdx/index.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
"moduleResolution": "node",
"module": "ES2022",
"esModuleInterop": true
"importHelpers": false,
"noImplicitAny": false
},
"include": [
"src/*.ts",
Expand Down

0 comments on commit adb5999

Please sign in to comment.