Skip to content

Commit eb1533d

Browse files
wmonkWilliam Monk
authored and
William Monk
committed
Update verdaccio
1 parent 798da0a commit eb1533d

File tree

2 files changed

+60
-10
lines changed

2 files changed

+60
-10
lines changed

tasks/e2e-simple.sh

+11-10
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ root_path=$PWD
6666
if hash npm 2>/dev/null
6767
then
6868
npm i -g npm@latest
69-
npm cache clean || npm cache verify
7069
fi
7170

7271
# Bootstrap monorepo
7372
yarn
7473

7574
# Start local registry
7675
tmp_registry_log=`mktemp`
77-
nohup npx verdaccio@2.7.2 &>$tmp_registry_log &
76+
nohup npx verdaccio@3.2.0 -c tasks/verdaccio.yaml &>$tmp_registry_log &
7877
# Wait for `verdaccio` to boot
7978
grep -q 'http address' <(tail -f $tmp_registry_log)
8079

@@ -83,16 +82,13 @@ npm set registry "$custom_registry_url"
8382
yarn config set registry "$custom_registry_url"
8483

8584
# Login so we can publish packages
86-
npx npm-cli-login@0.0.10 -u user -p password -e user@example.com -r "$custom_registry_url" --quotes
87-
88-
if [ $APPVEYOR != 'True' ]; then
89-
# Flow started hanging on AppVeyor after we moved to Yarn Workspaces :-(
90-
yarn flow
91-
fi
85+
(cd && npx npm-auth-to-token@1.0.0 -u user -p password -e user@example.com -r "$custom_registry_url")
9286

9387
# ******************************************************************************
94-
# Publish to local registry
88+
# First, test the create-react-app development environment.
89+
# This does not affect our users but makes sure we can develop it.
9590
# ******************************************************************************
91+
9692
git clean -df
9793
./tasks/publish.sh --yes --force-publish=* --skip-git --cd-version=prerelease --exact --npm-tag=latest
9894

@@ -104,10 +100,13 @@ git clean -df
104100
cd $temp_app_path
105101
npx create-react-app test-app --scripts-version=react-scripts-ts
106102

103+
# TODO: verify we installed prerelease
104+
107105
# ******************************************************************************
108106
# Now that we used create-react-app to create an app depending on react-scripts,
109107
# let's make sure all npm scripts are in the working state.
110108
# ******************************************************************************
109+
111110
function verify_env_url {
112111
# Backup package.json because we're going to make it dirty
113112
cp package.json package.json.orig
@@ -171,6 +170,8 @@ function verify_module_scope {
171170
yarn build; test $? -eq 1 || exit 1
172171
# TODO: check for error message
173172

173+
rm sample.json
174+
174175
# Restore App.tsx
175176
rm src/App.tsx
176177
mv src/App.tsx.bak src/App.tsx
@@ -218,7 +219,7 @@ exists build/static/css/*.css
218219
exists build/static/media/*.svg
219220
exists build/favicon.ico
220221

221-
# Run tests, overring the watch option to disable it.
222+
# Run tests, overriding the watch option to disable it.
222223
# `CI=true yarn test` won't work here because `yarn test` becomes just `jest`.
223224
# We should either teach Jest to respect CI env variable, or make
224225
# `scripts/test.js` survive ejection (right now it doesn't).

tasks/verdaccio.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# This is based on verdaccio's default config file. It allows all users
3+
# to do anything, so don't use it on production systems.
4+
#
5+
# Look here for more config file examples:
6+
# https://github.com/verdaccio/verdaccio/tree/master/conf
7+
#
8+
9+
# path to a directory with all packages
10+
storage: ./storage
11+
12+
auth:
13+
htpasswd:
14+
file: ./htpasswd
15+
# Maximum amount of users allowed to register, defaults to "+inf".
16+
# You can set this to -1 to disable registration.
17+
#max_users: 1000
18+
19+
# a list of other known repositories we can talk to
20+
uplinks:
21+
npmjs:
22+
url: https://registry.npmjs.org/
23+
24+
packages:
25+
'@*/*':
26+
# scoped packages
27+
access: $all
28+
publish: $all
29+
proxy: npmjs
30+
31+
'**':
32+
# allow all users (including non-authenticated users) to read and
33+
# publish all packages
34+
#
35+
# you can specify usernames/groupnames (depending on your auth plugin)
36+
# and three keywords: "$all", "$anonymous", "$authenticated"
37+
access: $all
38+
39+
# allow all known users to publish packages
40+
# (anyone can register by default, remember?)
41+
publish: $all
42+
43+
# if package is not available locally, proxy requests to 'npmjs' registry
44+
proxy: npmjs
45+
46+
# log settings
47+
logs:
48+
- {type: stdout, format: pretty, level: http}
49+
#- {type: file, path: verdaccio.log, level: info}

0 commit comments

Comments
 (0)