Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it easy to test-publish packages #2053

Open
wants to merge 14 commits into
base: trunk
Choose a base branch
from
10 changes: 9 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ for file in $STAGED_FILES; do
fi
done

exit 0
# Prevent commiting .npmrc with the registry set to local.
HAS_LOCAL_REGISTRY=$(git diff --cached --name-only .npmrc | xargs grep -n "registry=http://localhost:4873/")
if [ -n "${HAS_LOCAL_REGISTRY}" ]; then
Copy link
Collaborator

@adamziel adamziel Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good check! I'm wondering – is it possible to use a file that's .gitignore-d instead of a versioned one like .npmrc?

Copy link
Collaborator

@adamziel adamziel Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, could this focus more on the next step? As in tell the user to run npm run local-registry:disable

echo "The commit was rejected due to attempting to commit .npmrc with the registry set to the local registry."
echo "Please undo that change to .npmrc."
exit 1
fi

exit 0
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
save-exact = true
engine-strict = true
save-exact=true
engine-strict=true
22 changes: 22 additions & 0 deletions .verdaccio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# For documentation on verdaccio's configuration, see https://verdaccio.org/docs/configuration

# All verdaccio data is stored here.
# Do `npm run local-registry:clear` to delete all data.
storage: ./tmp/verdaccio

# Disable registration.
max_users: -1

# php-wasm assets can be large.
max_body_size: 256mb

# Fetch packages not found locally from npmjs.com.
uplinks:
npmjs:
url: https://registry.npmjs.org/

# All operations are available on all packages without authentication.
packages:
'**':
access: $all
publish: $all
Loading
Loading