Skip to content

Commit

Permalink
Merge branch 'main' into storybook
Browse files Browse the repository at this point in the history
# Conflicts:
#	.vscode/launch.json
#	package.json
#	pnpm-lock.yaml
  • Loading branch information
iva2k committed Aug 17, 2024
2 parents d04dd67 + 0ab20a4 commit 46015a2
Show file tree
Hide file tree
Showing 12 changed files with 707 additions and 315 deletions.
67 changes: 33 additions & 34 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,84 +101,83 @@
"skipFiles": ["<node_internals>/**"]
},
{
"name": "BROKEN node-terminal",
"name": "BROKEN pnpm test:unit (node-terminal)",
"request": "launch",
"type": "node-terminal",
"command": "pnpm test:unit",
"skipFiles": ["<node_internals>/**"]
},
{
"name": "WORKS pnpm test:unit",
"name": "pnpm test:integration",
"request": "launch",
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "test:unit"],
"skipFiles": ["<node_internals>/**"]
},
{
"name": "BROKEN pnpm test:unit node-terminal",
"request": "launch",
"type": "node-terminal",
"command": "pnpm test:unit",
"runtimeArgs": ["run", "test:integration"],
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm test:integration",
"name": "pnpm test:integration",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm test:integration:debug",
"name": "pnpm test:integration:debug",
"request": "launch",
"type": "node-terminal"
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "test:integration:debug"],
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm build:netlify",
"name": "pnpm build:netlify",
"name": "pnpm postinstall",
"request": "launch",
"type": "node-terminal"
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "postinstall"],
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm build:vercel",
"name": "pnpm build:vercel",
"name": "pnpm build",
"request": "launch",
"type": "node-terminal"
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "build"],
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm build:only",
"name": "pnpm build:only",
"request": "launch",
"type": "node-terminal"
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "build:only"],
"skipFiles": ["<node_internals>/**"]
},
{
"name": "pnpm build:only (node)",
"name": "pnpm build:netlify",
"request": "launch",
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "build:only"],
"runtimeArgs": ["run", "build:netlify"],
"skipFiles": ["<node_internals>/**"]
},
{
"name": "pnpm postinstall (node)",
"name": "pnpm build:vercel",
"request": "launch",
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "postinstall"],
"runtimeArgs": ["run", "build:vercel"],
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm build:only-sw",
"name": "pnpm build:only-sw",
"request": "launch",
"type": "node-terminal"
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "build:only-sw"],
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm build:only-destroy",
"name": "pnpm build:only-destroy",
"request": "launch",
"type": "node-terminal"
"type": "node",
"runtimeExecutable": "pnpm",
"runtimeArgs": ["run", "build:only-destroy"],
"skipFiles": ["<node_internals>/**"]
},
{
"type": "chrome",
Expand Down
2 changes: 2 additions & 0 deletions CREATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ KISS - Keep-It-Simple,Stupid. Keep the code simple and clear, making it easy to

## Prerequisites

Note: For developing on Windows, enable "Developer Mode" by opening "Settings" > "For developers" > "Developer Mode" = On. It will allow symlink creation (required for pnpm) without elevating as administrator. If you see "EPERM" error associated with SymLinks in any of the build tools, make sure that "Developer Mode" is turned on.

Install [Git](https://git-scm.com/).

Install [NodeJS](https://nodejs.org/en).
Expand Down
12 changes: 12 additions & 0 deletions QANDA.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ Out of the box features:
- Prepared for UDX (UI designer experience) - see UI integrations below.
- All deployment methods are included - build for standalone apps (iOS/Android/Windows), make a Website or a Web App, or Offline Web App, or all of them.

## Q: Why include `.vscode/extensions.json`?

A: Other projects indirectly recommend extensions via the README, but this file `.vscode/extensions.json` allows VS Code to prompt the user to install the recommended extension upon opening the project. It is easy to reject the recommendations for any reason, VSCode won't bother you anymore. Accepting these recommendations puts you in sync with the way this project is designed and makes most of it.

## Q: Why include `.vscode/launch.json`?

A: To preserve various debug configurations. If anything is not working, having a consistent debug configuration helps a lot to get to the root cause much quicker.

## Q: Why include `.vscode/settings.json`?

A: Unfortunately VSCode does not have an easy way to combine or split or inherit settings for the workspace. There are some critical settings that are required for the project tooling to operate properly. Pressure M$ team to implement extension mechanism for workspace settings to make a difference [TODO: (now) Link to the relevant VSCode issue here].

## Q: I found a bug, what shall I do?

A: Please understand that this project currently follows bleeding edge of Svelte 5 development, and gets all the bugs from early release candidate / pre-alpha versions. Once upstream stabilizes and gets released, many things will be fixed, so your patience will be greatly appreciated.
Expand Down
53 changes: 53 additions & 0 deletions SVELTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Svelte 5 and SvelteKit 2

## Peculiarities

Peculiarities encountered in Svelte 5 and SvelteKit 2.

### `./$types`

Works:

```ts
import type { PageServerLoad } from './$types';
```

Doesn't work:

```ts
import { type PageServerLoad } from './$types';
```

### Lifecycle and Context

`setContext()`, `getContext()` and `hasContext()` don't work and throw errors in modules if not called from `onMount()` or called on the server side.

As an extension, `useState()` does not work in the same situations.

### Runes type definitions

`$props` cannot take type parameter, should use type on the left-hand side. `$state` type on left-hand side does not work well, should use type parameter.

Works:

```ts
let { value }: { value: ValueType } = $props();
let value = $state<ValueType>(initialValue);
```

Does not work:

```ts
let { value } = $props<{ value: ValueType }>();
let value: ValueType = $state(initialValue);
```

## ChatGPT Prompts

### Generate Svelte 5 / SvelteKit 2 code

System prompt:

```text
Use Svelte 5 runes. They are not imported but compiled, `let value = $state<valueType>(initialValue);` and `value` can be read or set directly, it will be reactive. For component props, use `let { prop1, prop2, ...args } : { prop1: prop1Type, prop2: prop2Type, ... } = $props();`
```
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@
"icons:build": "bash -c \"./scripts/icon-generator.sh .logo/logo.svg .logo/icon.svg .logo/icon_bg.svg .logo/icon+texture.svg .logo/icon+texture-wide.svg \""
},
"dependencies": {
"@capacitor/android": "^6.1.1",
"@capacitor/core": "^6.1.1",
"@capacitor/geolocation": "^6.0.0",
"@capacitor/ios": "^6.1.1",
"@capacitor/android": "^6.1.2",
"@capacitor/core": "^6.1.2",
"@capacitor/geolocation": "^6.0.1",
"@capacitor/ios": "^6.1.2",
"@fontsource/fira-mono": "^5.0.13",
"@ionic/pwa-elements": "^3.3.0",
"qr-scanner": "^1.4.2"
},
"devDependencies": {
"@capacitor/cli": "^6.1.1",
"@capacitor/cli": "^6.1.2",
"@chromatic-com/storybook": "^1.6.1",
"@eslint/compat": "^1.1.0",
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@neoconfetti/svelte": "^2.2.1",
"@playwright/test": "^1.45.3",
"@playwright/test": "^1.46.0",
"@rollup/plugin-replace": "^5.0.7",
"@ronilaukkarinen/stylelint-a11y": "^1.2.9",
"@storybook/addon-a11y": "^8.2.5",
Expand All @@ -99,11 +99,11 @@
"@storybook/sveltekit": "^8.2.5",
"@storybook/test": "^8.2.5",
"@storybook/theming": "^8.2.5",
"@sveltejs/adapter-auto": "^3.2.2",
"@sveltejs/adapter-netlify": "^4.3.1",
"@sveltejs/adapter-static": "^3.0.2",
"@sveltejs/adapter-vercel": "^5.4.1",
"@sveltejs/kit": "^2.5.20",
"@sveltejs/adapter-auto": "^3.2.3",
"@sveltejs/adapter-netlify": "^4.3.2",
"@sveltejs/adapter-static": "^3.0.3",
"@sveltejs/adapter-vercel": "^5.4.2",
"@sveltejs/kit": "^2.5.21",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@tauri-apps/api": "2.0.0-rc.0",
"@tauri-apps/cli": "2.0.0-rc.0",
Expand All @@ -112,8 +112,8 @@
"@types/minimist": "^1.2.5",
"@types/node": "^22.1.0",
"@types/object-hash": "^3.0.6",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@vite-pwa/sveltekit": "^0.6.0",
"@vitest/coverage-v8": "^2.0.5",
"autoprefixer": "^10.4.20",
Expand All @@ -135,8 +135,8 @@
"http-server": "^14.1.1",
"minimist": "^1.2.8",
"object-hash": "^3.0.0",
"pnpm": "^9.6.0",
"postcss": "^8.4.40",
"pnpm": "^9.7.0",
"postcss": "^8.4.41",
"postcss-cli": "^11.0.0",
"postcss-html": "^1.7.0",
"postcss-import": "^16.1.0",
Expand All @@ -159,11 +159,11 @@
"svgo": "^3.3.2",
"ts-node": "^10.9.2",
"tslib": "^2.6.3",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.0",
"typescript-eslint": "^8.0.1",
"typescript-eslint-parser-for-extra-files": "^0.7.0",
"unplugin-icons": "^0.19.1",
"unplugin-icons": "^0.19.2",
"vanilla-lazyload": "^19.1.3",
"vite": "^5.3.5",
"vite-plugin-pwa": "^0.20.1",
Expand Down
Loading

0 comments on commit 46015a2

Please sign in to comment.