mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 16:37:07 +02:00
feat(v2): allow init project via npm (#3729)
* feat(v2: allow init project via npm * Add test-website to workspace * Remove test-website from workspace * Refactor
This commit is contained in:
parent
d05d703dad
commit
5f20200661
3 changed files with 14 additions and 5 deletions
|
@ -10,9 +10,14 @@ set -euo pipefail
|
|||
CUSTOM_REGISTRY_URL="http://localhost:4873"
|
||||
NEW_VERSION="$(node -p "require('./packages/docusaurus/package.json').version").NEW"
|
||||
CONTAINER_NAME="verdaccio"
|
||||
EXTRA_OPTS=""
|
||||
|
||||
if getopts ":n" arg; then
|
||||
EXTRA_OPTS="--use-npm"
|
||||
fi
|
||||
|
||||
# Run Docker container with private npm registry Verdaccio
|
||||
docker run -d --rm --name "$CONTAINER_NAME" -p 4873:4873 -v "$PWD/admin/verdaccio.yaml":/verdaccio/conf/config.yaml verdaccio/verdaccio:4
|
||||
docker run -d --rm --name "$CONTAINER_NAME" -p 4873:4873 -v "$PWD/admin/verdaccio.yaml":/verdaccio/conf/config.yaml verdaccio/verdaccio:latest
|
||||
|
||||
# Build packages
|
||||
yarn build:packages
|
||||
|
@ -24,7 +29,7 @@ npx --no-install lerna publish --yes --no-verify-access --no-git-reset --no-git-
|
|||
git diff --name-only -- '*.json' | sed 's, ,\\&,g' | xargs git checkout --
|
||||
|
||||
# Build skeleton website with new version
|
||||
npm_config_registry="$CUSTOM_REGISTRY_URL" npx @docusaurus/init@"$NEW_VERSION" init test-website classic
|
||||
npm_config_registry="$CUSTOM_REGISTRY_URL" npx @docusaurus/init@"$NEW_VERSION" init test-website classic $EXTRA_OPTS
|
||||
|
||||
# Stop Docker container
|
||||
if [[ -z "${KEEP_CONTAINER:-}" ]] && ( $(docker container inspect "$CONTAINER_NAME" > /dev/null 2>&1) ); then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue