asset忘了上传了,重新传一下,增加了模板引擎(见README),修复了printable的目录bug
This commit is contained in:
1 parent
0817d33309
commit
8b88de4942
7268 files changed
+1257020
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ ! -d "/home/helloworld/Projects/wpep/tools/gp" ]]; then
|
||||
echo "Cannot find source directory; Did you move it?"
|
||||
echo "(Looking for "/home/helloworld/Projects/wpep/tools/gp")"
|
||||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# rebuild the cache forcefully
|
||||
_nix_direnv_force_reload=1 direnv exec "/home/helloworld/Projects/wpep/tools/gp" true
|
||||
+1
@@ -0,0 +1 @@
|
||||
/nix/store/01x5k4nlxcpyd85nnr0b9gm89rm8ff4x-source
|
||||
+1
@@ -0,0 +1 @@
|
||||
/nix/store/0d1kf07ph2ply64i1y247f9q2an9cw00-source
|
||||
+1
@@ -0,0 +1 @@
|
||||
/nix/store/5msh8h99hcj2pp1bn49bf5j1hz0k59fl-source
|
||||
+1
@@ -0,0 +1 @@
|
||||
/nix/store/ljcx5g5zlms59kb3bd7jm0ilc22y4ab7-source
|
||||
+1
@@ -0,0 +1 @@
|
||||
/nix/store/yj1wxm9hh8610iyzqnz75kvs6xl8j3my-source
|
||||
@@ -0,0 +1 @@
|
||||
use flake
|
||||
@@ -0,0 +1,4 @@
|
||||
tmps/*
|
||||
outputs/*
|
||||
private_key.asc
|
||||
node_modules/
|
||||
+373
@@ -0,0 +1,373 @@
|
||||
{
|
||||
"nixEnvSelector.nixFile": "${workspaceFolder}/flake.nix",
|
||||
"terminal.integrated.env.linux": {
|
||||
"PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD": "1",
|
||||
"CHROMIUM_PATH": "/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/bin/chromium",
|
||||
"SHELL": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"__HM_SESS_VARS_SOURCED": "1",
|
||||
"COLORTERM": "truecolor",
|
||||
"XDG_CONFIG_DIRS": "/etc/xdg:/home/arch/.local/share/flatpak/exports/etc/xdg:/var/lib/flatpak/exports/etc/xdg:/home/arch/.nix-profile/etc/xdg:/nix/profile/etc/xdg:/home/arch/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/arch/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg:/nix/store/zh9bq7ndr6gxx6hagc57c8mdrpdjp0v0-gnome-settings-daemon-49.1/etc/xdg",
|
||||
"NIX_LD_LIBRARY_PATH": "/run/current-system/sw/share/nix-ld/lib",
|
||||
"NIX_BUILD_CORES": "12",
|
||||
"NIX_GCROOT": "/nix/store/0r1baggl4cim2yv1my7xv6ylwhj8jjlh-nix-shell-env",
|
||||
"XDG_MENU_PREFIX": "gnome-",
|
||||
"TERM_PROGRAM_VERSION": "49.2",
|
||||
"GTK_IM_MODULE": "fcitx",
|
||||
"configureFlags": "",
|
||||
"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "1",
|
||||
"mesonFlags": "",
|
||||
"shell": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"depsHostHost": "",
|
||||
"LC_ADDRESS": "zh_CN.UTF-8",
|
||||
"LC_NAME": "zh_CN.UTF-8",
|
||||
"SSH_AUTH_SOCK": "/run/user/1000/gcr/ssh",
|
||||
"DIRENV_DIR": "-/home/arch/Projects/wpep/tools/gp",
|
||||
"STRINGS": "strings",
|
||||
"depsTargetTarget": "",
|
||||
"XCURSOR_PATH": "/home/arch/.icons:/home/arch/.local/share/icons:/home/arch/.local/share/flatpak/exports/share/icons:/home/arch/.local/share/flatpak/exports/share/pixmaps:/var/lib/flatpak/exports/share/icons:/var/lib/flatpak/exports/share/pixmaps:/home/arch/.nix-profile/share/icons:/home/arch/.nix-profile/share/pixmaps:/nix/profile/share/icons:/nix/profile/share/pixmaps:/home/arch/.local/state/nix/profile/share/icons:/home/arch/.local/state/nix/profile/share/pixmaps:/etc/profiles/per-user/arch/share/icons:/etc/profiles/per-user/arch/share/pixmaps:/nix/var/nix/profiles/default/share/icons:/nix/var/nix/profiles/default/share/pixmaps:/run/current-system/sw/share/icons:/run/current-system/sw/share/pixmaps",
|
||||
"MEMORY_PRESSURE_WRITE": "c29tZSAyMDAwMDAgMjAwMDAwMAA=",
|
||||
"ELECTRON_RUN_AS_NODE": "1",
|
||||
"stdenv": "/nix/store/gvq9hvvnmkvrk27mba0jjjppj068z55x-stdenv-linux",
|
||||
"LOCALE_ARCHIVE_2_27": "/nix/store/s7627r57hh0hyb4ik6d92ms5zzclrawp-glibc-locales-2.42-51/lib/locale/locale-archive",
|
||||
"builder": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"XMODIFIERS": "@im=fcitx",
|
||||
"DESKTOP_SESSION": "gnome",
|
||||
"LC_MONETARY": "zh_CN.UTF-8",
|
||||
"GDK_PIXBUF_MODULE_FILE": "/nix/store/kn9lwgvdaa94nl9nsxx5p198gry21n03-librsvg-2.61.4/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache",
|
||||
"shellHook": "export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1",
|
||||
" export CHROMIUM_PATH": "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"",
|
||||
"echo \"PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD": "$PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD\"",
|
||||
" echo \"CHROMIUM_PATH": "$CHROMIUM_PATH\"",
|
||||
"NO_AT_BRIDGE": "1",
|
||||
"DIRENV_FILE": "/home/arch/Projects/wpep/tools/gp/.envrc",
|
||||
"EDITOR": "nano",
|
||||
"phases": "buildPhase",
|
||||
"DBUS_STARTER_BUS_TYPE": "session",
|
||||
"NAUTILUS_4_EXTENSION_DIR": "/nix/store/58b287bvfpkzf5gif1xz5bippfkd7f66-system-path/lib/nautilus/extensions-4",
|
||||
"PWD": "/home/arch/Projects/wpep/tools/gp",
|
||||
"NIX_PROFILES": "/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/arch /home/arch/.local/state/nix/profile /nix/profile /home/arch/.nix-profile /var/lib/flatpak/exports /home/arch/.local/share/flatpak/exports",
|
||||
"NIX_GSETTINGS_OVERRIDES_DIR": "/nix/store/pw378mnm4z97k9vj6kmg0qab9zbnwf47-gnome-gsettings-overrides/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas",
|
||||
"SOURCE_DATE_EPOCH": "315532800",
|
||||
"XDG_SESSION_DESKTOP": "gnome",
|
||||
"LOGNAME": "arch",
|
||||
"XDG_SESSION_TYPE": "wayland",
|
||||
"NIX_ENFORCE_NO_NATIVE": "1",
|
||||
"CUPS_DATADIR": "/nix/store/yflb7rc8rasa1pfvqkm3dp1z69vz2ba9-cups-progs/share/cups",
|
||||
"NIX_PATH": "/home/arch/.nix-defexpr/channels:nixpkgs=flake:nixpkgs:/nix/var/nix/profiles/per-user/root/channels",
|
||||
"COPILOT_OTEL_FILE_EXPORTER_PATH": "/dev/null",
|
||||
"VSCODE_ESM_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
|
||||
"SYSTEMD_EXEC_PID": "2256",
|
||||
"VSCODE_CODE_CACHE_PATH": "/home/arch/.config/Code/CachedData/41dd792b5e652393e7787322889ed5fdc58bd75b",
|
||||
"NIXPKGS_CONFIG": "/etc/nix/nixpkgs-config.nix",
|
||||
"CXX": "g++",
|
||||
"XAUTHORITY": "/run/user/1000/.mutter-Xwaylandauth.5ZVIO3",
|
||||
"TEMPDIR": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"system": "x86_64-linux",
|
||||
"HOST_PATH": "/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/c89zz4vh8v9dbs8169wk8ahwxvrdxgm5-findutils-4.10.0/bin:/nix/store/355mp4ns4042sb5p51rx3ys4mlliiwc5-diffutils-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/kvmqv1jqv4792rsihf7yjc5kwk3d8z6x-gnutar-1.35/bin:/nix/store/pnxiz967z73a45f4x7c1icldjaaqmlcp-gzip-1.14/bin:/nix/store/by6npbc13ly5a1zgsqghv7wv5bklyiny-bzip2-1.0.8-bin/bin:/nix/store/1fvcxyhg3i5fvw0j4l8wmyml10dnvm7q-gnumake-4.4.1/bin:/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin:/nix/store/ca84rbhb0bhwdcci7q51dad20nkbn9xc-patch-2.8/bin:/nix/store/g6mlwdvpg92rchq352ll7jbi0pz7h43r-xz-5.8.2-bin/bin:/nix/store/kjg8z2k0zvsczaij78803g7imlfm1vfb-file-5.45/bin",
|
||||
"GDM_LANG": "zh_CN.UTF-8",
|
||||
"IN_NIX_SHELL": "impure",
|
||||
"doInstallCheck": "",
|
||||
"GI_TYPELIB_PATH": "/nix/store/d864rlg855kf2hnnnfdzcx54grp8n10x-glib-2.86.3/lib/girepository-1.0:/nix/store/argh931zkmvlr78nkwxz45c6y49dnri0-gdk-pixbuf-2.44.5/lib/girepository-1.0:/nix/store/1h06bl72cj25gmv34cazvkixnvysj9q2-graphene-1.10.8/lib/girepository-1.0:/nix/store/bicq9gpqf10dx09li6q0pxd73wc5yx2x-harfbuzz-12.3.0/lib/girepository-1.0:/nix/store/apbb9j812kbr57qw1f1dgrqxf4gzbd3m-pango-1.57.0/lib/girepository-1.0:/nix/store/xsfc5fcy12nmcdsdwm3dx1xfffh7xv30-gsettings-desktop-schemas-49.1/lib/girepository-1.0:/nix/store/hjp25ksf3axb4czp7sllvzl1bkpfwsyg-gtk4-4.20.3/lib/girepository-1.0:/nix/store/kn9lwgvdaa94nl9nsxx5p198gry21n03-librsvg-2.61.4/lib/girepository-1.0:/nix/store/sf2lb971dqfwf326qddixn3yanc53nl0-gnome-desktop-44.5/lib/girepository-1.0:/nix/store/r9krxd5xlwggdj8997yvqyizscaa2x8y-json-glib-1.10.8/lib/girepository-1.0",
|
||||
"HOME": "/home/arch",
|
||||
"USERNAME": "arch",
|
||||
"NIX_BINTOOLS": "/nix/store/x7ikkplbrv5dlihy1bqq32gp6lilkval-binutils-wrapper-2.44",
|
||||
"LC_PAPER": "zh_CN.UTF-8",
|
||||
"LANG": "zh_CN.UTF-8",
|
||||
"LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.7z=01;31:*.ace=01;31:*.alz=01;31:*.apk=01;31:*.arc=01;31:*.arj=01;31:*.bz=01;31:*.bz2=01;31:*.cab=01;31:*.cpio=01;31:*.crate=01;31:*.deb=01;31:*.drpm=01;31:*.dwm=01;31:*.dz=01;31:*.ear=01;31:*.egg=01;31:*.esd=01;31:*.gz=01;31:*.jar=01;31:*.lha=01;31:*.lrz=01;31:*.lz=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.lzo=01;31:*.pyz=01;31:*.rar=01;31:*.rpm=01;31:*.rz=01;31:*.sar=01;31:*.swm=01;31:*.t7z=01;31:*.tar=01;31:*.taz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tgz=01;31:*.tlz=01;31:*.txz=01;31:*.tz=01;31:*.tzo=01;31:*.tzst=01;31:*.udeb=01;31:*.war=01;31:*.whl=01;31:*.wim=01;31:*.xz=01;31:*.z=01;31:*.zip=01;31:*.zoo=01;31:*.zst=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.jxl=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",
|
||||
"XDG_CURRENT_DESKTOP": "GNOME",
|
||||
"depsTargetTargetPropagated": "",
|
||||
"VSCODE_DOTNET_INSTALL_TOOL_ORIGINAL_HOME": "/home/arch",
|
||||
"VSCODE_IPC_HOOK": "/run/user/1000/vscode-2fafacbe-1.11-main.sock",
|
||||
"MEMORY_PRESSURE_WATCH": "/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/session.slice/dbus.service/memory.pressure",
|
||||
"STARSHIP_SHELL": "zsh",
|
||||
"VTE_VERSION": "8203",
|
||||
"WAYLAND_DISPLAY": "wayland-0",
|
||||
"cmakeFlags": "",
|
||||
"STARSHIP_CONFIG": "/home/arch/.config/starship.toml",
|
||||
"outputs": "out",
|
||||
"GIO_EXTRA_MODULES": "/nix/store/y8dqwhsf4bvggqawlv7zia65lbr8rp51-dconf-0.49.0-lib/lib/gio/modules:/nix/store/jhx50gyrf0zr45xxvdl11z4jlkky05my-gvfs-1.58.4/lib/gio/modules:/nix/store/yd01p9dyhm7p06wrsjz1zpqg063b4jfs-glib-networking-2.80.1/lib/gio/modules:GTK_PATH=/home/arch/.local/share/flatpak/exports/lib/gtk-2.0:/home/arch/.local/share/flatpak/exports/lib/gtk-3.0:/home/arch/.local/share/flatpak/exports/lib/gtk-4.0:/var/lib/flatpak/exports/lib/gtk-2.0:/var/lib/flatpak/exports/lib/gtk-3.0:/var/lib/flatpak/exports/lib/gtk-4.0:/home/arch/.nix-profile/lib/gtk-2.0:/home/arch/.nix-profile/lib/gtk-3.0:/home/arch/.nix-profile/lib/gtk-4.0:/nix/profile/lib/gtk-2.0:/nix/profile/lib/gtk-3.0:/nix/profile/lib/gtk-4.0:/home/arch/.local/state/nix/profile/lib/gtk-2.0:/home/arch/.local/state/nix/profile/lib/gtk-3.0:/home/arch/.local/state/nix/profile/lib/gtk-4.0:/etc/profiles/per-user/arch/lib/gtk-2.0:/etc/profiles/per-user/arch/lib/gtk-3.0:/etc/profiles/per-user/arch/lib/gtk-4.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-4.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0:/run/current-system/sw/lib/gtk-4.0",
|
||||
"VSCODE_CLI": "1",
|
||||
"NIX_STORE": "/nix/store",
|
||||
"TMPDIR": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"VSCODE_L10N_BUNDLE_LOCATION": "file:///home/arch/.vscode/extensions/ms-ceintl.vscode-language-pack-zh-hans-1.110.2026041514/translations/extensions/vscode.html-language-features.i18n.json",
|
||||
"LD": "ld",
|
||||
"buildPhase": "{ echo \"------------------------------------------------------------\";",
|
||||
"MANAGERPID": "2237",
|
||||
"DIRENV_DIFF": "eJzsWnlz2zqS_yoszvyxW2NSvA9PvT_kI7byHMmRncTJeEsFAiAJEgRBgOL16n33LUpyLB9JXo7Zqa1yKrakRv-6mw2g8YPaf6hcPfxDvZxen6uH6oSRbiLrUuBJCnLbsE0SRLxoUBVTELiVV9lR0lacR4aWUBJplh54uq1FhE0iwg738EliemHeE-o2qUxcUEEOkj6VQdxSQ7hCS0Cba65u69ZjaOqlKEryOHVDxv2I-GlQAd_jleWTbgiElrB1IjDXbN18As64rHrHF4gamYGavh8iJ2-DpAJZG7DOGMESI83Rw8dQ35GEIRN5TWxFcYv8PqdJAFPZDFVXFJUGS4HXNaFSC3XTeAyvGCMJFyR2G5GF0IhynnmtwZDjxYVdFFqbEphqlm7Zj6FtnPCUciZEA83UgxkCFeXc7zzRo6DptATXsGTxJulQs3TH0lxza0Ws2aQVgHMs5FaSlgWeAAHTiU5LCOhEpkDgSUxBzUE-wR0vRb3TbYCYUBI9P7hniJFO46KMCcX3wT8QPPVagxo_1cM1vBPICcdCW0sstsDPhseo9oBygnAM1rS-f2K4FgKzWpO9rHExke04pB6oNydnq5Pp9XR1MltePVzRwDVDbre0aFBXGZA6vd_3YKi4G8qg6YnWSFgirJm6abq6sc3a_ix1MoZuDHvTYgVEErWFjTqzi-M49bvGNrRE4romLJEawjKvS65JmOICSM0JdXM3DfdKu8HJ12H7EfTU7akduqTqgiBHZuHTzud-5LnMyOIu1JI6_4et2brl6O5XHO5r7ds3QIjiLMxi2rtm3kWBLYHVdMTsU1BZZq4lrCywBksmS4rH8KynaUozbrm5jG3QRQ4cuC8pbQZqRjmPW9knY5CO5uiWodtfC_FO55cE-JyLJ6r7noqYIlJkRlPwBolGgsyuBukGme8PkA5850liKUnJvpCK__yK-XdOxpCGUeUzJLyk67wUJND1YVAgwVHGjcb4nKK7WAEutqn6ypN9EfJLJucrHu9V9z0hEdpUeNRxSU5ZO-QWbdvBGwYn8XuTdztPBSkw4Fw-XQKGDbMIuANt0syOLaOjrZVGjIYkK7wwCO5m8DP0L1bvnfaX6vdTY_sVfC_KR6K_UMV3ml-p43vmv1jJdzrP1_InWcxN0SZOb6QNKyrHsCLT9mTDvSItotz23LsJTzGl4xw635ruz4q_wIv654HKRhY1XaqHKhDqgTodzx4g1QP1-Fg9VBMIx7fny8Wb2bs3q6dsy7Q7bhZJB1sbmr20TJSHiLuw6N1YDn6rwVSUBVkXmun4uqH7vuXrrjseepO7odHDYv5qdra6Oj-9uHjooAkk8IRXGbZP0iTt4qgdsszhbthYncEbLQIyHekY39CiyfhxNHhzM4b_j3-oB-rJbHk6fz8erOqhqu2tlEtRZhjWctJyzCd1WVI5Sfg94tXs4nSM5luIiY5ZI-A98MP0-vj8dEwlft1D47RetMP03XJ9FuJXw_v1TRR4pPo4a6OboQiuPPlp-bEuSTd3PrXV0avqSDoau8KXwc1xtHx7PoPIS9ZvzSx-zcWHcBZ9Wtwcfaxl_enTvCFun62K4LU4veZDZXhvl91sgaDvN9ji9hQhAV4nbh3D-Mann6wbS5CZwMv3QZp-yM7i15_Q1YV5cQJcXGZGFIHXxhGdvnK1368ThubhkWeS8PjcSOnvxx_Td9L7NA1hGnMqi7e4fmt8vPTefpA3-dvfr2bN8QWVVtTPRbqGR6-OpMPO3mE-vX79ySuM-ezNB5QReL5wmz4yL83ZGx7XJ-ubRfh-cMilEdwsg3hlYdc8vw7erwRdtNPpahXe1NFFpx6o54ur62dW4E-SXxiEw-A0adCEKJKB6YVtHoC07RqBuqRwtZgwtIU7umnoTwzYrltwh0nHcCwZudw1RWf30ikoJaSFroZIHG8N_GLa_1PXjZ-45uRNUTVmVjWOH1pCkjT2-wy6eZvbKBi88WhZ10Bopm67j7GcdWQIPX_wbeC4sdP50CSQogyAqqCQa8lA-MhkncfIqPcYj6Bp094F5pDIKkkbv23cKKc9Yb0WDYRbmqkbevDcvc6MG9j1aWITN25aI3No0BZ9QU0DsabwqzHqAuRYc3RHNx-jv7MMPVhhIHBElEZGlLYIQuJXrokAsgyWRyzsoMZBvbleBU_myCtoixqehJaAaWW7FqV-FhGDD37q2ELrBs3VA9167nnzLAkGKzeGRsIBkMwPAsNOfFLQuDCbONLGY01zdcfd3UBm89V8dvO5BpOCrwVWD9SLE_VQpUg9UMfho9n8erG4eHRF6XyS55xGonERJWlvRlVlWwn3KKF5A-gY4HYP7G5841XQeWRy9WE5vbw8Xa6up8uz0-vVZsN3gbfynNWa5axs2YoStu5WCVurh6p5h383uzhZHS-Wm4prWg_E14vLMdS64GO42yNQn13goSx2epuDbn9bRVYk3Thx27wwnM71XN_2K-Sy1Ep7l-VaAuHnxzBd3dKNz5Z-9BGOX11Mz65Wx4s3l9szR9FiARgqC01ijH4zhBmBJKEOVDSypRvKfshWBAQEZu7yooE9DeNWDK2IHMjMyHICjZUIZ1KzLH38PyEM0jXCz9qCLUGJH0QV9G0gUTQ0Lvd81Bp54tDcYlrFUayZ1qYyfM3QfzqoXWpP568Wy-PT1Xyxmk-vZ-9P99J-Pl2enM5n87PV6Xx6tEl8RBhiZavEpShAPb7UJO7vXm2Fkgh2XQoEwoywJAayVjiBisBUlIqsAcwhBTLloqwxrEnJtsLd51IoshYE1jHFHRAC9NLcScoGi5iWrTJgMTJYOtZ9gRO5C_biZLNIRg4jOKhT5du8pFzXfF3L8XUk24qiXewllWVBiqIAMDvzQyaayKSx2RCztXkknXhk-KzULN3Xww36ATgKUmnnoVXkEHVRS2SawKIgNq-coUkMuj8j2kj0n1j4P3e_y-PV9WJ5-mDLjwNv1EOVjSVhcfT6eHH5UT1UyyiDJe-3spN3by63MrQuRo74lIl8zwM9Psq_c688ghM02ClvzNxpGga91HS9kLSg46BtrbYqHmTjubPxx1n8vhmZ2bHX21lQmIFtUiOpCjOSuRk7XjbkMdqedJjGmqGPhfNJFr6_8j42QZs2AR5pqIkcylpjIDIEmTRE1YUJd8jGxPPQMC3sDBVenjuFw3mbwW5wpIkkapAXE_bwO8zn0viTVPTHDtHHVkTMA5rmDqKh7GPmOaKN7NSGvu1YHjeCeyvPoV_Y9AubfmHTP8umD1_6US_9qP_f_ajLi-nHD8vZ2fn16ur32eXqaLn4cHW6XJ0sPswvFtOTHYteTucXsyP1UBWAbSnW8nR6cnrxahRhgDCN1QP1avZpZFySDCPXulq8Gwn5yfT6dHV6uTgeaZRtuq5tBcZ4lbq6Xs7mG6I7EmO2IcCj7HInGdnX9embr93rxuHt931f1Pg6_lvwr7TrvocGPu1BfScRfGLgR6ncE0NZB6GVmkaa9nDw-zCzXKu3rLSKzEIAp9FYWZdaXLJaajDLNQnYSCkMw3lq67uJ4RMLLz3Qlx7oSw_0pQf60gN96YH-2h7ogbpayVqsYb0WGE3rWkj1UFUP1GhNKJoxvq73BZcpkFg9VP9QMExL5VbVfuLfrfrPW6bcWVI-TJfz2fzsUKlTrOCOyBoziJUyVuqUSGXzpR-RCitrJVkDAViNMdIfGZnVow5gCmE1FgxQhRSc4gKzGmy-jkS4BoQqcSkUnidSL_KrDbd5aOcXPdbmzd-UJYalQAqgVNlkUSGbvCpAKmLNalJgBWGOGcIMEiw36M1m-Oct-1O5XRuGjbe_lVv17-W6vlVv2d2UYPFLWsZwvK--oiDZTfd4TyDJWuzLEObyaPS5-fWc7FKUHCSgxo9Hr4FIcP2s8DnMeSnr8eep5DntrZ3HLvalT1DlcYphfvdhxmQNKH0gY_UUoRMiQUTxCebXAmzGRtpfYFmyvbwwUIyb4jNR1jBrNuKaNPjowUb6Mab8E42FH-0jKD_PqpVfwqfVA7Vc13_pDxH2vvDfonZJ337esuzdlPGxkI3v98ragcoFjrG4GE-PuyVubsR3q-focVW8H5o_M9vqgbpZEL9kh24snZfluAq35UH51jX1N_OW3TISK_9StGGsHQ_-luVWVf7nn2O1ZWPFIbECy6IADClao9zN6K76TBBuJmxNqWLdlyPLM-_hdyVLeeDit1v17__1jNn_HiuYomD6vFctEmUrsfg3eb8zvx_FvxStU27VyZRzSuDmrJCTs7JMKFaORxzWAeeT45LVmNVy8gbAxdVDhYf5_GJIP-diNB2TWzb-3LLdcfXNdfD3b2mMhrdZYN9YJzuXD5_qMeCWYSrxl9TvjnGJa303BVutC8LW3aECEFIY6cbz-W-fF2IpFLIt0_eLc0u7tJYg_NBQMabu8DPgQQ4nx3fwcVlI_GiGNobG7I5brkZjKX-we5OmCtOmYUXeiNzyiwgYWZZxnhleMLhup21B2qbRvbEhCKxPML8rCJuY1UN12xjf6f355_8GAAD___V7WAE=",
|
||||
"READELF": "readelf",
|
||||
"CHROME_DESKTOP": "code.desktop",
|
||||
"STARSHIP_SESSION_KEY": "5100215998796124",
|
||||
"NIX_USER_PROFILE_DIR": "/nix/var/nix/profiles/per-user/arch",
|
||||
"INFOPATH": "/home/arch/.local/share/flatpak/exports/info:/home/arch/.local/share/flatpak/exports/share/info:/var/lib/flatpak/exports/info:/var/lib/flatpak/exports/share/info:/home/arch/.nix-profile/info:/home/arch/.nix-profile/share/info:/nix/profile/info:/nix/profile/share/info:/home/arch/.local/state/nix/profile/info:/home/arch/.local/state/nix/profile/share/info:/etc/profiles/per-user/arch/info:/etc/profiles/per-user/arch/share/info:/nix/var/nix/profiles/default/info:/nix/var/nix/profiles/default/share/info:/run/current-system/sw/info:/run/current-system/sw/share/info",
|
||||
"doCheck": "",
|
||||
"GNOME_SETUP_DISPLAY": ":1",
|
||||
"depsBuildBuild": "",
|
||||
"XDG_SESSION_CLASS": "user",
|
||||
"COPILOT_OTEL_ENABLED": "true",
|
||||
"TERM": "xterm-256color",
|
||||
"LC_IDENTIFICATION": "zh_CN.UTF-8",
|
||||
"GTK_PATH": "/home/arch/.local/share/flatpak/exports/lib/gtk-2.0:/home/arch/.local/share/flatpak/exports/lib/gtk-3.0:/home/arch/.local/share/flatpak/exports/lib/gtk-4.0:/var/lib/flatpak/exports/lib/gtk-2.0:/var/lib/flatpak/exports/lib/gtk-3.0:/var/lib/flatpak/exports/lib/gtk-4.0:/home/arch/.nix-profile/lib/gtk-2.0:/home/arch/.nix-profile/lib/gtk-3.0:/home/arch/.nix-profile/lib/gtk-4.0:/nix/profile/lib/gtk-2.0:/nix/profile/lib/gtk-3.0:/nix/profile/lib/gtk-4.0:/home/arch/.local/state/nix/profile/lib/gtk-2.0:/home/arch/.local/state/nix/profile/lib/gtk-3.0:/home/arch/.local/state/nix/profile/lib/gtk-4.0:/etc/profiles/per-user/arch/lib/gtk-2.0:/etc/profiles/per-user/arch/lib/gtk-3.0:/etc/profiles/per-user/arch/lib/gtk-4.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-4.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0:/run/current-system/sw/lib/gtk-4.0",
|
||||
"SIZE": "size",
|
||||
"propagatedNativeBuildInputs": "",
|
||||
"strictDeps": "",
|
||||
"USER": "arch",
|
||||
"TZDIR": "/etc/zoneinfo",
|
||||
"NIX_LD": "/run/current-system/sw/share/nix-ld/lib/ld.so",
|
||||
"AR": "ar",
|
||||
"AS": "as",
|
||||
"TEMP": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu": "1",
|
||||
"DISPLAY": ":0",
|
||||
"VSCODE_PID": "4067",
|
||||
"SHLVL": "2",
|
||||
"NIX_BUILD_TOP": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"NM": "nm",
|
||||
"__HM_ZSH_SESS_VARS_SOURCED": "1",
|
||||
"PAGER": "less",
|
||||
"NIX_CFLAGS_COMPILE": " -frandom-seed=0r1baggl4c -isystem /nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/include -isystem /nix/store/cwidg78bqc73asdbzv5p67dw0kg4lk2n-qpdf-12.3.2/include -isystem /nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/include -isystem /nix/store/cwidg78bqc73asdbzv5p67dw0kg4lk2n-qpdf-12.3.2/include",
|
||||
"LC_TELEPHONE": "zh_CN.UTF-8",
|
||||
"QTWEBKIT_PLUGIN_PATH": "/home/arch/.local/share/flatpak/exports/lib/mozilla/plugins/:/var/lib/flatpak/exports/lib/mozilla/plugins/:/home/arch/.nix-profile/lib/mozilla/plugins/:/nix/profile/lib/mozilla/plugins/:/home/arch/.local/state/nix/profile/lib/mozilla/plugins/:/etc/profiles/per-user/arch/lib/mozilla/plugins/:/nix/var/nix/profiles/default/lib/mozilla/plugins/:/run/current-system/sw/lib/mozilla/plugins/",
|
||||
"patches": "",
|
||||
"QT_IM_MODULE": "fcitx",
|
||||
"APPLICATIONINSIGHTS_CONFIGURATION_CONTENT": "{}",
|
||||
"LC_MEASUREMENT": "zh_CN.UTF-8",
|
||||
"__NIXOS_SET_ENVIRONMENT_DONE": "1",
|
||||
"VSCODE_CWD": "/home/arch/Projects/wpep/tools/gp",
|
||||
"buildInputs": "",
|
||||
"DBUS_STARTER_ADDRESS": "unix:path=/run/user/1000/bus,guid=df5051e64effbfdd124009b669f232d4",
|
||||
"preferLocalBuild": "1",
|
||||
"LOCALE_ARCHIVE": "/run/current-system/sw/lib/locale/locale-archive",
|
||||
"MANAGERPIDFDID": "2238",
|
||||
"LESSKEYIN_SYSTEM": "/nix/store/ndjvymnavjb3xy2h54aci8cd2nmir587-lessconfig",
|
||||
"TERMINFO_DIRS": "/home/arch/.local/share/flatpak/exports/share/terminfo:/var/lib/flatpak/exports/share/terminfo:/home/arch/.nix-profile/share/terminfo:/nix/profile/share/terminfo:/home/arch/.local/state/nix/profile/share/terminfo:/etc/profiles/per-user/arch/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/run/current-system/sw/share/terminfo",
|
||||
"FC_FONTATIONS": "1",
|
||||
"LD_LIBRARY_PATH": "/nix/store/pcjb2l7xad0c9j25g4h9xd9pirchvl2m-libdbusmenu-glib-16.04.0/lib:/nix/store/dzpjlkm1r63x8jwyswqp6wfsr87hcv3g-pipewire-1.6.2-jack/lib",
|
||||
"VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
|
||||
"XDG_RUNTIME_DIR": "/run/user/1000",
|
||||
"depsBuildTarget": "",
|
||||
"OBJCOPY": "objcopy",
|
||||
"NIX_XDG_DESKTOP_PORTAL_DIR": "/run/current-system/sw/share/xdg-desktop-portal/portals",
|
||||
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT": "true",
|
||||
"out": "/home/arch/Projects/wpep/tools/gp/outputs/out",
|
||||
"LC_TIME": "zh_CN.UTF-8",
|
||||
"ELECTRON_NO_ATTACH_CONSOLE": "1",
|
||||
"STRIP": "strip",
|
||||
"XDG_DATA_DIRS": "/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/share:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/share:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/share:/nix/store/jxcc2h10hhycz7y9j252y22hqb1mra4v-noto-fonts-cjk-sans-2.004/share:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/share:/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/share:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/share:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/share:/nix/store/jxcc2h10hhycz7y9j252y22hqb1mra4v-noto-fonts-cjk-sans-2.004/share:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/share:/nix/store/a519p3wlmvdxq0cl4y7yyazqp59s8vyi-vscode-1.115.0/share:/nix/store/xsfc5fcy12nmcdsdwm3dx1xfffh7xv30-gsettings-desktop-schemas-49.1/share/gsettings-schemas/gsettings-desktop-schemas-49.1:/nix/store/yl5yl395iqx88kd1m7lx7p7b65n0jfx9-gtk+3-3.24.51/share/gsettings-schemas/gtk+3-3.24.51:/nix/store/0a9dfj9jfly51kxb83sa2vxi1yhaq21k-gnome-console-49.2/share:/nix/store/hjp25ksf3axb4czp7sllvzl1bkpfwsyg-gtk4-4.20.3/share/gsettings-schemas/gtk4-4.20.3:/nix/store/0a9dfj9jfly51kxb83sa2vxi1yhaq21k-gnome-console-49.2/share/gsettings-schemas/gnome-console-49.2:/nix/store/mfldimj0vmpvdrvsaj3qzs58j77zclzp-gnome-session-49.2/share:/nix/store/xsfc5fcy12nmcdsdwm3dx1xfffh7xv30-gsettings-desktop-schemas-49.1/share/gsettings-schemas/gsettings-desktop-schemas-49.1:/nix/store/hjp25ksf3axb4czp7sllvzl1bkpfwsyg-gtk4-4.20.3/share/gsettings-schemas/gtk4-4.20.3:/nix/store/zh9bq7ndr6gxx6hagc57c8mdrpdjp0v0-gnome-settings-daemon-49.1/share/gsettings-schemas/gnome-settings-daemon-49.1:/nix/store/mfldimj0vmpvdrvsaj3qzs58j77zclzp-gnome-session-49.2/share/gsettings-schemas/gnome-session-49.2:/nix/store/dr93lr6l45iklnwzk2lwwz6zz4g7y1px-gnome-mimeapps/share:/nix/store/03cjba5zlvhj3f20xlw2hbnl9ijm6988-desktops/share:/home/arch/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/home/arch/.nix-profile/share:/nix/profile/share:/home/arch/.local/state/nix/profile/share:/etc/profiles/per-user/arch/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share:/nix/store/k1rwg4y0hvnmq402b136svp6mhmbk365-gnome-shell-49.4/share/gsettings-schemas/gnome-shell-49.4:/nix/store/k1rwg4y0hvnmq402b136svp6mhmbk365-gnome-shell-49.4/share",
|
||||
"GDK_BACKEND": "wayland",
|
||||
"LIBEXEC_PATH": "/home/arch/.local/share/flatpak/exports/libexec:/var/lib/flatpak/exports/libexec:/home/arch/.nix-profile/libexec:/nix/profile/libexec:/home/arch/.local/state/nix/profile/libexec:/etc/profiles/per-user/arch/libexec:/nix/var/nix/profiles/default/libexec:/run/current-system/sw/libexec",
|
||||
"TMP": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"OBJDUMP": "objdump",
|
||||
"PATH": "/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/bin:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/bin:/nix/store/idz3hpv1k4vvnc6h1569iwaxpaww2wqm-qpdf-12.3.2-bin/bin:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/bin:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/bin:/nix/store/hb2bs5fg5wkm04x565737qd5nh2hy5nk-gcc-wrapper-15.2.0/bin:/nix/store/lvwga6ivl1d4lnw0zis9ajs0rqx9gp4i-gcc-15.2.0/bin:/nix/store/9hm3jdm6kk4m4ppwjcxz4s1dsdvd6fin-glibc-2.42-51-bin/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/x7ikkplbrv5dlihy1bqq32gp6lilkval-binutils-wrapper-2.44/bin:/nix/store/rfp8lhk4dl9syfn64rwb3h3c73426p08-binutils-2.44/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/c89zz4vh8v9dbs8169wk8ahwxvrdxgm5-findutils-4.10.0/bin:/nix/store/355mp4ns4042sb5p51rx3ys4mlliiwc5-diffutils-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/kvmqv1jqv4792rsihf7yjc5kwk3d8z6x-gnutar-1.35/bin:/nix/store/pnxiz967z73a45f4x7c1icldjaaqmlcp-gzip-1.14/bin:/nix/store/by6npbc13ly5a1zgsqghv7wv5bklyiny-bzip2-1.0.8-bin/bin:/nix/store/1fvcxyhg3i5fvw0j4l8wmyml10dnvm7q-gnumake-4.4.1/bin:/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin:/nix/store/ca84rbhb0bhwdcci7q51dad20nkbn9xc-patch-2.8/bin:/nix/store/g6mlwdvpg92rchq352ll7jbi0pz7h43r-xz-5.8.2-bin/bin:/nix/store/kjg8z2k0zvsczaij78803g7imlfm1vfb-file-5.45/bin:/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/bin:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/bin:/nix/store/idz3hpv1k4vvnc6h1569iwaxpaww2wqm-qpdf-12.3.2-bin/bin:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/bin:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/bin:/nix/store/hb2bs5fg5wkm04x565737qd5nh2hy5nk-gcc-wrapper-15.2.0/bin:/nix/store/lvwga6ivl1d4lnw0zis9ajs0rqx9gp4i-gcc-15.2.0/bin:/nix/store/9hm3jdm6kk4m4ppwjcxz4s1dsdvd6fin-glibc-2.42-51-bin/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/x7ikkplbrv5dlihy1bqq32gp6lilkval-binutils-wrapper-2.44/bin:/nix/store/rfp8lhk4dl9syfn64rwb3h3c73426p08-binutils-2.44/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/c89zz4vh8v9dbs8169wk8ahwxvrdxgm5-findutils-4.10.0/bin:/nix/store/355mp4ns4042sb5p51rx3ys4mlliiwc5-diffutils-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/kvmqv1jqv4792rsihf7yjc5kwk3d8z6x-gnutar-1.35/bin:/nix/store/pnxiz967z73a45f4x7c1icldjaaqmlcp-gzip-1.14/bin:/nix/store/by6npbc13ly5a1zgsqghv7wv5bklyiny-bzip2-1.0.8-bin/bin:/nix/store/1fvcxyhg3i5fvw0j4l8wmyml10dnvm7q-gnumake-4.4.1/bin:/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin:/nix/store/ca84rbhb0bhwdcci7q51dad20nkbn9xc-patch-2.8/bin:/nix/store/g6mlwdvpg92rchq352ll7jbi0pz7h43r-xz-5.8.2-bin/bin:/nix/store/kjg8z2k0zvsczaij78803g7imlfm1vfb-file-5.45/bin:/nix/store/hak3031i8bpmvdqfla85q6q3bgwqppb0-glib-2.86.3-bin/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/qnnigprif5vrj9c0bkpj6w0nd46fm3mm-which-2.23/bin:/nix/store/wfgphlpnrrvc1h6cjdaqlpp7x6ryd8vx-getconf-glibc-2.42-51/bin:/run/wrappers/bin:/home/arch/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/home/arch/.nix-profile/bin:/nix/profile/bin:/home/arch/.local/state/nix/profile/bin:/etc/profiles/per-user/arch/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin",
|
||||
"propagatedBuildInputs": "",
|
||||
"dontAddDisableDepTrack": "1",
|
||||
"GDMSESSION": "gnome",
|
||||
"CC": "gcc",
|
||||
"NIX_CC": "/nix/store/hb2bs5fg5wkm04x565737qd5nh2hy5nk-gcc-wrapper-15.2.0",
|
||||
"APPLICATION_INSIGHTS_NO_STATSBEAT": "true",
|
||||
"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus,guid=df5051e64effbfdd124009b669f232d4",
|
||||
"depsBuildTargetPropagated": "",
|
||||
"depsBuildBuildPropagated": "",
|
||||
"DIRENV_WATCHES": "eJyc0EtOwzAURuG9eFzVuXb86iqYIwbXzm8S6sZRYtoixN4ZwqBFqBs4-nSeP8XCbRQHIcd6guQ1jfJprW9IbZOXBYtstZZNvi5yj_m8JrETpzq06QRxIOdc77ve2p3AddraJg5tfcfX7lZ2X2riIreRV8hhWjGfJZdSL1LDa5eoj0bbaJ0BlAF5-KTgndN9B61i9CH0hlKCYhUs6ZA9chfplsmQetQ0YP6QWsXkQKSIvCLls2byNrhucBFBs4nGUepATJZ6m0NIMWdjicHO5vyb1P1IMpftDuXO9Vz4iP08XR8f_2e51HT8V_rlOwAA__9XtbLx",
|
||||
"VSCODE_NLS_CONFIG": "{\"userLocale\":\"zh-cn\",\"osLocale\":\"zh-cn\",\"resolvedLanguage\":\"zh-cn\",\"defaultMessagesFile\":\"/nix/store/a519p3wlmvdxq0cl4y7yyazqp59s8vyi-vscode-1.115.0/lib/vscode/resources/app/out/nls.messages.json\",\"languagePack\":{\"translationsConfigFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/tcf.json\",\"messagesFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/41dd792b5e652393e7787322889ed5fdc58bd75b/nls.messages.json\",\"corruptMarkerFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/corrupted.info\"},\"locale\":\"zh-cn\",\"availableLanguages\":{\"*\":\"zh-cn\"},\"_languagePackId\":\"b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn\",\"_languagePackSupport\":true,\"_translationsConfigFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/tcf.json\",\"_cacheRoot\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn\",\"_resolvedLanguagePackCoreLocation\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/41dd792b5e652393e7787322889ed5fdc58bd75b\",\"_corruptedFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/corrupted.info\"}",
|
||||
"NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu": "1",
|
||||
"QT_PLUGIN_PATH": "/nix/store/zi0yx7hlacqsnf6i5jqys4ybx53zzan2-fcitx5-with-addons-5.1.19/lib/qt-6/plugins",
|
||||
"CONFIG_SHELL": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"__structuredAttrs": "",
|
||||
"RANLIB": "ranlib",
|
||||
"NIX_HARDENING_ENABLE": "bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs",
|
||||
"VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
|
||||
"LC_NUMERIC": "zh_CN.UTF-8",
|
||||
"OLDPWD": "",
|
||||
"NIX_LDFLAGS": "-rpath /home/arch/Projects/wpep/tools/gp/outputs/out/lib -L/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/lib -L/nix/store/b8hs3k92mkcdxbwishgcmmi3pq4zvg0l-qpdf-12.3.2-lib/lib -L/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/lib -L/nix/store/b8hs3k92mkcdxbwishgcmmi3pq4zvg0l-qpdf-12.3.2-lib/lib",
|
||||
"nativeBuildInputs": "/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9 /nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2 /nix/store/cwidg78bqc73asdbzv5p67dw0kg4lk2n-qpdf-12.3.2 /nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55 /nix/store/jxcc2h10hhycz7y9j252y22hqb1mra4v-noto-fonts-cjk-sans-2.004",
|
||||
"COPILOT_OTEL_EXPORTER_TYPE": "file",
|
||||
"name": "nix-shell-env",
|
||||
"TERM_PROGRAM": "kgx",
|
||||
"depsHostHostPropagated": ""
|
||||
},
|
||||
"terminal.integrated.env.osx": {
|
||||
"PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD": "1",
|
||||
"CHROMIUM_PATH": "/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/bin/chromium",
|
||||
"SHELL": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"__HM_SESS_VARS_SOURCED": "1",
|
||||
"COLORTERM": "truecolor",
|
||||
"XDG_CONFIG_DIRS": "/etc/xdg:/home/arch/.local/share/flatpak/exports/etc/xdg:/var/lib/flatpak/exports/etc/xdg:/home/arch/.nix-profile/etc/xdg:/nix/profile/etc/xdg:/home/arch/.local/state/nix/profile/etc/xdg:/etc/profiles/per-user/arch/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg:/nix/store/zh9bq7ndr6gxx6hagc57c8mdrpdjp0v0-gnome-settings-daemon-49.1/etc/xdg",
|
||||
"NIX_LD_LIBRARY_PATH": "/run/current-system/sw/share/nix-ld/lib",
|
||||
"NIX_BUILD_CORES": "12",
|
||||
"NIX_GCROOT": "/nix/store/0r1baggl4cim2yv1my7xv6ylwhj8jjlh-nix-shell-env",
|
||||
"XDG_MENU_PREFIX": "gnome-",
|
||||
"TERM_PROGRAM_VERSION": "49.2",
|
||||
"GTK_IM_MODULE": "fcitx",
|
||||
"configureFlags": "",
|
||||
"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "1",
|
||||
"mesonFlags": "",
|
||||
"shell": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"depsHostHost": "",
|
||||
"LC_ADDRESS": "zh_CN.UTF-8",
|
||||
"LC_NAME": "zh_CN.UTF-8",
|
||||
"SSH_AUTH_SOCK": "/run/user/1000/gcr/ssh",
|
||||
"DIRENV_DIR": "-/home/arch/Projects/wpep/tools/gp",
|
||||
"STRINGS": "strings",
|
||||
"depsTargetTarget": "",
|
||||
"XCURSOR_PATH": "/home/arch/.icons:/home/arch/.local/share/icons:/home/arch/.local/share/flatpak/exports/share/icons:/home/arch/.local/share/flatpak/exports/share/pixmaps:/var/lib/flatpak/exports/share/icons:/var/lib/flatpak/exports/share/pixmaps:/home/arch/.nix-profile/share/icons:/home/arch/.nix-profile/share/pixmaps:/nix/profile/share/icons:/nix/profile/share/pixmaps:/home/arch/.local/state/nix/profile/share/icons:/home/arch/.local/state/nix/profile/share/pixmaps:/etc/profiles/per-user/arch/share/icons:/etc/profiles/per-user/arch/share/pixmaps:/nix/var/nix/profiles/default/share/icons:/nix/var/nix/profiles/default/share/pixmaps:/run/current-system/sw/share/icons:/run/current-system/sw/share/pixmaps",
|
||||
"MEMORY_PRESSURE_WRITE": "c29tZSAyMDAwMDAgMjAwMDAwMAA=",
|
||||
"ELECTRON_RUN_AS_NODE": "1",
|
||||
"stdenv": "/nix/store/gvq9hvvnmkvrk27mba0jjjppj068z55x-stdenv-linux",
|
||||
"LOCALE_ARCHIVE_2_27": "/nix/store/s7627r57hh0hyb4ik6d92ms5zzclrawp-glibc-locales-2.42-51/lib/locale/locale-archive",
|
||||
"builder": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"XMODIFIERS": "@im=fcitx",
|
||||
"DESKTOP_SESSION": "gnome",
|
||||
"LC_MONETARY": "zh_CN.UTF-8",
|
||||
"GDK_PIXBUF_MODULE_FILE": "/nix/store/kn9lwgvdaa94nl9nsxx5p198gry21n03-librsvg-2.61.4/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache",
|
||||
"shellHook": "export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1",
|
||||
" export CHROMIUM_PATH": "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"",
|
||||
"echo \"PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD": "$PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD\"",
|
||||
" echo \"CHROMIUM_PATH": "$CHROMIUM_PATH\"",
|
||||
"NO_AT_BRIDGE": "1",
|
||||
"DIRENV_FILE": "/home/arch/Projects/wpep/tools/gp/.envrc",
|
||||
"EDITOR": "nano",
|
||||
"phases": "buildPhase",
|
||||
"DBUS_STARTER_BUS_TYPE": "session",
|
||||
"NAUTILUS_4_EXTENSION_DIR": "/nix/store/58b287bvfpkzf5gif1xz5bippfkd7f66-system-path/lib/nautilus/extensions-4",
|
||||
"PWD": "/home/arch/Projects/wpep/tools/gp",
|
||||
"NIX_PROFILES": "/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/arch /home/arch/.local/state/nix/profile /nix/profile /home/arch/.nix-profile /var/lib/flatpak/exports /home/arch/.local/share/flatpak/exports",
|
||||
"NIX_GSETTINGS_OVERRIDES_DIR": "/nix/store/pw378mnm4z97k9vj6kmg0qab9zbnwf47-gnome-gsettings-overrides/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas",
|
||||
"SOURCE_DATE_EPOCH": "315532800",
|
||||
"XDG_SESSION_DESKTOP": "gnome",
|
||||
"LOGNAME": "arch",
|
||||
"XDG_SESSION_TYPE": "wayland",
|
||||
"NIX_ENFORCE_NO_NATIVE": "1",
|
||||
"CUPS_DATADIR": "/nix/store/yflb7rc8rasa1pfvqkm3dp1z69vz2ba9-cups-progs/share/cups",
|
||||
"NIX_PATH": "/home/arch/.nix-defexpr/channels:nixpkgs=flake:nixpkgs:/nix/var/nix/profiles/per-user/root/channels",
|
||||
"COPILOT_OTEL_FILE_EXPORTER_PATH": "/dev/null",
|
||||
"VSCODE_ESM_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess",
|
||||
"SYSTEMD_EXEC_PID": "2256",
|
||||
"VSCODE_CODE_CACHE_PATH": "/home/arch/.config/Code/CachedData/41dd792b5e652393e7787322889ed5fdc58bd75b",
|
||||
"NIXPKGS_CONFIG": "/etc/nix/nixpkgs-config.nix",
|
||||
"CXX": "g++",
|
||||
"XAUTHORITY": "/run/user/1000/.mutter-Xwaylandauth.5ZVIO3",
|
||||
"TEMPDIR": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"system": "x86_64-linux",
|
||||
"HOST_PATH": "/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/c89zz4vh8v9dbs8169wk8ahwxvrdxgm5-findutils-4.10.0/bin:/nix/store/355mp4ns4042sb5p51rx3ys4mlliiwc5-diffutils-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/kvmqv1jqv4792rsihf7yjc5kwk3d8z6x-gnutar-1.35/bin:/nix/store/pnxiz967z73a45f4x7c1icldjaaqmlcp-gzip-1.14/bin:/nix/store/by6npbc13ly5a1zgsqghv7wv5bklyiny-bzip2-1.0.8-bin/bin:/nix/store/1fvcxyhg3i5fvw0j4l8wmyml10dnvm7q-gnumake-4.4.1/bin:/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin:/nix/store/ca84rbhb0bhwdcci7q51dad20nkbn9xc-patch-2.8/bin:/nix/store/g6mlwdvpg92rchq352ll7jbi0pz7h43r-xz-5.8.2-bin/bin:/nix/store/kjg8z2k0zvsczaij78803g7imlfm1vfb-file-5.45/bin",
|
||||
"GDM_LANG": "zh_CN.UTF-8",
|
||||
"IN_NIX_SHELL": "impure",
|
||||
"doInstallCheck": "",
|
||||
"GI_TYPELIB_PATH": "/nix/store/d864rlg855kf2hnnnfdzcx54grp8n10x-glib-2.86.3/lib/girepository-1.0:/nix/store/argh931zkmvlr78nkwxz45c6y49dnri0-gdk-pixbuf-2.44.5/lib/girepository-1.0:/nix/store/1h06bl72cj25gmv34cazvkixnvysj9q2-graphene-1.10.8/lib/girepository-1.0:/nix/store/bicq9gpqf10dx09li6q0pxd73wc5yx2x-harfbuzz-12.3.0/lib/girepository-1.0:/nix/store/apbb9j812kbr57qw1f1dgrqxf4gzbd3m-pango-1.57.0/lib/girepository-1.0:/nix/store/xsfc5fcy12nmcdsdwm3dx1xfffh7xv30-gsettings-desktop-schemas-49.1/lib/girepository-1.0:/nix/store/hjp25ksf3axb4czp7sllvzl1bkpfwsyg-gtk4-4.20.3/lib/girepository-1.0:/nix/store/kn9lwgvdaa94nl9nsxx5p198gry21n03-librsvg-2.61.4/lib/girepository-1.0:/nix/store/sf2lb971dqfwf326qddixn3yanc53nl0-gnome-desktop-44.5/lib/girepository-1.0:/nix/store/r9krxd5xlwggdj8997yvqyizscaa2x8y-json-glib-1.10.8/lib/girepository-1.0",
|
||||
"HOME": "/home/arch",
|
||||
"USERNAME": "arch",
|
||||
"NIX_BINTOOLS": "/nix/store/x7ikkplbrv5dlihy1bqq32gp6lilkval-binutils-wrapper-2.44",
|
||||
"LC_PAPER": "zh_CN.UTF-8",
|
||||
"LANG": "zh_CN.UTF-8",
|
||||
"LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.7z=01;31:*.ace=01;31:*.alz=01;31:*.apk=01;31:*.arc=01;31:*.arj=01;31:*.bz=01;31:*.bz2=01;31:*.cab=01;31:*.cpio=01;31:*.crate=01;31:*.deb=01;31:*.drpm=01;31:*.dwm=01;31:*.dz=01;31:*.ear=01;31:*.egg=01;31:*.esd=01;31:*.gz=01;31:*.jar=01;31:*.lha=01;31:*.lrz=01;31:*.lz=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.lzo=01;31:*.pyz=01;31:*.rar=01;31:*.rpm=01;31:*.rz=01;31:*.sar=01;31:*.swm=01;31:*.t7z=01;31:*.tar=01;31:*.taz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tgz=01;31:*.tlz=01;31:*.txz=01;31:*.tz=01;31:*.tzo=01;31:*.tzst=01;31:*.udeb=01;31:*.war=01;31:*.whl=01;31:*.wim=01;31:*.xz=01;31:*.z=01;31:*.zip=01;31:*.zoo=01;31:*.zst=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.jxl=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",
|
||||
"XDG_CURRENT_DESKTOP": "GNOME",
|
||||
"depsTargetTargetPropagated": "",
|
||||
"VSCODE_DOTNET_INSTALL_TOOL_ORIGINAL_HOME": "/home/arch",
|
||||
"VSCODE_IPC_HOOK": "/run/user/1000/vscode-2fafacbe-1.11-main.sock",
|
||||
"MEMORY_PRESSURE_WATCH": "/sys/fs/cgroup/user.slice/user-1000.slice/[email protected]/session.slice/dbus.service/memory.pressure",
|
||||
"STARSHIP_SHELL": "zsh",
|
||||
"VTE_VERSION": "8203",
|
||||
"WAYLAND_DISPLAY": "wayland-0",
|
||||
"cmakeFlags": "",
|
||||
"STARSHIP_CONFIG": "/home/arch/.config/starship.toml",
|
||||
"outputs": "out",
|
||||
"GIO_EXTRA_MODULES": "/nix/store/y8dqwhsf4bvggqawlv7zia65lbr8rp51-dconf-0.49.0-lib/lib/gio/modules:/nix/store/jhx50gyrf0zr45xxvdl11z4jlkky05my-gvfs-1.58.4/lib/gio/modules:/nix/store/yd01p9dyhm7p06wrsjz1zpqg063b4jfs-glib-networking-2.80.1/lib/gio/modules:GTK_PATH=/home/arch/.local/share/flatpak/exports/lib/gtk-2.0:/home/arch/.local/share/flatpak/exports/lib/gtk-3.0:/home/arch/.local/share/flatpak/exports/lib/gtk-4.0:/var/lib/flatpak/exports/lib/gtk-2.0:/var/lib/flatpak/exports/lib/gtk-3.0:/var/lib/flatpak/exports/lib/gtk-4.0:/home/arch/.nix-profile/lib/gtk-2.0:/home/arch/.nix-profile/lib/gtk-3.0:/home/arch/.nix-profile/lib/gtk-4.0:/nix/profile/lib/gtk-2.0:/nix/profile/lib/gtk-3.0:/nix/profile/lib/gtk-4.0:/home/arch/.local/state/nix/profile/lib/gtk-2.0:/home/arch/.local/state/nix/profile/lib/gtk-3.0:/home/arch/.local/state/nix/profile/lib/gtk-4.0:/etc/profiles/per-user/arch/lib/gtk-2.0:/etc/profiles/per-user/arch/lib/gtk-3.0:/etc/profiles/per-user/arch/lib/gtk-4.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-4.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0:/run/current-system/sw/lib/gtk-4.0",
|
||||
"VSCODE_CLI": "1",
|
||||
"NIX_STORE": "/nix/store",
|
||||
"TMPDIR": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"VSCODE_L10N_BUNDLE_LOCATION": "file:///home/arch/.vscode/extensions/ms-ceintl.vscode-language-pack-zh-hans-1.110.2026041514/translations/extensions/vscode.html-language-features.i18n.json",
|
||||
"LD": "ld",
|
||||
"buildPhase": "{ echo \"------------------------------------------------------------\";",
|
||||
"MANAGERPID": "2237",
|
||||
"DIRENV_DIFF": "eJzsWnlz2zqS_yoszvyxW2NSvA9PvT_kI7byHMmRncTJeEsFAiAJEgRBgOL16n33LUpyLB9JXo7Zqa1yKrakRv-6mw2g8YPaf6hcPfxDvZxen6uH6oSRbiLrUuBJCnLbsE0SRLxoUBVTELiVV9lR0lacR4aWUBJplh54uq1FhE0iwg738EliemHeE-o2qUxcUEEOkj6VQdxSQ7hCS0Cba65u69ZjaOqlKEryOHVDxv2I-GlQAd_jleWTbgiElrB1IjDXbN18As64rHrHF4gamYGavh8iJ2-DpAJZG7DOGMESI83Rw8dQ35GEIRN5TWxFcYv8PqdJAFPZDFVXFJUGS4HXNaFSC3XTeAyvGCMJFyR2G5GF0IhynnmtwZDjxYVdFFqbEphqlm7Zj6FtnPCUciZEA83UgxkCFeXc7zzRo6DptATXsGTxJulQs3TH0lxza0Ws2aQVgHMs5FaSlgWeAAHTiU5LCOhEpkDgSUxBzUE-wR0vRb3TbYCYUBI9P7hniJFO46KMCcX3wT8QPPVagxo_1cM1vBPICcdCW0sstsDPhseo9oBygnAM1rS-f2K4FgKzWpO9rHExke04pB6oNydnq5Pp9XR1MltePVzRwDVDbre0aFBXGZA6vd_3YKi4G8qg6YnWSFgirJm6abq6sc3a_ix1MoZuDHvTYgVEErWFjTqzi-M49bvGNrRE4romLJEawjKvS65JmOICSM0JdXM3DfdKu8HJ12H7EfTU7akduqTqgiBHZuHTzud-5LnMyOIu1JI6_4et2brl6O5XHO5r7ds3QIjiLMxi2rtm3kWBLYHVdMTsU1BZZq4lrCywBksmS4rH8KynaUozbrm5jG3QRQ4cuC8pbQZqRjmPW9knY5CO5uiWodtfC_FO55cE-JyLJ6r7noqYIlJkRlPwBolGgsyuBukGme8PkA5850liKUnJvpCK__yK-XdOxpCGUeUzJLyk67wUJND1YVAgwVHGjcb4nKK7WAEutqn6ypN9EfJLJucrHu9V9z0hEdpUeNRxSU5ZO-QWbdvBGwYn8XuTdztPBSkw4Fw-XQKGDbMIuANt0syOLaOjrZVGjIYkK7wwCO5m8DP0L1bvnfaX6vdTY_sVfC_KR6K_UMV3ml-p43vmv1jJdzrP1_InWcxN0SZOb6QNKyrHsCLT9mTDvSItotz23LsJTzGl4xw635ruz4q_wIv654HKRhY1XaqHKhDqgTodzx4g1QP1-Fg9VBMIx7fny8Wb2bs3q6dsy7Q7bhZJB1sbmr20TJSHiLuw6N1YDn6rwVSUBVkXmun4uqH7vuXrrjseepO7odHDYv5qdra6Oj-9uHjooAkk8IRXGbZP0iTt4qgdsszhbthYncEbLQIyHekY39CiyfhxNHhzM4b_j3-oB-rJbHk6fz8erOqhqu2tlEtRZhjWctJyzCd1WVI5Sfg94tXs4nSM5luIiY5ZI-A98MP0-vj8dEwlft1D47RetMP03XJ9FuJXw_v1TRR4pPo4a6OboQiuPPlp-bEuSTd3PrXV0avqSDoau8KXwc1xtHx7PoPIS9ZvzSx-zcWHcBZ9Wtwcfaxl_enTvCFun62K4LU4veZDZXhvl91sgaDvN9ji9hQhAV4nbh3D-Mann6wbS5CZwMv3QZp-yM7i15_Q1YV5cQJcXGZGFIHXxhGdvnK1368ThubhkWeS8PjcSOnvxx_Td9L7NA1hGnMqi7e4fmt8vPTefpA3-dvfr2bN8QWVVtTPRbqGR6-OpMPO3mE-vX79ySuM-ezNB5QReL5wmz4yL83ZGx7XJ-ubRfh-cMilEdwsg3hlYdc8vw7erwRdtNPpahXe1NFFpx6o54ur62dW4E-SXxiEw-A0adCEKJKB6YVtHoC07RqBuqRwtZgwtIU7umnoTwzYrltwh0nHcCwZudw1RWf30ikoJaSFroZIHG8N_GLa_1PXjZ-45uRNUTVmVjWOH1pCkjT2-wy6eZvbKBi88WhZ10Bopm67j7GcdWQIPX_wbeC4sdP50CSQogyAqqCQa8lA-MhkncfIqPcYj6Bp094F5pDIKkkbv23cKKc9Yb0WDYRbmqkbevDcvc6MG9j1aWITN25aI3No0BZ9QU0DsabwqzHqAuRYc3RHNx-jv7MMPVhhIHBElEZGlLYIQuJXrokAsgyWRyzsoMZBvbleBU_myCtoixqehJaAaWW7FqV-FhGDD37q2ELrBs3VA9167nnzLAkGKzeGRsIBkMwPAsNOfFLQuDCbONLGY01zdcfd3UBm89V8dvO5BpOCrwVWD9SLE_VQpUg9UMfho9n8erG4eHRF6XyS55xGonERJWlvRlVlWwn3KKF5A-gY4HYP7G5841XQeWRy9WE5vbw8Xa6up8uz0-vVZsN3gbfynNWa5axs2YoStu5WCVurh6p5h383uzhZHS-Wm4prWg_E14vLMdS64GO42yNQn13goSx2epuDbn9bRVYk3Thx27wwnM71XN_2K-Sy1Ep7l-VaAuHnxzBd3dKNz5Z-9BGOX11Mz65Wx4s3l9szR9FiARgqC01ijH4zhBmBJKEOVDSypRvKfshWBAQEZu7yooE9DeNWDK2IHMjMyHICjZUIZ1KzLH38PyEM0jXCz9qCLUGJH0QV9G0gUTQ0Lvd81Bp54tDcYlrFUayZ1qYyfM3QfzqoXWpP568Wy-PT1Xyxmk-vZ-9P99J-Pl2enM5n87PV6Xx6tEl8RBhiZavEpShAPb7UJO7vXm2Fkgh2XQoEwoywJAayVjiBisBUlIqsAcwhBTLloqwxrEnJtsLd51IoshYE1jHFHRAC9NLcScoGi5iWrTJgMTJYOtZ9gRO5C_biZLNIRg4jOKhT5du8pFzXfF3L8XUk24qiXewllWVBiqIAMDvzQyaayKSx2RCztXkknXhk-KzULN3Xww36ATgKUmnnoVXkEHVRS2SawKIgNq-coUkMuj8j2kj0n1j4P3e_y-PV9WJ5-mDLjwNv1EOVjSVhcfT6eHH5UT1UyyiDJe-3spN3by63MrQuRo74lIl8zwM9Psq_c688ghM02ClvzNxpGga91HS9kLSg46BtrbYqHmTjubPxx1n8vhmZ2bHX21lQmIFtUiOpCjOSuRk7XjbkMdqedJjGmqGPhfNJFr6_8j42QZs2AR5pqIkcylpjIDIEmTRE1YUJd8jGxPPQMC3sDBVenjuFw3mbwW5wpIkkapAXE_bwO8zn0viTVPTHDtHHVkTMA5rmDqKh7GPmOaKN7NSGvu1YHjeCeyvPoV_Y9AubfmHTP8umD1_6US_9qP_f_ajLi-nHD8vZ2fn16ur32eXqaLn4cHW6XJ0sPswvFtOTHYteTucXsyP1UBWAbSnW8nR6cnrxahRhgDCN1QP1avZpZFySDCPXulq8Gwn5yfT6dHV6uTgeaZRtuq5tBcZ4lbq6Xs7mG6I7EmO2IcCj7HInGdnX9embr93rxuHt931f1Pg6_lvwr7TrvocGPu1BfScRfGLgR6ncE0NZB6GVmkaa9nDw-zCzXKu3rLSKzEIAp9FYWZdaXLJaajDLNQnYSCkMw3lq67uJ4RMLLz3Qlx7oSw_0pQf60gN96YH-2h7ogbpayVqsYb0WGE3rWkj1UFUP1GhNKJoxvq73BZcpkFg9VP9QMExL5VbVfuLfrfrPW6bcWVI-TJfz2fzsUKlTrOCOyBoziJUyVuqUSGXzpR-RCitrJVkDAViNMdIfGZnVow5gCmE1FgxQhRSc4gKzGmy-jkS4BoQqcSkUnidSL_KrDbd5aOcXPdbmzd-UJYalQAqgVNlkUSGbvCpAKmLNalJgBWGOGcIMEiw36M1m-Oct-1O5XRuGjbe_lVv17-W6vlVv2d2UYPFLWsZwvK--oiDZTfd4TyDJWuzLEObyaPS5-fWc7FKUHCSgxo9Hr4FIcP2s8DnMeSnr8eep5DntrZ3HLvalT1DlcYphfvdhxmQNKH0gY_UUoRMiQUTxCebXAmzGRtpfYFmyvbwwUIyb4jNR1jBrNuKaNPjowUb6Mab8E42FH-0jKD_PqpVfwqfVA7Vc13_pDxH2vvDfonZJ337esuzdlPGxkI3v98ragcoFjrG4GE-PuyVubsR3q-focVW8H5o_M9vqgbpZEL9kh24snZfluAq35UH51jX1N_OW3TISK_9StGGsHQ_-luVWVf7nn2O1ZWPFIbECy6IADClao9zN6K76TBBuJmxNqWLdlyPLM-_hdyVLeeDit1v17__1jNn_HiuYomD6vFctEmUrsfg3eb8zvx_FvxStU27VyZRzSuDmrJCTs7JMKFaORxzWAeeT45LVmNVy8gbAxdVDhYf5_GJIP-diNB2TWzb-3LLdcfXNdfD3b2mMhrdZYN9YJzuXD5_qMeCWYSrxl9TvjnGJa303BVutC8LW3aECEFIY6cbz-W-fF2IpFLIt0_eLc0u7tJYg_NBQMabu8DPgQQ4nx3fwcVlI_GiGNobG7I5brkZjKX-we5OmCtOmYUXeiNzyiwgYWZZxnhleMLhup21B2qbRvbEhCKxPML8rCJuY1UN12xjf6f355_8GAAD___V7WAE=",
|
||||
"READELF": "readelf",
|
||||
"CHROME_DESKTOP": "code.desktop",
|
||||
"STARSHIP_SESSION_KEY": "5100215998796124",
|
||||
"NIX_USER_PROFILE_DIR": "/nix/var/nix/profiles/per-user/arch",
|
||||
"INFOPATH": "/home/arch/.local/share/flatpak/exports/info:/home/arch/.local/share/flatpak/exports/share/info:/var/lib/flatpak/exports/info:/var/lib/flatpak/exports/share/info:/home/arch/.nix-profile/info:/home/arch/.nix-profile/share/info:/nix/profile/info:/nix/profile/share/info:/home/arch/.local/state/nix/profile/info:/home/arch/.local/state/nix/profile/share/info:/etc/profiles/per-user/arch/info:/etc/profiles/per-user/arch/share/info:/nix/var/nix/profiles/default/info:/nix/var/nix/profiles/default/share/info:/run/current-system/sw/info:/run/current-system/sw/share/info",
|
||||
"doCheck": "",
|
||||
"GNOME_SETUP_DISPLAY": ":1",
|
||||
"depsBuildBuild": "",
|
||||
"XDG_SESSION_CLASS": "user",
|
||||
"COPILOT_OTEL_ENABLED": "true",
|
||||
"TERM": "xterm-256color",
|
||||
"LC_IDENTIFICATION": "zh_CN.UTF-8",
|
||||
"GTK_PATH": "/home/arch/.local/share/flatpak/exports/lib/gtk-2.0:/home/arch/.local/share/flatpak/exports/lib/gtk-3.0:/home/arch/.local/share/flatpak/exports/lib/gtk-4.0:/var/lib/flatpak/exports/lib/gtk-2.0:/var/lib/flatpak/exports/lib/gtk-3.0:/var/lib/flatpak/exports/lib/gtk-4.0:/home/arch/.nix-profile/lib/gtk-2.0:/home/arch/.nix-profile/lib/gtk-3.0:/home/arch/.nix-profile/lib/gtk-4.0:/nix/profile/lib/gtk-2.0:/nix/profile/lib/gtk-3.0:/nix/profile/lib/gtk-4.0:/home/arch/.local/state/nix/profile/lib/gtk-2.0:/home/arch/.local/state/nix/profile/lib/gtk-3.0:/home/arch/.local/state/nix/profile/lib/gtk-4.0:/etc/profiles/per-user/arch/lib/gtk-2.0:/etc/profiles/per-user/arch/lib/gtk-3.0:/etc/profiles/per-user/arch/lib/gtk-4.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-4.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0:/run/current-system/sw/lib/gtk-4.0",
|
||||
"SIZE": "size",
|
||||
"propagatedNativeBuildInputs": "",
|
||||
"strictDeps": "",
|
||||
"USER": "arch",
|
||||
"TZDIR": "/etc/zoneinfo",
|
||||
"NIX_LD": "/run/current-system/sw/share/nix-ld/lib/ld.so",
|
||||
"AR": "ar",
|
||||
"AS": "as",
|
||||
"TEMP": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu": "1",
|
||||
"DISPLAY": ":0",
|
||||
"VSCODE_PID": "4067",
|
||||
"SHLVL": "2",
|
||||
"NIX_BUILD_TOP": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"NM": "nm",
|
||||
"__HM_ZSH_SESS_VARS_SOURCED": "1",
|
||||
"PAGER": "less",
|
||||
"NIX_CFLAGS_COMPILE": " -frandom-seed=0r1baggl4c -isystem /nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/include -isystem /nix/store/cwidg78bqc73asdbzv5p67dw0kg4lk2n-qpdf-12.3.2/include -isystem /nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/include -isystem /nix/store/cwidg78bqc73asdbzv5p67dw0kg4lk2n-qpdf-12.3.2/include",
|
||||
"LC_TELEPHONE": "zh_CN.UTF-8",
|
||||
"QTWEBKIT_PLUGIN_PATH": "/home/arch/.local/share/flatpak/exports/lib/mozilla/plugins/:/var/lib/flatpak/exports/lib/mozilla/plugins/:/home/arch/.nix-profile/lib/mozilla/plugins/:/nix/profile/lib/mozilla/plugins/:/home/arch/.local/state/nix/profile/lib/mozilla/plugins/:/etc/profiles/per-user/arch/lib/mozilla/plugins/:/nix/var/nix/profiles/default/lib/mozilla/plugins/:/run/current-system/sw/lib/mozilla/plugins/",
|
||||
"patches": "",
|
||||
"QT_IM_MODULE": "fcitx",
|
||||
"APPLICATIONINSIGHTS_CONFIGURATION_CONTENT": "{}",
|
||||
"LC_MEASUREMENT": "zh_CN.UTF-8",
|
||||
"__NIXOS_SET_ENVIRONMENT_DONE": "1",
|
||||
"VSCODE_CWD": "/home/arch/Projects/wpep/tools/gp",
|
||||
"buildInputs": "",
|
||||
"DBUS_STARTER_ADDRESS": "unix:path=/run/user/1000/bus,guid=df5051e64effbfdd124009b669f232d4",
|
||||
"preferLocalBuild": "1",
|
||||
"LOCALE_ARCHIVE": "/run/current-system/sw/lib/locale/locale-archive",
|
||||
"MANAGERPIDFDID": "2238",
|
||||
"LESSKEYIN_SYSTEM": "/nix/store/ndjvymnavjb3xy2h54aci8cd2nmir587-lessconfig",
|
||||
"TERMINFO_DIRS": "/home/arch/.local/share/flatpak/exports/share/terminfo:/var/lib/flatpak/exports/share/terminfo:/home/arch/.nix-profile/share/terminfo:/nix/profile/share/terminfo:/home/arch/.local/state/nix/profile/share/terminfo:/etc/profiles/per-user/arch/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/run/current-system/sw/share/terminfo",
|
||||
"FC_FONTATIONS": "1",
|
||||
"LD_LIBRARY_PATH": "/nix/store/pcjb2l7xad0c9j25g4h9xd9pirchvl2m-libdbusmenu-glib-16.04.0/lib:/nix/store/dzpjlkm1r63x8jwyswqp6wfsr87hcv3g-pipewire-1.6.2-jack/lib",
|
||||
"VSCODE_CRASH_REPORTER_PROCESS_TYPE": "extensionHost",
|
||||
"XDG_RUNTIME_DIR": "/run/user/1000",
|
||||
"depsBuildTarget": "",
|
||||
"OBJCOPY": "objcopy",
|
||||
"NIX_XDG_DESKTOP_PORTAL_DIR": "/run/current-system/sw/share/xdg-desktop-portal/portals",
|
||||
"OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT": "true",
|
||||
"out": "/home/arch/Projects/wpep/tools/gp/outputs/out",
|
||||
"LC_TIME": "zh_CN.UTF-8",
|
||||
"ELECTRON_NO_ATTACH_CONSOLE": "1",
|
||||
"STRIP": "strip",
|
||||
"XDG_DATA_DIRS": "/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/share:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/share:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/share:/nix/store/jxcc2h10hhycz7y9j252y22hqb1mra4v-noto-fonts-cjk-sans-2.004/share:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/share:/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/share:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/share:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/share:/nix/store/jxcc2h10hhycz7y9j252y22hqb1mra4v-noto-fonts-cjk-sans-2.004/share:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/share:/nix/store/a519p3wlmvdxq0cl4y7yyazqp59s8vyi-vscode-1.115.0/share:/nix/store/xsfc5fcy12nmcdsdwm3dx1xfffh7xv30-gsettings-desktop-schemas-49.1/share/gsettings-schemas/gsettings-desktop-schemas-49.1:/nix/store/yl5yl395iqx88kd1m7lx7p7b65n0jfx9-gtk+3-3.24.51/share/gsettings-schemas/gtk+3-3.24.51:/nix/store/0a9dfj9jfly51kxb83sa2vxi1yhaq21k-gnome-console-49.2/share:/nix/store/hjp25ksf3axb4czp7sllvzl1bkpfwsyg-gtk4-4.20.3/share/gsettings-schemas/gtk4-4.20.3:/nix/store/0a9dfj9jfly51kxb83sa2vxi1yhaq21k-gnome-console-49.2/share/gsettings-schemas/gnome-console-49.2:/nix/store/mfldimj0vmpvdrvsaj3qzs58j77zclzp-gnome-session-49.2/share:/nix/store/xsfc5fcy12nmcdsdwm3dx1xfffh7xv30-gsettings-desktop-schemas-49.1/share/gsettings-schemas/gsettings-desktop-schemas-49.1:/nix/store/hjp25ksf3axb4czp7sllvzl1bkpfwsyg-gtk4-4.20.3/share/gsettings-schemas/gtk4-4.20.3:/nix/store/zh9bq7ndr6gxx6hagc57c8mdrpdjp0v0-gnome-settings-daemon-49.1/share/gsettings-schemas/gnome-settings-daemon-49.1:/nix/store/mfldimj0vmpvdrvsaj3qzs58j77zclzp-gnome-session-49.2/share/gsettings-schemas/gnome-session-49.2:/nix/store/dr93lr6l45iklnwzk2lwwz6zz4g7y1px-gnome-mimeapps/share:/nix/store/03cjba5zlvhj3f20xlw2hbnl9ijm6988-desktops/share:/home/arch/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/home/arch/.nix-profile/share:/nix/profile/share:/home/arch/.local/state/nix/profile/share:/etc/profiles/per-user/arch/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share:/nix/store/k1rwg4y0hvnmq402b136svp6mhmbk365-gnome-shell-49.4/share/gsettings-schemas/gnome-shell-49.4:/nix/store/k1rwg4y0hvnmq402b136svp6mhmbk365-gnome-shell-49.4/share",
|
||||
"GDK_BACKEND": "wayland",
|
||||
"LIBEXEC_PATH": "/home/arch/.local/share/flatpak/exports/libexec:/var/lib/flatpak/exports/libexec:/home/arch/.nix-profile/libexec:/nix/profile/libexec:/home/arch/.local/state/nix/profile/libexec:/etc/profiles/per-user/arch/libexec:/nix/var/nix/profiles/default/libexec:/run/current-system/sw/libexec",
|
||||
"TMP": "/tmp/nix-shell.ILezom/nix-shell.AtazSx",
|
||||
"OBJDUMP": "objdump",
|
||||
"PATH": "/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/bin:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/bin:/nix/store/idz3hpv1k4vvnc6h1569iwaxpaww2wqm-qpdf-12.3.2-bin/bin:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/bin:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/bin:/nix/store/hb2bs5fg5wkm04x565737qd5nh2hy5nk-gcc-wrapper-15.2.0/bin:/nix/store/lvwga6ivl1d4lnw0zis9ajs0rqx9gp4i-gcc-15.2.0/bin:/nix/store/9hm3jdm6kk4m4ppwjcxz4s1dsdvd6fin-glibc-2.42-51-bin/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/x7ikkplbrv5dlihy1bqq32gp6lilkval-binutils-wrapper-2.44/bin:/nix/store/rfp8lhk4dl9syfn64rwb3h3c73426p08-binutils-2.44/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/c89zz4vh8v9dbs8169wk8ahwxvrdxgm5-findutils-4.10.0/bin:/nix/store/355mp4ns4042sb5p51rx3ys4mlliiwc5-diffutils-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/kvmqv1jqv4792rsihf7yjc5kwk3d8z6x-gnutar-1.35/bin:/nix/store/pnxiz967z73a45f4x7c1icldjaaqmlcp-gzip-1.14/bin:/nix/store/by6npbc13ly5a1zgsqghv7wv5bklyiny-bzip2-1.0.8-bin/bin:/nix/store/1fvcxyhg3i5fvw0j4l8wmyml10dnvm7q-gnumake-4.4.1/bin:/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin:/nix/store/ca84rbhb0bhwdcci7q51dad20nkbn9xc-patch-2.8/bin:/nix/store/g6mlwdvpg92rchq352ll7jbi0pz7h43r-xz-5.8.2-bin/bin:/nix/store/kjg8z2k0zvsczaij78803g7imlfm1vfb-file-5.45/bin:/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/bin:/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2/bin:/nix/store/idz3hpv1k4vvnc6h1569iwaxpaww2wqm-qpdf-12.3.2-bin/bin:/nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55/bin:/nix/store/sj3f6y3j8m1831l0gqm1bsk1f46jzkfd-patchelf-0.15.2/bin:/nix/store/hb2bs5fg5wkm04x565737qd5nh2hy5nk-gcc-wrapper-15.2.0/bin:/nix/store/lvwga6ivl1d4lnw0zis9ajs0rqx9gp4i-gcc-15.2.0/bin:/nix/store/9hm3jdm6kk4m4ppwjcxz4s1dsdvd6fin-glibc-2.42-51-bin/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/x7ikkplbrv5dlihy1bqq32gp6lilkval-binutils-wrapper-2.44/bin:/nix/store/rfp8lhk4dl9syfn64rwb3h3c73426p08-binutils-2.44/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/c89zz4vh8v9dbs8169wk8ahwxvrdxgm5-findutils-4.10.0/bin:/nix/store/355mp4ns4042sb5p51rx3ys4mlliiwc5-diffutils-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/kvmqv1jqv4792rsihf7yjc5kwk3d8z6x-gnutar-1.35/bin:/nix/store/pnxiz967z73a45f4x7c1icldjaaqmlcp-gzip-1.14/bin:/nix/store/by6npbc13ly5a1zgsqghv7wv5bklyiny-bzip2-1.0.8-bin/bin:/nix/store/1fvcxyhg3i5fvw0j4l8wmyml10dnvm7q-gnumake-4.4.1/bin:/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin:/nix/store/ca84rbhb0bhwdcci7q51dad20nkbn9xc-patch-2.8/bin:/nix/store/g6mlwdvpg92rchq352ll7jbi0pz7h43r-xz-5.8.2-bin/bin:/nix/store/kjg8z2k0zvsczaij78803g7imlfm1vfb-file-5.45/bin:/nix/store/hak3031i8bpmvdqfla85q6q3bgwqppb0-glib-2.86.3-bin/bin:/nix/store/gg169kyil5vhsg5aqcpagyhs8fwl0r5r-gawk-5.3.2/bin:/nix/store/h6hdbgkfh59np7bi7h8qa76pq27ixz8r-gnugrep-3.12/bin:/nix/store/jpsqy47rdl0j0dvyyzb4kw8gqajw8nx0-gnused-4.9/bin:/nix/store/74sind1d6vf2bfwd7yklg8chsvzqxmmq-coreutils-9.10/bin:/nix/store/qnnigprif5vrj9c0bkpj6w0nd46fm3mm-which-2.23/bin:/nix/store/wfgphlpnrrvc1h6cjdaqlpp7x6ryd8vx-getconf-glibc-2.42-51/bin:/run/wrappers/bin:/home/arch/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:/home/arch/.nix-profile/bin:/nix/profile/bin:/home/arch/.local/state/nix/profile/bin:/etc/profiles/per-user/arch/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin",
|
||||
"propagatedBuildInputs": "",
|
||||
"dontAddDisableDepTrack": "1",
|
||||
"GDMSESSION": "gnome",
|
||||
"CC": "gcc",
|
||||
"NIX_CC": "/nix/store/hb2bs5fg5wkm04x565737qd5nh2hy5nk-gcc-wrapper-15.2.0",
|
||||
"APPLICATION_INSIGHTS_NO_STATSBEAT": "true",
|
||||
"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus,guid=df5051e64effbfdd124009b669f232d4",
|
||||
"depsBuildTargetPropagated": "",
|
||||
"depsBuildBuildPropagated": "",
|
||||
"DIRENV_WATCHES": "eJyc0EtOwzAURuG9eFzVuXb86iqYIwbXzm8S6sZRYtoixN4ZwqBFqBs4-nSeP8XCbRQHIcd6guQ1jfJprW9IbZOXBYtstZZNvi5yj_m8JrETpzq06QRxIOdc77ve2p3AddraJg5tfcfX7lZ2X2riIreRV8hhWjGfJZdSL1LDa5eoj0bbaJ0BlAF5-KTgndN9B61i9CH0hlKCYhUs6ZA9chfplsmQetQ0YP6QWsXkQKSIvCLls2byNrhucBFBs4nGUepATJZ6m0NIMWdjicHO5vyb1P1IMpftDuXO9Vz4iP08XR8f_2e51HT8V_rlOwAA__9XtbLx",
|
||||
"VSCODE_NLS_CONFIG": "{\"userLocale\":\"zh-cn\",\"osLocale\":\"zh-cn\",\"resolvedLanguage\":\"zh-cn\",\"defaultMessagesFile\":\"/nix/store/a519p3wlmvdxq0cl4y7yyazqp59s8vyi-vscode-1.115.0/lib/vscode/resources/app/out/nls.messages.json\",\"languagePack\":{\"translationsConfigFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/tcf.json\",\"messagesFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/41dd792b5e652393e7787322889ed5fdc58bd75b/nls.messages.json\",\"corruptMarkerFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/corrupted.info\"},\"locale\":\"zh-cn\",\"availableLanguages\":{\"*\":\"zh-cn\"},\"_languagePackId\":\"b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn\",\"_languagePackSupport\":true,\"_translationsConfigFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/tcf.json\",\"_cacheRoot\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn\",\"_resolvedLanguagePackCoreLocation\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/41dd792b5e652393e7787322889ed5fdc58bd75b\",\"_corruptedFile\":\"/home/arch/.config/Code/clp/b3d577d0e0e421f69f6e9379a6ee9c57.zh-cn/corrupted.info\"}",
|
||||
"NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu": "1",
|
||||
"QT_PLUGIN_PATH": "/nix/store/zi0yx7hlacqsnf6i5jqys4ybx53zzan2-fcitx5-with-addons-5.1.19/lib/qt-6/plugins",
|
||||
"CONFIG_SHELL": "/nix/store/v8sa6r6q037ihghxfbwzjj4p59v2x0pv-bash-5.3p9/bin/bash",
|
||||
"__structuredAttrs": "",
|
||||
"RANLIB": "ranlib",
|
||||
"NIX_HARDENING_ENABLE": "bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs",
|
||||
"VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
|
||||
"LC_NUMERIC": "zh_CN.UTF-8",
|
||||
"OLDPWD": "",
|
||||
"NIX_LDFLAGS": "-rpath /home/arch/Projects/wpep/tools/gp/outputs/out/lib -L/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/lib -L/nix/store/b8hs3k92mkcdxbwishgcmmi3pq4zvg0l-qpdf-12.3.2-lib/lib -L/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9/lib -L/nix/store/b8hs3k92mkcdxbwishgcmmi3pq4zvg0l-qpdf-12.3.2-lib/lib",
|
||||
"nativeBuildInputs": "/nix/store/nj8hdb8an3j79nrvb1lf1vi1w3pbs4f8-deno-2.7.9 /nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2 /nix/store/cwidg78bqc73asdbzv5p67dw0kg4lk2n-qpdf-12.3.2 /nix/store/13xp1mgxcw3c1ys21dk9dp5cmy5fsz7w-chromium-147.0.7727.55 /nix/store/jxcc2h10hhycz7y9j252y22hqb1mra4v-noto-fonts-cjk-sans-2.004",
|
||||
"COPILOT_OTEL_EXPORTER_TYPE": "file",
|
||||
"name": "nix-shell-env",
|
||||
"TERM_PROGRAM": "kgx",
|
||||
"depsHostHostPropagated": ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# TODOS
|
||||
|
||||
- [x] HTML注入
|
||||
- [x] 自动生成目录
|
||||
<!--- [ ] PDF大小优化(基于外置程序)
|
||||
- [ ] 图片优化-->
|
||||
- [x] 加入js注入机制,可以便携的编译前修改dom,实现复杂功能
|
||||
<!--- [ ] 自动缓存图片-->
|
||||
- [x] 修改索引算法为按照索引表的顺序建立索引
|
||||
- [ ] 加入索引为可点击后跳转
|
||||
- [x] 加入模板与源码分离模式
|
||||
- [x] 加入通过文件系统区别专栏模式
|
||||
@@ -0,0 +1,120 @@
|
||||
{
|
||||
"settings": [
|
||||
{
|
||||
"name": "mobile",
|
||||
"journal": {
|
||||
"from_directory": "../../publications/26.11.0",
|
||||
"build_js_script": false,
|
||||
"build_mode": "detached",
|
||||
"template_directory": "../../templates/mobile_template",
|
||||
"folder_mode": "flat"
|
||||
},
|
||||
"pdf": {
|
||||
"generate_index": true,
|
||||
"use_qpdf": {
|
||||
"enabled": true,
|
||||
"options": ["--linearize"]
|
||||
},
|
||||
"signing": {
|
||||
"enabled": true,
|
||||
"key_path": "~/keys/中国马列毛主义统一战线_0x874AD0D3_SECRET.asc",
|
||||
"output_path": "./outputs/工农解放报RSF续刊第二期-适合手机阅读.pdf.sig"
|
||||
}
|
||||
},
|
||||
|
||||
"playwright": {
|
||||
"path": "./outputs/工农解放报RSF续刊第二期-适合手机阅读.pdf",
|
||||
"format": "A4",
|
||||
"printBackground": true,
|
||||
"displayHeaderFooter": true,
|
||||
"margin": {
|
||||
"bottom": "20mm",
|
||||
"top": "20mm"
|
||||
},
|
||||
"footerTemplate": "<div style=\"width:100%; font-size:10px; text-align:center; color:#666;\"><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></div>",
|
||||
"headerTemplate": "<div style=\"width:100%; font-size:10px; text-align:center; color:#666;\"><span class=\"title\"></span></div>"
|
||||
},
|
||||
"md": {
|
||||
"path": "./outputs/工农解放报RSF续刊第二期-适合手机阅读.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "computer",
|
||||
"journal": {
|
||||
"from_directory": "../../publications/26.11.0",
|
||||
"build_js_script": false,
|
||||
"build_mode": "detached",
|
||||
"template_directory": "../../templates/computer_template",
|
||||
"folder_mode": "flat"
|
||||
},
|
||||
"pdf": {
|
||||
"generate_index": true,
|
||||
"use_qpdf": {
|
||||
"enabled": true,
|
||||
"options": ["--linearize"]
|
||||
},
|
||||
"signing": {
|
||||
"enabled": true,
|
||||
"key_path": "~/keys/中国马列毛主义统一战线_0x874AD0D3_SECRET.asc",
|
||||
"output_path": "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.pdf.sig"
|
||||
}
|
||||
},
|
||||
|
||||
"playwright": {
|
||||
"path": "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.pdf",
|
||||
"format": "A4",
|
||||
"printBackground": true,
|
||||
"displayHeaderFooter": true,
|
||||
"margin": {
|
||||
"bottom": "20mm",
|
||||
"top": "20mm"
|
||||
},
|
||||
|
||||
"footerTemplate": "<div style=\"width:100%; font-size:10px; text-align:center; color:#666;\"><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></div>",
|
||||
"headerTemplate": "<div style=\"width:100%; font-size:10px; text-align:center; color:#666;\"><span class=\"title\"></span></div>"
|
||||
},
|
||||
"md": {
|
||||
"path": "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.md"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "printable",
|
||||
"journal": {
|
||||
"from_directory": "../../publications/26.11.0",
|
||||
"build_mode": "detached",
|
||||
"template_directory": "../../templates/printable_template",
|
||||
"folder_mode": "flat",
|
||||
"build_js_script": "../../templates/printable_template/build.js"
|
||||
},
|
||||
"pdf": {
|
||||
"generate_index": true,
|
||||
"use_qpdf": {
|
||||
"enabled": true,
|
||||
"options": [""]
|
||||
},
|
||||
"signing": {
|
||||
"enabled": true,
|
||||
"key_path": "~/keys/中国马列毛主义统一战线_0x874AD0D3_SECRET.asc",
|
||||
"output_path": "./outputs/工农解放报RSF续刊第二期-适合纸质打印.pdf.sig"
|
||||
}
|
||||
},
|
||||
|
||||
"playwright": {
|
||||
"path": "./outputs/工农解放报RSF续刊第二期-适合纸质打印.pdf",
|
||||
"format": "A4",
|
||||
"printBackground": true,
|
||||
"displayHeaderFooter": true,
|
||||
"margin": {
|
||||
"bottom": "20mm",
|
||||
"top": "20mm"
|
||||
},
|
||||
|
||||
"footerTemplate": "<div style=\"width:100%; font-size:10px; text-align:center; color:#666;\"><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></div>",
|
||||
"headerTemplate": "<div style=\"width:100%; font-size:10px; text-align:center; color:#666;\"><span class=\"title\"></span></div>"
|
||||
},
|
||||
"md": {
|
||||
"path": "./outputs/工农解放报RSF续刊第二期-适合纸质打印.md"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
asset_base = "../../assets"
|
||||
|
||||
[[settings]]
|
||||
name = "mobile"
|
||||
|
||||
[settings.journal]
|
||||
from_directory = "../../publications/26.11.0"
|
||||
build_js_script = false
|
||||
build_mode = "detached"
|
||||
template_directory = "../../templates/mobile_template"
|
||||
folder_mode = "flat"
|
||||
|
||||
[settings.pdf]
|
||||
generate_index = true
|
||||
|
||||
[settings.pdf.use_qpdf]
|
||||
enabled = true
|
||||
options = ["--linearize"]
|
||||
|
||||
[settings.pdf.signing]
|
||||
enabled = true
|
||||
key_path = "~/keys/中国马列毛主义统一战线_0x874AD0D3_SECRET.asc"
|
||||
output_path = "./outputs/工农解放报RSF续刊第二期-适合手机阅读.pdf.sig"
|
||||
|
||||
[settings.playwright]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合手机阅读.pdf"
|
||||
format = "A4"
|
||||
printBackground = true
|
||||
displayHeaderFooter = true
|
||||
footerTemplate = '<div style="width:100%; font-size:10px; text-align:center; color:#666;"><span class="pageNumber"></span> / <span class="totalPages"></span></div>'
|
||||
headerTemplate = '<div style="width:100%; font-size:10px; text-align:center; color:#666;"><span class="title"></span></div>'
|
||||
|
||||
[settings.playwright.margin]
|
||||
bottom = "20mm"
|
||||
top = "20mm"
|
||||
|
||||
[settings.md]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合手机阅读.md"
|
||||
|
||||
[settings.epub]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合手机阅读.epub"
|
||||
title = "工农解放报RSF续刊第二期"
|
||||
language = "zh-CN"
|
||||
|
||||
[[settings]]
|
||||
name = "computer"
|
||||
|
||||
[settings.journal]
|
||||
from_directory = "../../publications/26.11.0"
|
||||
build_js_script = false
|
||||
build_mode = "detached"
|
||||
template_directory = "../../templates/computer_template"
|
||||
folder_mode = "flat"
|
||||
|
||||
[settings.pdf]
|
||||
generate_index = true
|
||||
|
||||
[settings.pdf.use_qpdf]
|
||||
enabled = true
|
||||
options = ["--linearize"]
|
||||
|
||||
[settings.pdf.signing]
|
||||
enabled = true
|
||||
key_path = "~/keys/中国马列毛主义统一战线_0x874AD0D3_SECRET.asc"
|
||||
output_path = "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.pdf.sig"
|
||||
|
||||
[settings.playwright]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.pdf"
|
||||
format = "A4"
|
||||
printBackground = true
|
||||
displayHeaderFooter = true
|
||||
footerTemplate = '<div style="width:100%; font-size:10px; text-align:center; color:#666;"><span class="pageNumber"></span> / <span class="totalPages"></span></div>'
|
||||
headerTemplate = '<div style="width:100%; font-size:10px; text-align:center; color:#666;"><span class="title"></span></div>'
|
||||
|
||||
[settings.playwright.margin]
|
||||
bottom = "20mm"
|
||||
top = "20mm"
|
||||
|
||||
[settings.md]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.md"
|
||||
|
||||
[settings.epub]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合电脑阅读.epub"
|
||||
title = "工农解放报RSF续刊第二期"
|
||||
language = "zh-CN"
|
||||
|
||||
[[settings]]
|
||||
name = "printable"
|
||||
|
||||
[settings.journal]
|
||||
from_directory = "../../publications/26.11.0"
|
||||
build_mode = "detached"
|
||||
template_directory = "../../templates/printable_template"
|
||||
folder_mode = "flat"
|
||||
build_js_script = "../../templates/printable_template/build.js"
|
||||
|
||||
[settings.pdf]
|
||||
generate_index = true
|
||||
|
||||
[settings.pdf.use_qpdf]
|
||||
enabled = true
|
||||
options = [""]
|
||||
|
||||
[settings.pdf.signing]
|
||||
enabled = true
|
||||
key_path = "~/keys/中国马列毛主义统一战线_0x874AD0D3_SECRET.asc"
|
||||
output_path = "./outputs/工农解放报RSF续刊第二期-适合纸质打印.pdf.sig"
|
||||
|
||||
[settings.playwright]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合纸质打印.pdf"
|
||||
format = "A4"
|
||||
printBackground = true
|
||||
displayHeaderFooter = true
|
||||
footerTemplate = '<div style="width:100%; font-size:10px; text-align:center; color:#666;"><span class="pageNumber"></span> / <span class="totalPages"></span></div>'
|
||||
headerTemplate = '<div style="width:100%; font-size:10px; text-align:center; color:#666;"><span class="title"></span></div>'
|
||||
|
||||
[settings.playwright.margin]
|
||||
bottom = "20mm"
|
||||
top = "20mm"
|
||||
|
||||
[settings.md]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合纸质打印.md"
|
||||
|
||||
[settings.epub]
|
||||
path = "./outputs/工农解放报RSF续刊第二期-适合纸质打印.epub"
|
||||
title = "工农解放报RSF续刊第二期"
|
||||
language = "zh-CN"
|
||||
|
||||
[vars]
|
||||
@@ -0,0 +1,379 @@
|
||||
import { strToU8, unzipSync, type Zippable, zipSync } from "fflate";
|
||||
import { dirname, extname, relative, resolve, sep } from "node:path";
|
||||
import { PFiles } from "./file.ts";
|
||||
import { md } from "./mdit/md.ts";
|
||||
import { renderTemplate, type TemplateVariables } from "./template_engine.ts";
|
||||
|
||||
type EpubConfig = {
|
||||
journal: {
|
||||
build_mode?: "detached" | "flat";
|
||||
from_directory: string;
|
||||
template_directory: string;
|
||||
title?: string;
|
||||
author?: string;
|
||||
language?: string;
|
||||
identifier?: string;
|
||||
};
|
||||
vars?: Record<string, unknown>;
|
||||
epub?: { path?: string; title?: string; author?: string; language?: string };
|
||||
md?: { path?: string };
|
||||
markdown_output?: string;
|
||||
asset_base?: string;
|
||||
};
|
||||
|
||||
type EpubChapter = {
|
||||
id: string;
|
||||
href: string;
|
||||
title: string;
|
||||
html: string;
|
||||
sourcePath: string;
|
||||
column: string;
|
||||
};
|
||||
|
||||
function mediaType(extension: string): string {
|
||||
return ({
|
||||
".avif": "image/avif",
|
||||
".gif": "image/gif",
|
||||
".jpeg": "image/jpeg",
|
||||
".jpg": "image/jpeg",
|
||||
".png": "image/png",
|
||||
".svg": "image/svg+xml",
|
||||
".webp": "image/webp",
|
||||
".css": "text/css",
|
||||
".woff": "font/woff",
|
||||
".woff2": "font/woff2",
|
||||
".ttf": "font/ttf",
|
||||
".otf": "font/otf",
|
||||
".html": "application/xhtml+xml",
|
||||
".htm": "application/xhtml+xml",
|
||||
".js": "text/javascript",
|
||||
".mp3": "audio/mpeg",
|
||||
".mp4": "video/mp4",
|
||||
".pdf": "application/pdf",
|
||||
} as Record<string, string>)[extension] ?? "application/octet-stream";
|
||||
}
|
||||
|
||||
function escapeXml(value: string): string {
|
||||
return value.replace(/[&<>"']/g, (char) => ({
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
}[char]!));
|
||||
}
|
||||
|
||||
function normalizeHeadingText(value: string): string {
|
||||
return value
|
||||
.replace(/<[^>]*>/g, "")
|
||||
.replace(
|
||||
/&(#x[\da-f]+|#\d+|amp|lt|gt|quot|apos);/gi,
|
||||
(entity, code: string) => {
|
||||
if (code[0] === "#") {
|
||||
const hex = code[1]?.toLowerCase() === "x";
|
||||
const number = Number.parseInt(
|
||||
code.slice(hex ? 2 : 1),
|
||||
hex ? 16 : 10,
|
||||
);
|
||||
return Number.isFinite(number)
|
||||
? String.fromCodePoint(number)
|
||||
: entity;
|
||||
}
|
||||
return ({ amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" } as Record<
|
||||
string,
|
||||
string
|
||||
>)[code.toLowerCase()] ?? entity;
|
||||
},
|
||||
)
|
||||
.normalize("NFKC")
|
||||
.replace(/\s+/g, " ")
|
||||
.trim();
|
||||
}
|
||||
|
||||
function removeRepeatedLeadingTitle(html: string, title: string): string {
|
||||
const heading = html.match(/^\s*<h1\b[^>]*>([\s\S]*?)<\/h1>\s*/i);
|
||||
if (
|
||||
!heading || normalizeHeadingText(heading[1]) !== normalizeHeadingText(title)
|
||||
) {
|
||||
return html;
|
||||
}
|
||||
return html.slice(heading[0].length);
|
||||
}
|
||||
|
||||
function slug(value: string, index: number): string {
|
||||
const normalized = value.normalize("NFKD").toLowerCase()
|
||||
.replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-|-$/g, "");
|
||||
return `${String(index).padStart(4, "0")}-${normalized || "chapter"}`;
|
||||
}
|
||||
|
||||
function navXhtml(chapters: EpubChapter[], title: string): string {
|
||||
let previousColumn = "";
|
||||
let links = "";
|
||||
for (const chapter of chapters) {
|
||||
if (chapter.column !== previousColumn) {
|
||||
if (previousColumn) links += "</ol></li>";
|
||||
previousColumn = chapter.column;
|
||||
links += `<li><span>${escapeXml(chapter.column)}</span><ol>`;
|
||||
}
|
||||
links += `<li><a href="${chapter.href}">${
|
||||
escapeXml(chapter.title)
|
||||
}</a></li>`;
|
||||
}
|
||||
if (previousColumn) links += "</ol></li>";
|
||||
return `<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="zh" xml:lang="zh">
|
||||
<head><title>${escapeXml(title)}</title><meta charset="utf-8" /></head>
|
||||
<body><nav epub:type="toc" id="toc"><h1>目录</h1><ol>${links}</ol></nav></body>
|
||||
</html>`;
|
||||
}
|
||||
|
||||
function packageOpf(
|
||||
chapters: EpubChapter[],
|
||||
media: Map<string, string>,
|
||||
title: string,
|
||||
author: string,
|
||||
language: string,
|
||||
identifier: string,
|
||||
): string {
|
||||
const manifest = [
|
||||
`<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>`,
|
||||
...chapters.map((chapter) =>
|
||||
`<item id="${chapter.id}" href="${chapter.href}" media-type="application/xhtml+xml"/>`
|
||||
),
|
||||
...[...media.entries()].map(([href, mime], index) =>
|
||||
`<item id="media-${index + 1}" href="${href}" media-type="${mime}"/>`
|
||||
),
|
||||
].join("\n ");
|
||||
const spine = chapters.map((chapter) => `<itemref idref="${chapter.id}"/>`)
|
||||
.join("\n ");
|
||||
return `<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="book-id" xml:lang="${
|
||||
escapeXml(language)
|
||||
}">
|
||||
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||
<dc:identifier id="book-id">${escapeXml(identifier)}</dc:identifier>
|
||||
<dc:title>${escapeXml(title)}</dc:title>
|
||||
<dc:language>${escapeXml(language)}</dc:language>
|
||||
<dc:creator>${escapeXml(author)}</dc:creator>
|
||||
<meta property="dcterms:modified">${
|
||||
new Date().toISOString().replace(/\.\d{3}Z$/, "Z")
|
||||
}</meta>
|
||||
</metadata>
|
||||
<manifest>
|
||||
${manifest}
|
||||
</manifest>
|
||||
<spine>
|
||||
${spine}
|
||||
</spine>
|
||||
</package>`;
|
||||
}
|
||||
|
||||
export class EpubBuilder {
|
||||
private readonly config: EpubConfig;
|
||||
private readonly variables: TemplateVariables;
|
||||
private pfiles?: PFiles;
|
||||
|
||||
constructor(config: EpubConfig, variables: TemplateVariables = {}) {
|
||||
this.config = config;
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
with_files_sync(directory = this.config.journal.from_directory): this {
|
||||
this.pfiles = new PFiles(
|
||||
this.config.journal.build_mode ?? "flat",
|
||||
directory,
|
||||
this.config,
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
async build(path = this.outputPath()): Promise<void> {
|
||||
if (!this.pfiles) this.with_files_sync();
|
||||
const chapters: EpubChapter[] = [];
|
||||
const mediaManifest = new Map<string, string>();
|
||||
const epubMedia = new Map<string, Uint8Array>();
|
||||
const allFiles = this.pfiles!;
|
||||
let index = 0;
|
||||
const sourceToHref = new Map<string, string>();
|
||||
for (const column of allFiles.pcolumes) {
|
||||
for (const pfile of column.pfiles) {
|
||||
index += 1;
|
||||
sourceToHref.set(
|
||||
resolve(pfile.full_name),
|
||||
`text/${slug(pfile.meta.title, index)}.xhtml`,
|
||||
);
|
||||
}
|
||||
}
|
||||
index = 0;
|
||||
for (const column of allFiles.pcolumes) {
|
||||
for (const pfile of column.pfiles) {
|
||||
index += 1;
|
||||
const id = `chapter-${index}`;
|
||||
const href = `text/${slug(pfile.meta.title, index)}.xhtml`;
|
||||
let html = md.render(renderTemplate(pfile.content, {
|
||||
...this.variables,
|
||||
document: {
|
||||
title: pfile.meta.title,
|
||||
index: pfile.meta.index,
|
||||
file: pfile.full_name,
|
||||
},
|
||||
column: { name: column.name, index: column.index },
|
||||
}));
|
||||
html = removeRepeatedLeadingTitle(html, pfile.meta.title);
|
||||
const targetDir = dirname(resolve(href));
|
||||
const sourceDir = dirname(resolve(pfile.full_name));
|
||||
const media: Array<{ href: string; bytes: Uint8Array; mime: string }> =
|
||||
[];
|
||||
const mediaBySource = new Map<string, string>();
|
||||
const knownTargets = new Set(sourceToHref.keys());
|
||||
const assetReferences = [
|
||||
...html.matchAll(/\b(src|href)=(['"])([^'"]+)\2/gi),
|
||||
];
|
||||
for (const reference of assetReferences) {
|
||||
const sourceUrl = reference[3];
|
||||
if (sourceUrl.split(/[?#]/, 1)[0].toLowerCase().endsWith(".md")) {
|
||||
continue;
|
||||
}
|
||||
if (/^(?:[a-z][a-z0-9+.-]*:|#|\/\/)/i.test(sourceUrl)) continue;
|
||||
const sourceAsset = resolve(
|
||||
sourceDir,
|
||||
decodeURIComponent(sourceUrl.split(/[?#]/, 1)[0]),
|
||||
);
|
||||
if (knownTargets.has(sourceAsset)) continue;
|
||||
if (
|
||||
!sourceAsset.startsWith(
|
||||
`${resolve(this.config.journal.from_directory)}${sep}`,
|
||||
)
|
||||
) continue;
|
||||
try {
|
||||
const info = await Deno.stat(sourceAsset);
|
||||
if (!info.isFile) continue;
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
const destination = mediaBySource.get(sourceAsset) ??
|
||||
`media/${index}/${media.length + 1}${
|
||||
extname(sourceAsset).toLowerCase()
|
||||
}`;
|
||||
if (!mediaBySource.has(sourceAsset)) {
|
||||
mediaBySource.set(sourceAsset, destination);
|
||||
const ext = extname(sourceAsset).toLowerCase();
|
||||
media.push({
|
||||
href: destination,
|
||||
bytes: await Deno.readFile(sourceAsset),
|
||||
mime: mediaType(ext),
|
||||
});
|
||||
}
|
||||
const escapedUrl = reference[0];
|
||||
const replacement = `${reference[1]}=${reference[2]}${
|
||||
relative(targetDir, resolve(destination)).split(sep).join("/")
|
||||
}${reference[2]}`;
|
||||
html = html.replace(escapedUrl, replacement);
|
||||
}
|
||||
// Resolve authored links that point to another Markdown chapter inside this EPUB.
|
||||
html = html.replace(
|
||||
/\b(href)=(['"])([^'"]+\.md(?:#[^'"]*)?)\2/gi,
|
||||
(match, attr: string, quote: string, target: string) => {
|
||||
const [filePart, fragment] = target.split("#", 2);
|
||||
const targetPath = resolve(sourceDir, decodeURIComponent(filePart));
|
||||
const chapterHref = sourceToHref.get(targetPath);
|
||||
return chapterHref
|
||||
? `${attr}=${quote}${
|
||||
relative(targetDir, resolve(chapterHref)).split(sep).join("/")
|
||||
}${fragment ? `#${fragment}` : ""}${quote}`
|
||||
: match;
|
||||
},
|
||||
);
|
||||
chapters.push({
|
||||
id,
|
||||
href,
|
||||
title: pfile.meta.title,
|
||||
html,
|
||||
sourcePath: pfile.full_name,
|
||||
column: column.name,
|
||||
});
|
||||
for (const asset of media) {
|
||||
epubMedia.set(asset.href, asset.bytes);
|
||||
mediaManifest.set(asset.href, asset.mime);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (chapters.length === 0) {
|
||||
throw new Error("No Markdown articles found for EPUB");
|
||||
}
|
||||
|
||||
const epub = this.config.epub ?? {};
|
||||
const title = epub.title ?? this.config.journal.title ?? "未命名出版物";
|
||||
const author = epub.author ?? this.config.journal.author ?? "未知作者";
|
||||
const language = epub.language ?? this.config.journal.language ?? "zh-CN";
|
||||
const identifier = this.config.journal.identifier ??
|
||||
`urn:uuid:${await this.contentIdentifier(chapters)}`;
|
||||
const files: Record<string, Uint8Array> = {
|
||||
mimetype: strToU8("application/epub+zip"),
|
||||
"META-INF/container.xml": strToU8(
|
||||
`<?xml version="1.0" encoding="UTF-8"?>\n<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfile full-path="EPUB/content.opf" media-type="application/oebps-package+xml"/></rootfiles></container>`,
|
||||
),
|
||||
"EPUB/nav.xhtml": strToU8(navXhtml(chapters, title)),
|
||||
"EPUB/content.opf": strToU8(
|
||||
packageOpf(
|
||||
chapters,
|
||||
mediaManifest,
|
||||
title,
|
||||
author,
|
||||
language,
|
||||
identifier,
|
||||
),
|
||||
),
|
||||
};
|
||||
for (const [href, bytes] of epubMedia) files[`EPUB/${href}`] = bytes;
|
||||
chapters.forEach((chapter) => {
|
||||
files[`EPUB/${chapter.href}`] = strToU8(
|
||||
`<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="${
|
||||
escapeXml(language)
|
||||
}" xml:lang="${
|
||||
escapeXml(language)
|
||||
}"><head><meta charset="utf-8"/><title>${
|
||||
escapeXml(chapter.title)
|
||||
}</title></head><body><h1>${
|
||||
escapeXml(chapter.title)
|
||||
}</h1>${chapter.html}</body></html>`,
|
||||
);
|
||||
});
|
||||
const orderedEntries: Zippable = {
|
||||
mimetype: [files.mimetype, { level: 0 }],
|
||||
};
|
||||
for (const [name, bytes] of Object.entries(files)) {
|
||||
if (name !== "mimetype") orderedEntries[name] = bytes;
|
||||
}
|
||||
const archive = zipSync(orderedEntries, {
|
||||
level: 6,
|
||||
mtime: new Date("2020-01-01T00:00:00Z"),
|
||||
});
|
||||
await Deno.mkdir(path.replace(/[/\\][^/\\]*$/, ""), { recursive: true });
|
||||
await Deno.writeFile(path, archive);
|
||||
}
|
||||
|
||||
outputPath(): string {
|
||||
if (this.config.epub?.path) return this.config.epub.path;
|
||||
const sourcePath = this.config.md?.path ?? this.config.markdown_output;
|
||||
if (!sourcePath) return "./outputs/book.epub";
|
||||
return sourcePath.replace(/\.md$/i, ".epub");
|
||||
}
|
||||
|
||||
private async contentIdentifier(chapters: EpubChapter[]): Promise<string> {
|
||||
const digestInput = new TextEncoder().encode(
|
||||
`${this.config.journal.from_directory}\n${
|
||||
chapters.map((chapter) => chapter.sourcePath).join("\n")
|
||||
}`,
|
||||
);
|
||||
const digest = await crypto.subtle.digest("SHA-256", digestInput);
|
||||
return [...new Uint8Array(digest)].map((byte) =>
|
||||
byte.toString(16).padStart(2, "0")
|
||||
).join("");
|
||||
}
|
||||
}
|
||||
|
||||
export function inspectEpub(bytes: Uint8Array): Record<string, Uint8Array> {
|
||||
return unzipSync(bytes);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import { assertEquals, assertStringIncludes } from "@std/assert";
|
||||
import { EpubBuilder, inspectEpub } from "./epub_builder.ts";
|
||||
|
||||
Deno.test("generates EPUB 3 with a linked table of contents and spine", async () => {
|
||||
const root = await Deno.makeTempDir();
|
||||
const publication = `${root}/publication`;
|
||||
const templates = `${root}/templates`;
|
||||
const output = `${root}/book.epub`;
|
||||
await Deno.mkdir(`${publication}/1::专栏`, { recursive: true });
|
||||
await Deno.mkdir(templates, { recursive: true });
|
||||
await Deno.writeTextFile(
|
||||
`${publication}/1::专栏/1::第一篇.md`,
|
||||
"正文甲",
|
||||
);
|
||||
await Deno.writeTextFile(
|
||||
`${publication}/1::专栏/2::第二篇.md`,
|
||||
"# 第二篇\n\n第二段\n\n\n\n[转到第一篇](1::第一篇.md)",
|
||||
);
|
||||
await Deno.mkdir(`${publication}/1::专栏/assets`, { recursive: true });
|
||||
await Deno.writeFile(
|
||||
`${publication}/1::专栏/assets/pixel.png`,
|
||||
new Uint8Array([1, 2, 3]),
|
||||
);
|
||||
const builder = new EpubBuilder({
|
||||
journal: {
|
||||
build_mode: "detached",
|
||||
from_directory: publication,
|
||||
template_directory: templates,
|
||||
identifier: "urn:test:book",
|
||||
},
|
||||
epub: { path: output, title: "测试书", author: "作者甲" },
|
||||
}).with_files_sync();
|
||||
|
||||
try {
|
||||
await builder.build();
|
||||
const archiveBytes = await Deno.readFile(output);
|
||||
const zip = inspectEpub(archiveBytes);
|
||||
const mimetype = new TextDecoder().decode(zip.mimetype);
|
||||
assertEquals(mimetype, "application/epub+zip");
|
||||
const archiveView = new DataView(
|
||||
archiveBytes.buffer,
|
||||
archiveBytes.byteOffset,
|
||||
archiveBytes.byteLength,
|
||||
);
|
||||
// Local-file-header fields: compression method is the uint16 at offset 8.
|
||||
assertEquals(archiveView.getUint16(8, true), 0);
|
||||
assertEquals(
|
||||
new TextDecoder().decode(archiveBytes.slice(30, 38)),
|
||||
"mimetype",
|
||||
);
|
||||
|
||||
const nav = new TextDecoder().decode(zip["EPUB/nav.xhtml"]);
|
||||
assertStringIncludes(nav, 'epub:type="toc"');
|
||||
assertStringIncludes(nav, "text/0001-第一篇.xhtml");
|
||||
assertStringIncludes(nav, "text/0002-第二篇.xhtml");
|
||||
const opf = new TextDecoder().decode(zip["EPUB/content.opf"]);
|
||||
assertStringIncludes(opf, "<spine>");
|
||||
assertStringIncludes(opf, '<itemref idref="chapter-1"/>');
|
||||
assertStringIncludes(
|
||||
new TextDecoder().decode(zip["EPUB/text/0001-第一篇.xhtml"]),
|
||||
"正文甲",
|
||||
);
|
||||
const secondChapter = new TextDecoder().decode(
|
||||
zip["EPUB/text/0002-第二篇.xhtml"],
|
||||
);
|
||||
assertEquals((secondChapter.match(/<h1\b/g) ?? []).length, 1);
|
||||
assertStringIncludes(secondChapter, "第二篇</h1>");
|
||||
assertStringIncludes(secondChapter, "../media/2/1.png");
|
||||
assertStringIncludes(secondChapter, "0001-第一篇.xhtml");
|
||||
assertEquals(zip["EPUB/media/2/1.png"].length, 3);
|
||||
} finally {
|
||||
await Deno.remove(root, { recursive: true });
|
||||
}
|
||||
});
|
||||
|
||||
Deno.test("uses EPUB output path or a stable default", () => {
|
||||
const builder = new EpubBuilder({
|
||||
journal: { from_directory: "publication", template_directory: "templates" },
|
||||
});
|
||||
assertEquals(builder.outputPath(), "./outputs/book.epub");
|
||||
});
|
||||
@@ -0,0 +1,84 @@
|
||||
import { assertEquals } from "@std/assert";
|
||||
import { comparePColumes, PColume, PFile, PFileMetadata } from "./file.ts";
|
||||
|
||||
function column(name: string, order: number): PColume {
|
||||
const meta = new PFileMetadata(`${order}::${name}/1::sample.md`);
|
||||
return new PColume(name, [new PFile(`${name}/1::sample.md`, meta, "")]);
|
||||
}
|
||||
|
||||
Deno.test("orders explicitly numbered columns before unnumbered columns", () => {
|
||||
const columns = [column("乙", Number.NaN), column("丙", 2), column("甲", 1)];
|
||||
columns.sort(comparePColumes);
|
||||
assertEquals(columns.map((item) => item.name), ["甲", "丙", "乙"]);
|
||||
});
|
||||
|
||||
Deno.test("orders unnumbered columns by their first Chinese character", () => {
|
||||
const columns = [
|
||||
column("丙栏目", Number.NaN),
|
||||
column("阿栏目", Number.NaN),
|
||||
column("乙栏目", Number.NaN),
|
||||
];
|
||||
columns.sort(comparePColumes);
|
||||
assertEquals(columns.map((item) => item.name), [
|
||||
"阿栏目",
|
||||
"丙栏目",
|
||||
"乙栏目",
|
||||
]);
|
||||
});
|
||||
|
||||
Deno.test("parses detached column folders without an order prefix", () => {
|
||||
const meta = new PFileMetadata("/publication/专栏名称/1::文章标题.md");
|
||||
assertEquals(meta.colume, "专栏名称");
|
||||
assertEquals(Number.isNaN(meta.c_index), true);
|
||||
});
|
||||
|
||||
Deno.test("parses finite JavaScript numbers as detached column order", () => {
|
||||
for (const [prefix, expected] of [
|
||||
["-2.5", -2.5],
|
||||
["+3.25", 3.25],
|
||||
["1e3", 1000],
|
||||
["0x10", 16],
|
||||
]) {
|
||||
const meta = new PFileMetadata(`/publication/${prefix}::专栏/1::文章.md`);
|
||||
assertEquals(meta.colume, "专栏");
|
||||
assertEquals(meta.c_index, expected);
|
||||
}
|
||||
});
|
||||
|
||||
Deno.test("sorts negative, fractional, and large numeric order values", () => {
|
||||
const columns = [
|
||||
column("大数", Number.MAX_VALUE),
|
||||
column("小数", 0.25),
|
||||
column("负数", -10),
|
||||
column("非数字", Number.NaN),
|
||||
column("负小数", -0.5),
|
||||
];
|
||||
columns.sort(comparePColumes);
|
||||
assertEquals(columns.map((item) => item.name), [
|
||||
"负数",
|
||||
"负小数",
|
||||
"小数",
|
||||
"大数",
|
||||
"非数字",
|
||||
]);
|
||||
});
|
||||
|
||||
Deno.test("does not treat non-finite numeric strings as explicit order", () => {
|
||||
const nanMeta = new PFileMetadata("/publication/NaN::专栏/1::文章.md");
|
||||
assertEquals(nanMeta.colume, "NaN::专栏");
|
||||
assertEquals(Number.isNaN(nanMeta.c_index), true);
|
||||
|
||||
const columns = [
|
||||
column("正无穷", Number.POSITIVE_INFINITY),
|
||||
column("负无穷", Number.NEGATIVE_INFINITY),
|
||||
column("有限数", 1),
|
||||
column("NaN", Number.NaN),
|
||||
];
|
||||
columns.sort(comparePColumes);
|
||||
assertEquals(columns.map((item) => item.name), [
|
||||
"负无穷",
|
||||
"有限数",
|
||||
"正无穷",
|
||||
"NaN",
|
||||
]);
|
||||
});
|
||||
Generated
+61
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1776169885,
|
||||
"narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
import { dirname, extname, join, resolve } from "node:path";
|
||||
import { pathToFileURL } from "node:url";
|
||||
import { parse as parseToml, stringify as stringifyToml } from "@std/toml";
|
||||
|
||||
export type CacheMap = Record<string, string>;
|
||||
|
||||
const RESOURCE_REFERENCE_RE =
|
||||
/(?<prefix><link\b[^>]*?\bhref\s*=\s*["']|\bsrc\s*=\s*["']|\bhref\s*=\s*["']|url\(\s*["']?|@import\s+["']|!\[[^\]]*\]\(\s*["']?|\bcontent\s*=\s*["'][^"']*\burl\s*=\s*["']?)(?<url>https?:\/\/[^\s"'<>()[\]{}]+)(?<suffix>["']?\s*\)?)/gi;
|
||||
const ASSET_EXTENSIONS = new Set([
|
||||
".avif",
|
||||
".css",
|
||||
".gif",
|
||||
".htm",
|
||||
".html",
|
||||
".jpeg",
|
||||
".jpg",
|
||||
".js",
|
||||
".mjs",
|
||||
".otf",
|
||||
".png",
|
||||
".svg",
|
||||
".ttf",
|
||||
".webp",
|
||||
".woff",
|
||||
".woff2",
|
||||
]);
|
||||
|
||||
function isLocalUrl(url: string): boolean {
|
||||
return /^(?:data:|blob:|file:|\.\.?\/|\/|#)/i.test(url);
|
||||
}
|
||||
|
||||
function isHttpUrl(url: string): boolean {
|
||||
return /^https?:\/\//i.test(url);
|
||||
}
|
||||
|
||||
function isAssetUrl(
|
||||
url: string,
|
||||
prefix: string,
|
||||
sourceExtension: string,
|
||||
): boolean {
|
||||
if (isLocalUrl(url)) return false;
|
||||
let parsed: URL;
|
||||
try {
|
||||
parsed = new URL(url);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
if (!/^https?:$/.test(parsed.protocol)) return false;
|
||||
const extension = extname(parsed.pathname).toLowerCase();
|
||||
if (ASSET_EXTENSIONS.has(extension)) return true;
|
||||
if (/\.(?:css|html?)$/i.test(sourceExtension)) {
|
||||
return /^(?:src|url\(|@import|!\[)/i.test(prefix.trim());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isResourceReference(prefix: string, url: string): boolean {
|
||||
const extension = extname(new URL(url).pathname).toLowerCase();
|
||||
if (prefix.toLowerCase().startsWith("<link")) {
|
||||
return ASSET_EXTENSIONS.has(extension);
|
||||
}
|
||||
if (prefix.toLowerCase().startsWith("href")) return extension === ".css";
|
||||
if (prefix.toLowerCase().startsWith("content")) {
|
||||
return /\.(?:png|jpe?g|gif|webp|avif|svg)$/i.test(extension);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function sourceFiles(dir: string): string[] {
|
||||
const result: string[] = [];
|
||||
if (!existsSync(dir)) return result;
|
||||
for (const entry of Deno.readDirSync(dir)) {
|
||||
const path = join(dir, entry.name);
|
||||
if (entry.isDirectory) {
|
||||
if (entry.name !== ".local-cache") result.push(...sourceFiles(path));
|
||||
} else if (entry.isFile && /\.(?:css|html?|js|mjs|md)$/i.test(entry.name)) {
|
||||
result.push(path);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function existsSync(path: string): boolean {
|
||||
try {
|
||||
return Deno.statSync(path).isDirectory;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async function cacheFileName(url: string): Promise<string> {
|
||||
const parsed = new URL(url);
|
||||
const name = parsed.pathname.split("/").filter(Boolean).pop() || "asset";
|
||||
const digest = await crypto.subtle.digest(
|
||||
"SHA-256",
|
||||
new TextEncoder().encode(url),
|
||||
);
|
||||
const hash = Array.from(new Uint8Array(digest)).slice(0, 12).map((byte) =>
|
||||
byte.toString(16).padStart(2, "0")
|
||||
).join("");
|
||||
return `${hash}-${name.replace(/[^\p{L}\p{N}._-]/gu, "_")}`;
|
||||
}
|
||||
|
||||
async function readCache(path: string): Promise<CacheMap> {
|
||||
try {
|
||||
return parseToml(await Deno.readTextFile(path)) as CacheMap;
|
||||
} catch (error) {
|
||||
if (error instanceof Deno.errors.NotFound) return {};
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function prepareLocalCache(
|
||||
publicationDir: string,
|
||||
templateDir?: string,
|
||||
): Promise<number> {
|
||||
const pubDir = resolve(publicationDir);
|
||||
if (!existsSync(pubDir)) {
|
||||
throw new Error(`Publication directory does not exist: ${pubDir}`);
|
||||
}
|
||||
const cacheToml = join(pubDir, ".cache.toml");
|
||||
const cacheDir = join(pubDir, ".local-cache");
|
||||
const map = await readCache(cacheToml);
|
||||
const initialCachedCount = Object.keys(map).length;
|
||||
const files = new Set(sourceFiles(pubDir));
|
||||
if (templateDir) {
|
||||
for (const file of sourceFiles(resolve(templateDir))) files.add(file);
|
||||
}
|
||||
|
||||
const urls = new Set<string>(Object.keys(map));
|
||||
for (const file of files) {
|
||||
const content = await Deno.readTextFile(file);
|
||||
for (const match of content.matchAll(RESOURCE_REFERENCE_RE)) {
|
||||
const url = match.groups?.url;
|
||||
const prefix = match.groups?.prefix ?? "";
|
||||
if (
|
||||
url && isAssetUrl(url, prefix, extname(file).toLowerCase()) &&
|
||||
isResourceReference(prefix, url)
|
||||
) {
|
||||
urls.add(url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await Deno.mkdir(cacheDir, { recursive: true });
|
||||
const pending = [...urls];
|
||||
const processed = new Set<string>();
|
||||
while (pending.length > 0) {
|
||||
const url = pending.shift()!;
|
||||
if (processed.has(url)) continue;
|
||||
processed.add(url);
|
||||
const fileName = map[url]?.replace(/^\.local-cache\//, "") ??
|
||||
await cacheFileName(url);
|
||||
const target = join(cacheDir, fileName);
|
||||
if (!(await exists(target))) {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to cache ${url}: HTTP ${response.status}`);
|
||||
}
|
||||
const bytes = new Uint8Array(await response.arrayBuffer());
|
||||
await Deno.writeFile(target, bytes);
|
||||
}
|
||||
map[url] = `.local-cache/${fileName}`;
|
||||
}
|
||||
|
||||
await Deno.writeTextFile(cacheToml, stringifyToml(map));
|
||||
for (const file of files) await rewriteFile(file, pubDir, map);
|
||||
const inspected = new Set<string>();
|
||||
for (const url of [...urls]) {
|
||||
if (/\.(?:css|html?)$/i.test(new URL(url).pathname)) {
|
||||
const localFile = resolve(pubDir, map[url]);
|
||||
if (await exists(localFile)) {
|
||||
await scanDownloadedReferences(url, pubDir, map, inspected);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Object.keys(map).length - initialCachedCount;
|
||||
}
|
||||
|
||||
async function scanDownloadedReferences(
|
||||
sourceUrl: string,
|
||||
pubDir: string,
|
||||
map: CacheMap,
|
||||
processed: Set<string>,
|
||||
): Promise<void> {
|
||||
const file = resolve(pubDir, map[sourceUrl]);
|
||||
if (processed.has(sourceUrl)) return;
|
||||
processed.add(sourceUrl);
|
||||
const content = await Deno.readTextFile(file);
|
||||
const sourceExtension = extname(new URL(sourceUrl).pathname).toLowerCase();
|
||||
for (const match of content.matchAll(RESOURCE_REFERENCE_RE)) {
|
||||
const prefix = match.groups?.prefix ?? "";
|
||||
const reference = match.groups?.url;
|
||||
if (
|
||||
!reference ||
|
||||
!isAssetUrl(reference, prefix, sourceExtension) ||
|
||||
!isResourceReference(prefix, reference)
|
||||
) continue;
|
||||
let dependency: string;
|
||||
try {
|
||||
dependency = new URL(reference, sourceUrl).href;
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
if (!isHttpUrl(dependency) || !isResourceReference(prefix, dependency)) {
|
||||
continue;
|
||||
}
|
||||
if (!map[dependency] || !(await exists(resolve(pubDir, map[dependency])))) {
|
||||
const response = await fetch(dependency);
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`Failed to cache ${dependency}: HTTP ${response.status}`,
|
||||
);
|
||||
}
|
||||
const bytes = new Uint8Array(await response.arrayBuffer());
|
||||
const fileName = await cacheFileName(dependency);
|
||||
await Deno.writeFile(join(pubDir, ".local-cache", fileName), bytes);
|
||||
map[dependency] = `.local-cache/${fileName}`;
|
||||
}
|
||||
processed.add(dependency);
|
||||
if (/\.(?:css|html?)$/i.test(new URL(dependency).pathname)) {
|
||||
await scanDownloadedReferences(dependency, pubDir, map, processed);
|
||||
}
|
||||
}
|
||||
await rewriteFile(file, pubDir, map, sourceUrl);
|
||||
await Deno.writeTextFile(join(pubDir, ".cache.toml"), stringifyToml(map));
|
||||
}
|
||||
|
||||
async function rewriteFile(
|
||||
file: string,
|
||||
pubDir: string,
|
||||
map: CacheMap,
|
||||
sourceUrl?: string,
|
||||
): Promise<void> {
|
||||
const original = await Deno.readTextFile(file);
|
||||
const rewritten = original.replace(
|
||||
RESOURCE_REFERENCE_RE,
|
||||
(whole, prefix: string, url: string) => {
|
||||
let resolvedUrl = url;
|
||||
try {
|
||||
if (sourceUrl) resolvedUrl = new URL(url, sourceUrl).href;
|
||||
} catch {
|
||||
return whole;
|
||||
}
|
||||
const localPath = map[resolvedUrl] ?? map[url];
|
||||
if (
|
||||
!localPath || !isHttpUrl(resolvedUrl) ||
|
||||
!isResourceReference(prefix, resolvedUrl)
|
||||
) return whole;
|
||||
return whole.replace(
|
||||
url,
|
||||
pathToFileURL(resolve(pubDir, localPath)).href,
|
||||
);
|
||||
},
|
||||
);
|
||||
if (rewritten !== original) await Deno.writeTextFile(file, rewritten);
|
||||
}
|
||||
|
||||
async function exists(path: string): Promise<boolean> {
|
||||
try {
|
||||
await Deno.stat(path);
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (error instanceof Deno.errors.NotFound) return false;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import { assert, assertEquals, assertStringIncludes } from "@std/assert";
|
||||
import { prepareLocalCache } from "./local_cache.ts";
|
||||
|
||||
Deno.test("local cache downloads resource references and preserves reader links", async () => {
|
||||
const root = await Deno.makeTempDir();
|
||||
const publication = `${root}/publication`;
|
||||
const templates = `${root}/templates`;
|
||||
await Deno.mkdir(publication, { recursive: true });
|
||||
await Deno.mkdir(templates, { recursive: true });
|
||||
const assetUrl = "https://cdn.example.test/asset.png";
|
||||
const cssUrl = "https://cdn.example.test/theme.css";
|
||||
const fontUrl = "https://cdn.example.test/font.woff2";
|
||||
const htmlUrl = "https://cdn.example.test/widget.html";
|
||||
const nestedImageUrl = "https://cdn.example.test/widget.png";
|
||||
await Deno.writeTextFile(
|
||||
`${publication}/article.md`,
|
||||
`\n\n[reader link](${assetUrl})`,
|
||||
);
|
||||
await Deno.writeTextFile(
|
||||
`${templates}/cover.html`,
|
||||
`<img src="${assetUrl}"><iframe src="${htmlUrl}"></iframe><link href="${cssUrl}"><a href="https://example.com/page.png">reader</a>`,
|
||||
);
|
||||
|
||||
const originalFetch = globalThis.fetch;
|
||||
const fetched: string[] = [];
|
||||
globalThis.fetch = async (input) => {
|
||||
const url = String(input);
|
||||
fetched.push(url);
|
||||
assert(
|
||||
url === assetUrl || url === cssUrl || url === fontUrl ||
|
||||
url === htmlUrl || url === nestedImageUrl,
|
||||
);
|
||||
if (url === cssUrl) {
|
||||
return new Response(`@font-face { src: url("${fontUrl}"); }`, {
|
||||
headers: { "content-type": "text/css" },
|
||||
});
|
||||
}
|
||||
if (url === htmlUrl) {
|
||||
return new Response(
|
||||
`<img src="https://cdn.example.test/widget.png"><a href="https://reader.example.test/story.png">story</a>`,
|
||||
{ headers: { "content-type": "text/html" } },
|
||||
);
|
||||
}
|
||||
if (url === fontUrl) {
|
||||
return new Response(new Uint8Array([1, 2, 3]), {
|
||||
headers: { "content-type": "font/woff2" },
|
||||
});
|
||||
}
|
||||
return new Response(new Uint8Array([1, 2, 3]), {
|
||||
headers: { "content-type": "image/png" },
|
||||
});
|
||||
};
|
||||
try {
|
||||
assertEquals(await prepareLocalCache(publication, templates), 5);
|
||||
const rewrittenMd = await Deno.readTextFile(`${publication}/article.md`);
|
||||
const rewrittenHtml = await Deno.readTextFile(`${templates}/cover.html`);
|
||||
assertStringIncludes(rewrittenMd, "file://");
|
||||
assertStringIncludes(rewrittenMd, `[reader link](${assetUrl})`);
|
||||
assertStringIncludes(rewrittenHtml, "file://");
|
||||
assertStringIncludes(rewrittenHtml, 'iframe src="file://');
|
||||
assertStringIncludes(rewrittenHtml, "https://example.com/page.png");
|
||||
assertEquals(
|
||||
fetched.sort(),
|
||||
[assetUrl, cssUrl, fontUrl, htmlUrl, nestedImageUrl].sort(),
|
||||
);
|
||||
|
||||
const cache = await Deno.readTextFile(`${publication}/.cache.toml`);
|
||||
assertStringIncludes(cache, assetUrl);
|
||||
assertEquals(await prepareLocalCache(publication, templates), 0);
|
||||
assertEquals(fetched.length, 5);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
await Deno.remove(root, { recursive: true });
|
||||
}
|
||||
assert(true);
|
||||
});
|
||||
@@ -0,0 +1,85 @@
|
||||
import MarkdownIt from "markdown-it";
|
||||
|
||||
import { alert } from "npm:@mdit/plugin-alert";
|
||||
import { attrs } from "npm:@mdit/plugin-attrs";
|
||||
import { abbr } from "npm:@mdit/plugin-abbr";
|
||||
import { align } from "npm:@mdit/plugin-align";
|
||||
import { container } from "npm:@mdit/plugin-container";
|
||||
import { demo } from "npm:@mdit/plugin-demo";
|
||||
import { dl } from "npm:@mdit/plugin-dl";
|
||||
import { embed } from "npm:@mdit/plugin-embed";
|
||||
import { fullEmoji } from "npm:@mdit/plugin-emoji";
|
||||
import { field } from "npm:@mdit/plugin-field";
|
||||
import { figure } from "npm:@mdit/plugin-figure";
|
||||
import { footnote } from "npm:@mdit/plugin-footnote";
|
||||
import { icon } from "npm:@mdit/plugin-icon";
|
||||
import { imgLazyload } from "npm:@mdit/plugin-img-lazyload";
|
||||
import { imgMark } from "npm:@mdit/plugin-img-mark";
|
||||
import { imgSize } from "npm:@mdit/plugin-img-size";
|
||||
import { include } from "npm:@mdit/plugin-include";
|
||||
import { ins } from "npm:@mdit/plugin-ins";
|
||||
import { katex } from "npm:@mdit/plugin-katex";
|
||||
import { layout } from "npm:@mdit/plugin-layout";
|
||||
import { mark } from "npm:@mdit/plugin-mark";
|
||||
import { plantuml } from "npm:@mdit/plugin-plantuml";
|
||||
import { ruby } from "npm:@mdit/plugin-ruby";
|
||||
import { snippet } from "npm:@mdit/plugin-snippet";
|
||||
import { spoiler } from "npm:@mdit/plugin-spoiler";
|
||||
import { stylize } from "npm:@mdit/plugin-stylize";
|
||||
import { sub } from "npm:@mdit/plugin-sub";
|
||||
import { sup } from "npm:@mdit/plugin-sup";
|
||||
import { tab } from "npm:@mdit/plugin-tab";
|
||||
import { tasklist } from "npm:@mdit/plugin-tasklist";
|
||||
import { tex } from "npm:@mdit/plugin-tex";
|
||||
import { uml } from "npm:@mdit/plugin-uml";
|
||||
|
||||
export const md = MarkdownIt({
|
||||
html: true,
|
||||
linkify: true,
|
||||
typographer: true,
|
||||
})
|
||||
.use(alert)
|
||||
.use(attrs)
|
||||
.use(abbr)
|
||||
.use(align)
|
||||
.use(container, { name: "warning", validate: () => true })
|
||||
.use(demo)
|
||||
.use(dl)
|
||||
.use(embed, {
|
||||
config: [
|
||||
{
|
||||
name: "youtube",
|
||||
setup: (id: string) =>
|
||||
`<iframe width="560" height="315" src="https://www.youtube.com/embed/${id}" frameborder="0" allowfullscreen></iframe>`,
|
||||
},
|
||||
{
|
||||
name: "icon",
|
||||
allowInline: true,
|
||||
setup: (name: string) => `<i class="icon icon-${name}"></i>`,
|
||||
},
|
||||
],
|
||||
})
|
||||
.use(fullEmoji)
|
||||
.use(field)
|
||||
.use(figure)
|
||||
.use(footnote)
|
||||
.use(icon)
|
||||
.use(imgLazyload)
|
||||
.use(imgMark)
|
||||
.use(imgSize)
|
||||
//.use(include)
|
||||
.use(ins)
|
||||
.use(katex)
|
||||
.use(layout)
|
||||
.use(mark)
|
||||
.use(plantuml)
|
||||
.use(ruby)
|
||||
//.use(snippet)
|
||||
.use(spoiler)
|
||||
.use(stylize)
|
||||
.use(sub)
|
||||
.use(sup)
|
||||
.use(tab)
|
||||
.use(tasklist)
|
||||
//.use(tex)
|
||||
.use(uml);
|
||||
@@ -0,0 +1,26 @@
|
||||
import { assertEquals } from "@std/assert";
|
||||
import { DocuBuilder } from "./docu_builder.ts";
|
||||
|
||||
Deno.test("PDF rendering loads relative assets from configured file base", async () => {
|
||||
const chromiumPath = Deno.env.get("CHROMIUM_PATH");
|
||||
if (!chromiumPath) {
|
||||
console.warn("Skipping Chromium asset test: CHROMIUM_PATH is unset");
|
||||
return;
|
||||
}
|
||||
|
||||
const builder = new DocuBuilder({
|
||||
asset_base: "../../assets",
|
||||
journal: { build_js_script: false },
|
||||
});
|
||||
const pdfPath = await Deno.makeTempFile({ suffix: ".pdf" });
|
||||
await builder.with_browser();
|
||||
try {
|
||||
await builder.build_as_pdf({ path: pdfPath, format: "A4" }, [
|
||||
'<img src="pictures/rsf.png" alt="Asset">',
|
||||
]);
|
||||
} finally {
|
||||
await builder.close_browser();
|
||||
}
|
||||
assertEquals((await Deno.stat(pdfPath)).size > 0, true);
|
||||
await Deno.remove(pdfPath);
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
import "openpgp";
|
||||
import * as openpgp from "openpgp";
|
||||
import { PathLike } from "node:fs";
|
||||
export function resolveChromiumPath(): string {
|
||||
const chromiumPath = Deno.env.get("CHROMIUM_PATH");
|
||||
if (chromiumPath) {
|
||||
return chromiumPath;
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
[
|
||||
"CHROMIUM_PATH is not set.",
|
||||
"Use the provided flake shell or set CHROMIUM_PATH manually.",
|
||||
'Example: export CHROMIUM_PATH="$(command -v chromium)"',
|
||||
].join("\n"),
|
||||
);
|
||||
}
|
||||
export class OpenPGPSigner {
|
||||
file_path: PathLike;
|
||||
output_path: PathLike;
|
||||
pri_key: Promise<openpgp.PrivateKey>;
|
||||
pri_passphrase?: string;
|
||||
|
||||
constructor(
|
||||
file: PathLike,
|
||||
pri_key: PathLike,
|
||||
output_path: PathLike,
|
||||
pri_passphrase?: string,
|
||||
) {
|
||||
this.file_path = file;
|
||||
this.output_path = output_path;
|
||||
this.pri_passphrase = pri_passphrase;
|
||||
this.pri_key = openpgp.readPrivateKey({
|
||||
armoredKey: Deno.readTextFileSync(pri_key as string),
|
||||
});
|
||||
}
|
||||
|
||||
private async getDecryptedPrivateKey(): Promise<openpgp.PrivateKey> {
|
||||
let privateKey = await this.pri_key;
|
||||
if (this.pri_passphrase) {
|
||||
privateKey = await openpgp.decryptKey({
|
||||
privateKey,
|
||||
passphrase: this.pri_passphrase,
|
||||
});
|
||||
}
|
||||
return privateKey;
|
||||
}
|
||||
|
||||
async sign() {
|
||||
const file_bytes = await Deno.readFile(this.file_path as string);
|
||||
const message = await openpgp.createMessage({ binary: file_bytes });
|
||||
const signingKey = await this.getDecryptedPrivateKey();
|
||||
const signature = await openpgp.sign({
|
||||
message,
|
||||
signingKeys: signingKey,
|
||||
format: "armored",
|
||||
detached: true,
|
||||
});
|
||||
await Deno.writeTextFile(this.output_path as string, signature);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { type GPConfig, processPdfConfig } from "./pdf_pipeline.ts";
|
||||
import type { TemplateVariables } from "./template_engine.ts";
|
||||
|
||||
type WorkerRequest = {
|
||||
id: number;
|
||||
config: GPConfig;
|
||||
options: {
|
||||
addIndex?: boolean | number;
|
||||
useQpdf?: boolean;
|
||||
signPdf?: boolean;
|
||||
signPassphrase?: string;
|
||||
keepIndexPdf?: boolean;
|
||||
variables?: TemplateVariables;
|
||||
};
|
||||
};
|
||||
|
||||
type WorkerResponse =
|
||||
| { id: number; ok: true }
|
||||
| { id: number; ok: false; error: string };
|
||||
|
||||
const workerGlobal = self as unknown as {
|
||||
onmessage: ((event: MessageEvent<WorkerRequest>) => void) | null;
|
||||
postMessage: (message: WorkerResponse) => void;
|
||||
};
|
||||
|
||||
workerGlobal.onmessage = async (event: MessageEvent<WorkerRequest>) => {
|
||||
const { id, config, options } = event.data;
|
||||
try {
|
||||
await processPdfConfig(config, options);
|
||||
workerGlobal.postMessage({ id, ok: true } satisfies WorkerResponse);
|
||||
} catch (error) {
|
||||
workerGlobal.postMessage(
|
||||
{
|
||||
id,
|
||||
ok: false,
|
||||
error: error instanceof Error ? error.stack ?? error.message : String(
|
||||
error,
|
||||
),
|
||||
} satisfies WorkerResponse,
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,307 @@
|
||||
import { basename, dirname, join, relative, resolve } from "node:path";
|
||||
import { cfg } from "./main.ts";
|
||||
|
||||
type WebDavOptions = Record<string, unknown>;
|
||||
type WebDavConfig = {
|
||||
baseUrl: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
remoteDir: string;
|
||||
};
|
||||
|
||||
async function readDotEnv(): Promise<Record<string, string>> {
|
||||
const result: Record<string, string> = {};
|
||||
try {
|
||||
for (const line of (await Deno.readTextFile(".env")).split(/\r?\n/)) {
|
||||
const match = line.match(
|
||||
/^\s*(?:export\s+)?([A-Za-z_][\w]*)\s*=\s*(.*)\s*$/,
|
||||
);
|
||||
if (!match) continue;
|
||||
result[match[1]] = match[2].replace(/^(["'])(.*)\1$/, "$2");
|
||||
}
|
||||
} catch (error) {
|
||||
if (!(error instanceof Deno.errors.NotFound)) throw error;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
async function webDavConfig(options: WebDavOptions): Promise<WebDavConfig> {
|
||||
const env = await readDotEnv();
|
||||
const envValue = (...keys: string[]) => {
|
||||
for (const key of keys) {
|
||||
const value = env[key] ?? Deno.env.get(key);
|
||||
if (value) return value;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
const baseUrl = String(
|
||||
options.url ?? envValue("WEBDAV_URL", "WEBDAV_BASE_URL") ?? "",
|
||||
);
|
||||
if (!baseUrl) {
|
||||
throw new Error("WebDAV URL required: --url or WEBDAV_URL in .env");
|
||||
}
|
||||
const parsedBaseUrl = new URL(baseUrl);
|
||||
if (!/^https?:$/.test(parsedBaseUrl.protocol)) {
|
||||
throw new Error("WebDAV URL must use HTTP or HTTPS");
|
||||
}
|
||||
const remoteDir = String(
|
||||
options["remote-dir"] ?? envValue("WEBDAV_REMOTE_DIR") ?? "gp_upload",
|
||||
).replace(/^\/+|\/+$/g, "");
|
||||
if (remoteDir.split("/").some((part) => part === "." || part === "..")) {
|
||||
throw new Error("WebDAV remote directory cannot contain dot segments");
|
||||
}
|
||||
return {
|
||||
baseUrl: baseUrl.replace(/\/+$/, ""),
|
||||
username: String(
|
||||
options.user ?? envValue("WEBDAV_USERNAME", "WEBDAV_USER") ?? "",
|
||||
) || undefined,
|
||||
password: String(options.password ?? envValue("WEBDAV_PASSWORD") ?? "") ||
|
||||
undefined,
|
||||
remoteDir,
|
||||
};
|
||||
}
|
||||
|
||||
function authHeaders(config: WebDavConfig): HeadersInit {
|
||||
if (!config.username && !config.password) return {};
|
||||
const token = btoa(`${config.username ?? ""}:${config.password ?? ""}`);
|
||||
return { authorization: `Basic ${token}` };
|
||||
}
|
||||
|
||||
function remoteUrl(config: WebDavConfig, path: string): string {
|
||||
const base = new URL(`${config.baseUrl}/`);
|
||||
const suffix = [config.remoteDir, path].filter(Boolean).join("/");
|
||||
return new URL(suffix.split("/").map(encodeURIComponent).join("/"), base)
|
||||
.href;
|
||||
}
|
||||
|
||||
async function ensureCollection(
|
||||
config: WebDavConfig,
|
||||
path: string,
|
||||
): Promise<void> {
|
||||
const url = remoteUrl(config, path);
|
||||
const response = await fetch(url, {
|
||||
method: "MKCOL",
|
||||
headers: authHeaders(config),
|
||||
});
|
||||
if (
|
||||
response.ok || response.status === 405 || response.status === 301 ||
|
||||
response.status === 302
|
||||
) return;
|
||||
if (response.status === 409) {
|
||||
const parent = dirname(path);
|
||||
if (parent !== "." && parent !== path) {
|
||||
await ensureCollection(config, parent);
|
||||
}
|
||||
const retry = await fetch(url, {
|
||||
method: "MKCOL",
|
||||
headers: authHeaders(config),
|
||||
});
|
||||
if (retry.ok || retry.status === 405) return;
|
||||
throw new Error(`WebDAV MKCOL ${path} failed: HTTP ${retry.status}`);
|
||||
}
|
||||
throw new Error(`WebDAV MKCOL ${path} failed: HTTP ${response.status}`);
|
||||
}
|
||||
|
||||
async function walkFiles(root: string): Promise<string[]> {
|
||||
const files: string[] = [];
|
||||
for (const entry of Deno.readDirSync(root)) {
|
||||
const path = join(root, entry.name);
|
||||
if (entry.isDirectory) files.push(...await walkFiles(path));
|
||||
else if (entry.isFile) files.push(path);
|
||||
}
|
||||
return files;
|
||||
}
|
||||
|
||||
function roots(
|
||||
options: WebDavOptions,
|
||||
): Array<{ local: string; remote: string }> {
|
||||
const type = String(options.type ?? "all");
|
||||
if (!new Set(["all", "assets", "cache"]).has(type)) {
|
||||
throw new Error("--type must be all, cache, or assets");
|
||||
}
|
||||
const injectedRoots = options.localRoots;
|
||||
if (Array.isArray(injectedRoots)) {
|
||||
return injectedRoots.filter((
|
||||
root,
|
||||
): root is { local: string; remote: string } =>
|
||||
root && typeof root.local === "string" &&
|
||||
typeof root.remote === "string" &&
|
||||
((type === "all" &&
|
||||
(root.remote === "assets" || root.remote.startsWith("cache/"))) ||
|
||||
(type === "assets" && root.remote === "assets") ||
|
||||
(type === "cache" && root.remote.startsWith("cache/")))
|
||||
);
|
||||
}
|
||||
const roots: Array<{ local: string; remote: string }> = [];
|
||||
if (type === "all" || type === "assets") {
|
||||
roots.push({ local: resolve("../../assets"), remote: "assets" });
|
||||
}
|
||||
if (type === "all" || type === "cache") {
|
||||
for (const setting of cfg.settings) {
|
||||
const publication = resolve(setting.journal.from_directory);
|
||||
roots.push({
|
||||
local: publication,
|
||||
remote: `cache/${basename(publication)}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
return roots;
|
||||
}
|
||||
|
||||
export async function upload_webdav(options: WebDavOptions): Promise<void> {
|
||||
const config = await webDavConfig(options);
|
||||
await ensureCollection(config, "");
|
||||
for (const root of roots(options)) {
|
||||
try {
|
||||
await Deno.stat(root.local);
|
||||
} catch (error) {
|
||||
if (error instanceof Deno.errors.NotFound) continue;
|
||||
throw error;
|
||||
}
|
||||
await ensureCollection(config, root.remote);
|
||||
for (const file of await walkFiles(root.local)) {
|
||||
const path = relative(root.local, file).split("\\").join("/");
|
||||
if (
|
||||
root.remote.startsWith("cache/") && path !== ".cache.toml" &&
|
||||
!path.startsWith(".local-cache/")
|
||||
) continue;
|
||||
const parent = dirname(path);
|
||||
if (parent !== ".") {
|
||||
await ensureCollection(config, `${root.remote}/${parent}`);
|
||||
}
|
||||
const response = await fetch(
|
||||
remoteUrl(config, `${root.remote}/${path}`),
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
...authHeaders(config),
|
||||
"content-type": "application/octet-stream",
|
||||
},
|
||||
body: await Deno.readFile(file),
|
||||
},
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error(`WebDAV PUT ${path} failed: HTTP ${response.status}`);
|
||||
}
|
||||
console.log(`Uploaded ${file}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function sync_webdav(options: WebDavOptions): Promise<void> {
|
||||
const config = await webDavConfig(options);
|
||||
for (const root of roots(options)) {
|
||||
await Deno.mkdir(root.local, { recursive: true });
|
||||
await downloadCollection(config, root.remote, root.local);
|
||||
}
|
||||
}
|
||||
|
||||
async function downloadCollection(
|
||||
config: WebDavConfig,
|
||||
remotePath: string,
|
||||
localPath: string,
|
||||
): Promise<void> {
|
||||
const response = await fetch(remoteUrl(config, remotePath), {
|
||||
method: "PROPFIND",
|
||||
headers: { ...authHeaders(config), Depth: "1" },
|
||||
});
|
||||
if (response.status === 404) return;
|
||||
if (!response.ok) {
|
||||
throw new Error(
|
||||
`WebDAV PROPFIND ${remotePath} failed: HTTP ${response.status}`,
|
||||
);
|
||||
}
|
||||
const xml = await response.text();
|
||||
const requestUrl = new URL(remoteUrl(config, remotePath));
|
||||
const basePath = requestUrl.pathname.replace(/\/+$/, "");
|
||||
const responses = [
|
||||
...xml.matchAll(/<[^>]*response\b[^>]*>([\s\S]*?)<\/[^>]*response>/gi),
|
||||
];
|
||||
for (const [, responseXml] of responses) {
|
||||
const hrefMatch = responseXml.match(/<[^>]*href[^>]*>(.*?)<\/[^>]*href>/i);
|
||||
if (!hrefMatch) continue;
|
||||
const href = decodeXmlText(hrefMatch[1].trim());
|
||||
let parsed: URL;
|
||||
try {
|
||||
parsed = new URL(href, config.baseUrl);
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
if (parsed.origin !== requestUrl.origin) continue;
|
||||
const entry = parsed.pathname.replace(/\/+$/, "");
|
||||
if (entry === basePath || !entry.startsWith(`${basePath}/`)) continue;
|
||||
const relativePath = entry.slice(basePath.length + 1);
|
||||
let name: string;
|
||||
try {
|
||||
name = decodeURIComponent(relativePath);
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
if (name.includes("/")) continue;
|
||||
if (!name || name === "." || name === ".." || name.includes("\\")) {
|
||||
continue;
|
||||
}
|
||||
const isDirectory = /<[^>]*collection\b/i.test(responseXml);
|
||||
if (isDirectory) {
|
||||
await Deno.mkdir(join(localPath, name), { recursive: true });
|
||||
await downloadCollection(
|
||||
config,
|
||||
`${remotePath}/${name}`,
|
||||
join(localPath, name),
|
||||
);
|
||||
} else {
|
||||
const fileResponse = await fetch(new URL(href, config.baseUrl), {
|
||||
headers: authHeaders(config),
|
||||
});
|
||||
if (!fileResponse.ok) {
|
||||
throw new Error(
|
||||
`WebDAV GET ${name} failed: HTTP ${fileResponse.status}`,
|
||||
);
|
||||
}
|
||||
await Deno.writeFile(
|
||||
join(localPath, name),
|
||||
new Uint8Array(await fileResponse.arrayBuffer()),
|
||||
);
|
||||
console.log(`Downloaded ${join(localPath, name)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function decodeXmlText(text: string): string {
|
||||
return text.replace(/&(?:amp|lt|gt|quot|apos);/g, (entity) => ({
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
">": ">",
|
||||
""": '"',
|
||||
"'": "'",
|
||||
}[entity] ?? entity));
|
||||
}
|
||||
|
||||
export async function clean_local_files(options: WebDavOptions): Promise<void> {
|
||||
const type = String(options.type ?? "all");
|
||||
if (!new Set(["all", "cache", "assets"]).has(type)) {
|
||||
throw new Error("clean --type must be all, cache, or assets");
|
||||
}
|
||||
const targets: string[] = [];
|
||||
if (type === "all" || type === "assets") {
|
||||
targets.push(resolve("../../assets"));
|
||||
}
|
||||
if (type === "all" || type === "cache") {
|
||||
for (const setting of cfg.settings) {
|
||||
targets.push(
|
||||
join(resolve(setting.journal.from_directory), ".local-cache"),
|
||||
);
|
||||
targets.push(
|
||||
join(resolve(setting.journal.from_directory), ".cache.toml"),
|
||||
);
|
||||
}
|
||||
}
|
||||
for (const target of new Set(targets)) {
|
||||
try {
|
||||
await Deno.remove(target, { recursive: true });
|
||||
console.log(`Removed ${target}`);
|
||||
} catch (error) {
|
||||
if (!(error instanceof Deno.errors.NotFound)) throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
import { assert, assertEquals, assertRejects } from "@std/assert";
|
||||
import { clean_local_files, sync_webdav, upload_webdav } from "./webdav.ts";
|
||||
|
||||
function propfindResponse(
|
||||
entries: Array<{
|
||||
href: string;
|
||||
collection?: boolean;
|
||||
}>,
|
||||
): Response {
|
||||
const responses = entries.map(({ href, collection }) =>
|
||||
`<d:response><d:href>${href}</d:href><d:propstat><d:prop>$
|
||||
${collection ? "<d:resourcetype><d:collection/></d:resourcetype>" : ""}
|
||||
</d:prop></d:propstat></d:response>`
|
||||
).join("");
|
||||
return new Response(
|
||||
`<?xml version="1.0"?><d:multistatus xmlns:d="DAV:">${responses}</d:multistatus>`,
|
||||
{ status: 207 },
|
||||
);
|
||||
}
|
||||
|
||||
Deno.test("WebDAV sync maps assets and cache into their local roots", async () => {
|
||||
const base = "https://dav.example.test/remote.php/dav/files/user";
|
||||
const root = await Deno.makeTempDir();
|
||||
const assetsRoot = `${root}/assets`;
|
||||
const cacheRoot = `${root}/publication`;
|
||||
const seen: string[] = [];
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async (input, init) => {
|
||||
const url = String(input);
|
||||
const method = (init as RequestInit | undefined)?.method ?? "GET";
|
||||
seen.push(`${method} ${url}`);
|
||||
if (method === "PROPFIND" && url.endsWith("/gp_upload/assets")) {
|
||||
return propfindResponse([
|
||||
{ href: `${base}/gp_upload/assets/` },
|
||||
{ href: `${base}/gp_upload/assets/pictures/`, collection: true },
|
||||
{
|
||||
href:
|
||||
"https://evil.example.test/remote.php/dav/files/user/gp_upload/assets/outside.png",
|
||||
},
|
||||
]);
|
||||
}
|
||||
if (method === "PROPFIND" && url.endsWith("/gp_upload/cache/26.11.0")) {
|
||||
return propfindResponse([
|
||||
{ href: `${base}/gp_upload/cache/26.11.0/` },
|
||||
{ href: `${base}/gp_upload/cache/26.11.0/.cache.toml` },
|
||||
{
|
||||
href: `${base}/gp_upload/cache/26.11.0/.local-cache/`,
|
||||
collection: true,
|
||||
},
|
||||
]);
|
||||
}
|
||||
if (method === "PROPFIND" && url.endsWith("/gp_upload/cache")) {
|
||||
return propfindResponse([
|
||||
{ href: `${base}/gp_upload/cache/` },
|
||||
{ href: `${base}/gp_upload/cache/26.11.0/`, collection: true },
|
||||
]);
|
||||
}
|
||||
if (method === "PROPFIND" && url.endsWith("/assets/pictures")) {
|
||||
return propfindResponse([
|
||||
{ href: `${base}/gp_upload/assets/pictures/` },
|
||||
{ href: `${base}/gp_upload/assets/pictures/rsf.png` },
|
||||
]);
|
||||
}
|
||||
if (method === "PROPFIND" && url.endsWith("/.local-cache")) {
|
||||
return propfindResponse([
|
||||
{ href: `${base}/gp_upload/cache/26.11.0/.local-cache/` },
|
||||
{
|
||||
href: `${base}/gp_upload/cache/26.11.0/.local-cache/a.png`,
|
||||
},
|
||||
]);
|
||||
}
|
||||
if (method === "GET") return new Response("ok");
|
||||
throw new Error(`Unexpected WebDAV request: ${method} ${url}`);
|
||||
};
|
||||
try {
|
||||
await sync_webdav({
|
||||
url: base,
|
||||
"remote-dir": "gp_upload",
|
||||
type: "all",
|
||||
localRoots: [
|
||||
{ local: assetsRoot, remote: "assets" },
|
||||
{ local: cacheRoot, remote: "cache/26.11.0" },
|
||||
],
|
||||
});
|
||||
assertEquals(
|
||||
await Deno.readTextFile(`${assetsRoot}/pictures/rsf.png`),
|
||||
"ok",
|
||||
);
|
||||
assertEquals(await Deno.readTextFile(`${cacheRoot}/.cache.toml`), "ok");
|
||||
assertEquals(
|
||||
await Deno.readTextFile(`${cacheRoot}/.local-cache/a.png`),
|
||||
"ok",
|
||||
);
|
||||
assertEquals(
|
||||
seen.some((request) => request.includes("outside.png")),
|
||||
false,
|
||||
);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
await Deno.remove(root, { recursive: true });
|
||||
}
|
||||
});
|
||||
|
||||
Deno.test("WebDAV upload creates remote collections and uploads only cache files", async () => {
|
||||
const root = await Deno.makeTempDir();
|
||||
const publication = `${root}/publication`;
|
||||
await Deno.mkdir(`${publication}/.local-cache`, { recursive: true });
|
||||
await Deno.writeTextFile(`${publication}/.cache.toml`, '"a" = "b"');
|
||||
await Deno.writeTextFile(`${publication}/.local-cache/a.png`, "data");
|
||||
await Deno.writeTextFile(`${publication}/article.md`, "must not upload");
|
||||
const methods: string[] = [];
|
||||
const uploads: string[] = [];
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async (input, init) => {
|
||||
const method = (init as RequestInit | undefined)?.method ?? "GET";
|
||||
methods.push(method);
|
||||
if (method === "PUT") uploads.push(String(input));
|
||||
return new Response(null, { status: 201 });
|
||||
};
|
||||
try {
|
||||
await upload_webdav({
|
||||
url: "https://dav.example.test/root",
|
||||
type: "cache",
|
||||
localRoots: [
|
||||
{ local: publication, remote: "cache/test-publication" },
|
||||
],
|
||||
});
|
||||
assert(methods.includes("MKCOL"));
|
||||
assert(methods.includes("PUT"));
|
||||
assertEquals(uploads.length, 2);
|
||||
assertEquals(uploads.some((url) => url.endsWith("article.md")), false);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
await Deno.remove(root, { recursive: true });
|
||||
}
|
||||
});
|
||||
|
||||
Deno.test("WebDAV commands reject invalid types and unsafe remote roots", async () => {
|
||||
await assertRejects(
|
||||
() => sync_webdav({ url: "https://dav.example.test", type: "other" }),
|
||||
Error,
|
||||
"--type must be all, cache, or assets",
|
||||
);
|
||||
await assertRejects(
|
||||
() => clean_local_files({ type: "invalid" }),
|
||||
Error,
|
||||
"clean --type must be all, cache, or assets",
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user