Skip to content

Commit

Permalink
feature: wisdom: build
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed May 24, 2022
1 parent a9ccf6e commit 9dbde17
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .madrun.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default {
'major': () => 'node bin/wisdom.js major',
'wisdom:type': () => 'echo wisdom:type: $wisdom_version',
'wisdom:done': () => 'npm i wisdom -g',
'wisdom:build': () => 'echo "time for a build"',
'lint': () => 'putout .',
'fix:lint': () => run('lint', '--fix'),
};
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ When you need configure `wisdom` you could declare them in `package.json` (**wit
"private": false,
"branch": "master",
"scripts": {
"wisdom": "echo 'do something before publish'",
"wisdom:type": "echo 'do something before publish and add --patch, --minor or --major argument'",
"wisdom": "echo 'do something before starting'",
"wisdom:type": "echo 'do something before starting and add --patch, --minor or --major argument'",
"wisdom:build": "echo 'do something before publish'",
"wisdom:done": "echo 'do something after publish'"
}
}
Expand Down
13 changes: 11 additions & 2 deletions lib/wisdom.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function publish(version, info, emitter) {
});

series([
async function beforePublish() {
async function beforeStart() {
const cmd = jessy('scripts.wisdom', info);

if (!cmd)
Expand All @@ -106,7 +106,7 @@ function publish(version, info, emitter) {
await runWisdom('wisdom', '', version, info, emitter);
},

async function beforePublishType() {
async function beforeStartType() {
const cmd = jessy('scripts.wisdom:type', info);

if (!cmd)
Expand Down Expand Up @@ -165,6 +165,15 @@ function publish(version, info, emitter) {
});
},

async function build() {
const cmd = jessy('scripts.wisdom:build', info);

if (!cmd)
return;

await runWisdom('wisdom:build', '', version, info, emitter);
},

function npmPublish(callback) {
if (info.private)
return callback();
Expand Down

0 comments on commit 9dbde17

Please sign in to comment.