Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refac(cross): #1290 update makenodejslock #1291

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/src/api/builtins/utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ like this:
```bash
m github:fluidattacks/makes@24.02 /utils/makeNodeJsLock \
"${node_js_version}" \
"${package_json_dir}"
"${package_json_dir}" \
"${lockfile_version}"
```

- Supported `node_js_version`s are: `18`, `20` and `21`.
- `package_json_dir` is the **absolute path** to the directory that contains
the `package.json` file in your project.
- The `package-lock.json` file will be generated in the same directory that
contains the `package.json` file.
- The `lockfile_version` is an optional argument, defaults to `2` and can be
`1` or `2`.

## makePythonLock

Expand Down
3 changes: 2 additions & 1 deletion makes/utils/makeNodeJsLock/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
function main {
local node_js_version="${1}"
local package_json_dir="${2}"
local lockfile_version="${3:2}"
local npm_install_args=(
--audit false
--ignore-scripts true
Expand All @@ -15,7 +16,7 @@ function main {
*) critical NodeJs version not supported: "${node_js_version}" ;;
esac \
&& pushd "${package_json_dir}" \
&& "${npm}" install "${npm_install_args[@]}" \
&& "${npm}" install "${npm_install_args[@]}" --lockfile-version "${lockfile_version}" \
&& popd || return 1
}

Expand Down
Loading