-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
149 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# Top-most EditorConfig file | ||
root = true | ||
|
||
# defaults for all files | ||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# Markdown files uses two trailing spaces to indicate a <br> | ||
[*.{md,snap}] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,16 @@ | ||
# base-volta-off-of-nwjs | ||
|
||
WIP: Tool to update the Volta config in package.json so Node match's your NW.js version | ||
Updates the Volta config in your `package.json` so your Node.js version will match the version of Node.js built in to NW.js. | ||
|
||
This script needs adapted to work as a library: | ||
|
||
* https://github.com/nwutils/nw-selenium-javascript-example/blob/main/base-volta-off-of-nw.mjs | ||
## Usage | ||
|
||
1. `npm pkg set scripts.postinstall="npx base-volta-off-of-nwjs"` | ||
|
||
## API ideas | ||
This will add a command to your npm scripts that will automatically run after every time you do an `npm install`. It will update the Volta object in your `package.json` so the `node` value will match | ||
|
||
I'm wondering if it could be as easy as this? | ||
|
||
```json | ||
{ | ||
"name": "my-app", | ||
"main": "index.html", | ||
"scripts": { | ||
"start": "nw .", | ||
"postinstall": "base-volta-off-of-nwjs" | ||
} | ||
"devDependencies": { | ||
"nw": "0.80.0-sdk", | ||
"base-volta-off-of-nwjs": "^1.0.0" | ||
} | ||
} | ||
``` | ||
## Requirements | ||
|
||
Alternatively we could allow passing in the path to `node_modules` or the path to the `package.json`? | ||
|
||
```json | ||
"postinstall": "base-volta-off-of-nwjs ./node_modules ./package.json" | ||
``` | ||
1. You must have `nw` listed in `dependencies` or `devDependencies` | ||
1. `nw` must be installed in the `node_modules` folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "base-volta-off-of-nwjs", | ||
"version": "0.0.1", | ||
"main": "index.js", | ||
"bin": "./index.js", | ||
"license": "MIT", | ||
"description": "Updates Volta config in package.json so Node match's what your NW.js version uses", | ||
"scripts": { | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nwutils/base-volta-off-of-nwjs.git" | ||
}, | ||
"keywords": [ | ||
"nw.js", | ||
"volta", | ||
"node.js", | ||
"version", | ||
"management", | ||
"automated" | ||
], | ||
"author": "TheJaredWilcurt", | ||
"bugs": { | ||
"url": "https://github.com/nwutils/base-volta-off-of-nwjs/issues" | ||
}, | ||
"homepage": "https://github.com/nwutils/base-volta-off-of-nwjs#readme", | ||
"volta": { | ||
"node": "21.4.0", | ||
"npm": "10.2.4" | ||
} | ||
} |