Feature/Use fastify instead of express #1

Merged
jusemon merged 2 commits from dev into main 2025-03-06 19:15:56 -05:00
16 changed files with 130 additions and 1948 deletions
Showing only changes of commit a3700a0068 - Show all commits

3
.gitignore vendored
View file

@ -33,6 +33,9 @@ npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
.vscode/*
!.vscode/settings.json
# Misc # Misc
.DS_Store .DS_Store
*.pem *.pem

3
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib"
}

View file

@ -10,9 +10,9 @@
"test": "ts-node --test test/**/*.test.ts", "test": "ts-node --test test/**/*.test.ts",
"start": "node dist/index.js", "start": "node dist/index.js",
"dev": "nodemon --delay 2000ms src/index.ts", "dev": "nodemon --delay 2000ms src/index.ts",
"prisma:generate": "dotenv -e ../../.env -- prisma generate", "prisma:generate": "prisma generate",
"prisma:migrate": "dotenv -e ../../.env -- prisma migrate dev", "prisma:migrate": "prisma migrate dev",
"prisma:init": "dotenv -e ../../.env -- prisma migrate dev --name init", "prisma:init": "prisma migrate dev --name init",
"build": "tsc" "build": "tsc"
}, },
"keywords": [], "keywords": [],
@ -33,6 +33,7 @@
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "*", "@repo/eslint-config": "*",
"@repo/typescript-config": "*", "@repo/typescript-config": "*",
"typescript": "5.8.2",
"prisma": "^6.4.1" "prisma": "^6.4.1"
} }
} }

View file

@ -16,6 +16,8 @@
"zod": "^3.24.2" "zod": "^3.24.2"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"typescript": "5.8.2", "typescript": "5.8.2",
"vite": "^6.2.0", "vite": "^6.2.0",
"vite-plugin-solid": "^2.11.2" "vite-plugin-solid": "^2.11.2"

1988
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,6 @@
import js from '@eslint/js'; import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import turboPlugin from 'eslint-plugin-turbo'; import turboPlugin from 'eslint-plugin-turbo';
import tseslint from 'typescript-eslint'; import tseslint from 'typescript-eslint';
import onlyWarn from 'eslint-plugin-only-warn';
/** /**
* A shared ESLint configuration for the repository. * A shared ESLint configuration for the repository.
@ -11,7 +9,6 @@ import onlyWarn from 'eslint-plugin-only-warn';
* */ * */
export const config = [ export const config = [
js.configs.recommended, js.configs.recommended,
eslintConfigPrettier,
...tseslint.configs.recommended, ...tseslint.configs.recommended,
{ {
plugins: { plugins: {
@ -21,11 +18,6 @@ export const config = [
'turbo/no-undeclared-env-vars': 'warn', 'turbo/no-undeclared-env-vars': 'warn',
}, },
}, },
{
plugins: {
onlyWarn,
},
},
{ {
ignores: ['dist/**'], ignores: ['dist/**'],
}, },

View file

@ -9,14 +9,10 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.21.0", "@eslint/js": "^9.21.0",
"@next/eslint-plugin-next": "^15.2.1", "@typescript-eslint/parser": "^8.26.0",
"eslint": "^9.21.0", "eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.2", "eslint-plugin-solid": "^0.14.5",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-turbo": "^2.4.4", "eslint-plugin-turbo": "^2.4.4",
"globals": "^16.0.0",
"typescript": "^5.8.2", "typescript": "^5.8.2",
"typescript-eslint": "^8.26.0" "typescript-eslint": "^8.26.0"
} }

View file

@ -1,7 +1,6 @@
import js from '@eslint/js'; import js from '@eslint/js';
import solid from 'eslint-plugin-solid/configs/typescript'; import solid from 'eslint-plugin-solid/configs/typescript';
import * as tsParser from '@typescript-eslint/parser'; import * as tsParser from '@typescript-eslint/parser';
import eslintConfigPrettier from 'eslint-config-prettier';
import { config as baseConfig } from './base.js'; import { config as baseConfig } from './base.js';
/** /**
@ -11,7 +10,6 @@ import { config as baseConfig } from './base.js';
export const config = [ export const config = [
...baseConfig, ...baseConfig,
js.configs.recommended, js.configs.recommended,
eslintConfigPrettier,
{ {
files: ['**/*.{ts,tsx}'], files: ['**/*.{ts,tsx}'],
...solid, ...solid,

View file

@ -4,5 +4,6 @@
"compilerOptions": { "compilerOptions": {
"jsx": "preserve", "jsx": "preserve",
"jsxImportSource": "solid-js" "jsxImportSource": "solid-js"
} },
"exclude": ["node_modules", "dist"]
} }

View file

@ -1,9 +1,9 @@
"use client"; 'use client';
import { ReactNode } from "react"; import { JSX } from 'solid-js/jsx-runtime';
interface ButtonProps { interface ButtonProps {
children: ReactNode; children: JSX.Element;
className?: string; className?: string;
appName: string; appName: string;
} }
@ -11,7 +11,7 @@ interface ButtonProps {
export const Button = ({ children, className, appName }: ButtonProps) => { export const Button = ({ children, className, appName }: ButtonProps) => {
return ( return (
<button <button
className={className} class={className}
onClick={() => alert(`Hello from your ${appName} app!`)} onClick={() => alert(`Hello from your ${appName} app!`)}
> >
{children} {children}

View file

@ -1,4 +1,4 @@
import { type JSX } from "react"; import { type JSX } from 'solid-js/jsx-runtime';
export function Card({ export function Card({
className, className,
@ -8,15 +8,15 @@ export function Card({
}: { }: {
className?: string; className?: string;
title: string; title: string;
children: React.ReactNode; children: JSX.Element;
href: string; href: string;
}): JSX.Element { }): JSX.Element {
return ( return (
<a <a
className={className} class={className}
href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`} href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
rel="noopener noreferrer" rel='noopener noreferrer'
target="_blank" target='_blank'
> >
<h2> <h2>
{title} <span>-&gt;</span> {title} <span>-&gt;</span>

View file

@ -1,11 +1,11 @@
import { type JSX } from "react"; import { type JSX } from 'solid-js/jsx-runtime';
export function Code({ export function Code({
children, children,
className, className,
}: { }: {
children: React.ReactNode; children: JSX.Element;
className?: string; className?: string;
}): JSX.Element { }): JSX.Element {
return <code className={className}>{children}</code>; return <code class={className}>{children}</code>;
} }

View file

@ -3,6 +3,5 @@
"compilerOptions": { "compilerOptions": {
"outDir": "dist" "outDir": "dist"
}, },
"include": ["src"], "include": ["src"]
"exclude": ["node_modules", "dist"]
} }

View file

@ -1,27 +1,27 @@
import type { PlopTypes } from "@turbo/gen"; import type { PlopTypes } from '@turbo/gen';
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation // Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
export default function generator(plop: PlopTypes.NodePlopAPI): void { export default function generator(plop: PlopTypes.NodePlopAPI): void {
// A simple generator to add a new React component to the internal UI library // A simple generator to add a new React component to the internal UI library
plop.setGenerator("react-component", { plop.setGenerator('solid-component', {
description: "Adds a new react component", description: 'Adds a new solid component',
prompts: [ prompts: [
{ {
type: "input", type: 'input',
name: "name", name: 'name',
message: "What is the name of the component?", message: 'What is the name of the component?',
}, },
], ],
actions: [ actions: [
{ {
type: "add", type: 'add',
path: "src/{{kebabCase name}}.tsx", path: 'src/{{kebabCase name}}.tsx',
templateFile: "templates/component.hbs", templateFile: 'templates/component.hbs',
}, },
{ {
type: "append", type: 'append',
path: "package.json", path: 'package.json',
pattern: /"exports": {(?<insertion>)/g, pattern: /"exports": {(?<insertion>)/g,
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",', template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
}, },

View file

@ -1,4 +1,4 @@
export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => { export const {{ pascalCase name }} = ({ children }: { children: JSX.Element }) => {
return ( return (
<div> <div>
<h1>{{ pascalCase name }} Component</h1> <h1>{{ pascalCase name }} Component</h1>

View file

@ -1,11 +1,12 @@
{ {
"$schema": "https://turbo.build/schema.json", "$schema": "https://turbo.build/schema.json",
"ui": "tui", "ui": "tui",
"globalDependencies": [".env"],
"globalEnv": ["NODE_ENV", "DATABASE_URL", "VITE_API_URL", "VITE_WS_URL"], "globalEnv": ["NODE_ENV", "DATABASE_URL", "VITE_API_URL", "VITE_WS_URL"],
"tasks": { "tasks": {
"build": { "build": {
"dependsOn": ["^build"], "dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"], "inputs": [".env*"],
"outputs": ["dist/**"] "outputs": ["dist/**"]
}, },
"lint": { "lint": {