chore: organize repo
Some checks are pending
Checks / lint (push) Waiting to run
Checks / test (push) Waiting to run
Checks / content (push) Waiting to run

This commit is contained in:
ayo 2026-07-18 22:00:07 +02:00
parent 3b17a596c6
commit f4ac3b0c12
15 changed files with 17 additions and 9 deletions

View file

@ -2,7 +2,7 @@
"name": "mnswpr", "name": "mnswpr",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"description": "mnswpr the mnswpr.com web app", "description": "mnswpr \u2014 the mnswpr.com web app",
"author": "Ayo Ayco", "author": "Ayo Ayco",
"type": "module", "type": "module",
"main": "main.js", "main": "main.js",
@ -12,16 +12,16 @@
}, },
"homepage": "https://mnswpr.com", "homepage": "https://mnswpr.com",
"scripts": { "scripts": {
"dev": "firebase emulators:exec --only firestore --ui \"node scripts/seed-dev-scores.js; vite\"", "dev": "firebase --config firebase/firebase.json emulators:exec --only firestore --ui \"node scripts/seed-dev-scores.js; vite\"",
"dev:no-db": "vite", "dev:no-db": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"build:preview": "pnpm run build && pnpm run preview", "build:preview": "pnpm run build && pnpm run preview",
"test": "vitest run", "test": "vitest run",
"test:watch": "vitest", "test:watch": "vitest",
"deploy:db": "firebase deploy --only firestore", "deploy:db": "firebase --config firebase/firebase.json deploy --only firestore",
"deploy:site": "pnpm run build && netlify deploy --prod --dir=dist", "deploy:site": "pnpm run build && netlify deploy --prod --dir=dist",
"db:start": "firebase emulators:start --only firestore", "db:start": "firebase --config firebase/firebase.json emulators:start --only firestore",
"db:seed": "FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 node scripts/seed-dev-scores.js", "db:seed": "FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 node scripts/seed-dev-scores.js",
"db:stop": "pkill -f '[c]loud-firestore-emulator'; pkill -f '[f]irebase.* emulators:'; true", "db:stop": "pkill -f '[c]loud-firestore-emulator'; pkill -f '[f]irebase.* emulators:'; true",
"release": "pnpm lint && pnpm test && bumpp && node scripts/release.js", "release": "pnpm lint && pnpm test && bumpp && node scripts/release.js",

View file

@ -130,6 +130,6 @@ ${sections.join('\n')}
` `
const __dirname = dirname(fileURLToPath(import.meta.url)) const __dirname = dirname(fileURLToPath(import.meta.url))
const out = resolve(__dirname, '../legends.html') const out = resolve(__dirname, '../src/legends.html')
writeFileSync(out, html) writeFileSync(out, html)
console.log(`\nWrote ${out}`) console.log(`\nWrote ${out}`)

View file

@ -3,7 +3,7 @@ import '@cozy-games/mnswpr/mnswpr.css'
import '@cozy-games/utils/loading/loading.css' import '@cozy-games/utils/loading/loading.css'
// The app's own version — this is what the heading shows and what the v* tags // The app's own version — this is what the heading shows and what the v* tags
// and GitHub releases track. Not the engine's version (@cozy-games/mnswpr). // and GitHub releases track. Not the engine's version (@cozy-games/mnswpr).
import * as pkg from './package.json' import * as pkg from '../package.json'
import { configureLeaderboard } from '@cozy-games/leaderboard/leaderboard-element.js' import { configureLeaderboard } from '@cozy-games/leaderboard/leaderboard-element.js'
import { FirebaseAdapter } from '@cozy-games/leaderboard/adapters/firebase.js' import { FirebaseAdapter } from '@cozy-games/leaderboard/adapters/firebase.js'
import { NicknameService } from './modules/nickname/nickname.js' import { NicknameService } from './modules/nickname/nickname.js'

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

View file

@ -1,13 +1,21 @@
import { resolve } from 'node:path' import { resolve } from 'node:path'
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
// Multi-page build: the game (index.html) and the frozen Legends page. const root = resolve(import.meta.dirname, 'src')
// App source lives in src/; env files and the build output stay at the repo root.
export default defineConfig({ export default defineConfig({
root,
// .env* files sit at the repo root next to package.json, not in src/.
envDir: import.meta.dirname,
build: { build: {
outDir: resolve(import.meta.dirname, 'dist'),
emptyOutDir: true,
// Multi-page build: the game (index.html) and the frozen Legends page.
rollupOptions: { rollupOptions: {
input: { input: {
main: resolve(import.meta.dirname, 'index.html'), main: resolve(root, 'index.html'),
legends: resolve(import.meta.dirname, 'legends.html') legends: resolve(root, 'legends.html')
} }
} }
} }