Skip to content

Commit

Permalink
chore: build prepublishing
Browse files Browse the repository at this point in the history
  • Loading branch information
yeojz committed Dec 29, 2019
1 parent 08051bf commit 453d984
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 2,654 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.json
Expand Up @@ -16,5 +16,13 @@
"prettier/@typescript-eslint",
"eslint:recommended",
"plugin:prettier/recommended"
],
"ignorePatterns": [
"builds",
"externals",
"extras",
"node_modules",
"package-lock.json",
"public"
]
}
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: setup, build
run: |
npm run setup
npm run build
NODE_ENV=production npm run build
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
- name: tests for browser bundles
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -73,5 +73,5 @@ yarn-error.log
.rpt2_cache/
audit.txt
builds
build
externals
lib.test.*
6 changes: 4 additions & 2 deletions .prettierignore
@@ -1,5 +1,7 @@
.cache
builds
externals
extras
node_modules
package-lock.json
public
builds
build
8 changes: 2 additions & 6 deletions README.md
Expand Up @@ -85,11 +85,7 @@ and includes additional methods to allow you to work with Google Authenticator.
### In Node.js

```bash
npm install otplib

# Note:
# Starting from v12.x, this is actually a bundle containing a
# few @otplib/* presets and dependencies to help you get started quickly.
npm install otplib --save
```

```js
Expand Down Expand Up @@ -324,7 +320,7 @@ The following defaults have been used:
- **encoder**: `base32-encode`
- **decoder**: `base32-decode`

For more details, you can take a look at `packages/otplib-browser/src/index.ts`.
For more details, you can take a look at `packages/otplib-preset-browser/src/index.ts`.

#### Browser bundle size

Expand Down
2 changes: 1 addition & 1 deletion configs/helpers.js
Expand Up @@ -33,7 +33,7 @@ function banner(pkg) {
**/`;
}

exports.RWD = path.join(__dirname, '..');
exports.ROOT_DIR = path.join(__dirname, '..');
exports.EXTENSIONS = ['.js', '.ts'];

exports.banner = banner;
Expand Down
1 change: 1 addition & 0 deletions configs/npmrc
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
3 changes: 1 addition & 2 deletions configs/typedoc.json
@@ -1,12 +1,11 @@
{
"exclude": [
"build",
"builds",
"configs",
"packages/**/*.js",
"packages/**/*.test.js",
"packages/**/*.test.ts",
"scripts",
"test",
"tests",
"website"
],
Expand Down
2 changes: 1 addition & 1 deletion configs/webpack.config.js
Expand Up @@ -46,7 +46,7 @@ function webpackConfig(file) {
},
resolve: {
extensions: helpers.EXTENSIONS,
modules: [path.join(helpers.RWD, 'node_modules'), 'node_modules']
modules: [path.join(helpers.ROOT_DIR, 'node_modules'), 'node_modules']
},
plugins: [
new webpack.DefinePlugin({
Expand Down
11 changes: 7 additions & 4 deletions package.json
Expand Up @@ -3,7 +3,7 @@
"version": "12.0.0-1",
"description": "HMAC-based (HOTP) and Time-based (TOTP) One-Time Password library",
"private": true,
"repository": "yeojz/otplib",
"repository": "https://github.com/yeojz/otplib",
"author": "Gerald Yeo <contact@fusedthought.com>",
"license": "MIT",
"bugs": "https://github.com/yeojz/otplib/issues",
Expand Down Expand Up @@ -69,17 +69,20 @@
"!**/node_modules/**",
"!packages/otplib-preset-browser/**",
"!**/builds/*",
"!**/external/*",
"!**/externals/*",
"!**/extras/*",
"!**/tests/*"
],
"coverageDirectory": "./coverage/",
"modulePathIgnorePatterns": [
"<rootDir>/.*/__mocks__"
"<rootDir>/.*/__mocks__",
"<rootDir>/packages/.*/builds"
],
"resetMocks": true,
"setupFiles": [],
"testPathIgnorePatterns": [
"/node_modules/"
"/node_modules/",
"/builds/"
],
"testURL": "http://localhost",
"moduleNameMapper": {
Expand Down
2 changes: 1 addition & 1 deletion packages/README.md
@@ -1,4 +1,4 @@
# Packages
# otplib packages

This library adopts a monorepo design, and is responsible for `@otplib/*` packages.
The only other package that is not under this scope is the quick-start package `otplib`.
Expand Down

0 comments on commit 453d984

Please sign in to comment.