98c51dd660
* build: ensure consistent package-lock across multiple machines * build: fix linting errors and use npm ci instead of npm install * build: use a yarn.lock and yarn instead of package-lock and npm * chore: replace package-lock.json files with yarn.lock * chore: replace last instance of `npm install`
47 lines
1.1 KiB
Text
47 lines
1.1 KiB
Text
template("npm_action") {
|
|
assert(defined(invoker.script),
|
|
"Need script name to run (must be defined in package.json)")
|
|
assert(defined(invoker.args), "Need script argumets")
|
|
|
|
action("npm_pre_flight_" + target_name) {
|
|
inputs = [
|
|
"package.json",
|
|
"yarn.lock",
|
|
]
|
|
script = "//electron/build/npm-run.py"
|
|
|
|
outputs = [
|
|
"$target_gen_dir/npm_pre_stamps/" + target_name + ".stamp",
|
|
]
|
|
|
|
args = [
|
|
"--silent",
|
|
"pre-flight",
|
|
"--",
|
|
"--stamp",
|
|
rebase_path(outputs[0]),
|
|
]
|
|
}
|
|
|
|
action(target_name) {
|
|
forward_variables_from(invoker,
|
|
[
|
|
"deps",
|
|
"public_deps",
|
|
"sources",
|
|
"inputs",
|
|
"outputs",
|
|
])
|
|
if (!defined(deps)) {
|
|
deps = []
|
|
}
|
|
deps += [ ":npm_pre_flight_" + target_name ]
|
|
|
|
script = "//electron/build/npm-run.py"
|
|
args = [
|
|
"--silent",
|
|
invoker.script,
|
|
"--",
|
|
] + invoker.args
|
|
}
|
|
}
|