hfs 0.26.1 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{c as SF}from"./index.5c49e66e.js";function OF(sF,hF){for(var eF=0;eF<hF.length;eF++){const tF=hF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var yF={exports:{}};/*
1
+ import{c as SF}from"./index.55c710c2.js";function OF(sF,hF){for(var eF=0;eF<hF.length;eF++){const tF=hF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var yF={exports:{}};/*
2
2
  * [js-sha512]{@link https://github.com/emn178/js-sha512}
3
3
  *
4
4
  * @version 0.8.0
@@ -6,7 +6,7 @@
6
6
  <link href="fontello.css" rel="stylesheet" />
7
7
  <script>SESSION = _HFS_SESSION_</script>
8
8
  <title>File Server</title>
9
- <script type="module" crossorigin src="/assets/index.0f8e459c.js"></script>
9
+ <script type="module" crossorigin src="/assets/index.55c710c2.js"></script>
10
10
  <link rel="stylesheet" href="/assets/index.ee805a6c.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hfs",
3
- "version": "0.26.1",
3
+ "version": "0.26.2",
4
4
  "description": "HTTP File Server",
5
5
  "keywords": [
6
6
  "file server",
@@ -27,9 +27,10 @@
27
27
  "test": "mocha -r ts-node/register 'tests/**/*.ts'",
28
28
  "pub": "cd dist && npm publish",
29
29
  "dist": "npm run build-all && npm run dist-bin",
30
- "dist-bin": "npm run dist-modules && cd dist && pkg . -C gzip && mv -f hfs-win.exe hfs.exe && zip hfs-windows.zip hfs.exe -r plugins && cp -f hfs-linux hfs && zip hfs-linux.zip hfs -r plugins && cp -f hfs-macos hfs && zip hfs-mac.zip hfs -r plugins && rm hfs",
30
+ "dist-bin": "npm run dist-modules && cd dist && pkg . -C gzip && mv -f hfs-win-x64.exe hfs.exe && zip hfs-windows.zip hfs.exe -r plugins && cp -f hfs-linux-x64 hfs && zip hfs-linux.zip hfs -r plugins && cp -f hfs-macos-x64 hfs && zip hfs-mac.zip hfs -r plugins && cp -f hfs-macos-arm64 hfs && zip hfs-mac-arm.zip hfs -r plugins && rm hfs",
31
31
  "dist-modules": "cp package*.json dist && cd dist && npm ci --omit=dev && npm i -f --no-save --omit=dev @node-rs/crc32-win32-x64-msvc && rm package-lock.json && cd .. && node prune_modules",
32
- "dist-win": "npm run dist-modules && pkg . -C gzip -t node16-win && cd dist && zip hfs-windows.zip hfs.exe -r plugins",
32
+ "dist-win": "npm run dist-modules && cd dist && pkg . -C gzip -t node16-win-x64 && zip hfs-windows.zip hfs.exe -r plugins",
33
+ "dist-mac": "cd dist && pkg . -C gzip -t node16-mac-arm64",
33
34
  "dist-node": "npm run dist-modules && cd dist && zip hfs-node.zip -r * -x *.zip *.exe hfs-* *.log logs"
34
35
  },
35
36
  "engines": {
@@ -53,9 +54,10 @@
53
54
  "frontend/**/*"
54
55
  ],
55
56
  "targets": [
56
- "node16-win",
57
- "node16-mac",
58
- "node16-linux"
57
+ "node16-win-x64",
58
+ "node16-mac-x64",
59
+ "node16-mac-arm64",
60
+ "node16-linux-x64"
59
61
  ]
60
62
  },
61
63
  "dependencies": {
@@ -37,7 +37,7 @@ const ZIP64_NUMBER_LIMIT = 0xffff;
37
37
  let crc32function;
38
38
  Promise.resolve().then(() => __importStar(require('@node-rs/crc32'))).then(lib => crc32function = lib.crc32, () => {
39
39
  console.log('using generic lib for crc32');
40
- return crc32function = buffer_crc32_1.crc32.unsigned;
40
+ crc32function = buffer_crc32_1.unsigned;
41
41
  });
42
42
  const FLAGS = 0x0808; // bit3 = no crc in local header + bit11 = utf8
43
43
  class QuickZipStream extends stream_1.Readable {
package/src/const.js CHANGED
@@ -55,7 +55,8 @@ exports.NO_CONTENT = 204;
55
55
  exports.FORBIDDEN = 403;
56
56
  exports.UNAUTHORIZED = 401;
57
57
  exports.IS_WINDOWS = process.platform === 'win32';
58
- exports.APP_PATH = (0, path_1.resolve)(__dirname + '/..');
58
+ const IS_BINARY = !(0, path_1.basename)(process.argv0).includes('node'); // this won't be node if pkg was used
59
+ exports.APP_PATH = (0, path_1.dirname)(IS_BINARY ? process.argv0 : __dirname);
59
60
  // we want this to be the first stuff to be printed, then we print it in this module, that is executed at the beginning
60
61
  if (exports.DEV)
61
62
  console.clear();
package/src/serveFile.js CHANGED
@@ -38,7 +38,7 @@ function serveFileNode(node) {
38
38
  };
39
39
  }
40
40
  exports.serveFileNode = serveFileNode;
41
- const mimeCfg = (0, config_1.defineConfig)('mime', { '*.jpg|*.png|*.mp3|*.txt': 'auto' });
41
+ const mimeCfg = (0, config_1.defineConfig)('mime', { '*': 'auto' });
42
42
  function serveFile(source, mime, content) {
43
43
  return async (ctx) => {
44
44
  if (!source)
@@ -1 +0,0 @@
1
- body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:100vh}#root{min-height:100%;display:flex}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.MuiTreeItem-content{box-sizing:border-box}ol,ul{margin-top:.2em}