Skip to content

Commit 5486943

Browse files
author
James Bradbury
committed
migrate files to new +page.svx format
migration stage 1
1 parent cf977ed commit 5486943

File tree

142 files changed

+3566
-483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+3566
-483
lines changed

.eslintignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.eslintrc.cjs

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
module.exports = {
22
root: true,
3-
parser: '@typescript-eslint/parser',
4-
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5-
plugins: ['svelte3', '@typescript-eslint'],
3+
extends: ['eslint:recommended', 'prettier'],
4+
plugins: ['svelte3'],
65
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
7-
settings: {
8-
'svelte3/typescript': () => require('typescript')
9-
},
106
parserOptions: {
117
sourceType: 'module',
128
ecmaVersion: 2020
@@ -15,8 +11,5 @@ module.exports = {
1511
browser: true,
1612
es2017: true,
1713
node: true
18-
},
19-
rules: {
20-
'@typescript-eslint/no-inferrable-types': 'off'
2114
}
2215
};

.gitattributes

-11
This file was deleted.

.gitignore

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
.DS_Store
22
node_modules
3-
.svelte-kit
4-
build
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
vite.config.js.timestamp-*
10+
vite.config.ts.timestamp-*
511

612
# autogenerated files
713
crumbs.json
@@ -18,3 +24,4 @@ pnpm-lock.yaml
1824
package-lock.json
1925
.pnpm-debug.log
2026
scripts/__pycache__
27+

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16.19

.prettierignore

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock
14+
115
.git
216
.gitignore
317
static
@@ -20,3 +34,4 @@ pnpm-lock.yaml
2034
package-lock.json
2135
.pnpm-debug.log
2236
scripts/__pycache__
37+

.prettierrc

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"trailingComma": "none",
55
"printWidth": 120,
66
"tabWidth": 4,
7-
"arrowParens": "avoid"
7+
"arrowParens": "avoid",
8+
"plugins": ["prettier-plugin-svelte"],
9+
"pluginSearchDirs": ["."],
10+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
811
}

README.md

+24-38
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,38 @@
1-
# Learn
1+
# create-svelte
22

3-
[![Deployment](https://github.com/flucoma/learn/actions/workflows/deploy.yml/badge.svg)](https://github.com/flucoma/learn/actions/workflows/deploy.yml)
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
44

5-
To run this website you will need a package manager for js/node such as `pnpm`, `yarn` or `npm`.
5+
## Creating a project
66

7-
## Run Locally
7+
If you're seeing this, you've probably already done this step. Congrats!
88

9-
Inside this repository run:
9+
```bash
10+
# create a new project in the current directory
11+
npm create svelte@latest
1012

11-
`pnpm i`
12-
13-
and then to run a local server:
14-
15-
`pnpm run dev`
13+
# create a new project in my-app
14+
npm create svelte@latest my-app
15+
```
1616

17-
which will spawn a web server at http://localhost:3000
17+
## Developing
1818

19-
## Run Static Site
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
2020

21-
`pnpm run build`
21+
```bash
22+
npm run dev
2223

23-
which will create a static site in `./build`
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
2427

25-
# How does it work?
28+
## Building
2629

27-
Pages are written in `.svx` format, which is a mix of markdown and svelte. Wrting is principally written in what you might know as normal markdown while bits of javascript (widgets, audio, pictures) are included as svelte widgets. There is also markdown frontmatter where you can include arbitrary information such as tags, a blurb, the title (so that you are not dependent on the name of the file itself). An example of a page describing how speakers work might look like this:
30+
To create a production version of your app:
2831

32+
```bash
33+
npm run build
2934
```
30-
---
31-
title: 'How speakers work'
32-
blurb: |
33-
Every wondered how sound is made by speakers? This article tells you all...
34-
tags:
35-
- audio
36-
- technology
37-
---
38-
39-
<script>
40-
import MyAmazingWidget from '$lib/demos/amazingwidget.svelte'
41-
</script>
42-
43-
# Speakers
44-
They are very good at wiggling the air for us
45-
46-
## How?
47-
Speaker move air wiggle. Simples. Look at the picture below
48-
49-
<MyAmazingWidget /> <-- this is defined inside the script tag and imported
50-
```
5135

52-
In the `scripts` folder you will find a file called `extract_structure.py`. This will parse the `.svx` pages and return some JSON data that is then stored in the `static` folder of this website. This is used to programatically generate the pages, links, tags and some content.
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

jsconfig.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
{
2+
"extends": "./.svelte-kit/tsconfig.json",
23
"compilerOptions": {
3-
"baseUrl": ".",
4-
"paths": {
5-
"$lib": ["src/lib"],
6-
"$lib/*": ["src/lib/*"]
7-
}
8-
},
9-
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
4+
"allowJs": true,
5+
"checkJs": true,
6+
"esModuleInterop": true,
7+
"forceConsistentCasingInFileNames": true,
8+
"resolveJsonModule": true,
9+
"skipLibCheck": true,
10+
"sourceMap": true,
11+
"strict": true
12+
}
13+
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias and https://kit.svelte.dev/docs/configuration#files
14+
//
15+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
16+
// from the referenced tsconfig.json - TypeScript does not merge them in
1017
}

package.json

+41-39
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,70 @@
11
{
2-
"name": "learn",
2+
"name": "learn-2.0",
33
"version": "0.0.1",
4+
"private": true,
45
"scripts": {
5-
"dev": "node scripts/metadata.js && node scripts/db.js && node scripts/related.js && svelte-kit dev --host",
6-
"build": "node scripts/metadata.js && node scripts/db.js && node scripts/related.js && svelte-kit build",
7-
"check": "svelte-check --tsconfig ./tsconfig.json",
8-
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
9-
"lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path=.prettierignore .",
10-
"format": "prettier --write --plugin-search-dir=. ."
6+
"dev": "node scripts/metadata.js && node scripts/db.js && node scripts/related.js && vite dev",
7+
"build": "node scripts/metadata.js && node scripts/db.js && node scripts/related.js && vite build",
8+
"preview": "vite preview",
9+
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
10+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
11+
"test": "playwright test",
12+
"test:unit": "vitest",
13+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
14+
"format": "prettier --plugin-search-dir . --write ."
1115
},
1216
"devDependencies": {
13-
"@sveltejs/adapter-static": "next",
14-
"@sveltejs/kit": "1.0.0-next.321",
15-
"@typescript-eslint/eslint-plugin": "^4.33.0",
16-
"@typescript-eslint/parser": "^4.33.0",
17-
"autoprefixer": "^10.4.5",
18-
"eslint": "^7.32.0",
17+
"@playwright/test": "^1.28.1",
18+
"@sveltejs/adapter-static": "^1.0.0",
19+
"@sveltejs/kit": "^1.0.0",
20+
"eslint": "^8.28.0",
1921
"eslint-config-prettier": "^8.5.0",
20-
"eslint-plugin-svelte3": "^3.4.1",
22+
"eslint-plugin-svelte3": "^4.0.0",
2123
"front-matter": "^4.0.2",
22-
"github-slugger": "^1.4.0",
23-
"glob": "^7.2.0",
24-
"hastscript": "^7.0.2",
24+
"github-slugger": "^1.5.0",
25+
"glob": "^7.2.3",
26+
"hastscript": "^7.1.0",
2527
"markdown": "^0.5.0",
2628
"markdown-link-extractor": "^1.3.1",
27-
"postcss": "^8.4.12",
28-
"prettier": "^2.6.2",
29-
"prettier-plugin-svelte": "^2.7.0",
29+
"mdsvex": "^0.10.6",
30+
"prettier": "^2.8.0",
31+
"prettier-plugin-svelte": "^2.8.1",
3032
"rehype-autolink-headings": "^6.1.1",
31-
"rehype-slug": "^4.0.1",
32-
"svelte": "^3.47.0",
33-
"svelte-check": "^2.7.0",
34-
"svelte-preprocess": "^4.10.6",
35-
"tslib": "^2.4.0",
36-
"typescript": "^4.6.4"
33+
"rehype-slug": "^5.1.0",
34+
"remark": "13.0.0",
35+
"remark-html": "13.0.1",
36+
"svelte": "^3.54.0",
37+
"svelte-check": "^2.9.2",
38+
"svelte-preprocess": "^5.0.0",
39+
"typescript": "^4.9.3",
40+
"vite": "^4.0.0",
41+
"vitest": "^0.25.3"
3742
},
3843
"type": "module",
3944
"dependencies": {
4045
"@flucoma/tf-kmeans": "^0.0.3",
41-
"@juggle/resize-observer": "^3.3.1",
42-
"@tensorflow/tfjs": "^3.16.0",
46+
"@juggle/resize-observer": "^3.4.0",
47+
"@tensorflow/tfjs": "^3.21.0",
4348
"array-smooth": "^1.0.0",
44-
"chart.js": "^3.7.1",
49+
"chart.js": "^3.9.1",
4550
"chartjs-plugin-annotation": "^1.4.0",
46-
"d3": "^7.4.4",
51+
"d3": "^7.8.0",
4752
"fuzzy-search": "^3.2.1",
48-
"konva": "^8.3.6",
53+
"konva": "^8.3.14",
4954
"lodash": "^4.17.21",
5055
"mdsvex": "^0.9.8",
51-
"meyda": "^5.3.0",
56+
"meyda": "^5.5.1",
5257
"numpy-parser": "^1.2.3",
5358
"peaks.js": "^0.27.0",
54-
"pts": "^0.10.9",
59+
"pts": "^0.10.12",
60+
"rehype-jargon": "^2.22.2",
5561
"remark": "13.0.0",
56-
"remark-html": "13.0.1",
57-
"remark-jargon": "^2.20.7",
5862
"seedrandom": "~2.4.4",
59-
"svelte-bricks": "^0.1.6",
63+
"svelte-bricks": "^0.1.7",
6064
"svelte-select": "^4.4.7",
6165
"svelte-youtube": "^0.0.2",
6266
"tone": "^14.7.77",
6367
"umap-js": "^1.3.3",
64-
"waveform-data": "^4.3.0",
65-
"webgl-plot": "^0.7.0",
66-
"youtube-player": "^5.5.2"
68+
"waveform-data": "^4.3.0"
6769
}
6870
}

playwright.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type {import('@playwright/test').PlaywrightTestConfig} */
2+
const config = {
3+
webServer: {
4+
command: 'npm run build && npm run preview',
5+
port: 4173
6+
},
7+
testDir: 'tests'
8+
};
9+
10+
export default config;

0 commit comments

Comments
 (0)