Skip to content

Commit 7abb2fe

Browse files
committed
feat: init
1 parent 65ab21e commit 7abb2fe

86 files changed

Lines changed: 2471 additions & 1529 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": true,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["@foldcms/typescript-config"]
11+
}

.gitignore

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
1-
# dependencies (bun install)
2-
node_modules
3-
4-
# output
5-
out
6-
dist
7-
*.tgz
8-
9-
# code coverage
10-
coverage
11-
*.lcov
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
122

13-
# logs
14-
logs
15-
_.log
16-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3+
# Dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
177

18-
# dotenv environment variable files
8+
# Local env files
199
.env
10+
.env.local
2011
.env.development.local
2112
.env.test.local
2213
.env.production.local
23-
.env.local
2414

25-
# caches
26-
.eslintcache
27-
.cache
28-
*.tsbuildinfo
15+
# Testing
16+
coverage
2917

30-
# IntelliJ based IDEs
31-
.idea
18+
# Turbo
19+
.turbo
3220

33-
# Finder (MacOS) folder config
34-
.DS_Store
21+
# Vercel
22+
.vercel
23+
24+
# Build Outputs
25+
.next/
26+
out/
27+
build
28+
dist
3529

36-
.jj
3730

38-
.old
31+
# Debug
32+
npm-debug.log*
33+
yarn-debug.log*
34+
yarn-error.log*
35+
36+
# Misc
37+
.DS_Store
38+
*.pem
39+
40+
.old
41+
.jj
File renamed without changes.
File renamed without changes.

biome.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"formatter": {
9+
"enabled": true
10+
},
11+
12+
"linter": {
13+
"enabled": true,
14+
"rules": {
15+
"recommended": true
16+
}
17+
},
18+
"javascript": {
19+
"formatter": {
20+
"quoteStyle": "double",
21+
"jsxQuoteStyle": "double",
22+
"quoteProperties": "asNeeded",
23+
"trailingCommas": "all",
24+
"semicolons": "always",
25+
"arrowParentheses": "always",
26+
"bracketSpacing": true,
27+
"bracketSameLine": false,
28+
"attributePosition": "auto"
29+
}
30+
},
31+
"json": {
32+
"formatter": {
33+
"trailingCommas": "none"
34+
}
35+
}
36+
}

bun.lock

Lines changed: 916 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "t",
3+
"private": true,
4+
"scripts": {
5+
"build": "turbo run build",
6+
"dev": "turbo run dev",
7+
"format-and-lint": "biome check .",
8+
"format-and-lint:fix": "biome check . --write",
9+
"check-types": "turbo run check-types",
10+
"publish-packages": "turbo run format-and-lint test build && changeset version && changeset publish"
11+
},
12+
"devDependencies": {
13+
"@biomejs/biome": "2.2.4",
14+
"@changesets/cli": "^2.29.7",
15+
"turbo": "^2.5.8",
16+
"typescript": "5.9.2"
17+
},
18+
"engines": {
19+
"node": ">=18"
20+
},
21+
"packageManager": "bun@1.2.22",
22+
"workspaces": [
23+
"apps/*",
24+
"packages/*"
25+
]
26+
}

packages/core/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# dependencies (bun install)
2+
node_modules
3+
4+
# output
5+
out
6+
dist
7+
*.tgz
8+
9+
# code coverage
10+
coverage
11+
*.lcov
12+
13+
# logs
14+
logs
15+
_.log
16+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17+
18+
# dotenv environment variable files
19+
.env
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.env.local
24+
25+
# caches
26+
.eslintcache
27+
.cache
28+
*.tsbuildinfo
29+
30+
# IntelliJ based IDEs
31+
.idea
32+
33+
# Finder (MacOS) folder config
34+
.DS_Store

packages/core/CLAUDE.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
2+
Default to using Bun instead of Node.js.
3+
4+
- Use `bun <file>` instead of `node <file>` or `ts-node <file>`
5+
- Use `bun test` instead of `jest` or `vitest`
6+
- Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
7+
- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`
8+
- Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`
9+
- Bun automatically loads .env, so don't use dotenv.
10+
11+
## APIs
12+
13+
- `Bun.serve()` supports WebSockets, HTTPS, and routes. Don't use `express`.
14+
- `bun:sqlite` for SQLite. Don't use `better-sqlite3`.
15+
- `Bun.redis` for Redis. Don't use `ioredis`.
16+
- `Bun.sql` for Postgres. Don't use `pg` or `postgres.js`.
17+
- `WebSocket` is built-in. Don't use `ws`.
18+
- Prefer `Bun.file` over `node:fs`'s readFile/writeFile
19+
- Bun.$`ls` instead of execa.
20+
21+
## Testing
22+
23+
Use `bun test` to run tests.
24+
25+
```ts#index.test.ts
26+
import { test, expect } from "bun:test";
27+
28+
test("hello world", () => {
29+
expect(1).toBe(1);
30+
});
31+
```
32+
33+
## Frontend
34+
35+
Use HTML imports with `Bun.serve()`. Don't use `vite`. HTML imports fully support React, CSS, Tailwind.
36+
37+
Server:
38+
39+
```ts#index.ts
40+
import index from "./index.html"
41+
42+
Bun.serve({
43+
routes: {
44+
"/": index,
45+
"/api/users/:id": {
46+
GET: (req) => {
47+
return new Response(JSON.stringify({ id: req.params.id }));
48+
},
49+
},
50+
},
51+
// optional websocket support
52+
websocket: {
53+
open: (ws) => {
54+
ws.send("Hello, world!");
55+
},
56+
message: (ws, message) => {
57+
ws.send(message);
58+
},
59+
close: (ws) => {
60+
// handle close
61+
}
62+
},
63+
development: {
64+
hmr: true,
65+
console: true,
66+
}
67+
})
68+
```
69+
70+
HTML files can import .tsx, .jsx or .js files directly and Bun's bundler will transpile & bundle automatically. `<link>` tags can point to stylesheets and Bun's CSS bundler will bundle.
71+
72+
```html#index.html
73+
<html>
74+
<body>
75+
<h1>Hello, world!</h1>
76+
<script type="module" src="./frontend.tsx"></script>
77+
</body>
78+
</html>
79+
```
80+
81+
With the following `frontend.tsx`:
82+
83+
```tsx#frontend.tsx
84+
import React from "react";
85+
86+
// import .css files directly and it works
87+
import './index.css';
88+
89+
import { createRoot } from "react-dom/client";
90+
91+
const root = createRoot(document.body);
92+
93+
export default function Frontend() {
94+
return <h1>Hello, world!</h1>;
95+
}
96+
97+
root.render(<Frontend />);
98+
```
99+
100+
Then, run index.ts
101+
102+
```sh
103+
bun --hot ./index.ts
104+
```
105+
106+
For more information, read the Bun API docs in `node_modules/bun-types/docs/**.md`.

0 commit comments

Comments
 (0)