forked from facebook/create-react-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up changes to npm and yarn registry (facebook#3756)
- Loading branch information
1 parent
4c0bf03
commit b02fe66
Showing
3 changed files
with
24 additions
and
9 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 |
---|---|---|
|
@@ -15,11 +15,16 @@ cd "$(dirname "$0")" | |
# CLI and app temporary locations | ||
# http://unix.stackexchange.com/a/84980 | ||
temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` | ||
custom_registry_url=http://localhost:4873 | ||
original_npm_registry_url=`npm get registry` | ||
original_yarn_registry_url=`yarn config get registry` | ||
|
||
function cleanup { | ||
echo 'Cleaning up.' | ||
cd "$root_path" | ||
rm -rf "$temp_app_path" | ||
npm set registry "$original_npm_registry_url" | ||
yarn config set registry "$original_yarn_registry_url" | ||
} | ||
|
||
# Error messages are redirected to stderr | ||
|
@@ -87,11 +92,11 @@ nohup npx [email protected] &>$tmp_registry_log & | |
grep -q 'http address' <(tail -f $tmp_registry_log) | ||
|
||
# Set registry to local registry | ||
npm set registry http://localhost:4873 | ||
yarn config set registry http://localhost:4873 | ||
npm set registry "$custom_registry_url" | ||
yarn config set registry "$custom_registry_url" | ||
|
||
# Login so we can publish packages | ||
npx [email protected] -u user -p password -e [email protected] -r http://localhost:4873 --quotes | ||
npx [email protected] -u user -p password -e [email protected] -r "$custom_registry_url" --quotes | ||
|
||
# Publish the monorepo | ||
git clean -f | ||
|
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 |
---|---|---|
|
@@ -16,13 +16,18 @@ cd "$(dirname "$0")" | |
# http://unix.stackexchange.com/a/84980 | ||
temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` | ||
temp_module_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_module_path'` | ||
custom_registry_url=http://localhost:4873 | ||
original_npm_registry_url=`npm get registry` | ||
original_yarn_registry_url=`yarn config get registry` | ||
|
||
function cleanup { | ||
echo 'Cleaning up.' | ||
ps -ef | grep 'react-scripts' | grep -v grep | awk '{print $2}' | xargs kill -9 | ||
cd "$root_path" | ||
# TODO: fix "Device or resource busy" and remove ``|| $CI` | ||
rm -rf "$temp_app_path" "$temp_module_path" || $CI | ||
npm set registry "$original_npm_registry_url" | ||
yarn config set registry "$original_yarn_registry_url" | ||
} | ||
|
||
# Error messages are redirected to stderr | ||
|
@@ -79,11 +84,11 @@ nohup npx [email protected] &>$tmp_registry_log & | |
grep -q 'http address' <(tail -f $tmp_registry_log) | ||
|
||
# Set registry to local registry | ||
npm set registry http://localhost:4873 | ||
yarn config set registry http://localhost:4873 | ||
npm set registry "$custom_registry_url" | ||
yarn config set registry "$custom_registry_url" | ||
|
||
# Login so we can publish packages | ||
npx [email protected] -u user -p password -e [email protected] -r http://localhost:4873 --quotes | ||
npx [email protected] -u user -p password -e [email protected] -r "$custom_registry_url" --quotes | ||
|
||
# Publish the monorepo | ||
git clean -f | ||
|
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 |
---|---|---|
|
@@ -15,13 +15,18 @@ cd "$(dirname "$0")" | |
# App temporary location | ||
# http://unix.stackexchange.com/a/84980 | ||
temp_app_path=`mktemp -d 2>/dev/null || mktemp -d -t 'temp_app_path'` | ||
custom_registry_url=http://localhost:4873 | ||
original_npm_registry_url=`npm get registry` | ||
original_yarn_registry_url=`yarn config get registry` | ||
|
||
function cleanup { | ||
echo 'Cleaning up.' | ||
cd "$root_path" | ||
# Uncomment when snapshot testing is enabled by default: | ||
# rm ./packages/react-scripts/template/src/__snapshots__/App.test.js.snap | ||
rm -rf "$temp_app_path" | ||
npm set registry "$original_npm_registry_url" | ||
yarn config set registry "$original_yarn_registry_url" | ||
} | ||
|
||
# Error messages are redirected to stderr | ||
|
@@ -87,11 +92,11 @@ nohup npx [email protected] &>$tmp_registry_log & | |
grep -q 'http address' <(tail -f $tmp_registry_log) | ||
|
||
# Set registry to local registry | ||
npm set registry http://localhost:4873 | ||
yarn config set registry http://localhost:4873 | ||
npm set registry "$custom_registry_url" | ||
yarn config set registry "$custom_registry_url" | ||
|
||
# Login so we can publish packages | ||
npx [email protected] -u user -p password -e [email protected] -r http://localhost:4873 --quotes | ||
npx [email protected] -u user -p password -e [email protected] -r "$custom_registry_url" --quotes | ||
|
||
# Lint own code | ||
./node_modules/.bin/eslint --max-warnings 0 packages/babel-preset-react-app/ | ||
|