Separate CLI from server and add compiler tests.#67
Merged
maejima-fumika merged 6 commits intocsg-tokyo:mainfrom Oct 5, 2025
Merged
Separate CLI from server and add compiler tests.#67maejima-fumika merged 6 commits intocsg-tokyo:mainfrom
maejima-fumika merged 6 commits intocsg-tokyo:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR separates the CLI functionality from the server package and adds comprehensive compiler tests. The refactoring restructures the project into a monorepo with separate CLI and server packages, where the server now exports only the compiler functionality as a library.
- Moves CLI commands from server to a dedicated CLI package
- Refactors the server package to export only compiler functionality as
@bluescript/compiler - Adds extensive test suite for the compiler with 15 test cases covering module imports, package system, and ESP-IDF components
Reviewed Changes
Copilot reviewed 18 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.base.json | Adds shared TypeScript configuration for the monorepo |
| server/tsconfig.json | Updates to extend base config and removes duplicated options |
| server/tests/compiler/compiler.test.ts | Adds comprehensive compiler test suite with 15 test scenarios |
| server/tests/compiler/compiler-test-utils.ts | Adds test utilities for compiler testing |
| server/src/index.ts | Changes from CLI entry point to library exports |
| server/src/compiler/compiler.ts | Refactors compiler implementation with improved error handling |
| server/package.json | Updates package metadata for library distribution |
| cli/src/index.ts | Moves CLI functionality from server package |
| cli/src/cli/run.ts | Updates imports to use new compiler package |
Files not reviewed (1)
- cli/package-lock.json: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/src/compiler/compiler.ts
Outdated
| } catch (error) { | ||
| this.logger.error(`Failed to link: ${error}`); | ||
| throw error; | ||
| throw new Error(`Failed to link: ${getErrorMessage}`, {cause: error}); |
There was a problem hiding this comment.
Missing function call parentheses. Should be ${getErrorMessage(error)} instead of ${getErrorMessage}.
Suggested change
| throw new Error(`Failed to link: ${getErrorMessage}`, {cause: error}); | |
| throw new Error(`Failed to link: ${getErrorMessage(error)}`, {cause: error}); |
| testEnv.clean(); | ||
| }); | ||
|
|
||
| it('should throw error if a specified ESP-IDF component does not exit.', async () => { |
There was a problem hiding this comment.
Corrected spelling of 'exit' to 'exist'.
Suggested change
| it('should throw error if a specified ESP-IDF component does not exit.', async () => { | |
| it('should throw error if a specified ESP-IDF component does not exist.', async () => { |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.