@synergyerp/frontend-standards 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci-template.yml +1 -1
- package/.husky/commit-msg +0 -0
- package/.husky/pre-commit +0 -0
- package/.husky/pre-push +0 -0
- package/README.md +10 -10
- package/eslint.config.js +6 -1
- package/package.json +13 -12
- package/scripts/check-modularization.mjs +0 -0
- package/tsconfig.base.json +1 -5
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Consumer repos should USE this as a reference, not directly call it.
|
|
5
5
|
# The actual CI is triggered by the consumer repo's own .github/workflows/ci.yml
|
|
6
|
-
# which installs @
|
|
6
|
+
# which installs @synergyerp/frontend-standards and runs the same commands.
|
|
7
7
|
|
|
8
8
|
name: CI Pipeline (Template)
|
|
9
9
|
|
package/.husky/commit-msg
CHANGED
|
File without changes
|
package/.husky/pre-commit
CHANGED
|
File without changes
|
package/.husky/pre-push
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Shared frontend standards for all AO Holdings frontend projects. Provides unifie
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pnpm add -D @
|
|
8
|
+
pnpm add -D @synergyerp/frontend-standards
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## What's Included
|
|
@@ -27,21 +27,21 @@ pnpm add -D @aoholdings/frontend-standards
|
|
|
27
27
|
### 1. Install
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
pnpm add -D @
|
|
30
|
+
pnpm add -D @synergyerp/frontend-standards
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
### 2. Configure ESLint
|
|
34
34
|
|
|
35
35
|
```javascript
|
|
36
36
|
// eslint.config.js
|
|
37
|
-
export { default } from '@
|
|
37
|
+
export { default } from '@synergyerp/frontend-standards';
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
To extend with project-specific rules:
|
|
41
41
|
|
|
42
42
|
```javascript
|
|
43
43
|
// eslint.config.js
|
|
44
|
-
import baseConfig from '@
|
|
44
|
+
import baseConfig from '@synergyerp/frontend-standards';
|
|
45
45
|
|
|
46
46
|
export default [
|
|
47
47
|
...baseConfig,
|
|
@@ -58,7 +58,7 @@ export default [
|
|
|
58
58
|
```jsonc
|
|
59
59
|
// tsconfig.json
|
|
60
60
|
{
|
|
61
|
-
"extends": "@
|
|
61
|
+
"extends": "@synergyerp/frontend-standards/tsconfig.base.json",
|
|
62
62
|
"compilerOptions": {
|
|
63
63
|
// project-specific overrides
|
|
64
64
|
},
|
|
@@ -69,7 +69,7 @@ export default [
|
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
71
|
// vitest.config.ts
|
|
72
|
-
import baseConfig from '@
|
|
72
|
+
import baseConfig from '@synergyerp/frontend-standards/vitest.config.base';
|
|
73
73
|
import { defineConfig, mergeConfig } from 'vitest/config';
|
|
74
74
|
|
|
75
75
|
export default mergeConfig(
|
|
@@ -85,13 +85,13 @@ export default mergeConfig(
|
|
|
85
85
|
```json
|
|
86
86
|
{
|
|
87
87
|
"scripts": {
|
|
88
|
-
"prepare": "cp -r node_modules/@
|
|
88
|
+
"prepare": "cp -r node_modules/@synergyerp/frontend-standards/.husky . 2>/dev/null && chmod +x .husky/* 2>/dev/null || true",
|
|
89
89
|
"lint": "eslint --ext .ts,.tsx --max-warnings 0 .",
|
|
90
90
|
"lint:fix": "eslint --ext .ts,.tsx . --fix",
|
|
91
91
|
"format": "prettier --write \"src/**/*.{ts,tsx,json,css,md}\"",
|
|
92
92
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,json,css,md}\"",
|
|
93
93
|
"check-types": "tsc --noEmit",
|
|
94
|
-
"check-modularization": "node node_modules/@
|
|
94
|
+
"check-modularization": "node node_modules/@synergyerp/frontend-standards/scripts/check-modularization.mjs",
|
|
95
95
|
"test": "vitest run",
|
|
96
96
|
"test:watch": "vitest",
|
|
97
97
|
"test:ci": "vitest run --coverage",
|
|
@@ -111,7 +111,7 @@ Copy the CI workflow template:
|
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
113
|
mkdir -p .github/workflows
|
|
114
|
-
cp node_modules/@
|
|
114
|
+
cp node_modules/@synergyerp/frontend-standards/.github/workflows/ci-template.yml .github/workflows/ci.yml
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
Edit as needed for your project.
|
|
@@ -127,7 +127,7 @@ pnpm add -D husky lint-staged
|
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
129
|
mkdir -p .github
|
|
130
|
-
cp node_modules/@
|
|
130
|
+
cp node_modules/@synergyerp/frontend-standards/.github/PULL_REQUEST_TEMPLATE.md .github/
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
## Enforcement Summary
|
package/eslint.config.js
CHANGED
|
@@ -67,7 +67,7 @@ export default tseslint.config(
|
|
|
67
67
|
settings: {
|
|
68
68
|
react: { version: 'detect' },
|
|
69
69
|
'import/resolver': {
|
|
70
|
-
typescript: { alwaysTryTypes: true },
|
|
70
|
+
typescript: { alwaysTryTypes: true, project: ['tsconfig.json'] },
|
|
71
71
|
},
|
|
72
72
|
// === BOUNDARIES: Domain modularization (see FRONTEND_STANDARDS.md Section 5.2.1) ===
|
|
73
73
|
'boundaries/include': ['src/**/*'],
|
|
@@ -161,6 +161,10 @@ export default tseslint.config(
|
|
|
161
161
|
'error',
|
|
162
162
|
{
|
|
163
163
|
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
164
|
+
pathGroups: [
|
|
165
|
+
{ pattern: '@/**', group: 'internal', position: 'before' },
|
|
166
|
+
],
|
|
167
|
+
pathGroupsExcludedImportTypes: ['builtin'],
|
|
164
168
|
'newlines-between': 'always',
|
|
165
169
|
alphabetize: { order: 'asc', caseInsensitive: true },
|
|
166
170
|
},
|
|
@@ -243,6 +247,7 @@ export default tseslint.config(
|
|
|
243
247
|
'error',
|
|
244
248
|
{
|
|
245
249
|
allow: [
|
|
250
|
+
'@/**',
|
|
246
251
|
'src/services/*/index',
|
|
247
252
|
'src/hooks/*/index',
|
|
248
253
|
'src/store/*/index',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synergyerp/frontend-standards",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "SynergyERP
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "SynergyERP frontend standards — ESLint, Prettier, commitlint, Husky, Vitest, TypeScript configs, modularization enforcement, and PR templates.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "eslint.config.js",
|
|
@@ -21,6 +21,16 @@
|
|
|
21
21
|
".vscode/",
|
|
22
22
|
".github/"
|
|
23
23
|
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"format": "prettier --write .",
|
|
27
|
+
"format:check": "prettier --check .",
|
|
28
|
+
"check-modularization": "node scripts/check-modularization.mjs; exit 0",
|
|
29
|
+
"check-types": "tsc --noEmit; exit 0",
|
|
30
|
+
"test:ci": "exit 0",
|
|
31
|
+
"test": "exit 0",
|
|
32
|
+
"prepare": "echo 'Standards package ready'"
|
|
33
|
+
},
|
|
24
34
|
"repository": {
|
|
25
35
|
"type": "git",
|
|
26
36
|
"url": "git+https://github.com/aoholdings/frontend-standards.git"
|
|
@@ -68,14 +78,5 @@
|
|
|
68
78
|
"typescript": "^5.5.0",
|
|
69
79
|
"vitest": "^3.0.0",
|
|
70
80
|
"@types/node": "^22.0.0"
|
|
71
|
-
},
|
|
72
|
-
"scripts": {
|
|
73
|
-
"lint": "eslint .",
|
|
74
|
-
"format": "prettier --write .",
|
|
75
|
-
"format:check": "prettier --check .",
|
|
76
|
-
"check-modularization": "node scripts/check-modularization.mjs; exit 0",
|
|
77
|
-
"check-types": "tsc --noEmit; exit 0",
|
|
78
|
-
"test:ci": "exit 0",
|
|
79
|
-
"test": "exit 0"
|
|
80
81
|
}
|
|
81
|
-
}
|
|
82
|
+
}
|
|
File without changes
|
package/tsconfig.base.json
CHANGED