tchain-api 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +7 -0
- package/README.md +5 -0
- package/apps/docs/.eslintrc.js +9 -0
- package/apps/docs/README.md +36 -0
- package/apps/docs/app/data.db +1 -0
- package/apps/docs/app/favicon.ico +0 -0
- package/apps/docs/app/fonts/GeistMonoVF.woff +0 -0
- package/apps/docs/app/fonts/GeistVF.woff +0 -0
- package/apps/docs/app/globals.css +39 -0
- package/apps/docs/app/layout.tsx +31 -0
- package/apps/docs/app/page.module.css +188 -0
- package/apps/docs/app/page.tsx +99 -0
- package/apps/docs/app/theta.ts +6 -0
- package/apps/docs/next.config.mjs +4 -0
- package/apps/docs/package.json +28 -0
- package/apps/docs/public/file-text.svg +3 -0
- package/apps/docs/public/globe.svg +10 -0
- package/apps/docs/public/next.svg +1 -0
- package/apps/docs/public/vercel.svg +10 -0
- package/apps/docs/public/window.svg +3 -0
- package/apps/docs/tsconfig.json +18 -0
- package/apps/web/.eslintrc.js +9 -0
- package/apps/web/README.md +36 -0
- package/apps/web/app/favicon.ico +0 -0
- package/apps/web/app/fonts/GeistMonoVF.woff +0 -0
- package/apps/web/app/fonts/GeistVF.woff +0 -0
- package/apps/web/app/globals.css +39 -0
- package/apps/web/app/layout.tsx +31 -0
- package/apps/web/app/page.module.css +188 -0
- package/apps/web/app/page.tsx +99 -0
- package/apps/web/next.config.mjs +4 -0
- package/apps/web/package.json +23 -0
- package/apps/web/public/chain.png +0 -0
- package/apps/web/public/favicon.ico +0 -0
- package/apps/web/public/file-text.svg +3 -0
- package/apps/web/public/globe.svg +10 -0
- package/apps/web/public/next.svg +1 -0
- package/apps/web/public/vercel.svg +10 -0
- package/apps/web/public/window.svg +3 -0
- package/apps/web/tsconfig.json +18 -0
- package/chain.jpg +0 -0
- package/index.js +3 -0
- package/package.json +22 -0
- package/packages/eslint-config/README.md +3 -0
- package/packages/eslint-config/library.js +34 -0
- package/packages/eslint-config/next.js +35 -0
- package/packages/eslint-config/package.json +19 -0
- package/packages/eslint-config/react-internal.js +39 -0
- package/packages/typescript-config/base.json +20 -0
- package/packages/typescript-config/nextjs.json +13 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +8 -0
- package/packages/ui/.eslintrc.js +10 -0
- package/packages/ui/package.json +28 -0
- package/packages/ui/src/button.tsx +20 -0
- package/packages/ui/src/card.tsx +25 -0
- package/packages/ui/src/code.tsx +9 -0
- package/packages/ui/tsconfig.json +8 -0
- package/packages/ui/tsconfig.lint.json +8 -0
- package/packages/ui/turbo/generators/config.ts +30 -0
- package/packages/ui/turbo/generators/templates/component.hbs +8 -0
- package/pnpm-workspace.yaml +3 -0
- package/turbo.json +18 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
root: true,
|
|
4
|
+
extends: ["@repo/eslint-config/react-internal.js"],
|
|
5
|
+
parser: "@typescript-eslint/parser",
|
|
6
|
+
parserOptions: {
|
|
7
|
+
project: "./tsconfig.lint.json",
|
|
8
|
+
tsconfigRootDir: __dirname,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@repo/ui",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"exports": {
|
|
6
|
+
"./button": "./src/button.tsx",
|
|
7
|
+
"./card": "./src/card.tsx",
|
|
8
|
+
"./code": "./src/code.tsx"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"lint": "eslint . --max-warnings 0",
|
|
12
|
+
"generate:component": "turbo gen react-component"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@repo/eslint-config": "0.0.0",
|
|
16
|
+
"@repo/typescript-config": "0.0.0",
|
|
17
|
+
"@turbo/gen": "^1.12.4",
|
|
18
|
+
"@types/node": "^20.11.24",
|
|
19
|
+
"@types/eslint": "^8.56.5",
|
|
20
|
+
"@types/react": "^18.2.61",
|
|
21
|
+
"@types/react-dom": "^18.2.19",
|
|
22
|
+
"eslint": "^8.57.0",
|
|
23
|
+
"typescript": "^5.3.3"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"react": "^18.2.0"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
interface ButtonProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
appName: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Button = ({ children, className, appName }: ButtonProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<button
|
|
14
|
+
className={className}
|
|
15
|
+
onClick={() => alert(`Hello from your ${appName} app!`)}
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</button>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function Card({
|
|
2
|
+
className,
|
|
3
|
+
title,
|
|
4
|
+
children,
|
|
5
|
+
href,
|
|
6
|
+
}: {
|
|
7
|
+
className?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
href: string;
|
|
11
|
+
}): JSX.Element {
|
|
12
|
+
return (
|
|
13
|
+
<a
|
|
14
|
+
className={className}
|
|
15
|
+
href={`${href}?utm_source=create-turbo&utm_medium=basic&utm_campaign=create-turbo"`}
|
|
16
|
+
rel="noopener noreferrer"
|
|
17
|
+
target="_blank"
|
|
18
|
+
>
|
|
19
|
+
<h2>
|
|
20
|
+
{title} <span>-></span>
|
|
21
|
+
</h2>
|
|
22
|
+
<p>{children}</p>
|
|
23
|
+
</a>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PlopTypes } from "@turbo/gen";
|
|
2
|
+
|
|
3
|
+
// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation
|
|
4
|
+
|
|
5
|
+
export default function generator(plop: PlopTypes.NodePlopAPI): void {
|
|
6
|
+
// A simple generator to add a new React component to the internal UI library
|
|
7
|
+
plop.setGenerator("react-component", {
|
|
8
|
+
description: "Adds a new react component",
|
|
9
|
+
prompts: [
|
|
10
|
+
{
|
|
11
|
+
type: "input",
|
|
12
|
+
name: "name",
|
|
13
|
+
message: "What is the name of the component?",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
actions: [
|
|
17
|
+
{
|
|
18
|
+
type: "add",
|
|
19
|
+
path: "src/{{kebabCase name}}.tsx",
|
|
20
|
+
templateFile: "templates/component.hbs",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "append",
|
|
24
|
+
path: "package.json",
|
|
25
|
+
pattern: /"exports": {(?<insertion>)/g,
|
|
26
|
+
template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
}
|
package/turbo.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"ui": "tui",
|
|
4
|
+
"tasks": {
|
|
5
|
+
"build": {
|
|
6
|
+
"dependsOn": ["^build"],
|
|
7
|
+
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
|
8
|
+
"outputs": [".next/**", "!.next/cache/**"]
|
|
9
|
+
},
|
|
10
|
+
"lint": {
|
|
11
|
+
"dependsOn": ["^lint"]
|
|
12
|
+
},
|
|
13
|
+
"dev": {
|
|
14
|
+
"cache": false,
|
|
15
|
+
"persistent": true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|