Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9383a98

Browse files
committed
feat: removegetLastRelease hook
BREAKING CHANGE: The `getLastRelease` hook is removedThe plugin is compatible only with `semantic-release@13.0.0` and above.
1 parent0f774fc commit9383a98

File tree

12 files changed

+10
-724
lines changed

12 files changed

+10
-724
lines changed

‎README.md‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ Set of [semantic-release](https://github.com/semantic-release/semantic-release)
1010

1111
Verify the presence of the`NPM_TOKEN` environment variable, create or update the`.npmrc` file with the token and verify the token is valid.
1212

13-
##getLastRelease
14-
15-
Determine the last release of the package on the`npm` registry.
16-
1713
##publish
1814

1915
Update the`package.json` version,[create](https://docs.npmjs.com/cli/pack) the`npm` package tarball and[publish](https://docs.npmjs.com/cli/publish) to the`npm` registry.
@@ -73,7 +69,6 @@ Each individual plugin can be disabled, replaced or used with other plugins in t
7369
{
7470
"release": {
7571
"verifyConditions": ["@semantic-release/npm","verify-other-condition"],
76-
"getLastRelease":"custom-get-last-release",
7772
"publish": ["@semantic-release/npm","custom-publish"]
7873
}
7974
}
@@ -85,7 +80,6 @@ The `npmPublish` and `tarballDir` option can be used to skip the publishing to t
8580
{
8681
"release": {
8782
"verifyConditions": ["@semantic-release/npm","@semantic-release/git","@semantic-release/github"],
88-
"getLastRelease":"@semantic-release/git",
8983
"publish": [
9084
{
9185
"path":"@semantic-release/npm",
@@ -107,7 +101,6 @@ When publishing from a sub-directory with the `pkgRoot` option, the `package.jso
107101
{
108102
"release": {
109103
"verifyConditions": ["@semantic-release/npm","@semantic-release/git"],
110-
"getLastRelease":"@semantic-release/npm",
111104
"publish": [
112105
{
113106
"path":"@semantic-release/npm",

‎index.js‎

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ const getPkg = require('./lib/get-pkg');
44
constverifyNpmConfig=require('./lib/verify-config');
55
constverifyNpmAuth=require('./lib/verify-auth');
66
constpublishNpm=require('./lib/publish');
7-
constgetLastReleaseNpm=require('./lib/get-last-release');
87

98
letverified;
109

11-
asyncfunctionverifyConditions(pluginConfig,{options:{publish, getLastRelease}, logger}){
10+
asyncfunctionverifyConditions(pluginConfig,{options:{publish}, logger}){
1211
// If the npm publish plugin is used and has `npmPublish`, `tarballDir` or `pkgRoot` configured, validate them now in order to prevent any release if the configuration is wrong
1312
if(publish){
1413
constpublishPlugin=castArray(publish).find(config=>config.path&&config.path==='@semantic-release/npm');
@@ -26,35 +25,14 @@ async function verifyConditions(pluginConfig, {options: {publish, getLastRelease
2625
constpkg=awaitgetPkg(pluginConfig.pkgRoot);
2726
awaitverifyNpmConfig(pluginConfig,pkg,logger);
2827

29-
// Verify the npm authentication only if `npmPublish` is not false and if the npm plugin is used as `getLastRelease`
30-
if(
31-
pluginConfig.npmPublish!==false||
32-
(getLastRelease&&(getLastRelease==='@semantic-release/npm'||getLastRelease.path==='@semantic-release/npm'))
33-
){
28+
// Verify the npm authentication only if `npmPublish` is not false
29+
if(pluginConfig.npmPublish!==false){
3430
setLegacyToken();
3531
awaitverifyNpmAuth(pluginConfig,pkg,logger);
3632
}
3733
verified=true;
3834
}
3935

40-
asyncfunctiongetLastRelease(pluginConfig,{options:{publish, branch}, logger}){
41-
setLegacyToken();
42-
// Reload package.json in case a previous external step updated it
43-
constpkg=awaitgetPkg(pluginConfig.pkgRoot);
44-
if(!verified){
45-
if(publish){
46-
constpublishPlugin=castArray(publish).find(config=>config.path&&config.path==='@semantic-release/npm');
47-
if(publishPlugin&&publishPlugin.pkgRoot){
48-
pluginConfig.pkgRoot=publishPlugin.pkgRoot;
49-
}
50-
}
51-
awaitverifyNpmConfig(pluginConfig,pkg,logger);
52-
awaitverifyNpmAuth(pluginConfig,pkg,logger);
53-
verified=true;
54-
}
55-
returngetLastReleaseNpm(pkg,branch,logger);
56-
}
57-
5836
asyncfunctionpublish(pluginConfig,{nextRelease:{version}, logger}){
5937
setLegacyToken();
6038
// Reload package.json in case a previous external step updated it
@@ -69,4 +47,4 @@ async function publish(pluginConfig, {nextRelease: {version}, logger}) {
6947
awaitpublishNpm(pluginConfig,pkg,version,logger);
7048
}
7149

72-
module.exports={verifyConditions,getLastRelease,publish};
50+
module.exports={verifyConditions, publish};

‎lib/get-client-config.js‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎lib/get-last-release.js‎

Lines changed: 0 additions & 57 deletions
This file was deleted.

‎lib/get-version-head.js‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎lib/git.js‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@
1717
],
1818
"dependencies": {
1919
"@semantic-release/error":"^2.1.0",
20-
"debug":"^3.1.0",
2120
"execa":"^0.9.0",
2221
"fs-extra":"^5.0.0",
2322
"lodash":"^4.17.4",
2423
"nerf-dart":"^1.0.0",
2524
"normalize-url":"^2.0.1",
26-
"npm-conf":"^1.1.3",
27-
"npm-registry-client":"^8.5.0",
2825
"read-pkg":"^3.0.0",
2926
"registry-auth-token":"^3.3.1"
3027
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp