@sdxc/kit 0.0.0-stage → 2026.10.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +93 -2
- package/changelog.jsonl +1097 -0
- package/config.schema.json +89 -0
- package/dist/author.d.ts +36 -0
- package/dist/author.js +107 -0
- package/dist/bin.d.ts +9 -0
- package/dist/bin.js +10 -0
- package/dist/cli.d.ts +33 -0
- package/dist/cli.js +58 -0
- package/dist/commands/create.d.ts +20 -0
- package/dist/commands/create.js +169 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.js +27 -0
- package/dist/commands/make.d.ts +335 -0
- package/dist/commands/make.js +152 -0
- package/dist/commands/run.d.ts +23 -0
- package/dist/commands/run.js +53 -0
- package/dist/commands/ui/add.d.ts +23 -0
- package/dist/commands/ui/add.js +50 -0
- package/dist/commands/ui/diff.d.ts +20 -0
- package/dist/commands/ui/diff.js +28 -0
- package/dist/commands/ui/list.d.ts +24 -0
- package/dist/commands/ui/list.js +45 -0
- package/dist/commands/ui/remove.d.ts +22 -0
- package/dist/commands/ui/remove.js +48 -0
- package/dist/commands/ui/update.d.ts +23 -0
- package/dist/commands/ui/update.js +37 -0
- package/dist/commands/upgrade.d.ts +30 -0
- package/dist/commands/upgrade.js +184 -0
- package/dist/config.d.ts +81 -0
- package/dist/config.js +157 -0
- package/dist/contract.d.ts +161 -0
- package/dist/contract.js +308 -0
- package/dist/create/github.d.ts +63 -0
- package/dist/create/github.js +172 -0
- package/dist/create/target.d.ts +31 -0
- package/dist/create/target.js +56 -0
- package/dist/create/templates.d.ts +69 -0
- package/dist/create/templates.js +251 -0
- package/dist/dependencies.d.ts +34 -0
- package/dist/dependencies.js +76 -0
- package/dist/diff.d.ts +14 -0
- package/dist/diff.js +103 -0
- package/dist/format.d.ts +21 -0
- package/dist/format.js +40 -0
- package/dist/init.d.ts +40 -0
- package/dist/init.js +100 -0
- package/dist/lock.d.ts +74 -0
- package/dist/lock.js +214 -0
- package/dist/make/declare.d.ts +54 -0
- package/dist/make/declare.js +598 -0
- package/dist/make/generate.d.ts +62 -0
- package/dist/make/generate.js +160 -0
- package/dist/make/imports.d.ts +43 -0
- package/dist/make/imports.js +105 -0
- package/dist/make/index.d.ts +43 -0
- package/dist/make/index.js +140 -0
- package/dist/make/kinds.d.ts +40 -0
- package/dist/make/kinds.js +96 -0
- package/dist/make/migrations.d.ts +41 -0
- package/dist/make/migrations.js +116 -0
- package/dist/make/names.d.ts +31 -0
- package/dist/make/names.js +47 -0
- package/dist/make/stubs.d.ts +44 -0
- package/dist/make/stubs.js +89 -0
- package/dist/middleware.d.ts +44 -0
- package/dist/middleware.js +49 -0
- package/dist/package-manager.d.ts +41 -0
- package/dist/package-manager.js +80 -0
- package/dist/project.d.ts +19 -0
- package/dist/project.js +42 -0
- package/dist/releases.d.ts +40 -0
- package/dist/releases.js +110 -0
- package/dist/testing.d.ts +60 -0
- package/dist/testing.js +148 -0
- package/dist/ui/commands.d.ts +114 -0
- package/dist/ui/commands.js +432 -0
- package/dist/ui/imports.d.ts +46 -0
- package/dist/ui/imports.js +160 -0
- package/dist/ui/layout.d.ts +48 -0
- package/dist/ui/layout.js +138 -0
- package/dist/ui/registry.d.ts +58 -0
- package/dist/ui/registry.js +82 -0
- package/dist/upgrade/changelog.d.ts +50 -0
- package/dist/upgrade/changelog.js +69 -0
- package/dist/upgrade/project.d.ts +62 -0
- package/dist/upgrade/project.js +132 -0
- package/dist/upgrade/prompt.d.ts +51 -0
- package/dist/upgrade/prompt.js +227 -0
- package/dist/upgrade/registry.d.ts +33 -0
- package/dist/upgrade/registry.js +50 -0
- package/lock.schema.json +60 -0
- package/package.json +44 -5
- package/registry/ui/accordion.json +15 -0
- package/registry/ui/alert-dialog.json +20 -0
- package/registry/ui/alert.json +15 -0
- package/registry/ui/aspect-ratio.json +13 -0
- package/registry/ui/attachment.json +15 -0
- package/registry/ui/avatar.json +15 -0
- package/registry/ui/badge.json +13 -0
- package/registry/ui/breadcrumbs.json +15 -0
- package/registry/ui/bubble.json +13 -0
- package/registry/ui/button.json +16 -0
- package/registry/ui/calendar.json +16 -0
- package/registry/ui/card.json +18 -0
- package/registry/ui/carousel.json +15 -0
- package/registry/ui/chart.json +13 -0
- package/registry/ui/checkbox-group.json +13 -0
- package/registry/ui/checkbox.json +16 -0
- package/registry/ui/color-area.json +13 -0
- package/registry/ui/color-field.json +20 -0
- package/registry/ui/color-picker.json +17 -0
- package/registry/ui/color-slider.json +13 -0
- package/registry/ui/color-swatch-picker.json +15 -0
- package/registry/ui/color-swatch.json +13 -0
- package/registry/ui/color-wheel.json +13 -0
- package/registry/ui/combobox.json +15 -0
- package/registry/ui/command.json +13 -0
- package/registry/ui/confirm.json +19 -0
- package/registry/ui/context-menu.json +16 -0
- package/registry/ui/date-field.json +19 -0
- package/registry/ui/date-picker.json +15 -0
- package/registry/ui/date-range-picker.json +16 -0
- package/registry/ui/description.json +13 -0
- package/registry/ui/dialog.json +19 -0
- package/registry/ui/disclosure.json +18 -0
- package/registry/ui/drawer.json +18 -0
- package/registry/ui/drop-indicator.json +13 -0
- package/registry/ui/drop-zone.json +13 -0
- package/registry/ui/empty.json +15 -0
- package/registry/ui/field-error.json +13 -0
- package/registry/ui/file-trigger.json +13 -0
- package/registry/ui/form.json +21 -0
- package/registry/ui/grid-list.json +18 -0
- package/registry/ui/group.json +13 -0
- package/registry/ui/header.json +13 -0
- package/registry/ui/heading-scope.json +20 -0
- package/registry/ui/heading.json +15 -0
- package/registry/ui/highlight.json +16 -0
- package/registry/ui/hover-card.json +13 -0
- package/registry/ui/image-placeholder.json +16 -0
- package/registry/ui/input.json +13 -0
- package/registry/ui/item.json +13 -0
- package/registry/ui/keyboard.json +13 -0
- package/registry/ui/label.json +13 -0
- package/registry/ui/link-button.json +16 -0
- package/registry/ui/link.json +13 -0
- package/registry/ui/listbox.json +15 -0
- package/registry/ui/logo.json +15 -0
- package/registry/ui/marker.json +13 -0
- package/registry/ui/menu.json +19 -0
- package/registry/ui/menubar.json +13 -0
- package/registry/ui/message-scroller.json +16 -0
- package/registry/ui/message.json +13 -0
- package/registry/ui/meter.json +13 -0
- package/registry/ui/modal.json +15 -0
- package/registry/ui/nav-link.json +13 -0
- package/registry/ui/navigation-menu.json +15 -0
- package/registry/ui/number-field.json +15 -0
- package/registry/ui/otp-field.json +15 -0
- package/registry/ui/overlay-arrow.json +13 -0
- package/registry/ui/pagination.json +16 -0
- package/registry/ui/popover.json +13 -0
- package/registry/ui/progress-bar.json +13 -0
- package/registry/ui/radio-group.json +13 -0
- package/registry/ui/range-calendar.json +16 -0
- package/registry/ui/resizable.json +13 -0
- package/registry/ui/scroll-area.json +13 -0
- package/registry/ui/search-field.json +16 -0
- package/registry/ui/section.json +13 -0
- package/registry/ui/select.json +13 -0
- package/registry/ui/selection-indicator.json +13 -0
- package/registry/ui/sentinel-row.json +16 -0
- package/registry/ui/separator.json +13 -0
- package/registry/ui/shared-element.json +13 -0
- package/registry/ui/sheet.json +15 -0
- package/registry/ui/shortcut-list.json +18 -0
- package/registry/ui/sidebar.json +20 -0
- package/registry/ui/skeleton.json +13 -0
- package/registry/ui/slider.json +16 -0
- package/registry/ui/spinner.json +13 -0
- package/registry/ui/switch.json +16 -0
- package/registry/ui/table.json +16 -0
- package/registry/ui/tabs.json +17 -0
- package/registry/ui/tag-group.json +18 -0
- package/registry/ui/text-field.json +19 -0
- package/registry/ui/text.json +13 -0
- package/registry/ui/textarea.json +13 -0
- package/registry/ui/time-field.json +19 -0
- package/registry/ui/toast.json +16 -0
- package/registry/ui/toggle-button.json +17 -0
- package/registry/ui/toolbar.json +13 -0
- package/registry/ui/tooltip.json +16 -0
- package/registry/ui/tree.json +18 -0
- package/registry/ui/typeset.json +16 -0
- package/registry/ui/youtube-embed.json +16 -0
- package/stubs/command.stub +16 -0
- package/stubs/command.test.stub +21 -0
- package/stubs/controller.api.stub +21 -0
- package/stubs/controller.api.test.stub +18 -0
- package/stubs/controller.form.stub +63 -0
- package/stubs/controller.form.test.stub +61 -0
- package/stubs/controller.stub +24 -0
- package/stubs/controller.test.stub +18 -0
- package/stubs/email.stub +26 -0
- package/stubs/email.test.stub +21 -0
- package/stubs/factory.stub +13 -0
- package/stubs/initializer.stub +9 -0
- package/stubs/initializer.test.stub +16 -0
- package/stubs/job.cron.stub +16 -0
- package/stubs/job.stub +15 -0
- package/stubs/job.test.stub +18 -0
- package/stubs/mcp.resource.stub +15 -0
- package/stubs/mcp.stub +13 -0
- package/stubs/mcp.test.stub +18 -0
- package/stubs/middleware.stub +16 -0
- package/stubs/middleware.test.stub +16 -0
- package/stubs/migration.stub +1 -0
- package/stubs/model.stub +33 -0
- package/stubs/model.test.stub +18 -0
- package/stubs/policy.stub +16 -0
- package/stubs/policy.test.stub +20 -0
- package/stubs/service.stub +17 -0
- package/stubs/service.test.stub +17 -0
- package/stubs/validator.stub +17 -0
- package/stubs/validator.test.stub +25 -0
- package/templates/app/.env.example +16 -0
- package/templates/app/README.md +84 -0
- package/templates/app/app/commands/about.test.ts +29 -0
- package/templates/app/app/commands/about.ts +34 -0
- package/templates/app/app/commands/db/console.ts +6 -0
- package/templates/app/app/commands/db/migrate.test.ts +30 -0
- package/templates/app/app/commands/db/migrate.ts +55 -0
- package/templates/app/app/commands/index.ts +31 -0
- package/templates/app/app/commands/typegen.test.ts +17 -0
- package/templates/app/app/commands/typegen.ts +16 -0
- package/templates/app/app/http/controllers/api/health.tsx +15 -0
- package/templates/app/app/http/controllers/api/not-found.tsx +16 -0
- package/templates/app/app/http/controllers/api/openapi.tsx +17 -0
- package/templates/app/app/http/controllers/home.tsx +30 -0
- package/templates/app/app/http/controllers/mcp.tsx +16 -0
- package/templates/app/app/http/controllers/not-found.tsx +30 -0
- package/templates/app/app/http/controllers/robots.test.ts +18 -0
- package/templates/app/app/http/controllers/robots.ts +24 -0
- package/templates/app/app/http/controllers/sitemap.test.ts +28 -0
- package/templates/app/app/http/controllers/sitemap.ts +25 -0
- package/templates/app/app/http/middleware/api.ts +10 -0
- package/templates/app/app/http/middleware/page.test.ts +40 -0
- package/templates/app/app/http/middleware/page.ts +49 -0
- package/templates/app/app/http/middleware/server-timing.test.ts +15 -0
- package/templates/app/app/http/middleware/server-timing.ts +42 -0
- package/templates/app/app/initializers/assets.ts +11 -0
- package/templates/app/app/initializers/captcha.ts +11 -0
- package/templates/app/app/initializers/cli.ts +75 -0
- package/templates/app/app/initializers/database.test.ts +18 -0
- package/templates/app/app/initializers/database.ts +18 -0
- package/templates/app/app/initializers/dispatcher.ts +36 -0
- package/templates/app/app/initializers/honeypot.ts +11 -0
- package/templates/app/app/initializers/i18n.test.ts +16 -0
- package/templates/app/app/initializers/i18n.ts +28 -0
- package/templates/app/app/initializers/local-database.test.ts +33 -0
- package/templates/app/app/initializers/local-database.ts +53 -0
- package/templates/app/app/initializers/logger.ts +10 -0
- package/templates/app/app/initializers/mail.test.ts +27 -0
- package/templates/app/app/initializers/mail.ts +11 -0
- package/templates/app/app/initializers/mcp.ts +16 -0
- package/templates/app/app/initializers/openapi.ts +21 -0
- package/templates/app/app/initializers/router.test.ts +61 -0
- package/templates/app/app/initializers/router.tsx +111 -0
- package/templates/app/app/initializers/seo.ts +15 -0
- package/templates/app/app/initializers/session.test.ts +34 -0
- package/templates/app/app/initializers/session.ts +29 -0
- package/templates/app/app/initializers/spam.ts +10 -0
- package/templates/app/app/jobs/index.ts +10 -0
- package/templates/app/app/mcp/resources/index.ts +9 -0
- package/templates/app/app/mcp/tools/index.ts +10 -0
- package/templates/app/app/models/index.ts +10 -0
- package/templates/app/app/services/migrations.test.ts +45 -0
- package/templates/app/app/services/migrations.ts +60 -0
- package/templates/app/app/test/cloudflare-workers.ts +25 -0
- package/templates/app/bootstrap/browser.ts +27 -0
- package/templates/app/bootstrap/cli.ts +9 -0
- package/templates/app/bootstrap/worker.ts +31 -0
- package/templates/app/cloudflare.config.ts +56 -0
- package/templates/app/config/constants.ts +19 -0
- package/templates/app/config/problems.ts +24 -0
- package/templates/app/config/security-policy.ts +34 -0
- package/templates/app/config/security-txt.ts +28 -0
- package/templates/app/database/migrations/.gitkeep +0 -0
- package/templates/app/gitignore +9 -0
- package/templates/app/package.json +68 -0
- package/templates/app/resources/layouts/document.tsx +79 -0
- package/templates/app/resources/locales/en.json +10 -0
- package/templates/app/routes/api.ts +29 -0
- package/templates/app/routes/web.ts +14 -0
- package/templates/app/tsconfig.json +40 -0
- package/templates/app/vite.config.ts +44 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The app's security.txt (RFC 9116), served at `/.well-known/security.txt` so a researcher who
|
|
3
|
+
* finds a vulnerability knows where to report it. Review it before `expires`; a test fails a
|
|
4
|
+
* month ahead so the file never goes stale.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { SecurityTxt } from "@sdxc/well-known/security-txt";
|
|
8
|
+
|
|
9
|
+
import { serve } from "@sdxc/well-known/middleware";
|
|
10
|
+
import { securityTxt } from "@sdxc/well-known/security-txt";
|
|
11
|
+
|
|
12
|
+
import { SITE_URL } from "~/config/constants";
|
|
13
|
+
|
|
14
|
+
/** Where reports go and until when this file is current; replace the contact with yours. */
|
|
15
|
+
export const SECURITY_TXT: SecurityTxt = {
|
|
16
|
+
contact: [new URL("mailto:security@example.com")],
|
|
17
|
+
expires: new Date("2027-10-15T00:00:00Z"),
|
|
18
|
+
encryption: [],
|
|
19
|
+
acknowledgments: [],
|
|
20
|
+
preferredLanguages: ["en"],
|
|
21
|
+
canonical: [new URL("/.well-known/security.txt", SITE_URL)],
|
|
22
|
+
policy: [],
|
|
23
|
+
hiring: [],
|
|
24
|
+
extensions: {},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** The entry the router's `wellKnown()` serves the file through. */
|
|
28
|
+
export const securityTxtEntry = serve(securityTxt, () => SECURITY_TXT);
|
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "vp build",
|
|
7
|
+
"cf:deploy": "cf deploy --prebuilt",
|
|
8
|
+
"check": "vp check",
|
|
9
|
+
"cli": "bun ./bootstrap/cli.ts",
|
|
10
|
+
"dev": "vp dev",
|
|
11
|
+
"start": "vp preview",
|
|
12
|
+
"test": "vp test run",
|
|
13
|
+
"typecheck": "tsc --noEmit"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@pitlane/assets": "0.1.0",
|
|
17
|
+
"@sdxc/assets-middleware": "0.0.1",
|
|
18
|
+
"@sdxc/captcha": "0.0.1",
|
|
19
|
+
"@sdxc/cli": "0.0.1",
|
|
20
|
+
"@sdxc/data-model": "0.0.1",
|
|
21
|
+
"@sdxc/data-table-d1": "0.0.1",
|
|
22
|
+
"@sdxc/database-middleware": "0.0.1",
|
|
23
|
+
"@sdxc/get-client-ip": "0.0.1",
|
|
24
|
+
"@sdxc/honeypot": "0.0.1",
|
|
25
|
+
"@sdxc/http": "0.0.1",
|
|
26
|
+
"@sdxc/i18n": "0.0.1",
|
|
27
|
+
"@sdxc/jobs": "0.0.1",
|
|
28
|
+
"@sdxc/json-schema": "0.0.1",
|
|
29
|
+
"@sdxc/lazy-route": "0.0.1",
|
|
30
|
+
"@sdxc/logger": "0.0.1",
|
|
31
|
+
"@sdxc/mail": "0.0.1",
|
|
32
|
+
"@sdxc/mcp": "0.0.1",
|
|
33
|
+
"@sdxc/no-www-middleware": "0.0.1",
|
|
34
|
+
"@sdxc/openapi": "0.0.1",
|
|
35
|
+
"@sdxc/problem": "0.0.1",
|
|
36
|
+
"@sdxc/rate-limit": "0.0.1",
|
|
37
|
+
"@sdxc/result": "0.0.1",
|
|
38
|
+
"@sdxc/robots": "0.0.1",
|
|
39
|
+
"@sdxc/security-headers": "0.0.1",
|
|
40
|
+
"@sdxc/seo": "0.0.1",
|
|
41
|
+
"@sdxc/server-timing": "0.0.1",
|
|
42
|
+
"@sdxc/session-storage-kv": "0.0.1",
|
|
43
|
+
"@sdxc/sitemap": "0.0.1",
|
|
44
|
+
"@sdxc/spam": "0.0.1",
|
|
45
|
+
"@sdxc/trace-context": "0.0.1",
|
|
46
|
+
"@sdxc/trailing-slash-middleware": "0.0.1",
|
|
47
|
+
"@sdxc/ui": "0.0.1",
|
|
48
|
+
"@sdxc/user-agent": "0.0.1",
|
|
49
|
+
"@sdxc/well-known": "0.0.1",
|
|
50
|
+
"remix": "3.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@cloudflare/vite-plugin": "2.0.0-beta.sha-ad79608dd",
|
|
54
|
+
"@pitlane/vite-plugin-remix": "0.8.0",
|
|
55
|
+
"@sdxc/cloudflare-mocks": "0.0.1",
|
|
56
|
+
"@sdxc/kit": "0.0.1",
|
|
57
|
+
"@types/node": "^26.6.5",
|
|
58
|
+
"cf": "1.0.0-beta.5",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.3",
|
|
61
|
+
"vite-plus": "0.3.3",
|
|
62
|
+
"vitest": "4.1.11"
|
|
63
|
+
},
|
|
64
|
+
"overrides": {
|
|
65
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.3"
|
|
66
|
+
},
|
|
67
|
+
"packageManager": "bun@1.4.2"
|
|
68
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTML document every page renders inside: the head tags, the page's title, description,
|
|
3
|
+
* canonical link and link-preview tags, and the
|
|
4
|
+
* stylesheets imported below in cascade order. The client entry is linked only by a page
|
|
5
|
+
* that carries an island.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { DocumentAssets } from "@sdxc/assets-middleware";
|
|
9
|
+
import type { I18n } from "@sdxc/i18n";
|
|
10
|
+
import type { Handle, RemixNode } from "remix/component";
|
|
11
|
+
|
|
12
|
+
import { IntlProvider } from "@sdxc/i18n/ui";
|
|
13
|
+
import { Seo } from "@sdxc/seo";
|
|
14
|
+
import { css } from "remix/component";
|
|
15
|
+
import { ImportMap } from "remix/component/server";
|
|
16
|
+
|
|
17
|
+
import { seo } from "~/app/initializers/seo";
|
|
18
|
+
|
|
19
|
+
import "@sdxc/ui/reset.css";
|
|
20
|
+
import "@sdxc/ui/theme.css";
|
|
21
|
+
|
|
22
|
+
namespace DocumentLayout {
|
|
23
|
+
export interface Props {
|
|
24
|
+
/** The page's content, rendered inside `<main>`. */
|
|
25
|
+
children: RemixNode;
|
|
26
|
+
/**
|
|
27
|
+
* The stylesheets, client entry and CSP nonce the request resolved, from `ctx.assets`;
|
|
28
|
+
* the nonce is read only when the page hydrates, for its inline import map.
|
|
29
|
+
*/
|
|
30
|
+
assets: DocumentAssets;
|
|
31
|
+
/** The request's translator, from `ctx.intl`: it sets `<html lang>` and is what `intl(handle)` reads below it. */
|
|
32
|
+
intl: I18n;
|
|
33
|
+
title: string;
|
|
34
|
+
/** The page's summary in search results and link previews; the site's description by default. */
|
|
35
|
+
description?: string;
|
|
36
|
+
/** The request's URL, from `ctx.url`, which the canonical link names on `SITE_URL`. */
|
|
37
|
+
url: URL;
|
|
38
|
+
/** Whether the page carries an island, the only reason to link the client entry. */
|
|
39
|
+
hydrates?: boolean;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Renders the `<html>`, `<head>` and `<body>` shell around a page. */
|
|
44
|
+
export default function DocumentLayout(handle: Handle<DocumentLayout.Props>) {
|
|
45
|
+
return () => {
|
|
46
|
+
let { assets, children, description, hydrates = false, intl, title, url } = handle.props;
|
|
47
|
+
let { script, stylesheets } = assets;
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<html lang={intl.locale} class="system">
|
|
51
|
+
<head>
|
|
52
|
+
<meta charSet="utf-8" data-rmx-key="charset" />
|
|
53
|
+
<meta
|
|
54
|
+
name="viewport"
|
|
55
|
+
content="width=device-width, initial-scale=1"
|
|
56
|
+
data-rmx-key="viewport"
|
|
57
|
+
/>
|
|
58
|
+
<Seo.Meta
|
|
59
|
+
title={title}
|
|
60
|
+
description={description}
|
|
61
|
+
canonical={seo.canonical(url)}
|
|
62
|
+
site={seo.site}
|
|
63
|
+
og={{ locale: intl.locale }}
|
|
64
|
+
/>
|
|
65
|
+
{stylesheets.map((href) => (
|
|
66
|
+
<link key={href} rel="stylesheet" href={href} data-rmx-key={href} />
|
|
67
|
+
))}
|
|
68
|
+
{hydrates ? <ImportMap value={script.importMap} nonce={assets.nonce} /> : null}
|
|
69
|
+
</head>
|
|
70
|
+
<body>
|
|
71
|
+
<main mix={css({ maxInlineSize: "48rem", marginInline: "auto", padding: "1.5rem" })}>
|
|
72
|
+
<IntlProvider intl={intl}>{children}</IntlProvider>
|
|
73
|
+
</main>
|
|
74
|
+
{hydrates ? <script type="module" src={script.href}></script> : null}
|
|
75
|
+
</body>
|
|
76
|
+
</html>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API route contract: every endpoint a machine client calls, and the OpenAPI operation
|
|
3
|
+
* that types each documented one, so the published document and the handler that parses a
|
|
4
|
+
* request read the same schemas.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as s from "@sdxc/json-schema";
|
|
8
|
+
import { defineOperation } from "@sdxc/openapi";
|
|
9
|
+
import { get, post, route } from "remix/routes";
|
|
10
|
+
|
|
11
|
+
/** The JSON endpoints under `/api`, and the MCP endpoint an agent connects to. */
|
|
12
|
+
const ROUTES = route({
|
|
13
|
+
api: {
|
|
14
|
+
health: get("/api/health"),
|
|
15
|
+
openapi: get("/api/openapi.json"),
|
|
16
|
+
notFound: "/api/*path",
|
|
17
|
+
},
|
|
18
|
+
mcp: post("/mcp"),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export default ROUTES;
|
|
22
|
+
|
|
23
|
+
/** GET /api/health, the check a monitor or load balancer polls. */
|
|
24
|
+
export const HEALTH = defineOperation("health", ROUTES.api.health, {
|
|
25
|
+
summary: "Check the service",
|
|
26
|
+
responses: {
|
|
27
|
+
200: { description: "The service is up", body: s.object({ status: s.literal("ok") }) },
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The web route contract: every page the app serves, by name. Controllers and links build
|
|
3
|
+
* URLs with `routes.<name>.href()`, so a pattern changes here and nowhere else.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { get, route } from "remix/routes";
|
|
7
|
+
|
|
8
|
+
/** The pages, and the 404 page for any path no other route claims. */
|
|
9
|
+
export default route({
|
|
10
|
+
home: get("/"),
|
|
11
|
+
robots: get("/robots.txt"),
|
|
12
|
+
sitemap: get("/sitemap.xml"),
|
|
13
|
+
notFound: "/*path",
|
|
14
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": [
|
|
3
|
+
"app/**/*",
|
|
4
|
+
"bootstrap/**/*",
|
|
5
|
+
"config/**/*",
|
|
6
|
+
"database/**/*",
|
|
7
|
+
"resources/**/*",
|
|
8
|
+
"routes/**/*",
|
|
9
|
+
".cloudflare/types/index.d.ts",
|
|
10
|
+
"cloudflare.config.ts",
|
|
11
|
+
"vite.config.ts"
|
|
12
|
+
],
|
|
13
|
+
"compilerOptions": {
|
|
14
|
+
"target": "es2022",
|
|
15
|
+
"lib": ["es2023", "dom", "dom.iterable"],
|
|
16
|
+
"module": "preserve",
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"moduleDetection": "force",
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"allowImportingTsExtensions": true,
|
|
21
|
+
"isolatedModules": true,
|
|
22
|
+
"verbatimModuleSyntax": true,
|
|
23
|
+
"esModuleInterop": true,
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"noEmit": true,
|
|
26
|
+
"strict": true,
|
|
27
|
+
"noUncheckedIndexedAccess": true,
|
|
28
|
+
"noImplicitOverride": true,
|
|
29
|
+
"jsx": "react-jsx",
|
|
30
|
+
"jsxImportSource": "remix/component",
|
|
31
|
+
"types": ["node", "vite/client"],
|
|
32
|
+
"paths": {
|
|
33
|
+
"~/app/*": ["./app/*"],
|
|
34
|
+
"~/config/*": ["./config/*"],
|
|
35
|
+
"~/database/*": ["./database/*"],
|
|
36
|
+
"~/resources/*": ["./resources/*"],
|
|
37
|
+
"~/routes/*": ["./routes/*"]
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite+ configuration: the dev server and build, the tests, and the formatting and lint rules
|
|
3
|
+
* `vp check` applies. The Cloudflare plugin runs the Worker in the SSR environment, and the
|
|
4
|
+
* Remix plugin builds the client entry and writes the asset manifest the document links from.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
8
|
+
import { remix } from "@pitlane/vite-plugin-remix";
|
|
9
|
+
import { defineConfig } from "vite-plus";
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
resolve: { tsconfigPaths: true },
|
|
13
|
+
|
|
14
|
+
plugins: [
|
|
15
|
+
remix({
|
|
16
|
+
clientEntry: "bootstrap/browser.ts",
|
|
17
|
+
serverEntry: "bootstrap/worker.ts",
|
|
18
|
+
serverHandler: false,
|
|
19
|
+
}),
|
|
20
|
+
/**
|
|
21
|
+
* Tests import modules on their own, in Node, so the Worker runtime the plugin starts
|
|
22
|
+
* is left out while Vitest runs.
|
|
23
|
+
*/
|
|
24
|
+
process.env.VITEST === undefined ? cloudflare({ viteEnvironment: { name: "ssr" } }) : null,
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
test: {
|
|
28
|
+
include: ["app/**/*.test.ts?(x)", "resources/**/*.test.ts?(x)"],
|
|
29
|
+
/** Vitest runs modules in Node, so the Worker runtime's module resolves to a stand-in. */
|
|
30
|
+
alias: {
|
|
31
|
+
"cloudflare:workers": new URL("app/test/cloudflare-workers.ts", import.meta.url).pathname,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
fmt: {
|
|
36
|
+
useTabs: true,
|
|
37
|
+
ignorePatterns: [".cloudflare/**"],
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
lint: {
|
|
41
|
+
options: { typeAware: true, typeCheck: true },
|
|
42
|
+
ignorePatterns: [".cloudflare/**"],
|
|
43
|
+
},
|
|
44
|
+
});
|