chore: handle 'npm run raw' being used on node versions below 22.7.0
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build / build (pull_request) Successful in 2m17s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build / build (pull_request) Successful in 2m17s
				
			This commit is contained in:
		
							parent
							
								
									4d8dbd99aa
								
							
						
					
					
						commit
						fc7b7191f1
					
				@ -15,7 +15,7 @@
 | 
				
			|||||||
    "dev:bun": "bun scripts/dev.cjs",
 | 
					    "dev:bun": "bun scripts/dev.cjs",
 | 
				
			||||||
    "verify": "tsgo --noEmit",
 | 
					    "verify": "tsgo --noEmit",
 | 
				
			||||||
    "verify:tsc": "tsc --noEmit",
 | 
					    "verify:tsc": "tsc --noEmit",
 | 
				
			||||||
    "raw": "node --experimental-transform-types src/index.ts",
 | 
					    "raw": "node scripts/raw-precheck.js && node --experimental-transform-types src/index.ts",
 | 
				
			||||||
    "raw:bun": "bun src/index.ts",
 | 
					    "raw:bun": "bun src/index.ts",
 | 
				
			||||||
    "lint": "eslint --ext .ts .",
 | 
					    "lint": "eslint --ext .ts .",
 | 
				
			||||||
    "lint:ci": "eslint --ext .ts --rule \"prettier/prettier: off\" .",
 | 
					    "lint:ci": "eslint --ext .ts --rule \"prettier/prettier: off\" .",
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										9
									
								
								scripts/raw-precheck.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								scripts/raw-precheck.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					const [major, minor] = process.versions.node.split(".").map(x => parseInt(x));
 | 
				
			||||||
 | 
					if (major > 22 || (major == 22 && minor >= 7)) {
 | 
				
			||||||
 | 
					    // ok
 | 
				
			||||||
 | 
					} else {
 | 
				
			||||||
 | 
					    console.log("Sorry, your Node version is a bit too old for this. You have 2 options:");
 | 
				
			||||||
 | 
					    console.log("- Update Node.js.");
 | 
				
			||||||
 | 
					    console.log("- Use 'npm run build && npm run start'. Optional libraries must be installed for this.");
 | 
				
			||||||
 | 
					    process.exit(1);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user