Skip to content

Commit

Permalink
Repair documentation generator and broaden bundle compatibility (#833)
Browse files Browse the repository at this point in the history
* Properly generate jsdocs
  • Loading branch information
Shaptic committed May 23, 2023
1 parent 223cbc2 commit e73cc5e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
24 changes: 20 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
{
"comments": true,
"comments": false,
"presets": [
"@babel/preset-env",
"@babel/typescript"
],
"targets": {
"node": 14,
"browsers": [ "> 2%" ]
},
"env": {
"development": {
"plugins": [
"istanbul"
]
"comments": true, // for debugging
"plugins": [ "istanbul" ] // for code coverage
},
"docs": {
"comments": true // for jsdocs
},
"production": {
// stricter target for final browser bundle
"targets": {
"browsers": [
"> 2%",
"ie 11",
"not op_mini all"
]
}
}
}
}
2 changes: 1 addition & 1 deletion config/webpack.config.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const config = {
// Ignore native modules (sodium-native)
new webpack.IgnorePlugin({ resourceRegExp: /sodium-native/ }),
new NodePolyfillPlugin({
includeAliases: ["http", "https"] // others aren't needed
includeAliases: ['http', 'https'] // others aren't needed
}),
new webpack.ProvidePlugin({
Buffer: ['buffer', 'Buffer']
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@
"scripts": {
"build": "cross-env NODE_ENV=development yarn _build",
"build:prod": "cross-env NODE_ENV=production yarn _build",
"build:node": "babel --extensions '.ts' --out-dir lib/ src/ && tsc -p ./config/tsconfig.json",
"build:node": "yarn _babel && yarn build:ts",
"build:ts": "tsc -p ./config/tsconfig.json",
"build:browser": "webpack --stats-modules-space 999 -c config/webpack.config.browser.js",
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/",
"docs": "jsdoc -c ./config/.jsdoc.json --verbose",
"build:docs": "cross-env NODE_ENV=docs yarn _babel",
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/ jsdoc/",
"docs": "yarn build:docs && jsdoc -c ./config/.jsdoc.json --verbose",
"test": "yarn test:node && yarn test:integration && yarn test:browser",
"test:node": "yarn _nyc mocha --recursive 'test/unit/**/*.js'",
"test:integration": "yarn _nyc mocha --recursive 'test/integration/**/*.js'",
"test:browser": "karma start config/karma.conf.js",
"lint": "eslint -c .eslintrc.js src/",
"fmt": "yarn lint --fix && yarn _prettier",
"preversion": "yarn clean && yarn fmt && yarn lint && yarn build:prod && yarn test",
"fmt": "yarn eslint -c .eslintrc.js src/ --fix && yarn _prettier",
"preversion": "yarn clean && yarn fmt && yarn build:prod && yarn test",
"prepare": "yarn build:prod",
"_build": "yarn build:node && yarn build:browser",
"_babel": "babel --extensions '.ts' --out-dir lib/ src/",
"_nyc": "nyc --nycrc-path config/.nycrc",
"_prettier": "prettier --ignore-path config/.prettierignore --write './**/*.js'"
},
Expand Down

0 comments on commit e73cc5e

Please sign in to comment.