Skip to content

Commit

Permalink
tabwidth 2
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge committed Jan 24, 2024
1 parent 75c1ce8 commit 6070c86
Show file tree
Hide file tree
Showing 49 changed files with 2,272 additions and 2,311 deletions.
26 changes: 13 additions & 13 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/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/[email protected]/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"
]
}
52 changes: 25 additions & 27 deletions .github/canary-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"biome.lspBin": "node_modules/.bin/biome",
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
Expand Down
74 changes: 37 additions & 37 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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
}
}
164 changes: 82 additions & 82 deletions docs/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => (
<h1 className="scroll-m-20 font-cal text-4xl mt-10" {...props}>
{children}
</h1>
),
h2: ({ children, ...props }) => (
<h2
className="mt-10 scroll-m-20 border-b pb-2 font-cal text-3xl first:mt-0"
id={slugify(children)}
{...props}
>
<a className="group" href={`#${slugify(children)}`}>
<span>{children}</span>
<Icons.link className="inline-flex ml-1 h-4 w-4 invisible group-hover:visible" />
</a>
</h2>
),
h3: ({ children, ...props }) => (
<h3
className="mt-8 scroll-m-20 font-cal text-2xl"
id={slugify(children)}
{...props}
>
<a className="group" href={`#${slugify(children)}`}>
<span>{children}</span>
<Icons.link className="inline-flex ml-1 h-4 w-4 invisible group-hover:visible" />
</a>
</h3>
),
h4: ({ children, ...props }) => (
<h4
className="mt-6 -mb-4 scroll-m-20 font-cal text-2xl"
id={slugify(children)}
{...props}
>
<a className="group" href={`#${slugify(children)}`}>
<span>{children}</span>
<Icons.link className="inline-flex ml-1 h-4 w-4 invisible group-hover:visible" />
</a>
</h4>
),
p: (props) => (
<p className="leading-7 [&:not(:first-child)]:mt-6" {...props} />
),
a: ({ children, href }) => {
const isExternal = href?.startsWith("http");
const Component = isExternal ? "a" : Link;
return (
<Component
href={href as string}
className="underline decoration-primary decoration-2 underline-offset-4"
>
{children}
</Component>
);
},
ul: (props) => <ul className="mt-4 list-disc pl-8" {...props} />,
code: (props) => (
<code
className="relative font-mono rounded bg-muted py-[0.2rem] px-[0.3rem] text-sm font-semibold text-muted-foreground"
{...props}
/>
),
pre: Codeblock,
return {
// Allows customizing built-in components, e.g. to add styling.
h1: ({ children, ...props }) => (
<h1 className="scroll-m-20 font-cal text-4xl mt-10" {...props}>
{children}
</h1>
),
h2: ({ children, ...props }) => (
<h2
className="mt-10 scroll-m-20 border-b pb-2 font-cal text-3xl first:mt-0"
id={slugify(children)}
{...props}
>
<a className="group" href={`#${slugify(children)}`}>
<span>{children}</span>
<Icons.link className="inline-flex ml-1 h-4 w-4 invisible group-hover:visible" />
</a>
</h2>
),
h3: ({ children, ...props }) => (
<h3
className="mt-8 scroll-m-20 font-cal text-2xl"
id={slugify(children)}
{...props}
>
<a className="group" href={`#${slugify(children)}`}>
<span>{children}</span>
<Icons.link className="inline-flex ml-1 h-4 w-4 invisible group-hover:visible" />
</a>
</h3>
),
h4: ({ children, ...props }) => (
<h4
className="mt-6 -mb-4 scroll-m-20 font-cal text-2xl"
id={slugify(children)}
{...props}
>
<a className="group" href={`#${slugify(children)}`}>
<span>{children}</span>
<Icons.link className="inline-flex ml-1 h-4 w-4 invisible group-hover:visible" />
</a>
</h4>
),
p: (props) => (
<p className="leading-7 [&:not(:first-child)]:mt-6" {...props} />
),
a: ({ children, href }) => {
const isExternal = href?.startsWith("http");
const Component = isExternal ? "a" : Link;
return (
<Component
href={href as string}
className="underline decoration-primary decoration-2 underline-offset-4"
>
{children}
</Component>
);
},
ul: (props) => <ul className="mt-4 list-disc pl-8" {...props} />,
code: (props) => (
<code
className="relative font-mono rounded bg-muted py-[0.2rem] px-[0.3rem] text-sm font-semibold text-muted-foreground"
{...props}
/>
),
pre: Codeblock,

img: (props) => <img {...props} className="rounded-lg" />,
img: (props) => <img {...props} className="rounded-lg" />,

// Add custom components.
Callout,
Steps: ({ ...props }) => (
<div
className="[&>h3]:step mb-12 ml-4 border-l pl-6 [counter-reset:step]"
{...props}
/>
),
// Add custom components.
Callout,
Steps: ({ ...props }) => (
<div
className="[&>h3]:step mb-12 ml-4 border-l pl-6 [counter-reset:step]"
{...props}
/>
),

// Pass through all other components.
...components,
};
// Pass through all other components.
...components,
};
}

function slugify(input: unknown) {
if (typeof input !== "string") {
return "";
}
return input.replaceAll(" ", "-").toLowerCase().trim();
if (typeof input !== "string") {
return "";
}
return input.replaceAll(" ", "-").toLowerCase().trim();
}
Loading

0 comments on commit 6070c86

Please sign in to comment.