| 1 | { |
| 2 | "name": "hfs", |
| 3 | "version": "3.2.2", |
| 4 | "description": "HTTP File Server", |
| 5 | "keywords": ["file server", "http server"], |
| 6 | "homepage": "https://rejetto.com/hfs", |
| 7 | "license": "GPL-3.0", |
| 8 | "author": "Massimo Melina <a@rejetto.com>", |
| 9 | "workspaces": [ "admin", "frontend", "shared", "mui-grid-form" ], |
| 10 | "scripts": { |
| 11 | "postinstall": "patch-package", |
| 12 | "watch-server": "cross-env DEV=1 nodemon --ignore tests/ --watch src -e ts,tsx --exec tsx src", |
| 13 | "watch-server-proxied": "cross-env FRONTEND_PROXY=3005 ADMIN_PROXY=3006 npm run watch-server", |
| 14 | "watch-server-full": "npm run start --workspace=frontend & npm run start --workspace=admin & cross-env FRONTEND_PROXY=3005 ADMIN_PROXY=3006 npm run watch-server", |
| 15 | "start-frontend": "npm run start --workspace=frontend", |
| 16 | "start-admin": "npm run start --workspace=admin", |
| 17 | "build-all": "rm -rf dist && npm run build-server && (npm run build-frontend & npm run build-admin) && echo COMPLETED", |
| 18 | "build-server": "rm -rf dist/src dist/plugins && npm i && tsc && touch package.json && cp -v -r package.json central.json README* LICENSE* hfs.ico plugins dist && find dist -name .DS_Store -o -name storage -exec rm -rf {} + && node scripts/afterbuild.js", |
| 19 | "build-frontend": "npm run build --workspace=frontend", |
| 20 | "build-admin": "npm run build --workspace=admin", |
| 21 | "prepare-test": "mkdir -p tests/work tests/tmp && cp tests/config.yaml tests/work/config.yaml && cp tests/alfa.txt tests/tmp/alfa.txt", |
| 22 | "server-for-test": "npm run prepare-test && node dist/src --cwd tests/work --config tests/work/config.yaml --debug", |
| 23 | "server-for-test-dev": "npm run prepare-test && cross-env DEV=1 FRONTEND_PROXY=3005 ADMIN_PROXY=3006 nodemon --ignore tests/ --watch src -e ts,tsx --exec tsx src -- --cwd tests/work --config tests", |
| 24 | "test": "sh -c 'npm run port-is-free >/dev/null && { echo \"no server\"; exit 1; }; node --import tsx --test \"$@\" tests/test.ts' --", |
| 25 | "test-with-server": "sh -c 'npm run port-is-free && tsc && rm -rf tests/work tests/tmp && npm run prepare-test && (node dist/src --cwd tests/work --config tests/work/config.yaml & echo $! > .server_pid) && sleep 2 && node --import tsx --test \"$@\" tests/test.ts; _exit=$?; if [ -f ./.server_pid ]; then SERVER_PID=$(cat ./.server_pid); kill \"$SERVER_PID\" 2>/dev/null || true; rm -f ./.server_pid; fi; exit $_exit' --", |
| 26 | "port-is-free": "node -e \"const port=process.argv[1]||8081;process.exit(await fetch('http://localhost:'+port).then(() => console.log('BUSY')||1, () => 0))\" --", |
| 27 | "test-ui": "npm run port-is-free -- 8081 && rm -rf tests/work tests/work2 tests/tmp && npx playwright test frontend && npx playwright test serial && npx playwright test admin-vfs", |
| 28 | "test-with-ui": "sh -c 'npm run port-is-free -- 3005 && npm run start-frontend & npm run port-is-free -- 3006 && npm run start-admin & cross-env TEST_WITH_UI=1 npx playwright test --ui \"$@\"' --", |
| 29 | "pub": "cd dist && npm publish", |
| 30 | "dist": "STASHED=; STASH_BEFORE=$(git rev-parse -q --verify refs/stash || true); git update-index -q --refresh; if ! git diff-index --quiet HEAD --; then git stash push -m 'dist' || exit $?; STASH_AFTER=$(git rev-parse -q --verify refs/stash || true); [ \"$STASH_AFTER\" != \"$STASH_BEFORE\" ] && STASHED=1; fi; npm audit --omit=dev --audit-level=moderate && CI=1 FORCE_COLOR=1 npm run dist-uncommitted; EXIT_CODE=$?; if [ -n \"$STASHED\" ]; then git stash pop || exit $?; fi; exit $EXIT_CODE", |
| 31 | "dist-uncommitted": "npm audit --omit=dev --audit-level=moderate && rm -rf dist && npm run build-server && npm run test-with-server && (npm run build-frontend & fe=$!; npm run build-admin & ad=$!; wait $fe && wait $ad) && npm run test-ui && npm run dist-bin", |
| 32 | "dist-bin": "npm run dist-modules && npm run dist-bin-win && npm run dist-bin-linux && npm run dist-bin-linux-arm && npm run dist-bin-mac && npm run dist-bin-mac-arm", |
| 33 | "dist-modules": "cp package.json central.json README.md dist && cd dist && npm pkg delete devDependencies workspaces scripts.postinstall && rm -rf node_modules && npm install --omit=dev && npm shrinkwrap && cd .. && node scripts/prune_modules.js", |
| 34 | "dist-bin-win": "cd dist && pkg . --public -C gzip -t node24-win-x64 && npx resedit-cli --in hfs.exe --icon 1,../hfs.ico --out hfs.exe && zip hfs-windows-x64-$(jq -r .version ../package.json).zip hfs.exe -r plugins && cd ..", |
| 35 | "dist-bin-mac-arm": "cd dist && pkg . --public -C gzip -t node24-macos-arm64 && zip hfs-mac-arm64-$(jq -r .version ../package.json).zip hfs -r plugins && cd ..", |
| 36 | "dist-bin-mac": "cd dist && pkg . --public -C gzip -t node24-macos-x64 && zip hfs-mac-x64-$(jq -r .version ../package.json).zip hfs -r plugins && cd ..", |
| 37 | "dist-bin-linux": "cd dist && pkg . --public --public-packages \"*\" -C gzip -t node24-linux-x64 && zip hfs-linux-x64-$(jq -r .version ../package.json).zip hfs -r plugins && cd ..", |
| 38 | "dist-bin-linux-arm": "cd dist && pkg . --public --public-packages \"*\" -C gzip -t node24-linux-arm64 && zip hfs-linux-arm64-$(jq -r .version ../package.json).zip hfs -r plugins && cd ..", |
| 39 | "dist-win": "npm run dist-modules && npm run dist-bin-win", |
| 40 | "dist-mac-arm": "npm run dist-modules && npm run dist-bin-mac-arm", |
| 41 | "dist-mac": "npm run dist-modules && npm run dist-bin-mac", |
| 42 | "dist-linux": "npm run dist-modules && npm run dist-bin-linux", |
| 43 | "dist-node": "npm run dist-modules && cd dist && zip hfs-node-$(jq -r .version ../package.json).zip -r * -x *.zip *.exe hfs-* *.log logs" |
| 44 | }, |
| 45 | "engines": { |
| 46 | "node": ">=18.15.0" |
| 47 | }, |
| 48 | "files": [ |
| 49 | "central.json", |
| 50 | "npm-shrinkwrap.json", |
| 51 | "src/*", |
| 52 | "admin/*", |
| 53 | "frontend/*", |
| 54 | "plugins/*" |
| 55 | ], |
| 56 | "repository": { |
| 57 | "type": "git", |
| 58 | "url": "git+https://github.com/rejetto/hfs.git" |
| 59 | }, |
| 60 | "bin": { |
| 61 | "hfs": "src/index.js" |
| 62 | }, |
| 63 | "pkg": { |
| 64 | "assets": [ |
| 65 | "central.json", |
| 66 | "src/statWorker.js", |
| 67 | "admin/**/*", |
| 68 | "frontend/**/*", |
| 69 | "**/node_modules/fswin/x64/*", |
| 70 | "**/node_modules/axios/dist/node/*", |
| 71 | "**/node_modules/buffers/**", |
| 72 | "**/node_modules/binary/**", |
| 73 | "**/node_modules/unzipper/**" |
| 74 | ], |
| 75 | "targets": [ |
| 76 | "node24-win-x64", |
| 77 | "node24-mac-x64", |
| 78 | "node24-mac-arm64", |
| 79 | "node24-linux-x64", |
| 80 | "node24-linux-arm64" |
| 81 | ] |
| 82 | }, |
| 83 | "dependencies": { |
| 84 | "@gregoranders/csv": "^0.0.13", |
| 85 | "@rejetto/kvstorage": "^0.17.7", |
| 86 | "@rejetto/nat-upnp": "^2.1.4", |
| 87 | "acme-client": "^5.4.0", |
| 88 | "busboy": "^1.6.0", |
| 89 | "crc-32": "^1.2.2", |
| 90 | "fast-glob": "^3.3.3", |
| 91 | "fast-xml-parser": "^5.4.2", |
| 92 | "find-process": "^2.0.0", |
| 93 | "fs-x-attributes": "^1.0.2", |
| 94 | "fswin": "^3.24.829", |
| 95 | "iconv-lite": "^0.7.0", |
| 96 | "ip2location-nodejs": "^9.7.0", |
| 97 | "koa": "^3.1.2", |
| 98 | "koa-compress": "^5.2.0", |
| 99 | "koa-mount": "^4.2.0", |
| 100 | "koa-session": "^7.0.2", |
| 101 | "limiter": "^3.0.0", |
| 102 | "lodash": "^4.17.21", |
| 103 | "mime-types": "*", |
| 104 | "minimist": "^1.2.8", |
| 105 | "node-forge": "^1.3.1", |
| 106 | "open": "^8.4.0", |
| 107 | "picomatch": "^4.0.3", |
| 108 | "tssrp6a": "^3.0.0", |
| 109 | "unzipper": "^0.12.3", |
| 110 | "valtio": "^1.13.2", |
| 111 | "xxhashjs": "^0.2.2", |
| 112 | "yaml": "^2.8.1", |
| 113 | "yazl": "^3.3.1" |
| 114 | }, |
| 115 | "devDependencies": { |
| 116 | "@playwright/test": "^1.60.0", |
| 117 | "@types/busboy": "^1.5.4", |
| 118 | "@types/koa": "^3.0.0", |
| 119 | "@types/koa-mount": "^4.0.5", |
| 120 | "@types/lodash": "^4.17.20", |
| 121 | "@types/mime-types": "^3.0.1", |
| 122 | "@types/minimist": "^1.2.5", |
| 123 | "@types/node": "^20.17.30", |
| 124 | "@types/node-forge": "^1.3.14", |
| 125 | "@types/picomatch": "^4.0.2", |
| 126 | "@types/unzipper": "^0.10.11", |
| 127 | "@types/yazl": "^3.3.0", |
| 128 | "@yao-pkg/pkg": "6.20.0", |
| 129 | "cross-env": "^10.0.0", |
| 130 | "koa-better-http-proxy": "^0.2.10", |
| 131 | "nm-prune": "^5.0.0", |
| 132 | "nodemon": "^3.1.10", |
| 133 | "patch-package": "^8.0.1", |
| 134 | "tsx": "^4.20.5", |
| 135 | "typescript": "^5.9.2" |
| 136 | } |
| 137 | } |