|
| 1 | +default: |
| 2 | + @just --list --justfile "{{ justfile() }}" |
| 3 | + |
1 | 4 | do-it: |
2 | 5 | @xdg-open https://youtu.be/AkygX8Fncpk |
3 | 6 |
|
4 | 7 | build: |
5 | | - @just build_js 2> /dev/null ||: |
| 8 | + -@just build_js 2> /dev/null |
6 | 9 | just build_css |
7 | 10 | just build_js |
8 | 11 |
|
9 | | -build_css *args: ( esbuild '--outbase=style' '--outdir=an_website/static/css' '"style/**/*.css"' args ) |
| 12 | +build_css *args: (esbuild '--outbase=style' '--outdir=an_website/static/css' '"style/**/*.css"' args) |
10 | 13 |
|
11 | | -build_js_debug *args: ( esbuild 'an_website/**/*[!_].ts' '--bundle' '"--external:/static/*"' '--legal-comments=inline' '"--footer:js=// @license-end"' '--format=esm' '--outbase=an_website' '--outdir=an_website/static/js' '"--alias:@utils/utils.js=$(./scripts/fix_static_url_path.py /static/js/utils/utils.js)"' args ) |
| 14 | +build_js_debug *args: (esbuild 'an_website/**/*[!_].ts' '--bundle' '"--external:/static/*"' '--legal-comments=inline' '"--footer:js=// @license-end"' '--format=esm' '--outbase=an_website' '--outdir=an_website/static/js' '"--alias:@utils/utils.js=$(./scripts/fix_static_url_path.py /static/js/utils/utils.js)"' args) |
12 | 15 |
|
13 | | -build_js *args: ( build_js_debug '--pure:console.log' '--pure:console.debug' args ) |
| 16 | +build_js *args: (build_js_debug '--pure:console.log' '--pure:console.debug' args) |
14 | 17 |
|
15 | 18 | clean: clean_css clean_js |
16 | 19 | ./scripts/compress_static_files.py --clean |
17 | 20 |
|
18 | 21 | clean_css: |
19 | | - rm -fr an_website/static/css |
| 22 | + rm -fr "{{ justfile_directory() }}/an_website/static/css" |
20 | 23 |
|
21 | 24 | clean_js: |
22 | | - rm -fr an_website/static/js |
| 25 | + rm -fr "{{ justfile_directory() }}/an_website/static/js" |
23 | 26 |
|
24 | 27 | esbuild *args: |
25 | | - deno run -A https://deno.land/x/esbuild@v0.24.2/mod.js --target=$(just target),chrome103,edge129,firefox115,ios11,opera114,safari15.6 --charset=utf8 --minify --sourcemap --tree-shaking=false {{args}} |
| 28 | + deno run -A https://deno.land/x/esbuild@v0.24.2/mod.js --target=$(just target),chrome103,edge129,firefox115,ios11,opera114,safari15.6 --charset=utf8 --minify --sourcemap --tree-shaking=false {{ args }} |
26 | 29 |
|
27 | 30 | target: |
28 | 31 | #!/usr/bin/env python3 |
29 | | - from datetime import datetime, timezone |
30 | | - print(end="es") |
31 | | - print(min((now := datetime.now(timezone.utc)).year - (5 + (now.month < 7)), 2022)) |
| 32 | + year = {{ datetime_utc('%Y') }} |
| 33 | + month = {{ trim_start_match(datetime_utc('%m'), '0') }} |
| 34 | + print(f"es{min(year - (5 + (month < 7)), 2022)}") |
32 | 35 |
|
33 | | -watch_css: ( build_css '--watch' ) |
| 36 | +watch_css: (build_css '--watch') |
34 | 37 |
|
35 | | -watch_js: ( build_js '--watch' ) |
| 38 | +watch_js: (build_js '--watch') |
36 | 39 |
|
37 | | -watch_js_debug: ( build_js_debug '--watch' ) |
| 40 | +watch_js_debug: (build_js_debug '--watch') |
38 | 41 |
|
39 | 42 | watman: |
40 | 43 | @deno eval 'console.log(Array(16).join("wat" - 1) + " Batman!")' |
0 commit comments