@itcase/config 1.6.18 → 1.6.19

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.
@@ -1,9 +1,16 @@
1
+ import { existsSync } from 'node:fs'
2
+ import { resolve } from 'node:path'
3
+
1
4
  export default {
2
5
  '*.(js|jsx|ts|tsx)': (files) => `npx eslint --fix --color ${files.join(' ')}`,
3
6
  '*.css': (files) =>
4
7
  `npx stylelint --fix --color --formatter verbose ${files.join(' ')}`,
5
- 'package.json': [
6
- 'npm install --package-lock-only',
7
- 'git add package-lock.json',
8
- ],
8
+ 'package.json': (files) => {
9
+ // Проверяем, есть ли package.json в корне репозитория
10
+ const rootPackageJson = resolve(process.cwd(), 'package.json')
11
+ if (existsSync(rootPackageJson) && files.includes(rootPackageJson)) {
12
+ return ['npm install --package-lock-only', 'git add package-lock.json']
13
+ }
14
+ return 'true' // Пропускаем, если не найден
15
+ },
9
16
  }
@@ -1,3 +1,6 @@
1
+ import { existsSync } from 'node:fs'
2
+ import { resolve } from 'node:path'
3
+
1
4
  export default {
2
5
  '*.(ts|tsx)': (files) => {
3
6
  const tsFiles = files.filter((f) => /\.(ts|tsx)$/.test(f))
@@ -10,8 +13,12 @@ export default {
10
13
  },
11
14
  '*.css': (files) =>
12
15
  `npx stylelint --fix --color --formatter verbose ${files.join(' ')}`,
13
- 'package.json': [
14
- 'npm install --package-lock-only',
15
- 'git add package-lock.json',
16
- ],
16
+ 'package.json': (files) => {
17
+ // Проверяем, есть ли package.json в корне репозитория
18
+ const rootPackageJson = resolve(process.cwd(), 'package.json')
19
+ if (existsSync(rootPackageJson) && files.includes(rootPackageJson)) {
20
+ return ['npm install --package-lock-only', 'git add package-lock.json']
21
+ }
22
+ return 'true' // Пропускаем, если не найден
23
+ },
17
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/config",
3
- "version": "1.6.18",
3
+ "version": "1.6.19",
4
4
  "author": "ITCase",
5
5
  "description": "ITCase Config ",
6
6
  "engines": {