- Introduced a Makefile for streamlined commands related to building, running, and managing presentations. - Created package.json to define project metadata, dependencies, and scripts for development and testing. - Added .gitignore entries to exclude build artifacts and temporary files from version control. - Included playwright.config.mjs for end-to-end testing setup with Playwright. - Added README.md for project documentation, outlining setup instructions and development guidelines.
41 lines
1.0 KiB
JavaScript
41 lines
1.0 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* npm run dev:portal — sync + VitePress dev avec base=/ (ignore SITE_BASE sauf SKIP_PORTAL_DEV=1).
|
|
*/
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { spawn, execFileSync } from 'node:child_process'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
const root = path.resolve(__dirname, '..')
|
|
const runEnv =
|
|
process.env.SKIP_PORTAL_DEV === '1'
|
|
? process.env
|
|
: { ...process.env, TALKS_PORTAL_DEV: '1' }
|
|
|
|
execFileSync(process.execPath, [path.join(root, 'tools', 'sync-portal.mjs')], {
|
|
stdio: 'inherit',
|
|
cwd: root,
|
|
env: runEnv,
|
|
})
|
|
|
|
const vitepressBin = path.join(root, 'node_modules', '.bin', 'vitepress')
|
|
const child = spawn(vitepressBin, ['dev', 'portal'], {
|
|
cwd: root,
|
|
stdio: 'inherit',
|
|
env: runEnv,
|
|
shell: process.platform === 'win32',
|
|
})
|
|
|
|
function die() {
|
|
try {
|
|
child.kill('SIGTERM')
|
|
} catch {
|
|
/* ignore */
|
|
}
|
|
process.exit(0)
|
|
}
|
|
process.on('SIGINT', die)
|
|
process.on('SIGTERM', die)
|
|
child.on('exit', (code) => process.exit(code ?? 0))
|