@remix-run/static-middleware 0.4.13 → 0.4.15
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.
- package/LICENSE +0 -1
- package/README.md +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/directory-listing.d.ts.map +1 -1
- package/dist/lib/directory-listing.js +22 -4
- package/dist/lib/static.js +1 -1
- package/package.json +13 -13
- package/src/lib/directory-listing.ts +22 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { staticFiles } from
|
|
1
|
+
export { staticFiles } from './lib/static.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory-listing.d.ts","sourceRoot":"","sources":["../../src/lib/directory-listing.ts"],"names":[],"mappings":"AAaA,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"directory-listing.d.ts","sourceRoot":"","sources":["../../src/lib/directory-listing.ts"],"names":[],"mappings":"AAaA,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,CAAC,CAuQnB"}
|
|
@@ -47,8 +47,25 @@ export async function generateDirectoryListing(dirPath, pathname) {
|
|
|
47
47
|
});
|
|
48
48
|
// Build table rows
|
|
49
49
|
let tableRows = [];
|
|
50
|
-
let folderIcon = html.raw `<svg
|
|
51
|
-
|
|
50
|
+
let folderIcon = html.raw `<svg
|
|
51
|
+
class="icon"
|
|
52
|
+
viewBox="0 0 16 16"
|
|
53
|
+
fill="none"
|
|
54
|
+
stroke="currentColor"
|
|
55
|
+
stroke-width="1.5"
|
|
56
|
+
>
|
|
57
|
+
<path d="M2 3.5h4.5l1.5 1.5h6v8h-12z" />
|
|
58
|
+
</svg>`;
|
|
59
|
+
let fileIcon = html.raw `<svg
|
|
60
|
+
class="icon"
|
|
61
|
+
viewBox="0 0 16 16"
|
|
62
|
+
fill="none"
|
|
63
|
+
stroke="currentColor"
|
|
64
|
+
stroke-width="1.5"
|
|
65
|
+
>
|
|
66
|
+
<path d="M3 2h7l3 3v9H3z" />
|
|
67
|
+
<path d="M10 2v3h3" />
|
|
68
|
+
</svg>`;
|
|
52
69
|
// Add parent directory link if not at root
|
|
53
70
|
if (pathname !== '/' && pathname !== '') {
|
|
54
71
|
let parentPath = pathname.replace(/\/$/, '').split('/').slice(0, -1).join('/') || '/';
|
|
@@ -88,8 +105,9 @@ export async function generateDirectoryListing(dirPath, pathname) {
|
|
|
88
105
|
box-sizing: border-box;
|
|
89
106
|
}
|
|
90
107
|
body {
|
|
91
|
-
font-family:
|
|
92
|
-
|
|
108
|
+
font-family:
|
|
109
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
110
|
+
'Open Sans', 'Helvetica Neue', sans-serif;
|
|
93
111
|
margin: 0;
|
|
94
112
|
padding: 2rem 1rem;
|
|
95
113
|
background: #fff;
|
package/dist/lib/static.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as fsp from 'node:fs/promises';
|
|
|
3
3
|
import { openLazyFile } from '@remix-run/fs';
|
|
4
4
|
import { detectMimeType } from '@remix-run/mime';
|
|
5
5
|
import { createFileResponse as sendFile } from '@remix-run/response/file';
|
|
6
|
-
import { generateDirectoryListing } from
|
|
6
|
+
import { generateDirectoryListing } from './directory-listing.js';
|
|
7
7
|
/**
|
|
8
8
|
* Creates a middleware that serves static files from the filesystem.
|
|
9
9
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remix-run/static-middleware",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.15",
|
|
4
4
|
"description": "Middleware for serving static files from the filesystem",
|
|
5
5
|
"author": "Michael Jackson <mjijackson@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^24.6.0",
|
|
30
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
31
|
-
"@remix-run/assert": "0.3.0",
|
|
32
|
-
"@remix-run/fetch-router": "0.
|
|
33
|
-
"@remix-run/
|
|
34
|
-
"@remix-run/
|
|
35
|
-
"@remix-run/mime": "0.4.2",
|
|
36
|
-
"@remix-run/
|
|
37
|
-
"@remix-run/
|
|
30
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
31
|
+
"@remix-run/assert": "^0.3.0",
|
|
32
|
+
"@remix-run/fetch-router": "^0.22.0",
|
|
33
|
+
"@remix-run/form-data-middleware": "^0.3.6",
|
|
34
|
+
"@remix-run/response": "^0.3.8",
|
|
35
|
+
"@remix-run/mime": "^0.4.2",
|
|
36
|
+
"@remix-run/test": "^0.6.0",
|
|
37
|
+
"@remix-run/method-override-middleware": "^0.1.14"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@remix-run/fetch-router": "^0.
|
|
40
|
+
"@remix-run/fetch-router": "^0.22.0",
|
|
41
41
|
"@remix-run/fs": "^0.4.6",
|
|
42
42
|
"@remix-run/html-template": "^0.3.1",
|
|
43
43
|
"@remix-run/mime": "^0.4.2",
|
|
44
|
-
"@remix-run/response": "^0.3.
|
|
44
|
+
"@remix-run/response": "^0.3.8"
|
|
45
45
|
},
|
|
46
46
|
"keywords": [
|
|
47
47
|
"fetch",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "tsgo -p tsconfig.build.json",
|
|
55
55
|
"clean": "git clean -fdX",
|
|
56
|
-
"test": "remix
|
|
57
|
-
"test:bun": "bun x --bun remix
|
|
56
|
+
"test": "remix test",
|
|
57
|
+
"test:bun": "bun x --bun remix test",
|
|
58
58
|
"typecheck": "tsgo --noEmit"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -60,8 +60,25 @@ export async function generateDirectoryListing(
|
|
|
60
60
|
// Build table rows
|
|
61
61
|
let tableRows = []
|
|
62
62
|
|
|
63
|
-
let folderIcon = html.raw`<svg
|
|
64
|
-
|
|
63
|
+
let folderIcon = html.raw`<svg
|
|
64
|
+
class="icon"
|
|
65
|
+
viewBox="0 0 16 16"
|
|
66
|
+
fill="none"
|
|
67
|
+
stroke="currentColor"
|
|
68
|
+
stroke-width="1.5"
|
|
69
|
+
>
|
|
70
|
+
<path d="M2 3.5h4.5l1.5 1.5h6v8h-12z" />
|
|
71
|
+
</svg>`
|
|
72
|
+
let fileIcon = html.raw`<svg
|
|
73
|
+
class="icon"
|
|
74
|
+
viewBox="0 0 16 16"
|
|
75
|
+
fill="none"
|
|
76
|
+
stroke="currentColor"
|
|
77
|
+
stroke-width="1.5"
|
|
78
|
+
>
|
|
79
|
+
<path d="M3 2h7l3 3v9H3z" />
|
|
80
|
+
<path d="M10 2v3h3" />
|
|
81
|
+
</svg>`
|
|
65
82
|
|
|
66
83
|
// Add parent directory link if not at root
|
|
67
84
|
if (pathname !== '/' && pathname !== '') {
|
|
@@ -105,8 +122,9 @@ export async function generateDirectoryListing(
|
|
|
105
122
|
box-sizing: border-box;
|
|
106
123
|
}
|
|
107
124
|
body {
|
|
108
|
-
font-family:
|
|
109
|
-
|
|
125
|
+
font-family:
|
|
126
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
127
|
+
'Open Sans', 'Helvetica Neue', sans-serif;
|
|
110
128
|
margin: 0;
|
|
111
129
|
padding: 2rem 1rem;
|
|
112
130
|
background: #fff;
|