Skip to content

feat: compiler watch mode#2

Merged
Floffah merged 3 commits intomainfrom
feature/watch-mode
Mar 2, 2026
Merged

feat: compiler watch mode#2
Floffah merged 3 commits intomainfrom
feature/watch-mode

Conversation

@Floffah
Copy link
Copy Markdown
Owner

@Floffah Floffah commented Mar 2, 2026

What this changes

Adds watch mode (--watch) to the compiler.

(Also reorganises some tests)

How I tested this

Ran it against the basic example

Checklist

  • I have read CONTRIBUTING.md and this PR follows the guidelines
  • A human has reviewed the entire diff of this PR, every line of code
  • A human understands the changes and can explain why this approach is correct
  • This PR doesn't have AI-generated boilerplate or co-author lines
  • Tests pass
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have created a changeset (if appropriate)
  • This PR was authored and submitted by an AI agent without human review

Copilot AI review requested due to automatic review settings March 2, 2026 23:12
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 2, 2026

Worth a look

Unchecked items in the PR checklist

Each checkbox is an attestation — please fill them in honestly. If one doesn't apply to your change, note why in the description.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a --watch mode to the sqts compiler so it can recompile automatically on file changes, while also expanding the test suite around SQL parsing/introspection and compiler helpers, and enabling package/type linting in the build configs.

Changes:

  • Add watch mode (--watch) to the sqts compile CLI and implement a chokidar-based watcher.
  • Refactor/add Bun tests (and snapshots) for SQL parsing, schema introspection, and compiler utilities.
  • Enable publint / attw in tsdown configs and add corresponding dev dependencies.

Reviewed changes

Copilot reviewed 19 out of 28 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/core/src/compiler/compileProject.ts Adds watchAndCompileProject, switches globbing to tinyglobby, and uses ctx.tsCompilerOptions for ts-morph project creation.
packages/core/src/compiler/getCompileContext.ts Augments compile context with tsCompilerOptions loaded from tsconfig.json.
packages/core/src/cli.ts Adds --watch flag to the compile command and routes to watch vs one-shot compile.
packages/core/package.json Adds chokidar and replaces glob with tinyglobby.
packages/core/tsconfig.json Adds @/tests/* path alias for test imports.
packages/core/tests/** Adds/refactors compiler/parser tests and snapshots; introduces shared test utilities.
packages/core/src/compiler/lib/*.test.ts Removes colocated tests in src (moved under packages/core/tests).
packages/sql/tests/** Adds SQL parser + schema introspection tests and snapshots.
packages/*/tsdown.config.ts Enables publint and attw during builds.
package.json / bun.lock Adds publint + @arethetypeswrong/core and updates lockfile.
.changeset/spicy-hats-dream.md Declares a minor bump for @sqts/core for watch mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/compiler/compileProject.ts
Comment thread packages/core/src/compiler/compileProject.ts Outdated
Comment thread packages/core/src/compiler/compileProject.ts Outdated
Comment thread packages/core/src/cli.ts
Comment thread packages/core/src/compiler/compileProject.ts Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 28 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/cli.ts
Comment thread packages/core/src/compiler/compileProject.ts
Comment thread packages/core/src/compiler/compileProject.ts
Comment thread packages/core/src/compiler/compileProject.ts
@Floffah Floffah merged commit 6fef1be into main Mar 2, 2026
3 checks passed
@Floffah Floffah deleted the feature/watch-mode branch March 2, 2026 23:49
@github-actions github-actions bot mentioned this pull request Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants