auto-dist-tag
Advanced tools
Comparing version 1.0.0 to 2.0.0
{ | ||
"name": "auto-dist-tag", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Automatically rewrites the publishConfig.tag setting in your package.json file for you", | ||
@@ -20,17 +20,20 @@ "homepage": "https://github.com/Turbo87/auto-dist-tag#readme", | ||
"scripts": { | ||
"release": "release-it", | ||
"test": "jest" | ||
}, | ||
"dependencies": { | ||
"debug": "^3.1.0", | ||
"fs-extra": "^6.0.1", | ||
"meow": "^5.0.0", | ||
"package-json": "^5.0.0", | ||
"pkg-up": "^2.0.0", | ||
"semver": "^5.3.0" | ||
"debug": "^4.3.1", | ||
"fs-extra": "^9.0.0", | ||
"meow": "^8.0.0", | ||
"package-json": "^6.0.0", | ||
"pkg-up": "^3.0.0", | ||
"semver": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"jest": "^22.4.3" | ||
"jest": "26.6.3", | ||
"release-it": "14.2.2", | ||
"release-it-lerna-changelog": "3.1.0" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
"node": ">=10" | ||
}, | ||
@@ -37,0 +40,0 @@ "jest": { |
@@ -8,32 +8,21 @@ 'use strict'; | ||
module.exports = function autoDistTag(cwd, options) { | ||
let pkgPath, pkg, tags, tag; | ||
module.exports = async function autoDistTag(cwd, options) { | ||
let pkgPath = await pkgUp(cwd); | ||
let pkg = await fs.readJson(pkgPath); | ||
let tags = await getDistTags(pkg.name); | ||
let tag = await calcDistTag(pkg.version, tags); | ||
return pkgUp(cwd) | ||
.then(_pkgPath => (pkgPath = _pkgPath)) | ||
.then(() => fs.readJson(pkgPath)) | ||
.then(_pkg => (pkg = _pkg)) | ||
.then(() => getDistTags(pkg.name)) | ||
.then(_tags => (tags = _tags)) | ||
.then(() => calcDistTag(pkg.version, tags)) | ||
.then(_tag => (tag = _tag)) | ||
.then(() => { | ||
if (options && options.write) { | ||
// skip writing to `package.json if an explicit publishConfig.tag is set | ||
if ('publishConfig' in pkg && 'tag' in pkg.publishConfig) { | ||
return; | ||
} | ||
if ( | ||
options && options.write && | ||
// skip writing to `package.json if an explicit publishConfig.tag is set | ||
!('publishConfig' in pkg && 'tag' in pkg.publishConfig) && | ||
// skip writing to `package.json if the calculated tag is "latest" because it's the default anyway | ||
tag !== 'latest' | ||
) { | ||
pkg.publishConfig = pkg.publishConfig || {}; | ||
pkg.publishConfig.tag = tag; | ||
fs.writeJson(pkgPath, pkg, {spaces: 2}); | ||
} | ||
// skip writing to `package.json if the calculated tag is "latest" because it's the default anyway | ||
if (tag === 'latest') { | ||
return; | ||
} | ||
pkg.publishConfig = pkg.publishConfig || {}; | ||
pkg.publishConfig.tag = tag; | ||
return fs.writeJson(pkgPath, pkg, { spaces: 2 }); | ||
} | ||
}) | ||
.then(() => tag); | ||
return tag; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14
233
27480
3
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@sindresorhus/is@0.14.0(transitive)
+ Added@szmarczak/http-timer@1.1.2(transitive)
+ Added@types/minimist@1.2.5(transitive)
+ Added@types/normalize-package-data@2.4.4(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedcacheable-request@6.1.0(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedcamelcase-keys@6.2.2(transitive)
+ Addedclone-response@1.0.3(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddefer-to-connect@1.1.3(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedfind-up@3.0.04.1.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedget-stream@4.1.05.2.0(transitive)
+ Addedgot@9.6.0(transitive)
+ Addedhard-rejection@2.1.0(transitive)
+ Addedhosted-git-info@4.1.0(transitive)
+ Addedhttp-cache-semantics@4.1.1(transitive)
+ Addedindent-string@4.0.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedkeyv@3.1.0(transitive)
+ Addedkind-of@6.0.3(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedlocate-path@3.0.05.0.0(transitive)
+ Addedlowercase-keys@2.0.0(transitive)
+ Addedlru-cache@6.0.0(transitive)
+ Addedmap-obj@4.3.0(transitive)
+ Addedmeow@8.1.2(transitive)
+ Addedmin-indent@1.0.1(transitive)
+ Addedminimist-options@4.1.0(transitive)
+ Addednormalize-package-data@3.0.3(transitive)
+ Addednormalize-url@4.5.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedp-cancelable@1.1.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.04.1.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpackage-json@6.5.0(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-exists@4.0.0(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpkg-up@3.1.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquick-lru@4.0.1(transitive)
+ Addedread-pkg@5.2.0(transitive)
+ Addedread-pkg-up@7.0.1(transitive)
+ Addedredent@3.0.0(transitive)
+ Addedregistry-auth-token@4.2.2(transitive)
+ Addedregistry-url@5.1.0(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedstrip-indent@3.0.0(transitive)
+ Addedto-readable-stream@1.0.0(transitive)
+ Addedtrim-newlines@3.0.1(transitive)
+ Addedtype-fest@0.18.10.6.00.8.1(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@4.0.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
- Removed@sindresorhus/is@0.7.0(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedcacheable-request@2.1.4(transitive)
- Removedcamelcase@4.1.0(transitive)
- Removedcamelcase-keys@4.2.0(transitive)
- Removedclone-response@1.0.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddebug@3.2.7(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedfrom2@2.3.0(transitive)
- Removedfs-extra@6.0.1(transitive)
- Removedget-stream@3.0.0(transitive)
- Removedgot@8.3.2(transitive)
- Removedhas-symbol-support-x@1.4.2(transitive)
- Removedhas-to-string-tag-x@1.4.1(transitive)
- Removedhttp-cache-semantics@3.8.1(transitive)
- Removedindent-string@3.2.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedinto-stream@3.1.0(transitive)
- Removedis-object@1.0.2(transitive)
- Removedis-retry-allowed@1.2.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisurl@1.0.0(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removedkeyv@3.0.0(transitive)
- Removedload-json-file@4.0.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedlowercase-keys@1.0.0(transitive)
- Removedmap-obj@2.0.0(transitive)
- Removedmeow@5.0.0(transitive)
- Removedminimist-options@3.0.2(transitive)
- Removednormalize-url@2.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedp-cancelable@0.4.1(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-is-promise@1.1.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-timeout@2.0.1(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpackage-json@5.0.0(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedpkg-up@2.0.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedquery-string@5.1.1(transitive)
- Removedquick-lru@1.1.0(transitive)
- Removedread-pkg@3.0.0(transitive)
- Removedread-pkg-up@3.0.0(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedredent@2.0.0(transitive)
- Removedregistry-auth-token@3.4.0(transitive)
- Removedregistry-url@3.1.0(transitive)
- Removedsafe-buffer@5.1.25.2.1(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsort-keys@2.0.0(transitive)
- Removedstrict-uri-encode@1.1.0(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedstrip-indent@2.0.0(transitive)
- Removedtimed-out@4.0.1(transitive)
- Removedtrim-newlines@2.0.0(transitive)
- Removeduniversalify@0.1.2(transitive)
- Removedurl-to-options@1.0.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedyargs-parser@10.1.0(transitive)
Updateddebug@^4.3.1
Updatedfs-extra@^9.0.0
Updatedmeow@^8.0.0
Updatedpackage-json@^6.0.0
Updatedpkg-up@^3.0.0
Updatedsemver@^7.0.0