diff --git a/docs/src/api/builtins/utilities.md b/docs/src/api/builtins/utilities.md index 9a39190e..c715feb4 100644 --- a/docs/src/api/builtins/utilities.md +++ b/docs/src/api/builtins/utilities.md @@ -11,7 +11,8 @@ 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`. @@ -19,6 +20,8 @@ m github:fluidattacks/makes@24.02 /utils/makeNodeJsLock \ 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`, `2`, or `3`. ## makePythonLock diff --git a/makes/utils/makeNodeJsLock/entrypoint.sh b/makes/utils/makeNodeJsLock/entrypoint.sh index a3699fe4..8d51cc9b 100644 --- a/makes/utils/makeNodeJsLock/entrypoint.sh +++ b/makes/utils/makeNodeJsLock/entrypoint.sh @@ -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 @@ -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 }