-
Notifications
You must be signed in to change notification settings - Fork 50
feat(token-analyzer-mcp): Token analyzer mcp scaffold #403
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
5336b2c
cb567ff
d61e5e0
552f384
47b7b48
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 |
|---|---|---|
|
|
@@ -66,8 +66,8 @@ | |
| "@swc/core": "1.11.24", | ||
| "@swc/helpers": "~0.5.11", | ||
| "@swc/jest": "0.2.38", | ||
| "@testing-library/react": "16.3.0", | ||
| "@testing-library/dom": "10.4.0", | ||
| "@testing-library/react": "16.3.0", | ||
| "@testing-library/user-event": "14.6.1", | ||
| "@types/jest": "29.5.14", | ||
| "@types/node": "20.14.9", | ||
|
|
@@ -82,6 +82,7 @@ | |
| "globals": "15.15.0", | ||
| "jest": "29.7.0", | ||
| "jest-environment-jsdom": "29.7.0", | ||
| "jest-environment-node": "^29.7.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was also added by the generator ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checked with source - it was, which is expected, as this lib is setting
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, there's no UI so no need for JSDOM test env. |
||
| "jsonc-eslint-parser": "2.4.0", | ||
| "nx": "20.8.2", | ||
| "parsel-js": "^1.1.2", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| { | ||
| "jsc": { | ||
| "target": "es2019", | ||
| "parser": { | ||
| "syntax": "typescript", | ||
| "tsx": true, | ||
| "decorators": false, | ||
| "dynamicImport": false | ||
| }, | ||
| "transform": { | ||
| "react": { | ||
| "runtime": "classic", | ||
| "useSpread": true | ||
| } | ||
| }, | ||
| "keepClassNames": true, | ||
| "externalHelpers": true, | ||
| "loose": true | ||
| }, | ||
| "sourceMaps": true, | ||
| "exclude": [ | ||
| "jest.config.ts", | ||
| ".*\\.spec.tsx?$", | ||
| ".*\\.test.tsx?$", | ||
| "./src/jest-setup.ts$", | ||
| "./**/jest-setup.ts$", | ||
| ".*.js$" | ||
| ], | ||
| "$schema": "https://json.schemastore.org/swcrc" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # token-analyzer-mcp | ||
|
|
||
| This library was generated with [Nx](https://nx.dev). | ||
|
|
||
| ## Building | ||
|
|
||
| Run `nx build token-analyzer-mcp` to build the library. | ||
|
|
||
| ## Running unit tests | ||
|
|
||
| Run `nx test token-analyzer-mcp` to execute the unit tests via [Jest](https://jestjs.io). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| const baseConfig = require('../../eslint.config.js'); | ||
|
|
||
| module.exports = [ | ||
| ...baseConfig, | ||
| { | ||
| files: ['**/*.json'], | ||
| rules: { | ||
| '@nx/dependency-checks': [ | ||
| 'error', | ||
| { | ||
| ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'], | ||
| }, | ||
| ], | ||
| }, | ||
| languageOptions: { | ||
| parser: require('jsonc-eslint-parser'), | ||
| }, | ||
| }, | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| const baseConfig = require('../../eslint.config.js'); | ||
|
|
||
| module.exports = [ | ||
| ...baseConfig, | ||
| { | ||
| files: ['**/*.ts', '**/*.tsx'], | ||
| // Override or add rules here | ||
| rules: {}, | ||
| }, | ||
| { | ||
| files: ['**/*.js', '**/*.jsx'], | ||
| // Override or add rules here | ||
| rules: {}, | ||
| }, | ||
| ]; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* eslint-disable */ | ||
| import { readFileSync } from 'fs'; | ||
|
|
||
| // Reading the SWC compilation config and remove the "exclude" | ||
| // for the test files to be compiled by SWC | ||
| const { exclude: _, ...swcJestConfig } = JSON.parse( | ||
| readFileSync(`${__dirname}/.swcrc`, 'utf-8') | ||
| ); | ||
|
|
||
| // disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves. | ||
| // If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude" | ||
| if (swcJestConfig.swcrc === undefined) { | ||
| swcJestConfig.swcrc = false; | ||
| } | ||
|
|
||
| // Uncomment if using global setup/teardown files being transformed via swc | ||
| // https://nx.dev/nx-api/jest/documents/overview#global-setupteardown-with-nx-libraries | ||
| // jest needs EsModule Interop to find the default exported setup/teardown functions | ||
| // swcJestConfig.module.noInterop = false; | ||
|
|
||
| export default { | ||
| displayName: 'token-analyzer-mcp', | ||
| preset: '../../jest.preset.js', | ||
| transform: { | ||
| '^.+\\.[tj]s$': ['@swc/jest', swcJestConfig], | ||
| }, | ||
| moduleFileExtensions: ['ts', 'js', 'html'], | ||
| testEnvironment: 'node', | ||
| coverageDirectory: '../../coverage/packages/token-analyzer-mcp', | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "name": "@fluentui-contrib/token-analyzer-mcp", | ||
| "version": "0.0.1", | ||
| "main": "./src/index.js", | ||
| "types": "./src/index.d.ts", | ||
| "dependencies": {}, | ||
| "private": true | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "name": "token-analyzer-mcp", | ||
| "$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
| "sourceRoot": "packages/token-analyzer-mcp/src", | ||
| "projectType": "library", | ||
| "tags": [], | ||
| "targets": { | ||
| "build": { | ||
| "executor": "@fluentui-contrib/nx-plugin:build" | ||
| }, | ||
| "lint": { | ||
| "executor": "@nx/eslint:lint", | ||
| "options": { | ||
| "lintFilePatterns": [ | ||
| "packages/token-analyzer-mcp/**/*.ts", | ||
| "packages/token-analyzer-mcp/**/*.tsx" | ||
| ] | ||
| } | ||
| }, | ||
| "test": { | ||
| "executor": "@nx/jest:jest", | ||
| "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
| "options": { | ||
| "jestConfig": "packages/token-analyzer-mcp/jest.config.ts", | ||
| "passWithNoTests": true | ||
| } | ||
| }, | ||
| "type-check": { | ||
| "executor": "@fluentui-contrib/nx-plugin:type-check" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export {}; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "extends": "../../tsconfig.base.json", | ||
| "files": [], | ||
| "compilerOptions": { | ||
| "jsx": "react" | ||
| }, | ||
| "include": [], | ||
| "references": [ | ||
| { | ||
| "path": "./tsconfig.lib.json" | ||
| }, | ||
| { | ||
| "path": "./tsconfig.spec.json" | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "../../dist/out-tsc", | ||
| "declaration": true | ||
| }, | ||
| "include": ["src/**/*.ts"], | ||
| "exclude": [ | ||
| "jest.config.ts", | ||
| "src/**/*.test.ts", | ||
| "src/**/*.test.tsx", | ||
| "files/**" | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "extends": "./tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "../../dist/out-tsc", | ||
| "module": "commonjs", | ||
| "types": ["jest", "node"] | ||
| }, | ||
| "include": [ | ||
| "jest.config.ts", | ||
| "src/**/*.test.ts", | ||
| "src/**/*.test.tsx", | ||
| "src/**/*.d.ts" | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.