Skip to content

Commit e2f3ac0

Browse files
committed
Address PR comments
1 parent 64ee397 commit e2f3ac0

File tree

3 files changed

+34
-15
lines changed

3 files changed

+34
-15
lines changed

.circleci/verdaccio.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ auth:
44
file: ./htpasswd
55
uplinks:
66
npmjs:
7-
url: https://registry.yarnpkg.com/
7+
url: https://registry.npmjs.org/
88
max_fails: 40
99
maxage: 30m
1010
timeout: 60s

scripts/run-ci-e2e-tests.js

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const {cd, cp, echo, exec, exit, mv, rm} = require('shelljs');
2323
const spawn = require('child_process').spawn;
2424
const argv = require('yargs').argv;
2525
const path = require('path');
26+
const {setupVerdaccio} = require('./setup-verdaccio');
2627

2728
const SCRIPTS = __dirname;
2829
const ROOT = path.normalize(path.join(__dirname, '..'));
@@ -72,26 +73,14 @@ try {
7273
const REACT_NATIVE_PACKAGE = path.join(ROOT, 'react-native-*.tgz');
7374

7475
describe('Set up Verdaccio');
75-
const verdaccioProcess = spawn('npx', [
76-
'verdaccio@5.15.3',
77-
'--config',
78-
'.circleci/verdaccio.yml',
79-
]);
80-
VERDACCIO_PID = verdaccioProcess.pid;
81-
exec('npx wait-on@6.0.1 http://localhost:4873');
82-
exec('npm set registry http://localhost:4873');
83-
exec('echo "//localhost:4873/:_authToken=secretToken" > .npmrc');
76+
VERDACCIO_PID = setupVerdaccio();
8477

8578
describe('Publish packages');
8679
const packages = JSON.parse(
8780
JSON.parse(exec('yarn --json workspaces info').stdout).data,
8881
);
8982
Object.keys(packages)
90-
.filter(
91-
packageName =>
92-
packageName !== '@react-native/tester' &&
93-
packageName !== '@react-native/repo-config',
94-
)
83+
.filter(packageName => packageName !== '@react-native/repo-config')
9584
.forEach(packageName => {
9685
exec(
9786
`cd ${packages[packageName].location} && npm publish --registry http://localhost:4873 --yes --access public`,

scripts/setup-verdaccio.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
*/
9+
10+
'use strict';
11+
12+
function setupVerdaccio() {
13+
const {exec} = require('shelljs');
14+
const spawn = require('child_process').spawn;
15+
16+
const verdaccioProcess = spawn('npx', [
17+
'verdaccio@5.15.3',
18+
'--config',
19+
'.circleci/verdaccio.yml',
20+
]);
21+
const VERDACCIO_PID = verdaccioProcess.pid;
22+
exec('npx wait-on@6.0.1 http://localhost:4873');
23+
exec('npm set registry http://localhost:4873');
24+
exec('echo "//localhost:4873/:_authToken=secretToken" > .npmrc');
25+
return VERDACCIO_PID;
26+
}
27+
28+
module.exports = {
29+
setupVerdaccio: setupVerdaccio,
30+
};

0 commit comments

Comments
 (0)