@itcase/config 1.7.1 → 1.7.3

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
@@ -38,7 +38,10 @@ npm install --save-dev @itcase/config
38
38
  - `semantic-release/indexVSMarketplace.js` — для VS Code расширений
39
39
 
40
40
  - **SVGR** — преобразование SVG в React компоненты
41
- - `svgr/index.js` — базовая конфигурация
41
+ - `svgr/index.js` — реэкспорт
42
+ - `svgr/svgrConfigBase.js` — общие plugins и svgo
43
+ - `svgr/svgrConfigWeb.js` — веб
44
+ - `svgr/svgrConfigReactNative.js` — React Native (`native: true`)
42
45
  - `svgr/webpack.js` — интеграция с Webpack
43
46
 
44
47
  ## Подключение Lint-staged
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config",
6
6
  "engines": {
@@ -111,6 +111,7 @@
111
111
  "semantic-release-lerna": "^3.6.5"
112
112
  },
113
113
  "devDependencies": {
114
+ "@itcase/agent-skills": "^1.0.13",
114
115
  "@itcase/lint": "^1.1.126",
115
116
  "eslint": "9.39.2",
116
117
  "husky": "^9.1.7",
@@ -48,7 +48,7 @@ const AGENT_WAIT_STEPS = [
48
48
  'Still thinking',
49
49
  'Waiting for response',
50
50
  ]
51
- const HELP = `smart-commit [--dry-run] [--yes|-y] [--type t] [--model id] [--verbose]
51
+ const HELP = `smart-commit [--dry-run] [--yes|-y] [--no-verify] [--type t] [--model id] [--verbose]
52
52
  [--cat|--nyan] [--banana] [--upyachka]
53
53
 
54
54
  Cursor Agent → commit messages by SCOPES → [y/N] → git commit
@@ -56,6 +56,10 @@ Run via: npm exec smart-commit (from project with @itcase/config)
56
56
  Needs: agent login (or CURSOR_API_KEY) + commitlint.config.* with SCOPES
57
57
  Default model: ${DEFAULT_MODEL} (override with --model / SMART_COMMIT_MODEL).
58
58
 
59
+ --no-verify is passed to git commit and skips hooks
60
+ (husky pre-commit / lint-staged and commit-msg). Commit message
61
+ is still checked by smart-commit before git runs.
62
+
59
63
  Progress sprite is random (nyan cat, banana, or upyachka).
60
64
  Force with --cat, --banana, or --upyachka. Agent log is below.
61
65
  `
@@ -181,9 +185,17 @@ async function main(argv) {
181
185
  )
182
186
  }
183
187
 
184
- process.stdout.write(' git commit (husky)…\n')
188
+ process.stdout.write(
189
+ option.noVerify
190
+ ? ' git commit --no-verify (hooks skipped)…\n'
191
+ : ' git commit (husky)…\n',
192
+ )
185
193
  try {
186
- git(cwd, ['commit', '-m', plan.message], { inherit: true })
194
+ const commitArgs = ['commit', '-m', plan.message]
195
+ // Skips pre-commit (lint-staged) and commit-msg. lint-staged has no
196
+ // equivalent flag — the hook simply does not run.
197
+ if (option.noVerify) commitArgs.push('--no-verify')
198
+ git(cwd, commitArgs, { inherit: true })
187
199
  } catch (error) {
188
200
  throw new Error(`git commit failed: ${plan.message}\n${error.message}`, {
189
201
  cause: error,
@@ -208,6 +220,7 @@ function parseArgs(argv) {
208
220
  type: '',
209
221
  dryRun: false,
210
222
  model: '',
223
+ noVerify: false,
211
224
  sprite: '',
212
225
  staged: false,
213
226
  verbose: false,
@@ -216,6 +229,7 @@ function parseArgs(argv) {
216
229
  for (let i = 0; i < argv.length; i++) {
217
230
  const arg = argv[i]
218
231
  if (arg === '--dry-run') option.dryRun = true
232
+ else if (arg === '--no-verify') option.noVerify = true
219
233
  else if (arg === '--yes' || arg === '-y') option.yes = true
220
234
  else if (arg === '--verbose') option.verbose = true
221
235
  else if (arg === '--staged') option.staged = true
package/svgr/index.js CHANGED
@@ -1,20 +1,5 @@
1
- export default {
2
- plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx'],
3
- svgoConfig: {
4
- plugins: [
5
- {
6
- name: 'preset-default',
7
- },
8
- {
9
- name: 'removeAttrs',
10
- params: { attrs: '(fill|stroke|stroke-width)' },
11
- },
12
- {
13
- name: 'addAttributesToSVGElement',
14
- params: {
15
- attributes: [{ fill: 'none' }, { stroke: 'none' }],
16
- },
17
- },
18
- ],
19
- },
20
- }
1
+ import { svgrConfigBase } from './svgrConfigBase.js'
2
+ import { svgrConfigReactNative } from './svgrConfigReactNative.js'
3
+ import { svgrConfigWeb } from './svgrConfigWeb.js'
4
+
5
+ export { svgrConfigBase, svgrConfigReactNative, svgrConfigWeb }
@@ -0,0 +1,33 @@
1
+ const svgrConfigBase = {
2
+ plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx'],
3
+ svgoConfig: {
4
+ plugins: [
5
+ {
6
+ name: 'preset-default',
7
+ // preset-default would drop viewBox and icons would stop scaling.
8
+ params: {
9
+ overrides: {
10
+ convertColors: false,
11
+ inlineStyles: {
12
+ onlyMatchedOnce: false,
13
+ },
14
+ removeUnknownsAndDefaults: false,
15
+ removeViewBox: false,
16
+ },
17
+ },
18
+ },
19
+ {
20
+ name: 'removeAttrs',
21
+ params: { attrs: '(fill|stroke|stroke-width)' },
22
+ },
23
+ {
24
+ name: 'addAttributesToSVGElement',
25
+ params: {
26
+ attributes: [{ fill: 'none' }, { stroke: 'none' }],
27
+ },
28
+ },
29
+ ],
30
+ },
31
+ }
32
+
33
+ export { svgrConfigBase }
@@ -0,0 +1,9 @@
1
+ import { svgrConfigBase } from './svgrConfigBase.js'
2
+
3
+ // react-native-svg-transformer replaces its svgoConfig with this one.
4
+ const svgrConfigReactNative = {
5
+ ...svgrConfigBase,
6
+ native: true,
7
+ }
8
+
9
+ export { svgrConfigReactNative }
@@ -0,0 +1,7 @@
1
+ import { svgrConfigBase } from './svgrConfigBase.js'
2
+
3
+ const svgrConfigWeb = {
4
+ ...svgrConfigBase,
5
+ }
6
+
7
+ export { svgrConfigWeb }