Skip to content

Commit

Permalink
fix: remove prepublishOnly scripts (#1579)
Browse files Browse the repository at this point in the history
  • Loading branch information
maribethb authored Feb 23, 2023
1 parent 2189b53 commit 27da6cd
Show file tree
Hide file tree
Showing 29 changed files with 19 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx lerna publish --conventional-commits --create-release github --yes --ignore-scripts
run: npx lerna publish --conventional-commits --create-release github --yes

update-gh-pages:
name: Update GitHub Pages
Expand Down
6 changes: 6 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ function publish(force) {
`${force ? ' --force-publish=*' : ''}`,
{cwd: releaseDir, stdio: 'inherit'});

console.log('Removing release directory.');
rimraf.sync(releaseDir);

done();
};
}
Expand Down Expand Up @@ -166,6 +169,9 @@ function publishFromPackage(done) {
execSync(
`lerna publish --from-package`,
{cwd: releaseDir, stdio: 'inherit'});

console.log('Removing release directory.');
rimraf.sync(releaseDir);
done();
}

Expand Down
1 change: 0 additions & 1 deletion plugins/dev-create/bin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ exports.createPlugin = function(pluginName, options) {
'dist': 'blockly-scripts build prod',
'lint': 'blockly-scripts lint',
'predeploy': 'blockly-scripts predeploy',
'prepublishOnly': 'npm run clean && npm run dist',
'start': 'blockly-scripts start',
'test': 'blockly-scripts test',
},
Expand Down
1 change: 0 additions & 1 deletion plugins/dev-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"build": "blockly-scripts build",
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start"
},
"main": "dist/index.js",
Expand Down
1 change: 0 additions & 1 deletion plugins/disable-top-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"build": "blockly-scripts build",
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"predeploy": "npm run build && blockly-scripts predeploy"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/field-bitmap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/field-colour-hsv-sliders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/field-date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "npm run build && blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "npm run build && blockly-scripts start",
"test": "npm run build && blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/field-grid-dropdown/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "npm run build && blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/field-slider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/fixed-edges/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start"
},
"main": "./dist/index.js",
Expand Down
1 change: 0 additions & 1 deletion plugins/keyboard-navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/renderer-inline-row-separators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"postinstall": "blockly-scripts postinstall",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/scroll-options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/serialize-disabled-interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/shadow-block-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"postinstall": "blockly-scripts postinstall",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/strict-connection-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"postinstall": "blockly-scripts postinstall",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/suggested-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/theme-dark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/theme-deuteranopia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/theme-highcontrast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/theme-modern/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/theme-tritanopia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/typed-variable-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/workspace-backpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/workspace-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start",
"test": "blockly-scripts test"
},
Expand Down
1 change: 0 additions & 1 deletion plugins/zoom-to-fit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"clean": "blockly-scripts clean",
"lint": "blockly-scripts lint",
"predeploy": "blockly-scripts predeploy",
"prepublishOnly": "npm run clean && npm run build",
"start": "blockly-scripts start"
},
"main": "./dist/index.js",
Expand Down
24 changes: 12 additions & 12 deletions scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ try again.

### `npm run publish:manual`
This script assumes that you have already run `npm run publish:prepare`. It will
publish all of the changed plugins since the last release, using the `dist` directory. It
runs the lerna command that uses conventional commits to determine a new version number
for each plugin, and publishes the new versions to npm and to a github release and tag.
Since all plugins should have the `prepublishOnly` lifecycle script configured, plugins
will build themselves before the publish step, so that the correct files are uploaded.

If any plugin fails to build, hopefully that should have been caught by the
`publish:prepare` script. If it fails during this step, then likely some plugins have
already been published to npm, and some will not have due to the error. That may also
occur if there is some other with npm while running this command. You can recover from
this state by fixing the error, and then running `npm run publish:prepare` again followed
by `npm run publish:unpublishedOnly` or `npm run publish:force`.
publish all of the changed plugins since the last release, using the `dist`
directory. It runs the lerna command that uses conventional commits to determine
a new version number for each plugin, and publishes the new versions to npm and
to a github release and tag. Plugins do not automatically build themselves
before publishing. You must have run `npm run publish:prepare` script ahead of
time for this reason.

If there is some error with npm while running this command, you may end up in a
state where some plugins have been published to npm and not others, after lerna
has already tagged the new releases. You can recover from this state by fixing
the error, and then running `npm run publish:prepare` again followed by
`npm run publish:unpublishedOnly` or `npm run publish:force`.

### `npm run publish:unpublishedOnly`
This script assumes that you have already run `npm run publish:prepare`. It uses the `dist`
Expand Down

0 comments on commit 27da6cd

Please sign in to comment.