Skip to content

Commit d83c40d

Browse files
Merge pull request #19 from push-based/feature/esm-migration
feat(angular-toolkit-mcp): prepare publishing
2 parents 3b9e9d6 + f724a62 commit d83c40d

File tree

13 files changed

+388
-119
lines changed

13 files changed

+388
-119
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
node-version: 20
3131
cache: 'npm'
3232

33-
- run: npm ci --legacy-peer-deps
33+
- run: npm ci
3434
- uses: nrwl/nx-set-shas@v4
3535
- run: npx nx format:check
3636

CONTRIBUTING.MD

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Thank you for your interest in contributing to the Angular Toolkit MCP! This doc
1313
- [Submitting Changes](#submitting-changes)
1414
- [Documentation](#documentation)
1515
- [Debugging](#debugging)
16+
- [Release Process](#release-process)
1617

1718
## 🚀 Getting Started
1819

@@ -38,7 +39,7 @@ Thank you for your interest in contributing to the Angular Toolkit MCP! This doc
3839

3940
2. **Build the project:**
4041
```bash
41-
npx nx build angular-mcp
42+
npx nx build angular-toolkit-mcp
4243
```
4344

4445
### Nx Workspace Commands
@@ -209,7 +210,7 @@ Before committing, ensure:
209210
Start the MCP server in debug mode:
210211

211212
```bash
212-
npx nx run angular-mcp:debug
213+
npx nx run angular-toolkit-mcp:debug
213214
```
214215

215216
This starts the server with the MCP Inspector for debugging.
@@ -222,6 +223,78 @@ This starts the server with the MCP Inspector for debugging.
222223
- Use `console.log` or debugger statements in development
223224
- Test with the minimal-repo examples
224225

226+
## 📦 Release Process
227+
228+
### Publishing to npm
229+
230+
The Angular Toolkit MCP is published to npm as `@push-based/angular-toolkit-mcp`. Only maintainers with appropriate permissions can publish new versions.
231+
232+
### Release Steps
233+
234+
1. **Update Version**
235+
236+
Update the version in `packages/angular-mcp/package.json` following semantic versioning:
237+
- **Patch** (0.1.0 → 0.1.1): Bug fixes
238+
- **Minor** (0.1.0 → 0.2.0): New features (backwards compatible)
239+
- **Major** (0.1.0 → 1.0.0): Breaking changes
240+
241+
2. **Build the Package**
242+
```bash
243+
npx nx build angular-toolkit-mcp
244+
```
245+
246+
3. **Test the Package**
247+
```bash
248+
cd packages/angular-mcp/dist
249+
npm pack
250+
# Test the generated .tgz file
251+
node main.js --help
252+
```
253+
254+
4. **Authenticate with npm**
255+
```bash
256+
npm login
257+
```
258+
Ensure you have access to the `@push-based` scope.
259+
260+
5. **Publish to npm**
261+
```bash
262+
npm run publish:mcp
263+
```
264+
Or manually:
265+
```bash
266+
npx nx build angular-toolkit-mcp
267+
cd packages/angular-mcp/dist
268+
npm publish
269+
```
270+
271+
6. **Verify Publication**
272+
```bash
273+
npm view @push-based/angular-toolkit-mcp
274+
npx @push-based/angular-toolkit-mcp@latest --help
275+
```
276+
277+
7. **Tag the Release**
278+
```bash
279+
git tag v0.1.0
280+
git push origin v0.1.0
281+
```
282+
283+
8. **Update Documentation**
284+
- Update CHANGELOG.md with release notes
285+
- Update any version references in documentation
286+
287+
### Pre-release Checklist
288+
289+
Before publishing a new version:
290+
- [ ] All tests pass (`npx nx run-many --target=test --all`)
291+
- [ ] No linting errors (`npx nx run-many --target=lint --all`)
292+
- [ ] Build succeeds (`npx nx build angular-toolkit-mcp`)
293+
- [ ] Version number updated in package.json
294+
- [ ] CHANGELOG.md updated with changes
295+
- [ ] Documentation updated as needed
296+
- [ ] Local npm pack test successful
297+
225298
## 📄 License
226299

227300
By contributing, you agree that your contributions will be licensed under the MIT License.

README.md

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@ A Model Context Protocol (MCP) server that provides Angular project analysis and
2020
- Breaking change detection during component updates
2121
- Code quality analysis and improvement
2222

23+
## Quick Start
24+
25+
Install and run via npx (no manual build required):
26+
27+
```json
28+
{
29+
"mcpServers": {
30+
"angular-toolkit": {
31+
"command": "npx",
32+
"args": [
33+
"@push-based/angular-toolkit-mcp@latest",
34+
"--workspaceRoot=/absolute/path/to/your/angular/workspace",
35+
"--ds.uiRoot=packages/ui"
36+
]
37+
}
38+
}
39+
}
40+
```
41+
42+
**Required Node.js version:** 18 or higher
43+
2344
## Configuration
2445

2546
### Prerequisites
@@ -28,39 +49,63 @@ A Model Context Protocol (MCP) server that provides Angular project analysis and
2849

2950
### Installation & Setup
3051

52+
#### For Users
53+
54+
Simply use npx as shown in the Quick Start section above. No installation or build required.
55+
56+
#### For Contributors (Local Development)
57+
3158
1. Clone the repository
3259

33-
2. Build the MCP
60+
2. Install dependencies and build the MCP
3461

35-
```bash
62+
```bash
3663
npm install
3764
npx nx build angular-mcp
38-
```
65+
```
3966

40-
2. Locate the built server
67+
3. Locate the built server
4168

4269
After building, the server will be available at `packages/angular-mcp/dist/main.js`
4370

4471
### MCP Configuration
4572

4673
Add the server to your MCP client configuration (e.g., Claude Desktop, Cursor, Copilot, Windsurf or other MCP-compatible clients):
4774

48-
#### For Cursor (`.cursor/mcp.json` or MCP settings):
75+
#### For Users (npx - Recommended)
76+
77+
```json
78+
{
79+
"mcpServers": {
80+
"angular-toolkit": {
81+
"command": "npx",
82+
"args": [
83+
"@push-based/angular-toolkit-mcp@latest",
84+
"--workspaceRoot=/absolute/path/to/your/angular/workspace",
85+
"--ds.uiRoot=relative/path/to/ui/components",
86+
"--ds.storybookDocsRoot=relative/path/to/storybook/docs",
87+
"--ds.deprecatedCssClassesPath=relative/path/to/component-options.mjs"
88+
]
89+
}
90+
}
91+
}
92+
```
93+
94+
#### For Contributors (Local Development)
4995

50-
Copy `.cursor/mcp.json.example` to the project you're working on. Copied file should be: `.cursor/mcp.json` and update `angular-toolkit-mcp` values accordingly:
96+
When developing locally, point to the built server:
5197

5298
```json
5399
{
54100
"mcpServers": {
55-
...(other servers)...
56101
"angular-toolkit-mcp": {
57102
"command": "node",
58103
"args": [
59-
"/absolute/path/to/angular-mcp-server/packages/angular-mcp-server/dist/index.js",
104+
"/absolute/path/to/angular-toolkit-mcp/packages/angular-mcp/dist/main.js",
60105
"--workspaceRoot=/absolute/path/to/your/angular/workspace",
106+
"--ds.uiRoot=relative/path/to/ui/components",
61107
"--ds.storybookDocsRoot=relative/path/to/storybook/docs",
62-
"--ds.deprecatedCssClassesPath=relative/path/to/component-options.js",
63-
"--ds.uiRoot=relative/path/to/ui/components"
108+
"--ds.deprecatedCssClassesPath=relative/path/to/component-options.mjs"
64109
]
65110
}
66111
}
@@ -85,7 +130,7 @@ Copy `.cursor/mcp.json.example` to the project you're working on. Copied file sh
85130
| Parameter | Type | Description | Example |
86131
|-----------|------|-------------|---------|
87132
| `ds.storybookDocsRoot` | Relative path | Root directory containing Storybook documentation used by documentation-related tools | `storybook/docs` |
88-
| `ds.deprecatedCssClassesPath` | Relative path | JavaScript file mapping deprecated CSS classes used by violation and deprecated CSS tools | `design-system/component-options.js` |
133+
| `ds.deprecatedCssClassesPath` | Relative path | JavaScript file mapping deprecated CSS classes used by violation and deprecated CSS tools | `design-system/component-options.mjs` |
89134

90135
When optional parameters are omitted:
91136

@@ -94,7 +139,7 @@ When optional parameters are omitted:
94139

95140
#### Deprecated CSS Classes File Format
96141

97-
The `component-options.js` file should export an array of component configurations:
142+
The `component-options.mjs` file should export an array of component configurations:
98143

99144
```javascript
100145
const dsComponents = [
@@ -121,7 +166,7 @@ my-angular-workspace/
121166
│ │ ├── modal/
122167
│ │ └── ...
123168
│ └── design-system/
124-
│ └── component-options.js # ds.deprecatedCssClassesPath
169+
│ └── component-options.mjs # ds.deprecatedCssClassesPath
125170
├── storybook/
126171
│ └── docs/ # ds.storybookDocsRoot
127172
└── apps/
@@ -132,7 +177,7 @@ my-angular-workspace/
132177

133178
- **Server not starting**: Ensure all paths are correct and the server is built
134179
- **Permission errors**: Check that the Node.js process has read access to all specified directories
135-
- **Component not found**: Verify that component names in `component-options.js` match your actual component class names
180+
- **Component not found**: Verify that component names in `component-options.mjs` match your actual component class names
136181
- **Path resolution issues**: Use absolute paths for `workspaceRoot` and relative paths (from workspace root) for other parameters
137182

138183
## Available Tools

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Instead of the palette-based flow, copy the manual configuration from your works
4444
"./packages/angular-mcp/dist/main.js",
4545
"--workspaceRoot=/absolute/path/to/angular-toolkit-mcp",
4646
"--ds.storybookDocsRoot=packages/minimal-repo/packages/design-system/storybook-host-app/src/components",
47-
"--ds.deprecatedCssClassesPath=packages/minimal-repo/packages/design-system/component-options.js",
47+
"--ds.deprecatedCssClassesPath=packages/minimal-repo/packages/design-system/component-options.mjs",
4848
"--ds.uiRoot=packages/minimal-repo/packages/design-system/ui"
4949
]
5050
}

package-lock.json

Lines changed: 18 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"version": "0.0.0",
44
"type": "module",
55
"license": "MIT",
6-
"scripts": {},
6+
"scripts": {
7+
"publish:mcp": "nx build @push-based/angular-toolkit-mcp && cd packages/angular-mcp/dist && npm publish"
8+
},
79
"private": true,
810
"devDependencies": {
911
"@eslint/js": "^9.28.0",
@@ -34,6 +36,7 @@
3436
"eslint-config-prettier": "10.1.5",
3537
"eslint-plugin-functional": "^9.0.2",
3638
"eslint-plugin-unicorn": "^59.0.1",
39+
"ignore-loader": "^0.1.2",
3740
"jest": "^29.7.0",
3841
"jest-environment-node": "^29.7.0",
3942
"jiti": "2.4.2",

0 commit comments

Comments
 (0)