diff --git a/.github/workflows/deploy_gitea.yml b/.github/workflows/deploy_gitea.yml deleted file mode 100644 index 5b68b9f..0000000 --- a/.github/workflows/deploy_gitea.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Deploy Pages -on: - push: - branches: [main] # или master, или любая другая - -jobs: - deploy: - runs-on: ubuntu-latest # или label твоего runner'а - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Diagnostic - run: | - echo "=== User ===" - whoami - id - - echo "=== Hostname ===" - hostname - - echo "=== Is this a container? ===" - if [ -f /.dockerenv ]; then - echo "YES — мы внутри Docker-контейнера" - else - echo "NO — работаем на хосте" - fi - - echo "=== Mounts ===" - mount | grep -E '/var/www|/data|overlay' || true - - echo "=== Looking for /var/www/pages ===" - ls -la /var/www 2>/dev/null || echo "/var/www не существует" - ls -la /var/www/pages 2>/dev/null || echo "/var/www/pages не существует" - - echo "=== Current directory ===" - pwd - ls -la - - - name: Deploy to /var/www/pages - run: | - # Устанавливаем rsync (если его нет) - if ! command -v rsync &> /dev/null; then - sudo apt-get update && sudo apt-get install -y rsync - fi - - TARGET="/var/www/pages/${{ gitea.repository }}" - mkdir -p "$TARGET" - - rsync -a --delete \ - --exclude='.git' \ - --exclude='.gitea' \ - --exclude='.github' \ - --exclude='.gitignore' \ - ./ "$TARGET/" diff --git a/.gitignore b/.gitignore index 0273118..d347283 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/.mimocode/ +/dist/ +node_modules/ diff --git a/build.js b/build.js new file mode 100644 index 0000000..c0cc715 --- /dev/null +++ b/build.js @@ -0,0 +1,35 @@ +import { cpSync, copyFileSync, mkdirSync, readdirSync, rmSync } from 'node:fs' +import { dirname, join, relative } from 'node:path' +import { fileURLToPath } from 'node:url' + +const root = dirname(fileURLToPath(import.meta.url)) +const dist = join(root, 'dist') + +const rootFiles = ['index.html', 'game.html', 'style.css', 'serve.json'] +const jsDir = 'js' +const imgFiles = ['sprite.svg'] + +function listFiles(dir) { + return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => + entry.isDirectory() ? listFiles(join(dir, entry.name)) : [join(dir, entry.name)], + ) +} + +rmSync(dist, { recursive: true, force: true }) +mkdirSync(dist) + +for (const file of rootFiles) { + copyFileSync(join(root, file), join(dist, file)) +} + +cpSync(join(root, jsDir), join(dist, jsDir), { recursive: true }) + +mkdirSync(join(dist, 'img')) +for (const file of imgFiles) { + copyFileSync(join(root, 'img', file), join(dist, 'img', file)) +} + +console.log('Собрано в dist:') +for (const file of listFiles(dist)) { + console.log(' ' + relative(dist, file)) +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..9250d45 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "shooting-word", + "version": "0.1.0", + "description": "Twitch-интерактивная игра, где зрители чата стреляют по врагам, печатая слова.", + "scripts": { + "build": "node build.js" + }, + "license": "MIT", + "devEngines": { + "packageManager": { + "name": "pnpm", + "version": "^11.20.0", + "onFail": "download" + } + }, + "type": "module" +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..70a235e --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,208 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + '@pnpm/exe': + specifier: ^11.20.0 + version: 11.22.0 + pnpm: + specifier: ^11.20.0 + version: 11.22.0 + +packages: + + '@pnpm/exe@11.22.0': + resolution: {integrity: sha512-B1SGeKm+v9pX9YkzMmrnO2FbgBd8TDwzZ3jSj6J6ThxdyGvI4TsOfMeHARW4Wb25visPpmMDfIXrU76EZdJM4g==} + hasBin: true + + '@pnpm/linux-arm64@11.22.0': + resolution: {integrity: sha512-xzzn3jYG9QaiFZPaHcWM3yX4Fm9UGz5E42mzpbvUEvXYf5O9fwNolenOhGLpRl2qS5u35fjZSvDZbWlOwHMcug==} + cpu: [arm64] + os: [linux] + + '@pnpm/linux-x64@11.22.0': + resolution: {integrity: sha512-isvaPctGinbsM2hsTtRsMarN8Sr5QhXDTNmn8Xv9Lp1PjincCvH2RBbhpo+xYIOxzgls1dtQSdgoORUbfRVALQ==} + cpu: [x64] + os: [linux] + + '@pnpm/linuxstatic-arm64@11.22.0': + resolution: {integrity: sha512-i4J+AQWW0T3JBdXaLsvxu8ZmMG1HLS6JZQESdOR9uBv8Zumb4yg8GYT83eWRLacr6ngVdhEBiC3W4eOG64MFbA==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@pnpm/linuxstatic-x64@11.22.0': + resolution: {integrity: sha512-QYzk8jhSuSbVthW/OxEOhU3f3zhjpw4HqgedrlwbVNb7btCWn5del2Hb5PsYYka2PbmKq5EtF5IzYN8Yp1CfxQ==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/macos-arm64@11.22.0': + resolution: {integrity: sha512-Io8Axk5kutPgMuAfOg1QGj3J0/KpLvH5iiPcmp7up8D4q7BNWT02ndQo3RyGWqrlkf5nwspM41GFpWTShrZ4Aw==} + cpu: [arm64] + os: [darwin] + + '@pnpm/win-arm64@11.22.0': + resolution: {integrity: sha512-QgaRuKGQKov7xW2utPCgDT83fn/PU5cD6HFgib48oTslz7wv26E89d4jMCxL4GRmEL2YCfkYuj5ITj1oVWg5WQ==} + cpu: [arm64] + os: [win32] + + '@pnpm/win-x64@11.22.0': + resolution: {integrity: sha512-iWYsiSwpgxqur+TwsnSoPdOQaEfd4ygB84mb5tJUOgim6PHr1xhKJBndaQzH+At/WkLxLdYN+K8dYc4M7naezg==} + cpu: [x64] + os: [win32] + + '@reflink/reflink-darwin-arm64@0.1.19': + resolution: {integrity: sha512-ruy44Lpepdk1FqDz38vExBY/PVUsjxZA+chd9wozjUH9JjuDT/HEaQYA6wYN9mf041l0yLVar6BCZuWABJvHSA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@reflink/reflink-darwin-x64@0.1.19': + resolution: {integrity: sha512-By85MSWrMZa+c26TcnAy8SDk0sTUkYlNnwknSchkhHpGXOtjNDUOxJE9oByBnGbeuIE1PiQsxDG3Ud+IVV9yuA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@reflink/reflink-linux-arm64-gnu@0.1.19': + resolution: {integrity: sha512-7P+er8+rP9iNeN+bfmccM4hTAaLP6PQJPKWSA4iSk2bNvo6KU6RyPgYeHxXmzNKzPVRcypZQTpFgstHam6maVg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-arm64-musl@0.1.19': + resolution: {integrity: sha512-37iO/Dp6m5DDaC2sf3zPtx/hl9FV3Xze4xoYidrxxS9bgP3S8ALroxRK6xBG/1TtfXKTvolvp+IjrUU6ujIGmA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@reflink/reflink-linux-x64-gnu@0.1.19': + resolution: {integrity: sha512-jbI8jvuYCaA3MVUdu8vLoLAFqC+iNMpiSuLbxlAgg7x3K5bsS8nOpTRnkLF7vISJ+rVR8W+7ThXlXlUQ93ulkw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-x64-musl@0.1.19': + resolution: {integrity: sha512-e9FBWDe+lv7QKAwtKOt6A2W/fyy/aEEfr0g6j/hWzvQcrzHCsz07BNQYlNOjTfeytrtLU7k449H1PI95jA4OjQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@reflink/reflink-win32-arm64-msvc@0.1.19': + resolution: {integrity: sha512-09PxnVIQcd+UOn4WAW73WU6PXL7DwGS6wPlkMhMg2zlHHG65F3vHepOw06HFCq+N42qkaNAc8AKIabWvtk6cIQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@reflink/reflink-win32-x64-msvc@0.1.19': + resolution: {integrity: sha512-E//yT4ni2SyhwP8JRjVGWr3cbnhWDiPLgnQ66qqaanjjnMiu3O/2tjCPQXlcGc/DEYofpDc9fvhv6tALQsMV9w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@reflink/reflink@0.1.19': + resolution: {integrity: sha512-DmCG8GzysnCZ15bres3N5AHCmwBwYgp0As6xjhQ47rAUTUXxJiK+lLUxaGsX3hd/30qUpVElh05PbGuxRPgJwA==} + engines: {node: '>= 10'} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + pnpm@11.22.0: + resolution: {integrity: sha512-H/hwxMYTPf2I+yr8Rt0T1H8JyXlLQ4xv20fKmMrzvBY4HuC+k6CRuOOCTPAfiJ9G19niCRD7C+GrD7W6qA3WIQ==} + engines: {node: '>=22.13'} + hasBin: true + +snapshots: + + '@pnpm/exe@11.22.0': + dependencies: + '@reflink/reflink': 0.1.19 + detect-libc: 2.1.2 + optionalDependencies: + '@pnpm/linux-arm64': 11.22.0 + '@pnpm/linux-x64': 11.22.0 + '@pnpm/linuxstatic-arm64': 11.22.0 + '@pnpm/linuxstatic-x64': 11.22.0 + '@pnpm/macos-arm64': 11.22.0 + '@pnpm/win-arm64': 11.22.0 + '@pnpm/win-x64': 11.22.0 + + '@pnpm/linux-arm64@11.22.0': + optional: true + + '@pnpm/linux-x64@11.22.0': + optional: true + + '@pnpm/linuxstatic-arm64@11.22.0': + optional: true + + '@pnpm/linuxstatic-x64@11.22.0': + optional: true + + '@pnpm/macos-arm64@11.22.0': + optional: true + + '@pnpm/win-arm64@11.22.0': + optional: true + + '@pnpm/win-x64@11.22.0': + optional: true + + '@reflink/reflink-darwin-arm64@0.1.19': + optional: true + + '@reflink/reflink-darwin-x64@0.1.19': + optional: true + + '@reflink/reflink-linux-arm64-gnu@0.1.19': + optional: true + + '@reflink/reflink-linux-arm64-musl@0.1.19': + optional: true + + '@reflink/reflink-linux-x64-gnu@0.1.19': + optional: true + + '@reflink/reflink-linux-x64-musl@0.1.19': + optional: true + + '@reflink/reflink-win32-arm64-msvc@0.1.19': + optional: true + + '@reflink/reflink-win32-x64-msvc@0.1.19': + optional: true + + '@reflink/reflink@0.1.19': + optionalDependencies: + '@reflink/reflink-darwin-arm64': 0.1.19 + '@reflink/reflink-darwin-x64': 0.1.19 + '@reflink/reflink-linux-arm64-gnu': 0.1.19 + '@reflink/reflink-linux-arm64-musl': 0.1.19 + '@reflink/reflink-linux-x64-gnu': 0.1.19 + '@reflink/reflink-linux-x64-musl': 0.1.19 + '@reflink/reflink-win32-arm64-msvc': 0.1.19 + '@reflink/reflink-win32-x64-msvc': 0.1.19 + + detect-libc@2.1.2: {} + + pnpm@11.22.0: {} + +--- +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: {}