├── examples ├── islands │ ├── .vercelignore │ ├── .gitignore │ ├── index.js │ ├── src │ │ ├── types │ │ │ └── env.d.ts │ │ ├── styles │ │ │ ├── main.css │ │ │ ├── example.less │ │ │ ├── example.scss │ │ │ └── example.styl │ │ ├── api │ │ │ └── message.ts │ │ ├── pages │ │ │ ├── index.mdx │ │ │ ├── a.tsx │ │ │ └── b.tsx │ │ └── components │ │ │ ├── Main.client.tsx │ │ │ └── Counter.client.tsx │ ├── postcss.config.js │ ├── tailwind.config.js │ ├── .eslintrc.js │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── vercel.json │ ├── package.json │ └── build-src.js ├── minimal │ ├── .vercelignore │ ├── .gitignore │ ├── index.js │ ├── postcss.config.js │ ├── src │ │ ├── root.tsx │ │ └── pages │ │ │ └── index.tsx │ ├── tailwind.config.js │ ├── .eslintrc.js │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── vercel.json │ ├── package.json │ └── build-src.js └── hello-world │ ├── .gitignore │ ├── .vercelignore │ ├── index.js │ ├── src │ ├── types │ │ └── env.d.ts │ ├── styles │ │ ├── example.module.css │ │ └── main.css │ ├── api │ │ └── message.ts │ └── pages │ │ ├── sfc.tsx │ │ ├── a.tsx │ │ ├── b.tsx │ │ ├── wildcard │ │ └── [...list].tsx │ │ ├── parameter │ │ └── [id].tsx │ │ └── index.tsx │ ├── postcss.config.js │ ├── tailwind.config.js │ ├── .eslintrc.js │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── vercel.json │ ├── package.json │ └── build-src.js ├── docs ├── meta.md ├── islands.md ├── markdown.md ├── bundler.md ├── deployment.md ├── imports.md ├── spa.md └── root.md ├── packages ├── caldaria │ ├── src │ │ ├── build.ts │ │ ├── meta.ts │ │ ├── root.ts │ │ ├── router.ts │ │ ├── render-client.ts │ │ ├── render-server.ts │ │ ├── islands-client.ts │ │ ├── islands-server.ts │ │ ├── server.ts │ │ └── types.ts │ ├── env.d.ts │ ├── .eslintrc.js │ ├── pridepack.json │ ├── tsconfig.eslint.json │ ├── tsconfig.json │ └── .gitignore ├── core │ ├── build │ │ ├── pridepack.json │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── get-posix-path.ts │ │ │ ├── literal.ts │ │ │ ├── plugins │ │ │ │ ├── utils │ │ │ │ │ ├── create-raw-css-module.ts │ │ │ │ │ ├── create-url-css-module.ts │ │ │ │ │ ├── create-lazy-css.ts │ │ │ │ │ ├── fork-to-css-in-js.ts │ │ │ │ │ ├── create-inline-source-map.ts │ │ │ │ │ ├── create-style-id.ts │ │ │ │ │ ├── build-css-entrypoint.ts │ │ │ │ │ └── islands-handler.ts │ │ │ │ ├── resolvers.ts │ │ │ │ ├── raw.ts │ │ │ │ ├── progress.ts │ │ │ │ ├── url.ts │ │ │ │ └── solid.ts │ │ │ ├── resolve-tsconfig.ts │ │ │ ├── run-diagnostics.ts │ │ │ ├── get-pages.ts │ │ │ ├── get-artifact-directory.ts │ │ │ ├── create-build.ts │ │ │ ├── traverse-directory.ts │ │ │ ├── create-esbuild-diagnostics.ts │ │ │ ├── create-diagnostic-message.ts │ │ │ ├── imports.ts │ │ │ ├── options.ts │ │ │ ├── fs.ts │ │ │ └── inject-page.ts │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ └── .gitignore │ ├── meta │ │ ├── pridepack.json │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ ├── package.json │ │ └── .gitignore │ ├── server │ │ ├── pridepack.json │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ ├── package.json │ │ └── .gitignore │ ├── shared │ │ ├── pridepack.json │ │ ├── src │ │ │ ├── index.ts │ │ │ ├── StatusCode.ts │ │ │ ├── arrays.ts │ │ │ ├── constants.ts │ │ │ └── colors.ts │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ └── LICENSE │ ├── hybrid-router │ │ ├── pridepack.json │ │ ├── src │ │ │ ├── env.d.ts │ │ │ ├── page-lifecycle.ts │ │ │ ├── index.ts │ │ │ ├── dom-lifecycle.ts │ │ │ └── prefetch.ts │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ └── package.json │ ├── islands │ │ ├── client │ │ │ ├── env.d.ts │ │ │ ├── index.ts │ │ │ ├── nodes.ts │ │ │ └── process-script.ts │ │ ├── server │ │ │ └── index.ts │ │ ├── pridepack.json │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ ├── babel │ │ │ └── env.d.ts │ │ └── .gitignore │ ├── scheduler │ │ ├── src │ │ │ ├── env.d.ts │ │ │ ├── on-idle.ts │ │ │ ├── on-animation-frame.ts │ │ │ ├── on-delay.ts │ │ │ ├── on-load.ts │ │ │ ├── on-media.ts │ │ │ ├── on-interaction.ts │ │ │ ├── on-visible.ts │ │ │ └── on-ready-state.ts │ │ ├── pridepack.json │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ └── LICENSE │ ├── root │ │ ├── pridepack.json │ │ ├── src │ │ │ ├── App.ts │ │ │ ├── index.ts │ │ │ ├── Markdown.tsx │ │ │ └── Error.tsx │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ └── .gitignore │ ├── router │ │ ├── pridepack.json │ │ ├── src │ │ │ ├── errors │ │ │ │ ├── DuplicateRouterPathError.ts │ │ │ │ ├── InvalidRouterPathError.ts │ │ │ │ └── SharedRouterPathError.ts │ │ │ ├── utils │ │ │ │ ├── load-data.ts │ │ │ │ └── routing.ts │ │ │ ├── core │ │ │ │ ├── create-api-tree.ts │ │ │ │ └── create-page-tree.ts │ │ │ ├── index.ts │ │ │ └── components │ │ │ │ ├── Data.tsx │ │ │ │ ├── Page.tsx │ │ │ │ └── Router.tsx │ │ ├── .eslintrc.js │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ ├── package.json │ │ └── .gitignore │ └── render │ │ ├── server │ │ └── index.ts │ │ ├── pridepack.json │ │ ├── client │ │ ├── index.ts │ │ └── render-style.ts │ │ ├── .eslintrc.js │ │ ├── common │ │ └── error-page.ts │ │ ├── tsconfig.json │ │ ├── tsconfig.eslint.json │ │ ├── LICENSE │ │ └── .gitignore └── adapters │ ├── http │ ├── pridepack.json │ ├── .eslintrc.js │ ├── src │ │ ├── shims.ts │ │ ├── index.ts │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── LICENSE │ ├── package.json │ └── .gitignore │ ├── http2 │ ├── pridepack.json │ ├── .eslintrc.js │ ├── src │ │ ├── shims.ts │ │ ├── index.ts │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── LICENSE │ └── package.json │ ├── vanilla │ ├── pridepack.json │ ├── .eslintrc.js │ ├── src │ │ ├── shims.ts │ │ ├── index.ts │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── LICENSE │ └── package.json │ ├── vercel │ ├── pridepack.json │ ├── .eslintrc.js │ ├── src │ │ ├── shims.ts │ │ ├── index.ts │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── LICENSE │ └── package.json │ └── worker │ ├── pridepack.json │ ├── .eslintrc.js │ ├── src │ └── index.ts │ ├── tsconfig.json │ ├── tsconfig.eslint.json │ ├── LICENSE │ └── package.json ├── pnpm-workspace.yaml ├── .eslintrc ├── package.json ├── lerna.json ├── README.md └── LICENSE /examples/islands/.vercelignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /examples/minimal/.vercelignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /examples/hello-world/.gitignore: -------------------------------------------------------------------------------- 1 | .vercel 2 | *.pem -------------------------------------------------------------------------------- /examples/hello-world/.vercelignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /examples/islands/.gitignore: -------------------------------------------------------------------------------- 1 | .vercel 2 | *.pem -------------------------------------------------------------------------------- /examples/minimal/.gitignore: -------------------------------------------------------------------------------- 1 | .vercel 2 | *.pem -------------------------------------------------------------------------------- /docs/meta.md: -------------------------------------------------------------------------------- 1 | # Meta 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | -------------------------------------------------------------------------------- /docs/islands.md: -------------------------------------------------------------------------------- 1 | # Islands 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | -------------------------------------------------------------------------------- /docs/markdown.md: -------------------------------------------------------------------------------- 1 | # Markdown 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | -------------------------------------------------------------------------------- /packages/caldaria/src/build.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-build'; 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/meta.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-meta'; 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/root.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-root'; 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/router.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-router'; 2 | -------------------------------------------------------------------------------- /packages/core/build/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018" 3 | } -------------------------------------------------------------------------------- /packages/core/meta/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018" 3 | } -------------------------------------------------------------------------------- /packages/core/server/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018" 3 | } -------------------------------------------------------------------------------- /packages/core/shared/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018" 3 | } -------------------------------------------------------------------------------- /examples/islands/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./.caldaria/server'); -------------------------------------------------------------------------------- /examples/minimal/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./.caldaria/server'); -------------------------------------------------------------------------------- /examples/hello-world/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./.caldaria/server'); -------------------------------------------------------------------------------- /examples/islands/src/types/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/caldaria/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018" 3 | } -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'packages/**/*' 3 | - 'examples/**/*' 4 | -------------------------------------------------------------------------------- /examples/hello-world/src/types/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/render-client.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-render/client'; 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/render-server.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-render/server'; 2 | -------------------------------------------------------------------------------- /packages/core/islands/client/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/islands-client.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-islands/client'; 2 | -------------------------------------------------------------------------------- /packages/caldaria/src/islands-server.ts: -------------------------------------------------------------------------------- 1 | export * from 'caldaria-islands/server'; 2 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/src/env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/core/root/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jsx": "preserve" 4 | } -------------------------------------------------------------------------------- /packages/core/router/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jsx": "preserve" 4 | } -------------------------------------------------------------------------------- /packages/core/islands/server/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default as Client, 3 | } from './Client'; 4 | -------------------------------------------------------------------------------- /examples/hello-world/src/styles/example.module.css: -------------------------------------------------------------------------------- 1 | .title { 2 | @apply text-purple-500; 3 | } 4 | -------------------------------------------------------------------------------- /examples/islands/src/styles/main.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /examples/hello-world/src/styles/main.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /packages/caldaria/src/server.ts: -------------------------------------------------------------------------------- 1 | import createServer from 'caldaria-server'; 2 | 3 | export default createServer; 4 | -------------------------------------------------------------------------------- /packages/adapters/http/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jest": { 4 | "preset": "ts-jest" 5 | } 6 | } -------------------------------------------------------------------------------- /packages/adapters/http2/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jest": { 4 | "preset": "ts-jest" 5 | } 6 | } -------------------------------------------------------------------------------- /packages/adapters/vanilla/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jest": { 4 | "preset": "ts-jest" 5 | } 6 | } -------------------------------------------------------------------------------- /packages/adapters/vercel/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jest": { 4 | "preset": "ts-jest" 5 | } 6 | } -------------------------------------------------------------------------------- /packages/adapters/worker/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "jest": { 4 | "preset": "ts-jest" 5 | } 6 | } -------------------------------------------------------------------------------- /packages/core/render/server/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | renderServer, 3 | renderServerError, 4 | } from './render-server'; 5 | -------------------------------------------------------------------------------- /docs/bundler.md: -------------------------------------------------------------------------------- 1 | # Bundler 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | 5 | ## ESBuild 6 | 7 | ## PostCSS 8 | 9 | ## Babel 10 | -------------------------------------------------------------------------------- /examples/islands/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | } 6 | }; -------------------------------------------------------------------------------- /examples/minimal/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | } 6 | }; -------------------------------------------------------------------------------- /examples/hello-world/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | } 6 | }; -------------------------------------------------------------------------------- /examples/islands/src/styles/example.less: -------------------------------------------------------------------------------- 1 | @width: 10px; 2 | @height: @width + 10px; 3 | 4 | #header { 5 | width: @width; 6 | height: @height; 7 | } -------------------------------------------------------------------------------- /examples/islands/src/styles/example.scss: -------------------------------------------------------------------------------- 1 | $font-stack: Helvetica, sans-serif; 2 | $primary-color: #333; 3 | 4 | body { 5 | font: 100% $font-stack; 6 | color: $primary-color; 7 | } -------------------------------------------------------------------------------- /examples/minimal/src/root.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { 3 | createCaldariaRoot, 4 | } from 'caldaria/root'; 5 | 6 | export default createCaldariaRoot({}); 7 | -------------------------------------------------------------------------------- /packages/core/build/src/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default as createBuild, 3 | } from './create-build'; 4 | export { 5 | default as createDevBuild, 6 | } from './create-dev-build'; 7 | -------------------------------------------------------------------------------- /packages/core/build/src/get-posix-path.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | 3 | export default function getPOSIXPath(file: string): string { 4 | return file.replaceAll(path.sep, path.posix.sep); 5 | } 6 | -------------------------------------------------------------------------------- /packages/core/render/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "entrypoints": { 4 | "./server": "server/index.ts", 5 | "./client": "client/index.ts" 6 | }, 7 | "jsx": "preserve" 8 | } -------------------------------------------------------------------------------- /packages/core/render/client/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | useHotReload, 3 | default as hydrateClient, 4 | } from './hydrate-client'; 5 | export { 6 | default as renderStyle, 7 | } from './render-style'; 8 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-idle.ts: -------------------------------------------------------------------------------- 1 | export default function onIdle(callback: () => void): () => void { 2 | const id = requestIdleCallback(callback); 3 | return () => cancelIdleCallback(id); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/shared/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants'; 2 | export * from './types'; 3 | export { default as StatusCode } from './StatusCode'; 4 | export * from './colors'; 5 | export * from './arrays'; 6 | -------------------------------------------------------------------------------- /packages/core/islands/client/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default as createIsland, 3 | IslandComponent, 4 | } from './create-island'; 5 | export { 6 | setup as setupHybridRouter, 7 | } from 'caldaria-hybrid-router'; 8 | -------------------------------------------------------------------------------- /packages/core/islands/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "entrypoints": { 4 | "./babel": "./babel/index.ts", 5 | "./client": "./client/index.ts", 6 | "./server": "./server/index.ts" 7 | } 8 | } -------------------------------------------------------------------------------- /docs/deployment.md: -------------------------------------------------------------------------------- 1 | 2 | # Deployment 3 | 4 | ## 🚧 UNDER DEVELOPMENT 🚧 5 | 6 | ### Serverful 7 | 8 | TODO 9 | 10 | ### Vanilla 11 | 12 | TODO 13 | 14 | ### Vercel 15 | 16 | TODO 17 | 18 | ### Workers 19 | 20 | TODO -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-animation-frame.ts: -------------------------------------------------------------------------------- 1 | export default function onAnimationFrame(callback: () => void): () => void { 2 | const id = requestAnimationFrame(callback); 3 | return () => cancelAnimationFrame(id); 4 | } 5 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-delay.ts: -------------------------------------------------------------------------------- 1 | export default function onDelay( 2 | timeout: number, 3 | callback: () => void, 4 | ): () => void { 5 | const id = setTimeout(callback, timeout); 6 | return () => clearTimeout(id); 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/build/src/literal.ts: -------------------------------------------------------------------------------- 1 | // Used for generting identifier 2 | export function getAPILiteral(index: number): string { 3 | return `API${index}`; 4 | } 5 | 6 | export function getPageLiteral(index: number): string { 7 | return `Page${index}`; 8 | } 9 | -------------------------------------------------------------------------------- /packages/core/root/src/App.ts: -------------------------------------------------------------------------------- 1 | import { createMemo } from 'solid-js'; 2 | import { 3 | App, 4 | } from 'caldaria-shared'; 5 | 6 | const DefaultApp: App = (props) => createMemo(() => ( 7 | props.children 8 | )); 9 | 10 | export default DefaultApp; 11 | -------------------------------------------------------------------------------- /packages/core/router/src/errors/DuplicateRouterPathError.ts: -------------------------------------------------------------------------------- 1 | export default class DuplicateRouterPathError extends Error { 2 | constructor(key: string) { 3 | super(` 4 | Duplicate router path detected. 5 | 6 | Received: '${key}' 7 | `); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/router/src/errors/InvalidRouterPathError.ts: -------------------------------------------------------------------------------- 1 | export default class InvalidRouterPathError extends Error { 2 | constructor(received: string) { 3 | super(` 4 | Invalid router path detected 5 | 6 | Received: '${received}' 7 | `); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /examples/islands/src/api/message.ts: -------------------------------------------------------------------------------- 1 | import { ServerSideContext } from 'caldaria/types'; 2 | 3 | export default function getMessage(ctx: ServerSideContext): Response { 4 | console.log(ctx); 5 | return new Response('Hello World', { 6 | status: 200, 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /examples/islands/src/styles/example.styl: -------------------------------------------------------------------------------- 1 | border-radius() 2 | -webkit-border-radius: arguments 3 | -moz-border-radius: arguments 4 | border-radius: arguments 5 | 6 | body 7 | font: 12px Helvetica, Arial, sans-serif 8 | 9 | a.button 10 | border-radius: 5px -------------------------------------------------------------------------------- /examples/minimal/src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { JSX } from 'solid-js'; 3 | import { Dynamic } from 'solid-js/web'; 4 | 5 | export default function Example(): JSX.Element { 6 | return Hello World; 7 | } 8 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/create-raw-css-module.ts: -------------------------------------------------------------------------------- 1 | export default function createRawCSSModule(css: string, json: Record) { 2 | return `export const styles = ${JSON.stringify(json)}; 3 | export const sheet = ${JSON.stringify(css)}; 4 | `; 5 | } 6 | -------------------------------------------------------------------------------- /examples/hello-world/src/api/message.ts: -------------------------------------------------------------------------------- 1 | import { ServerSideContext } from 'caldaria/types'; 2 | 3 | export default function getMessage(ctx: ServerSideContext): Response { 4 | console.log(ctx); 5 | return new Response('Hello World', { 6 | status: 200, 7 | }); 8 | } 9 | -------------------------------------------------------------------------------- /docs/imports.md: -------------------------------------------------------------------------------- 1 | # Imports 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | 5 | ## Sass 6 | 7 | ## Less 8 | 9 | ## Stylus 10 | 11 | ## Raw 12 | 13 | TODO 14 | 15 | ## URL 16 | 17 | TODO 18 | 19 | ## Asset 20 | 21 | TODO 22 | 23 | ## JSON 24 | 25 | TODO 26 | 27 | ## Text 28 | 29 | TODO 30 | -------------------------------------------------------------------------------- /packages/core/build/src/resolve-tsconfig.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | 3 | export default function resolveTSConfig( 4 | configPath?: string, 5 | ): string | undefined { 6 | if (configPath == null) { 7 | return undefined; 8 | } 9 | return path.resolve(configPath); 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/router/src/errors/SharedRouterPathError.ts: -------------------------------------------------------------------------------- 1 | export default class SharedRouterPathError extends Error { 2 | constructor(received: string, existing: string) { 3 | super(` 4 | Shared router path detected. 5 | 6 | Received: '${received}' 7 | Existing: '${existing}' 8 | `); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/create-url-css-module.ts: -------------------------------------------------------------------------------- 1 | export default function createURLCSSModule( 2 | p: string, 3 | json: Record, 4 | ) { 5 | return ` 6 | export const styles = ${JSON.stringify(json)}; 7 | export { default as source } from ${JSON.stringify(`${p}?url-only`)}; 8 | `; 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-load.ts: -------------------------------------------------------------------------------- 1 | export default function onLoad(callback: () => void): () => void { 2 | const currentWindow = document.defaultView ?? window; 3 | currentWindow.addEventListener('load', callback, { 4 | once: true, 5 | }); 6 | return () => currentWindow.removeEventListener('load', callback); 7 | } 8 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parserOptions": { 4 | "project": [ 5 | "./tsconfig.eslint.json", 6 | "./packages/caldaria/tsconfig.eslint.json", 7 | "./packages/core/*/tsconfig.json", 8 | "./packages/adapters/*/tsconfig.json" 9 | ] 10 | }, 11 | "extends": [ 12 | "lxsmnsyc/typescript" 13 | ] 14 | } -------------------------------------------------------------------------------- /examples/islands/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: 'jit', 3 | content: [ 4 | './src/**/*.tsx', 5 | './src/**/*.mdx', 6 | ], 7 | darkMode: 'class', // or 'media' or 'class' 8 | theme: { 9 | extend: { 10 | }, 11 | }, 12 | variants: {}, 13 | plugins: [ 14 | require('@tailwindcss/typography') 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /examples/minimal/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: 'jit', 3 | content: [ 4 | './src/**/*.tsx', 5 | './src/**/*.solid', 6 | ], 7 | darkMode: 'class', // or 'media' or 'class' 8 | theme: { 9 | extend: { 10 | }, 11 | }, 12 | variants: {}, 13 | plugins: [ 14 | require('@tailwindcss/typography') 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /examples/hello-world/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: 'jit', 3 | content: [ 4 | './src/**/*.tsx', 5 | './src/**/*.solid', 6 | ], 7 | darkMode: 'class', // or 'media' or 'class' 8 | theme: { 9 | extend: { 10 | }, 11 | }, 12 | variants: {}, 13 | plugins: [ 14 | require('@tailwindcss/typography') 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/create-lazy-css.ts: -------------------------------------------------------------------------------- 1 | export default function createLazyCSS( 2 | id: string, 3 | content: string, 4 | json: Record, 5 | ) { 6 | return `import { renderStyle } from 'caldaria/render-client'; 7 | renderStyle(${JSON.stringify(id)}, ${JSON.stringify(content)}); 8 | export default ${JSON.stringify(json)}; 9 | `; 10 | } 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root", 3 | "private": true, 4 | "workspaces": [ 5 | "packages/adapters/*", 6 | "packages/core/*", 7 | "packages/caldaria", 8 | "examples/*" 9 | ], 10 | "devDependencies": { 11 | "eslint": "^8.21.0", 12 | "eslint-config-lxsmnsyc": "^0.4.8", 13 | "lerna": "^5.1.8", 14 | "typescript": "^4.7.4" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /examples/islands/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ] 15 | }, 16 | }; -------------------------------------------------------------------------------- /examples/minimal/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ] 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/adapters/http/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/core/shared/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /examples/hello-world/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ] 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/adapters/http2/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/adapters/vanilla/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/adapters/vercel/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/adapters/worker/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/core/render/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | }, 16 | }; -------------------------------------------------------------------------------- /packages/core/shared/src/StatusCode.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getReasonPhrase, 3 | } from 'http-status-codes'; 4 | 5 | export default class StatusCode extends Error { 6 | public readonly value: number; 7 | 8 | public readonly reason?: Error; 9 | 10 | constructor(value: number, reason?: Error) { 11 | super(`${value}: ${getReasonPhrase(value)}`); 12 | this.reason = reason; 13 | this.value = value; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/build/src/run-diagnostics.ts: -------------------------------------------------------------------------------- 1 | import { BuildResult } from 'esbuild'; 2 | import generateESBuildDiagnostics from './create-esbuild-diagnostics'; 3 | 4 | export default function runDiagnostics(result: BuildResult): void { 5 | if (result.errors.length) { 6 | generateESBuildDiagnostics(false, result.errors); 7 | } 8 | if (result.warnings.length) { 9 | generateESBuildDiagnostics(true, result.warnings); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/router/src/utils/load-data.ts: -------------------------------------------------------------------------------- 1 | import { RIGIDITY_DATA } from 'caldaria-shared'; 2 | 3 | export default async function loadData( 4 | pathname: string, 5 | search: string, 6 | ): Promise { 7 | const params = new URLSearchParams(search); 8 | params.set(RIGIDITY_DATA, ''); 9 | const response = await fetch(`${pathname}?${params.toString()}`); 10 | const result = await response.json(); 11 | return result as T; 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/scheduler/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": "es2018", 3 | "entrypoints": { 4 | "./animation-frame": "src/on-animation-frame.ts", 5 | "./delay": "src/on-delay.ts", 6 | "./interaction": "src/on-interaction.ts", 7 | "./idle": "src/on-idle.ts", 8 | "./load": "src/on-load.ts", 9 | "./media": "src/on-media.ts", 10 | "./ready-state": "src/on-ready-state.ts", 11 | "./visible": "src/on-visible.ts" 12 | } 13 | } -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "useWorkspaces": true, 3 | "workspaces": [ 4 | "packages/adapters/*", 5 | "packages/core/*", 6 | "packages/caldaria", 7 | "examples/*" 8 | ], 9 | "command": { 10 | "version": { 11 | "exact": true 12 | }, 13 | "publish": { 14 | "allowBranch": [ 15 | "main" 16 | ], 17 | "registry": "https://registry.npmjs.org/" 18 | } 19 | }, 20 | "version": "0.0.24" 21 | } 22 | -------------------------------------------------------------------------------- /packages/core/build/src/get-pages.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { 3 | filter, 4 | SUPPORTED_PAGE_EXT, 5 | } from 'caldaria-shared'; 6 | import traverseDirectory from './traverse-directory'; 7 | 8 | export default async function getPages(dir: string): Promise { 9 | return filter( 10 | await traverseDirectory(path.join(process.cwd(), dir)), 11 | (file) => SUPPORTED_PAGE_EXT.has(path.extname(file)), 12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /examples/islands/src/pages/index.mdx: -------------------------------------------------------------------------------- 1 | import Counter from '../components/Counter.client'; 2 | import Main from '../components/Main.client'; 3 | 4 | # This is a server-side title 5 | 6 |
7 |
8 | 9 |

This is a server-side paragraph.

10 |
11 |
12 | -------------------------------------------------------------------------------- /packages/core/server/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "@typescript-eslint/no-unsafe-assignment": "off" 16 | }, 17 | }; -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/fork-to-css-in-js.ts: -------------------------------------------------------------------------------- 1 | import { OnResolveArgs, OnResolveResult } from 'esbuild'; 2 | 3 | export default function forkToCSSInJS( 4 | targetNamespace: string, 5 | kind: OnResolveArgs['kind'], 6 | args: OnResolveResult, 7 | ): OnResolveResult { 8 | if (kind === 'import-rule' || kind === 'entry-point') { 9 | return { 10 | path: args.path, 11 | namespace: targetNamespace, 12 | }; 13 | } 14 | return args; 15 | } 16 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/create-inline-source-map.ts: -------------------------------------------------------------------------------- 1 | import type { RawSourceMap } from 'source-map-js'; 2 | 3 | export default function createInlineSourceMap( 4 | source: string, 5 | sourceMap: RawSourceMap | undefined, 6 | isDev?: boolean, 7 | ) { 8 | if (isDev && sourceMap) { 9 | const instance = Buffer.from(JSON.stringify(sourceMap)).toString('base64'); 10 | return `${source}\n/*# sourceMappingURL=data:application/json;base64,${instance} */`; 11 | } 12 | return source; 13 | } 14 | -------------------------------------------------------------------------------- /packages/caldaria/src/types.ts: -------------------------------------------------------------------------------- 1 | export { 2 | APICallback, 3 | Adapter, 4 | App, 5 | AppProps, 6 | BabelBuildOptions, 7 | BuildContext, 8 | BuildOptions, 9 | BundleType, 10 | StatusCode, 11 | ServerSideContext, 12 | DirectoryOptions, 13 | ErrorPage, 14 | ErrorProps, 15 | ServerFunction, 16 | LazyPage, 17 | PathOptions, 18 | Page, 19 | PageProps, 20 | PageRoute, 21 | Params, 22 | Query, 23 | CaldariaRoot, 24 | SSRMode, 25 | WebVitalsMetric, 26 | } from 'caldaria-shared'; 27 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/create-style-id.ts: -------------------------------------------------------------------------------- 1 | import UniqueIdGenerator from './id-generator'; 2 | 3 | export default function createStyleId(prefix: string) { 4 | const styleIds = new UniqueIdGenerator(); 5 | const paths = new Map(); 6 | 7 | return (source: string) => { 8 | const id = paths.get(source); 9 | if (id) { 10 | return id; 11 | } 12 | const newID = `${prefix}-${styleIds.next()}`; 13 | paths.set(source, newID); 14 | return newID; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/router/src/core/create-api-tree.ts: -------------------------------------------------------------------------------- 1 | import { APIRoute, APITree, APICallback } from 'caldaria-shared'; 2 | import { 3 | addRoute, 4 | createRouterNode, 5 | } from './router'; 6 | 7 | export default function createAPITree(routes: APIRoute[]): APITree { 8 | const root = createRouterNode(''); 9 | 10 | for (let i = 0, len = routes.length; i < len; i += 1) { 11 | const [path, call] = routes[i]; 12 | addRoute(root, path.split('/'), call); 13 | } 14 | 15 | return root; 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/build/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "@typescript-eslint/no-unsafe-assignment": "off", 16 | "no-void": "off", 17 | "no-restricted-syntax": "off" 18 | }, 19 | }; -------------------------------------------------------------------------------- /packages/core/meta/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "no-param-reassign": "off", 16 | "no-plusplus": "off", 17 | "@typescript-eslint/no-unsafe-assignment": "off" 18 | }, 19 | }; -------------------------------------------------------------------------------- /packages/core/root/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "no-param-reassign": "off", 16 | "no-plusplus": "off", 17 | "@typescript-eslint/no-unsafe-assignment": "off" 18 | }, 19 | }; -------------------------------------------------------------------------------- /docs/spa.md: -------------------------------------------------------------------------------- 1 | # Single-Page Application and SSR 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | 5 | `caldaria` utilizes Solid's blazing fast SSR capabilities while also maintaing the goodness of Single Page Applications. SolidJS offers 3 kinds of SSR: Sync, Async and Streaming, in which `caldaria` defaults to Async. You can pick your own SSR mode to build with using the `ssrMode` option for `createBuild`: 6 | 7 | ```js 8 | caldaria.createBuild({ 9 | ssrMode: 'async' // Other values: 'sync', 'node-stream', 'web-stream' 10 | }); 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/resolvers.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from 'esbuild'; 2 | import { registerDependencyMarker } from './utils/file-cache'; 3 | 4 | export default function resolversPlugin(): Plugin { 5 | return { 6 | name: 'caldaria:resolvers', 7 | setup(build) { 8 | // JS/TS 9 | registerDependencyMarker(build, /\.[mc]?[jt]s$/); 10 | // JSON 11 | registerDependencyMarker(build, /\.json$/); 12 | // Text 13 | registerDependencyMarker(build, /\.txt$/); 14 | }, 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/router/src/core/create-page-tree.ts: -------------------------------------------------------------------------------- 1 | import { LazyPage, PageRoute, PageTree } from 'caldaria-shared'; 2 | import { 3 | addRoute, 4 | createRouterNode, 5 | } from './router'; 6 | 7 | export default function createPageTree(routes: PageRoute[]): PageTree { 8 | const root = createRouterNode>(''); 9 | 10 | for (let i = 0, len = routes.length; i < len; i += 1) { 11 | const [path, component] = routes[i]; 12 | addRoute(root, path.split('/'), component); 13 | } 14 | 15 | return root; 16 | } 17 | -------------------------------------------------------------------------------- /packages/adapters/http/src/shims.ts: -------------------------------------------------------------------------------- 1 | if (!globalThis.fetch) { 2 | (async () => { 3 | const { 4 | default: fetch, 5 | Headers, 6 | Request, 7 | Response, 8 | } = await import('node-fetch'); 9 | globalThis.fetch = fetch as unknown as typeof globalThis.fetch; 10 | globalThis.Headers = Headers as unknown as typeof globalThis.Headers; 11 | globalThis.Request = Request as unknown as typeof globalThis.Request; 12 | globalThis.Response = Response as unknown as typeof globalThis.Response; 13 | })(); 14 | } 15 | -------------------------------------------------------------------------------- /packages/adapters/http2/src/shims.ts: -------------------------------------------------------------------------------- 1 | if (!globalThis.fetch) { 2 | (async () => { 3 | const { 4 | default: fetch, 5 | Headers, 6 | Request, 7 | Response, 8 | } = await import('node-fetch'); 9 | globalThis.fetch = fetch as unknown as typeof globalThis.fetch; 10 | globalThis.Headers = Headers as unknown as typeof globalThis.Headers; 11 | globalThis.Request = Request as unknown as typeof globalThis.Request; 12 | globalThis.Response = Response as unknown as typeof globalThis.Response; 13 | })(); 14 | } 15 | -------------------------------------------------------------------------------- /packages/adapters/vanilla/src/shims.ts: -------------------------------------------------------------------------------- 1 | if (!globalThis.fetch) { 2 | (async () => { 3 | const { 4 | default: fetch, 5 | Headers, 6 | Request, 7 | Response, 8 | } = await import('node-fetch'); 9 | globalThis.fetch = fetch as unknown as typeof globalThis.fetch; 10 | globalThis.Headers = Headers as unknown as typeof globalThis.Headers; 11 | globalThis.Request = Request as unknown as typeof globalThis.Request; 12 | globalThis.Response = Response as unknown as typeof globalThis.Response; 13 | })(); 14 | } 15 | -------------------------------------------------------------------------------- /packages/adapters/vercel/src/shims.ts: -------------------------------------------------------------------------------- 1 | if (!globalThis.fetch) { 2 | (async () => { 3 | const { 4 | default: fetch, 5 | Headers, 6 | Request, 7 | Response, 8 | } = await import('node-fetch'); 9 | globalThis.fetch = fetch as unknown as typeof globalThis.fetch; 10 | globalThis.Headers = Headers as unknown as typeof globalThis.Headers; 11 | globalThis.Request = Request as unknown as typeof globalThis.Request; 12 | globalThis.Response = Response as unknown as typeof globalThis.Response; 13 | })(); 14 | } 15 | -------------------------------------------------------------------------------- /packages/caldaria/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "import/no-unresolved": "off", 16 | "no-param-reassign": "off", 17 | "no-plusplus": "off", 18 | "@typescript-eslint/no-unsafe-assignment": "off" 19 | }, 20 | }; -------------------------------------------------------------------------------- /packages/caldaria/pridepack.json: -------------------------------------------------------------------------------- 1 | { 2 | "target": [ 3 | "es2017", 4 | "node12" 5 | ], 6 | "entrypoints": { 7 | "./build": "./src/build.ts", 8 | "./islands-client": "./src/islands-client.ts", 9 | "./islands-server": "./src/islands-server.ts", 10 | "./meta": "./src/meta.ts", 11 | "./render-server": "./src/render-server.ts", 12 | "./render-client": "./src/render-client.ts", 13 | "./root": "./src/root.ts", 14 | "./router": "./src/router.ts", 15 | "./server": "./src/server.ts", 16 | "./types": "./src/types.ts" 17 | } 18 | } -------------------------------------------------------------------------------- /packages/core/scheduler/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "no-param-reassign": "off", 16 | "no-plusplus": "off", 17 | "@typescript-eslint/no-unsafe-assignment": "off", 18 | "no-restricted-syntax": "off" 19 | }, 20 | }; -------------------------------------------------------------------------------- /packages/core/islands/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "no-param-reassign": "off", 16 | "no-plusplus": "off", 17 | "@typescript-eslint/no-unsafe-assignment": "off", 18 | "no-restricted-syntax": "off", 19 | "no-void": "off" 20 | }, 21 | }; -------------------------------------------------------------------------------- /packages/core/islands/client/nodes.ts: -------------------------------------------------------------------------------- 1 | export function getRoot(id: string): Element { 2 | const marker = document.querySelector(`ri-frame[rid="${id}"] > ri-root`); 3 | if (marker) { 4 | return marker; 5 | } 6 | throw new Error(`Missing ri-frame[rid="${id}"] > ri-root`); 7 | } 8 | export function getFragment(id: string): HTMLTemplateElement | null { 9 | const template = document.querySelector(`ri-frame[rid="${id}"] > template`); 10 | if (template) { 11 | return template as HTMLTemplateElement; 12 | } 13 | throw new Error(`Missing ri-frame[rid="${id}"] > template`); 14 | } 15 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "no-param-reassign": "off", 16 | "no-plusplus": "off", 17 | "@typescript-eslint/no-unsafe-assignment": "off", 18 | "no-restricted-syntax": "off", 19 | "no-void": "off" 20 | }, 21 | }; -------------------------------------------------------------------------------- /examples/islands/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["DOM", "ESNext"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/minimal/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["DOM", "ESNext"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/worker/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Adapter, ServerFunction } from 'caldaria/types'; 2 | 3 | const ADAPTER: Adapter = /* @__PURE__ */{ 4 | enableStaticFileServing: false, 5 | generateScript: (config) => ` 6 | import createServer from 'caldaria/server'; 7 | import adapter from 'caldaria-adapter-worker'; 8 | const server = createServer(${config}); 9 | const listener = adapter.create(server); 10 | 11 | addEventListener('fetch', (event) => { 12 | event.respondWith(listener(event.request)) 13 | }); 14 | `, 15 | create: (fn) => fn, 16 | }; 17 | 18 | export default ADAPTER; 19 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-media.ts: -------------------------------------------------------------------------------- 1 | export default function onMedia( 2 | query: string, 3 | callback: () => void, 4 | ): (() => void) | undefined { 5 | const media = window.matchMedia(query); 6 | 7 | const onMediaCallback = () => { 8 | if (media.matches) { 9 | callback(); 10 | media.removeEventListener('change', onMediaCallback); 11 | } 12 | }; 13 | 14 | if (media.matches) { 15 | callback(); 16 | return undefined; 17 | } 18 | media.addEventListener('change', onMediaCallback); 19 | return () => media.removeEventListener('change', onMediaCallback); 20 | } 21 | -------------------------------------------------------------------------------- /examples/hello-world/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["DOM", "ESNext"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/http/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/http2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/vanilla/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/vercel/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/worker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/http/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/http2/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/vanilla/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/vercel/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/adapters/worker/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "react", 18 | "esModuleInterop": true, 19 | "target": "ES2017" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/core/root/src/index.ts: -------------------------------------------------------------------------------- 1 | import { CaldariaRoot } from 'caldaria-shared'; 2 | 3 | export { 4 | default as DefaultApp, 5 | } from './App'; 6 | export { 7 | DefaultDocument, 8 | DocumentHead, 9 | DocumentHeadProps, 10 | DocumentHtml, 11 | DocumentMain, 12 | DocumentScript, 13 | Root, 14 | RootProps, 15 | useDocumentContext, 16 | } from './Document'; 17 | export { 18 | default as DefaultErrorComponent, 19 | } from './Error'; 20 | export { 21 | MDXProvider, 22 | useMDX, 23 | } from './Markdown'; 24 | 25 | export function createCaldariaRoot(options: CaldariaRoot): CaldariaRoot { 26 | return options; 27 | } 28 | -------------------------------------------------------------------------------- /packages/core/render/client/render-style.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isServer, 3 | } from 'solid-js/web'; 4 | import { on } from 'caldaria-hybrid-router'; 5 | 6 | function insertStyle(id: string, content: string) { 7 | if (!document.getElementById(id)) { 8 | const el = document.createElement('style'); 9 | el.id = id; 10 | el.textContent = content; 11 | document.head.appendChild(el); 12 | } 13 | } 14 | 15 | export default function renderStyle(id: string, content: string): void { 16 | if (!isServer) { 17 | on('load', () => { 18 | insertStyle(id, content); 19 | }); 20 | insertStyle(id, content); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/router/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": [ 3 | 'lxsmnsyc/typescript/solid', 4 | ], 5 | "parserOptions": { 6 | "project": "./tsconfig.eslint.json", 7 | "tsconfigRootDir": __dirname, 8 | }, 9 | "rules": { 10 | "import/no-extraneous-dependencies": [ 11 | "error", { 12 | "devDependencies": ["**/*.test.tsx"] 13 | } 14 | ], 15 | "no-param-reassign": "off", 16 | "no-plusplus": "off", 17 | "@typescript-eslint/no-unsafe-assignment": "off", 18 | "@typescript-eslint/no-unsafe-return": "off", 19 | "@typescript-eslint/no-unsafe-argument": "off" 20 | }, 21 | }; -------------------------------------------------------------------------------- /examples/islands/src/components/Main.client.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { JSX } from 'solid-js'; 3 | import { IslandComponent } from 'caldaria/islands-client'; 4 | 5 | type MainProps = IslandComponent<{ 6 | children: JSX.Element; 7 | }> 8 | 9 | export default function Main(props: MainProps): JSX.Element { 10 | return ( 11 |
12 |
13 |

Counter App Example

14 | {props.children} 15 |
16 |
17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /packages/core/render/common/error-page.ts: -------------------------------------------------------------------------------- 1 | import { 2 | DefaultErrorComponent, 3 | } from 'caldaria-root'; 4 | import { 5 | GlobalRenderOptions, 6 | ErrorPage, 7 | } from 'caldaria-shared'; 8 | 9 | export default function getErrorPage( 10 | statusCode: number, 11 | global: GlobalRenderOptions, 12 | ): ErrorPage { 13 | if (statusCode === 404 && global.root.Error404) { 14 | return global.root.Error404; 15 | } 16 | if (statusCode === 500 && global.root.Error500) { 17 | return global.root.Error500; 18 | } 19 | if (global.root.Error) { 20 | return global.root.Error; 21 | } 22 | return DefaultErrorComponent; 23 | } 24 | -------------------------------------------------------------------------------- /examples/islands/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["DOM", "ESNext"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/minimal/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["DOM", "ESNext"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/scheduler/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /examples/hello-world/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["DOM", "ESNext"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/build/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/meta/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/root/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/router/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/scheduler/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/shared/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `caldaria` 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | 5 | ## Features 6 | 7 | - [SPA and SSR](/docs/spa.md) 8 | - [Islands](/docs/islands.md) 9 | - [File-based routing, API Routes, Static File Serving, Isomorphic Forms and Data Loaders](/docs/routing.md) 10 | - [Custom App Root](/docs/root.md) 11 | - [SEO Management](/docs/meta.md) 12 | - [ESBuild, PostCSS and Babel](/docs/bundler.md) 13 | - [Deployments](/docs/deployment.md) 14 | - [Markdown](/docs/markdown.md) 15 | - [Supported imports](/docs/imports.md) 16 | 17 | ## Upcoming Features 18 | 19 | - Worker imports 20 | - WASM imports 21 | 22 | ## License 23 | 24 | MIT © [lxsmnsyc](https://github.com/lxsmnsyc) -------------------------------------------------------------------------------- /packages/caldaria/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "Node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/caldaria/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "env.d.ts"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./src", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "Node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/build/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/meta/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/render/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["client", "server", "common"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/root/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/router/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/server/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/shared/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["src", "types", "test"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/render/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["client", "server", "common"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/islands/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["server", "types", "babel", "client"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/core/islands/tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules"], 3 | "include": ["server", "types", "babel", "client"], 4 | "compilerOptions": { 5 | "module": "ESNext", 6 | "lib": ["ESNext", "DOM"], 7 | "importHelpers": true, 8 | "declaration": true, 9 | "sourceMap": true, 10 | "rootDir": "./", 11 | "strict": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "moduleResolution": "node", 17 | "jsx": "preserve", 18 | "jsxImportSource": "solid-js", 19 | "esModuleInterop": true, 20 | "target": "ES2017" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/adapters/vanilla/src/index.ts: -------------------------------------------------------------------------------- 1 | import { RequestListener } from 'http'; 2 | import { Adapter } from 'caldaria/types'; 3 | import { handleHTTP } from './utils'; 4 | import './shims'; 5 | 6 | const ADAPTER: Adapter = /* @__PURE__ */ { 7 | enableStaticFileServing: true, 8 | generateScript: (config) => ` 9 | import createServer from 'caldaria/server'; 10 | import adapter from 'caldaria-adapter-vanilla'; 11 | export default adapter.create(createServer(${config})); 12 | `, 13 | create: (fn) => async (request, response) => { 14 | // eslint-disable-next-line no-void 15 | await handleHTTP(fn, request, response); 16 | }, 17 | }; 18 | 19 | export default ADAPTER; 20 | -------------------------------------------------------------------------------- /examples/islands/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": [ 3 | { 4 | "src": ".caldaria/client/**/*", 5 | "use": "@vercel/static" 6 | }, 7 | { 8 | "src": "index.js", 9 | "use": "@vercel/node" 10 | } 11 | ], 12 | "rewrites": [ 13 | { 14 | "source": "/assets/:match*", 15 | "destination": "/.caldaria/client/:match*" 16 | }, 17 | { 18 | "source": "/(.*)", 19 | "destination": "/" 20 | } 21 | ], 22 | "headers": [ 23 | { 24 | "source": "/.caldaria/(.*)", 25 | "headers": [ 26 | { 27 | "key": "Cache-Control", 28 | "value": "public, max-age=31536000" 29 | } 30 | ] 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /examples/minimal/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": [ 3 | { 4 | "src": ".caldaria/client/**/*", 5 | "use": "@vercel/static" 6 | }, 7 | { 8 | "src": "index.js", 9 | "use": "@vercel/node" 10 | } 11 | ], 12 | "rewrites": [ 13 | { 14 | "source": "/assets/:match*", 15 | "destination": "/.caldaria/client/:match*" 16 | }, 17 | { 18 | "source": "/(.*)", 19 | "destination": "/" 20 | } 21 | ], 22 | "headers": [ 23 | { 24 | "source": "/.caldaria/(.*)", 25 | "headers": [ 26 | { 27 | "key": "Cache-Control", 28 | "value": "public, max-age=31536000" 29 | } 30 | ] 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /examples/hello-world/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "builds": [ 3 | { 4 | "src": ".caldaria/client/**/*", 5 | "use": "@vercel/static" 6 | }, 7 | { 8 | "src": "index.js", 9 | "use": "@vercel/node" 10 | } 11 | ], 12 | "rewrites": [ 13 | { 14 | "source": "/assets/:match*", 15 | "destination": "/.caldaria/client/:match*" 16 | }, 17 | { 18 | "source": "/(.*)", 19 | "destination": "/" 20 | } 21 | ], 22 | "headers": [ 23 | { 24 | "source": "/.caldaria/(.*)", 25 | "headers": [ 26 | { 27 | "key": "Cache-Control", 28 | "value": "public, max-age=31536000" 29 | } 30 | ] 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /packages/core/root/src/Markdown.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | createContext, 3 | JSX, 4 | splitProps, 5 | useContext, 6 | } from 'solid-js'; 7 | import { MDXProps } from 'solid-marked'; 8 | 9 | const MDXContext = /* @__PURE__ */ createContext(); 10 | 11 | export function MDXProvider(props: MDXProps & { children: JSX.Element }): JSX.Element { 12 | const [local, other] = splitProps(props, ['children']); 13 | return ( 14 | 15 | {local.children} 16 | 17 | ); 18 | } 19 | 20 | export function useMDX(): MDXProps { 21 | const ctx = useContext(MDXContext); 22 | if (ctx) { 23 | return ctx; 24 | } 25 | throw new Error('Missing MDXProvider'); 26 | } 27 | -------------------------------------------------------------------------------- /packages/core/build/src/get-artifact-directory.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { 3 | BUILD_OUTPUT, 4 | BUILD_PATH, 5 | BuildOptions, 6 | BundleType, 7 | } from 'caldaria-shared'; 8 | 9 | export function getArtifactBaseDirectory( 10 | options: BuildOptions, 11 | bundleType: BundleType, 12 | ): string { 13 | return path.join( 14 | options.directories?.build ?? BUILD_PATH, 15 | BUILD_OUTPUT[bundleType].temp, 16 | ); 17 | } 18 | 19 | export default function getArtifactDirectory( 20 | options: BuildOptions, 21 | bundleType: BundleType, 22 | directory: string, 23 | ): string { 24 | return path.join( 25 | getArtifactBaseDirectory( 26 | options, 27 | bundleType, 28 | ), 29 | directory, 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /packages/core/build/src/create-build.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BuildOptions, 3 | } from 'caldaria-shared'; 4 | import createClientBuild from './create-client-build'; 5 | import createServerBuild from './create-server-build'; 6 | import createIslandsBuild from './create-islands-build'; 7 | import runDiagnostics from './run-diagnostics'; 8 | 9 | export default async function createBuild(options: BuildOptions): Promise { 10 | const server = await createServerBuild(options); 11 | 12 | runDiagnostics(server); 13 | if (options.mode?.type === 'islands') { 14 | const islands = await createIslandsBuild(options); 15 | runDiagnostics(islands); 16 | } else { 17 | const client = await createClientBuild(options); 18 | runDiagnostics(client); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/raw.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Plugin, 3 | } from 'esbuild'; 4 | import fs from 'fs/promises'; 5 | import { resolvePath } from './utils/file-cache'; 6 | 7 | export default function rawPlugin(): Plugin { 8 | return { 9 | name: 'caldaria:raw', 10 | 11 | setup(build) { 12 | build.onResolve({ 13 | filter: /\?raw$/, 14 | }, (args) => ({ 15 | path: resolvePath(args), 16 | namespace: 'raw', 17 | })); 18 | build.onLoad({ 19 | filter: /.*/, 20 | namespace: 'raw', 21 | }, async (args) => { 22 | const text = await fs.readFile(args.path, 'utf8'); 23 | return { 24 | contents: text, 25 | loader: 'text', 26 | }; 27 | }); 28 | }, 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /packages/adapters/vercel/src/index.ts: -------------------------------------------------------------------------------- 1 | import { VercelRequest, VercelResponse } from '@vercel/node'; 2 | import { Adapter } from 'caldaria/types'; 3 | import { handleHTTP } from './utils'; 4 | import './shims'; 5 | 6 | type VercelFunction = (request: VercelRequest, response: VercelResponse) => Promise; 7 | const ADAPTER: Adapter = /* @__PURE__ */ { 8 | enableStaticFileServing: false, 9 | generateScript: (config) => ` 10 | import createServer from 'caldaria/server'; 11 | import adapter from 'caldaria-adapter-vercel'; 12 | export default adapter.create(createServer(${config})); 13 | `, 14 | create: (fn) => async (request, response) => { 15 | // eslint-disable-next-line no-void 16 | await handleHTTP(fn, request, response); 17 | }, 18 | }; 19 | 20 | export default ADAPTER; 21 | -------------------------------------------------------------------------------- /packages/core/router/src/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default as Router, 3 | useRouter, 4 | RouterProps, 5 | RouterInstance, 6 | } from './components/Router'; 7 | export { 8 | default as RouterLink, 9 | RouterLinkProps, 10 | } from './components/RouterLink'; 11 | export { 12 | matchRoute, 13 | } from './core/router'; 14 | export { 15 | default as createPage, 16 | } from './components/Page'; 17 | export { 18 | default as createAPITree, 19 | } from './core/create-api-tree'; 20 | export { 21 | default as createPageTree, 22 | } from './core/create-page-tree'; 23 | export { 24 | FormEncoding, 25 | FormMethod, 26 | FormProps, 27 | default as Form, 28 | } from './components/Form'; 29 | export { 30 | DataProvider, 31 | DataProviderProps, 32 | useDataContext, 33 | } from './components/Data'; 34 | -------------------------------------------------------------------------------- /packages/core/build/src/traverse-directory.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import fs from 'fs/promises'; 3 | import { map } from 'caldaria-shared'; 4 | 5 | export default async function traverseDirectory( 6 | root: string, 7 | directory: string = root, 8 | ): Promise { 9 | try { 10 | const files = await fs.readdir(directory); 11 | 12 | const recursiveTraverse = async (file: string) => { 13 | const fullPath = path.join(directory, file); 14 | 15 | if ((await fs.lstat(fullPath)).isDirectory()) { 16 | return traverseDirectory(root, fullPath); 17 | } 18 | return path.relative(root, fullPath); 19 | }; 20 | 21 | const results = await Promise.all( 22 | map(files, recursiveTraverse), 23 | ); 24 | 25 | return results.flat(); 26 | } catch (err) { 27 | return []; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-interaction.ts: -------------------------------------------------------------------------------- 1 | const DEFAULT_EVENTS = ['mouseenter', 'focusin', 'touchstart']; 2 | 3 | export default function onInteraction( 4 | events: string[] | boolean, 5 | marker: Element, 6 | callback: () => void, 7 | ): () => void { 8 | const allEvents = typeof events === 'boolean' ? DEFAULT_EVENTS : events; 9 | 10 | function run() { 11 | callback(); 12 | for (const event of allEvents) { 13 | marker.removeEventListener(event, run, { 14 | capture: true, 15 | }); 16 | } 17 | } 18 | 19 | for (const event of allEvents) { 20 | marker.addEventListener(event, run, { 21 | capture: true, 22 | }); 23 | } 24 | 25 | return () => { 26 | for (const event of allEvents) { 27 | marker.removeEventListener(event, run, { 28 | capture: true, 29 | }); 30 | } 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-visible.ts: -------------------------------------------------------------------------------- 1 | export default function onVisible( 2 | marker: Element, 3 | callback: () => void, 4 | observeChildren?: boolean, 5 | ): () => void { 6 | const observer = new IntersectionObserver((entries) => { 7 | // eslint-disable-next-line no-restricted-syntax 8 | for (const entry of entries) { 9 | if (entry.isIntersecting || entry.intersectionRatio > 0) { 10 | callback(); 11 | observer.disconnect(); 12 | break; 13 | } 14 | } 15 | }); 16 | 17 | if (observeChildren) { 18 | let node = marker.firstChild; 19 | 20 | while (node) { 21 | if (node instanceof Element) { 22 | observer.observe(node); 23 | } 24 | node = node.nextSibling; 25 | } 26 | } else { 27 | observer.observe(marker); 28 | } 29 | 30 | return () => observer.disconnect(); 31 | } 32 | -------------------------------------------------------------------------------- /examples/islands/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "MIT", 3 | "name": "islands", 4 | "version": "0.0.24", 5 | "scripts": { 6 | "build": "node build-src", 7 | "dev": "cross-env NODE_ENV=development node build-src" 8 | }, 9 | "dependencies": { 10 | "@vercel/node": "1.12.1", 11 | "@vercel/static-build": "^0.18.0", 12 | "caldaria": "0.0.24", 13 | "caldaria-adapter-http": "0.0.24", 14 | "caldaria-adapter-vercel": "0.0.24", 15 | "solid-headless": "^0.11.0", 16 | "solid-js": "^1.5.5" 17 | }, 18 | "devDependencies": { 19 | "@tailwindcss/typography": "^0.5.2", 20 | "autoprefixer": "^10.4.7", 21 | "cross-env": "^7.0.3", 22 | "eslint": "^8.21.0", 23 | "eslint-config-lxsmnsyc": "^0.4.8", 24 | "postcss": "^8.4.14", 25 | "tailwindcss": "^3.0.24", 26 | "typescript": "^4.7.4" 27 | }, 28 | "private": true 29 | } 30 | -------------------------------------------------------------------------------- /examples/minimal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "MIT", 3 | "name": "minimal", 4 | "version": "0.0.24", 5 | "scripts": { 6 | "build": "node build-src", 7 | "dev": "cross-env NODE_ENV=development node build-src" 8 | }, 9 | "dependencies": { 10 | "@vercel/node": "1.12.1", 11 | "@vercel/static-build": "^0.18.0", 12 | "caldaria": "0.0.24", 13 | "caldaria-adapter-http": "0.0.24", 14 | "caldaria-adapter-vercel": "0.0.24", 15 | "solid-headless": "^0.11.0", 16 | "solid-js": "^1.5.5" 17 | }, 18 | "devDependencies": { 19 | "@tailwindcss/typography": "^0.5.2", 20 | "autoprefixer": "^10.4.7", 21 | "cross-env": "^7.0.3", 22 | "eslint": "^8.21.0", 23 | "eslint-config-lxsmnsyc": "^0.4.8", 24 | "postcss": "^8.4.14", 25 | "tailwindcss": "^3.0.24", 26 | "typescript": "^4.7.4" 27 | }, 28 | "private": true 29 | } 30 | -------------------------------------------------------------------------------- /examples/hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "license": "MIT", 3 | "name": "hello-world", 4 | "version": "0.0.24", 5 | "scripts": { 6 | "build": "node build-src", 7 | "dev": "cross-env NODE_ENV=development node build-src" 8 | }, 9 | "dependencies": { 10 | "@vercel/node": "1.12.1", 11 | "@vercel/static-build": "^0.18.0", 12 | "caldaria": "0.0.24", 13 | "caldaria-adapter-http": "0.0.24", 14 | "caldaria-adapter-vercel": "0.0.24", 15 | "solid-headless": "^0.11.0", 16 | "solid-js": "^1.5.5" 17 | }, 18 | "devDependencies": { 19 | "@tailwindcss/typography": "^0.5.2", 20 | "autoprefixer": "^10.4.7", 21 | "cross-env": "^7.0.3", 22 | "eslint": "^8.21.0", 23 | "eslint-config-lxsmnsyc": "^0.4.8", 24 | "postcss": "^8.4.14", 25 | "tailwindcss": "^3.0.24", 26 | "typescript": "^4.7.4" 27 | }, 28 | "private": true 29 | } 30 | -------------------------------------------------------------------------------- /packages/core/shared/src/arrays.ts: -------------------------------------------------------------------------------- 1 | export function forEach( 2 | array: T[], 3 | callback: (value: T, index: number) => R, 4 | ): void { 5 | for (let i = 0, len = array.length; i < len; i += 1) { 6 | callback(array[i], i); 7 | } 8 | } 9 | 10 | export function map( 11 | array: T[], 12 | transform: (value: T, index: number) => R, 13 | ): R[] { 14 | const result: R[] = []; 15 | 16 | for (let i = 0, len = array.length; i < len; i += 1) { 17 | result[i] = transform(array[i], i); 18 | } 19 | 20 | return result; 21 | } 22 | 23 | export function filter( 24 | array: T[], 25 | predicate: (value: T, index: number) => boolean, 26 | ): T[] { 27 | const result: T[] = []; 28 | 29 | for (let i = 0, len = array.length; i < len; i += 1) { 30 | if (predicate(array[i], i)) { 31 | result.push(array[i]); 32 | } 33 | } 34 | 35 | return result; 36 | } 37 | -------------------------------------------------------------------------------- /packages/core/islands/client/process-script.ts: -------------------------------------------------------------------------------- 1 | function nodeScriptClone(node: HTMLScriptElement) { 2 | const script = document.createElement('script'); 3 | script.text = node.innerHTML; 4 | 5 | const attrs = node.attributes; 6 | for (let i = 0, len = attrs.length; i < len; i += 1) { 7 | const attr = attrs[i]; 8 | script.setAttribute(attr.name, attr.value); 9 | } 10 | return script; 11 | } 12 | 13 | function nodeScriptIs(node: Node): node is HTMLScriptElement { 14 | return node instanceof HTMLScriptElement; 15 | } 16 | 17 | export default function processScript(node: Node) { 18 | if (nodeScriptIs(node)) { 19 | node.parentNode?.replaceChild(nodeScriptClone(node), node); 20 | } else { 21 | const children = node.childNodes; 22 | for (let i = 0, len = children.length; i < len; i += 1) { 23 | processScript(children[i]); 24 | } 25 | } 26 | 27 | return node; 28 | } 29 | -------------------------------------------------------------------------------- /packages/adapters/http/src/index.ts: -------------------------------------------------------------------------------- 1 | import { RequestListener } from 'http'; 2 | import { Adapter } from 'caldaria/types'; 3 | import { handleHTTP } from './utils'; 4 | 5 | import './shims'; 6 | 7 | const ADAPTER: Adapter = /* @__PURE__ */ { 8 | enableStaticFileServing: true, 9 | generateScript: (config) => ` 10 | import http from 'http'; 11 | import createServer from 'caldaria/server'; 12 | import adapter from 'caldaria-adapter-http'; 13 | const server = createServer(${config}); 14 | const listener = adapter.create(server); 15 | const port = process.env.PORT || 3000; 16 | http.createServer(listener).listen(port).on('listening', () => { 17 | console.log(\`Listening at http://localhost:\${port}\`) 18 | }); 19 | `, 20 | create: (fn) => (request, response) => { 21 | // eslint-disable-next-line no-void 22 | void handleHTTP(fn, request, response); 23 | }, 24 | }; 25 | 26 | export default ADAPTER; 27 | -------------------------------------------------------------------------------- /examples/minimal/build-src.js: -------------------------------------------------------------------------------- 1 | const caldaria = require('caldaria/build'); 2 | const httpAdapter = require('caldaria-adapter-http').default; 3 | const vercelAdapter = require('caldaria-adapter-vercel').default; 4 | 5 | if (process.env.NODE_ENV === 'development') { 6 | caldaria.createDevBuild({ 7 | env: 'development', 8 | adapter: httpAdapter, 9 | // env: 'development', 10 | // adapter: httpAdapter, 11 | // ssrMode: 'node-stream', 12 | ssrMode: 'async', 13 | // ssrMode: 'sync', 14 | esbuild: { 15 | tsconfig: './tsconfig.json', 16 | }, 17 | }); 18 | } else { 19 | caldaria.createBuild({ 20 | env: 'production', 21 | adapter: vercelAdapter, 22 | // env: 'development', 23 | // adapter: httpAdapter, 24 | // ssrMode: 'node-stream', 25 | ssrMode: 'async', 26 | // ssrMode: 'sync', 27 | esbuild: { 28 | tsconfig: './tsconfig.json', 29 | }, 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /examples/hello-world/build-src.js: -------------------------------------------------------------------------------- 1 | const caldaria = require('caldaria/build'); 2 | const httpAdapter = require('caldaria-adapter-http').default; 3 | const vercelAdapter = require('caldaria-adapter-vercel').default; 4 | 5 | if (process.env.NODE_ENV === 'development') { 6 | caldaria.createDevBuild({ 7 | env: 'development', 8 | adapter: httpAdapter, 9 | // env: 'development', 10 | // adapter: httpAdapter, 11 | // ssrMode: 'node-stream', 12 | ssrMode: 'async', 13 | // ssrMode: 'sync', 14 | esbuild: { 15 | tsconfig: './tsconfig.json', 16 | }, 17 | }); 18 | } else { 19 | caldaria.createBuild({ 20 | env: 'production', 21 | adapter: vercelAdapter, 22 | // env: 'development', 23 | // adapter: httpAdapter, 24 | // ssrMode: 'node-stream', 25 | ssrMode: 'async', 26 | // ssrMode: 'sync', 27 | esbuild: { 28 | tsconfig: './tsconfig.json', 29 | }, 30 | }); 31 | } 32 | -------------------------------------------------------------------------------- /packages/core/build/src/create-esbuild-diagnostics.ts: -------------------------------------------------------------------------------- 1 | import { Message } from 'esbuild'; 2 | import { blue, yellow } from 'caldaria-shared'; 3 | import createDiagnosticMessage from './create-diagnostic-message'; 4 | 5 | function createEsbuildDiagnosticString(message: Message): string { 6 | const baseMessage = message.text; 7 | if (message.location) { 8 | const { location } = message; 9 | const file = blue(location.file); 10 | const line = yellow(`${location.line}`); 11 | const column = yellow(`${location.column + 1}`); 12 | return `${file} (${line}, ${column}): ${baseMessage}`; 13 | } 14 | 15 | return baseMessage; 16 | } 17 | 18 | export default function generateESBuildDiagnostics(isWarning: boolean, messages: Message[]): void { 19 | for (let i = 0, len = messages.length; i < len; i += 1) { 20 | createDiagnosticMessage( 21 | isWarning ? 'warning' : 'error', 22 | createEsbuildDiagnosticString(messages[i]), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/sfc.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | 3 | 'use solid-sfc'; 4 | 5 | import { Meta, Title } from 'caldaria/meta'; 6 | import { RouterLink } from 'caldaria/router'; 7 | 8 | export default ( 9 |
10 |
11 | Welcome to SFC Example! 12 | 13 | 14 | {'Welcome to '} 15 | SFC Example 16 | ! 17 | 18 |
19 | This page is written in SFC format. 20 |
21 |
22 | Go to home 23 |
24 |
25 |
26 | ); 27 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/progress.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Plugin, 3 | } from 'esbuild'; 4 | import { log, green } from 'caldaria-shared'; 5 | 6 | function getTime(base: [number, number]) { 7 | const result = process.hrtime(base); 8 | return (result[0] * 1000000000 + result[1]) / 1000000; 9 | } 10 | 11 | interface ProgressPluginOptions { 12 | prefix: string; 13 | } 14 | 15 | export default function progressPlugin(options: ProgressPluginOptions): Plugin { 16 | let top = true; 17 | return { 18 | name: 'caldaria:progress', 19 | setup(build) { 20 | let end: [number, number] | undefined; 21 | build.onStart(() => { 22 | if (top) { 23 | end = process.hrtime(); 24 | top = false; 25 | log(options.prefix, 'Build started.'); 26 | } 27 | }); 28 | build.onEnd(() => { 29 | if (end) { 30 | top = true; 31 | log(options.prefix, `Built in ${green(`${getTime(end).toFixed(3)}ms`)}.`); 32 | } 33 | }); 34 | }, 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /examples/islands/build-src.js: -------------------------------------------------------------------------------- 1 | const caldaria = require('caldaria/build'); 2 | const httpAdapter = require('caldaria-adapter-http').default; 3 | const vercelAdapter = require('caldaria-adapter-vercel').default; 4 | 5 | if (process.env.NODE_ENV === 'development') { 6 | caldaria.createDevBuild({ 7 | mode: { 8 | type: 'islands', 9 | }, 10 | env: 'development', 11 | adapter: httpAdapter, 12 | // env: 'development', 13 | // adapter: httpAdapter, 14 | // ssrMode: 'node-stream', 15 | ssrMode: 'async', 16 | // ssrMode: 'sync', 17 | esbuild: { 18 | tsconfig: './tsconfig.json', 19 | }, 20 | }); 21 | } else { 22 | caldaria.createBuild({ 23 | mode: { 24 | type: 'islands', 25 | }, 26 | env: 'production', 27 | adapter: vercelAdapter, 28 | // env: 'development', 29 | // adapter: httpAdapter, 30 | // ssrMode: 'node-stream', 31 | ssrMode: 'async', 32 | // ssrMode: 'sync', 33 | esbuild: { 34 | tsconfig: './tsconfig.json', 35 | }, 36 | }); 37 | } 38 | -------------------------------------------------------------------------------- /packages/core/build/src/create-diagnostic-message.ts: -------------------------------------------------------------------------------- 1 | import { 2 | cyan, 3 | green, 4 | red, 5 | yellow, 6 | } from 'caldaria-shared'; 7 | 8 | type DiagnosticCategory = 'error' | 'message' | 'suggestion' | 'warning'; 9 | 10 | interface DiagnosticDisplay { 11 | symbol: string; 12 | color: (value: string) => string; 13 | } 14 | 15 | type DiagnosticDisplayOptions = { 16 | [key in DiagnosticCategory]: DiagnosticDisplay; 17 | }; 18 | 19 | const DIAGNOSTIC_DISPLAYS: DiagnosticDisplayOptions = { 20 | error: { 21 | symbol: '✖', 22 | color: red, 23 | }, 24 | message: { 25 | symbol: '✔', 26 | color: green, 27 | }, 28 | suggestion: { 29 | symbol: 'ℹ', 30 | color: cyan, 31 | }, 32 | warning: { 33 | symbol: '⚠', 34 | color: yellow, 35 | }, 36 | }; 37 | 38 | export default function createDiagnosticMessage( 39 | category: DiagnosticCategory, 40 | message: string, 41 | ): void { 42 | const display = DIAGNOSTIC_DISPLAYS[category]; 43 | console.log(`${display.color(display.symbol)} ${message}`); 44 | } 45 | -------------------------------------------------------------------------------- /examples/islands/src/components/Counter.client.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { createSignal, JSX } from 'solid-js'; 3 | import { IslandComponent } from 'caldaria/islands-client'; 4 | 5 | type CountProps = IslandComponent<{ 6 | initialValue: number; 7 | }> 8 | 9 | export default function Counter(props: CountProps): JSX.Element { 10 | const [count, setCount] = createSignal(props.initialValue); 11 | 12 | function increment() { 13 | setCount((c) => c + 1); 14 | } 15 | function decrement() { 16 | setCount((c) => c - 1); 17 | } 18 | 19 | return ( 20 |
21 | 24 | {`Count: ${count()}`} 25 | 28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/src/page-lifecycle.ts: -------------------------------------------------------------------------------- 1 | export type PageLifecycleType = 'beforeunload' | 'unload' | 'load'; 2 | 3 | export class PageLifecycleEvent extends Event { 4 | } 5 | 6 | export type PageLifecycleListener = (ev: PageLifecycleEvent) => void; 7 | 8 | const LISTENERS = new Map>(); 9 | 10 | export function on(event: PageLifecycleType, callback: PageLifecycleListener): () => void { 11 | let listeners = LISTENERS.get(event); 12 | 13 | if (!listeners) { 14 | listeners = new Set(); 15 | LISTENERS.set(event, listeners); 16 | } 17 | 18 | listeners.add(callback); 19 | 20 | return () => { 21 | listeners?.delete(callback); 22 | }; 23 | } 24 | 25 | export function notify( 26 | event: PageLifecycleType, 27 | ): boolean { 28 | const listeners = LISTENERS.get(event); 29 | 30 | const instance = new PageLifecycleEvent(event); 31 | 32 | if (listeners) { 33 | for (const listener of listeners.keys()) { 34 | listener(instance); 35 | } 36 | } 37 | 38 | return instance.defaultPrevented; 39 | } 40 | -------------------------------------------------------------------------------- /packages/adapters/http/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/build/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/islands/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/meta/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/render/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/root/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/router/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/server/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/shared/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/adapters/http2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/adapters/vanilla/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/adapters/vercel/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/adapters/worker/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/hybrid-router/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/scheduler/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2022 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /packages/core/scheduler/src/on-ready-state.ts: -------------------------------------------------------------------------------- 1 | export default function onReadyState( 2 | readyState: DocumentReadyState, 3 | callback: () => void, 4 | ): undefined | (() => void) { 5 | const cb = () => { 6 | switch (readyState) { 7 | case 'loading': 8 | // Call regardless 9 | callback(); 10 | return true; 11 | case 'interactive': 12 | if (document.readyState !== 'loading') { 13 | callback(); 14 | return true; 15 | } 16 | return false; 17 | case 'complete': 18 | if (document.readyState === 'complete') { 19 | callback(); 20 | return true; 21 | } 22 | return false; 23 | default: 24 | return false; 25 | } 26 | }; 27 | if (!cb()) { 28 | const listener = () => { 29 | if (cb()) { 30 | document.removeEventListener('readystatechange', listener); 31 | } 32 | }; 33 | document.addEventListener('readystatechange', listener); 34 | return () => document.removeEventListener('readystatechange', listener); 35 | } 36 | return undefined; 37 | } 38 | -------------------------------------------------------------------------------- /examples/islands/src/pages/a.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { JSX } from 'solid-js'; 5 | 6 | export default function A(): JSX.Element { 7 | return ( 8 |
9 |
10 | Welcome to Page A! 11 | 12 | 13 | {'Welcome to '} 14 | Page A 15 | ! 16 | 17 |
18 | Go to home 19 | Go to page B 20 |
21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /examples/islands/src/pages/b.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { JSX } from 'solid-js'; 5 | 6 | export default function B(): JSX.Element { 7 | return ( 8 |
9 |
10 | Welcome to Page B! 11 | 12 | 13 | {'Welcome to '} 14 | Page B 15 | ! 16 | 17 |
18 | Go to home 19 | Go to page A 20 |
21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/a.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { JSX } from 'solid-js'; 5 | 6 | export default function A(): JSX.Element { 7 | return ( 8 |
9 |
10 | Welcome to Page A! 11 | 12 | 13 | {'Welcome to '} 14 | Page A 15 | ! 16 | 17 |
18 | Go to home 19 | Go to page B 20 |
21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/b.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { JSX } from 'solid-js'; 5 | 6 | export default function B(): JSX.Element { 7 | return ( 8 |
9 |
10 | Welcome to Page B! 11 | 12 | 13 | {'Welcome to '} 14 | Page B 15 | ! 16 | 17 |
18 | Go to home 19 | Go to page A 20 |
21 |
22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Alexis Munsayac 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/build-css-entrypoint.ts: -------------------------------------------------------------------------------- 1 | import { PluginBuild } from 'esbuild'; 2 | import path from 'path'; 3 | import { filter, map } from 'caldaria-shared'; 4 | import { outputFile } from '../../fs'; 5 | 6 | const decoder = new TextDecoder(); 7 | 8 | export default async function buildCSSEntrypoint( 9 | instance: PluginBuild, 10 | sourcefile: string, 11 | contents: string, 12 | ) { 13 | const output = await instance.esbuild.build({ 14 | ...instance.initialOptions, 15 | incremental: undefined, 16 | entryPoints: undefined, 17 | sourcemap: instance.initialOptions.sourcemap ? 'inline' : undefined, 18 | write: false, 19 | stdin: { 20 | contents, 21 | resolveDir: path.dirname(sourcefile), 22 | loader: 'css', 23 | sourcefile: path.basename(sourcefile), 24 | }, 25 | }); 26 | 27 | const root = filter(output.outputFiles, (item) => path.basename(item.path) === 'stdin.css'); 28 | 29 | await Promise.all(map(output.outputFiles, async (item) => { 30 | if (path.basename(item.path) !== 'stdin.css') { 31 | await outputFile(item.path, item.contents); 32 | } 33 | })); 34 | 35 | return decoder.decode(root[0].contents); 36 | } 37 | -------------------------------------------------------------------------------- /docs/root.md: -------------------------------------------------------------------------------- 1 | # Root 2 | 3 | ## 🚧 UNDER DEVELOPMENT 🚧 4 | 5 | A custom root allows lower-level override for building the app. This is useful when you want to provide your error pages, manage your document structure or implement your own app shell. 6 | 7 | To create a custom root, you need to create a `src/root` file. 8 | 9 | ```js 10 | // src/root.tsx 11 | import { createCaldariaRoot } from 'caldaria/root'; 12 | 13 | export default createCaldariaRoot({}); 14 | ``` 15 | 16 | ## `App` 17 | 18 | When switching between pages, old pages gets unmounted, which might not be preferrable specially if we have a state that's located in the components that we want to preserve or if the most of the page's layout is unchanging between navigations. By building a custom `App` component, this allows one to solve such problem. 19 | 20 | ```js 21 | import { createCaldariaRoot } from 'caldaria'; 22 | 23 | export default createCaldariaRoot({ 24 | App(props) { 25 | return ( 26 | 27 | {props.children} 28 | 29 | ); 30 | } 31 | }); 32 | ``` 33 | 34 | ## `Document` 35 | 36 | TODO 37 | 38 | ## `Error`, `Error404` and `Error500` 39 | 40 | TODO 41 | 42 | ## `reportWebVitals` 43 | 44 | TODO 45 | -------------------------------------------------------------------------------- /packages/core/islands/babel/env.d.ts: -------------------------------------------------------------------------------- 1 | declare module '@babel/helper-module-imports' { 2 | import { NodePath } from '@babel/traverse'; 3 | import * as t from '@babel/types'; 4 | 5 | interface ImportOptions { 6 | importedSource: string | null; 7 | importedType: 'es6' | 'commonjs'; 8 | importedInterop: 'babel' | 'node' | 'compiled' | 'uncompiled'; 9 | importingInterop: 'babel' | 'node'; 10 | ensureLiveReference: boolean; 11 | ensureNoContext: boolean; 12 | importPosition: 'before' | 'after'; 13 | nameHint: string; 14 | blockHoist: number; 15 | } 16 | 17 | export function addDefault( 18 | path: NodePath, 19 | importedSource: string, 20 | opts?: Partial 21 | ): t.Identifier; 22 | export function addNamed( 23 | path: NodePath, 24 | name: string, 25 | importedSource: string, 26 | opts?: Partial 27 | ): t.Identifier; 28 | export function addNamespace( 29 | path: NodePath, 30 | importedSource: string, 31 | opts?: Partial 32 | ): t.Identifier; 33 | export function addSideEffect( 34 | path: NodePath, 35 | importedSource: string, 36 | opts?: Partial 37 | ): t.Identifier; 38 | } 39 | -------------------------------------------------------------------------------- /packages/adapters/http2/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Http2ServerRequest, Http2ServerResponse } from 'http2'; 2 | import { Adapter } from 'caldaria/types'; 3 | import { handleHTTP2 } from './utils'; 4 | import './shims'; 5 | 6 | type HTTP2Listener = (request: Http2ServerRequest, response: Http2ServerResponse) => void; 7 | 8 | const ADAPTER: Adapter = /* @__PURE__ */ { 9 | enableStaticFileServing: true, 10 | generateScript: (config) => ` 11 | import http2 from 'http2'; 12 | import fs from 'fs'; 13 | import createServer from 'caldaria/server'; 14 | import adapter from 'caldaria-adapter-http2'; 15 | const server = createServer(${config}); 16 | const listener = adapter.create(server); 17 | const options = { 18 | key: fs.readFileSync('key.pem'), 19 | cert: fs.readFileSync('cert.pem'), 20 | allowHTTP1: true, 21 | }; 22 | const port = process.env.PORT || 3000; 23 | http2.createSecureServer(options, listener).listen(port).on('listening', () => { 24 | console.log(\`Listening at http://localhost:\${port}\`) 25 | }); 26 | `, 27 | create: (fn) => (request, response) => { 28 | // eslint-disable-next-line no-void 29 | void handleHTTP2(fn, request, response); 30 | }, 31 | }; 32 | 33 | export default ADAPTER; 34 | -------------------------------------------------------------------------------- /packages/core/router/src/components/Data.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | createContext, 3 | createSignal, 4 | JSX, 5 | useContext, 6 | } from 'solid-js'; 7 | 8 | interface DataContext { 9 | initial: boolean; 10 | load: L; 11 | action: A; 12 | setAction: (value: A) => void; 13 | } 14 | 15 | const DataContext = /* @__PURE__ */ createContext>(); 16 | 17 | export function useDataContext(): DataContext { 18 | const ctx = useContext(DataContext); 19 | if (ctx) { 20 | return ctx; 21 | } 22 | throw new Error('Missing DataContext'); 23 | } 24 | 25 | export interface DataProviderProps { 26 | load: L; 27 | action: A; 28 | children: JSX.Element; 29 | } 30 | 31 | export function DataProvider(props: DataProviderProps) { 32 | const [action, setAction] = createSignal(props.action); 33 | return ( 34 | 46 | {props.children} 47 | 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /packages/core/router/src/utils/routing.ts: -------------------------------------------------------------------------------- 1 | export function getLocationOrigin(): string { 2 | const { protocol, hostname, port } = window.location; 3 | return `${protocol}//${hostname}${port ? `:${port}` : ''}`; 4 | } 5 | 6 | export function isLocalURL(url: string): boolean { 7 | // prevent a hydration mismatch on href for url with anchor refs 8 | if (url.startsWith('/') || url.startsWith('#') || url.startsWith('?')) { 9 | return true; 10 | } 11 | try { 12 | // absolute urls can be local if they are on the same origin 13 | const locationOrigin = getLocationOrigin(); 14 | const resolved = new URL(url, locationOrigin); 15 | return resolved.origin === locationOrigin; 16 | } catch (_) { 17 | return false; 18 | } 19 | } 20 | 21 | export function isModifiedEvent(event: MouseEvent): boolean { 22 | const { target } = event.currentTarget as HTMLAnchorElement; 23 | return ( 24 | (target && target !== '_self') 25 | || event.metaKey 26 | || event.ctrlKey 27 | || event.shiftKey 28 | || event.altKey // triggers resource download 29 | ); 30 | } 31 | 32 | export function normalizeURL(url: string): string { 33 | const locationOrigin = getLocationOrigin(); 34 | const resolved = new URL(url, locationOrigin); 35 | return resolved.pathname; 36 | } 37 | -------------------------------------------------------------------------------- /packages/core/router/src/components/Page.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | createEffect, 3 | createResource, 4 | lazy, 5 | } from 'solid-js'; 6 | import { 7 | Page, 8 | LazyPage, 9 | } from 'caldaria-shared'; 10 | import { useDataContext } from './Data'; 11 | import { useRouter } from './Router'; 12 | import loadData from '../utils/load-data'; 13 | 14 | export default function createPage( 15 | lazyComponent: () => Promise<{ default: Page }>, 16 | ): LazyPage { 17 | const PageComponent = lazy(lazyComponent); 18 | 19 | function Component() { 20 | const ctx = useDataContext(); 21 | const router = useRouter(); 22 | const [load] = createResource( 23 | () => !ctx.initial, 24 | async () => ( 25 | loadData(router.pathname, router.search) 26 | ), 27 | { 28 | initialValue: ctx.load, 29 | }, 30 | ); 31 | 32 | createEffect(() => { 33 | ctx.initial = false; 34 | }); 35 | return ( 36 | 43 | ); 44 | } 45 | 46 | Component.preload = async () => { 47 | const mod = await lazyComponent(); 48 | return mod.default; 49 | }; 50 | 51 | return Component; 52 | } 53 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/src/index.ts: -------------------------------------------------------------------------------- 1 | import { log } from 'caldaria-shared'; 2 | import { onInsert, resetObserver } from './dom-lifecycle'; 3 | import { notify, on } from './page-lifecycle'; 4 | import { registerAnchor, setupEvents } from './register-anchor'; 5 | 6 | function load() { 7 | resetObserver(); 8 | if (import.meta.env.DEV) { 9 | log('hybrid-router', 'Registered observer'); 10 | } 11 | 12 | document.body.querySelectorAll('a').forEach(registerAnchor); 13 | if (import.meta.env.DEV) { 14 | log('hybrid-router', 'Registered anchor tags synchronously'); 15 | } 16 | 17 | onInsert((item) => { 18 | if (item instanceof HTMLAnchorElement) { 19 | registerAnchor(item); 20 | } 21 | }); 22 | if (import.meta.env.DEV) { 23 | log('hybrid-router', 'Observing anchor tags'); 24 | } 25 | } 26 | 27 | export function setup() { 28 | setupEvents(); 29 | if (import.meta.env.DEV) { 30 | log('hybrid-router', 'Registered events'); 31 | } 32 | 33 | on('load', load); 34 | 35 | // Defer on DOMContentLoad 36 | if (/complete|interactive|loaded/.test(document.readyState)) { 37 | notify('load'); 38 | } else { 39 | window.addEventListener('DOMContentLoaded', () => { 40 | notify('load'); 41 | }); 42 | } 43 | } 44 | 45 | export { onInsert, onRemove } from './dom-lifecycle'; 46 | export { 47 | PageLifecycleEvent, 48 | PageLifecycleListener, 49 | PageLifecycleType, 50 | on, 51 | } from './page-lifecycle'; 52 | -------------------------------------------------------------------------------- /packages/core/build/src/imports.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { map } from 'caldaria-shared'; 3 | import getPOSIXPath from './get-posix-path'; 4 | import { 5 | getPageLiteral, 6 | getAPILiteral, 7 | } from './literal'; 8 | 9 | // Generates import declarations 10 | export function getPageImports( 11 | targetDirectory: string, 12 | artifactDirectory: string, 13 | pages: string[], 14 | ): string[] { 15 | return map(pages, (page, index) => { 16 | const { name, dir, ext } = path.parse(page); 17 | 18 | const srcFile = path.join(targetDirectory, dir, `${name}${ext}`); 19 | 20 | // Transform path to POSIX 21 | const targetFile = getPOSIXPath(path.relative(artifactDirectory, srcFile)); 22 | 23 | const literal = getPageLiteral(index); 24 | // Create lazy load declaration 25 | return `const ${literal} = createPage(() => import('${targetFile}'))`; 26 | }); 27 | } 28 | 29 | export function getAPIImports( 30 | targetDirectory: string, 31 | artifactDirectory: string, 32 | endpoints: string[], 33 | ): string[] { 34 | return map(endpoints, (endpoint, index) => { 35 | const { name, dir } = path.parse(endpoint); 36 | 37 | const srcFile = path.join(targetDirectory, dir, name); 38 | 39 | // Transform path to POSIX 40 | const targetFile = getPOSIXPath(path.relative(artifactDirectory, srcFile)); 41 | 42 | // Declare import for api 43 | return `import ${getAPILiteral(index)} from '${targetFile}';`; 44 | }); 45 | } 46 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/src/dom-lifecycle.ts: -------------------------------------------------------------------------------- 1 | const insertListeners = new Set<(el: Node) => void>(); 2 | const removeListeners: Map void)> = new Map(); 3 | 4 | let OBSERVER: MutationObserver | undefined; 5 | 6 | function onObserve(records: MutationRecord[]) { 7 | for (const record of records) { 8 | if (record.type === 'childList') { 9 | for (let i = 0, len = record.addedNodes.length; i < len; i += 1) { 10 | for (const listener of insertListeners.keys()) { 11 | listener(record.addedNodes[i]); 12 | } 13 | } 14 | for (let i = 0, len = record.removedNodes.length; i < len; i += 1) { 15 | const item = record.removedNodes[i]; 16 | if (removeListeners.has(item)) { 17 | const listener = removeListeners.get(item); 18 | if (listener) { 19 | listener(); 20 | removeListeners.delete(item); 21 | } 22 | } 23 | } 24 | } 25 | } 26 | } 27 | 28 | export function resetObserver() { 29 | if (OBSERVER) { 30 | OBSERVER.disconnect(); 31 | insertListeners.clear(); 32 | removeListeners.clear(); 33 | } 34 | OBSERVER = new MutationObserver(onObserve); 35 | 36 | OBSERVER.observe(document.body, { 37 | childList: true, 38 | subtree: true, 39 | }); 40 | } 41 | 42 | export function onInsert(callback: (el: Node) => void) { 43 | insertListeners.add(callback); 44 | } 45 | 46 | export function onRemove(el: Node, callback: () => void) { 47 | removeListeners.set(el, callback); 48 | } 49 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/wildcard/[...list].tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { JSX } from 'solid-js'; 5 | import { isServer } from 'solid-js/web'; 6 | 7 | interface Params { 8 | list: string[]; 9 | } 10 | 11 | interface HelloProps { 12 | data: string; 13 | params: Params; 14 | } 15 | 16 | function Wildcard(props: HelloProps): JSX.Element { 17 | return ( 18 |
19 |
20 | {`Welcome to Page ${props.params.list.join(', ')}!`} 21 | 22 | 23 | {'Welcome to '} 24 | {`Page ${props.params.list.join(', ')}`} 25 | ! 26 | 27 | 28 | {props.data.load} 29 | 30 |
31 | Go to home 32 |
33 |
34 |
35 | ); 36 | } 37 | 38 | if (isServer) { 39 | Wildcard.load = (_: Request, params: Params) => `Hello, ${params.list.join(', ')}`; 40 | } 41 | 42 | export default Wildcard; 43 | -------------------------------------------------------------------------------- /packages/core/shared/src/constants.ts: -------------------------------------------------------------------------------- 1 | // Directory relative to project root where all pages are located 2 | export const PAGES_PATH = 'src/pages'; 3 | 4 | // Directory relative to project root where api files are located 5 | export const API_PATH = 'src/api'; 6 | 7 | // Directory relative to project root where public files are located 8 | export const PUBLIC_PATH = 'src/public'; 9 | 10 | export const DOCUMENT_DATA = 'caldaria__data'; 11 | 12 | // Name of the app root 13 | export const DOCUMENT_MAIN_ROOT = 'caldaria__root'; 14 | 15 | // Base URL path for static file serving 16 | export const ASSETS_URL = 'assets'; 17 | export const PUBLIC_URL = 'public'; 18 | 19 | export const API_URL = 'api'; 20 | 21 | export const PAGES_URL = 'pages'; 22 | 23 | // Directory output 24 | export const BUILD_PATH = '.caldaria'; 25 | 26 | export const CUSTOM_ROOT = 'src/root'; 27 | 28 | export const DIRECTORY_ROOT = 'index'; 29 | 30 | export const SUPPORTED_PAGE_EXT = /* @__PURE__ */ new Set([ 31 | '.js', 32 | '.jsx', 33 | '.ts', 34 | '.tsx', 35 | ...'md|mdx|markdown|mdown|mkdn|mkd|mkdown|ron'.split('|').map((item) => `.${item}`), 36 | ]); 37 | 38 | export const BUILD_OUTPUT = { 39 | client: { 40 | output: 'client', 41 | temp: 'tmp.client', 42 | }, 43 | server: { 44 | output: 'server', 45 | temp: 'tmp.server', 46 | }, 47 | }; 48 | 49 | // Special search query for data-only fetching 50 | export const RIGIDITY_DATA = '.caldaria-data'; 51 | export const RIGIDITY_ACTION = '.caldaria-action'; 52 | 53 | // Special headers 54 | export const RIGIDITY_REDIRECT_HEADER = 'X-Caldaria-Redirect'; 55 | 56 | export const DEFAULT_WS_PORT = 12321; 57 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/url.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Plugin, 3 | } from 'esbuild'; 4 | import fs from 'fs/promises'; 5 | import { registerDependencyMarker, resolvePath } from './utils/file-cache'; 6 | 7 | export default function urlPlugin(): Plugin { 8 | return { 9 | name: 'caldaria:url', 10 | 11 | setup(build) { 12 | build.onResolve({ filter: /^https?:\/\// }, () => ({ 13 | external: true, 14 | })); 15 | 16 | registerDependencyMarker(build, /\?url$/); 17 | registerDependencyMarker(build, /\.(jpe?g|png|gif|svg|ico|webp|avif)$/); 18 | registerDependencyMarker(build, /\.(mp4|webm|ogg|mp3|wav|flac|aac)$/); 19 | registerDependencyMarker(build, /\.(woff2?|eot|ttf|otf)$/); 20 | 21 | build.onResolve({ filter: /\?url$/ }, (args) => ({ 22 | path: resolvePath(args), 23 | namespace: 'url', 24 | })); 25 | // images 26 | build.onResolve({ filter: /\.(jpe?g|png|gif|svg|ico|webp|avif)$/ }, (args) => ({ 27 | path: resolvePath(args), 28 | namespace: 'url', 29 | })); 30 | // media 31 | build.onResolve({ filter: /\.(mp4|webm|ogg|mp3|wav|flac|aac)$/ }, (args) => ({ 32 | path: resolvePath(args), 33 | namespace: 'url', 34 | })); 35 | // font 36 | build.onResolve({ filter: /\.(woff2?|eot|ttf|otf)$/ }, (args) => ({ 37 | path: resolvePath(args), 38 | namespace: 'url', 39 | })); 40 | 41 | // Loader 42 | build.onLoad({ filter: /.*/, namespace: 'url' }, async (args) => ({ 43 | contents: await fs.readFile(args.path), 44 | loader: 'file', 45 | })); 46 | }, 47 | }; 48 | } 49 | -------------------------------------------------------------------------------- /packages/core/root/src/Error.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | getReasonPhrase, 3 | } from 'http-status-codes'; 4 | import { 5 | createMemo, 6 | JSX, 7 | } from 'solid-js'; 8 | import { 9 | Style, 10 | Title, 11 | } from 'caldaria-meta'; 12 | import { 13 | ErrorProps, 14 | Page, 15 | } from 'caldaria-shared'; 16 | 17 | const ERROR_ROOT_STYLE: JSX.CSSProperties = { 18 | color: '#000', 19 | background: '#fff', 20 | 'font-family': '-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif', 21 | width: '100vw', 22 | height: '100vh', 23 | display: 'flex', 24 | 'align-items': 'center', 25 | 'justify-content': 'center', 26 | }; 27 | 28 | const ERROR_STATUS_CODE_STYLE: JSX.CSSProperties = { 29 | 'font-size': '1.5rem', 30 | 'line-height': '2rem', 31 | 'font-weight': 'bold', 32 | 'margin-right': '2rem', 33 | }; 34 | 35 | const ERROR_REASON_STYLE: JSX.CSSProperties = { 36 | 'font-size': '1.25rem', 37 | 'line-height': '1.75rem', 38 | }; 39 | 40 | const DefaultErrorComponent: Page = (props): JSX.Element => ( 41 | createMemo(() => { 42 | const currentData = props.data; 43 | if (!currentData) { 44 | return null; 45 | } 46 | const code = currentData.load.statusCode; 47 | const phrase = getReasonPhrase(code); 48 | return ( 49 |
50 | {`${code}: ${phrase}`} 51 | 52 | {code} 53 | {phrase} 54 |
55 | ); 56 | }) 57 | ); 58 | 59 | export default DefaultErrorComponent; 60 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/utils/islands-handler.ts: -------------------------------------------------------------------------------- 1 | import islands from 'caldaria-islands/babel'; 2 | 3 | export type IslandsOnEntry = (id: string, entry: string) => void; 4 | 5 | export interface IslandsHandlerOptions { 6 | extension: string; 7 | assets: string; 8 | prefix: string; 9 | generate?: 'dom' | 'ssr'; 10 | onEntry?: IslandsOnEntry; 11 | } 12 | 13 | export default class IslandsHandler { 14 | private entries = new Map(); 15 | 16 | private filenames = new Map(); 17 | 18 | private options: IslandsHandlerOptions; 19 | 20 | constructor(options: IslandsHandlerOptions) { 21 | this.options = options; 22 | } 23 | 24 | private createEntry(entry: string): string { 25 | const result = this.entries.get(entry); 26 | if (result) { 27 | return result; 28 | } 29 | const id = `${this.options.prefix}-${this.entries.size}`; 30 | this.entries.set(entry, id); 31 | this.options.onEntry?.(id, entry); 32 | return id; 33 | } 34 | 35 | private getFilename(pth: string) { 36 | const filename = this.filenames.get(pth); 37 | 38 | if (filename) { 39 | return filename; 40 | } 41 | 42 | const entry = this.createEntry(pth); 43 | const newFilename = `/${this.options.assets}/${entry}.js`; 44 | this.filenames.set(pth, newFilename); 45 | return newFilename; 46 | } 47 | 48 | getPlugins( 49 | pth: string, 50 | ) { 51 | if (this.options.generate !== 'ssr') { 52 | return []; 53 | } 54 | if (new RegExp(`\\.client\\.${this.options.extension}$`).test(pth)) { 55 | return [[islands, { source: this.getFilename(pth) }]]; 56 | } 57 | return [[islands]]; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /packages/core/build/src/options.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { 3 | DIRECTORY_ROOT, filter, map, 4 | } from 'caldaria-shared'; 5 | import getPOSIXPath from './get-posix-path'; 6 | import { 7 | getPageLiteral, 8 | getAPILiteral, 9 | } from './literal'; 10 | 11 | function getPageOption(page: string, index: number): string { 12 | const extname = path.extname(page); 13 | const directory = path.dirname(page); 14 | const filename = path.basename(page, extname); 15 | 16 | const extensionless = path.join(directory, filename); 17 | 18 | const output = `[${JSON.stringify(getPOSIXPath(path.join('/', extensionless)))},${getPageLiteral(index)}]`; 19 | if (filename === DIRECTORY_ROOT) { 20 | return `[${JSON.stringify(getPOSIXPath(path.join('/', directory)))},${getPageLiteral(index)}], ${output}`; 21 | } 22 | 23 | return output; 24 | } 25 | 26 | function getAPIOption( 27 | page: string, 28 | index: number, 29 | ): string { 30 | const { name, dir } = path.parse(page); 31 | 32 | const extensionless = path.join(dir, name); 33 | 34 | const output = `[${JSON.stringify(getPOSIXPath(path.join('/', extensionless)))},${getAPILiteral(index)}]`; 35 | 36 | // If the file is named "index", make sure to support trailing slash 37 | if (name === DIRECTORY_ROOT) { 38 | return `[${JSON.stringify(getPOSIXPath(path.join('/', dir)))},API${getAPILiteral(index)}], ${output}`; 39 | } 40 | 41 | return output; 42 | } 43 | 44 | export function getPagesOptions( 45 | pages: string[], 46 | ): string { 47 | const pagesOptions = map(pages, getPageOption); 48 | 49 | return `[${filter(pagesOptions, Boolean).join(',\n')}]`; 50 | } 51 | 52 | export function getAPIOptions( 53 | endpoints: string[], 54 | ): string { 55 | const endpointOptions = map(endpoints, getAPIOption); 56 | 57 | return `[${endpointOptions.join(',\n')}]`; 58 | } 59 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/parameter/[id].tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { createResource, JSX } from 'solid-js'; 5 | import { isServer } from 'solid-js/web'; 6 | 7 | interface Params { 8 | id: string; 9 | } 10 | 11 | interface HelloProps { 12 | data: string; 13 | params: Params; 14 | } 15 | 16 | async function sleep(ms: number) { 17 | return new Promise((resolve) => { 18 | setTimeout(resolve, ms, true); 19 | }); 20 | } 21 | 22 | function Parametized(props: HelloProps): JSX.Element { 23 | const [data] = createResource( 24 | () => props.data.load, 25 | async (value) => { 26 | await sleep(1000); 27 | return value; 28 | }, 29 | { 30 | initialValue: props.data.load, 31 | }, 32 | ); 33 | return ( 34 |
35 |
36 | {`Welcome to Page ${props.params.id}!`} 37 | 38 | 39 | {'Welcome to '} 40 | {`Page ${props.params.id}`} 41 | ! 42 | 43 | 44 | {data()} 45 | 46 |
47 | Go to home 48 |
49 |
50 |
51 | ); 52 | } 53 | 54 | if (isServer) { 55 | Parametized.load = (_: Request, params: Params) => `Hello, ${params.id}`; 56 | } 57 | 58 | export default Parametized; 59 | -------------------------------------------------------------------------------- /packages/adapters/http/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { Readable } from 'stream'; 2 | import { IncomingMessage, ServerResponse } from 'http'; 3 | import { ServerFunction } from 'caldaria/types'; 4 | 5 | export function nodeStreamToBuffer(stream: Readable): Promise { 6 | return new Promise((resolve, reject) => { 7 | const buffer: Uint8Array[] = []; 8 | 9 | stream.on('data', (chunk) => buffer.push(chunk)); 10 | stream.on('end', () => resolve(Buffer.concat(buffer))); 11 | stream.on('error', (err) => reject(err)); 12 | }); 13 | } 14 | 15 | export async function convertHTTPRequestToWebRequest( 16 | request: IncomingMessage, 17 | ): Promise { 18 | if (!request.url || !request.headers.host) { 19 | throw new Error('Unexpected url'); 20 | } 21 | return new Request(`http://${request.headers.host}${request.url}`, { 22 | method: request.method, 23 | headers: request.headers as HeadersInit, 24 | body: (request.method !== 'GET' && request.method !== 'HEAD') 25 | ? await nodeStreamToBuffer(request) 26 | : null, 27 | }); 28 | } 29 | 30 | export async function handleHTTP( 31 | func: ServerFunction, 32 | request: IncomingMessage, 33 | response: ServerResponse, 34 | ): Promise { 35 | const transformedRequest = await convertHTTPRequestToWebRequest(request); 36 | const newResponse = await func(transformedRequest); 37 | 38 | // Set status code 39 | response.statusCode = newResponse.status; 40 | response.statusMessage = newResponse.statusText; 41 | // Set headers 42 | newResponse.headers.forEach((value, key) => { 43 | response.setHeader(key, value); 44 | }); 45 | // Set content 46 | if ( 47 | newResponse.body instanceof Buffer 48 | || typeof newResponse.body === 'string' 49 | || newResponse.body == null 50 | ) { 51 | response.end(newResponse.body); 52 | } else { 53 | (newResponse.body as unknown as Readable).pipe(response); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/adapters/vercel/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { Readable } from 'stream'; 2 | import { IncomingMessage, ServerResponse } from 'http'; 3 | import { ServerFunction } from 'caldaria/types'; 4 | 5 | export function nodeStreamToBuffer(stream: Readable): Promise { 6 | return new Promise((resolve, reject) => { 7 | const buffer: Uint8Array[] = []; 8 | 9 | stream.on('data', (chunk) => buffer.push(chunk)); 10 | stream.on('end', () => resolve(Buffer.concat(buffer))); 11 | stream.on('error', (err) => reject(err)); 12 | }); 13 | } 14 | 15 | export async function convertHTTPRequestToWebRequest( 16 | request: IncomingMessage, 17 | ): Promise { 18 | if (!request.url || !request.headers.host) { 19 | throw new Error('Unexpected url'); 20 | } 21 | return new Request(`http://${request.headers.host}${request.url}`, { 22 | method: request.method, 23 | headers: request.headers as HeadersInit, 24 | body: (request.method !== 'GET' && request.method !== 'HEAD') 25 | ? await nodeStreamToBuffer(request) 26 | : null, 27 | }); 28 | } 29 | 30 | export async function handleHTTP( 31 | func: ServerFunction, 32 | request: IncomingMessage, 33 | response: ServerResponse, 34 | ): Promise { 35 | const transformedRequest = await convertHTTPRequestToWebRequest(request); 36 | const newResponse = await func(transformedRequest); 37 | 38 | // Set status code 39 | response.statusCode = newResponse.status; 40 | response.statusMessage = newResponse.statusText; 41 | // Set headers 42 | newResponse.headers.forEach((value, key) => { 43 | response.setHeader(key, value); 44 | }); 45 | // Set content 46 | if ( 47 | newResponse.body instanceof Buffer 48 | || typeof newResponse.body === 'string' 49 | || newResponse.body == null 50 | ) { 51 | response.end(newResponse.body); 52 | } else { 53 | (newResponse.body as unknown as Readable).pipe(response); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/adapters/vanilla/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { Readable } from 'stream'; 2 | import { IncomingMessage, ServerResponse } from 'http'; 3 | import { ServerFunction } from 'caldaria/types'; 4 | 5 | export function nodeStreamToBuffer(stream: Readable): Promise { 6 | return new Promise((resolve, reject) => { 7 | const buffer: Uint8Array[] = []; 8 | 9 | stream.on('data', (chunk) => buffer.push(chunk)); 10 | stream.on('end', () => resolve(Buffer.concat(buffer))); 11 | stream.on('error', (err) => reject(err)); 12 | }); 13 | } 14 | 15 | export async function convertHTTPRequestToWebRequest( 16 | request: IncomingMessage, 17 | ): Promise { 18 | if (!request.url || !request.headers.host) { 19 | throw new Error('Unexpected url'); 20 | } 21 | return new Request(`http://${request.headers.host}${request.url}`, { 22 | method: request.method, 23 | headers: request.headers as HeadersInit, 24 | body: (request.method !== 'GET' && request.method !== 'HEAD') 25 | ? await nodeStreamToBuffer(request) 26 | : null, 27 | }); 28 | } 29 | 30 | export async function handleHTTP( 31 | func: ServerFunction, 32 | request: IncomingMessage, 33 | response: ServerResponse, 34 | ): Promise { 35 | const transformedRequest = await convertHTTPRequestToWebRequest(request); 36 | const newResponse = await func(transformedRequest); 37 | 38 | // Set status code 39 | response.statusCode = newResponse.status; 40 | response.statusMessage = newResponse.statusText; 41 | // Set headers 42 | newResponse.headers.forEach((value, key) => { 43 | response.setHeader(key, value); 44 | }); 45 | // Set content 46 | if ( 47 | newResponse.body instanceof Buffer 48 | || typeof newResponse.body === 'string' 49 | || newResponse.body == null 50 | ) { 51 | response.end(newResponse.body); 52 | } else { 53 | (newResponse.body as unknown as Readable).pipe(response); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/core/build/src/fs.ts: -------------------------------------------------------------------------------- 1 | import { Abortable } from 'events'; 2 | import fs from 'fs/promises'; 3 | import path from 'path'; 4 | import { Mode, ObjectEncodingOptions, OpenMode } from 'fs'; 5 | import { Stream } from 'stream'; 6 | 7 | export async function removeFile(filePath: string): Promise { 8 | return fs.rm(filePath, { recursive: true, force: true }); 9 | } 10 | 11 | export async function fileExists(p: string): Promise { 12 | try { 13 | const stat = await fs.stat(p); 14 | 15 | return stat.isFile(); 16 | } catch (error) { 17 | return false; 18 | } 19 | } 20 | 21 | export function checkPath(pth: string) { 22 | if (process.platform === 'win32') { 23 | const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); 24 | 25 | if (pathHasInvalidWinCharacters) { 26 | const error = new Error(`Path contains invalid characters: ${pth}`); 27 | throw error; 28 | } 29 | } 30 | } 31 | 32 | export async function makeDir(dir: string, mode = 0o777) { 33 | checkPath(dir); 34 | return fs.mkdir(dir, { 35 | mode, 36 | recursive: true, 37 | }); 38 | } 39 | 40 | export async function pathExists(filePath: string) { 41 | try { 42 | await fs.access(filePath); 43 | return true; 44 | } catch { 45 | return false; 46 | } 47 | } 48 | 49 | export async function outputFile( 50 | file: string, 51 | data: string 52 | | NodeJS.ArrayBufferView 53 | | Iterable 55 | | AsyncIterable 56 | | Stream, 57 | encoding?: 58 | | (ObjectEncodingOptions & { 59 | mode?: Mode | undefined; 60 | flag?: OpenMode | undefined; 61 | } & Abortable) 62 | | BufferEncoding 63 | | null, 64 | ) { 65 | const dir = path.dirname(file); 66 | if (!await pathExists(dir)) { 67 | await makeDir(dir); 68 | } 69 | return fs.writeFile(file, data, encoding); 70 | } 71 | -------------------------------------------------------------------------------- /examples/hello-world/src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | /* @jsxImportSource solid-js */ 2 | import { Meta, Title } from 'caldaria/meta'; 3 | import { RouterLink } from 'caldaria/router'; 4 | import { JSX } from 'solid-js'; 5 | 6 | export default function Index(): JSX.Element { 7 | return ( 8 |
9 |
10 | Welcome to Caldaria Demo! 11 | 12 | 13 | {'Welcome to '} 14 | Caldaria 15 | ! 16 | 17 |
18 | Go to page A 19 | Go to page B 20 | Go to page C 21 | Go to page D 22 | Go to page E, F, G, H 23 | Go to Form Example 24 | Go to SFC Example 25 | Go to Markdown Example 26 |
27 |
28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /packages/core/meta/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-meta", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "files": [ 6 | "dist", 7 | "src" 8 | ], 9 | "engines": { 10 | "node": ">=10" 11 | }, 12 | "license": "MIT", 13 | "keywords": [ 14 | "pridepack" 15 | ], 16 | "devDependencies": { 17 | "@types/node": "^18.6.3", 18 | "eslint": "^8.21.0", 19 | "eslint-config-lxsmnsyc": "^0.4.8", 20 | "pridepack": "2.3.0", 21 | "solid-js": "^1.5.5", 22 | "tslib": "^2.4.0", 23 | "typescript": "^4.7.4", 24 | "vitest": "^0.21.0" 25 | }, 26 | "peerDependencies": { 27 | "solid-js": "^1.5" 28 | }, 29 | "scripts": { 30 | "prepublishOnly": "pridepack clean && pridepack build", 31 | "build": "pridepack build", 32 | "type-check": "pridepack check", 33 | "lint": "pridepack lint", 34 | "clean": "pridepack clean", 35 | "watch": "pridepack watch", 36 | "start": "pridepack start", 37 | "dev": "pridepack dev", 38 | "test": "vitest" 39 | }, 40 | "description": "", 41 | "repository": { 42 | "url": "https://github.com/lxsmnsyc/caldaria.git", 43 | "type": "git" 44 | }, 45 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/core/meta", 46 | "bugs": { 47 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 48 | }, 49 | "publishConfig": { 50 | "access": "public" 51 | }, 52 | "author": "Alexis Munsayac", 53 | "private": false, 54 | "exports": { 55 | ".": { 56 | "development": { 57 | "require": "./dist/cjs/development/index.cjs", 58 | "import": "./dist/esm/development/index.mjs" 59 | }, 60 | "require": "./dist/cjs/production/index.cjs", 61 | "import": "./dist/esm/production/index.mjs", 62 | "types": "./dist/types/index.d.ts" 63 | } 64 | }, 65 | "typesVersions": { 66 | "*": {} 67 | }, 68 | "types": "./dist/types/index.d.ts", 69 | "main": "./dist/cjs/production/index.cjs", 70 | "module": "./dist/esm/production/index.mjs" 71 | } 72 | -------------------------------------------------------------------------------- /packages/core/shared/src/colors.ts: -------------------------------------------------------------------------------- 1 | // Intentionally not using template literal for performance. 2 | const format = (startCode: number, endCode: number) => ( 3 | (string: string) => `\u001B[${startCode}m${string}\u001B[${endCode}m` 4 | ); 5 | 6 | export const reset = /* @__PURE__ */format(0, 0); 7 | export const bold = /* @__PURE__ */format(1, 22); 8 | export const dim = /* @__PURE__ */format(2, 22); 9 | export const italic = /* @__PURE__ */format(3, 23); 10 | export const underline = /* @__PURE__ */format(4, 24); 11 | export const overline = /* @__PURE__ */format(53, 55); 12 | export const inverse = /* @__PURE__ */format(7, 27); 13 | export const hidden = /* @__PURE__ */format(8, 28); 14 | export const strikethrough = /* @__PURE__ */format(9, 29); 15 | 16 | export const black = /* @__PURE__ */format(30, 39); 17 | export const red = /* @__PURE__ */format(31, 39); 18 | export const green = /* @__PURE__ */format(32, 39); 19 | export const yellow = /* @__PURE__ */format(33, 39); 20 | export const blue = /* @__PURE__ */format(34, 39); 21 | export const magenta = /* @__PURE__ */format(35, 39); 22 | export const cyan = /* @__PURE__ */format(36, 39); 23 | export const white = /* @__PURE__ */format(37, 39); 24 | export const gray = /* @__PURE__ */format(90, 39); 25 | 26 | export const bgBlack = /* @__PURE__ */format(40, 49); 27 | export const bgRed = /* @__PURE__ */format(41, 49); 28 | export const bgGreen = /* @__PURE__ */format(42, 49); 29 | export const bgYellow = /* @__PURE__ */format(43, 49); 30 | export const bgBlue = /* @__PURE__ */format(44, 49); 31 | export const bgMagenta = /* @__PURE__ */format(45, 49); 32 | export const bgCyan = /* @__PURE__ */format(46, 49); 33 | export const bgWhite = /* @__PURE__ */format(47, 49); 34 | export const bgGray = /* @__PURE__ */format(100, 49); 35 | 36 | export function log(prefix: string, message: string) { 37 | if (typeof window === 'undefined') { 38 | console.log(`${magenta(`[caldaria:${prefix}]`)} ${message}`); 39 | } else { 40 | console.log(`%c[caldaria:${prefix}] %c${message}`, 'font-weight: bold; color: #a855f7', 'color: inherit'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/core/build/src/plugins/solid.ts: -------------------------------------------------------------------------------- 1 | import * as babel from '@babel/core'; 2 | import { Plugin } from 'esbuild'; 3 | import path from 'path'; 4 | import fs from 'fs/promises'; 5 | 6 | import solid from 'babel-preset-solid'; 7 | import ts from '@babel/preset-typescript'; 8 | import solidSFC from 'babel-plugin-solid-sfc'; 9 | import { 10 | createFileCache, 11 | FileCache, 12 | isFileDirty, 13 | readFileCache, 14 | writeFileCache, 15 | } from './utils/file-cache'; 16 | 17 | interface SolidBabelOption { 18 | plugins: babel.PluginItem[]; 19 | presets: babel.PluginItem[]; 20 | } 21 | 22 | interface SolidOptions { 23 | dev: boolean; 24 | generate: 'dom' | 'ssr'; 25 | babel: SolidBabelOption; 26 | } 27 | 28 | async function transform( 29 | file: string, 30 | options: SolidOptions, 31 | cache: FileCache, 32 | ) { 33 | if (isFileDirty(file)) { 34 | const source = await fs.readFile(file, 'utf-8'); 35 | 36 | const result = await babel.transformAsync(source, { 37 | presets: [ 38 | [solid, { generate: options.generate, hydratable: true }], 39 | [ts], 40 | ...options.babel.presets, 41 | ], 42 | plugins: [ 43 | [solidSFC, { dev: options.dev }], 44 | ...options.babel.plugins, 45 | ], 46 | filename: path.basename(file), 47 | sourceMaps: 'inline', 48 | }); 49 | 50 | if (result) { 51 | const contents = result.code ?? ''; 52 | await writeFileCache(cache, file, contents); 53 | return contents; 54 | } 55 | throw new Error('[caldaria:solid] Babel Transform returned null.'); 56 | } 57 | return readFileCache(cache, file); 58 | } 59 | 60 | export default function solidPlugin(options: SolidOptions): Plugin { 61 | const cache = createFileCache(`solid-${options.generate}`); 62 | return { 63 | name: 'caldaria:solid', 64 | 65 | setup(build) { 66 | build.onLoad({ 67 | filter: /\.(t|j)sx$/, 68 | }, async (args) => ({ 69 | contents: await transform(args.path, options, cache), 70 | loader: 'js', 71 | })); 72 | }, 73 | }; 74 | } 75 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-hybrid-router", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "files": [ 6 | "dist", 7 | "src" 8 | ], 9 | "engines": { 10 | "node": ">=10" 11 | }, 12 | "license": "MIT", 13 | "keywords": [ 14 | "pridepack" 15 | ], 16 | "dependencies": { 17 | "caldaria-scheduler": "0.0.24", 18 | "caldaria-shared": "0.0.24" 19 | }, 20 | "peerDependencies": {}, 21 | "devDependencies": { 22 | "@types/node": "^18.6.3", 23 | "eslint": "^8.18.0", 24 | "eslint-config-lxsmnsyc": "^0.4.8", 25 | "pridepack": "2.3.0", 26 | "tslib": "^2.4.0", 27 | "typescript": "^4.7.4", 28 | "vitest": "^0.21.0" 29 | }, 30 | "scripts": { 31 | "prepublishOnly": "pridepack clean && pridepack build", 32 | "build": "pridepack build", 33 | "type-check": "pridepack check", 34 | "lint": "pridepack lint", 35 | "clean": "pridepack clean", 36 | "watch": "pridepack watch", 37 | "start": "pridepack start", 38 | "dev": "pridepack dev", 39 | "test": "vitest" 40 | }, 41 | "description": "", 42 | "repository": { 43 | "url": "https://github.com/lxsmnsyc/caldaria.git", 44 | "type": "git" 45 | }, 46 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/core/hybrid-router", 47 | "bugs": { 48 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 49 | }, 50 | "publishConfig": { 51 | "access": "public" 52 | }, 53 | "author": "Alexis Munsayac", 54 | "private": false, 55 | "types": "./dist/types/src/index.d.ts", 56 | "exports": { 57 | ".": { 58 | "development": { 59 | "require": "./dist/cjs/development/index.cjs", 60 | "import": "./dist/esm/development/index.mjs" 61 | }, 62 | "require": "./dist/cjs/production/index.cjs", 63 | "import": "./dist/esm/production/index.mjs", 64 | "types": "./dist/types/src/index.d.ts" 65 | } 66 | }, 67 | "typesVersions": { 68 | "*": {} 69 | }, 70 | "main": "./dist/cjs/production/index.cjs", 71 | "module": "./dist/esm/production/index.mjs" 72 | } 73 | -------------------------------------------------------------------------------- /packages/core/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-router", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "files": [ 6 | "dist", 7 | "src" 8 | ], 9 | "engines": { 10 | "node": ">=10" 11 | }, 12 | "license": "MIT", 13 | "keywords": [ 14 | "pridepack" 15 | ], 16 | "devDependencies": { 17 | "@types/node": "^18.6.3", 18 | "eslint": "^8.21.0", 19 | "eslint-config-lxsmnsyc": "^0.4.8", 20 | "pridepack": "2.3.0", 21 | "solid-js": "^1.5.5", 22 | "tslib": "^2.4.0", 23 | "typescript": "^4.7.4", 24 | "vitest": "^0.21.0" 25 | }, 26 | "peerDependencies": { 27 | "solid-js": "^1.5" 28 | }, 29 | "dependencies": { 30 | "caldaria-shared": "0.0.24", 31 | "solid-use": "^0.5.0" 32 | }, 33 | "scripts": { 34 | "prepublishOnly": "pridepack clean && pridepack build", 35 | "build": "pridepack build", 36 | "type-check": "pridepack check", 37 | "lint": "pridepack lint", 38 | "clean": "pridepack clean", 39 | "watch": "pridepack watch", 40 | "start": "pridepack start", 41 | "dev": "pridepack dev", 42 | "test": "vitest" 43 | }, 44 | "description": "", 45 | "repository": { 46 | "url": "https://github.com/lxsmnsyc/caldaria.git", 47 | "type": "git" 48 | }, 49 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/core/router", 50 | "bugs": { 51 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 52 | }, 53 | "publishConfig": { 54 | "access": "public" 55 | }, 56 | "author": "Alexis Munsayac", 57 | "private": false, 58 | "exports": { 59 | ".": { 60 | "development": { 61 | "require": "./dist/cjs/development/index.jsx", 62 | "import": "./dist/esm/development/index.jsx" 63 | }, 64 | "require": "./dist/cjs/production/index.jsx", 65 | "import": "./dist/esm/production/index.jsx", 66 | "types": "./dist/types/index.d.ts" 67 | } 68 | }, 69 | "typesVersions": { 70 | "*": {} 71 | }, 72 | "types": "./dist/types/index.d.ts", 73 | "main": "./dist/cjs/production/index.jsx", 74 | "module": "./dist/esm/production/index.jsx" 75 | } 76 | -------------------------------------------------------------------------------- /packages/adapters/worker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-adapter-worker", 3 | "type": "module", 4 | "version": "0.0.24", 5 | "types": "dist/types/index.d.ts", 6 | "main": "dist/cjs/production/index.js", 7 | "module": "dist/esm/production/index.js", 8 | "exports": { 9 | ".": { 10 | "development": { 11 | "require": "./dist/cjs/development/index.cjs", 12 | "import": "./dist/esm/development/index.mjs" 13 | }, 14 | "require": "./dist/cjs/production/index.cjs", 15 | "import": "./dist/esm/production/index.mjs", 16 | "types": "./dist/types/index.d.ts" 17 | } 18 | }, 19 | "files": [ 20 | "dist", 21 | "src" 22 | ], 23 | "engines": { 24 | "node": ">=10" 25 | }, 26 | "license": "MIT", 27 | "keywords": [ 28 | "pridepack" 29 | ], 30 | "devDependencies": { 31 | "@types/node": "^17.0.35", 32 | "eslint": "^8.21.0", 33 | "eslint-config-lxsmnsyc": "^0.4.8", 34 | "pridepack": "^2.1.2", 35 | "caldaria": "0.0.24", 36 | "tslib": "^2.4.0", 37 | "typescript": "^4.7.4" 38 | }, 39 | "description": "Worker Adapter for Caldaria", 40 | "repository": { 41 | "url": "https://github.com/lxsmnsyc/caldaria.git", 42 | "type": "git" 43 | }, 44 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/adapters/worker", 45 | "bugs": { 46 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 47 | }, 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "author": "Alexis Munsayac", 52 | "private": false, 53 | "scripts": { 54 | "prepublishOnly": "pridepack clean && pridepack build", 55 | "build": "pridepack build", 56 | "type-check": "pridepack check", 57 | "lint": "pridepack lint", 58 | "test": "pridepack test --passWithNoTests", 59 | "clean": "pridepack clean", 60 | "watch": "pridepack watch", 61 | "start": "pridepack start", 62 | "dev": "pridepack dev" 63 | }, 64 | "peerDependencies": { 65 | "caldaria": "^0.0" 66 | }, 67 | "typesVersions": { 68 | "*": { 69 | "*": [ 70 | "./dist/types/index.d.ts" 71 | ] 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /packages/core/build/src/inject-page.ts: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { 3 | map, 4 | SUPPORTED_PAGE_EXT, 5 | } from 'caldaria-shared'; 6 | import { pathExists } from './fs'; 7 | import getPOSIXPath from './get-posix-path'; 8 | 9 | async function getCustomRootPath( 10 | rootPath: string, 11 | ): Promise { 12 | const result = await Promise.all( 13 | map( 14 | [...SUPPORTED_PAGE_EXT], 15 | async (ext) => { 16 | const app = path.join( 17 | `${rootPath}${ext}`, 18 | ); 19 | 20 | return { 21 | path: app, 22 | stat: await pathExists(app), 23 | }; 24 | }, 25 | ), 26 | ); 27 | for (let i = 0; i < result.length; i += 1) { 28 | if (result[i].stat) { 29 | return getPOSIXPath(result[i].path); 30 | } 31 | } 32 | 33 | return undefined; 34 | } 35 | 36 | export async function getCustomRoot( 37 | artifactDirectory: string, 38 | lines: string[], 39 | rootPath: string, 40 | ): Promise { 41 | const result = await getCustomRootPath(rootPath); 42 | 43 | if (result) { 44 | const { name, dir, ext } = path.parse(result); 45 | const extensionless = path.join(dir, `${name}${ext}`); 46 | const importPath = getPOSIXPath(path.relative(artifactDirectory, extensionless)); 47 | 48 | lines.push( 49 | `import CustomRoot from '${importPath}';`, 50 | ); 51 | 52 | return 'CustomRoot'; 53 | } 54 | return undefined; 55 | } 56 | 57 | export async function getCustomPage( 58 | pagesDirectory: string, 59 | page: string, 60 | ): Promise { 61 | const result = await Promise.all( 62 | map( 63 | [...SUPPORTED_PAGE_EXT], 64 | async (ext) => { 65 | const app = path.join( 66 | pagesDirectory, 67 | `${page}${ext}`, 68 | ); 69 | 70 | return { 71 | path: app, 72 | stat: await pathExists(app), 73 | }; 74 | }, 75 | ), 76 | ); 77 | for (let i = 0; i < result.length; i += 1) { 78 | if (result[i].stat) { 79 | return getPOSIXPath(result[i].path); 80 | } 81 | } 82 | 83 | return undefined; 84 | } 85 | -------------------------------------------------------------------------------- /packages/adapters/http2/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { Readable } from 'stream'; 2 | import { Http2ServerRequest, Http2ServerResponse } from 'http2'; 3 | import { ServerFunction } from 'caldaria/types'; 4 | 5 | export function nodeStreamToBuffer(stream: Readable): Promise { 6 | return new Promise((resolve, reject) => { 7 | const buffer: Uint8Array[] = []; 8 | 9 | stream.on('data', (chunk) => buffer.push(chunk)); 10 | stream.on('end', () => resolve(Buffer.concat(buffer))); 11 | stream.on('error', (err) => reject(err)); 12 | }); 13 | } 14 | 15 | export async function convertHTTP2RequestToWebRequest( 16 | request: Http2ServerRequest, 17 | ): Promise { 18 | const { 19 | ':scheme': scheme, 20 | ':authority': authority, 21 | ':method': method, 22 | ':path': path, 23 | ...headers 24 | } = request.headers; 25 | if (!path) { 26 | throw new Error('Unexpected url'); 27 | } 28 | return new Request(path, { 29 | method, 30 | headers: { 31 | ...(headers as HeadersInit), 32 | ...(authority ? { host: authority } : {}), 33 | ...(scheme ? { scheme } : {}), 34 | }, 35 | body: (request.method !== 'GET' && request.method !== 'HEAD') 36 | ? await nodeStreamToBuffer(request) 37 | : null, 38 | }); 39 | } 40 | 41 | export async function handleHTTP2( 42 | func: ServerFunction, 43 | request: Http2ServerRequest, 44 | response: Http2ServerResponse, 45 | ): Promise { 46 | const transformedRequest = await convertHTTP2RequestToWebRequest(request); 47 | const newResponse = await func(transformedRequest); 48 | 49 | // Set status code 50 | response.statusCode = newResponse.status; 51 | // Set headers 52 | newResponse.headers.forEach((value, key) => { 53 | response.setHeader(key, value); 54 | }); 55 | // Set content 56 | if (newResponse.body instanceof Buffer) { 57 | response.end(new Uint8Array(newResponse.body.buffer)); 58 | } else if (typeof newResponse.body === 'string') { 59 | response.end(newResponse.body); 60 | } else if (newResponse.body == null) { 61 | response.end(); 62 | } else { 63 | (newResponse.body as unknown as Readable).pipe(response); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /packages/core/router/src/components/Router.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | JSX, 3 | createContext, 4 | useContext, 5 | createMemo, 6 | mergeProps, 7 | Show, 8 | } from 'solid-js'; 9 | import { 10 | PageTree, 11 | RouterParams, 12 | } from 'caldaria-shared'; 13 | import { 14 | matchRoute, 15 | } from '../core/router'; 16 | import useLocation, { 17 | UseLocation, 18 | UseLocationOptions, 19 | } from '../core/use-location'; 20 | 21 | export interface RouterInstance

extends UseLocation { 22 | params: P; 23 | } 24 | 25 | const LocationContext = /* @__PURE__ */ createContext(); 26 | const ParamsContext = /* @__PURE__ */ createContext(); 27 | 28 | export interface RouterProps { 29 | routes: PageTree; 30 | fallback?: JSX.Element; 31 | location?: UseLocationOptions; 32 | } 33 | 34 | export default function Router( 35 | props: RouterProps, 36 | ): JSX.Element { 37 | const location = useLocation(() => props.routes, props.location); 38 | 39 | const matchedRoute = createMemo(() => ( 40 | matchRoute(props.routes, location.pathname) 41 | )); 42 | 43 | return ( 44 | 45 | 46 | {(route) => ( 47 | 48 | 49 | {(Comp) => } 50 | 51 | 52 | )} 53 | 54 | 55 | ); 56 | } 57 | 58 | export function useRouterUnsafe

(): RouterInstance

| undefined { 59 | const location = useContext(LocationContext); 60 | const params = useContext(ParamsContext); 61 | if (location) { 62 | return mergeProps(location, { 63 | params: params as P, 64 | }); 65 | } 66 | return undefined; 67 | } 68 | 69 | export function useRouter

(): RouterInstance

{ 70 | const router = useRouterUnsafe

(); 71 | if (router) { 72 | return router; 73 | } 74 | throw new Error('useRouter must be used in a component within '); 75 | } 76 | -------------------------------------------------------------------------------- /packages/adapters/http/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-adapter-http", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "types": "dist/types/index.d.ts", 6 | "main": "dist/cjs/production/index.js", 7 | "module": "dist/esm/production/index.js", 8 | "exports": { 9 | ".": { 10 | "development": { 11 | "require": "./dist/cjs/development/index.cjs", 12 | "import": "./dist/esm/development/index.mjs" 13 | }, 14 | "require": "./dist/cjs/production/index.cjs", 15 | "import": "./dist/esm/production/index.mjs", 16 | "types": "./dist/types/index.d.ts" 17 | } 18 | }, 19 | "files": [ 20 | "dist", 21 | "src" 22 | ], 23 | "engines": { 24 | "node": ">=10" 25 | }, 26 | "license": "MIT", 27 | "keywords": [ 28 | "pridepack" 29 | ], 30 | "devDependencies": { 31 | "@types/node": "^17.0.35", 32 | "eslint": "^8.21.0", 33 | "eslint-config-lxsmnsyc": "^0.4.8", 34 | "pridepack": "^2.1.2", 35 | "caldaria": "0.0.24", 36 | "tslib": "^2.4.0", 37 | "typescript": "^4.7.4" 38 | }, 39 | "description": "HTTP Adapter for Caldaria", 40 | "repository": { 41 | "url": "https://github.com/lxsmnsyc/caldaria.git", 42 | "type": "git" 43 | }, 44 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/adapters/http", 45 | "bugs": { 46 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 47 | }, 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "author": "Alexis Munsayac", 52 | "private": false, 53 | "scripts": { 54 | "prepublishOnly": "pridepack clean && pridepack build", 55 | "build": "pridepack build", 56 | "type-check": "pridepack check", 57 | "lint": "pridepack lint", 58 | "test": "pridepack test --passWithNoTests", 59 | "clean": "pridepack clean", 60 | "watch": "pridepack watch", 61 | "start": "pridepack start", 62 | "dev": "pridepack dev" 63 | }, 64 | "peerDependencies": { 65 | "caldaria": "^0.0" 66 | }, 67 | "dependencies": { 68 | "node-fetch": "^3.1.0" 69 | }, 70 | "typesVersions": { 71 | "*": { 72 | "*": [ 73 | "./dist/types/index.d.ts" 74 | ] 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /packages/adapters/http2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-adapter-http2", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "types": "dist/types/index.d.ts", 6 | "main": "dist/cjs/production/index.js", 7 | "module": "dist/esm/production/index.js", 8 | "exports": { 9 | ".": { 10 | "development": { 11 | "require": "./dist/cjs/development/index.cjs", 12 | "import": "./dist/esm/development/index.mjs" 13 | }, 14 | "require": "./dist/cjs/production/index.cjs", 15 | "import": "./dist/esm/production/index.mjs", 16 | "types": "./dist/types/index.d.ts" 17 | } 18 | }, 19 | "files": [ 20 | "dist", 21 | "src" 22 | ], 23 | "engines": { 24 | "node": ">=10" 25 | }, 26 | "license": "MIT", 27 | "keywords": [ 28 | "pridepack" 29 | ], 30 | "devDependencies": { 31 | "@types/node": "^17.0.35", 32 | "eslint": "^8.21.0", 33 | "eslint-config-lxsmnsyc": "^0.4.8", 34 | "pridepack": "^2.1.2", 35 | "caldaria": "0.0.24", 36 | "tslib": "^2.4.0", 37 | "typescript": "^4.7.4" 38 | }, 39 | "description": "HTTP2 Adapter for Caldaria", 40 | "repository": { 41 | "url": "https://github.com/lxsmnsyc/caldaria.git", 42 | "type": "git" 43 | }, 44 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/adapters/http2", 45 | "bugs": { 46 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 47 | }, 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "author": "Alexis Munsayac", 52 | "private": false, 53 | "scripts": { 54 | "prepublishOnly": "pridepack clean && pridepack build", 55 | "build": "pridepack build", 56 | "type-check": "pridepack check", 57 | "lint": "pridepack lint", 58 | "test": "pridepack test --passWithNoTests", 59 | "clean": "pridepack clean", 60 | "watch": "pridepack watch", 61 | "start": "pridepack start", 62 | "dev": "pridepack dev" 63 | }, 64 | "peerDependencies": { 65 | "caldaria": "^0.0" 66 | }, 67 | "dependencies": { 68 | "node-fetch": "^3.1.0" 69 | }, 70 | "typesVersions": { 71 | "*": { 72 | "*": [ 73 | "./dist/types/index.d.ts" 74 | ] 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /packages/adapters/vanilla/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-adapter-vanilla", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "types": "dist/types/index.d.ts", 6 | "main": "dist/cjs/production/index.js", 7 | "module": "dist/esm/production/index.js", 8 | "exports": { 9 | ".": { 10 | "development": { 11 | "require": "./dist/cjs/development/index.cjs", 12 | "import": "./dist/esm/development/index.mjs" 13 | }, 14 | "require": "./dist/cjs/production/index.cjs", 15 | "import": "./dist/esm/production/index.mjs", 16 | "types": "./dist/types/index.d.ts" 17 | } 18 | }, 19 | "files": [ 20 | "dist", 21 | "src" 22 | ], 23 | "engines": { 24 | "node": ">=10" 25 | }, 26 | "license": "MIT", 27 | "keywords": [ 28 | "pridepack" 29 | ], 30 | "devDependencies": { 31 | "@types/node": "^17.0.35", 32 | "eslint": "^8.21.0", 33 | "eslint-config-lxsmnsyc": "^0.4.8", 34 | "pridepack": "^2.1.2", 35 | "caldaria": "0.0.24", 36 | "tslib": "^2.4.0", 37 | "typescript": "^4.7.4" 38 | }, 39 | "description": "Vanilla HTTP Adapter for Caldaria", 40 | "repository": { 41 | "url": "https://github.com/lxsmnsyc/caldaria.git", 42 | "type": "git" 43 | }, 44 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/adapters/vanilla", 45 | "bugs": { 46 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 47 | }, 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "author": "Alexis Munsayac", 52 | "private": false, 53 | "scripts": { 54 | "prepublishOnly": "pridepack clean && pridepack build", 55 | "build": "pridepack build", 56 | "type-check": "pridepack check", 57 | "lint": "pridepack lint", 58 | "test": "pridepack test --passWithNoTests", 59 | "clean": "pridepack clean", 60 | "watch": "pridepack watch", 61 | "start": "pridepack start", 62 | "dev": "pridepack dev" 63 | }, 64 | "peerDependencies": { 65 | "caldaria": "^0.0" 66 | }, 67 | "dependencies": { 68 | "node-fetch": "^3.1.0" 69 | }, 70 | "typesVersions": { 71 | "*": { 72 | "*": [ 73 | "./dist/types/index.d.ts" 74 | ] 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /packages/adapters/vercel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-adapter-vercel", 3 | "type": "module", 4 | "version": "0.0.24", 5 | "types": "dist/types/index.d.ts", 6 | "main": "dist/cjs/production/index.js", 7 | "module": "dist/esm/production/index.js", 8 | "exports": { 9 | ".": { 10 | "development": { 11 | "require": "./dist/cjs/development/index.cjs", 12 | "import": "./dist/esm/development/index.mjs" 13 | }, 14 | "require": "./dist/cjs/production/index.cjs", 15 | "import": "./dist/esm/production/index.mjs", 16 | "types": "./dist/types/index.d.ts" 17 | } 18 | }, 19 | "files": [ 20 | "dist", 21 | "src" 22 | ], 23 | "engines": { 24 | "node": ">=10" 25 | }, 26 | "license": "MIT", 27 | "keywords": [ 28 | "pridepack" 29 | ], 30 | "devDependencies": { 31 | "@types/node": "^17.0.35", 32 | "eslint": "^8.21.0", 33 | "eslint-config-lxsmnsyc": "^0.4.8", 34 | "pridepack": "^2.1.2", 35 | "caldaria": "0.0.24", 36 | "tslib": "^2.4.0", 37 | "typescript": "^4.7.4" 38 | }, 39 | "description": "Vercel Adapter for Caldaria", 40 | "repository": { 41 | "url": "https://github.com/lxsmnsyc/caldaria.git", 42 | "type": "git" 43 | }, 44 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/adapters/vercel", 45 | "bugs": { 46 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 47 | }, 48 | "publishConfig": { 49 | "access": "public" 50 | }, 51 | "author": "Alexis Munsayac", 52 | "private": false, 53 | "scripts": { 54 | "prepublishOnly": "pridepack clean && pridepack build", 55 | "build": "pridepack build", 56 | "type-check": "pridepack check", 57 | "lint": "pridepack lint", 58 | "test": "pridepack test --passWithNoTests", 59 | "clean": "pridepack clean", 60 | "watch": "pridepack watch", 61 | "start": "pridepack start", 62 | "dev": "pridepack dev" 63 | }, 64 | "peerDependencies": { 65 | "caldaria": "^0.0" 66 | }, 67 | "dependencies": { 68 | "@vercel/node": "^1.12.1", 69 | "node-fetch": "^3.1.0" 70 | }, 71 | "typesVersions": { 72 | "*": { 73 | "*": [ 74 | "./dist/types/index.d.ts" 75 | ] 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /packages/core/hybrid-router/src/prefetch.ts: -------------------------------------------------------------------------------- 1 | // https://github.com/GoogleChromeLabs/quicklink/blob/master/src/prefetch.mjs 2 | function hasPrefetch(): boolean { 3 | const link = document.createElement('link'); 4 | return link.relList && link.relList.supports && link.relList.supports('prefetch'); 5 | } 6 | 7 | function viaDOM(url: string): Promise { 8 | return new Promise((res, rej) => { 9 | if (!document.querySelector(`link[rel="prefetch"][href="${url}"][as="fetch"]`)) { 10 | const link = document.createElement('link'); 11 | link.rel = 'prefetch'; 12 | link.as = 'document'; 13 | link.onload = () => res(); 14 | link.onerror = rej; 15 | link.href = url; 16 | 17 | document.head.appendChild(link); 18 | } else { 19 | res(); 20 | } 21 | }); 22 | } 23 | 24 | function viaXHR(url: string): Promise { 25 | return new Promise((res, rej) => { 26 | const req = new XMLHttpRequest(); 27 | 28 | req.withCredentials = true; 29 | req.open('GET', url, true); 30 | 31 | req.onload = () => { 32 | if (req.status === 200) { 33 | res(); 34 | } else { 35 | rej(); 36 | } 37 | }; 38 | 39 | req.send(); 40 | }); 41 | } 42 | 43 | async function priority(url: string): Promise { 44 | // TODO: Investigate using preload for high-priority 45 | // fetches. May have to sniff file-extension to provide 46 | // valid 'as' values. In the future, we may be able to 47 | // use Priority Hints here. 48 | // 49 | // As of 2018, fetch() is high-priority in Chrome 50 | // and medium-priority in Safari. 51 | if ('fetch' in window) { 52 | await fetch(url, { credentials: 'include' }); 53 | } else { 54 | await viaXHR(url); 55 | } 56 | } 57 | 58 | const links = new Set(); 59 | 60 | export default async function prefetch(url: string, isPriority = false): Promise { 61 | if (!links.has(url)) { 62 | links.add(url); 63 | if (isPriority) { 64 | await priority(url); 65 | } else if (hasPrefetch()) { 66 | try { 67 | await viaDOM(url); 68 | } catch (error) { 69 | await viaXHR(url); 70 | } 71 | } else { 72 | await viaXHR(url); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /packages/caldaria/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "caldaria-server", 3 | "version": "0.0.24", 4 | "type": "module", 5 | "files": [ 6 | "dist", 7 | "src" 8 | ], 9 | "engines": { 10 | "node": ">=10" 11 | }, 12 | "license": "MIT", 13 | "keywords": [ 14 | "pridepack" 15 | ], 16 | "devDependencies": { 17 | "@types/node": "^18.6.3", 18 | "eslint": "^8.21.0", 19 | "eslint-config-lxsmnsyc": "^0.4.8", 20 | "pridepack": "2.3.0", 21 | "solid-js": "^1.5.5", 22 | "tslib": "^2.4.0", 23 | "typescript": "^4.7.4", 24 | "vitest": "^0.21.0" 25 | }, 26 | "peerDependencies": { 27 | "solid-js": "^1.5" 28 | }, 29 | "dependencies": { 30 | "@types/mime-types": "^2.1.1", 31 | "mime-types": "^2.1.34", 32 | "caldaria-render": "0.0.24", 33 | "caldaria-router": "0.0.24", 34 | "caldaria-shared": "0.0.24" 35 | }, 36 | "scripts": { 37 | "prepublishOnly": "pridepack clean && pridepack build", 38 | "build": "pridepack build", 39 | "type-check": "pridepack check", 40 | "lint": "pridepack lint", 41 | "clean": "pridepack clean", 42 | "watch": "pridepack watch", 43 | "start": "pridepack start", 44 | "dev": "pridepack dev", 45 | "test": "vitest" 46 | }, 47 | "description": "", 48 | "repository": { 49 | "url": "https://github.com/lxsmnsyc/caldaria.git", 50 | "type": "git" 51 | }, 52 | "homepage": "https://github.com/lxsmnsyc/caldaria/tree/main/packages/core/server", 53 | "bugs": { 54 | "url": "https://github.com/lxsmnsyc/caldaria/issues" 55 | }, 56 | "publishConfig": { 57 | "access": "public" 58 | }, 59 | "author": "Alexis Munsayac", 60 | "private": false, 61 | "exports": { 62 | ".": { 63 | "development": { 64 | "require": "./dist/cjs/development/index.cjs", 65 | "import": "./dist/esm/development/index.mjs" 66 | }, 67 | "require": "./dist/cjs/production/index.cjs", 68 | "import": "./dist/esm/production/index.mjs", 69 | "types": "./dist/types/index.d.ts" 70 | } 71 | }, 72 | "typesVersions": { 73 | "*": {} 74 | }, 75 | "types": "./dist/types/index.d.ts", 76 | "main": "./dist/cjs/production/index.cjs", 77 | "module": "./dist/esm/production/index.mjs" 78 | } 79 | -------------------------------------------------------------------------------- /packages/adapters/http/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/build/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/islands/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/meta/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/render/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/root/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/router/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | -------------------------------------------------------------------------------- /packages/core/server/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.production 74 | .env.development 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # Next.js build output 80 | .next 81 | 82 | # Nuxt.js build / generate output 83 | .nuxt 84 | dist 85 | 86 | # Gatsby files 87 | .cache/ 88 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 89 | # https://nextjs.org/blog/next-9-1#public-directory-support 90 | # public 91 | 92 | # vuepress build output 93 | .vuepress/dist 94 | 95 | # Serverless directories 96 | .serverless/ 97 | 98 | # FuseBox cache 99 | .fusebox/ 100 | 101 | # DynamoDB Local files 102 | .dynamodb/ 103 | 104 | # TernJS port file 105 | .tern-port 106 | 107 | .npmrc 108 | --------------------------------------------------------------------------------