Compare commits
3 commits
7de82dd3fb
...
4e6e11d2e4
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e6e11d2e4 | |||
| f08a99ccb1 | |||
| 0e26241e4a |
18 changed files with 501 additions and 479 deletions
19
README.md
19
README.md
|
|
@ -1,20 +1,9 @@
|
||||||
# websnacks: Minimal Dependency Server-Side JSX for Static Sites
|
# websnacks: Minimal Dependency Server-Side JSX for Static Sites
|
||||||
|
|
||||||
<div>
|
[](https://www.npmjs.com/package/@websnacksjs/websnacks "NPM release")
|
||||||
|
[](https://www.mozilla.org/en-US/MPL/2.0/FAQ/ "License info")
|
||||||
[](https://www.npmjs.com/package/@websnacksjs/websnacks "NPM release")
|
[](https://git.theinnerlimit.ch/websnacksjs/websnacks/actions?workflow=ci.yml "CI status for main branch")
|
||||||
[](https://www.mozilla.org/en-US/MPL/2.0/FAQ/ "License info")
|

|
||||||
[](https://github.com/websnacksjs/websnacks/actions?query=branch%3Amainline "Build status for mainline branch")
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
[](https://david-dm.org/websnacksjs/websnacks "Dependency status")
|
|
||||||
[](https://david-dm.org/websnacksjs/websnacks?type=optional "Optional dependency status")
|
|
||||||
[](https://david-dm.org/websnacksjs/websnacks?type=dev "Dev dependency status")
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Develop fully static websites using typesafe JSX templates on the server without the complex build system and dependency management of server-side rendered React frameworks.
|
Develop fully static websites using typesafe JSX templates on the server without the complex build system and dependency management of server-side rendered React frameworks.
|
||||||
|
|
||||||
|
|
|
||||||
19
biome.json
19
biome.json
|
|
@ -1,16 +1,21 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
|
"$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
|
||||||
"organizeImports": {
|
"files": {
|
||||||
|
"includes": ["**", "!dist", "!node_modules", "!.temp"]
|
||||||
|
},
|
||||||
|
"assist": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"ignore": ["dist", "node_modules", ".temp"]
|
"actions": {
|
||||||
|
"source": {
|
||||||
|
"organizeImports": "on"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true
|
||||||
"ignore": ["dist", "node_modules", ".temp"]
|
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"ignore": ["dist", "node_modules", ".temp"],
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
"style": {
|
"style": {
|
||||||
|
|
@ -23,7 +28,7 @@
|
||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"include": ["test"],
|
"includes": ["test/**"],
|
||||||
"linter": {
|
"linter": {
|
||||||
"rules": {
|
"rules": {
|
||||||
"a11y": {
|
"a11y": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import { stylesheet } from "typestyle";
|
import { stylesheet } from "typestyle";
|
||||||
import { type Component, createElement } from "websnacks";
|
import {
|
||||||
|
type Component,
|
||||||
|
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
|
||||||
|
createElement,
|
||||||
|
} from "websnacks";
|
||||||
|
|
||||||
const styles = stylesheet({
|
const styles = stylesheet({
|
||||||
header: {
|
header: {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
import { normalize } from "csstips";
|
import { normalize } from "csstips";
|
||||||
import { stylesheet } from "typestyle";
|
import { stylesheet } from "typestyle";
|
||||||
import { type Component, createElement } from "websnacks";
|
import {
|
||||||
|
type Component,
|
||||||
|
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
|
||||||
|
createElement,
|
||||||
|
} from "websnacks";
|
||||||
|
|
||||||
import { stylesheetPath } from "../config";
|
import { stylesheetPath } from "../config";
|
||||||
import { Header } from "./header";
|
import { Header } from "./header";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import { stylesheet } from "typestyle";
|
import { stylesheet } from "typestyle";
|
||||||
import { type Component, createElement } from "websnacks";
|
import {
|
||||||
|
type Component,
|
||||||
|
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
|
||||||
|
createElement,
|
||||||
|
} from "websnacks";
|
||||||
|
|
||||||
const styles = stylesheet({
|
const styles = stylesheet({
|
||||||
navbar: {
|
navbar: {
|
||||||
|
|
|
||||||
2
examples/personal-site/package-lock.json
generated
2
examples/personal-site/package-lock.json
generated
|
|
@ -20,7 +20,7 @@
|
||||||
"websnacks": "bin/websnacks.js"
|
"websnacks": "bin/websnacks.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.8.3",
|
"@biomejs/biome": "2.4.14",
|
||||||
"@types/node": "~18",
|
"@types/node": "~18",
|
||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^7.4.0",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
import { type Component, createElement } from "websnacks";
|
import {
|
||||||
|
type Component,
|
||||||
|
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
|
||||||
|
createElement,
|
||||||
|
} from "websnacks";
|
||||||
|
|
||||||
import { Layout } from "../components/layout";
|
import { Layout } from "../components/layout";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
import { stylesheet } from "typestyle";
|
import { stylesheet } from "typestyle";
|
||||||
import { type Component, createElement } from "websnacks";
|
import {
|
||||||
|
type Component,
|
||||||
|
// biome-ignore lint/correctness/noUnusedImports: required to support JSX
|
||||||
|
createElement,
|
||||||
|
} from "websnacks";
|
||||||
|
|
||||||
import { Layout } from "../components/layout";
|
import { Layout } from "../components/layout";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { Config } from "websnacks";
|
||||||
|
|
||||||
import { stylesheetPath } from "./config";
|
import { stylesheetPath } from "./config";
|
||||||
|
|
||||||
const config: Config = {
|
const _config: Config = {
|
||||||
// Watch additional files and folders for changes when the dev server is
|
// Watch additional files and folders for changes when the dev server is
|
||||||
// running.
|
// running.
|
||||||
watch: ["components/", "config.ts"],
|
watch: ["components/", "config.ts"],
|
||||||
|
|
|
||||||
113
package-lock.json
generated
113
package-lock.json
generated
|
|
@ -12,9 +12,9 @@
|
||||||
"websnacks": "bin/websnacks.js"
|
"websnacks": "bin/websnacks.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.8.3",
|
"@biomejs/biome": "2.4.14",
|
||||||
"@types/node": "~18",
|
"@types/node": "~18",
|
||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^8.18.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "~4.9.5"
|
"typescript": "~4.9.5"
|
||||||
},
|
},
|
||||||
|
|
@ -22,16 +22,16 @@
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"node-watch": "^0.7.1",
|
"node-watch": "^0.7.4",
|
||||||
"ws": "^7.4.3"
|
"ws": "^8.20.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/biome": {
|
"node_modules/@biomejs/biome": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.4.14.tgz",
|
||||||
"integrity": "sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==",
|
"integrity": "sha512-TmAvxOEgrpLypzVGJ8FulIZnlyA9TxrO1hyqYrCz9r+bwma9xXxuLA5IuYnj55XQneFx460KjRbx6SWGLkg3bQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"license": "MIT OR Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"biome": "bin/biome"
|
"biome": "bin/biome"
|
||||||
},
|
},
|
||||||
|
|
@ -43,24 +43,25 @@
|
||||||
"url": "https://opencollective.com/biome"
|
"url": "https://opencollective.com/biome"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@biomejs/cli-darwin-arm64": "1.8.3",
|
"@biomejs/cli-darwin-arm64": "2.4.14",
|
||||||
"@biomejs/cli-darwin-x64": "1.8.3",
|
"@biomejs/cli-darwin-x64": "2.4.14",
|
||||||
"@biomejs/cli-linux-arm64": "1.8.3",
|
"@biomejs/cli-linux-arm64": "2.4.14",
|
||||||
"@biomejs/cli-linux-arm64-musl": "1.8.3",
|
"@biomejs/cli-linux-arm64-musl": "2.4.14",
|
||||||
"@biomejs/cli-linux-x64": "1.8.3",
|
"@biomejs/cli-linux-x64": "2.4.14",
|
||||||
"@biomejs/cli-linux-x64-musl": "1.8.3",
|
"@biomejs/cli-linux-x64-musl": "2.4.14",
|
||||||
"@biomejs/cli-win32-arm64": "1.8.3",
|
"@biomejs/cli-win32-arm64": "2.4.14",
|
||||||
"@biomejs/cli-win32-x64": "1.8.3"
|
"@biomejs/cli-win32-x64": "2.4.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-darwin-arm64": {
|
"node_modules/@biomejs/cli-darwin-arm64": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.14.tgz",
|
||||||
"integrity": "sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==",
|
"integrity": "sha512-XvgoE9XOawUOQPdmvs4J7wPhi/DLwSCGks3AlPJDmh34O0awRTqCED1HRcRDdpf1Zrp4us4MGOOdIxNpbqNF5Q==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
|
|
@ -70,13 +71,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-darwin-x64": {
|
"node_modules/@biomejs/cli-darwin-x64": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.14.tgz",
|
||||||
"integrity": "sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==",
|
"integrity": "sha512-jE7hKBCFhOx3uUh+ZkWBfOHxAcILPfhFplNkuID/eZeSTLHzfZzoZxW8fbqY9xXRnPi7jGNAf1iPVR+0yWsM/Q==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
|
|
@ -86,13 +88,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-arm64": {
|
"node_modules/@biomejs/cli-linux-arm64": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.14.tgz",
|
||||||
"integrity": "sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==",
|
"integrity": "sha512-2TELhZnW5RSLL063l9rc5xLpA0ZIw0Ccwy/0q384rvNAgFw3yI76bd59547yxowdQr5MNPET/xDLrLuvgSeeWQ==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
|
|
@ -102,13 +105,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
"node_modules/@biomejs/cli-linux-arm64-musl": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.14.tgz",
|
||||||
"integrity": "sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==",
|
"integrity": "sha512-/z+6gqAqqUQTHazwStxSXKHg9b8UvqBmDFRp+c4wYbq2KXhELQDon9EoC9RpmQ8JWkqQx/lIUy/cs+MhzDZp6A==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
|
|
@ -118,13 +122,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-x64": {
|
"node_modules/@biomejs/cli-linux-x64": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.14.tgz",
|
||||||
"integrity": "sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==",
|
"integrity": "sha512-zHrlQZDBDUz4OLAraYpWKcnLS6HOewBFWYOzY91d1ZjdqZwibOyb6BEu6WuWLugyo0P3riCmsbV9UqV1cSXwQg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
|
|
@ -134,13 +139,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-linux-x64-musl": {
|
"node_modules/@biomejs/cli-linux-x64-musl": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.14.tgz",
|
||||||
"integrity": "sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==",
|
"integrity": "sha512-R6BWgJdQOwW9ulJatuTVrQkjnODjqHZkKNOqb1sz++3Noe5LYd0i3PchnOBUCYAPHoPWHhjJqbdZlHEu0hpjdA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"linux"
|
"linux"
|
||||||
|
|
@ -150,13 +156,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-win32-arm64": {
|
"node_modules/@biomejs/cli-win32-arm64": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.14.tgz",
|
||||||
"integrity": "sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==",
|
"integrity": "sha512-M3EH5hqOI/F/FUA2u4xcLoUgmxd218mvuj/6JL7Hv2toQvr2/AdOvKSpGkoRuWFCtQPVa+ZqkEV3Q5xBA9+XSA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
|
|
@ -166,13 +173,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@biomejs/cli-win32-x64": {
|
"node_modules/@biomejs/cli-win32-x64": {
|
||||||
"version": "1.8.3",
|
"version": "2.4.14",
|
||||||
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.14.tgz",
|
||||||
"integrity": "sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==",
|
"integrity": "sha512-WL0EG5qE+EAKomGXbf2g6VnSKJhTL3tXC0QRzWRwA5VpjxNYa6H4P7ZWfymbGE4IhZZQi1KXQ2R0YjwInmz2fA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT OR Apache-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
"win32"
|
"win32"
|
||||||
|
|
@ -252,10 +260,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/ws": {
|
"node_modules/@types/ws": {
|
||||||
"version": "7.4.0",
|
"version": "8.18.1",
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
|
||||||
"integrity": "sha512-Y29uQ3Uy+58bZrFLhX36hcI3Np37nqWE7ky5tjiDoy1GDZnIwVxS0CgF+s+1bXMzjKBFy+fqaRfb708iNzdinw==",
|
"integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
|
|
@ -312,9 +321,10 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-watch": {
|
"node_modules/node-watch": {
|
||||||
"version": "0.7.1",
|
"version": "0.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-watch/-/node-watch-0.7.4.tgz",
|
||||||
"integrity": "sha512-UWblPYuZYrkCQCW5PxAwYSxaELNBLUckrTBBk8xr1/bUgyOkYYTsUcV4e3ytcazFEOyiRyiUrsG37pu6I0I05g==",
|
"integrity": "sha512-RinNxoz4W1cep1b928fuFhvAQ5ag/+1UlMDV7rbyGthBIgsiEouS4kvRayvvboxii4m8eolKOIBo3OjDqbc+uQ==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
|
|
@ -401,16 +411,17 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "7.4.3",
|
"version": "8.20.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.20.0.tgz",
|
||||||
"integrity": "sha512-hr6vCR76GsossIRsr8OLR9acVVm1jyfEWvhbNjtgPOrfvAlKzvyeg/P6r8RuDjRyrcQoPQT7K0DGEPc7Ae6jzA==",
|
"integrity": "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==",
|
||||||
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.3.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"bufferutil": "^4.0.1",
|
"bufferutil": "^4.0.1",
|
||||||
"utf-8-validate": "^5.0.2"
|
"utf-8-validate": ">=5.0.2"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"bufferutil": {
|
"bufferutil": {
|
||||||
|
|
|
||||||
|
|
@ -36,14 +36,14 @@
|
||||||
"test:e2e": "cd test && ts-node --script-mode ./run-e2e.ts"
|
"test:e2e": "cd test && ts-node --script-mode ./run-e2e.ts"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.8.3",
|
"@biomejs/biome": "2.4.14",
|
||||||
"@types/node": "~18",
|
"@types/node": "~18",
|
||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^8.18.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "~4.9.5"
|
"typescript": "~4.9.5"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"node-watch": "^0.7.1",
|
"node-watch": "^0.7.4",
|
||||||
"ws": "^7.4.3"
|
"ws": "^8.20.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ const copyStaticAssets = async ({
|
||||||
}: ConfigPaths): Promise<void> => {
|
}: ConfigPaths): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
await fs.access(staticAssetsDir);
|
await fs.access(staticAssetsDir);
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
// Static assets folder doesn't exist, so no-op.
|
// Static assets folder doesn't exist, so no-op.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { promises as fs, existsSync, watch } from "node:fs";
|
import { existsSync, promises as fs, watch } from "node:fs";
|
||||||
import * as http from "node:http";
|
import * as http from "node:http";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
|
|
||||||
|
|
@ -152,7 +152,7 @@ const startHttpServer = async (publicDir: string): Promise<http.Server> => {
|
||||||
let contents: Buffer | string;
|
let contents: Buffer | string;
|
||||||
try {
|
try {
|
||||||
contents = await fs.readFile(path.join(publicDir, reqPath));
|
contents = await fs.readFile(path.join(publicDir, reqPath));
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
console.error(`unable to load file ${reqPath}`);
|
console.error(`unable to load file ${reqPath}`);
|
||||||
res.writeHead(404);
|
res.writeHead(404);
|
||||||
res.end();
|
res.end();
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ export const loadConfig = async (rootDir: string): Promise<Config> => {
|
||||||
decacheModule(configPath);
|
decacheModule(configPath);
|
||||||
// TODO: validate user config.
|
// TODO: validate user config.
|
||||||
userConfig = await import(configPath);
|
userConfig = await import(configPath);
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
// Use default config;
|
// Use default config;
|
||||||
}
|
}
|
||||||
const outDir = path.join(rootDir, "public");
|
const outDir = path.join(rootDir, "public");
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { HTMLElement, Component, Fragment } from "./component";
|
export { Component, Fragment, HTMLElement } from "./component";
|
||||||
export { UserConfig as Config, defineConfig } from "./config";
|
export { defineConfig, UserConfig as Config } from "./config";
|
||||||
export { createElement } from "./create-element";
|
export { createElement } from "./create-element";
|
||||||
export * from "./jsx";
|
export * from "./jsx";
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import { promises as fs } from "node:fs";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
WEBSNACKS_BIN_PATH,
|
|
||||||
WEBSNACKS_REPO_ROOT,
|
|
||||||
npmCmd,
|
npmCmd,
|
||||||
runCommand,
|
runCommand,
|
||||||
|
WEBSNACKS_BIN_PATH,
|
||||||
|
WEBSNACKS_REPO_ROOT,
|
||||||
withTempDir,
|
withTempDir,
|
||||||
} from "../helpers/e2e";
|
} from "../helpers/e2e";
|
||||||
import { testSuite } from "../lib";
|
import { testSuite } from "../lib";
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import { promises as fs } from "node:fs";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
WEBSNACKS_BIN_PATH,
|
|
||||||
WEBSNACKS_REPO_ROOT,
|
|
||||||
npmCmd,
|
npmCmd,
|
||||||
runCommand,
|
runCommand,
|
||||||
|
WEBSNACKS_BIN_PATH,
|
||||||
|
WEBSNACKS_REPO_ROOT,
|
||||||
wait,
|
wait,
|
||||||
withTempDir,
|
withTempDir,
|
||||||
} from "../helpers/e2e";
|
} from "../helpers/e2e";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { type Component, Fragment, createElement } from "../../dist";
|
import { type Component, createElement, Fragment } from "../../dist";
|
||||||
import { renderPage } from "../../dist/render";
|
import { renderPage } from "../../dist/render";
|
||||||
import { testSuite } from "../lib";
|
import { testSuite } from "../lib";
|
||||||
|
|
||||||
|
|
@ -118,7 +118,6 @@ testSuite("renderPage", ({ test, expect }) => {
|
||||||
const html = renderPage(
|
const html = renderPage(
|
||||||
<html>
|
<html>
|
||||||
<div
|
<div
|
||||||
// biome-ignore lint/security/noDangerouslySetInnerHtml: explicit test
|
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: "<div>red alert!</div>",
|
__html: "<div>red alert!</div>",
|
||||||
}}
|
}}
|
||||||
|
|
@ -135,8 +134,6 @@ testSuite("renderPage", ({ test, expect }) => {
|
||||||
renderPage(
|
renderPage(
|
||||||
<html>
|
<html>
|
||||||
<div
|
<div
|
||||||
// biome-ignore lint/security/noDangerouslySetInnerHtml: explicit test
|
|
||||||
// biome-ignore lint/security/noDangerouslySetInnerHtmlWithChildren: explicit test
|
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: "<div>set phasers to kill</div>",
|
__html: "<div>set phasers to kill</div>",
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue