fds-vue-core 6.0.13 → 6.1.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/README.md CHANGED
@@ -136,6 +136,45 @@ import { FdsButtonPrimary, FdsInput, FdsModal } from 'fds-vue-core'
136
136
 
137
137
  All components are fully typed. Type definitions are included in the package.
138
138
 
139
+ ## Commit workflow
140
+
141
+ Use these commands to create commits with the shared Commitizen adapter and security dependency helper.
142
+
143
+ ### In this repo
144
+
145
+ ```bash
146
+ pnpm commit
147
+ pnpm commit:vuln
148
+ ```
149
+
150
+ - `pnpm commit` starts Commitizen prompts (configured via `scripts/cz/cz-adapter.cjs`).
151
+ - `pnpm commit:vuln` runs `scripts/vuln-commit.mjs` and auto-creates a `vuln(...)` commit from staged `package.json` dependency bumps.
152
+
153
+ ### In a consuming repo
154
+
155
+ Install dependencies:
156
+
157
+ ```bash
158
+ pnpm add fds-vue-core
159
+ pnpm add -D commitizen
160
+ ```
161
+
162
+ Add this to the consuming repo `package.json`:
163
+
164
+ ```json
165
+ {
166
+ "scripts": {
167
+ "commit": "cz",
168
+ "commit:vuln": "fds-vuln-commit"
169
+ },
170
+ "config": {
171
+ "commitizen": {
172
+ "path": "fds-vue-core/cz-adapter"
173
+ }
174
+ }
175
+ }
176
+ ```
177
+
139
178
  ## Further Documentation
140
179
 
141
180
  - [Usage Guide](./src/docs/Usage.md) - Detailed usage instructions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fds-vue-core",
3
- "version": "6.0.13",
3
+ "version": "6.1.1",
4
4
  "description": "FDS Vue Core Component Library",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,9 @@
28
28
  "./eslint.config.base.js": "./configs/eslint.config.base.js",
29
29
  "./prettier.config.js": "./configs/prettier.config.js",
30
30
  "./vscode-settings.json": "./configs/vscode-settings.json",
31
- "./vuln-commit": "./scripts/vuln-commit.mjs"
31
+ "./vuln-commit": "./scripts/vuln-commit.mjs",
32
+ "./cz-adapter": "./scripts/cz/cz-adapter.cjs",
33
+ "./cz-config": "./scripts/cz/.cz-config.cjs"
32
34
  },
33
35
  "files": [
34
36
  "dist",
@@ -67,7 +69,15 @@
67
69
  "yalc:push": "npm run build && yalc push",
68
70
  "serve:playground": "pnpm --dir playground-consumer dev",
69
71
  "create:release": "bash ./scripts/release.sh",
70
- "vuln-commit": "node scripts/vuln-commit.mjs"
72
+ "commit": "git-cz",
73
+ "commit:vuln": "node scripts/vuln-commit.mjs",
74
+ "vuln-commit": "node scripts/vuln-commit.mjs",
75
+ "cz:config": "node -e \"console.log(require('./scripts/cz/.cz-config.cjs'))\""
76
+ },
77
+ "config": {
78
+ "commitizen": {
79
+ "path": "./scripts/cz/cz-adapter.cjs"
80
+ }
71
81
  },
72
82
  "peerDependencies": {
73
83
  "vue": "^3.5.25"
@@ -93,6 +103,7 @@
93
103
  "@vitest/eslint-plugin": "^1.5.2",
94
104
  "@vue/eslint-config-prettier": "^10.2.0",
95
105
  "@vue/tsconfig": "^0.8.1",
106
+ "commitizen": "^4.3.1",
96
107
  "eslint": "^9.39.2",
97
108
  "eslint-plugin-storybook": "^10.1.10",
98
109
  "eslint-plugin-vue": "~10.6.2",
@@ -123,7 +134,8 @@
123
134
  "overrides": {
124
135
  "minimatch": "^10.2.3",
125
136
  "flatted": "^3.4.2",
126
- "lodash": ">=4.18.0"
137
+ "lodash": ">=4.18.0",
138
+ "tmp": "^0.2.4"
127
139
  },
128
140
  "onlyBuiltDependencies": [
129
141
  "@parcel/watcher",
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ types: [
3
+ { value: 'feat', name: 'feat(scope): Added' },
4
+ { value: 'fix', name: 'fix(scope): Fixed' },
5
+ { value: 'perf', name: 'perf(scope): Performance' },
6
+ { value: 'refactor', name: 'refactor(scope): Changed' },
7
+ { value: 'chore', name: 'chore(scope): Changed' },
8
+ { value: 'dep', name: 'dep(scope): Dependencies (single package or batch)' },
9
+ { value: 'vuln', name: 'vuln(scope): Security dependency update (single package or batch)' },
10
+ { value: 'fix(security)', name: 'fix(security): Security' }
11
+ ],
12
+ allowCustomScopes: true,
13
+ allowBreakingChanges: [],
14
+ skipQuestions: ['footer', 'breaking'],
15
+ subjectLimit: 120,
16
+ messages: {
17
+ type: 'Select the type of change you are committing:',
18
+ customScope: 'Packages (for dep/vuln) or scope:',
19
+ subject: 'Commit subject (imperative, no trailing period):',
20
+ body: "Optional body (use '|' for newline):"
21
+ }
22
+ }
@@ -0,0 +1,112 @@
1
+ module.exports = {
2
+ prompter(cz, commit) {
3
+ const types = [
4
+ { value: "feat", name: "feat(scope): Added" },
5
+ { value: "fix", name: "fix(scope): Fixed" },
6
+ { value: "perf", name: "perf(scope): Performance" },
7
+ { value: "refactor", name: "refactor(scope): Changed" },
8
+ { value: "chore", name: "chore(scope): Changed" },
9
+ { value: "docs", name: "docs(scope): Documentation" },
10
+ { value: "dep", name: "dep(scope): Dependencies (single package or batch)" },
11
+ { value: "vuln", name: "vuln(scope): Security dependency update (single package or batch)" },
12
+ { value: "fix(security)", name: "fix(security): Security" },
13
+ ];
14
+
15
+ const questions = [
16
+ {
17
+ type: "list",
18
+ name: "change_type",
19
+ message: "Select the type of change you are committing",
20
+ choices: types,
21
+ },
22
+ {
23
+ type: "input",
24
+ name: "scope",
25
+ when: (answers) => !["dep", "vuln"].includes(answers.change_type),
26
+ message: "Scope:",
27
+ },
28
+ {
29
+ type: "input",
30
+ name: "packages",
31
+ when: (answers) => ["dep", "vuln"].includes(answers.change_type),
32
+ message: "Packages:",
33
+ },
34
+ {
35
+ type: "list",
36
+ name: "vuln_change_kind",
37
+ when: (answers) => answers.change_type === "vuln",
38
+ message: "Vulnerability change type:",
39
+ choices: [
40
+ { value: "override", name: "override" },
41
+ { value: "bump", name: "bump" },
42
+ ],
43
+ },
44
+ {
45
+ type: "input",
46
+ name: "vuln_target_version",
47
+ when: (answers) => answers.change_type === "vuln",
48
+ message: "Target version/range (e.g. 5.2.2 or >=5.2.2):",
49
+ validate: (value) => (value && value.trim() ? true : "Provide a target version/range"),
50
+ },
51
+ {
52
+ type: "list",
53
+ name: "dep_change_kind",
54
+ when: (answers) => answers.change_type === "dep",
55
+ message: "Dependency change type:",
56
+ choices: [
57
+ { value: "new", name: "new package" },
58
+ { value: "update", name: "updated package" },
59
+ { value: "remove", name: "removed package" },
60
+ ],
61
+ },
62
+ {
63
+ type: "input",
64
+ name: "dep_version",
65
+ when: (answers) => answers.change_type === "dep",
66
+ message: "Version (x.y.z):",
67
+ validate: (value) => (/^\d+\.\d+\.\d+$/.test(value) ? true : "Use format x.y.z"),
68
+ },
69
+ {
70
+ type: "input",
71
+ name: "shortcut_id",
72
+ when: (answers) => !["dep", "vuln"].includes(answers.change_type),
73
+ message: "Shortcut ID digits only (optional, e.g. 1234):",
74
+ },
75
+ {
76
+ type: "input",
77
+ name: "message",
78
+ when: (answers) => !["dep", "vuln"].includes(answers.change_type),
79
+ message: "Commit subject (imperative, no trailing period):",
80
+ },
81
+ {
82
+ type: "input",
83
+ name: "body",
84
+ message: "Optional body (use '|' for newline):",
85
+ },
86
+ ];
87
+
88
+ cz.prompt(questions).then((answers) => {
89
+ const type = answers.change_type;
90
+ const scopeValue = ["dep", "vuln"].includes(type) ? answers.packages : answers.scope;
91
+ const needsEmptyParens = ["dep", "vuln"].includes(type) && !scopeValue;
92
+ const scopePart = scopeValue ? `(${scopeValue})` : needsEmptyParens ? "()" : "";
93
+ const shortcutPart = answers.shortcut_id ? ` [sc-${answers.shortcut_id}]` : "";
94
+ const bodyPart = answers.body ? `\n\n${answers.body.split("|").join("\n")}` : "";
95
+ const depSubject =
96
+ answers.dep_change_kind === "new"
97
+ ? `add ${answers.dep_version}`
98
+ : answers.dep_change_kind === "remove"
99
+ ? `yeet ${answers.dep_version}`
100
+ : `bump to ${answers.dep_version}`;
101
+ const vulnSubject =
102
+ type === "vuln"
103
+ ? answers.vuln_change_kind === "override"
104
+ ? `override ${answers.vuln_target_version}`
105
+ : `bump to ${answers.vuln_target_version}`
106
+ : "";
107
+ const subject = type === "dep" ? depSubject : type === "vuln" ? vulnSubject : answers.message;
108
+ const commitMessage = `${type}${scopePart}: ${subject}${shortcutPart}${bodyPart}`;
109
+ commit(commitMessage);
110
+ });
111
+ },
112
+ };