Skip to content

Commit

Permalink
update deps and format
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed Jun 18, 2024
1 parent 17fbcea commit ef0d909
Show file tree
Hide file tree
Showing 45 changed files with 16,265 additions and 15,583 deletions.
6 changes: 3 additions & 3 deletions epicshop/fix-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ const debouncedRun = debounce(run, 200)

// Add event listeners.
watcher
.on('addDir', path => {
.on('addDir', (path) => {
debouncedRun()
})
.on('unlinkDir', path => {
.on('unlinkDir', (path) => {
// Only act if path contains two slashes (excluding the leading `./`)
debouncedRun()
})
.on('error', error => console.log(`Watcher error: ${error}`))
.on('error', (error) => console.log(`Watcher error: ${error}`))

/**
* Simple debounce implementation
Expand Down
18 changes: 9 additions & 9 deletions epicshop/fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
const here = (...p) => path.join(__dirname, ...p)

const workshopRoot = here('..')
const examples = (await readDir(here('../examples'))).map(dir =>
const examples = (await readDir(here('../examples'))).map((dir) =>
here(`../examples/${dir}`),
)
const exercises = (await readDir(here('../exercises')))
.map(name => here(`../exercises/${name}`))
.filter(filepath => fs.statSync(filepath).isDirectory())
.map((name) => here(`../exercises/${name}`))
.filter((filepath) => fs.statSync(filepath).isDirectory())
const exerciseApps = (
await Promise.all(
exercises.flatMap(async exercise => {
exercises.flatMap(async (exercise) => {
return (await readDir(exercise))
.filter(dir => {
.filter((dir) => {
return /(problem|solution)/.test(dir)
})
.map(dir => path.join(exercise, dir))
.map((dir) => path.join(exercise, dir))
}),
)
).flat()
const exampleApps = (await readDir(here('../examples'))).map(dir =>
const exampleApps = (await readDir(here('../examples'))).map((dir) =>
here(`../examples/${dir}`),
)
const apps = [...exampleApps, ...exerciseApps]

const appsWithPkgJson = [...examples, ...apps].filter(app => {
const appsWithPkgJson = [...examples, ...apps].filter((app) => {
const pkgjsonPath = path.join(app, 'package.json')
return exists(pkgjsonPath)
})
Expand Down Expand Up @@ -67,7 +67,7 @@ async function updateTsconfig() {
const tsconfig = {
files: [],
exclude: ['node_modules'],
references: appsWithPkgJson.map(a => ({
references: appsWithPkgJson.map((a) => ({
path: relativeToWorkshopRoot(a).replace(/\\/g, '/'),
})),
}
Expand Down
Loading

0 comments on commit ef0d909

Please sign in to comment.