Skip to content

Commit 0f82909

Browse files
authored
Merge pull request #2 from sourcefuse/GH-1
feat(chore):integration between lb4 applications and mcp
2 parents e15dcec + 9e88e4e commit 0f82909

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+19206
-3666
lines changed

.cz-config.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
module.exports = {
2+
types: [
3+
{value: 'feat', name: 'feat: A new feature'},
4+
{value: 'fix', name: 'fix: A bug fix'},
5+
{value: 'docs', name: 'docs: Documentation only changes'},
6+
{
7+
value: 'style',
8+
name: 'style: Changes that do not affect the meaning of the code\n (white-space, formatting, missing semi-colons, etc)',
9+
},
10+
{
11+
value: 'refactor',
12+
name: 'refactor: A code change that neither fixes a bug nor adds a feature',
13+
},
14+
{
15+
value: 'perf',
16+
name: 'perf: A code change that improves performance',
17+
},
18+
{value: 'test', name: 'test: Adding missing tests'},
19+
{
20+
value: 'chore',
21+
name: 'chore: Changes to the build process or auxiliary tools\n and libraries such as documentation generation',
22+
},
23+
{value: 'revert', name: 'revert: Reverting a commit'},
24+
{value: 'WIP', name: 'WIP: Work in progress'},
25+
],
26+
27+
scopes: [
28+
{name: 'chore'},
29+
{name: 'deps'},
30+
{name: 'ci-cd'},
31+
{name: 'core'},
32+
{name: 'maintenance'},
33+
],
34+
35+
appendBranchNameToCommitMessage: true,
36+
appendIssueFromBranchName: true,
37+
allowTicketNumber: false,
38+
isTicketNumberRequired: false,
39+
40+
// override the messages, defaults are as follows
41+
messages: {
42+
type: "Select the type of change that you're committing:",
43+
scope: 'Denote the SCOPE of this change:',
44+
// used if allowCustomScopes is true
45+
customScope: 'Denote the SCOPE of this change:',
46+
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
47+
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
48+
breaking: 'List any BREAKING CHANGES (optional):\n',
49+
footer: 'List any ISSUES CLOSED by this change (optional). E.g.: GH-144:\n',
50+
confirmCommit: 'Are you sure you want to proceed with the commit above?',
51+
},
52+
53+
allowCustomScopes: false,
54+
allowBreakingChanges: ['feat', 'fix'],
55+
56+
// limit subject length
57+
subjectLimit: 100,
58+
breaklineChar: '|', // It is supported for fields body and footer.
59+
footerPrefix: '',
60+
askForBreakingChangeFirst: true, // default is false
61+
};

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ node_modules/
22
dist/
33
coverage/
44
.eslintrc.js
5+
.cz-config.js
6+
commitlint.config.js

.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
module.exports = {
22
extends: '@loopback/eslint-config',
3+
rules: {
4+
'no-extra-boolean-cast': 'off',
5+
'@typescript-eslint/interface-name-prefix': 'off',
6+
'no-prototype-builtins': 'off',
7+
'no-await-in-loop': 'error',
8+
},
9+
parserOptions: {
10+
project: './tsconfig.json',
11+
tsconfigRootDir: __dirname,
12+
},
313
};

.github/CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

.github/CONTRIBUTING.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# loopback4-mcp
2+
3+
## Contributing
4+
5+
First off, thank you for considering contributing to the project. It's people like you that helps in keeping this extension useful.
6+
7+
### Where do I go from here?
8+
9+
If you've noticed a bug or have a question, [search the issue tracker](https://github.com/sourcefuse/loopback4-mcp/issues) to see if
10+
someone else in the community has already created a ticket. If not, go ahead and
11+
[make one](https://github.com/sourcefuse/loopback4-mcp/issues/new/choose)!
12+
13+
### Fork & create a branch
14+
15+
If this is something you think you can fix, then [fork](https://help.github.com/articles/fork-a-repo) this repo and
16+
create a branch with a descriptive name.
17+
18+
A good branch name would be (where issue #325 is the ticket you're working on):
19+
20+
```sh
21+
git checkout -b 325-add-new-feature
22+
```
23+
24+
### Make a Pull Request
25+
26+
At this point, you should switch back to your master branch and make sure it's
27+
up to date with loopback4-mcp's master branch:
28+
29+
```sh
30+
git remote add upstream [email protected]:sourcefuse/loopback4-mcp.git
31+
git checkout master
32+
git pull upstream master
33+
```
34+
35+
Then update your feature branch from your local copy of master, and push it!
36+
37+
```sh
38+
git checkout 325-add-new-feature
39+
git rebase master
40+
git push --set-upstream origin 325-add-new-feature
41+
```
42+
43+
Finally, go to GitHub and [make a Pull Request](https://help.github.com/articles/creating-a-pull-request).
44+
45+
### Keeping your Pull Request updated
46+
47+
If a maintainer asks you to "rebase" your PR, they're saying that a lot of code
48+
has changed, and that you need to update your branch so it's easier to merge.
49+
50+
To learn more about rebasing in Git, there are a lot of [good][git rebasing]
51+
[resources][interactive rebase] but here's the suggested workflow:
52+
53+
```sh
54+
git checkout 325-add-new-feature
55+
git pull --rebase upstream master
56+
git push --force-with-lease 325-add-new-feature
57+
```
58+
59+
[git rebasing]: http://git-scm.com/book/en/Git-Branching-Rebasing
60+
[interactive rebase]: https://help.github.com/articles/interactive-rebase
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Additional context**
27+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Intermediate change (work in progress)
15+
16+
## How Has This Been Tested?
17+
18+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
19+
20+
- [ ] Test A
21+
- [ ] Test B
22+
23+
## Checklist:
24+
25+
- [ ] Performed a self-review of my own code
26+
- [ ] npm test passes on your machine
27+
- [ ] New tests added or existing tests modified to cover all changes
28+
- [ ] Code conforms with the style guide
29+
- [ ] API Documentation in code was updated
30+
- [ ] Any dependent changes have been merged and published in downstream modules

.github/workflows/main.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
node_matrix_tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [20, 22, 24]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: Install Dependencies
21+
run: npm ci --ignore-scripts
22+
- name: Run Test Cases
23+
run: npm run test
24+
25+
npm_test:
26+
runs-on: ubuntu-latest
27+
needs: node_matrix_tests
28+
if: success()
29+
steps:
30+
- name: Final status
31+
run: echo "✅ All tests passed for Node.js 20, 22, and 24"

.github/workflows/release.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This Manually Executable Workflow is for NPM Releases
2+
3+
name: Release [Manual]
4+
on: workflow_dispatch
5+
6+
permissions:
7+
contents: write
8+
id-token: write # REQUIRED for trusted publishing
9+
10+
jobs:
11+
Release:
12+
runs-on: ubuntu-latest
13+
# Specify environment if you configured one in npm
14+
# environment: production # Uncomment if you set an environment name in npm trusted publisher settings
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
# fetch-depth is necessary to get all tags
20+
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
21+
fetch-depth: 0
22+
token: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4 # UPDATED to v4
26+
with:
27+
node-version: '22'
28+
registry-url: 'https://registry.npmjs.org'
29+
always-auth: false # important for trusted publishing
30+
31+
- name: Configure CI Git User
32+
run: |
33+
git config --global user.name $CONFIG_USERNAME
34+
git config --global user.email $CONFIG_EMAIL
35+
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/loopback4-mcp
36+
env:
37+
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
38+
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
39+
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
40+
41+
- name: Install 📌
42+
run: npm install --ignore-scripts
43+
44+
- name: Test 🔧
45+
run: npm run test
46+
47+
# ✅ CHANGED THIS SECTION
48+
- name: Semantic Publish to NPM 🚀
49+
run: |
50+
npm config set provenance true
51+
HUSKY=0 npx semantic-release
52+
env:
53+
GH_TOKEN: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
54+
# REMOVED: NPM_TOKEN is not needed with trusted publishing
55+
# The id-token: write permission above handles authentication
56+
57+
- name: Changelog 📝
58+
run: cd src/release_notes && HUSKY=0 node release-notes.js

0 commit comments

Comments
 (0)