diff --git a/.gitignore b/.gitignore index 1baa4ccf..d78baa90 100644 --- a/.gitignore +++ b/.gitignore @@ -68,4 +68,5 @@ count.txt .secrets .actrc .secrets -generated/ \ No newline at end of file +generated/ +.wrangler diff --git a/.npmrc b/.npmrc index 76cb2f66..6adec7ce 100644 --- a/.npmrc +++ b/.npmrc @@ -5,3 +5,4 @@ # JSR Configuration (for Deno packages) #@jsr:registry=https://npm.jsr.io/ +hoist=false diff --git a/apps/cli/tsconfig.tsbuildinfo b/apps/cli/tsconfig.tsbuildinfo index 4d6684f2..9df2cfc7 100644 --- a/apps/cli/tsconfig.tsbuildinfo +++ b/apps/cli/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/main.ts","./src/commands/add.ts","./src/commands/create.ts","./src/commands/init.ts","./src/commands/registry.ts"],"version":"5.9.2"} \ No newline at end of file +{"root":["./src/main.ts","./src/commands/add.ts","./src/commands/create.ts","./src/commands/init.ts","./src/commands/registry.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/apps/node-auth-app/.env-example b/apps/node-auth-example/.env-example similarity index 100% rename from apps/node-auth-app/.env-example rename to apps/node-auth-example/.env-example diff --git a/apps/node-auth-app/LLMs.txt b/apps/node-auth-example/LLMs.txt similarity index 100% rename from apps/node-auth-app/LLMs.txt rename to apps/node-auth-example/LLMs.txt diff --git a/apps/node-auth-app/package.json b/apps/node-auth-example/package.json similarity index 93% rename from apps/node-auth-app/package.json rename to apps/node-auth-example/package.json index 5bcf8fcb..77417e7f 100644 --- a/apps/node-auth-app/package.json +++ b/apps/node-auth-example/package.json @@ -1,5 +1,5 @@ { - "name": "@effectify/node-auth-app", + "name": "@effectify/node-auth-example", "version": "0.0.1", "private": true, "type": "module", diff --git a/apps/node-auth-app/project.json b/apps/node-auth-example/project.json similarity index 68% rename from apps/node-auth-app/project.json rename to apps/node-auth-example/project.json index e2f5c774..41bab72d 100644 --- a/apps/node-auth-app/project.json +++ b/apps/node-auth-example/project.json @@ -1,7 +1,7 @@ { - "name": "@effectify/node-auth-app", + "name": "@effectify/node-auth-example", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/node-auth-app/src", + "sourceRoot": "apps/node-auth-example/src", "projectType": "application", "targets": { "build": { @@ -9,22 +9,22 @@ "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "outputPath": "apps/node-auth-app/dist", - "main": "apps/node-auth-app/src/main.ts", - "tsConfig": "apps/node-auth-app/tsconfig.app.json", + "outputPath": "apps/node-auth-example/dist", + "main": "apps/node-auth-example/src/main.ts", + "tsConfig": "apps/node-auth-example/tsconfig.app.json", "format": ["esm"], "generatePackageJson": false, "updateBuildableProjectDepsInPackageJson": false, "additionalEntryPoints": [], "assets": [ - "apps/node-auth-app/src/assets", + "apps/node-auth-example/src/assets", { "input": "node_modules/better-sqlite3/build/Release", "glob": "better_sqlite3.node", "output": "./" }, { - "input": "apps/node-auth-app", + "input": "apps/node-auth-example", "glob": "sqlite.db", "output": "./" } @@ -40,16 +40,16 @@ "defaultConfiguration": "development", "dependsOn": ["build"], "options": { - "buildTarget": "@effectify/node-auth-app:build", + "buildTarget": "@effectify/node-auth-example:build", "runBuildTargetDependencies": true, "runtimeArgs": ["--experimental-specifier-resolution=node"] }, "configurations": { "development": { - "buildTarget": "@effectify/node-auth-app:build:development" + "buildTarget": "@effectify/node-auth-example:build:development" }, "production": { - "buildTarget": "@effectify/node-auth-app:build:production" + "buildTarget": "@effectify/node-auth-example:build:production" } } } diff --git a/apps/node-auth-app/sqlite.db b/apps/node-auth-example/sqlite.db similarity index 100% rename from apps/node-auth-app/sqlite.db rename to apps/node-auth-example/sqlite.db diff --git a/apps/node-auth-app/src/assets/.gitkeep b/apps/node-auth-example/src/assets/.gitkeep similarity index 100% rename from apps/node-auth-app/src/assets/.gitkeep rename to apps/node-auth-example/src/assets/.gitkeep diff --git a/apps/node-auth-app/src/auth.ts b/apps/node-auth-example/src/auth.ts similarity index 100% rename from apps/node-auth-app/src/auth.ts rename to apps/node-auth-example/src/auth.ts diff --git a/apps/node-auth-app/src/http.ts b/apps/node-auth-example/src/http.ts similarity index 100% rename from apps/node-auth-app/src/http.ts rename to apps/node-auth-example/src/http.ts diff --git a/apps/node-auth-app/src/main.ts b/apps/node-auth-example/src/main.ts similarity index 100% rename from apps/node-auth-app/src/main.ts rename to apps/node-auth-example/src/main.ts diff --git a/apps/node-auth-app/tsconfig.app.json b/apps/node-auth-example/tsconfig.app.json similarity index 100% rename from apps/node-auth-app/tsconfig.app.json rename to apps/node-auth-example/tsconfig.app.json diff --git a/apps/node-auth-app/tsconfig.json b/apps/node-auth-example/tsconfig.json similarity index 100% rename from apps/node-auth-app/tsconfig.json rename to apps/node-auth-example/tsconfig.json diff --git a/apps/react-app-router/index.html b/apps/react-app-router/index.html deleted file mode 100644 index 12f6d42d..00000000 --- a/apps/react-app-router/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - React Router 7 App - - -
- - - diff --git a/apps/react-app-router/package.json b/apps/react-app-router/package.json deleted file mode 100644 index 7953148a..00000000 --- a/apps/react-app-router/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "react-app-router", - "version": "1.0.0", - "description": "", - "main": "index.js", - "type": "module", - "scripts": { - "build": "vite build", - "dev": "vite dev", - "preview": "vite preview", - "typecheck": "tsc" - }, - "keywords": [], - "author": "", - "license": "ISC", - "packageManager": "pnpm@10.14.0", - "dependencies": { - "effect": "catalog:", - "@effectify/react-router": "workspace:*", - "react": "catalog:", - "react-dom": "catalog:", - "react-router": "catalog:" - }, - "devDependencies": { - "@types/react": "catalog:", - "@types/react-dom": "catalog:", - "@vitejs/plugin-react": "catalog:", - "typescript": "catalog:", - "vite": "catalog:" - }, - "peerDependencies": {}, - "optionalDependencies": {} -} diff --git a/apps/react-app-router/project.json b/apps/react-app-router/project.json deleted file mode 100644 index ffa8376c..00000000 --- a/apps/react-app-router/project.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "react-app-router", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "projectType": "application", - "sourceRoot": "apps/react-app-router", - "targets": {}, - "tags": ["npm:public"] -} diff --git a/apps/react-app-router/src/lib/runtime.server.ts b/apps/react-app-router/src/lib/runtime.server.ts deleted file mode 100644 index 72dc515c..00000000 --- a/apps/react-app-router/src/lib/runtime.server.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Runtime } from "@effectify/react-router" -import * as Layer from "effect/Layer" - -const layers = Layer.empty - -export const { withLoaderEffect, withActionEffect } = Runtime.make(layers) diff --git a/apps/react-app-router/src/main.tsx b/apps/react-app-router/src/main.tsx deleted file mode 100644 index 5385f3fd..00000000 --- a/apps/react-app-router/src/main.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { StrictMode } from "react" -import { createRoot } from "react-dom/client" -import { createBrowserRouter, RouterProvider } from "react-router" -import { routes } from "./routes" - -const router = createBrowserRouter(routes) - -const rootElement = document.getElementById("root") -if (!rootElement) { - throw new Error("Root element not found") -} -createRoot(rootElement).render( - - - , -) diff --git a/apps/react-app-router/src/routes.tsx b/apps/react-app-router/src/routes.tsx deleted file mode 100644 index 60609e75..00000000 --- a/apps/react-app-router/src/routes.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import Home from "./routes/_index" -import Layout from "./routes/_layout" -import About from "./routes/about" -import Test, { action, loader } from "./routes/test" - -export const routes = [ - { - path: "/", - element: , - children: [ - { - index: true, - element: , - }, - { - path: "about", - element: , - }, - { - path: "test", - element: , - loader, - action, - }, - ], - }, -] diff --git a/apps/react-app-router/src/routes/_index.tsx b/apps/react-app-router/src/routes/_index.tsx deleted file mode 100644 index 4b931de2..00000000 --- a/apps/react-app-router/src/routes/_index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export default function Home() { - return ( -
-

Welcome to React Router 7

-

This app uses React Router 7 with Effect integration

-

Hello from React Router 7 with Effect!

-
- ) -} diff --git a/apps/react-app-router/src/routes/_layout.tsx b/apps/react-app-router/src/routes/_layout.tsx deleted file mode 100644 index bac90939..00000000 --- a/apps/react-app-router/src/routes/_layout.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Link, Outlet } from "react-router" - -export default function Layout() { - return ( -
- -
- -
-
- ) -} diff --git a/apps/react-app-router/src/routes/about.tsx b/apps/react-app-router/src/routes/about.tsx deleted file mode 100644 index 7262bcaa..00000000 --- a/apps/react-app-router/src/routes/about.tsx +++ /dev/null @@ -1,8 +0,0 @@ -export default function About() { - return ( -
-

About

-

This is the about page using React Router 7

-
- ) -} diff --git a/apps/react-app-router/src/routes/demo.tsx b/apps/react-app-router/src/routes/demo.tsx deleted file mode 100644 index eeba61b2..00000000 --- a/apps/react-app-router/src/routes/demo.tsx +++ /dev/null @@ -1,232 +0,0 @@ -import { ActionArgsContext, httpFailure, httpRedirect, httpSuccess, LoaderArgsContext } from "@effectify/react-router" -import * as Effect from "effect/Effect" -import { Form, useActionData, useLoaderData } from "react-router" -import { withActionEffect, withLoaderEffect } from "../lib/runtime.server" - -export const loader = withLoaderEffect( - Effect.gen(function*() { - const { request } = yield* LoaderArgsContext - const url = new URL(request.url) - const demo = url.searchParams.get("demo") - - yield* Effect.log("Demo loader called with:", demo) - - // Demonstrate different response types based on query parameter - if (demo === "error") { - return yield* httpFailure("This is a demo error from the loader") - } - - if (demo === "redirect") { - return yield* httpRedirect("/test") - } - - // Default to success - return yield* httpSuccess({ - message: "Demo loader works!", - demo: demo || "success", - timestamp: new Date().toISOString(), - }) - }), -) - -export const action = withActionEffect( - Effect.gen(function*() { - const { request } = yield* ActionArgsContext - - // Get form data - const formData = yield* Effect.tryPromise(() => request.formData()) - const actionType = formData.get("actionType") as string - - yield* Effect.log("Demo action called with type:", actionType) - - // Demonstrate different response types based on form data - if (actionType === "error") { - return yield* httpFailure("This is a demo error from the action") - } - - if (actionType === "redirect") { - return yield* httpRedirect("/test") - } - - // Default to success - return yield* httpSuccess({ - message: "Demo action completed successfully!", - actionType: actionType || "success", - timestamp: new Date().toISOString(), - }) - }), -) - -export default function DemoRoute() { - const loaderData = useLoaderData() - const actionData = useActionData() - - return ( -
-

Demo Route - New API Features

-

This route demonstrates the new httpSuccess, httpFailure, and httpRedirect helpers.

- - {/* Show loader data */} -
-

Loader Data:

- {loaderData ? - ( - loaderData.ok ? - ( -
-

- Message: {loaderData.data.message} -

-

- Demo: {loaderData.data.demo} -

-

- Timestamp: {loaderData.data.timestamp} -

-
- ) : - ( -
-

- Error: {loaderData.errors.join(", ")} -

-
- ) - ) : - ( -
-

Loading...

-
- )} -
- - {/* Demo buttons for loader */} -
-

Test Loader Responses:

- -
- - {/* Form for action testing */} -
-

Test Action Responses:

-
-
- - - -
-
-
- - {/* Show action result */} - {actionData && ( -
-

Action Result:

- {actionData.ok ? - ( -
-

- Message: {actionData.response.message} -

-

- Action Type: {actionData.response.actionType} -

-

- Timestamp: {actionData.response.timestamp} -

-
- ) : - ( -

- Error: {String(actionData.errors)} -

- )} -
- )} - - {/* Navigation */} - -
- ) -} diff --git a/apps/react-app-router/src/routes/test.tsx b/apps/react-app-router/src/routes/test.tsx deleted file mode 100644 index 7ae581ac..00000000 --- a/apps/react-app-router/src/routes/test.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { ActionArgsContext, httpFailure, httpSuccess, LoaderArgsContext } from "@effectify/react-router" -import * as Effect from "effect/Effect" -import { Form, useActionData, useLoaderData } from "react-router" -import { withActionEffect, withLoaderEffect } from "../lib/runtime.server" - -export const loader = withLoaderEffect( - Effect.gen(function*() { - const { request } = yield* LoaderArgsContext - yield* Effect.log("request", request) - - // Use the new httpSuccess helper for better DX - return yield* httpSuccess({ message: "Test route works!" }) - }), -) - -export const action = withActionEffect( - Effect.gen(function*() { - const { request } = yield* ActionArgsContext - - // Get form data - const formData = yield* Effect.tryPromise(() => request.formData()) - const inputValue = formData.get("inputValue") as string - - yield* Effect.log("Form value received:", inputValue) - - // Validate input - if (!inputValue || inputValue.trim().length === 0) { - return yield* httpFailure("Input value is required") - } - - // Return processed value using the new httpSuccess helper - return yield* httpSuccess({ - message: "Received successfully!", - inputValue, - }) - }), -) - -export default function Test() { - const loaderData = useLoaderData() - const actionData = useActionData() - - return ( -
-

Test Route - Form with Effect

- - {/* Show loader data */} - {loaderData ? - ( - loaderData.ok ? - ( -
-

Loader Data:

-

{loaderData.data.message}

-
- ) : - ( -
-

Loader Error:

-

{loaderData.errors.join(", ")}

-
- ) - ) : - ( -
-

Loading...

-

Loader data is not available yet

-
- )} - - {/* Form */} -
-
- - -
- -
- - {/* Show action result */} - {actionData && ( -
-

Action Result:

- {actionData.ok ? - ( -
-

- Message: {actionData.response.message} -

-

- Sent value: "{actionData.response.inputValue}" -

-
- ) : -

Error: {String(actionData.errors)}

} -
- )} - - {/* Navigation */} - -
- ) -} diff --git a/apps/react-app-router/tsconfig.json b/apps/react-app-router/tsconfig.json deleted file mode 100644 index d27dab4f..00000000 --- a/apps/react-app-router/tsconfig.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "include": [ - "**/*.ts", - "**/*.tsx", - "**/.server/**/*.ts", - "**/.server/**/*.tsx", - "**/.client/**/*.ts", - "**/.client/**/*.tsx" - ], - "compilerOptions": { - "lib": ["DOM", "DOM.Iterable", "ES2022"], - "types": ["vite/client"], - "isolatedModules": true, - "esModuleInterop": true, - "jsx": "react-jsx", - "module": "ESNext", - "moduleResolution": "Bundler", - "resolveJsonModule": true, - "target": "ES2022", - "strict": true, - "allowJs": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - }, - - // Vite takes care of building everything, not tsc. - "noEmit": true - } -} diff --git a/apps/react-app-router/vite.config.ts b/apps/react-app-router/vite.config.ts deleted file mode 100644 index 602d0b5a..00000000 --- a/apps/react-app-router/vite.config.ts +++ /dev/null @@ -1,22 +0,0 @@ -import path from "node:path" -import react from "@vitejs/plugin-react" -import { defineConfig } from "vite" - -export default defineConfig({ - plugins: [react()], - resolve: { - alias: { - "~": path.resolve(__dirname, "src"), - }, - }, - build: { - outDir: "dist", - target: "esnext", - }, - server: { - port: 5174, - }, - preview: { - port: 4174, - }, -}) diff --git a/apps/react-app-remix/app/entry.client.tsx b/apps/react-remix-example/app/entry.client.tsx similarity index 100% rename from apps/react-app-remix/app/entry.client.tsx rename to apps/react-remix-example/app/entry.client.tsx diff --git a/apps/react-app-remix/app/entry.server.tsx b/apps/react-remix-example/app/entry.server.tsx similarity index 100% rename from apps/react-app-remix/app/entry.server.tsx rename to apps/react-remix-example/app/entry.server.tsx diff --git a/apps/react-app-remix/app/lib/http.server.ts b/apps/react-remix-example/app/lib/http.server.ts similarity index 100% rename from apps/react-app-remix/app/lib/http.server.ts rename to apps/react-remix-example/app/lib/http.server.ts diff --git a/apps/react-app-remix/app/lib/runtime.server.ts b/apps/react-remix-example/app/lib/runtime.server.ts similarity index 100% rename from apps/react-app-remix/app/lib/runtime.server.ts rename to apps/react-remix-example/app/lib/runtime.server.ts diff --git a/apps/react-app-remix/app/root.tsx b/apps/react-remix-example/app/root.tsx similarity index 100% rename from apps/react-app-remix/app/root.tsx rename to apps/react-remix-example/app/root.tsx diff --git a/apps/react-app-remix/app/routes/api.$.ts b/apps/react-remix-example/app/routes/api.$.ts similarity index 100% rename from apps/react-app-remix/app/routes/api.$.ts rename to apps/react-remix-example/app/routes/api.$.ts diff --git a/apps/react-app-remix/app/routes/demo.tsx b/apps/react-remix-example/app/routes/demo.tsx similarity index 100% rename from apps/react-app-remix/app/routes/demo.tsx rename to apps/react-remix-example/app/routes/demo.tsx diff --git a/apps/react-app-remix/app/routes/test.tsx b/apps/react-remix-example/app/routes/test.tsx similarity index 100% rename from apps/react-app-remix/app/routes/test.tsx rename to apps/react-remix-example/app/routes/test.tsx diff --git a/apps/react-app-remix/package.json b/apps/react-remix-example/package.json similarity index 95% rename from apps/react-app-remix/package.json rename to apps/react-remix-example/package.json index 2fb11303..007629ae 100644 --- a/apps/react-app-remix/package.json +++ b/apps/react-remix-example/package.json @@ -1,5 +1,5 @@ { - "name": "react-app-remix", + "name": "@effectify/react-remix-example", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/apps/react-app-remix/project.json b/apps/react-remix-example/project.json similarity index 90% rename from apps/react-app-remix/project.json rename to apps/react-remix-example/project.json index aac6cd2b..cf4a70db 100644 --- a/apps/react-app-remix/project.json +++ b/apps/react-remix-example/project.json @@ -1,8 +1,8 @@ { - "name": "react-app-remix", + "name": "@effectify/react-remix-example", "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "sourceRoot": "apps/react-app-remix", + "sourceRoot": "apps/react-remix-example/src", "targets": { "build": { "executor": "nx:run-script", diff --git a/apps/react-app-remix/tsconfig.json b/apps/react-remix-example/tsconfig.json similarity index 100% rename from apps/react-app-remix/tsconfig.json rename to apps/react-remix-example/tsconfig.json diff --git a/apps/react-app-remix/vite.config.ts b/apps/react-remix-example/vite.config.ts similarity index 72% rename from apps/react-app-remix/vite.config.ts rename to apps/react-remix-example/vite.config.ts index d7e81f0c..6d4a74dd 100644 --- a/apps/react-app-remix/vite.config.ts +++ b/apps/react-remix-example/vite.config.ts @@ -1,8 +1,10 @@ import path from "node:path" import { vitePlugin as remix } from "@remix-run/dev" import { defineConfig } from "vite" +import { fileURLToPath } from "node:url" export default defineConfig({ + root: fileURLToPath(new URL(".", import.meta.url)), plugins: [remix()], resolve: { alias: { diff --git a/apps/react-app-router-fm/.gitignore b/apps/react-router-example/.gitignore similarity index 100% rename from apps/react-app-router-fm/.gitignore rename to apps/react-router-example/.gitignore diff --git a/apps/react-app-router-fm/app/app-nav.tsx b/apps/react-router-example/app/app-nav.tsx similarity index 100% rename from apps/react-app-router-fm/app/app-nav.tsx rename to apps/react-router-example/app/app-nav.tsx diff --git a/apps/react-app-router-fm/app/app.module.css b/apps/react-router-example/app/app.module.css similarity index 100% rename from apps/react-app-router-fm/app/app.module.css rename to apps/react-router-example/app/app.module.css diff --git a/apps/react-app-router-fm/app/app.tsx b/apps/react-router-example/app/app.tsx similarity index 100% rename from apps/react-app-router-fm/app/app.tsx rename to apps/react-router-example/app/app.tsx diff --git a/apps/react-app-router-fm/app/entry.client.tsx b/apps/react-router-example/app/entry.client.tsx similarity index 100% rename from apps/react-app-router-fm/app/entry.client.tsx rename to apps/react-router-example/app/entry.client.tsx diff --git a/apps/react-app-router-fm/app/entry.server.tsx b/apps/react-router-example/app/entry.server.tsx similarity index 100% rename from apps/react-app-router-fm/app/entry.server.tsx rename to apps/react-router-example/app/entry.server.tsx diff --git a/apps/react-app-router-fm/app/lib/auth-client.ts b/apps/react-router-example/app/lib/auth-client.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/auth-client.ts rename to apps/react-router-example/app/lib/auth-client.ts diff --git a/apps/react-app-router-fm/app/lib/better-auth-options.server.ts b/apps/react-router-example/app/lib/better-auth-options.server.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/better-auth-options.server.ts rename to apps/react-router-example/app/lib/better-auth-options.server.ts diff --git a/apps/react-app-router-fm/app/lib/http/auth-middleware.server.ts b/apps/react-router-example/app/lib/http/auth-middleware.server.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/http/auth-middleware.server.ts rename to apps/react-router-example/app/lib/http/auth-middleware.server.ts diff --git a/apps/react-app-router-fm/app/lib/http/http.server.ts b/apps/react-router-example/app/lib/http/http.server.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/http/http.server.ts rename to apps/react-router-example/app/lib/http/http.server.ts diff --git a/apps/react-app-router-fm/app/lib/prisma.ts b/apps/react-router-example/app/lib/prisma.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/prisma.ts rename to apps/react-router-example/app/lib/prisma.ts diff --git a/apps/react-app-router-fm/app/lib/runtime.server.ts b/apps/react-router-example/app/lib/runtime.server.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/runtime.server.ts rename to apps/react-router-example/app/lib/runtime.server.ts diff --git a/apps/react-app-router-fm/app/lib/script-prisma-test.ts b/apps/react-router-example/app/lib/script-prisma-test.ts similarity index 100% rename from apps/react-app-router-fm/app/lib/script-prisma-test.ts rename to apps/react-router-example/app/lib/script-prisma-test.ts diff --git a/apps/react-app-router-fm/app/root.tsx b/apps/react-router-example/app/root.tsx similarity index 100% rename from apps/react-app-router-fm/app/root.tsx rename to apps/react-router-example/app/root.tsx diff --git a/apps/react-app-router-fm/app/routes.tsx b/apps/react-router-example/app/routes.tsx similarity index 100% rename from apps/react-app-router-fm/app/routes.tsx rename to apps/react-router-example/app/routes.tsx diff --git a/apps/react-app-router-fm/app/routes/api.auth.ts b/apps/react-router-example/app/routes/api.auth.ts similarity index 100% rename from apps/react-app-router-fm/app/routes/api.auth.ts rename to apps/react-router-example/app/routes/api.auth.ts diff --git a/apps/react-app-router-fm/app/routes/api.ts b/apps/react-router-example/app/routes/api.ts similarity index 100% rename from apps/react-app-router-fm/app/routes/api.ts rename to apps/react-router-example/app/routes/api.ts diff --git a/apps/react-app-router-fm/app/routes/login.tsx b/apps/react-router-example/app/routes/login.tsx similarity index 100% rename from apps/react-app-router-fm/app/routes/login.tsx rename to apps/react-router-example/app/routes/login.tsx diff --git a/apps/react-app-router-fm/app/routes/signup.tsx b/apps/react-router-example/app/routes/signup.tsx similarity index 100% rename from apps/react-app-router-fm/app/routes/signup.tsx rename to apps/react-router-example/app/routes/signup.tsx diff --git a/apps/react-app-router-fm/app/routes/todo-app.tsx b/apps/react-router-example/app/routes/todo-app.tsx similarity index 100% rename from apps/react-app-router-fm/app/routes/todo-app.tsx rename to apps/react-router-example/app/routes/todo-app.tsx diff --git a/apps/react-app-router-fm/app/sqlite.db b/apps/react-router-example/app/sqlite.db similarity index 100% rename from apps/react-app-router-fm/app/sqlite.db rename to apps/react-router-example/app/sqlite.db diff --git a/apps/react-app-router-fm/better-auth_migrations/2025-11-22T04-27-51.619Z.sql b/apps/react-router-example/better-auth_migrations/2025-11-22T04-27-51.619Z.sql similarity index 100% rename from apps/react-app-router-fm/better-auth_migrations/2025-11-22T04-27-51.619Z.sql rename to apps/react-router-example/better-auth_migrations/2025-11-22T04-27-51.619Z.sql diff --git a/apps/react-app-router-fm/better-auth_migrations/2025-11-23T05-47-31.745Z.sql b/apps/react-router-example/better-auth_migrations/2025-11-23T05-47-31.745Z.sql similarity index 100% rename from apps/react-app-router-fm/better-auth_migrations/2025-11-23T05-47-31.745Z.sql rename to apps/react-router-example/better-auth_migrations/2025-11-23T05-47-31.745Z.sql diff --git a/apps/react-app-router-fm/docker-compose.yml b/apps/react-router-example/docker-compose.yml similarity index 100% rename from apps/react-app-router-fm/docker-compose.yml rename to apps/react-router-example/docker-compose.yml diff --git a/apps/react-app-router-fm/package.json b/apps/react-router-example/package.json similarity index 94% rename from apps/react-app-router-fm/package.json rename to apps/react-router-example/package.json index 78d7d3e9..de235cec 100644 --- a/apps/react-app-router-fm/package.json +++ b/apps/react-router-example/package.json @@ -1,5 +1,5 @@ { - "name": "react-app-router-fm", + "name": "@effectify/react-router-example", "private": true, "type": "module", "scripts": { @@ -8,11 +8,6 @@ "dev": "react-router dev" }, "sideEffects": false, - "pnpm": { - "overrides": { - "vite": "7.1.7" - } - }, "dependencies": { "@effect/experimental": "catalog:", "@effect/platform": "catalog:", diff --git a/apps/react-app-router-fm/prisma.config.ts b/apps/react-router-example/prisma.config.ts similarity index 100% rename from apps/react-app-router-fm/prisma.config.ts rename to apps/react-router-example/prisma.config.ts diff --git a/apps/react-app-router-fm/prisma/migrations/20251126024643_init/migration.sql b/apps/react-router-example/prisma/migrations/20251126024643_init/migration.sql similarity index 100% rename from apps/react-app-router-fm/prisma/migrations/20251126024643_init/migration.sql rename to apps/react-router-example/prisma/migrations/20251126024643_init/migration.sql diff --git a/apps/react-app-router-fm/prisma/migrations/migration_lock.toml b/apps/react-router-example/prisma/migrations/migration_lock.toml similarity index 100% rename from apps/react-app-router-fm/prisma/migrations/migration_lock.toml rename to apps/react-router-example/prisma/migrations/migration_lock.toml diff --git a/apps/react-app-router-fm/prisma/schema.prisma b/apps/react-router-example/prisma/schema.prisma similarity index 100% rename from apps/react-app-router-fm/prisma/schema.prisma rename to apps/react-router-example/prisma/schema.prisma diff --git a/apps/react-app-router-fm/project.json b/apps/react-router-example/project.json similarity index 78% rename from apps/react-app-router-fm/project.json rename to apps/react-router-example/project.json index a04d6a99..342eae8b 100644 --- a/apps/react-app-router-fm/project.json +++ b/apps/react-router-example/project.json @@ -1,16 +1,16 @@ { - "name": "react-app-router-fm", + "name": "@effectify/react-router-example", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/react-app-router-fm/src", + "sourceRoot": "apps/react-router-example/src", "projectType": "application", "tags": [], - "// targets": "to see all targets run: nx show project react-app-router-fm --web", + "// targets": "to see all targets run: nx show project react-router-example --web", "targets": { "typecheck": { "executor": "nx:run-commands", "options": { "command": "tsc", - "cwd": "apps/react-app-router-fm" + "cwd": "apps/react-router-example" }, "dependsOn": [ "typegen" @@ -20,7 +20,7 @@ "executor": "nx:run-commands", "options": { "command": "react-router typegen", - "cwd": "apps/react-app-router-fm" + "cwd": "apps/react-router-example" }, "dependsOn": [ "prisma-generate" @@ -30,7 +30,7 @@ "executor": "nx:run-commands", "options": { "command": "prisma generate", - "cwd": "apps/react-app-router-fm" + "cwd": "apps/react-router-example" }, "cache": true, "inputs": [ @@ -52,7 +52,7 @@ "outputs": ["{options.outputPath}"], "defaultConfiguration": "production", "options": { - "outputPath": "dist/apps/react-app-router-fm" + "outputPath": "dist/apps/react-router-example" }, "configurations": { "development": { diff --git a/apps/react-app-router-fm/public/favicon.ico b/apps/react-router-example/public/favicon.ico similarity index 100% rename from apps/react-app-router-fm/public/favicon.ico rename to apps/react-router-example/public/favicon.ico diff --git a/apps/react-app-router-fm/react-router.config.ts b/apps/react-router-example/react-router.config.ts similarity index 100% rename from apps/react-app-router-fm/react-router.config.ts rename to apps/react-router-example/react-router.config.ts diff --git a/apps/react-app-router-fm/styles.css b/apps/react-router-example/styles.css similarity index 100% rename from apps/react-app-router-fm/styles.css rename to apps/react-router-example/styles.css diff --git a/apps/react-app-router-fm/tsconfig.app.json b/apps/react-router-example/tsconfig.app.json similarity index 100% rename from apps/react-app-router-fm/tsconfig.app.json rename to apps/react-router-example/tsconfig.app.json diff --git a/apps/react-app-router-fm/tsconfig.json b/apps/react-router-example/tsconfig.json similarity index 100% rename from apps/react-app-router-fm/tsconfig.json rename to apps/react-router-example/tsconfig.json diff --git a/apps/react-app-router-fm/tsconfig.test.json b/apps/react-router-example/tsconfig.test.json similarity index 100% rename from apps/react-app-router-fm/tsconfig.test.json rename to apps/react-router-example/tsconfig.test.json diff --git a/apps/react-app-router-fm/vite.config.ts b/apps/react-router-example/vite.config.ts similarity index 73% rename from apps/react-app-router-fm/vite.config.ts rename to apps/react-router-example/vite.config.ts index 610c6973..fa0b5cba 100644 --- a/apps/react-app-router-fm/vite.config.ts +++ b/apps/react-router-example/vite.config.ts @@ -5,14 +5,14 @@ import { fileURLToPath } from "node:url" import { nxCopyAssetsPlugin } from "@nx/vite/plugins/nx-copy-assets.plugin" import { nxViteTsPaths } from "@nx/vite/plugins/nx-tsconfig-paths.plugin" import { reactRouter } from "@react-router/dev/vite" -import { defineConfig } from "vite" +import { defineConfig, Plugin } from "vite" const __filename = fileURLToPath(import.meta.url) const __dirname = dirname(__filename) const plugins = [ ...(process.env.VITEST ? [] : [reactRouter()]), - nxViteTsPaths(), + nxViteTsPaths() as Plugin, nxCopyAssetsPlugin([ { // Copy all markdown files from the root of the project @@ -21,18 +21,6 @@ const plugins = [ output: ".", }, ]), - { - name: "ignore-chrome-devtools", - configureServer(server) { - server.middlewares.use((req, res, next) => { - if (req.url?.startsWith("/.well-known/appspecific")) { - res.statusCode = 204 - return res.end() - } - next() - }) - }, - }, ].filter(Boolean) export default defineConfig({ @@ -46,7 +34,6 @@ export default defineConfig({ port: 3000, host: "localhost", }, - // @ts-expect-error - Multiple Vite versions causing type incompatibility plugins, // Uncomment this if you are using workers. // worker: { diff --git a/apps/solid-app-start/package.json b/apps/solid-app-start/package.json deleted file mode 100644 index 7566cc19..00000000 --- a/apps/solid-app-start/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@effectify/solid-app-start", - "private": true, - "type": "module", - "scripts": { - "dev": "vite dev --port 3000", - "start": "node .output/server/index.mjs", - "build": "vite build", - "serve": "vite preview", - "test": "vitest run" - }, - "dependencies": { - "@effectify/solid-query": "workspace:*", - "@effectify/solid-ui": "workspace:*", - "@effectify/chat-solid": "workspace:*", - "@corvu/drawer": "catalog:", - "@kobalte/core": "^0.13.10", - "@tailwindcss/vite": "catalog:", - "@tanstack/router-plugin": "catalog:", - "@tanstack/solid-form": "catalog:", - "@tanstack/solid-router": "catalog:", - "@tanstack/solid-router-devtools": "catalog:", - "@tanstack/solid-start": "catalog:", - "better-auth": "catalog:", - "class-variance-authority": "catalog:", - "clsx": "catalog:", - "lucide-solid": "catalog:", - "solid-js": "catalog:", - "tailwind-merge": "catalog:", - "tailwindcss": "catalog:", - "tailwindcss-animate": "catalog:", - "vite-tsconfig-paths": "catalog:" - }, - "devDependencies": { - "typescript": "catalog:", - "vite": "catalog:", - "vite-plugin-solid": "catalog:" - }, - "peerDependencies": {}, - "optionalDependencies": {} -} diff --git a/apps/solid-app-start/project.json b/apps/solid-app-start/project.json deleted file mode 100644 index 2e387c35..00000000 --- a/apps/solid-app-start/project.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "./../../node_modules/nx/schemas/project-schema.json", - "name": "@effectify/solid-app-start", - "projectType": "application", - "sourceRoot": "apps/solid-app-start/src", - "targets": { - "build": { - "executor": "nx:run-commands", - "options": { - "command": "vite build", - "cwd": "apps/solid-app-start" - } - }, - "dev:watch": { - "executor": "nx:run-commands", - "options": { - "commands": ["vite", "nx run @effectify/solid-app-start:watch-deps "], - "cwd": "apps/solid-app-start", - "parallel": true - } - }, - "dev:server:watch": { - "executor": "nx:run-commands", - "options": { - "commands": [ - "nx serve @effectify/node-auth-app", - "vite", - "nx run @effectify/solid-app-start:watch-deps " - ], - "cwd": "apps/solid-app-start", - "parallel": true - } - } - }, - "targets": { - "lint": { - "executor": "nx-oxlint:lint", - "options": { - "lintFilePatterns": [ - "apps/solid-app-start/**/*.{ts,tsx,js,jsx}", - "!apps/solid-app-start/src/routeTree.gen.ts" - ] - } - } - }, - "tags": ["solid-start"] -} diff --git a/apps/solid-app-start/src/components/default-error-bundaries.tsx b/apps/solid-app-start/src/components/default-error-bundaries.tsx deleted file mode 100644 index 76650766..00000000 --- a/apps/solid-app-start/src/components/default-error-bundaries.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import type { ErrorComponentProps } from "@tanstack/solid-router" -import { ErrorComponent, Link, rootRouteId, useMatch, useRouter } from "@tanstack/solid-router" - -export function DefaultCatchBoundary({ error }: ErrorComponentProps) { - const router = useRouter() - const isRoot = useMatch({ - strict: false, - select: (state) => state.id === rootRouteId, - }) - - console.error("DefaultCatchBoundary Error:", error) - - return ( -
- -
- - {isRoot() ? - ( - - Home - - ) : - ( - { - e.preventDefault() - window.history.back() - }} - to="/" - > - Go Back - - )} -
-
- ) -} diff --git a/apps/solid-app-start/src/hooks/check-session-hook.ts b/apps/solid-app-start/src/hooks/check-session-hook.ts deleted file mode 100644 index 907d50f1..00000000 --- a/apps/solid-app-start/src/hooks/check-session-hook.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { useNavigate } from "@tanstack/solid-router" -import { createEffect } from "solid-js" -import { useSession } from "@/libs/auth-client" - -export const useCheckSession = () => { - const navigate = useNavigate() - const session = useSession() - - createEffect(() => { - if (session().data?.session) { - navigate({ to: "/dashboard" }) - } else if (!session().isPending) { - navigate({ to: "/login" }) - } - }) -} diff --git a/apps/solid-app-start/src/libs/auth-client.ts b/apps/solid-app-start/src/libs/auth-client.ts deleted file mode 100644 index 91b8f469..00000000 --- a/apps/solid-app-start/src/libs/auth-client.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createAuthClient } from "better-auth/solid" - -export const authClient = createAuthClient({ - /** The base URL of the server (optional if you're using the same domain) */ - baseURL: "http://localhost:3001/api/auth", -}) - -export const { useSession } = authClient diff --git a/apps/solid-app-start/src/routeTree.gen.ts b/apps/solid-app-start/src/routeTree.gen.ts deleted file mode 100644 index d74f2cb8..00000000 --- a/apps/solid-app-start/src/routeTree.gen.ts +++ /dev/null @@ -1,179 +0,0 @@ -/* eslint-disable */ - -// @ts-nocheck - -// noinspection JSUnusedGlobalSymbols - -// This file was automatically generated by TanStack Router. -// You should NOT make any changes in this file as it will be overwritten. -// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. - -import { Route as rootRouteImport } from './routes/__root' -import { Route as protectedLayoutRouteImport } from './routes/(protected)/layout' -import { Route as authLayoutRouteImport } from './routes/(auth)/layout' -import { Route as IndexRouteImport } from './routes/index' -import { Route as authRegisterRouteImport } from './routes/(auth)/register' -import { Route as authLoginRouteImport } from './routes/(auth)/login' -import { Route as protectedDashboardIndexRouteImport } from './routes/(protected)/dashboard/index' - -const protectedLayoutRoute = protectedLayoutRouteImport.update({ - id: '/(protected)', - getParentRoute: () => rootRouteImport, -} as any) -const authLayoutRoute = authLayoutRouteImport.update({ - id: '/(auth)', - getParentRoute: () => rootRouteImport, -} as any) -const IndexRoute = IndexRouteImport.update({ - id: '/', - path: '/', - getParentRoute: () => rootRouteImport, -} as any) -const authRegisterRoute = authRegisterRouteImport.update({ - id: '/register', - path: '/register', - getParentRoute: () => authLayoutRoute, -} as any) -const authLoginRoute = authLoginRouteImport.update({ - id: '/login', - path: '/login', - getParentRoute: () => authLayoutRoute, -} as any) -const protectedDashboardIndexRoute = protectedDashboardIndexRouteImport.update({ - id: '/dashboard/', - path: '/dashboard/', - getParentRoute: () => protectedLayoutRoute, -} as any) - -export interface FileRoutesByFullPath { - '/': typeof IndexRoute - '/login': typeof authLoginRoute - '/register': typeof authRegisterRoute - '/dashboard': typeof protectedDashboardIndexRoute -} -export interface FileRoutesByTo { - '/': typeof IndexRoute - '/login': typeof authLoginRoute - '/register': typeof authRegisterRoute - '/dashboard': typeof protectedDashboardIndexRoute -} -export interface FileRoutesById { - __root__: typeof rootRouteImport - '/': typeof IndexRoute - '/(auth)': typeof authLayoutRouteWithChildren - '/(protected)': typeof protectedLayoutRouteWithChildren - '/(auth)/login': typeof authLoginRoute - '/(auth)/register': typeof authRegisterRoute - '/(protected)/dashboard/': typeof protectedDashboardIndexRoute -} -export interface FileRouteTypes { - fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' | '/login' | '/register' | '/dashboard' - fileRoutesByTo: FileRoutesByTo - to: '/' | '/login' | '/register' | '/dashboard' - id: - | '__root__' - | '/' - | '/(auth)' - | '/(protected)' - | '/(auth)/login' - | '/(auth)/register' - | '/(protected)/dashboard/' - fileRoutesById: FileRoutesById -} -export interface RootRouteChildren { - IndexRoute: typeof IndexRoute - authLayoutRoute: typeof authLayoutRouteWithChildren - protectedLayoutRoute: typeof protectedLayoutRouteWithChildren -} - -declare module '@tanstack/solid-router' { - interface FileRoutesByPath { - '/(protected)': { - id: '/(protected)' - path: '' - fullPath: '' - preLoaderRoute: typeof protectedLayoutRouteImport - parentRoute: typeof rootRouteImport - } - '/(auth)': { - id: '/(auth)' - path: '' - fullPath: '' - preLoaderRoute: typeof authLayoutRouteImport - parentRoute: typeof rootRouteImport - } - '/': { - id: '/' - path: '/' - fullPath: '/' - preLoaderRoute: typeof IndexRouteImport - parentRoute: typeof rootRouteImport - } - '/(auth)/register': { - id: '/(auth)/register' - path: '/register' - fullPath: '/register' - preLoaderRoute: typeof authRegisterRouteImport - parentRoute: typeof authLayoutRoute - } - '/(auth)/login': { - id: '/(auth)/login' - path: '/login' - fullPath: '/login' - preLoaderRoute: typeof authLoginRouteImport - parentRoute: typeof authLayoutRoute - } - '/(protected)/dashboard/': { - id: '/(protected)/dashboard/' - path: '/dashboard' - fullPath: '/dashboard' - preLoaderRoute: typeof protectedDashboardIndexRouteImport - parentRoute: typeof protectedLayoutRoute - } - } -} - -interface authLayoutRouteChildren { - authLoginRoute: typeof authLoginRoute - authRegisterRoute: typeof authRegisterRoute -} - -const authLayoutRouteChildren: authLayoutRouteChildren = { - authLoginRoute: authLoginRoute, - authRegisterRoute: authRegisterRoute, -} - -const authLayoutRouteWithChildren = authLayoutRoute._addFileChildren( - authLayoutRouteChildren, -) - -interface protectedLayoutRouteChildren { - protectedDashboardIndexRoute: typeof protectedDashboardIndexRoute -} - -const protectedLayoutRouteChildren: protectedLayoutRouteChildren = { - protectedDashboardIndexRoute: protectedDashboardIndexRoute, -} - -const protectedLayoutRouteWithChildren = protectedLayoutRoute._addFileChildren( - protectedLayoutRouteChildren, -) - -const rootRouteChildren: RootRouteChildren = { - IndexRoute: IndexRoute, - authLayoutRoute: authLayoutRouteWithChildren, - protectedLayoutRoute: protectedLayoutRouteWithChildren, -} -export const routeTree = rootRouteImport - ._addFileChildren(rootRouteChildren) - ._addFileTypes() - -import type { getRouter } from './router.tsx' -import type { createStart } from '@tanstack/solid-start' -declare module '@tanstack/solid-start' { - interface Register { - ssr: true - router: Awaited> - } -} diff --git a/apps/solid-app-start/src/router.tsx b/apps/solid-app-start/src/router.tsx deleted file mode 100644 index bb91f2c4..00000000 --- a/apps/solid-app-start/src/router.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { createRouter } from "@tanstack/solid-router" -import { DefaultCatchBoundary } from "./components/default-error-bundaries" -import { routeTree } from "./routeTree.gen" - -import "./styles.css" - -export function getRouter() { - const router = createRouter({ - routeTree, - defaultPreload: "intent", - defaultErrorComponent: DefaultCatchBoundary, - defaultNotFoundComponent: () => <>error, - scrollRestoration: true, - }) - - return router -} diff --git a/apps/solid-app-start/src/routes/(auth)/layout.tsx b/apps/solid-app-start/src/routes/(auth)/layout.tsx deleted file mode 100644 index 612f2baf..00000000 --- a/apps/solid-app-start/src/routes/(auth)/layout.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { Flex } from "@effectify/solid-ui/components/primitives/flex" -import { VStack } from "@effectify/solid-ui/components/primitives/stack" -import { createFileRoute, Outlet } from "@tanstack/solid-router" - -export const Route = createFileRoute("/(auth)")({ - component: Layout, -}) - -function Layout() { - // useCheckSession() - return ( - -