frontend-boilerplate-cli 1.0.0

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +418 -0
  3. package/dist/architectures/structures.d.ts +15 -0
  4. package/dist/architectures/structures.d.ts.map +1 -0
  5. package/dist/architectures/structures.js +1018 -0
  6. package/dist/cli/cli.d.ts +3 -0
  7. package/dist/cli/cli.d.ts.map +1 -0
  8. package/dist/cli/cli.js +17 -0
  9. package/dist/commands/create.d.ts +8 -0
  10. package/dist/commands/create.d.ts.map +1 -0
  11. package/dist/commands/create.js +56 -0
  12. package/dist/index.d.ts +4 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -0
  15. package/dist/utils/configSetup.d.ts +5 -0
  16. package/dist/utils/configSetup.d.ts.map +1 -0
  17. package/dist/utils/configSetup.js +225 -0
  18. package/dist/utils/fileSystem.d.ts +7 -0
  19. package/dist/utils/fileSystem.d.ts.map +1 -0
  20. package/dist/utils/fileSystem.js +22 -0
  21. package/dist/utils/folderBuilder.d.ts +7 -0
  22. package/dist/utils/folderBuilder.d.ts.map +1 -0
  23. package/dist/utils/folderBuilder.js +44 -0
  24. package/dist/utils/installer.d.ts +3 -0
  25. package/dist/utils/installer.d.ts.map +1 -0
  26. package/dist/utils/installer.js +23 -0
  27. package/dist/utils/logger.d.ts +9 -0
  28. package/dist/utils/logger.d.ts.map +1 -0
  29. package/dist/utils/logger.js +9 -0
  30. package/package.json +72 -0
  31. package/templates/configs/CHANGELOG.md +59 -0
  32. package/templates/configs/biome.json +61 -0
  33. package/templates/configs/commit-msg +15 -0
  34. package/templates/configs/commitlint.config.js +25 -0
  35. package/templates/configs/github-workflow.yml +100 -0
  36. package/templates/configs/lighthouserc.js +36 -0
  37. package/templates/configs/lint-staged.config.json +8 -0
  38. package/templates/configs/pre-commit +1 -0
  39. package/templates/configs/pull_request_template.md +28 -0
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
3
+
4
+ "vcs": {
5
+ "enabled": true,
6
+ "clientKind": "git",
7
+ "useIgnoreFile": true
8
+ },
9
+
10
+ "files": {
11
+ "ignoreUnknown": false
12
+ },
13
+
14
+ "formatter": {
15
+ "enabled": true,
16
+ "indentStyle": "space",
17
+ "indentWidth": 2,
18
+ "lineWidth": 100
19
+ },
20
+
21
+ "linter": {
22
+ "enabled": true,
23
+ "rules": {
24
+ "recommended": true,
25
+
26
+ "suspicious": {
27
+ "noExplicitAny": "error"
28
+ },
29
+
30
+ "correctness": {
31
+ "noUnusedVariables": "error"
32
+ },
33
+
34
+ "style": {
35
+ "useTemplate": "warn"
36
+ },
37
+
38
+ "complexity": {
39
+ "noUselessCatch": "error"
40
+ }
41
+ }
42
+ },
43
+
44
+ "javascript": {
45
+ "formatter": {
46
+ "quoteStyle": "single",
47
+ "jsxQuoteStyle": "double",
48
+ "trailingCommas": "es5",
49
+ "semicolons": "asNeeded"
50
+ }
51
+ },
52
+
53
+ "assist": {
54
+ "enabled": true,
55
+ "actions": {
56
+ "source": {
57
+ "organizeImports": "on"
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,15 @@
1
+ RED='\033[0;31m'
2
+ GREEN='\033[0;32m'
3
+ CYAN='\033[0;36m'
4
+ YELLOW='\033[1;33m'
5
+ NC='\033[0m'
6
+
7
+ echo "${RED}โง— Commits should follow the conventional commit format: ${GREEN}type(scope?): subject${NC}"
8
+ echo "${YELLOW} 'scope' is optional${NC}"
9
+ echo "${YELLOW} 'Subject' must start with an uppercase letter.${NC}"
10
+ echo "${GREEN} Allowed types: feat, fix, docs, chore, style, refactor, ci, test, revert, perf, vercel${NC}"
11
+ echo "${CYAN} Example: 'feat: Add email validation'"
12
+ echo "${CYAN} More info: https://www.conventionalcommits.org/en/v1.0.0/${NC}"
13
+ echo ""
14
+
15
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,25 @@
1
+ export default {
2
+ extends: ['@commitlint/config-conventional'],
3
+ rules: {
4
+ 'type-enum': [
5
+ 2,
6
+ 'always',
7
+ [
8
+ 'feat',
9
+ 'fix',
10
+ 'docs',
11
+ 'chore',
12
+ 'style',
13
+ 'refactor',
14
+ 'ci',
15
+ 'test',
16
+ 'revert',
17
+ 'perf',
18
+ 'wip',
19
+ 'hotfix',
20
+ ],
21
+ ],
22
+
23
+ 'subject-case': [2, 'never', ['upper-case']],
24
+ },
25
+ }
@@ -0,0 +1,100 @@
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main, develop]
8
+
9
+ jobs:
10
+ # Job de linting y formateo
11
+ lint:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '20'
20
+ cache: 'npm'
21
+
22
+ - name: Install dependencies
23
+ run: npm ci
24
+
25
+ - name: Run Biome linter
26
+ run: npm run lint
27
+
28
+ - name: Run Biome formatter check
29
+ run: npm run format:check
30
+
31
+ # Job de tests
32
+ test:
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ - name: Setup Node.js
38
+ uses: actions/setup-node@v4
39
+ with:
40
+ node-version: '20'
41
+ cache: 'npm'
42
+
43
+ - name: Install dependencies
44
+ run: npm ci
45
+
46
+ - name: Run tests
47
+ run: npm run test
48
+
49
+ # Job de build
50
+ build:
51
+ runs-on: ubuntu-latest
52
+ needs: [lint, test]
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+
56
+ - name: Setup Node.js
57
+ uses: actions/setup-node@v4
58
+ with:
59
+ node-version: '20'
60
+ cache: 'npm'
61
+
62
+ - name: Install dependencies
63
+ run: npm ci
64
+
65
+ - name: Build project
66
+ run: npm run build
67
+
68
+ - name: Upload build artifacts
69
+ uses: actions/upload-artifact@v4
70
+ with:
71
+ name: dist
72
+ path: dist
73
+
74
+ # Job de Lighthouse (only in PR)
75
+ lighthouse:
76
+ runs-on: ubuntu-latest
77
+ needs: [build]
78
+ if: github.event_name == 'pull_request'
79
+ steps:
80
+ - uses: actions/checkout@v4
81
+
82
+ - name: Setup Node.js
83
+ uses: actions/setup-node@v4
84
+ with:
85
+ node-version: '20'
86
+ cache: 'npm'
87
+
88
+ - name: Install dependencies
89
+ run: npm ci
90
+
91
+ - name: Build project
92
+ run: npm run build
93
+
94
+ - name: Run Lighthouse CI
95
+ uses: treosh/lighthouse-ci-action@v11
96
+ with:
97
+ urls: |
98
+ http://localhost:4173
99
+ uploadArtifacts: true
100
+ temporaryPublicStorage: true
@@ -0,0 +1,36 @@
1
+ module.exports = {
2
+ ci: {
3
+ collect: {
4
+ startServerCommand: 'npm run preview',
5
+ startServerReadyPattern: 'Local:',
6
+ url: ['http://localhost:4173'],
7
+ numberOfRuns: 3,
8
+ settings: {
9
+ preset: 'desktop',
10
+ },
11
+ },
12
+ assert: {
13
+ preset: 'lighthouse:recommended',
14
+ assertions: {
15
+ 'categories:performance': ['warn', { minScore: 0.9 }],
16
+ 'categories:accessibility': ['error', { minScore: 0.9 }],
17
+ 'categories:best-practices': ['warn', { minScore: 0.9 }],
18
+ 'categories:seo': ['warn', { minScore: 0.9 }],
19
+ 'categories:pwa': 'off',
20
+
21
+ // Performance budgets
22
+ 'first-contentful-paint': ['warn', { maxNumericValue: 2000 }],
23
+ 'largest-contentful-paint': ['warn', { maxNumericValue: 2500 }],
24
+ 'cumulative-layout-shift': ['warn', { maxNumericValue: 0.1 }],
25
+ 'total-blocking-time': ['warn', { maxNumericValue: 300 }],
26
+
27
+ // Resource hints
28
+ 'uses-rel-preconnect': 'off',
29
+ 'uses-rel-preload': 'off',
30
+ },
31
+ },
32
+ upload: {
33
+ target: 'temporary-public-storage',
34
+ },
35
+ },
36
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "*.{js,jsx,ts,tsx}": [
3
+ "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
4
+ ],
5
+ "*.{json,md}": [
6
+ "biome format --write --no-errors-on-unmatched --files-ignore-unknown=true"
7
+ ]
8
+ }
@@ -0,0 +1 @@
1
+ npx lint-staged
@@ -0,0 +1,28 @@
1
+ # ๐Ÿš€ PR Title: [Brief description]
2
+
3
+ ## ๐Ÿ“ Description
4
+ - **Summary**: [What does this PR do?]
5
+ - **Type of Change**:
6
+ - [ ] ๐Ÿ†• Feature
7
+ - [ ] ๐Ÿ› Bug Fix
8
+ - [ ] โšก Refactor
9
+ - [ ] ๐Ÿ”ง Chore / Config
10
+
11
+ ## ๐Ÿ› ๏ธ Technical Details
12
+ - **Main Changes**: [List key files or logic changed]
13
+ - **API / Hooks**: [Any new hooks or endpoints added?]
14
+ - **Storage**: [Changes in LocalStorage or Cookies?]
15
+
16
+ ## ๐Ÿงช How to Test?
17
+ 1. [Step 1: e.g. Run yarn install]
18
+ 2. [Step 2: e.g. Login with user X]
19
+ 3. [Step 3: e.g. Check if token refreshes]
20
+
21
+ ## โœ… Checklist
22
+ - [ ] Code follows project style (Biome/Lint)
23
+ - [ ] No `any` types used
24
+ - [ ] Environment variables updated (if needed)
25
+ - [ ] Tested in local environment
26
+
27
+ ## ๐Ÿ“ธ Screenshots / Logs
28
+ [Attach images or console logs here]