Skip to content

Separate CLI from server and add compiler tests.#67

Merged
maejima-fumika merged 6 commits intocsg-tokyo:mainfrom
maejima-fumika:add-compiler-test
Oct 5, 2025
Merged

Separate CLI from server and add compiler tests.#67
maejima-fumika merged 6 commits intocsg-tokyo:mainfrom
maejima-fumika:add-compiler-test

Conversation

@maejima-fumika
Copy link
Copy Markdown
Collaborator

No description provided.

@chibash chibash requested a review from Copilot October 5, 2025 06:04
Copy link
Copy Markdown
Contributor

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

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.

} catch (error) {
this.logger.error(`Failed to link: ${error}`);
throw error;
throw new Error(`Failed to link: ${getErrorMessage}`, {cause: error});
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

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});

Copilot uses AI. Check for mistakes.
testEnv.clean();
});

it('should throw error if a specified ESP-IDF component does not exit.', async () => {
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

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

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 () => {

Copilot uses AI. Check for mistakes.
@maejima-fumika maejima-fumika merged commit ea6ac4d into csg-tokyo:main Oct 5, 2025
2 checks passed
@maejima-fumika maejima-fumika deleted the add-compiler-test branch October 8, 2025 02:21
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