Skip to content

Commit

Permalink
Prepublish scripts (#5473)
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Dec 1, 2023
1 parent 468ef68 commit dbd8702
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 84 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ node_modules
build
packages/volto-slate
packages/volto
packages/volto-testing
packages/volto-guillotina
packages/generator-volto/generators/app/templates
1 change: 1 addition & 0 deletions packages/scripts/news/5473.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added a pre-publish plugin for release-it @sneridagh
25 changes: 25 additions & 0 deletions packages/scripts/prepublish.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Plugin } from 'release-it';

class PrePublishReleaseItPlugin extends Plugin {
constructor(...args) {
super(...args);
this.registerPrompts({
prePublishPrompt: {
type: 'confirm',
message: () => 'Are you sure?',
},
});
}

async release() {
await this.step({
enabled: true,
task: () =>
this.exec('pnpm publish --dry-run', { options: { write: false } }),
label: 'Doing task',
prompt: 'prePublishPrompt',
});
}
}

export default PrePublishReleaseItPlugin;
5 changes: 0 additions & 5 deletions packages/volto-testing/.yarnrc.yml

This file was deleted.

10 changes: 9 additions & 1 deletion packages/volto-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@
"release-alpha": "release-it --preRelease=alpha"
},
"release-it": {
"plugins": {
"../scripts/prepublish.js": {}
},
"hooks": {
"after:bump": "pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}",
"after:bump": [
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft && pipx run towncrier build --yes --version ${version}"
],
"after:release": "rm .changelog.draft"
},
"npm": {
"publish": false
},
"git": {
"changelog": "pipx run towncrier build --draft --yes --version 0.0.0",
"requireUpstream": false,
Expand Down
Loading

0 comments on commit dbd8702

Please sign in to comment.