Skip to content

Snippets #42

@AlanGreene

Description

@AlanGreene

npm scripts access to npm-specific environment variables, e.g. $npm_new_version for npm version command

"check-env": "node -e 'console.log(process.env)' | grep npm"

https://www.twilio.com/blog/npm-scripts

"demo": "echo \"Hello $npm_config_first $npm_config_last\""

npm run demo --last=Kundel --first=Dominik

git merge histories (e.g. importing existing projects into monorepo)

# Add an external repository as a remote
git remote add -f <external-repo-name> <external-repo-path>
# Merge commit history of a required branch
git merge --allow-unrelated-histories <external-repo-name>/<branch-name>
# files will be merged to root of repo so then need to move to appropriate place in e.g. `packages/`
# also create branch to track original repo to preserve history
git branch init/$package $package/master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions