@itcase/config 1.6.74 → 1.6.75

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.
@@ -28,7 +28,9 @@ function buildTypeChoices(types, typeEnum) {
28
28
  const name = meta
29
29
  ? [meta.emoji, value, meta.description].filter(Boolean).join(': ')
30
30
  : value
31
- return { name, value }
31
+ // `short` is what inquirer reprints after select. Without it the
32
+ // full emoji + description wraps and the next input line jumps.
33
+ return { name: name, short: value, value: value }
32
34
  })
33
35
  }
34
36
 
@@ -82,7 +84,11 @@ async function prompter(inquirer, commit) {
82
84
  type: 'list',
83
85
  name: 'scope',
84
86
  message: messages.scope,
85
- choices: scopeList.map((value) => ({ name: value, value: value })),
87
+ choices: scopeList.map((value) => ({
88
+ name: value,
89
+ short: value,
90
+ value: value,
91
+ })),
86
92
  },
87
93
  {
88
94
  type: 'list',
@@ -91,9 +97,13 @@ async function prompter(inquirer, commit) {
91
97
  choices: function (answers) {
92
98
  const subs = isScopesArray ? [] : SCOPES[answers.scope] || []
93
99
  return [
94
- ...subs.map((value) => ({ name: value, value: value })),
100
+ ...subs.map((value) => ({
101
+ name: value,
102
+ short: value,
103
+ value: value,
104
+ })),
95
105
  new inquirer.Separator(),
96
- { name: 'none', value: '' },
106
+ { name: 'none', short: 'none', value: '' },
97
107
  ]
98
108
  },
99
109
  when: function (answers) {
@@ -16,7 +16,7 @@ export const commonRules = {
16
16
  }
17
17
 
18
18
  export const promptSubjectDescription =
19
- 'Short imperative description in lower-case (no camelCase: use "public dir" not "publicDir")'
19
+ 'Short description (lower-case, no camelCase)'
20
20
 
21
21
  export const promptSubjectRules = [
22
22
  'lower-case only (commitlint subject-case)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.6.74",
3
+ "version": "1.6.75",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {
@@ -95,7 +95,7 @@
95
95
  "postcss-nested-ancestors": "^3.0.0",
96
96
  "postcss-normalize": "^13.0.1",
97
97
  "postcss-prepend-imports": "^1.0.1",
98
- "postcss-preset-env": "^11.5.0",
98
+ "postcss-preset-env": "^11.5.1",
99
99
  "postcss-pxtorem": "^6.1.0",
100
100
  "postcss-sort-media-queries": "^6.7.1",
101
101
  "postcss-unit": "^0.0.3",
@@ -117,13 +117,21 @@ async function main(argv) {
117
117
 
118
118
  let created = 0
119
119
  for (const plan of activePlans) {
120
- git(cwd, ['add', '--', ...plan.files])
120
+ const files = plan.files.filter((file) => fileHasChanges(cwd, file))
121
+ if (!files.length) {
122
+ process.stdout.write(`Skipping empty commit: ${plan.message}\n`)
123
+ continue
124
+ }
125
+
126
+ // Drop leftover index entries so only this plan's files are committed.
127
+ git(cwd, ['reset', '-q', 'HEAD'])
128
+ git(cwd, ['add', '--', ...files])
121
129
  const staged = lines(cwd, ['diff', '--cached', '--name-only'])
122
- const stagedForPlan = plan.files.filter((file) => staged.includes(file))
130
+ const stagedForPlan = files.filter((file) => staged.includes(file))
123
131
  if (!stagedForPlan.length) {
124
132
  throw new Error(
125
133
  `Nothing staged for commit: ${plan.message}\n` +
126
- `Files: ${plan.files.join(', ')}`,
134
+ `Files: ${files.join(', ')}`,
127
135
  )
128
136
  }
129
137