Convert remaining package.json scripts to cargo-make tasks.

This commit is contained in:
Bauke 2023-04-13 12:30:03 +02:00
parent 862a2fdb86
commit 30c042f991
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 23 additions and 10 deletions

View File

@ -25,6 +25,23 @@ clear = true
command = "pnpm"
args = ["trash", "build/${BROWSER}"]
# Run all other linting tasks.
[tasks.lint]
clear = true
dependencies = ["lint-js", "lint-scss"]
# Run XO.
[tasks.lint-js]
clear = true
command = "pnpm"
args = ["xo"]
# Run Stylelint.
[tasks.lint-scss]
clear = true
command = "pnpm"
args = ["stylelint", "source/**/*.scss"]
# Re-build and pack the WebExtension for publishing.
[tasks.pack]
clear = true
@ -42,3 +59,9 @@ args = ["web-ext", "run", "--config=build/web-ext-${BROWSER}.json"]
[tasks.watch]
env = { WATCH="true" }
extend = "build"
# Create a ZIP archive with only the source code, for AMO publishing.
[tasks.zip-source]
clear = true
command = "git"
args = ["archive", "--format=zip", "--output=build/queue-source.zip", "HEAD"]

View File

@ -1,16 +1,6 @@
{
"private": true,
"type": "module",
"scripts": {
"start": "vite build -m development --watch",
"start:chromium": "VITE_BROWSER=chromium pnpm start",
"clean": "trash build web-ext-artifacts",
"build": "pnpm clean && pnpm build:chromium && pnpm build:firefox && pnpm zip-source",
"build:chromium": "VITE_BROWSER=chromium vite build && web-ext build -n queue-chromium-{version}.zip -s build/chromium",
"build:firefox": "VITE_BROWSER=firefox vite build && web-ext build -n queue-firefox-{version}.zip -s build/firefox",
"zip-source": "git archive --format zip --output web-ext-artifacts/queue-source.zip HEAD",
"test": "xo && stylelint 'source/**/*.scss' && tsc && c8 ava"
},
"dependencies": {
"@holllo/migration-helper": "^0.1.3",
"@holllo/preact-components": "^0.2.3",