diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..6881532 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,41 @@ +name: Deploy to Cloudflare Pages + +on: + push: + branches: rewrite + +jobs: + build_site: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Build site + run: | + pnpm run build + + - name: Publish to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: 2604d9d303c7a3e9c9b923c3f05e0bb9 + projectName: mod-magazine + directory: build + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + wranglerVersion: '3' + \ No newline at end of file diff --git a/package.json b/package.json index 854e8b0..77786ee 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "discord-api-types": "^0.37.87", "fuse.js": "^7.0.0", "lucide-svelte": "^0.390.0", - "node-fetch": "^3.3.2", "postcss-load-config": "^5.0.0", "svelte-markdown": "^0.4.1", "svelte-virtual-scroll-list": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72f145f..29a04a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,9 +23,6 @@ importers: lucide-svelte: specifier: ^0.390.0 version: 0.390.0(svelte@4.2.18) - node-fetch: - specifier: ^3.3.2 - version: 3.3.2 postcss-load-config: specifier: ^5.0.0 version: 5.1.0(jiti@1.21.3)(postcss@8.4.38) @@ -633,10 +630,6 @@ packages: engines: {node: '>=4'} hasBin: true - data-uri-to-buffer@4.0.1: - resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} - engines: {node: '>= 12'} - debug@4.3.5: resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} engines: {node: '>=6.0'} @@ -786,10 +779,6 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} - fetch-blob@3.2.0: - resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} - engines: {node: ^12.20 || >= 14.13} - file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} @@ -813,10 +802,6 @@ packages: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} - formdata-polyfill@4.0.10: - resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} - engines: {node: '>=12.20.0'} - fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} @@ -1069,14 +1054,6 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - - node-fetch@3.3.2: - resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} @@ -1550,10 +1527,6 @@ packages: vite: optional: true - web-streams-polyfill@3.3.3: - resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} - engines: {node: '>= 8'} - which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -2071,8 +2044,6 @@ snapshots: cssesc@3.0.0: {} - data-uri-to-buffer@4.0.1: {} - debug@4.3.5: dependencies: ms: 2.1.2 @@ -2261,11 +2232,6 @@ snapshots: dependencies: reusify: 1.0.4 - fetch-blob@3.2.0: - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 3.3.3 - file-entry-cache@6.0.1: dependencies: flat-cache: 3.2.0 @@ -2292,10 +2258,6 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - formdata-polyfill@4.0.10: - dependencies: - fetch-blob: 3.2.0 - fraction.js@4.3.7: {} fs.realpath@1.0.0: {} @@ -2507,14 +2469,6 @@ snapshots: natural-compare@1.4.0: {} - node-domexception@1.0.0: {} - - node-fetch@3.3.2: - dependencies: - data-uri-to-buffer: 4.0.1 - fetch-blob: 3.2.0 - formdata-polyfill: 4.0.10 - node-releases@2.0.14: {} normalize-path@3.0.0: {} @@ -2955,8 +2909,6 @@ snapshots: optionalDependencies: vite: 5.2.13 - web-streams-polyfill@3.3.3: {} - which@2.0.2: dependencies: isexe: 2.0.0 diff --git a/src/lib/fetchPolyfill.ts b/src/lib/fetchPolyfill.ts deleted file mode 100644 index d18a6c6..0000000 --- a/src/lib/fetchPolyfill.ts +++ /dev/null @@ -1,6 +0,0 @@ -import fetch from 'node-fetch'; - -if (typeof globalThis.fetch === 'undefined') { - // @ts-ignore - globalThis.fetch = fetch; -} diff --git a/src/routes/+layout.ts b/src/routes/+layout.ts index 1420fb0..189f71e 100644 --- a/src/routes/+layout.ts +++ b/src/routes/+layout.ts @@ -1,3 +1 @@ -import "$lib/fetchPolyfill"; - export const prerender = true;