-
Notifications
You must be signed in to change notification settings - Fork 0
feat(): migration to esm #12
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
Changes from 10 commits
4d92340
0f112f9
c972a86
7422b59
9a538d2
5535a89
4dcadc1
b1eab19
4d59481
7674b0f
1f4a181
2950e39
8205922
720d27f
775be79
6365132
d279287
4819333
a516abf
0e9ae2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ packages/angular-mcp-server/ | |
| | **Prompt** | `prompts/prompt-registry.ts` | 1. Append schema to `PROMPTS`. <br>2. Provide implementation in `PROMPTS_IMPL`. | | ||
| | **Resource Provider** | `registerResources()` | Extend logic to aggregate custom docs or design-system assets. | | ||
|
|
||
| All tools share the `ToolsConfig` interface (`@push-based/models`) that bundles: | ||
| All tools share the `ToolsConfig` interface (`@code-pushup/models`) that bundles: | ||
|
||
| - `schema` (name, description, arguments, return type) | ||
| - `handler(request)` async function. | ||
|
|
||
|
|
@@ -110,7 +110,6 @@ Validation is handled via **Zod** in `angular-mcp-server-options.schema.ts`. | |
| models (types & schemas) | ||
| ├─ utils | ||
| ├─ styles-ast-utils | ||
| ├─ angular-cli-utils | ||
| └─ angular-ast-utils | ||
| └─ ds-component-coverage (top-level plugin) | ||
| ``` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,7 @@ File name **must** end with `.tool.ts` so tests & registries can auto-discover i | |
|
|
||
| ```ts | ||
| import { z } from 'zod'; | ||
| import { ToolSchemaOptions, ToolsConfig } from '@push-based/models'; | ||
| import { ToolSchemaOptions, ToolsConfig } from '@code-pushup/models'; | ||
|
||
| import { createHandler, RESULT_FORMATTERS } from '../shared/utils/handler-helpers.js'; | ||
|
|
||
| // 1️⃣ Schema | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import nxPreset from '@nx/jest/preset'; | ||
|
|
||
| export default { ...nxPreset }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export * from './lib/angular-mcp-server'; | ||
| export * from './lib/angular-mcp-server.js'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,11 +14,11 @@ export interface DeprecatedCssComponent { | |
| * @returns Array of deprecated CSS classes for the component | ||
| * @throws Error if file not found, invalid format, or component not found | ||
| */ | ||
| export function getDeprecatedCssClasses( | ||
| export async function getDeprecatedCssClasses( | ||
| componentName: string, | ||
| deprecatedCssClassesPath: string, | ||
| cwd: string, | ||
| ): string[] { | ||
| ): Promise<string[]> { | ||
| if ( | ||
| !deprecatedCssClassesPath || | ||
| typeof deprecatedCssClassesPath !== 'string' | ||
|
|
@@ -31,11 +31,10 @@ export function getDeprecatedCssClasses( | |
| throw new Error(`File not found at deprecatedCssClassesPath: ${absPath}`); | ||
| } | ||
|
|
||
| const module = require(absPath); | ||
| const module = await import(absPath); | ||
|
|
||
| // Handle both ES modules (export default) and CommonJS (module.exports) | ||
| // Support: export default dsComponents, module.exports = { dsComponents }, or direct module.exports = dsComponents | ||
| const dsComponents = module.default || module.dsComponents || module; | ||
| // Pure ESM: use export default | ||
| const dsComponents = module.default; | ||
|
||
|
|
||
| if (!Array.isArray(dsComponents)) { | ||
| throw new Error('Invalid export: expected dsComponents to be an array'); | ||
|
|
||
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.
Lets avoid using local paths in the source
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.
Done. Local MCP is not tracked anymore, example file available