json is just incredibly tedious to use for this, especially because of lack of comments. Upstream has been informed of this many times apparently, npm won't change it. Just hack it downstream. npm will never get better, will it...
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			369 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			369 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
| #!/usr/bin/env bash
 | |
| 
 | |
| set -eu
 | |
| 
 | |
| cd "$(git rev-parse --show-toplevel)"
 | |
| 
 | |
| if [ -L node_modules ]; then
 | |
|     unlink node_modules
 | |
| fi
 | |
| 
 | |
| if [ -L package.json ]; then
 | |
|     unlink package.json
 | |
| fi
 | |
| 
 | |
| yj < package.yaml > package.json
 | |
| 
 | |
| if [ "${1}" == "--ignore-semver" ]; then
 | |
|    npm-check-updates -u
 | |
| fi
 | |
| 
 | |
| npm install --package-lock-only
 | |
| rm -rf node_modules
 | |
| rm package.json
 | |
| 
 | |
| direnv reload
 |