Skip to content

Commit bc6127e

Browse files
sinha-sahilmurdore
authored andcommitted
BZ-8465: chore: added workflow configurations
- added precommit hooks for format,lint,test before commit & commit msg formatting - added .editorconfig, updated config to use space in prettier config - added commitlint & commitzen for commit message linting
1 parent f63272d commit bc6127e

22 files changed

+1882
-147
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.eslintrc.cjs

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
module.exports = {
2-
root: true,
3-
extends: [
4-
'eslint:recommended',
5-
'plugin:@typescript-eslint/recommended',
6-
'plugin:svelte/recommended',
7-
'prettier'
8-
],
9-
parser: '@typescript-eslint/parser',
10-
plugins: ['@typescript-eslint'],
11-
parserOptions: {
12-
sourceType: 'module',
13-
ecmaVersion: 2020,
14-
extraFileExtensions: ['.svelte']
15-
},
16-
env: {
17-
browser: true,
18-
es2017: true,
19-
node: true
20-
},
21-
overrides: [
22-
{
23-
files: ['*.svelte'],
24-
parser: 'svelte-eslint-parser',
25-
parserOptions: {
26-
parser: '@typescript-eslint/parser'
27-
}
28-
}
29-
]
2+
root: true,
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:svelte/recommended',
7+
'prettier'
8+
],
9+
parser: '@typescript-eslint/parser',
10+
plugins: ['@typescript-eslint'],
11+
parserOptions: {
12+
sourceType: 'module',
13+
ecmaVersion: 2020,
14+
extraFileExtensions: ['.svelte']
15+
},
16+
env: {
17+
browser: true,
18+
es2017: true,
19+
node: true
20+
},
21+
overrides: [
22+
{
23+
files: ['*.svelte'],
24+
parser: 'svelte-eslint-parser',
25+
parserOptions: {
26+
parser: '@typescript-eslint/parser'
27+
}
28+
}
29+
]
3030
};

.husky/commit-msg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
./scripts/commit-msg.sh

.husky/pre-commit

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
./scripts/pre-commit.sh

.husky/pre-push

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
./scripts/pre-push.sh

.husky/prepare-commit-msg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
./scripts/prepare-commit-msg.sh

.prettierrc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"useTabs": true,
3-
"singleQuote": true,
4-
"trailingComma": "none",
5-
"printWidth": 100,
6-
"plugins": ["prettier-plugin-svelte"],
7-
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
88
}

package.json

+154-53
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,156 @@
11
{
2-
"name": "svelte-ui-components",
3-
"version": "0.0.1",
4-
"scripts": {
5-
"dev": "vite dev",
6-
"build": "vite build && npm run package",
7-
"preview": "vite preview",
8-
"package": "svelte-kit sync && svelte-package && publint",
9-
"prepublishOnly": "npm run package",
10-
"test": "npm run test:integration && npm run test:unit",
11-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13-
"lint": "prettier --check . && eslint .",
14-
"format": "prettier --write .",
15-
"test:integration": "playwright test",
16-
"test:unit": "vitest"
17-
},
18-
"exports": {
19-
".": {
20-
"types": "./dist/index.d.ts",
21-
"svelte": "./dist/index.js"
22-
}
23-
},
24-
"files": [
25-
"dist",
26-
"!dist/**/*.test.*",
27-
"!dist/**/*.spec.*"
28-
],
29-
"peerDependencies": {
30-
"svelte": "^4.0.0"
31-
},
32-
"devDependencies": {
33-
"@playwright/test": "^1.39.0",
34-
"@sveltejs/adapter-auto": "^2.1.1",
35-
"@sveltejs/kit": "^1.27.6",
36-
"@sveltejs/package": "^2.2.2",
37-
"@typescript-eslint/eslint-plugin": "^6.11.0",
38-
"@typescript-eslint/parser": "^6.11.0",
39-
"eslint": "^8.53.0",
40-
"eslint-config-prettier": "^9.0.0",
41-
"eslint-plugin-svelte": "^2.35.0",
42-
"prettier": "^3.1.0",
43-
"prettier-plugin-svelte": "^3.1.0",
44-
"publint": "^0.2.5",
45-
"svelte": "^4.2.3",
46-
"svelte-check": "^3.6.0",
47-
"tslib": "^2.6.2",
48-
"typescript": "^5.2.2",
49-
"vite": "^4.5.0",
50-
"vitest": "^0.34.6"
51-
},
52-
"svelte": "./dist/index.js",
53-
"types": "./dist/index.d.ts",
54-
"type": "module"
2+
"name": "svelte-ui-components",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build && npm run package",
7+
"preview": "vite preview",
8+
"package": "svelte-kit sync && svelte-package && publint",
9+
"prepublishOnly": "npm run package",
10+
"test": "npm run test:integration && npm run test:unit",
11+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
12+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
13+
"lint": "prettier --check . && eslint .",
14+
"format": "prettier --write .",
15+
"test:integration": "playwright test",
16+
"test:unit": "vitest"
17+
},
18+
"exports": {
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"svelte": "./dist/index.js"
22+
}
23+
},
24+
"files": [
25+
"dist",
26+
"!dist/**/*.test.*",
27+
"!dist/**/*.spec.*"
28+
],
29+
"peerDependencies": {
30+
"svelte": "^4.0.0"
31+
},
32+
"devDependencies": {
33+
"@commitlint/cli": "^18.4.2",
34+
"@commitlint/config-conventional": "^18.4.2",
35+
"@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1",
36+
"@playwright/test": "^1.39.0",
37+
"@sveltejs/adapter-auto": "^2.1.1",
38+
"@sveltejs/kit": "^1.27.6",
39+
"@sveltejs/package": "^2.2.2",
40+
"@typescript-eslint/eslint-plugin": "^6.11.0",
41+
"@typescript-eslint/parser": "^6.11.0",
42+
"commitizen": "^4.3.0",
43+
"commitlint-config-jira": "^1.6.4",
44+
"commitlint-plugin-jira-rules": "^1.6.4",
45+
"eslint": "^8.53.0",
46+
"eslint-config-prettier": "^9.0.0",
47+
"eslint-plugin-svelte": "^2.35.0",
48+
"husky": "^8.0.3",
49+
"prettier": "^3.1.0",
50+
"prettier-plugin-svelte": "^3.1.0",
51+
"publint": "^0.2.5",
52+
"svelte": "^4.2.3",
53+
"svelte-check": "^3.6.0",
54+
"tslib": "^2.6.2",
55+
"typescript": "^5.2.2",
56+
"vite": "^4.5.0",
57+
"vitest": "^0.34.6"
58+
},
59+
"svelte": "./dist/index.js",
60+
"types": "./dist/index.d.ts",
61+
"type": "module",
62+
"config": {
63+
"commitizen": {
64+
"path": "./node_modules/@digitalroute/cz-conventional-changelog-for-jira",
65+
"jiraPrefix": "BZ",
66+
"jiraLocation": "pre-type",
67+
"jiraAppend": ":"
68+
}
69+
},
70+
"standard-version": {
71+
"skip": {
72+
"commit": true,
73+
"changelog": true
74+
},
75+
"types": [
76+
{
77+
"type": "feat",
78+
"section": "Features",
79+
"release": "minor"
80+
},
81+
{
82+
"type": "fix",
83+
"section": "Bug Fixes",
84+
"release": "minor"
85+
},
86+
{
87+
"type": "test",
88+
"section": "Tests"
89+
},
90+
{
91+
"type": "build",
92+
"section": "Build System"
93+
},
94+
{
95+
"type": "docs",
96+
"section": "Documentation"
97+
},
98+
{
99+
"type": "style",
100+
"hidden": true
101+
},
102+
{
103+
"type": "refactor",
104+
"section": "Improvements"
105+
},
106+
{
107+
"type": "perf",
108+
"section": "Improvements"
109+
},
110+
{
111+
"type": "ci",
112+
"hidden": true
113+
},
114+
{
115+
"type": "chore",
116+
"hidden": true
117+
}
118+
],
119+
"issuePrefixes": [
120+
"BZ-"
121+
],
122+
"issueUrlFormat": "https://juspay.atlassian.net/browse/{{prefix}}{{id}}",
123+
"commitUrlFormat": "https://github.com/juspay/svelte-ui-components/commits/{{hash}}",
124+
"compareUrlFormat": "https://github.com/juspay/svelte-ui-components/branches/compare/{{currentTag}}%0D{{previousTag}}",
125+
"releaseCommitMessageFormat": "chore(release): {{currentTag}} {{prefix}}{{id}}"
126+
},
127+
"commitlint": {
128+
"plugins": [
129+
"commitlint-plugin-jira-rules"
130+
],
131+
"extends": [
132+
"jira"
133+
],
134+
"rules": {
135+
"jira-task-id-max-length": [
136+
0
137+
]
138+
}
139+
},
140+
"auto-changelog": {
141+
"output": "docs/CHANGELOG.md",
142+
"template": "./docs/templates/changelog.hbs",
143+
"commitLimit": false,
144+
"breakingPattern": "(!:)",
145+
"issueUrl": "https://juspay.atlassian.net/browse/{id}",
146+
"issuePattern": "[A-Z]{2,}-\\d+",
147+
"compareUrl": "https://github.com/juspay/svelte-ui-components/compare/{to}..{from}",
148+
"unreleased": true,
149+
"releaseSummary": true,
150+
"hideCredit": false,
151+
"ignoreCommitPattern": "(\\[skip ci\\])",
152+
"replaceText": {
153+
"(ABC-\\d+)": "[`$1`](https://juspay.atlassian.net/browse/$1)"
154+
}
155+
}
55156
}

playwright.config.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { PlaywrightTestConfig } from '@playwright/test';
22

33
const config: PlaywrightTestConfig = {
4-
webServer: {
5-
command: 'npm run build && npm run preview',
6-
port: 4173
7-
},
8-
testDir: 'tests',
9-
testMatch: /(.+\.)?(test|spec)\.[jt]s/
4+
webServer: {
5+
command: 'npm run build && npm run preview',
6+
port: 4173
7+
},
8+
testDir: 'tests',
9+
testMatch: /(.+\.)?(test|spec)\.[jt]s/
1010
};
1111

1212
export default config;

0 commit comments

Comments
 (0)