-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #19001 from storybookjs/shilman/improve-generate-r…
…epros Build: Improve generate-repros-next
- Loading branch information
Showing
5 changed files
with
42 additions
and
27 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
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
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 |
---|---|---|
|
@@ -94,18 +94,18 @@ const publish = (packages: { name: string; location: string }[], url: string) => | |
); | ||
}; | ||
|
||
// const addUser = (url: string) => | ||
// new Promise((res, rej) => { | ||
// logger.log(`👤 add temp user to verdaccio`); | ||
|
||
// exec(`npx npm-cli-adduser -r "${url}" -a -u user -p password -e [email protected]`, (e) => { | ||
// if (e) { | ||
// rej(e); | ||
// } else { | ||
// res(); | ||
// } | ||
// }); | ||
// }); | ||
const addUser = (url: string) => | ||
new Promise((res, rej) => { | ||
logger.log(`👤 add temp user to verdaccio`); | ||
|
||
exec(`npx npm-cli-adduser -r "${url}" -a -u user -p password -e [email protected]`, (e) => { | ||
if (e) { | ||
rej(e); | ||
} else { | ||
res(); | ||
} | ||
}); | ||
}); | ||
|
||
const run = async () => { | ||
const port = await freePort(program.port); | ||
|
@@ -135,8 +135,12 @@ const run = async () => { | |
|
||
logger.log(`🌿 verdaccio running on ${verdaccioUrl}`); | ||
|
||
// first time running, you might need to enable this | ||
// await addUser(verdaccioUrl); | ||
// in some environments you need to add a dummy user. always try to add & catch on failure | ||
try { | ||
await addUser(verdaccioUrl); | ||
} catch (e) { | ||
// | ||
} | ||
|
||
logger.log(`📦 found ${packages.length} storybook packages at version ${chalk.blue(version)}`); | ||
|
||
|