chore: split Taskfile (#2654)

This commit is contained in:
Misite Bao 2023-05-27 10:29:50 +08:00
commit bbf0e8cdad
3 changed files with 114 additions and 118 deletions

View file

@ -3,130 +3,16 @@
version: "3"
includes:
runtime:
taskfile: ./internal/runtime
dir: ./internal/runtime
website:
taskfile: ./website
dir: ./website
optional: true
tasks:
build:runtime:debug:
dir: internal/runtime
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --tree-shaking=true --sourcemap=inline --outfile=runtime_debug_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
build:runtime:debug:windows:
cmds:
- task: build:runtime:debug
vars:
WINDOWS: true
DARWIN: false
LINUX: false
PLATFORM: windows
INVOKE: "chrome.webview.postMessage"
build:runtime:debug:linux:
cmds:
- task: build:runtime:debug
vars:
WINDOWS: false
DARWIN: false
LINUX: true
PLATFORM: linux
INVOKE: "webkit.messageHandlers.external.postMessage"
build:runtime:debug:darwin:
cmds:
- task: build:runtime:debug
vars:
WINDOWS: false
DARWIN: true
LINUX: false
PLATFORM: darwin
INVOKE: "webkit.messageHandlers.external.postMessage"
build:runtime:production:
dir: internal/runtime
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --tree-shaking=true --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
build:runtime:production:windows:
cmds:
- task: build:runtime:production
vars:
WINDOWS: true
DARWIN: false
LINUX: false
PLATFORM: windows
INVOKE: "chrome.webview.postMessage"
build:runtime:production:linux:
cmds:
- task: build:runtime:production
vars:
WINDOWS: false
DARWIN: false
LINUX: true
PLATFORM: linux
INVOKE: "webkit.messageHandlers.external.postMessage"
build:runtime:production:darwin:
cmds:
- task: build:runtime:production
vars:
WINDOWS: false
DARWIN: true
LINUX: false
PLATFORM: darwin
INVOKE: "webkit.messageHandlers.external.postMessage"
install:runtime-dev-deps:
dir: internal/runtime/dev
internal: true
sources:
- package.json
cmds:
- npm install
install:runtime-deps:
dir: internal/runtime
internal: true
sources:
- package.json
cmds:
- npm install
test:runtime:
dir: internal/runtime
cmds:
- npx vitest run
update:runtime:
dir: internal/runtime
cmds:
- npx npm-check-updates -u
build:runtime-all:
dir: internal/runtime
deps:
- build:runtime:production:darwin
- build:runtime:production:windows
- build:runtime:production:linux
- build:runtime:debug:darwin
- build:runtime:debug:windows
- build:runtime:debug:linux
cmds:
- cmd: echo "build complete"
build:runtime:
dir: internal/runtime
deps:
- install:runtime-deps
cmds:
- task: build:runtime-all
recreate-template-dir:
dir: internal/templates
internal: true

2
v3/internal/runtime/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
node_modules
.task

View file

@ -0,0 +1,108 @@
# https://taskfile.dev
version: "3"
tasks:
install-deps:
internal: true
sources:
- package.json
cmds:
- npm install
test:
cmds:
- npx vitest run
update:
cmds:
- npx npm-check-updates -u
build:debug:
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --tree-shaking=true --sourcemap=inline --outfile=runtime_debug_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
build:debug:windows:
cmds:
- task: build:debug
vars:
WINDOWS: true
DARWIN: false
LINUX: false
PLATFORM: windows
INVOKE: "chrome.webview.postMessage"
build:debug:linux:
cmds:
- task: build:debug
vars:
WINDOWS: false
DARWIN: false
LINUX: true
PLATFORM: linux
INVOKE: "webkit.messageHandlers.external.postMessage"
build:debug:darwin:
cmds:
- task: build:debug
vars:
WINDOWS: false
DARWIN: true
LINUX: false
PLATFORM: darwin
INVOKE: "webkit.messageHandlers.external.postMessage"
build:production:
internal: true
cmds:
- npx esbuild desktop/main.js --bundle --tree-shaking=true --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
build:production:windows:
cmds:
- task: build:production
vars:
WINDOWS: true
DARWIN: false
LINUX: false
PLATFORM: windows
INVOKE: "chrome.webview.postMessage"
build:production:linux:
cmds:
- task: build:production
vars:
WINDOWS: false
DARWIN: false
LINUX: true
PLATFORM: linux
INVOKE: "webkit.messageHandlers.external.postMessage"
build:production:darwin:
cmds:
- task: build:production
vars:
WINDOWS: false
DARWIN: true
LINUX: false
PLATFORM: darwin
INVOKE: "webkit.messageHandlers.external.postMessage"
build:all:
internal: true
deps:
- build:debug:windows
- build:debug:linux
- build:debug:darwin
- build:production:windows
- build:production:linux
- build:production:darwin
cmds:
- cmd: echo "Build Complete."
build:
deps:
- install-deps
cmds:
- task: build:all