Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/files-inspector/src/devframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default defineDevframe({
command: 'devframe-files-inspector',
port: 9876,
distDir,
// Single-user localhost demo — skip the trust handshake so the served
// SPA can call RPC without an OTP round-trip.
auth: false,
},
spa: { loader: 'none' },
setup(ctx) {
Expand Down
22 changes: 21 additions & 1 deletion examples/next-runtime-snapshot/scripts/build-spa.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
import { cpSync, mkdirSync, rmSync } from 'node:fs'
import { chmodSync, cpSync, mkdirSync, readdirSync, rmSync } from 'node:fs'
import { join } from 'node:path'

rmSync('dist/client', { recursive: true, force: true })
mkdirSync('dist', { recursive: true })
cpSync('src/client/out', 'dist/client', { recursive: true })

// A built SPA must be readable to be served. Some filesystems (e.g. Docker
// Desktop's shared mounts) drop the read bits when copying, which yields
// unservable assets and trips downstream `createBuild` copies. Normalize the
// tree so directories are traversable and files are world-readable.
function normalizePermissions(dir) {
for (const entry of readdirSync(dir, { withFileTypes: true })) {
const path = join(dir, entry.name)
if (entry.isDirectory()) {
chmodSync(path, 0o755)
normalizePermissions(path)
}
else if (entry.isFile()) {
chmodSync(path, 0o644)
}
}
}

normalizePermissions('dist/client')
Loading