forked from fluidattacks/makes
-
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.
feat(build): fluidattacks#1378 deprecate makenodejs
- Deprecate `makeNodeJsModules` and `makeNodeJsEnvironment`. Signed-off-by: Robin Quintero <[email protected]>
- Loading branch information
1 parent
382fe21
commit 7750a71
Showing
15 changed files
with
51 additions
and
380 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 |
---|---|---|
|
@@ -2,27 +2,6 @@ Utilities provide an easy mechanism | |
for calling functions from makes | ||
without having to specify them on any file. | ||
|
||
## makeNodeJsLock | ||
|
||
You can generate a `package-lock.json` for | ||
[makeNodeJsEnvironment](/api/extensions/node.js/#makenodejsenvironment) | ||
like this: | ||
|
||
```bash | ||
m github:fluidattacks/[email protected] /utils/makeNodeJsLock \ | ||
"${node_js_version}" \ | ||
"${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 | ||
|
||
You can generate a `poetry.lock` for | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,23 +1,13 @@ | ||
{ __nixpkgs__, makeNodeJsEnvironment, makeScript, ... }: | ||
{ __nixpkgs__, makeScript, makeDerivation, makeSearchPaths, ... }: | ||
{ branch, config, name, parser, src, }: | ||
let | ||
commitlint = makeNodeJsEnvironment { | ||
name = "commitlint"; | ||
nodeJsVersion = "21"; | ||
packageJson = ./commitlint/package.json; | ||
packageLockJson = ./commitlint/package-lock.json; | ||
}; | ||
in makeScript { | ||
makeScript { | ||
name = "lint-git-commit-msg-for-${name}"; | ||
replace = { | ||
__argBranch__ = branch; | ||
__argConfig__ = config; | ||
__argParser__ = parser; | ||
__argSrc__ = src; | ||
}; | ||
searchPaths = { | ||
bin = [ __nixpkgs__.git ]; | ||
source = [ commitlint ]; | ||
}; | ||
searchPaths = { bin = [ __nixpkgs__.git __nixpkgs__.nodejs_21 ]; }; | ||
entrypoint = ./entrypoint.sh; | ||
} |
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 was deleted.
Oops, something went wrong.
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,20 +1,12 @@ | ||
{ makeDerivation, makeNodeJsEnvironment, toBashArray, ... }: | ||
{ __nixpkgs__, makeScript, projectPath, toBashArray, ... }: | ||
{ name, schema, targets, }: | ||
makeDerivation { | ||
env = { | ||
envSchema = schema; | ||
envTargets = toBashArray targets; | ||
makeScript { | ||
replace = { | ||
__argSchema__ = schema; | ||
__argTargets__ = toBashArray targets; | ||
__argAjvPath__ = projectPath "/src/args/lint-with-ajv/ajv-cli"; | ||
}; | ||
name = "lint-with-ajv-for-${name}"; | ||
searchPaths = { | ||
source = [ | ||
(makeNodeJsEnvironment { | ||
name = "ajv-cli"; | ||
nodeJsVersion = "21"; | ||
packageJson = ./ajv-cli/package.json; | ||
packageLockJson = ./ajv-cli/package-lock.json; | ||
}) | ||
]; | ||
}; | ||
builder = ./builder.sh; | ||
searchPaths.bin = [ __nixpkgs__.nodejs_21 ]; | ||
entrypoint = ./entrypoint.sh; | ||
} |
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,20 @@ | ||
# shellcheck shell=bash | ||
|
||
function main { | ||
source "${__argTargets__}/template" local targets | ||
|
||
pushd "${__argAjvPath__}" \ | ||
&& npm ci \ | ||
&& export PATH="${PWD}/node_modules/.bin:${PATH}" \ | ||
&& popd \ | ||
&& info "Compiling schema: ${__argSchema__}" \ | ||
&& ajv compile -s "${__argSchema__}" \ | ||
&& for target in "${targets[@]}"; do | ||
info "Linting data: ${target}" \ | ||
&& ajv validate -s "${__argSchema__}" -d "${target}" \ | ||
|| return 1 | ||
done \ | ||
&& touch "${out}" | ||
} | ||
|
||
main "${@}" |
Oops, something went wrong.