Skip to content

Commit

Permalink
feat: move to esm
Browse files Browse the repository at this point in the history
BREAKING CHANGE: require Node.js ^12.20.0 || ^14.13.1 || >=16.0.0
  • Loading branch information
antongolub committed Sep 8, 2021
1 parent 2996fb5 commit 16a3e65
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 82 deletions.
18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,38 @@
"name": "yarn-audit-fix",
"version": "6.4.4",
"private": false,
"type": "module",
"description": "Apply `npm audit fix` logic to `yarn.lock`",
"bin": {
"yarn-audit-fix": "target/es5/cli.js"
"yarn-audit-fix": "target/es6/cli.js"
},
"source": "src/main/ts/index.ts",
"main": "target/es5/index.js",
"main": "target/es6/index.js",
"types": "typings/index.d.ts",
"typescript": {
"definition": "typings/index.d.ts"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"scripts": {
"clean": "rimraf target typings flow-typed buildcache docs coverage",
"lint": "eslint 'src/**/*.+(js|ts)'",
"lint:fix": "yarn lint --fix",
"format": "prettier --write \"src/**/*.ts\"",
"test:unit": "yarn jest --config=jest.config.json --runInBand",
"test:integration": "node ./target/es5/cli.js --package-lock-only --audit-level=moderate --ignore-engines",
"test:integration": "node ./target/es6/cli.js --package-lock-only --audit-level=moderate --ignore-engines",
"test:integration-build": "yarn build:es5 && yarn test:integration",
"test:depcheck": "npm_config_yes=true npx depcheck --ignores=tslib,@types/jest,@types/node",
"test:report": "yarn test && yarn push:report",
"test": "npm-run-all -p -l lint test:unit test:integration test:depcheck",
"build": "yarn clean && npm-run-all -p -l build:es5 build:es6 build:ts build:libdef build:buildstamp docs",
"build:es5": "mkdirp target/es5 && tsc -p tsconfig.es5.json",
"build": "yarn clean && npm-run-all -p -l build:esnext build:es6 build:ts build:libdef build:buildstamp docs && yarn build:esmfix",
"build:esnext": "mkdirp target/esnext && tsc -p tsconfig.esnext.json",
"build:es6": "mkdirp target/es6 && tsc -p tsconfig.es6.json",
"build:ts": "cpy src/main/ts/ target/ts/",
"build:buildstamp": "npm_config_yes=true npx buildstamp --git --out.path=buildstamp.json",
"build:libdef": "libdefkit --tsconfig=tsconfig.es5.json --tsconfig=tsconfig.es6.json",
"build:libdef": "libdefkit --tsconfig=tsconfig.esnext.json --tsconfig=tsconfig.es6.json",
"build:esmfix": "tsc-esm-fix --target=target/es6 --target=target/esnext",
"push:report": "yarn coveralls:push",
"docs": "typedoc",
"uglify": "for f in $(find target -name '*.js'); do short=${f%.js}; terser -c -m -o $short.js -- $f; done",
Expand Down Expand Up @@ -95,6 +100,7 @@
"prettier": "^2.3.2",
"terser": "^5.7.1",
"ts-jest": "^27.0.4",
"tsc-esm-fix": "^2.7.1",
"typedoc": "^0.21.5",
"typescript": "4.4.2"
},
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.es5.json → tsconfig.esnext.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "es5",
"module": "CommonJS",
"outDir": "target/es5"
"target": "esnext",
"module": "esnext",
"outDir": "target/esnext"
},
"include": ["src/main/**/*.ts"]
}
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"hideGenerator": true,
"readme": "README.md",
"theme": "minimal",
"tsconfig": "./tsconfig.es5.json"
"tsconfig": "./tsconfig.es6.json"
}
183 changes: 111 additions & 72 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,11 @@ array-union@^2.1.0:
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==

array-union@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-3.0.1.tgz#da52630d327f8b88cfbfb57728e2af5cd9b6b975"
integrity sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw==

array-uniq@^1.0.1:
version "1.0.3"
resolved "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6"
Expand Down Expand Up @@ -2996,6 +3001,18 @@ globby@^11.0.4:
merge2 "^1.3.0"
slash "^3.0.0"

globby@^12.0.2:
version "12.0.2"
resolved "https://registry.yarnpkg.com/globby/-/globby-12.0.2.tgz#53788b2adf235602ed4cabfea5c70a1139e1ab11"
integrity sha512-lAsmb/5Lww4r7MM9nCCliDZVIKbZTavrsunAsHLr9oHthrZP1qi7/gAnHOsUs9bLvEt2vKVJhHmxuL7QbDuPdQ==
dependencies:
array-union "^3.0.1"
dir-glob "^3.0.1"
fast-glob "^3.2.7"
ignore "^5.1.8"
merge2 "^1.4.1"
slash "^4.0.0"

globby@^9.2.0:
version "9.2.0"
resolved "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz"
Expand Down Expand Up @@ -3182,7 +3199,7 @@ ignore@^4.0.3, ignore@^4.0.6:
resolved "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==

ignore@^5.1.1, ignore@^5.1.4:
ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8:
version "5.1.8"
resolved "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz"
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
Expand Down Expand Up @@ -4053,7 +4070,7 @@ json-stringify-safe@~5.0.1:
resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=

[email protected], json5@^2.1.2:
[email protected], json5@^2.1.2, json5@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz"
integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==
Expand Down Expand Up @@ -4450,7 +4467,7 @@ memorystream@^0.3.1:
resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2"
integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI=

meow@^10.1.0:
meow@^10.1.0, meow@^10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/meow/-/meow-10.1.1.tgz#87fa665f18e727024116d456e725f69033ca6d8f"
integrity sha512-uzOAEBTGujHAD6bVzIQQk5kDTgatxmpVmr1pj9QhwsHLEG2AiB+9F08/wmjrZIk4h5pWxERd7+jqGZywYx3ZFw==
Expand Down Expand Up @@ -4490,7 +4507,7 @@ merge-stream@^2.0.0:
resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz"
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==

merge2@^1.3.0:
merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
Expand Down Expand Up @@ -4866,74 +4883,74 @@ [email protected]:
resolved "https://registry.yarnpkg.com/npm/-/npm-7.22.0.tgz#11db1860c68c569eb2e3f4d4e97934b005b585bc"
integrity sha512-HJnjTCrGGnacPMCSnrxuHGf2H4VdrY7hwTAK1RwByg0K96KIuTR4QNioFW+bnc/pW0uwpk9lLsDf4BeEQhTv2Q==
dependencies:
"@npmcli/arborist" "*"
"@npmcli/ci-detect" "*"
"@npmcli/config" "*"
"@npmcli/map-workspaces" "*"
"@npmcli/package-json" "*"
"@npmcli/run-script" "*"
abbrev "*"
ansicolors "*"
ansistyles "*"
archy "*"
cacache "*"
chalk "*"
chownr "*"
cli-columns "*"
cli-table3 "*"
columnify "*"
fastest-levenshtein "*"
glob "*"
graceful-fs "*"
hosted-git-info "*"
ini "*"
init-package-json "*"
is-cidr "*"
json-parse-even-better-errors "*"
libnpmaccess "*"
libnpmdiff "*"
libnpmexec "*"
libnpmfund "*"
libnpmhook "*"
libnpmorg "*"
libnpmpack "*"
libnpmpublish "*"
libnpmsearch "*"
libnpmteam "*"
libnpmversion "*"
make-fetch-happen "*"
minipass "*"
minipass-pipeline "*"
mkdirp "*"
mkdirp-infer-owner "*"
ms "*"
node-gyp "*"
nopt "*"
npm-audit-report "*"
npm-package-arg "*"
npm-pick-manifest "*"
npm-profile "*"
npm-registry-fetch "*"
npm-user-validate "*"
npmlog "*"
opener "*"
pacote "*"
parse-conflict-json "*"
qrcode-terminal "*"
read "*"
read-package-json "*"
read-package-json-fast "*"
readdir-scoped-modules "*"
rimraf "*"
semver "*"
ssri "*"
tar "*"
text-table "*"
tiny-relative-date "*"
treeverse "*"
validate-npm-package-name "*"
which "*"
write-file-atomic "*"
"@npmcli/arborist" "^2.8.2"
"@npmcli/ci-detect" "^1.2.0"
"@npmcli/config" "^2.2.0"
"@npmcli/map-workspaces" "^1.0.4"
"@npmcli/package-json" "^1.0.1"
"@npmcli/run-script" "^1.8.6"
abbrev "~1.1.1"
ansicolors "~0.3.2"
ansistyles "~0.1.3"
archy "~1.0.0"
cacache "^15.3.0"
chalk "^4.1.2"
chownr "^2.0.0"
cli-columns "^3.1.2"
cli-table3 "^0.6.0"
columnify "~1.5.4"
fastest-levenshtein "^1.0.12"
glob "^7.1.7"
graceful-fs "^4.2.8"
hosted-git-info "^4.0.2"
ini "^2.0.0"
init-package-json "^2.0.4"
is-cidr "^4.0.2"
json-parse-even-better-errors "^2.3.1"
libnpmaccess "^4.0.2"
libnpmdiff "^2.0.4"
libnpmexec "^2.0.1"
libnpmfund "^1.1.0"
libnpmhook "^6.0.2"
libnpmorg "^2.0.2"
libnpmpack "^2.0.1"
libnpmpublish "^4.0.1"
libnpmsearch "^3.1.1"
libnpmteam "^2.0.3"
libnpmversion "^1.2.1"
make-fetch-happen "^9.1.0"
minipass "^3.1.3"
minipass-pipeline "^1.2.4"
mkdirp "^1.0.4"
mkdirp-infer-owner "^2.0.0"
ms "^2.1.2"
node-gyp "^7.1.2"
nopt "^5.0.0"
npm-audit-report "^2.1.5"
npm-package-arg "^8.1.5"
npm-pick-manifest "^6.1.1"
npm-profile "^5.0.3"
npm-registry-fetch "^11.0.0"
npm-user-validate "^1.0.1"
npmlog "^5.0.0"
opener "^1.5.2"
pacote "^11.3.5"
parse-conflict-json "^1.1.1"
qrcode-terminal "^0.12.0"
read "~1.0.7"
read-package-json "^4.0.1"
read-package-json-fast "^2.0.3"
readdir-scoped-modules "^1.1.0"
rimraf "^3.0.2"
semver "^7.3.5"
ssri "^8.0.1"
tar "^6.1.11"
text-table "~0.2.0"
tiny-relative-date "^1.3.0"
treeverse "^1.0.4"
validate-npm-package-name "~3.0.0"
which "^2.0.2"
write-file-atomic "^3.0.3"

npmlog@*:
version "5.0.0"
Expand Down Expand Up @@ -5911,6 +5928,11 @@ slash@^3.0.0:
resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==

slash@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==

slice-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz"
Expand Down Expand Up @@ -6365,6 +6387,18 @@ ts-jest@^27.0.4:
semver "7.x"
yargs-parser "20.x"

tsc-esm-fix@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/tsc-esm-fix/-/tsc-esm-fix-2.7.1.tgz#c71af8047d0fa8906b368627d1896fb3971353a2"
integrity sha512-3NZH0QuYJIQMbHm99ktIEkZgi2Yk5C7+7Y/CpSvKT30mc25Jt0jLNphSXk0z+OK+CL4TqUDegX0icPhVPACQng==
dependencies:
"@types/fs-extra" "^9.0.12"
fs-extra "^10.0.0"
globby "^12.0.2"
json5 "^2.2.0"
meow "^10.1.1"
tslib "^2.3.1"

tsconfig-paths@^3.9.0:
version "3.9.0"
resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz"
Expand All @@ -6385,6 +6419,11 @@ tslib@^2.3.0:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==

tslib@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==

tsutils@^3.21.0:
version "3.21.0"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"
Expand Down

0 comments on commit 16a3e65

Please sign in to comment.