Skip to content

Commit a8a663b

Browse files
Sunny  TyagiSunny  Tyagi
authored andcommitted
feat(pkg): refactor the implementation and add event bridge startegy
refactor the implementation and add event bridge startegy gh-3
1 parent 7849527 commit a8a663b

File tree

125 files changed

+27509
-22307
lines changed

Some content is hidden

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

125 files changed

+27509
-22307
lines changed

.cz-config.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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: 'component'},
32+
{name: 'provider'},
33+
{name: 'core'},
34+
{name: 'maintenance'},
35+
{name: 'sqs'},
36+
{name: 'event-bridge'},
37+
{name: 'bullmq'},
38+
{name: 'pkg'},
39+
],
40+
41+
appendBranchNameToCommitMessage: true,
42+
appendIssueFromBranchName: true,
43+
allowTicketNumber: false,
44+
isTicketNumberRequired: false,
45+
46+
// override the messages, defaults are as follows
47+
messages: {
48+
type: "Select the type of change that you're committing:",
49+
scope: 'Denote the SCOPE of this change:',
50+
// used if allowCustomScopes is true
51+
customScope: 'Denote the SCOPE of this change:',
52+
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
53+
body: 'Provide a LONGER description of the change (mandatory). Use "\\n" to break new line:\n',
54+
breaking: 'List any BREAKING CHANGES (optional):\n',
55+
footer: 'List any ISSUES CLOSED by this change (optional). E.g.: GH-144:\n',
56+
confirmCommit: 'Are you sure you want to proceed with the commit above?',
57+
},
58+
59+
allowCustomScopes: false,
60+
allowBreakingChanges: ['feat', 'fix'],
61+
62+
// limit subject length
63+
subjectLimit: 100,
64+
breaklineChar: '|', // It is supported for fields body and footer.
65+
footerPrefix: '',
66+
askForBreakingChangeFirst: true, // default is false
67+
};

.github/workflows/build-image.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/main.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,13 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-node@v3
1818
with:
19-
node-version: ${{ matrix.node-version }}
19+
node-version: '^20.x'
20+
2021
- name: Install Monorepo Deps
2122
run: npm ci
23+
2224
- name: Run Test Cases
23-
run: npm run test --workspaces --if-present
24-
- name: Run Lint Checks
25-
run: npm run lint --workspaces --if-present
25+
run: npm run test
2626

27-
npm_test:
28-
runs-on: ubuntu-latest
29-
needs: node_matrix_tests
30-
if: success()
31-
steps:
32-
- name: Final status
33-
run: echo "✅ All tests passed for Node.js 20, 22, and 24"
27+
- name: Run Lint Checks
28+
run: npm run lint

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This Manually Executable Workflow is for NPM Releases
2+
3+
name: Release [Manual]
4+
on: workflow_dispatch
5+
permissions:
6+
contents: write
7+
jobs:
8+
Release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
# fetch-depth is necessary to get all tags
14+
# otherwise lerna can't detect the changes and will end up bumping the versions for all packages
15+
fetch-depth: 0
16+
token: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
17+
- name: Setup Node
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: '20.x'
21+
- name: Configure CI Git User
22+
run: |
23+
git config --global user.name $CONFIG_USERNAME
24+
git config --global user.email $CONFIG_EMAIL
25+
git remote set-url origin https://$GITHUB_ACTOR:[email protected]/sourcefuse/loopback4-message-bus-queue-connector
26+
env:
27+
GITHUB_PAT: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
28+
CONFIG_USERNAME: ${{ vars.RELEASE_COMMIT_USERNAME }}
29+
CONFIG_EMAIL: ${{ vars.RELEASE_COMMIT_EMAIL }}
30+
- name: Authenticate with Registry
31+
run: |
32+
echo "@${NPM_USERNAME}:registry=https://registry.npmjs.org/" > .npmrc
33+
echo "registry=https://registry.npmjs.org/" >> .npmrc
34+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
35+
npm whoami
36+
env:
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
NPM_USERNAME: ${{ vars.NPM_USERNAME }}
39+
40+
- name: Install 📌
41+
run: |
42+
npm install
43+
- name: Test 🔧
44+
run: npm run test
45+
- name: Semantic Publish to NPM 🚀
46+
# "HUSKY=0" disables pre-commit-msg check (Needed in order to allow semantic-release perform the release commit)
47+
run: HUSKY=0 npx semantic-release
48+
env:
49+
GH_TOKEN: ${{ secrets.RELEASE_COMMIT_GH_PAT }}
50+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51+
- name: Changelog 📝
52+
run: cd src/release_notes && HUSKY=0 node release-notes.js

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# These are some examples of commonly ignored file patterns.
2+
# You should customize this list as applicable to your project.
3+
# Learn more about .gitignore:
4+
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
5+
6+
# Node artifact files
7+
node_modules/
8+
dist/
9+
10+
# Compiled Java class files
11+
*.class
12+
13+
# Compiled Python bytecode
14+
*.py[cod]
15+
16+
# Log files
17+
*.log
18+
19+
# Package files
20+
*.jar
21+
22+
# Maven
23+
target/
24+
dist/
25+
26+
# JetBrains IDE
27+
.idea/
28+
29+
# Unit test reports
30+
TEST*.xml
31+
32+
# Generated by MacOS
33+
.DS_Store
34+
35+
# Generated by Windows
36+
Thumbs.db
37+
38+
# Applications
39+
*.app
40+
*.exe
41+
*.war
42+
43+
# Large media files
44+
*.mp4
45+
*.tiff
46+
*.avi
47+
*.flv
48+
*.mov
49+
*.wmv
50+
coverage
51+
.scannerwork/

.husky/commit-msg

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx --no-install commitlint --edit $1
5-
6-
# Section for git-secrets
7-
if ! command -v git-secrets &> /dev/null 2>&1
8-
then
9-
echo "git-secrets is not installed. Please run 'brew install git-secrets' or visit https://github.com/awslabs/git-secrets#installing-git-secrets"
10-
exit 1
11-
fi
12-
13-
# Initialise git-secrets configuration
14-
git-secrets --register-aws > /dev/null
15-
16-
echo "Running git-secrets..."
17-
# Scans the commit message.
18-
git-secrets --commit_msg_hook -- "$@"
4+
npx --no-install commitlint --edit

.husky/pre-commit

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
# Section for git-secrets
5-
if ! command -v git-secrets &> /dev/null 2>&1
6-
then
7-
echo "git-secrets is not installed. Please run 'brew install git-secrets' or visit https://github.com/awslabs/git-secrets#installing-git-secrets"
8-
exit 1
9-
fi
10-
11-
# Initialise git-secrets configuration
12-
git-secrets --register-aws > /dev/null
13-
14-
echo "Running git-secrets..."
15-
# Scans all files that are about to be committed.
16-
git-secrets --pre_commit_hook -- "$@"
17-
18-
npm test
4+
npm test

.husky/prepare-commit-msg

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,3 @@
22
. "$(dirname "$0")/_/husky.sh"
33

44
exec < /dev/tty && npx cz --hook || true
5-
6-
# Section for git-secrets
7-
if ! command -v git-secrets &> /dev/null 2>&1
8-
then
9-
echo "git-secrets is not installed. Please run 'brew install git-secrets' or visit https://github.com/awslabs/git-secrets#installing-git-secrets"
10-
exit 1
11-
fi
12-
13-
# Initialise git-secrets configuration
14-
git-secrets --register-aws > /dev/null
15-
16-
echo "Running git-secrets..."
17-
# Determines if merging in a commit will introduce tainted history.
18-
git-secrets --prepare_commit_msg_hook -- "$@"

.mocharc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recursive": true,
3+
"require": "source-map-support/register"
4+
}

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist
2+
*.json
3+
coverage
4+
mochawesome-report
5+
node_modules/

0 commit comments

Comments
 (0)