Skip to content

Commit

Permalink
Commit things (#15)
Browse files Browse the repository at this point in the history
Make it easier for people to get started by committing a lot of files
  • Loading branch information
bersling authored Apr 16, 2023
1 parent d761bca commit 122b6a1
Show file tree
Hide file tree
Showing 575 changed files with 1,166 additions and 24 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,12 @@ You need at least node v16.

## Initial Setup

The initial setup is unfortunately a bit tricky, since first some images and files need to be generated and for them to be generated the app needs to be running. I could commit the images, but that's also not that elegant.

I've encoded this in `setup.sh` you can run it like so:

```
./setup.sh
npm ci
npm start
```

The app is backgrounded and expected to run at port 5173, so make sure not to have another svelte app running before starting the setup. And make sure you know how to kill apps running on certain ports, because it's backgrounded.

Feel free to check out the code before running it!
Note: I chose to commit a lot of generated files, so the project can be started this easily. I thought an easy setup was more valuable than being too purist on the "don't commit generated files" dogma.

### Syncing chagnes from web to mobile

Expand Down
10 changes: 6 additions & 4 deletions generators/puzzle-convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ async function convertFile(
writeSvelteFile(filename, numCols, numRows);

if (filename === 'racoon') {
await writeIconFile(filename, numCols, numRows, true); // generate icon for root page
await writeIcon(filename, true);
await writeIconFile(filename, numCols, numRows); // generate icon for root page
await writeIcon(filename);
}

await writeIconFile(filename, numCols, numRows); // generate icon for /puzzle
Expand Down Expand Up @@ -116,6 +116,7 @@ function writeSvelteFile(filename: string, numCols: number, numRows: number) {

function getIconComponent(filename: string, numCols: number, numRows: number) {
return `<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/${filename}';
Expand All @@ -130,6 +131,7 @@ function getIconComponent(filename: string, numCols: number, numRows: number) {

function getSvelteComponent(filename: string, numCols: number, numRows: number) {
return `<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/${filename}';
Expand All @@ -142,8 +144,8 @@ function getSvelteComponent(filename: string, numCols: number, numRows: number)
}

function generateItemsForOverviewPage(files: string[]) {
return `
export const PUZZLE_PAGES = [
return `// THIS FILE IS GENERATED
export const PUZZLE_PAGES = [
${files.map((file) => {
const filenameWithoutExtension = file.split('.jpg')[0];
return `{
Expand Down
10 changes: 0 additions & 10 deletions src/routes/puzzle/.gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions src/routes/puzzle/01-orangutan/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/01-orangutan';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/01-orangutan/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/01-orangutan';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/02-bee/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/02-bee';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/02-bee/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/02-bee';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/03-hedgehog/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/03-hedgehog';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/03-hedgehog/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/03-hedgehog';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/04-fox/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/04-fox';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/04-fox/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/04-fox';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/05-bear/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/05-bear';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/05-bear/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/05-bear';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/06-crocodile/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/06-crocodile';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/06-crocodile/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/06-crocodile';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/07-hippo/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/07-hippo';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/07-hippo/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/07-hippo';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/08-lion/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/08-lion';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/08-lion/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/08-lion';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/09-bulldog/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/09-bulldog';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/09-bulldog/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/09-bulldog';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/10-shark/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/10-shark';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/10-shark/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/10-shark';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/11-zebra/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/11-zebra';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/11-zebra/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/11-zebra';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/12-panda/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/12-panda';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/12-panda/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/12-panda';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/13-lama/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/13-lama';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/13-lama/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/13-lama';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

10 changes: 10 additions & 0 deletions src/routes/puzzle/14-windwheel/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleGame from '../PuzzleGame.svelte';
const imageSrcRoot = '/assets/puzzle/14-windwheel';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleGame {imageSrcRoot} {numRows} {numCols} />
11 changes: 11 additions & 0 deletions src/routes/puzzle/14-windwheel/icon/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script lang="ts">
// THIS FILE IS GENERATED
import PuzzleIcon from '../../PuzzleIcon.svelte';
const imageSrcRoot = '/assets/puzzle/14-windwheel';
const numCols = 2;
const numRows = 2;
</script>

<PuzzleIcon {imageSrcRoot} {numRows} {numCols} />

Loading

0 comments on commit 122b6a1

Please sign in to comment.