-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: minor cleanup * chore: update browserslist in lockfile * build: disabling running headless Chrome locally in CI * docs: add deprecation notice Signed-off-by: Rong Sen Ng (motss) <wes.ngrongsen@gmail.com>
- Loading branch information
Showing
8 changed files
with
294 additions
and
197 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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# User config | ||
foreground-scripts=true | ||
message="chore(release): %s :tada:" | ||
package-lock=true | ||
preid=rc | ||
progress=true | ||
quiet=true | ||
sign-git-tag=true | ||
update-binary=true |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env zx | ||
|
||
const { | ||
CI = 'false', | ||
INIT_CWD = '', | ||
} = process.env; | ||
|
||
if (CI !== 'true') { | ||
const { | ||
name: fullModuleName, | ||
} = JSON.parse(await fs.readFile('./package.json', { encoding: 'utf-8' })); | ||
const [, moduleName = fullModuleName] = fullModuleName.split('/', 2); | ||
|
||
if ( | ||
![ | ||
fullModuleName, | ||
moduleName, | ||
].some(n => INIT_CWD.endsWith(`node_modules/${n}`)) && | ||
INIT_CWD.endsWith(moduleName) | ||
) { | ||
/** | ||
* NOTE: To skip running `simple-git-hooks` in CI environment. | ||
* But `npm x -y -- simple-git-hooks@latest` does not work as expected so splitting it into | ||
* a 2-step process: install without saving as dependency then execute it. | ||
*/ | ||
await $`npm i --no-save simple-git-hooks` | ||
await $`rm -rf .git/hooks` | ||
await $`sh ${__dirname}/simple-git-hooks.sh`; | ||
|
||
await $`npm dedupe`; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
DIRNAME="$(dirname "$0")" | ||
POSTINSTALL_SCRIPT="$DIRNAME/postinstall.mjs" | ||
|
||
# NPM_MAJOR_VERSION=$(npm -v | cut -d '.' -f 1) | ||
NPM_MAJOR_VERSION=$(npm -v | awk -F . '{print $1}') | ||
|
||
if [ "$NPM_MAJOR_VERSION" -gt 6 ]; then | ||
npm x -y -- zx@latest "$POSTINSTALL_SCRIPT" | ||
else | ||
npx -y -- zx@latest "$POSTINSTALL_SCRIPT" | ||
fi |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
DIRNAME=$(dirname "$0") | ||
CONFIG="$DIRNAME/.base.simple-git-hooks.json" | ||
NPM_BIN=$(npm bin) | ||
|
||
# NOTE(motss): This is a workaround for the fact that the `simple-git-hooks` does not support | ||
# custom configuration file. | ||
# | ||
# 1. To temporarily copy the configuration file to `pwd` | ||
cp "$CONFIG" ./.simple-git-hooks.json | ||
|
||
# 2. Run the `simple-git-hooks` | ||
"$NPM_BIN"/simple-git-hooks | ||
|
||
# 3. Remove the configuration file from `pwd` | ||
rm -rf ./.simple-git-hooks.json |
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