-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/typescript check errors #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JonasJesus42
wants to merge
4
commits into
main
Choose a base branch
from
fix/typescript-check-errors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f21ca8b
fix: resolve TypeScript check errors
JonasJesus42 6e2fb9d
feat: optimize TypeScript check with parallel execution
JonasJesus42 3fdd545
chore: update @decocms/runtime to 1.2.7 across all MCPs
JonasJesus42 95ec21e
Fix formatting issue in README.md
JonasJesus42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| #!/usr/bin/env bun | ||
| /** | ||
| * Optimized TypeScript check script | ||
| * Runs checks in parallel with concurrency limit to avoid overwhelming the system | ||
| */ | ||
|
|
||
| import { $ } from "bun"; | ||
| import { join } from "node:path"; | ||
|
|
||
| const MAX_CONCURRENT = 8; // Run 4 checks at a time | ||
| const ROOT_DIR = import.meta.dir.replace("/scripts", ""); | ||
|
|
||
| async function getWorkspaces(): Promise<string[]> { | ||
| const pkg = await Bun.file(join(ROOT_DIR, "package.json")).json(); | ||
| return pkg.workspaces || []; | ||
| } | ||
|
|
||
| async function hasTypeScriptConfig(dir: string): Promise<boolean> { | ||
| const tsConfigPath = join(ROOT_DIR, dir, "tsconfig.json"); | ||
| const file = Bun.file(tsConfigPath); | ||
| return await file.exists(); | ||
| } | ||
|
|
||
| async function runCheck(workspace: string): Promise<{ | ||
| workspace: string; | ||
| success: boolean; | ||
| error?: string; | ||
| }> { | ||
| try { | ||
| const cwd = join(ROOT_DIR, workspace); | ||
| await $`cd ${cwd} && bun run check`.quiet(); | ||
| return { workspace, success: true }; | ||
| } catch (error) { | ||
| return { | ||
| workspace, | ||
| success: false, | ||
| error: error instanceof Error ? error.message : String(error), | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| async function runChecksInBatches( | ||
| workspaces: string[], | ||
| concurrency: number, | ||
| ): Promise<void> { | ||
| const results: Array<{ | ||
| workspace: string; | ||
| success: boolean; | ||
| error?: string; | ||
| }> = []; | ||
| let completed = 0; | ||
|
|
||
| console.log( | ||
| `🔍 Running TypeScript checks on ${workspaces.length} workspaces (${concurrency} concurrent)...\n`, | ||
| ); | ||
|
|
||
| // Process workspaces in batches | ||
| for (let i = 0; i < workspaces.length; i += concurrency) { | ||
| const batch = workspaces.slice(i, i + concurrency); | ||
| const batchPromises = batch.map((ws) => runCheck(ws)); | ||
|
|
||
| const batchResults = await Promise.all(batchPromises); | ||
| results.push(...batchResults); | ||
|
|
||
| completed += batch.length; | ||
| const progress = Math.round((completed / workspaces.length) * 100); | ||
| console.log(`Progress: ${completed}/${workspaces.length} (${progress}%)`); | ||
| } | ||
|
|
||
| // Print results | ||
| console.log("\n" + "=".repeat(60)); | ||
| const failed = results.filter((r) => !r.success); | ||
| const passed = results.filter((r) => r.success); | ||
|
|
||
| console.log(`✅ Passed: ${passed.length}`); | ||
| console.log(`❌ Failed: ${failed.length}`); | ||
|
|
||
| if (failed.length > 0) { | ||
| console.log("\nFailed workspaces:"); | ||
| for (const result of failed) { | ||
| console.log(` - ${result.workspace}`); | ||
| } | ||
| process.exit(1); | ||
| } else { | ||
| console.log("\n🎉 All checks passed!"); | ||
| } | ||
| } | ||
|
|
||
| // Main | ||
| async function main() { | ||
| const args = process.argv.slice(2); | ||
| const changedOnly = args.includes("--changed"); | ||
|
|
||
| let workspaces = await getWorkspaces(); | ||
|
|
||
| // Filter to only workspaces with tsconfig.json | ||
| const workspacesWithTS = []; | ||
| for (const ws of workspaces) { | ||
| if (await hasTypeScriptConfig(ws)) { | ||
| workspacesWithTS.push(ws); | ||
| } | ||
| } | ||
|
|
||
| if (changedOnly) { | ||
| // Get changed files | ||
| try { | ||
| const output = await $`git diff --name-only origin/main...HEAD`.text(); | ||
| const changedFiles = output.trim().split("\n"); | ||
| const changedWorkspaces = new Set<string>(); | ||
|
|
||
| for (const file of changedFiles) { | ||
| const ws = workspacesWithTS.find((w) => file.startsWith(`${w}/`)); | ||
| if (ws) { | ||
| changedWorkspaces.add(ws); | ||
| } | ||
| } | ||
|
|
||
| if (changedWorkspaces.size === 0) { | ||
| console.log("No changed workspaces found. Checking all..."); | ||
| } else { | ||
| workspacesWithTS.length = 0; | ||
| workspacesWithTS.push(...changedWorkspaces); | ||
| console.log( | ||
| `Checking ${changedWorkspaces.size} changed workspaces only\n`, | ||
| ); | ||
| } | ||
| } catch (error) { | ||
| console.log( | ||
| "Could not detect changed files. Checking all workspaces...\n", | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| await runChecksInBatches(workspacesWithTS, MAX_CONCURRENT); | ||
| } | ||
|
|
||
| main(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Remove the extra space between “storage” and “providers” to avoid a typo in the README.
Prompt for AI agents