From 6070c868c867b8d6d77a6253e66e7008e8eeb9a9 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Wed, 24 Jan 2024 19:46:57 +0100 Subject: [PATCH] tabwidth 2 --- .changeset/config.json | 26 +- .github/canary-version.js | 52 +- .vscode/settings.json | 1 - biome.json | 74 +- docs/mdx-components.tsx | 164 +-- docs/next.config.js | 66 +- docs/postcss.config.cjs | 8 +- docs/src/app/docs/layout.tsx | 28 +- docs/src/app/layout.tsx | 136 ++- docs/src/app/page.tsx | 112 +-- docs/src/app/site-config.ts | 106 +- docs/src/components/icons.tsx | 238 ++--- docs/src/components/layout.tsx | 14 +- docs/src/components/main-nav.tsx | 63 +- docs/src/components/mdx/callout.tsx | 120 +-- docs/src/components/mdx/code-block.tsx | 122 ++- docs/src/components/mobile-nav.tsx | 134 ++- docs/src/components/sidebar.tsx | 107 +- docs/src/components/site-header.tsx | 80 +- docs/src/components/tailwind-indicator.tsx | 28 +- docs/src/components/theme-provider.tsx | 2 +- docs/src/components/theme-toggle.tsx | 24 +- docs/src/components/ui/button.tsx | 73 +- docs/src/components/ui/popover.tsx | 28 +- docs/src/components/ui/scroll-area.tsx | 62 +- docs/src/lib/cn.ts | 2 +- docs/tailwind.config.ts | 212 ++-- examples/astro/astro.config.mjs | 2 +- examples/astro/src/counter.tsx | 4 +- examples/astro/src/t3-env.ts | 24 +- examples/nextjs/app/api/edge/route.ts | 2 +- examples/nextjs/app/api/node/route.ts | 2 +- examples/nextjs/app/edge/page.tsx | 18 +- examples/nextjs/app/env.js | 28 +- examples/nextjs/app/layout.tsx | 20 +- examples/nextjs/app/node/page.tsx | 18 +- examples/nextjs/app/page.tsx | 2 +- examples/nextjs/next.config.js | 6 +- examples/nuxt/env.ts | 12 +- examples/nuxt/nuxt.config.ts | 2 +- examples/nuxt/server/api/hello.get.ts | 6 +- packages/core/src/index.ts | 468 +++++---- packages/core/src/presets.ts | 40 +- packages/core/test/smoke.test.ts | 1057 ++++++++++---------- packages/nextjs/src/index.ts | 136 ++- packages/nextjs/test/smoke.test.ts | 550 +++++----- packages/nuxt/src/index.ts | 50 +- replace-workspace-protocol.ts | 8 +- turbo.json | 46 +- 49 files changed, 2272 insertions(+), 2311 deletions(-) diff --git a/.changeset/config.json b/.changeset/config.json index 67b4a918..22b480f9 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,15 +1,15 @@ { - "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", - "changelog": ["@changesets/changelog-github", { "repo": "t3-oss/t3-env" }], - "commit": false, - "access": "public", - "baseBranch": "main", - "updateInternalDependencies": "patch", - "fixed": [["@t3-oss/env-core", "@t3-oss/env-nextjs", "@t3-oss/env-nuxt"]], - "ignore": [ - "@examples/astro", - "@examples/nextjs", - "@examples/nuxt", - "@t3-env/docs" - ] + "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", + "changelog": ["@changesets/changelog-github", { "repo": "t3-oss/t3-env" }], + "commit": false, + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "fixed": [["@t3-oss/env-core", "@t3-oss/env-nextjs", "@t3-oss/env-nuxt"]], + "ignore": [ + "@examples/astro", + "@examples/nextjs", + "@examples/nuxt", + "@t3-env/docs" + ] } diff --git a/.github/canary-version.js b/.github/canary-version.js index 1bbebd5e..84c159b3 100644 --- a/.github/canary-version.js +++ b/.github/canary-version.js @@ -2,39 +2,37 @@ import { exec } from "child_process"; import fs from "fs"; const pkgJsonPaths = [ - "packages/core/package.json", - "packages/nextjs/package.json", - "packages/nuxt/package.json", + "packages/core/package.json", + "packages/nextjs/package.json", + "packages/nuxt/package.json", ]; try { - exec("git rev-parse --short HEAD", (err, stdout) => { - if (err) { - console.log(err); - process.exit(1); - } - const commitHash = stdout.trim(); + exec("git rev-parse --short HEAD", (err, stdout) => { + if (err) { + console.log(err); + process.exit(1); + } + const commitHash = stdout.trim(); - for (const pkgJsonPath of pkgJsonPaths) { - const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8")); - const oldVersion = pkg.version; - const [major, minor, patch] = oldVersion.split(".").map(Number); - const newVersion = `${major}.${minor}.${ - patch + 1 - }-canary.${commitHash}`; + for (const pkgJsonPath of pkgJsonPaths) { + const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8")); + const oldVersion = pkg.version; + const [major, minor, patch] = oldVersion.split(".").map(Number); + const newVersion = `${major}.${minor}.${patch + 1}-canary.${commitHash}`; - pkg.version = newVersion; + pkg.version = newVersion; - const content = `${JSON.stringify(pkg, null, "\t")}\n`; - const newContent = content.replace( - new RegExp(`"@t3-oss/\\*": "${oldVersion}"`, "g"), - `"@t3-oss/*": "${newVersion}"`, - ); + const content = `${JSON.stringify(pkg, null, "\t")}\n`; + const newContent = content.replace( + new RegExp(`"@t3-oss/\\*": "${oldVersion}"`, "g"), + `"@t3-oss/*": "${newVersion}"`, + ); - fs.writeFileSync(pkgJsonPath, newContent); - } - }); + fs.writeFileSync(pkgJsonPath, newContent); + } + }); } catch (error) { - console.error(error); - process.exit(1); + console.error(error); + process.exit(1); } diff --git a/.vscode/settings.json b/.vscode/settings.json index 7dbc802e..092cd91e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "biome.lspBin": "node_modules/.bin/biome", "editor.codeActionsOnSave": { "quickfix.biome": "explicit", "source.organizeImports.biome": "explicit" diff --git a/biome.json b/biome.json index c714eb65..7cf22f20 100644 --- a/biome.json +++ b/biome.json @@ -1,42 +1,42 @@ { - "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", - "organizeImports": { - "enabled": true - }, - "formatter": { - "enabled": true, - "indentWidth": 4, - "indentStyle": "space" - }, - "linter": { - "enabled": true, + "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", + "organizeImports": { + "enabled": true + }, + "formatter": { + "enabled": true, + "indentWidth": 2, + "indentStyle": "space" + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "a11y": { + "noSvgWithoutTitle": "off", + "useButtonType": "off", + "useAltText": "off" + }, + "complexity": { + "noBannedTypes": "off" + } + } + }, + "overrides": [ + { + "include": ["**/*.test.ts"], + "linter": { "rules": { - "recommended": true, - "a11y": { - "noSvgWithoutTitle": "off", - "useButtonType": "off", - "useAltText": "off" - }, - "complexity": { - "noBannedTypes": "off" - } - } - }, - "overrides": [ - { - "include": ["**/*.test.ts"], - "linter": { - "rules": { - "suspicious": { - "noExplicitAny": "off" - } - } - } + "suspicious": { + "noExplicitAny": "off" + } } - ], - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true + } } + ], + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + } } diff --git a/docs/mdx-components.tsx b/docs/mdx-components.tsx index e64c06ae..bd09ddd9 100644 --- a/docs/mdx-components.tsx +++ b/docs/mdx-components.tsx @@ -8,92 +8,92 @@ import { Codeblock } from "@/components/mdx/code-block"; // This file is required to use MDX in `app` directory. export function useMDXComponents(components: MDXComponents): MDXComponents { - return { - // Allows customizing built-in components, e.g. to add styling. - h1: ({ children, ...props }) => ( -

- {children} -

- ), - h2: ({ children, ...props }) => ( -

- - {children} - - -

- ), - h3: ({ children, ...props }) => ( -

- - {children} - - -

- ), - h4: ({ children, ...props }) => ( -

- - {children} - - -

- ), - p: (props) => ( -

- ), - a: ({ children, href }) => { - const isExternal = href?.startsWith("http"); - const Component = isExternal ? "a" : Link; - return ( - - {children} - - ); - }, - ul: (props) =>