-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.1.13: Implement mfkey32v2 and mfkey64.
- Loading branch information
1 parent
f07b3cb
commit f71ad47
Showing
17 changed files
with
1,867 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ toc: | |
children: | ||
- Pn532 | ||
- Packet | ||
- Crypto1 | ||
- name: Plugin | ||
children: | ||
- Pn532Hf14a | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "pn532.js", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"author": "taichunmin <[email protected]>", | ||
"browser": "dist/pn532.min.js", | ||
"description": "pn532.js is a JavaScript library for PN532 base on Web Bluetooth and Web Serial.", | ||
|
@@ -25,30 +25,31 @@ | |
"web-serial-polyfill": "^1.0.14" | ||
}, | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^24.0.0", | ||
"@rollup/plugin-commonjs": "^24.0.1", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-terser": "^0.4.0", | ||
"cross-env": "^7.0.3", | ||
"dayjs": "^1.11.7", | ||
"documentation": "^14.0.1", | ||
"dotenv": "^16.0.3", | ||
"eslint": "^8.31.0", | ||
"eslint": "^8.32.0", | ||
"eslint-config-standard": "^17.0.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-n": "^15.6.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-n": "^15.6.1", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"eslint-plugin-pug": "^1.2.5", | ||
"fast-glob": "^3.2.12", | ||
"finalhandler": "^1.2.0", | ||
"html-minifier": "^4.0.0", | ||
"jest": "^29.3.1", | ||
"jest": "^29.4.1", | ||
"jstransformer-sass": "^1.0.0", | ||
"livereload": "^0.9.3", | ||
"node-watch": "^0.7.3", | ||
"pug": "^3.0.2", | ||
"rollup": "^3.9.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup": "^3.11.0", | ||
"rollup-plugin-version-injector": "^1.3.3", | ||
"serve-static": "^1.15.0", | ||
"web-streams-polyfill": "^3.2.1" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,76 @@ | ||
import _ from 'lodash' | ||
import { terser } from 'rollup-plugin-terser' | ||
import { fileURLToPath } from 'node:url' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import json from '@rollup/plugin-json' | ||
import resolve from '@rollup/plugin-node-resolve' | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import terser from '@rollup/plugin-terser' | ||
import versionInjector from 'rollup-plugin-version-injector' | ||
|
||
// good rollup example: https://github.com/MattiasBuelens/web-streams-polyfill/blob/master/rollup.config.js | ||
const configBrowser = { | ||
format: 'umd', | ||
globals: { | ||
lodash: '_', | ||
const configs = [ | ||
// src/main.js | ||
{ | ||
input: 'src/main.js', | ||
plugins: [json(), resolve(), commonjs(), versionInjector({ | ||
injectInComments: false, | ||
logLevel: 'error', | ||
})], | ||
external: ['lodash'], | ||
output: _.times(2, isMin => ({ | ||
file: 'dist/pn532.js', | ||
format: 'umd', | ||
name: 'Pn532', | ||
globals: { | ||
lodash: '_', | ||
}, | ||
...(!isMin ? {} : { // for minify | ||
file: 'dist/pn532.min.js', | ||
plugins: [terser()], | ||
}), | ||
})), | ||
}, | ||
|
||
// src/Crypto1.js | ||
{ | ||
input: 'src/Crypto1.js', | ||
plugins: [json(), resolve(), commonjs()], | ||
external: [ | ||
'lodash', | ||
fileURLToPath(new URL('src/main.js', import.meta.url)), | ||
], | ||
output: _.times(2, isMin => ({ | ||
file: 'dist/Crypto1.js', | ||
format: 'umd', | ||
name: 'Crypto1', | ||
globals: { | ||
lodash: '_', | ||
[fileURLToPath(new URL('src/main', import.meta.url))]: 'Pn532', | ||
}, | ||
...(!isMin ? {} : { // for minify | ||
file: 'dist/Crypto1.min.js', | ||
plugins: [terser()], | ||
}), | ||
})), | ||
}, | ||
} | ||
|
||
const configs = _.map([ | ||
{ name: 'Pn532', input: 'main', output: 'pn532' }, | ||
{ name: 'Pn532WebbleAdapter', input: 'plugin/WebbleAdapter', output: 'plugin/WebbleAdapter' }, | ||
{ name: 'Pn532WebserialAdapter', input: 'plugin/WebserialAdapter', output: 'plugin/WebserialAdapter' }, | ||
{ name: 'Pn532LoggerRxTx', input: 'plugin/LoggerRxTx', output: 'plugin/LoggerRxTx' }, | ||
{ name: 'Pn532Hf14a', input: 'plugin/Hf14a', output: 'plugin/Hf14a' }, | ||
], arg => ({ | ||
input: `src/${arg.input}.js`, | ||
plugins: [json(), resolve(), commonjs()], | ||
external: [ | ||
'lodash', | ||
], | ||
output: [ | ||
{ | ||
...configBrowser, | ||
name: arg.name, | ||
file: `dist/${arg.output}.js`, | ||
}, | ||
{ | ||
...configBrowser, | ||
name: arg.name, | ||
file: `dist/${arg.output}.min.js`, | ||
plugins: [terser()], | ||
}, | ||
], | ||
})) | ||
// plugins | ||
..._.map(['Hf14a', 'LoggerRxTx', 'WebbleAdapter', 'WebserialAdapter'], plugin => ({ | ||
input: `src/plugin/${plugin}.js`, | ||
plugins: [json(), resolve(), commonjs()], | ||
external: ['lodash'], | ||
output: _.times(2, isMin => ({ | ||
file: `dist/plugin/${plugin}.js`, | ||
format: 'umd', | ||
name: `Pn532${plugin}`, | ||
globals: { | ||
lodash: '_', | ||
}, | ||
...(!isMin ? {} : { // for minify | ||
file: `dist/plugin/${plugin}.min.js`, | ||
plugins: [terser()], | ||
}), | ||
})), | ||
})), | ||
] | ||
|
||
export default configs |
Oops, something went wrong.