Skip to content

Commit 7ec4b50

Browse files
feat: Boilerplate setup
* feat: Boilerplate setup * fix: typo in contributing guidelines * fix: PR script fails on running test command * fix: eslint indendation
1 parent 184d98f commit 7ec4b50

15 files changed

+5103
-0
lines changed

.eslintrc.cjs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'plugin:vue/vue3-essential',
5+
'eslint:recommended',
6+
'@vue/eslint-config-typescript',
7+
'@vue/eslint-config-prettier/skip-formatting',
8+
'@vue/airbnb'
9+
],
10+
parserOptions: {
11+
ecmaVersion: 'latest'
12+
},
13+
overrides: [
14+
{
15+
files: ['*.vue'],
16+
rules: {
17+
'vue/multi-word-component-names': 'off'
18+
}
19+
}
20+
],
21+
rules: {
22+
'no-plusplus': 'off',
23+
'comma-dangle': ['error', 'never'],
24+
'import/no-extraneous-dependencies': 'off',
25+
'import/extensions': 'off',
26+
'import/no-unresolved': 'off',
27+
'@typescript-eslint/no-unused-vars': [
28+
'error',
29+
{
30+
ignoreRestSiblings: true,
31+
vars: 'local'
32+
}
33+
],
34+
'no-shadow': 'off',
35+
'implicit-arrow-linebreak': 'off',
36+
'space-before-blocks': 'error',
37+
'function-paren-newline': 'off',
38+
'padding-line-between-statements': [
39+
'error',
40+
{
41+
blankLine: 'always',
42+
prev: '*',
43+
next: 'return'
44+
},
45+
{
46+
blankLine: 'always',
47+
prev: ['const', 'let', 'var'],
48+
next: '*'
49+
},
50+
{
51+
blankLine: 'any',
52+
prev: ['const', 'let', 'var'],
53+
next: ['const', 'let', 'var']
54+
}
55+
],
56+
'object-curly-newline': 'off',
57+
'vue/multi-word-component-names': 'off',
58+
'vue/comma-dangle': 'off',
59+
'vue/no-setup-props-destructure': 'off',
60+
'func-call-spacing': 'off',
61+
'operator-linebreak': 'off',
62+
'import/prefer-default-export': 'off',
63+
'vue/html-indent': 'off',
64+
'vue/max-attributes-per-line': 'off',
65+
'no-spaced-func': 'off',
66+
'@typescript-eslint/consistent-type-imports': 'error',
67+
'vuejs-accessibility/form-control-has-label': 'off',
68+
'vue/first-attribute-linebreak': 'off',
69+
indent: ['off'],
70+
curly: ['error', 'multi', 'consistent'],
71+
'no-confusing-arrow': 'off',
72+
'nonblock-statement-body-position': 'off',
73+
'vue/operator-linebreak': 'off'
74+
}
75+
};

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
This template outlines the recommended format for creating pull requests within this project. Please fill out all sections before submitting your PR
2+
3+
## Branch Naming:
4+
5+
- Use a descriptive branch name that reflects the change and follows the format: [type]/[brief-description]
6+
- Replace [type] with feature, fix, refactor, hotfix, or other relevant categories
7+
- Keep the description concise and clear
8+
9+
## Commit Guidelines:
10+
11+
- Adhere to the "scope:subject" commit message structure
12+
- Scope can be feat, fix, docs, test, refactor, build, format, etc.
13+
- Use imperative tense (e.g., "fix: User unable to login")
14+
## Pull Request Checklist:
15+
16+
[ ] **Read the contributing guidelines** <br />
17+
[ ] **Branch is up-to-date with the base branch: main (or other designated branch)**<br />
18+
[ ] **Changes pass all tests: npm test or yarn test (or equivalent command)**<br />
19+
[ ] **Documentation has been updated (if applicable)**<br />
20+
## Description:
21+
- Start your pull request summary with a clear and informative heading. Use the Markdown syntax `##` for the heading, like `## Your Heading Here`.
22+
- For the section detailing the changes introduced by this pull request, use the Markdown heading `## Changes`.
23+
- Briefly describe the changes introduced in this pull request.Ensure that the changelog has been updated accordingly
24+
- Explain the motivation and the problem it solves
25+
- Mention any breaking changes
26+
- Link to related issues or internal tickets
27+
## Additional Notes:
28+
29+
- Include any other relevant information, such as limitations, known issues, or future improvements.
30+
## Screenshots (if applicable):
31+
32+
- Add screenshots or GIFs to help visualize your changes.
33+
## Testing Instructions:
34+
35+
- Provide step-by-step instructions on how to test your changes
36+
## Checklist for Reviewers:
37+
38+
[ ] **Code follows project conventions and style guidelines**<br />
39+
[ ] **Changes do not introduce new warnings or errors**<br />
40+
[ ] **Unit tests cover the changes adequately**<br />
41+
[ ] **Documentation is updated correctly and reflects the changes**<br />
42+
Additional Information:
43+
44+
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT License.
45+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test Suite
2+
3+
on:
4+
pull_request:
5+
# The branches below must be a subset of the branches above
6+
branches: [main, dev]
7+
8+
jobs:
9+
test-and-build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [18.x]
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
fetch-depth: 0
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: Linting
30+
run: npm run lint
31+
32+
- name: Build
33+
run: npm run build
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ReleaseType:
7+
description: 'Release Type'
8+
required: true
9+
default: 'warning'
10+
type: choice
11+
options:
12+
- Major
13+
- Feature
14+
- Bug
15+
16+
jobs:
17+
update-and-publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: 18.x
27+
scope: '@keyvaluesystems'
28+
29+
- name: Install dependencies
30+
run: npm install
31+
32+
- name: Run tests
33+
run: npm run test
34+
35+
- name: 'Set release type : ${{ inputs.ReleaseType }}'
36+
id: release_type
37+
uses: ASzc/change-string-case-action@v5
38+
with:
39+
string: ${{ inputs.ReleaseType }}
40+
41+
- name: Extract Current Branch and Validate
42+
id: get_current_branch
43+
shell: bash
44+
run: |
45+
BRANCH="${GITHUB_REF#refs/heads/}"
46+
if [ "$BRANCH" == 'main' ]
47+
then
48+
echo "Branch validation Successful"
49+
else
50+
echo "Releases only taken from main branch"
51+
exit 1
52+
fi
53+
54+
- name: Get Latest version from package.json
55+
run: |
56+
# Get the latest version from package.json
57+
LATEST_VERSION=$(node -p "require('./package.json').version")
58+
59+
# Output the latest version as a workflow env
60+
echo "latest_version=$LATEST_VERSION" >> $GITHUB_ENV
61+
62+
- name: Get new version
63+
id: get_next_version
64+
uses: christian-draeger/increment-semantic-version@1.0.3
65+
with:
66+
current-version: ${{ env.latest_version }}
67+
version-fragment: ${{ steps.release_type.outputs.lowercase }}
68+
69+
- name: Update version in package.json and package-lock.json
70+
run: |
71+
OLD_VERSION=${{ env.latest_version }}
72+
NEW_VERSION=${{ steps.get_next_version.outputs.next-version }}
73+
74+
npm version $NEW_VERSION --no-git-tag-version
75+
git config user.name github-actions
76+
git config user.email github-actions@github.com
77+
git add package.json package-lock.json
78+
git commit -m "Bump version from $OLD_VERSION to $NEW_VERSION"
79+
git push origin HEAD:main
80+
81+
- name: Build Package
82+
run: npm run build
83+
84+
- name: Publish package
85+
run: npm publish --access public --//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}
86+
if: success()
87+
88+
- name: Revert package.json and package-lock.json
89+
run: |
90+
# Revert package.json and package-lock.json to the previous version
91+
npm version ${{ env.latest_version }} --no-git-tag-version
92+
git commit -am "Revert to version ${{ env.latest_version }}"
93+
git push origin HEAD:main
94+
if: failure()
95+
96+
- name: Create GitHub release
97+
if: success()
98+
uses: actions/create-release@v1
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
with:
102+
tag_name: v${{ steps.get_next_version.outputs.next-version }}
103+
release_name: Release v${{ steps.get_next_version.outputs.next-version }}
104+
# body: Release ${{ env.NEW_VERSION }}
105+
draft: false
106+
prerelease: false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.DS_Store
3+
dist

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [Unreleased]
6+
7+
### Added
8+
9+
- New feature or enhancement.
10+
11+
### Changed
12+
13+
- Updates to existing features.
14+
15+
### Deprecated
16+
17+
- Features or functionalities to be removed in future releases.
18+
19+
### Removed
20+
21+
- Features or functionalities that have been removed.
22+
23+
### Fixed
24+
25+
- Bug fixes.
26+
27+
### Security
28+
29+
- Security-related changes.
30+
31+
## [Version] - YYYY-MM-DD
32+
33+
### Added
34+
35+
- New feature or enhancement.
36+
37+
### Changed
38+
39+
- Updates to existing features.
40+
41+
### Deprecated
42+
43+
- Features or functionalities to be removed in future releases.
44+
45+
### Removed
46+
47+
- Features or functionalities that have been removed.
48+
49+
### Fixed
50+
51+
- Bug fixes.
52+
53+
### Security
54+
55+
- Security-related changes
56+

0 commit comments

Comments
 (0)