Skip to content

Commit 21466ad

Browse files
Initial setup
1 parent 322c2f6 commit 21466ad

37 files changed

+5379
-2
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch"
10+
}

.github/workflows/changesets.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Changesets
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version:
10+
timeout-minutes: 15
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Code Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
cache: "pnpm"
24+
25+
- name: Install Dependencies
26+
run: pnpm install
27+
28+
- name: Create and Publish Versions
29+
uses: changesets/action@v1
30+
with:
31+
commit: "chore: update versions"
32+
title: "chore: update versions"
33+
publish: pnpm ci:publish
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
- name: Create/Update GH Releases
38+
run: echo "TBD"

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-24.04
9+
timeout-minutes: 10
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Install pnpm
15+
uses: pnpm/action-setup@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version-file: .nvmrc
21+
cache: "pnpm"
22+
23+
- name: Install dependencies
24+
run: pnpm install
25+
26+
- name: Run tests
27+
run: pnpm packages:test:all

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
# ai-components-js
2-
AI components for JS-based applications

eslint.config.mjs

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
5+
import importPlugin from "eslint-plugin-import";
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ["dist"],
10+
},
11+
{
12+
name: "default",
13+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
14+
files: ["packages/**/src/**/*.ts"],
15+
languageOptions: {
16+
ecmaVersion: 2020,
17+
globals: globals.browser,
18+
},
19+
plugins: {
20+
import: importPlugin,
21+
},
22+
settings: {
23+
react: {
24+
version: "detect",
25+
},
26+
},
27+
rules: {
28+
camelcase: "off",
29+
semi: ["warn", "always"],
30+
eqeqeq: ["error", "smart"],
31+
"default-case": "off",
32+
"array-callback-return": "error",
33+
"arrow-body-style": "off",
34+
"comma-dangle": "off",
35+
"jsx-quotes": ["error", "prefer-single"],
36+
"linebreak-style": ["error", "unix"],
37+
"no-console": "off",
38+
"no-mixed-spaces-and-tabs": "warn",
39+
"no-self-compare": "error",
40+
"no-underscore-dangle": "off",
41+
"no-use-before-define": "off",
42+
"no-useless-concat": "error",
43+
"no-var": "error",
44+
"no-script-url": "error",
45+
"no-continue": "off",
46+
"object-shorthand": "warn",
47+
"prefer-const": "warn",
48+
"require-await": "off",
49+
"sort-imports": [
50+
"error",
51+
{
52+
allowSeparatedGroups: true,
53+
ignoreCase: true,
54+
ignoreDeclarationSort: true,
55+
ignoreMemberSort: false,
56+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
57+
},
58+
],
59+
"sort-keys": "off",
60+
"valid-typeof": "error",
61+
"max-classes-per-file": "off",
62+
"no-unused-expressions": "off",
63+
"import/prefer-default-export": "off",
64+
"import/extensions": "off",
65+
// "import/no-extraneous-dependencies": [
66+
// "warn",
67+
// {
68+
// devDependencies: false,
69+
// optionalDependencies: false,
70+
// peerDependencies: false,
71+
// },
72+
// ],
73+
"no-unused-vars": "off",
74+
"@typescript-eslint/no-unused-vars": [
75+
"error",
76+
{
77+
args: "all",
78+
argsIgnorePattern: "^_",
79+
caughtErrors: "all",
80+
caughtErrorsIgnorePattern: "^_",
81+
destructuredArrayIgnorePattern: "^_",
82+
varsIgnorePattern: "^_",
83+
ignoreRestSiblings: true,
84+
},
85+
],
86+
"@typescript-eslint/no-unsafe-function-type": "error",
87+
"@typescript-eslint/no-wrapper-object-types": "error",
88+
"@typescript-eslint/no-non-null-assertion": "off",
89+
"no-empty-function": "off",
90+
"@typescript-eslint/no-empty-function": "off",
91+
"@typescript-eslint/no-require-imports": "error",
92+
"@typescript-eslint/consistent-type-imports": "error",
93+
"@typescript-eslint/no-empty-object-type": "off",
94+
"@typescript-eslint/no-empty-generator-function": "off",
95+
"@typescript-eslint/no-explicit-any": "off",
96+
},
97+
},
98+
);

examples/react-example/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

examples/react-example/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## React Compiler
11+
12+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13+
14+
## Expanding the ESLint configuration
15+
16+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
17+
18+
```js
19+
export default defineConfig([
20+
globalIgnores(['dist']),
21+
{
22+
files: ['**/*.{ts,tsx}'],
23+
extends: [
24+
// Other configs...
25+
26+
// Remove tseslint.configs.recommended and replace with this
27+
tseslint.configs.recommendedTypeChecked,
28+
// Alternatively, use this for stricter rules
29+
tseslint.configs.strictTypeChecked,
30+
// Optionally, add this for stylistic rules
31+
tseslint.configs.stylisticTypeChecked,
32+
33+
// Other configs...
34+
],
35+
languageOptions: {
36+
parserOptions: {
37+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
38+
tsconfigRootDir: import.meta.dirname,
39+
},
40+
// other options...
41+
},
42+
},
43+
])
44+
```
45+
46+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47+
48+
```js
49+
// eslint.config.js
50+
import reactX from 'eslint-plugin-react-x'
51+
import reactDom from 'eslint-plugin-react-dom'
52+
53+
export default defineConfig([
54+
globalIgnores(['dist']),
55+
{
56+
files: ['**/*.{ts,tsx}'],
57+
extends: [
58+
// Other configs...
59+
// Enable lint rules for React
60+
reactX.configs['recommended-typescript'],
61+
// Enable lint rules for React DOM
62+
reactDom.configs.recommended,
63+
],
64+
languageOptions: {
65+
parserOptions: {
66+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
67+
tsconfigRootDir: import.meta.dirname,
68+
},
69+
// other options...
70+
},
71+
},
72+
])
73+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
import { defineConfig, globalIgnores } from 'eslint/config'
7+
8+
export default defineConfig([
9+
globalIgnores(['dist']),
10+
{
11+
files: ['**/*.{ts,tsx}'],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs['recommended-latest'],
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
])

examples/react-example/index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>react-example</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/main.tsx"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)