-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1441 from ronyeh/release-it
Remove patch for release-it
- Loading branch information
Showing
4 changed files
with
3,267 additions
and
2,231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,25 +103,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | |
const open = require('opener'); | ||
const concurrently = require('concurrently'); | ||
|
||
// There is a bug in one of our dependencies. See: https://github.com/release-it/release-it/issues/864 | ||
// vexflow | ||
// └─┬ [email protected] github.com/release-it/release-it | ||
// └─┬ [email protected] github.com/IonicaBizau/git-url-parse | ||
// └─┬ [email protected] github.com/IonicaBizau/git-up | ||
// └─┬ [email protected] github.com/IonicaBizau/parse-url | ||
// └── [email protected] github.com/IonicaBizau/parse-path <<< The bug is here!!! | ||
// Our fix has already been merged into the parse-path repo, but we need to wait for 5 projects to be updated on npm | ||
// for the fix to be available to us. In the meantime, we check if the bug is present, and apply a patch if necessary. | ||
let parsePath = require('parse-path'); | ||
if (parsePath('[email protected]:0xfe/vexflow.git').pathname === '/vexflow.git') { | ||
// The .pathname should be '/0xfe/vexflow.git' instead, but the buggy version of parse-path thinks :0xfe is a port number. | ||
// See: https://github.com/IonicaBizau/parse-path/pull/32 | ||
runCommand('npx', 'patch-package'); | ||
delete require.cache[require.resolve('parse-path')]; | ||
parsePath = require('parse-path'); | ||
} | ||
// We require() the release-it package AFTER patching parse-path. | ||
const release = require('release-it'); | ||
// release-it can only be dynamically imported. | ||
const releaseItDynamicImport = import('release-it'); | ||
|
||
// A module entry file `entry/xxxx.ts` will be mapped to a build output file in build/cjs/ or /build/esm/entry/. | ||
// Also see the package.json `exports` field, which is one way for projects to specify which entry file to import. | ||
|
@@ -348,7 +331,13 @@ function webpackConfigs() { | |
const WATCH = true; | ||
|
||
function prodConfig(watch = false) { | ||
return getConfig([VEX, VEX_BRAVURA, VEX_GONVILLE, VEX_LELAND, VEX_PETALUMA, VEX_CORE], PRODUCTION_MODE, BANNER, 'Vex', watch); | ||
return getConfig( | ||
[VEX, VEX_BRAVURA, VEX_GONVILLE, VEX_LELAND, VEX_PETALUMA, VEX_CORE], | ||
PRODUCTION_MODE, | ||
BANNER, | ||
'Vex', | ||
watch | ||
); | ||
} | ||
|
||
// The font modules need to have different webpack configs because they have a different | ||
|
@@ -824,17 +813,19 @@ module.exports = (grunt) => { | |
} | ||
}); | ||
|
||
release(options).then((output) => { | ||
try { | ||
log('Removing build/ folder...'); | ||
execSync('git rm -rf build/', { stdio: 'pipe' }); // { stdio: 'pipe' } hides the output. | ||
execSync(`git commit -m 'Remove build/ after releasing version ${output.version} to npm and GitHub.'`); | ||
runCommand('git', 'push'); | ||
} catch (e) { | ||
// If the build/ folder was not added/checked in, we do nothing. | ||
} | ||
done(); | ||
}); | ||
releaseItDynamicImport | ||
.then((releaseIt) => releaseIt(options)) | ||
.then((output) => { | ||
try { | ||
log('Removing build/ folder...'); | ||
execSync('git rm -rf build/', { stdio: 'pipe' }); // { stdio: 'pipe' } hides the output. | ||
execSync(`git commit -m 'Remove build/ after releasing version ${output.version} to npm and GitHub.'`); | ||
runCommand('git', 'push'); | ||
} catch (e) { | ||
// If the build/ folder was not added/checked in, we do nothing. | ||
} | ||
done(); | ||
}); | ||
}); | ||
|
||
// VexFlow examples on JSFiddle and other websites broke because VexFlow 4 removed these URLs: | ||
|
Oops, something went wrong.