Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
pull_request:
push:
branches: [main]

jobs:
# TODO: Enable lint job after applying lint fixes and setting appropriate warning limits
# Will be handled in follow-up PR to avoid blocking CI setup / bloating this PR
# lint:
# name: Lint
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v4

# - uses: oven-sh/setup-bun@v1
# with:
# bun-version: latest

# - name: Cache dependencies
# uses: actions/cache@v4
# with:
# path: |
# ~/.bun/install/cache
# key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

# - name: Install dependencies
# run: bun install --frozen

# - name: Run linter
# run: bun lint

typecheck:
name: Typecheck
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

- name: Install dependencies
run: bun install --frozen

- name: Run type checking
run: bun typecheck

test:
name: Unit Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

- name: Install dependencies
run: bun install --frozen

- name: Run tests
run: bun test --timeout 30000 --coverage
21 changes: 0 additions & 21 deletions .github/workflows/unit-test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .husky/pre-commit
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling temporarily, otherwise this PR will have 1000's of files touched

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
bun run format && git add .
# bun run format && git add .
# bun run lint && bun run format:write && git add .
Comment on lines +2 to 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-commit hook has been commented out without enabling a replacement, effectively disabling Git's pre-commit functionality. Consider either:

  1. Uncommenting line 3 to use the new format command:

    bun run format && git add .
    
  2. Or uncommenting line 4 to use the previous approach:

    bun run lint && bun run format:write && git add .
    

Without an active hook, code formatting won't be automatically applied before commits.

Suggested change
# bun run format && git add .
# bun run lint && bun run format:write && git add .
bun run format && git add .
# bun run lint && bun run format:write && git add .

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

11 changes: 0 additions & 11 deletions .prettierrc
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was pulled into tooling/prettier/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"peerDependencies": {
"typescript": "^5.0.0"
}
}
}
11 changes: 0 additions & 11 deletions apps/web/client/.prettierrc

This file was deleted.

54 changes: 13 additions & 41 deletions apps/web/client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,14 @@
import { FlatCompat } from '@eslint/eslintrc';
import tseslint from 'typescript-eslint';
import baseConfig from "@onlook/eslint/base";
import nextjsConfig, { restrictEnvAccess } from "@onlook/eslint/nextjs";
import reactConfig from "@onlook/eslint/react";

const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
});

export default tseslint.config(
{
ignores: ['.next'],
},
...compat.extends('next/core-web-vitals'),
{
files: ['**/*.ts', '**/*.tsx'],
extends: [
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
rules: {
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/consistent-type-imports': [
'warn',
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/no-misused-promises': 'warn'
},
},
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parserOptions: {
projectService: true,
},
},
},
);
/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: [".next/**"],
},
...baseConfig,
...reactConfig,
...nextjsConfig,
...restrictEnvAccess,
];
22 changes: 8 additions & 14 deletions apps/web/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
"type": "module",
"scripts": {
"dev": "next dev --turbo",
"check": "next lint && tsc --noEmit",
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
"format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
"lint": "next lint",
"lint:fix": "next lint --fix",
"lint": "eslint . --max-warnings 0",
"format": "eslint --fix .",
"typecheck": "tsc --noEmit",
"build": "next build",
"start": "next start",
"preview": "bun run build && bun run start",
"build:standalone": "STANDALONE_BUILD=true next build && { cp -r public .next/standalone/apps/web/client/ && cp -r .next/static .next/standalone/apps/web/client/.next/; } 2>/dev/null",
"start:standalone": "bun .next/standalone/apps/web/client/server.js",
"preview:standalone": "bun run build:standalone && bun run start:standalone",
"typecheck": "tsc --noEmit"
"preview:standalone": "bun run build:standalone && bun run start:standalone"
},
"dependencies": {
"@ai-sdk/provider-utils": "^3.0.5",
Expand Down Expand Up @@ -114,24 +111,21 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
"@onlook/eslint": "*",
"@onlook/typescript": "*",
"@tailwindcss/postcss": "^4.0.15",
"@types/culori": "^4.0.0",
"@types/node": "^20.14.10",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@types/webfontloader": "^1.6.38",
"eslint": "^9.23.0",
"eslint-config-next": "^15.5.2",
"eslint": "^9.0.0",
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"tailwindcss": "^4.0.15",
"type-fest": "^4.41.0",
"typescript": "^5.8.2",
"typescript-eslint": "^8.27.0"
"typescript": "^5.5.4"
},
"ct3aMetadata": {
"initVersion": "7.39.2"
}
}
}
4 changes: 0 additions & 4 deletions apps/web/client/prettier.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"typescript": "^5"
},
"dependencies": {}
}
}
9 changes: 9 additions & 0 deletions apps/web/preload/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import baseConfig from "@onlook/eslint/base";

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: ["dist/**"],
},
...baseConfig,
];
13 changes: 10 additions & 3 deletions apps/web/preload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@
"dev": "concurrently \"bun run build:watch\" \"bun run serve\"",
"serve": "bun --watch server/index.ts",
"build": "bun build script/index.ts --outfile=../client/public/onlook-preload-script.js --target=browser --minify --external @onlook/utility",
"build:watch": "bun run build --watch"
"build:watch": "bun run build --watch",
"lint": "eslint . --max-warnings 0",
"format": "eslint --fix .",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@onlook/eslint": "*",
"@onlook/typescript": "*",
"@types/bun": "latest",
"@types/css-tree": "^2.3.10",
"@types/lodash.debounce": "^4.0.9",
"concurrently": "^9.1.2"
"concurrently": "^9.1.2",
"eslint": "^9.0.0",
"typescript": "^5.5.4"
},
"peerDependencies": {
"typescript": "^5"
Expand All @@ -27,4 +34,4 @@
"nanoid": "^5.1.5",
"penpal": "^7.0.4"
}
}
}
4 changes: 2 additions & 2 deletions apps/web/preload/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
}
},
"include": [
"src",
"test"
"script",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no src/test in this package

"server"
],
"exclude": [
"node_modules"
Expand Down
9 changes: 9 additions & 0 deletions apps/web/server/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import baseConfig from "@onlook/eslint/base";

/** @type {import('typescript-eslint').Config} */
export default [
{
ignores: ["dist/**"],
},
...baseConfig,
];
13 changes: 10 additions & 3 deletions apps/web/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
"dev": "bun run --watch src/index.ts",
"build": "bun build src/index.ts --outdir dist --target bun",
"start": "bun dist/index.js",
"preview": "bun run build && bun run start"
"preview": "bun run build && bun run start",
"lint": "eslint . --max-warnings 0",
"format": "eslint --fix .",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/bun": "latest"
"@onlook/eslint": "*",
"@onlook/typescript": "*",
"@types/bun": "latest",
"eslint": "^9.0.0",
"typescript": "^5.5.4"
},
"peerDependencies": {
"typescript": "^5"
Expand All @@ -22,4 +29,4 @@
"fastify": "^5.2.2",
"zod": "^4.1.3"
}
}
}
18 changes: 0 additions & 18 deletions apps/web/server/tsup.config.ts
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was unused

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looks unused, since we're using bun build

This file was deleted.

Loading