@defra/fcp-sfd-frontend-engine 0.37.2 → 0.38.1
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/.husky/pre-commit +1 -0
- package/.nvmrc +1 -0
- package/README.md +14 -1
- package/package.json +9 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm run check:synthetic-ids
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v24.22.1
|
package/README.md
CHANGED
|
@@ -72,4 +72,17 @@ The script uploads results for the current branch and prints:
|
|
|
72
72
|
- Open issues on new code (when the gate fails)
|
|
73
73
|
- **Accepted / false-positive issues without comment** — DEFRA quality gates require a justification comment on each suppressed issue; add comments in SonarCloud under the issue **Activity** tab
|
|
74
74
|
|
|
75
|
-
Exit code is `0` when the gate passes and all suppressed issues are commented, `1` otherwise.
|
|
75
|
+
Exit code is `0` when the gate passes and all suppressed issues are commented, `1` otherwise.
|
|
76
|
+
|
|
77
|
+
## Pre-commit hook
|
|
78
|
+
|
|
79
|
+
A [Husky](https://typicode.github.io/husky/) pre-commit hook runs [`sfd-id-check`](https://github.com/DEFRA/fcp-sfd-core/tree/main/scripts/check-synthetic-ids), which blocks commits that add real-looking CRNs or SBIs. Pull requests run the same check.
|
|
80
|
+
|
|
81
|
+
Enable the hook once per clone:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install
|
|
85
|
+
npm run setup:husky
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Use synthetic identifiers only: CRNs from `9000000000` to `9999999999` and SBIs from `800000000` to `899999999`. If a flagged number isn't a CRN or SBI, such as a timestamp, add `sfd-id-check: allow` in a comment on the same line, or list it in `.sfd-id-check-allow`. See the [`sfd-id-check` README](https://github.com/DEFRA/fcp-sfd-core/tree/main/scripts/check-synthetic-ids) for details.
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra/fcp-sfd-frontend-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.1",
|
|
4
4
|
"description": "Shared frontend engine used by both the internal and external frontend applications.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=24.22.1"
|
|
8
|
+
},
|
|
6
9
|
"exports": {
|
|
7
10
|
".": {
|
|
8
11
|
"import": "./dist/index.js",
|
|
@@ -15,7 +18,9 @@
|
|
|
15
18
|
"build": "tsup",
|
|
16
19
|
"test": "npm run build && vitest run --coverage",
|
|
17
20
|
"test:watch": "vitest",
|
|
18
|
-
"sonar": "node scripts/sonar-scan.js"
|
|
21
|
+
"sonar": "node scripts/sonar-scan.js",
|
|
22
|
+
"check:synthetic-ids": "sfd-id-check --staged",
|
|
23
|
+
"setup:husky": "node -e \"try { (await import('husky')).default() } catch (e) { if (e.code !== 'ERR_MODULE_NOT_FOUND') throw e }\" --input-type module"
|
|
19
24
|
},
|
|
20
25
|
"repository": {
|
|
21
26
|
"type": "git",
|
|
@@ -40,7 +45,9 @@
|
|
|
40
45
|
"devDependencies": {
|
|
41
46
|
"@vitest/coverage-v8": "5.0.2",
|
|
42
47
|
"eslint": "9.39.2",
|
|
48
|
+
"fcp-sfd-core": "github:DEFRA/fcp-sfd-core#95f58ade56b2d0dd0f15bdcba6a5f37a54bcc939",
|
|
43
49
|
"graphql": "16.13.2",
|
|
50
|
+
"husky": "9.1.7",
|
|
44
51
|
"neostandard": "0.13.0",
|
|
45
52
|
"tsup": "8.5.1",
|
|
46
53
|
"vitest": "5.0.2"
|