eslint-plugin-traceability 1.0.3 → 1.0.5

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 (94) hide show
  1. package/.github/workflows/ci-cd.yml +41 -35
  2. package/.husky/pre-commit +1 -1
  3. package/.husky/pre-push +1 -1
  4. package/.prettierignore +5 -1
  5. package/.releaserc.json +15 -0
  6. package/.voder/history.md +138 -264
  7. package/.voder/implementation-progress.md +110 -112
  8. package/.voder/last-action.md +62 -204
  9. package/.voder/plan.md +10 -10
  10. package/.voder/progress-chart.png +0 -0
  11. package/.voder/progress-log-areas.csv +4 -0
  12. package/.voder/progress-log.csv +4 -0
  13. package/CHANGELOG.md +20 -1
  14. package/CONTRIBUTING.md +15 -13
  15. package/README.md +2 -2
  16. package/cli-integration.js +61 -115
  17. package/docs/cli-integration.md +3 -1
  18. package/docs/conventional-commits-guide.md +185 -0
  19. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +3 -1
  20. package/docs/decisions/005-github-actions-validation-tooling.accepted.md +144 -0
  21. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +227 -0
  22. package/eslint.config.js +4 -4
  23. package/package.json +7 -2
  24. package/tests/{basic.test.ts → plugin-setup.test.ts} +1 -1
  25. package/user-docs/migration-guide.md +71 -0
  26. package/lib/index.d.ts +0 -26
  27. package/lib/index.js +0 -11
  28. package/lib/src/index.d.ts +0 -80
  29. package/lib/src/index.js +0 -58
  30. package/lib/src/maintenance/batch.d.ts +0 -16
  31. package/lib/src/maintenance/batch.js +0 -28
  32. package/lib/src/maintenance/detect.d.ts +0 -6
  33. package/lib/src/maintenance/detect.js +0 -69
  34. package/lib/src/maintenance/index.d.ts +0 -14
  35. package/lib/src/maintenance/index.js +0 -22
  36. package/lib/src/maintenance/report.d.ts +0 -7
  37. package/lib/src/maintenance/report.js +0 -17
  38. package/lib/src/maintenance/update.d.ts +0 -6
  39. package/lib/src/maintenance/update.js +0 -67
  40. package/lib/src/maintenance/utils.d.ts +0 -6
  41. package/lib/src/maintenance/utils.js +0 -64
  42. package/lib/src/rules/require-branch-annotation.d.ts +0 -7
  43. package/lib/src/rules/require-branch-annotation.js +0 -111
  44. package/lib/src/rules/require-req-annotation.d.ts +0 -7
  45. package/lib/src/rules/require-req-annotation.js +0 -38
  46. package/lib/src/rules/require-story-annotation.d.ts +0 -7
  47. package/lib/src/rules/require-story-annotation.js +0 -50
  48. package/lib/src/rules/valid-annotation-format.d.ts +0 -10
  49. package/lib/src/rules/valid-annotation-format.js +0 -60
  50. package/lib/src/rules/valid-req-reference.d.ts +0 -3
  51. package/lib/src/rules/valid-req-reference.js +0 -104
  52. package/lib/src/rules/valid-story-reference.d.ts +0 -3
  53. package/lib/src/rules/valid-story-reference.js +0 -168
  54. package/lib/tests/basic.test.d.ts +0 -1
  55. package/lib/tests/basic.test.js +0 -51
  56. package/lib/tests/fixtures/stale/example.d.ts +0 -0
  57. package/lib/tests/fixtures/stale/example.js +0 -3
  58. package/lib/tests/fixtures/update/example.d.ts +0 -0
  59. package/lib/tests/fixtures/update/example.js +0 -3
  60. package/lib/tests/fixtures/valid-annotations/example.d.ts +0 -0
  61. package/lib/tests/fixtures/valid-annotations/example.js +0 -3
  62. package/lib/tests/index.test.d.ts +0 -1
  63. package/lib/tests/index.test.js +0 -72
  64. package/lib/tests/integration/file-validation.test.d.ts +0 -1
  65. package/lib/tests/integration/file-validation.test.js +0 -71
  66. package/lib/tests/integration/plugin-validation.test.d.ts +0 -1
  67. package/lib/tests/integration/plugin-validation.test.js +0 -83
  68. package/lib/tests/maintenance/batch.test.d.ts +0 -1
  69. package/lib/tests/maintenance/batch.test.js +0 -79
  70. package/lib/tests/maintenance/detect-isolated.test.d.ts +0 -1
  71. package/lib/tests/maintenance/detect-isolated.test.js +0 -95
  72. package/lib/tests/maintenance/detect.test.d.ts +0 -1
  73. package/lib/tests/maintenance/detect.test.js +0 -23
  74. package/lib/tests/maintenance/report.test.d.ts +0 -1
  75. package/lib/tests/maintenance/report.test.js +0 -67
  76. package/lib/tests/maintenance/update-isolated.test.d.ts +0 -1
  77. package/lib/tests/maintenance/update-isolated.test.js +0 -66
  78. package/lib/tests/maintenance/update.test.d.ts +0 -1
  79. package/lib/tests/maintenance/update.test.js +0 -26
  80. package/lib/tests/rules/require-branch-annotation.test.d.ts +0 -1
  81. package/lib/tests/rules/require-branch-annotation.test.js +0 -253
  82. package/lib/tests/rules/require-req-annotation.test.d.ts +0 -1
  83. package/lib/tests/rules/require-req-annotation.test.js +0 -41
  84. package/lib/tests/rules/require-story-annotation.test.d.ts +0 -1
  85. package/lib/tests/rules/require-story-annotation.test.js +0 -36
  86. package/lib/tests/rules/valid-annotation-format.test.d.ts +0 -1
  87. package/lib/tests/rules/valid-annotation-format.test.js +0 -58
  88. package/lib/tests/rules/valid-req-reference.test.d.ts +0 -1
  89. package/lib/tests/rules/valid-req-reference.test.js +0 -87
  90. package/lib/tests/rules/valid-story-reference.test.d.ts +0 -1
  91. package/lib/tests/rules/valid-story-reference.test.js +0 -69
  92. package/tests/integration/file-validation.test.ts +0 -78
  93. package/tests/integration/plugin-validation.test.ts +0 -84
  94. /package/tests/{index.test.ts → plugin-default-export-and-configs.test.ts} +0 -0
@@ -3,6 +3,8 @@ name: CI/CD Pipeline
3
3
  on:
4
4
  push:
5
5
  branches: [main]
6
+ pull_request:
7
+ branches: [main]
6
8
 
7
9
  jobs:
8
10
  quality-checks:
@@ -14,8 +16,10 @@ jobs:
14
16
  steps:
15
17
  - name: Checkout code
16
18
  uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
17
21
 
18
- - name: Setup Node.js ${{ matrix['node-version'] }}
22
+ - name: Setup Node.js
19
23
  uses: actions/setup-node@v4
20
24
  with:
21
25
  node-version: ${{ matrix['node-version'] }}
@@ -27,6 +31,13 @@ jobs:
27
31
  - name: Build project
28
32
  run: npm run build
29
33
 
34
+ - name: Upload build artifacts
35
+ if: ${{ matrix['node-version'] == '20.x' }}
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: build-artifact
39
+ path: lib/
40
+
30
41
  - name: Run type checking
31
42
  run: npm run type-check
32
43
 
@@ -39,55 +50,50 @@ jobs:
39
50
  - name: Run tests with coverage
40
51
  run: npm run test
41
52
 
42
- - name: Run CLI Integration Tests
43
- run: node cli-integration.js
44
-
45
53
  - name: Check code formatting
46
54
  run: npm run format:check
47
55
 
48
56
  - name: Run security audit
49
57
  run: npm audit --audit-level=high
50
58
 
51
- publish:
52
- name: Publish Package
53
- needs: quality-checks
59
+ deploy:
60
+ if: ${{ github.event_name == 'push' }}
61
+ name: Release
54
62
  runs-on: ubuntu-latest
55
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
63
+ needs: quality-checks
64
+ permissions:
65
+ contents: write
66
+ issues: write
67
+ pull-requests: write
68
+ id-token: write
69
+ env:
70
+ HUSKY: 0
56
71
  steps:
57
72
  - name: Checkout code
58
73
  uses: actions/checkout@v4
74
+ with:
75
+ fetch-depth: 0
59
76
 
60
- - name: Setup Node.js for publish
77
+ - name: Setup Node.js
61
78
  uses: actions/setup-node@v4
62
79
  with:
63
- node-version: '20.x'
64
- registry-url: 'https://registry.npmjs.org/'
65
- always-auth: true
80
+ node-version: '22.x'
66
81
 
67
82
  - name: Install dependencies
68
83
  run: npm ci
69
84
 
70
- - name: Build project
71
- run: npm run build
72
-
73
- - name: Configure npm for publish
74
- run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
75
- env:
76
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
77
-
78
- - name: Publish package to npm
79
- run: npm publish --access public
85
+ - name: Release with semantic-release
86
+ run: npx semantic-release
80
87
  env:
81
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
82
-
83
- smoke-test:
84
- name: Post-Deployment Smoke Test
85
- needs: publish
86
- runs-on: ubuntu-latest
87
- steps:
88
- - name: Checkout code
89
- uses: actions/checkout@v4
90
- - name: Install dependencies
91
- run: npm ci
92
- - name: Smoke Test Published Package
93
- run: node cli-integration.js
88
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
90
+
91
+ - name: Smoke test published package
92
+ run: |
93
+ echo "Smoke testing eslint-plugin-traceability"
94
+ workdir=$(mktemp -d)
95
+ cd "$workdir"
96
+ npm init -y > /dev/null
97
+ npm install eslint-plugin-traceability > /dev/null
98
+ echo '{"plugins":["traceability"],"rules":{}}' > .eslintrc.json
99
+ npx eslint --print-config .
package/.husky/pre-commit CHANGED
@@ -1 +1 @@
1
- npm run format && npm run lint -- --max-warnings=0
1
+ npm run format && npm run lint -- --max-warnings=0 && npm run type-check && node node_modules/actionlint/actionlint.cjs .github/workflows/*.yml
package/.husky/pre-push CHANGED
@@ -1 +1 @@
1
- npm run build && npm run type-check && npm run lint -- --max-warnings=0 && npm run duplication && npm test && npm run format:check && npm audit --audit-level=high && node cli-integration.js
1
+ npm run build && npm run type-check && npm run lint -- --max-warnings=0 && npm run duplication && npm test && npm run format:check && npm audit --audit-level=high
package/.prettierignore CHANGED
@@ -20,4 +20,8 @@ coverage/
20
20
  CHANGELOG.md
21
21
  *.log
22
22
  package.json
23
- eslint.config.js
23
+ eslint.config.js
24
+
25
+ # Ignore CLI integration files
26
+ cli-integration.js
27
+ docs/cli-integration.md
@@ -0,0 +1,15 @@
1
+ {
2
+ "branches": ["main"],
3
+ "plugins": [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ [
7
+ "@semantic-release/changelog",
8
+ {
9
+ "changelogFile": "CHANGELOG.md"
10
+ }
11
+ ],
12
+ "@semantic-release/npm",
13
+ "@semantic-release/github"
14
+ ]
15
+ }