Eduards commited on
Commit
f0a668b
Β·
unverified Β·
2 Parent(s): 574f0a0 ad511db

Merge pull request #378 from mrsimpson/force-local-linting

Browse files
.husky/pre-commit ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ echo "πŸ” Running pre-commit hook to check the code looks good... πŸ”"
4
+
5
+ if ! pnpm typecheck; then
6
+ echo "❌ Type checking failed! Please review TypeScript types."
7
+ echo "Once you're done, don't forget to add your changes to the commit! πŸš€"
8
+ exit 1
9
+ fi
10
+
11
+ if ! pnpm lint; then
12
+ echo "❌ Linting failed! 'pnpm lint:check' will help you fix the easy ones."
13
+ echo "Once you're done, don't forget to add your beautification to the commit! 🀩"
14
+ exit 1
15
+ fi
16
+
17
+ echo "πŸ‘ All good! Committing changes..."
CONTRIBUTING.md CHANGED
@@ -53,6 +53,8 @@ We're looking for dedicated contributors to help maintain and grow this project.
53
  - Comment complex logic
54
  - Keep functions focused and small
55
  - Use meaningful variable names
 
 
56
 
57
  ## Development Setup
58
 
 
53
  - Comment complex logic
54
  - Keep functions focused and small
55
  - Use meaningful variable names
56
+ - Lint your code. This repo contains a pre-commit-hook that will verify your code is linted properly,
57
+ so set up your IDE to do that for you!
58
 
59
  ## Development Setup
60
 
app/lib/.server/llm/stream-text.ts CHANGED
@@ -1,11 +1,11 @@
1
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
  // @ts-nocheck – TODO: Provider proper types
3
 
4
- import { streamText as _streamText, convertToCoreMessages } from 'ai';
5
  import { getModel } from '~/lib/.server/llm/model';
6
  import { MAX_TOKENS } from './constants';
7
  import { getSystemPrompt } from './prompts';
8
- import { MODEL_LIST, DEFAULT_MODEL, DEFAULT_PROVIDER, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants';
9
 
10
  interface ToolResult<Name extends string, Args, Result> {
11
  toolCallId: string;
 
1
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
  // @ts-nocheck – TODO: Provider proper types
3
 
4
+ import { convertToCoreMessages, streamText as _streamText } from 'ai';
5
  import { getModel } from '~/lib/.server/llm/model';
6
  import { MAX_TOKENS } from './constants';
7
  import { getSystemPrompt } from './prompts';
8
+ import { DEFAULT_MODEL, DEFAULT_PROVIDER, MODEL_LIST, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants';
9
 
10
  interface ToolResult<Name extends string, Args, Result> {
11
  toolCallId: string;
package.json CHANGED
@@ -20,7 +20,8 @@
20
  "dockerbuild": "docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-development .",
21
  "typecheck": "tsc",
22
  "typegen": "wrangler types",
23
- "preview": "pnpm run build && pnpm run start"
 
24
  },
25
  "engines": {
26
  "node": ">=18.18.0"
@@ -101,6 +102,7 @@
101
  "@types/react": "^18.2.20",
102
  "@types/react-dom": "^18.2.7",
103
  "fast-glob": "^3.3.2",
 
104
  "is-ci": "^3.0.1",
105
  "node-fetch": "^3.3.2",
106
  "prettier": "^3.3.2",
 
20
  "dockerbuild": "docker build -t bolt-ai:development -t bolt-ai:latest --target bolt-ai-development .",
21
  "typecheck": "tsc",
22
  "typegen": "wrangler types",
23
+ "preview": "pnpm run build && pnpm run start",
24
+ "prepare": "husky"
25
  },
26
  "engines": {
27
  "node": ">=18.18.0"
 
102
  "@types/react": "^18.2.20",
103
  "@types/react-dom": "^18.2.7",
104
  "fast-glob": "^3.3.2",
105
+ "husky": "9.1.7",
106
  "is-ci": "^3.0.1",
107
  "node-fetch": "^3.3.2",
108
  "prettier": "^3.3.2",
pnpm-lock.yaml CHANGED
@@ -231,6 +231,9 @@ importers:
231
  fast-glob:
232
  specifier: ^3.3.2
233
  version: 3.3.2
 
 
 
234
  is-ci:
235
  specifier: ^3.0.1
236
  version: 3.0.1
@@ -2482,7 +2485,7 @@ packages:
2482
  resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==}
2483
 
2484
2485
- resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}
2486
  engines: {node: '>= 0.8'}
2487
 
2488
@@ -3382,6 +3385,11 @@ packages:
3382
  resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
3383
  engines: {node: '>=16.17.0'}
3384
 
 
 
 
 
 
3385
3386
  resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
3387
  engines: {node: '>=0.10.0'}
@@ -9278,6 +9286,8 @@ snapshots:
9278
 
9279
9280
 
 
 
9281
9282
  dependencies:
9283
  safer-buffer: 2.1.2
 
231
  fast-glob:
232
  specifier: ^3.3.2
233
  version: 3.3.2
234
+ husky:
235
+ specifier: 9.1.7
236
+ version: 9.1.7
237
  is-ci:
238
  specifier: ^3.0.1
239
  version: 3.0.1
 
2485
  resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==}
2486
 
2487
2488
+ resolution: {integrity: sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=}
2489
  engines: {node: '>= 0.8'}
2490
 
2491
 
3385
  resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
3386
  engines: {node: '>=16.17.0'}
3387
 
3388
3389
+ resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==}
3390
+ engines: {node: '>=18'}
3391
+ hasBin: true
3392
+
3393
3394
  resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
3395
  engines: {node: '>=0.10.0'}
 
9286
 
9287
9288
 
9289
9290
+
9291
9292
  dependencies:
9293
  safer-buffer: 2.1.2