Skip to content

Commit

Permalink
fix: build types from source instead of generated files
Browse files Browse the repository at this point in the history
This module copies everything into the `dist` folder then builds types
from there.  `multiformats` builds types from the source, then copies
moves the `types` folder into `dist`.  The latter seems more predictable
and means things like mikeal/ipjs#14 don't
trip it up.
  • Loading branch information
achingbrain committed Jul 16, 2021
1 parent 5828444 commit 1bc4f3e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
coverage/
build/
dist/
types/
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"scripts": {
"build": "npm run build:js && npm run build:types",
"build:js": "ipjs build --tests --main && npm run build:copy",
"build:copy": "mkdir -p dist/examples/ && cp -a tsconfig.json *.js *.ts lib/ test/ dist/ && cp examples/*.* dist/examples/",
"build:types": "npm run build:copy && cd dist && tsc --build",
"build:copy": "mkdir -p dist/examples/ && cp -a tsconfig.json *.js *.ts lib test examples dist/",
"build:types": "tsc --build && mv types dist",
"prepublishOnly": "npm run build",
"publish": "ipjs publish",
"lint": "standard",
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
},
"exclude": [
"node_modules",
"esm",
"cjs",
"examples",
"index.js"
"dist",
"examples"
],
"compileOnSave": false
}

0 comments on commit 1bc4f3e

Please sign in to comment.