Initial commit for project Spoon!
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
import * as path from 'node:path';
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import eslint from '@eslint/js';
|
||||
import importPlugin from 'eslint-plugin-import';
|
||||
// eslint-plugin-prefer-arrow-functions doesn't ship flat config types — cast needed
|
||||
import preferArrowFunctions from 'eslint-plugin-prefer-arrow-functions';
|
||||
import turboPlugin from 'eslint-plugin-turbo';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const preferArrowPlugin = preferArrowFunctions as any;
|
||||
|
||||
const turboRecommendedRules = (
|
||||
turboPlugin as unknown as {
|
||||
configs: { recommended: { rules: Record<string, string> } };
|
||||
}
|
||||
).configs.recommended.rules;
|
||||
|
||||
/**
|
||||
* All packages that leverage t3-env should use this rule
|
||||
*/
|
||||
export const restrictEnvAccess = defineConfig(
|
||||
{ ignores: ['**/env.ts'] },
|
||||
{
|
||||
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
|
||||
rules: {
|
||||
'no-restricted-properties': [
|
||||
'error',
|
||||
{
|
||||
object: 'process',
|
||||
property: 'env',
|
||||
message:
|
||||
"Use `import { env } from '@/env'` instead to ensure validated types.",
|
||||
},
|
||||
],
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
name: 'process',
|
||||
importNames: ['env'],
|
||||
message:
|
||||
"Use `import { env } from '@/env'` instead to ensure validated types.",
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
export const baseConfig = defineConfig(
|
||||
// Ignore files not tracked by VCS and any config files
|
||||
includeIgnoreFile(path.join(import.meta.dirname, '../../.gitignore')),
|
||||
{ ignores: ['**/*.config.*'] },
|
||||
{
|
||||
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
|
||||
plugins: {
|
||||
import: importPlugin,
|
||||
turbo: turboPlugin,
|
||||
'prefer-arrow-functions': preferArrowPlugin,
|
||||
},
|
||||
extends: [
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
...tseslint.configs.recommendedTypeChecked,
|
||||
...tseslint.configs.stylisticTypeChecked,
|
||||
],
|
||||
rules: {
|
||||
...turboRecommendedRules,
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'warn',
|
||||
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
|
||||
],
|
||||
'@typescript-eslint/no-misused-promises': [
|
||||
2,
|
||||
{ checksVoidReturn: { attributes: false } },
|
||||
],
|
||||
'@typescript-eslint/no-unnecessary-condition': [
|
||||
'error',
|
||||
{
|
||||
allowConstantLoopConditions: true,
|
||||
},
|
||||
],
|
||||
'@typescript-eslint/no-non-null-assertion': 'error',
|
||||
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||
'prefer-arrow-functions/prefer-arrow-functions': [
|
||||
'warn',
|
||||
{
|
||||
allowNamedFunctions: false,
|
||||
classPropertiesAllowed: false,
|
||||
disallowPrototype: false,
|
||||
returnStyle: 'unchanged',
|
||||
singleReturnOnly: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
files: [
|
||||
'**/tests/**/*.{ts,tsx}',
|
||||
'**/*.test.{ts,tsx}',
|
||||
'**/*.spec.{ts,tsx}',
|
||||
],
|
||||
rules: {
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||
'@typescript-eslint/no-unsafe-call': 'off',
|
||||
'@typescript-eslint/no-unsafe-return': 'off',
|
||||
'@typescript-eslint/no-unsafe-argument': 'off',
|
||||
'@typescript-eslint/no-unnecessary-condition': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
linterOptions: { reportUnusedDisableDirectives: true },
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
import nextPlugin from '@next/eslint-plugin-next';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
export const nextjsConfig = defineConfig({
|
||||
files: ['**/*.ts', '**/*.tsx'],
|
||||
plugins: {
|
||||
'@next/next': nextPlugin,
|
||||
},
|
||||
rules: {
|
||||
...nextPlugin.configs.recommended.rules,
|
||||
...nextPlugin.configs['core-web-vitals'].rules,
|
||||
// TypeError: context.getAncestors is not a function
|
||||
'@next/next/no-duplicate-head': 'off',
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "@spoon/eslint-config",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./base": "./base.ts",
|
||||
"./nextjs": "./nextjs.ts",
|
||||
"./react": "./react.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@eslint/compat": "^2.0.3",
|
||||
"@eslint/js": "catalog:",
|
||||
"@next/eslint-plugin-next": "^16.2.1",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.10.2",
|
||||
"eslint-plugin-prefer-arrow-functions": "^3.9.1",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-turbo": "^2.8.20",
|
||||
"typescript-eslint": "^8.57.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@spoon/prettier-config": "workspace:*",
|
||||
"@spoon/tsconfig": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"prettier": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"prettier": "@spoon/prettier-config"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import type { Linter } from 'eslint';
|
||||
import reactPlugin from 'eslint-plugin-react';
|
||||
import reactHooks from 'eslint-plugin-react-hooks';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
const reactFlat = reactPlugin.configs.flat as Record<string, Linter.Config>;
|
||||
|
||||
export const reactConfig = defineConfig(
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx'],
|
||||
...reactFlat.recommended,
|
||||
...reactFlat['jsx-runtime'],
|
||||
languageOptions: {
|
||||
...reactFlat.recommended?.languageOptions,
|
||||
...reactFlat['jsx-runtime']?.languageOptions,
|
||||
globals: {
|
||||
React: 'writable',
|
||||
},
|
||||
},
|
||||
},
|
||||
reactHooks.configs.flat['recommended-latest']!,
|
||||
);
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "@spoon/tsconfig/base.json",
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/** @typedef {import("prettier").Config} PrettierConfig */
|
||||
/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */
|
||||
/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */
|
||||
|
||||
/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */
|
||||
const config = {
|
||||
singleQuote: true,
|
||||
jsxSingleQuote: true,
|
||||
trailingComma: 'all',
|
||||
tabWidth: 2,
|
||||
printWidth: 80,
|
||||
plugins: [
|
||||
'@ianvs/prettier-plugin-sort-imports',
|
||||
'prettier-plugin-tailwindcss',
|
||||
],
|
||||
tailwindFunctions: ['cn', 'cva'],
|
||||
importOrder: [
|
||||
'<TYPES>',
|
||||
'^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
|
||||
'^(next/(.*)$)|^(next$)',
|
||||
'^(expo(.*)$)|^(expo$)',
|
||||
'<THIRD_PARTY_MODULES>',
|
||||
'',
|
||||
'<TYPES>^@spoon',
|
||||
'^@spoon/(.*)$',
|
||||
'',
|
||||
'<TYPES>^[.|..|~]',
|
||||
'^~/',
|
||||
'^[../]',
|
||||
'^[./]',
|
||||
],
|
||||
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
|
||||
importOrderTypeScriptVersion: '5.0.0',
|
||||
overrides: [
|
||||
{
|
||||
files: '*.json.hbs',
|
||||
options: {
|
||||
parser: 'json',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: '*.ts.hbs',
|
||||
options: {
|
||||
parser: 'babel',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@spoon/prettier-config",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
||||
"prettier": "catalog:",
|
||||
"prettier-plugin-tailwindcss": "^0.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@spoon/tsconfig": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"prettier": "@spoon/prettier-config"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "@spoon/tsconfig/base.json",
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { defineConfig } from 'eslint/config';
|
||||
|
||||
import { baseConfig } from '@spoon/eslint-config/base';
|
||||
|
||||
export default defineConfig(baseConfig);
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@spoon/tailwind-config",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./theme": "./theme.css",
|
||||
"./postcss-config": "./postcss-config.js"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"lint": "eslint --flag unstable_native_nodejs_ts_config",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/postcss": "catalog:",
|
||||
"postcss": "^8.5.8",
|
||||
"tailwindcss": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@spoon/eslint-config": "workspace:*",
|
||||
"@spoon/prettier-config": "workspace:*",
|
||||
"@spoon/tsconfig": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"prettier": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
},
|
||||
"prettier": "@spoon/prettier-config"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
plugins: {
|
||||
'@tailwindcss/postcss': {},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,137 @@
|
||||
:root {
|
||||
--background: oklch(0.985 0.004 180);
|
||||
--foreground: oklch(0.18 0.015 250);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.18 0.015 250);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.18 0.015 250);
|
||||
--primary: oklch(0.49 0.12 178);
|
||||
--primary-foreground: oklch(0.99 0.004 180);
|
||||
--secondary: oklch(0.955 0.01 230);
|
||||
--secondary-foreground: oklch(0.22 0.02 250);
|
||||
--muted: oklch(0.95 0.008 235);
|
||||
--muted-foreground: oklch(0.48 0.02 245);
|
||||
--accent: oklch(0.94 0.035 168);
|
||||
--accent-foreground: oklch(0.25 0.06 180);
|
||||
--destructive: oklch(0.58 0.2 25);
|
||||
--destructive-foreground: oklch(0.99 0.004 180);
|
||||
--border: oklch(0.89 0.012 240);
|
||||
--input: oklch(0.89 0.012 240);
|
||||
--ring: oklch(0.56 0.12 178);
|
||||
--chart-1: oklch(0.56 0.12 178);
|
||||
--chart-2: oklch(0.58 0.13 210);
|
||||
--chart-3: oklch(0.62 0.15 145);
|
||||
--chart-4: oklch(0.64 0.14 95);
|
||||
--chart-5: oklch(0.57 0.16 300);
|
||||
--sidebar: oklch(0.975 0.004 220);
|
||||
--sidebar-foreground: oklch(0.18 0.015 250);
|
||||
--sidebar-primary: oklch(0.49 0.12 178);
|
||||
--sidebar-primary-foreground: oklch(0.99 0.004 180);
|
||||
--sidebar-accent: oklch(0.94 0.035 168);
|
||||
--sidebar-accent-foreground: oklch(0.25 0.06 180);
|
||||
--sidebar-border: oklch(0.89 0.012 240);
|
||||
--sidebar-ring: oklch(0.56 0.12 178);
|
||||
--font-sans:
|
||||
var(--font-geist-sans), Inter, ui-sans-serif, system-ui, sans-serif;
|
||||
--font-serif: Georgia, serif;
|
||||
--font-mono: var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace;
|
||||
--radius: 0.5rem;
|
||||
--shadow-2xs: 0 1px 2px 0 hsl(215 28% 17% / 0.04);
|
||||
--shadow-xs: 0 1px 2px 0 hsl(215 28% 17% / 0.06);
|
||||
--shadow-sm: 0 1px 2px 0 hsl(215 28% 17% / 0.08);
|
||||
--shadow: 0 1px 3px 0 hsl(215 28% 17% / 0.1);
|
||||
--shadow-md: 0 4px 10px -4px hsl(215 28% 17% / 0.16);
|
||||
--shadow-lg: 0 10px 20px -8px hsl(215 28% 17% / 0.18);
|
||||
--shadow-xl: 0 18px 35px -12px hsl(215 28% 17% / 0.2);
|
||||
--shadow-2xl: 0 24px 48px -18px hsl(215 28% 17% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
--spacing: 0.25rem;
|
||||
|
||||
@variant dark {
|
||||
--background: oklch(0.16 0.015 250);
|
||||
--foreground: oklch(0.96 0.006 220);
|
||||
--card: oklch(0.2 0.018 250);
|
||||
--card-foreground: oklch(0.96 0.006 220);
|
||||
--popover: oklch(0.2 0.018 250);
|
||||
--popover-foreground: oklch(0.96 0.006 220);
|
||||
--primary: oklch(0.7 0.13 172);
|
||||
--primary-foreground: oklch(0.14 0.02 250);
|
||||
--secondary: oklch(0.26 0.018 250);
|
||||
--secondary-foreground: oklch(0.94 0.006 220);
|
||||
--muted: oklch(0.24 0.018 250);
|
||||
--muted-foreground: oklch(0.7 0.02 235);
|
||||
--accent: oklch(0.28 0.05 175);
|
||||
--accent-foreground: oklch(0.92 0.035 168);
|
||||
--destructive: oklch(0.68 0.18 25);
|
||||
--destructive-foreground: oklch(0.98 0.004 220);
|
||||
--border: oklch(0.31 0.02 250);
|
||||
--input: oklch(0.31 0.02 250);
|
||||
--ring: oklch(0.7 0.13 172);
|
||||
--chart-1: oklch(0.7 0.13 172);
|
||||
--chart-2: oklch(0.72 0.12 210);
|
||||
--chart-3: oklch(0.72 0.13 145);
|
||||
--chart-4: oklch(0.74 0.12 95);
|
||||
--chart-5: oklch(0.72 0.14 300);
|
||||
--sidebar: oklch(0.18 0.015 250);
|
||||
--sidebar-foreground: oklch(0.96 0.006 220);
|
||||
--sidebar-primary: oklch(0.7 0.13 172);
|
||||
--sidebar-primary-foreground: oklch(0.14 0.02 250);
|
||||
--sidebar-accent: oklch(0.28 0.05 175);
|
||||
--sidebar-accent-foreground: oklch(0.92 0.035 168);
|
||||
--sidebar-border: oklch(0.31 0.02 250);
|
||||
--sidebar-ring: oklch(0.7 0.13 172);
|
||||
}
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-card: var(--card);
|
||||
--color-card-foreground: var(--card-foreground);
|
||||
--color-popover: var(--popover);
|
||||
--color-popover-foreground: var(--popover-foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-secondary: var(--secondary);
|
||||
--color-secondary-foreground: var(--secondary-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-accent: var(--accent);
|
||||
--color-accent-foreground: var(--accent-foreground);
|
||||
--color-destructive: var(--destructive);
|
||||
--color-destructive-foreground: var(--destructive-foreground);
|
||||
--color-border: var(--border);
|
||||
--color-input: var(--input);
|
||||
--color-ring: var(--ring);
|
||||
--color-chart-1: var(--chart-1);
|
||||
--color-chart-2: var(--chart-2);
|
||||
--color-chart-3: var(--chart-3);
|
||||
--color-chart-4: var(--chart-4);
|
||||
--color-chart-5: var(--chart-5);
|
||||
--color-sidebar: var(--sidebar);
|
||||
--color-sidebar-foreground: var(--sidebar-foreground);
|
||||
--color-sidebar-primary: var(--sidebar-primary);
|
||||
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
||||
--color-sidebar-accent: var(--sidebar-accent);
|
||||
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
||||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
|
||||
--font-sans: var(--font-sans);
|
||||
--font-mono: var(--font-mono);
|
||||
--font-serif: var(--font-serif);
|
||||
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
--radius-lg: var(--radius);
|
||||
--radius-xl: calc(var(--radius) + 2px);
|
||||
|
||||
--shadow-2xs: var(--shadow-2xs);
|
||||
--shadow-xs: var(--shadow-xs);
|
||||
--shadow-sm: var(--shadow-sm);
|
||||
--shadow: var(--shadow);
|
||||
--shadow-md: var(--shadow-md);
|
||||
--shadow-lg: var(--shadow-lg);
|
||||
--shadow-xl: var(--shadow-xl);
|
||||
--shadow-2xl: var(--shadow-2xl);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"extends": "@spoon/tsconfig/base.json",
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules", "eslint.config.ts"]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022"],
|
||||
"allowJs": true,
|
||||
"resolveJsonModule": true,
|
||||
"moduleDetection": "force",
|
||||
"isolatedModules": true,
|
||||
|
||||
"incremental": true,
|
||||
"disableSourceOfProjectReferenceRedirect": true,
|
||||
"tsBuildInfoFile": "${configDir}/.cache/tsbuildinfo.json",
|
||||
|
||||
"strict": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"checkJs": true,
|
||||
|
||||
"module": "Preserve",
|
||||
"moduleResolution": "Bundler",
|
||||
"noEmit": true
|
||||
},
|
||||
"exclude": ["node_modules", "build", "dist", ".next", ".expo"]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"noEmit": false,
|
||||
"outDir": "${configDir}/dist"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@spoon/tsconfig",
|
||||
"private": true,
|
||||
"files": [
|
||||
"*.json"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { defineProject } from 'vitest/config';
|
||||
|
||||
const jsdomSetup = fileURLToPath(new URL('./setup-jsdom.ts', import.meta.url));
|
||||
|
||||
export const nodeProject = (name: string, include: string[]) =>
|
||||
defineProject({ test: { name, environment: 'node', include } });
|
||||
|
||||
export const jsdomProject = (name: string, include: string[]) =>
|
||||
defineProject({
|
||||
plugins: [react()],
|
||||
test: { name, environment: 'jsdom', include, setupFiles: [jsdomSetup] },
|
||||
});
|
||||
|
||||
export const convexProject = (name: string, include: string[]) =>
|
||||
defineProject({
|
||||
test: {
|
||||
name,
|
||||
environment: 'edge-runtime',
|
||||
include,
|
||||
server: { deps: { inline: ['convex-test'] } },
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@spoon/vitest-config",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./index.ts",
|
||||
"./setup-jsdom": "./setup-jsdom.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "git clean -xdf .cache .turbo node_modules",
|
||||
"format": "prettier --check . --ignore-path ../../.gitignore",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "catalog:test",
|
||||
"@vitejs/plugin-react": "catalog:test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@spoon/prettier-config": "workspace:*",
|
||||
"@spoon/tsconfig": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"prettier": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:test"
|
||||
},
|
||||
"prettier": "@spoon/prettier-config"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "@spoon/tsconfig/base.json",
|
||||
"compilerOptions": { "lib": ["ES2022", "dom", "dom.iterable"] },
|
||||
"include": ["."],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user