Skip to content

Commit

Permalink
update to epicshop
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Apr 24, 2024
1 parent b8ef7b0 commit 67b88d3
Show file tree
Hide file tree
Showing 35 changed files with 4,286 additions and 12,319 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ jobs:

- name: 🚀 Deploy
run: flyctl deploy --remote-only
working-directory: ./scripts/deployed
working-directory: ./epicshop
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
11 changes: 0 additions & 11 deletions .prettierignore

This file was deleted.

34 changes: 0 additions & 34 deletions .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions kcdshop/.diffignore → epicshop/.diffignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tsconfig.json
countries-110m.json
us-cities.json
21 changes: 21 additions & 0 deletions epicshop/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:20-bookworm-slim as base

RUN apt-get update && apt-get install -y git

ENV EPICSHOP_CONTEXT_CWD="/myapp/workshop-content"
ENV EPICSHOP_DEPLOYED="true"
ENV EPICSHOP_DISABLE_WATCHER="true"
ENV FLY="true"
ENV PORT="8080"
ENV NODE_ENV="production"

WORKDIR /myapp

ADD . .

RUN npm install --omit=dev

CMD rm -rf ${EPICSHOP_CONTEXT_CWD} && \
git clone https://github.com/epicweb-dev/react-performance ${EPICSHOP_CONTEXT_CWD} && \
cd ${EPICSHOP_CONTEXT_CWD} && \
npx epicshop start
6 changes: 3 additions & 3 deletions scripts/fix-watch.js → epicshop/fix-watch.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chokidar from 'chokidar'
import path from 'node:path'
import { $ } from 'execa'
import { fileURLToPath } from 'node:url'
import chokidar from 'chokidar'
import { $ } from 'execa'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const here = (...p) => path.join(__dirname, ...p)
Expand All @@ -10,7 +10,7 @@ const workshopRoot = here('..')

const watchPath = path.join(workshopRoot, './exercises/*')
const watcher = chokidar.watch(watchPath, {
ignored: /(^|[\/\\])\../, // ignore dotfiles
ignored: /(^|[/\\])\../, // ignore dotfiles
persistent: true,
ignoreInitial: true,
depth: 2,
Expand Down
3 changes: 0 additions & 3 deletions scripts/fix.js → epicshop/fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
// because you may need to run it without deps.

import fs from 'node:fs'
import cp from 'node:child_process'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const here = (...p) => path.join(__dirname, ...p)
const VERBOSE = false
const logVerbose = (...args) => (VERBOSE ? console.log(...args) : undefined)

const workshopRoot = here('..')
const examples = (await readDir(here('../examples'))).map(dir =>
Expand Down
1 change: 1 addition & 0 deletions scripts/deployed/fly.toml → epicshop/fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ primary_region = "sjc"
kill_signal = "SIGINT"
kill_timeout = 5
processes = [ ]
swap_size_mb = 512

[experimental]
allowed_public_ports = [ ]
Expand Down
Loading

0 comments on commit 67b88d3

Please sign in to comment.