Skip to content

Commit 6bef39f

Browse files
committed
full tutorial
1 parent 5f0ca0f commit 6bef39f

39 files changed

Lines changed: 759 additions & 129 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ data.db
1414
# file as well, but since this is for a workshop
1515
# we're going to keep them around.
1616
# .env
17+
18+
saved-playgrounds

epicshop/fix.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ const VERBOSE = false
1212
const logVerbose = (...args) => (VERBOSE ? console.log(...args) : undefined)
1313

1414
const workshopRoot = here('..')
15-
const examples = (await readDir(here('../examples'))).map(dir =>
15+
const examples = (await readDir(here('../examples'))).map((dir) =>
1616
here(`../examples/${dir}`),
1717
)
1818
const exercises = (await readDir(here('../exercises')))
19-
.map(name => here(`../exercises/${name}`))
20-
.filter(filepath => fs.statSync(filepath).isDirectory())
19+
.map((name) => here(`../exercises/${name}`))
20+
.filter((filepath) => fs.statSync(filepath).isDirectory())
2121
const exerciseApps = (
2222
await Promise.all(
23-
exercises.flatMap(async exercise => {
23+
exercises.flatMap(async (exercise) => {
2424
return (await readDir(exercise))
25-
.filter(dir => {
25+
.filter((dir) => {
2626
return /(problem|solution)/.test(dir)
2727
})
28-
.map(dir => path.join(exercise, dir))
28+
.map((dir) => path.join(exercise, dir))
2929
}),
3030
)
3131
).flat()
32-
const exampleApps = (await readDir(here('../examples'))).map(dir =>
32+
const exampleApps = (await readDir(here('../examples'))).map((dir) =>
3333
here(`../examples/${dir}`),
3434
)
3535
const apps = [...exampleApps, ...exerciseApps]
3636

37-
const appsWithPkgJson = [...examples, ...apps].filter(app => {
37+
const appsWithPkgJson = [...examples, ...apps].filter((app) => {
3838
const pkgjsonPath = path.join(app, 'package.json')
3939
return exists(pkgjsonPath)
4040
})
@@ -70,7 +70,7 @@ async function updateTsconfig() {
7070
const tsconfig = {
7171
files: [],
7272
exclude: ['node_modules'],
73-
references: appsWithPkgJson.map(a => ({
73+
references: appsWithPkgJson.map((a) => ({
7474
path: relativeToWorkshopRoot(a).replace(/\\/g, '/'),
7575
})),
7676
}

epicshop/setup-custom.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,3 @@ import {
88
import fsExtra from 'fs-extra'
99

1010
await warm()
11-
12-
const allApps = await getApps()
13-
const problemApps = allApps.filter(isProblemApp)
14-
15-
if (!process.env.SKIP_PLAYGROUND) {
16-
const firstProblemApp = problemApps[0]
17-
if (firstProblemApp) {
18-
console.log('🛝 setting up the first problem app...')
19-
const playgroundPath = path.join(process.cwd(), 'playground')
20-
if (await fsExtra.exists(playgroundPath)) {
21-
console.log('🗑 deleting existing playground app')
22-
await fsExtra.remove(playgroundPath)
23-
}
24-
await setPlayground(firstProblemApp.fullPath).then(
25-
() => {
26-
console.log('✅ first problem app set up')
27-
},
28-
(error) => {
29-
console.error(error)
30-
throw new Error('❌ first problem app setup failed')
31-
},
32-
)
33-
}
34-
}

exercises/01.example/01.problem.hello/README.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

exercises/01.example/01.problem.hello/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

exercises/01.example/01.problem.hello/package.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

exercises/01.example/01.problem.hello/tsconfig.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

exercises/01.example/01.solution.goodbye/README.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

exercises/01.example/01.solution.goodbye/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

exercises/01.example/01.solution.goodbye/package.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)