Skip to content

Commit 0454e7b

Browse files
authored
fix(examples): unblock the e2e suite (#113)
1 parent 89c4df2 commit 0454e7b

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

examples/files-inspector/src/devframe.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export default defineDevframe({
1919
command: 'devframe-files-inspector',
2020
port: 9876,
2121
distDir,
22+
// Single-user localhost demo — skip the trust handshake so the served
23+
// SPA can call RPC without an OTP round-trip.
24+
auth: false,
2225
},
2326
spa: { loader: 'none' },
2427
setup(ctx) {
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
import { cpSync, mkdirSync, rmSync } from 'node:fs'
1+
import { chmodSync, cpSync, mkdirSync, readdirSync, rmSync } from 'node:fs'
2+
import { join } from 'node:path'
23

34
rmSync('dist/client', { recursive: true, force: true })
45
mkdirSync('dist', { recursive: true })
56
cpSync('src/client/out', 'dist/client', { recursive: true })
7+
8+
// A built SPA must be readable to be served. Some filesystems (e.g. Docker
9+
// Desktop's shared mounts) drop the read bits when copying, which yields
10+
// unservable assets and trips downstream `createBuild` copies. Normalize the
11+
// tree so directories are traversable and files are world-readable.
12+
function normalizePermissions(dir) {
13+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
14+
const path = join(dir, entry.name)
15+
if (entry.isDirectory()) {
16+
chmodSync(path, 0o755)
17+
normalizePermissions(path)
18+
}
19+
else if (entry.isFile()) {
20+
chmodSync(path, 0o644)
21+
}
22+
}
23+
}
24+
25+
normalizePermissions('dist/client')

0 commit comments

Comments
 (0)