Skip to content

Commit

Permalink
feat(cross): fluidattacks#1043 use node2nix
Browse files Browse the repository at this point in the history
- Use node2nix for building node modules
- Update documentation
- Update locks to include name as it is now required by node2nix
  • Loading branch information
dsalaza4 committed Dec 21, 2023
1 parent bab198e commit fe5d3e5
Show file tree
Hide file tree
Showing 13 changed files with 1,944 additions and 202 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__
.vscode
node_modules
17 changes: 6 additions & 11 deletions docs/src/api/extensions/node.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Get a specific Node.js version interpreter.
Types:

- makeNodeJsVersion (`function str -> package`):
- (`enum [ "14" "16" "18" ]`):
- (`enum [ "18" "20" "21" ]`):
Node.js version to use.

Example:
Expand All @@ -25,7 +25,7 @@ Example:
'';
name = "example";
searchPaths = {
bin = [ (makeNodeJsVersion "16") ];
bin = [ (makeNodeJsVersion "18") ];
};
}
```
Expand All @@ -41,14 +41,15 @@ Example:
## makeNodeJsModules

Cook the `node_modules` directory
for the given Node.js project.
for the given Node.js project
using [node2nix](https://github.com/svanderburg/node2nix).

Types:

- makeNodeJsModules (`function { ... } -> package`):
- name (`str`):
Custom name to assign to the build step, be creative, it helps in debugging.
- nodeJsVersion (`enum [ "14" "16" "18" ]`):
- nodeJsVersion (`enum [ "18" ]`):
Node.js version to use.
- packageJson (`package`):
Path to the `package.json` of your project.
Expand All @@ -57,9 +58,6 @@ Types:
- searchPaths (`asIn makeSearchPaths`): Optional.
Arguments here will be passed as-is to `makeSearchPaths`.
Defaults to `makeSearchPaths`'s defaults.
- shouldIgnoreScripts (`bool`): Optional.
Enable to propagate the `--ignore-scripts true` flag to npm.
Defaults to `false`.

Example:

Expand Down Expand Up @@ -148,7 +146,7 @@ Types:
- makeNodeJsEnvironment (`function { ... } -> package`):
- name (`str`):
Custom name to assign to the build step, be creative, it helps in debugging.
- nodeJsVersion (`enum [ "14" "16" "18" ]`):
- nodeJsVersion (`enum [ "18" ]`):
Node.js version to use.
- packageJson (`package`):
Path to the `package.json` of your project.
Expand All @@ -157,9 +155,6 @@ Types:
- searchPaths (`asIn makeSearchPaths`): Optional.
Arguments here will be passed as-is to `makeSearchPaths`.
Defaults to `makeSearchPaths`'s defaults.
- shouldIgnoreScripts (`bool`): Optional.
Enable to propagate the `--ignore-scripts true` flag to npm.
Defaults to `false`.

Example:

Expand Down
Loading

0 comments on commit fe5d3e5

Please sign in to comment.