@front-cmdt/format 1.0.12 → 1.1.0

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 ADDED
@@ -0,0 +1,79 @@
1
+ # @front-cmdt/format
2
+
3
+ Общий **Prettier config** для проектов. Включает сортировку импортов через `@trivago/prettier-plugin-sort-imports`.
4
+
5
+ ## Требования
6
+
7
+ - `prettier` (peer dependency): `^3.0.0`
8
+
9
+ ## Установка
10
+
11
+ ```bash
12
+ npm i -D @front-cmdt/format prettier
13
+ # или
14
+ yarn add -D @front-cmdt/format prettier
15
+ # или
16
+ pnpm add -D @front-cmdt/format prettier
17
+ ```
18
+
19
+ ### Создайте: `prettier.js` в проекте
20
+
21
+ ```js
22
+ import config from "@front-cmdt/format/prettier"
23
+
24
+ export default config
25
+ ```
26
+
27
+ ## Пример скриптов
28
+
29
+ `package.json`:
30
+
31
+ ```json
32
+ {
33
+ "scripts": {
34
+ "format": "prettier . --write",
35
+ "format:check": "prettier . --check"
36
+ }
37
+ }
38
+ ```
39
+
40
+ ---
41
+
42
+ # @front-cmdt/format (EN)
43
+
44
+ Shared **Prettier config** for projects. Includes import sorting via `@trivago/prettier-plugin-sort-imports`.
45
+
46
+ ## Requirements
47
+
48
+ - `prettier` (peer dependency): `^3.0.0`
49
+
50
+ ## Install
51
+
52
+ ```bash
53
+ npm i -D @front-cmdt/format prettier
54
+ # or
55
+ yarn add -D @front-cmdt/format prettier
56
+ # or
57
+ pnpm add -D @front-cmdt/format prettier
58
+ ```
59
+
60
+ ### Create: `prettier.js` in your project
61
+
62
+ ```js
63
+ import config from "@front-cmdt/format/prettier"
64
+
65
+ export default config
66
+ ```
67
+
68
+ ## Script examples
69
+
70
+ `package.json`:
71
+
72
+ ```json
73
+ {
74
+ "scripts": {
75
+ "format": "prettier . --write",
76
+ "format:check": "prettier . --check"
77
+ }
78
+ }
79
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@front-cmdt/format",
3
- "version": "1.0.12",
3
+ "version": "1.1.0",
4
4
  "keywords": [],
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,32 +1,20 @@
1
1
  /** @type {import("prettier").Config} */
2
2
 
3
3
  export default {
4
- trailingComma: "none",
5
- tabWidth: 2,
6
- useTabs: true,
7
- semi: false,
8
- singleQuote: true,
9
- jsSingleQuote: true,
10
- arrowParens: "avoid",
11
- printWidth: 120,
4
+ trailingComma: 'none',
5
+ tabWidth: 2,
6
+ useTabs: true,
7
+ semi: false,
8
+ singleQuote: true,
9
+ jsxSingleQuote: true,
10
+ arrowParens: 'avoid',
11
+ printWidth: 120,
12
12
 
13
- importOrderSeparation: true,
14
- singleAttributePerLine: true,
15
- importOrderSortSpecifiers: true,
16
- importOrderInsensitive: true,
17
- importOrderParserPlugins: ["classProperties", "decorators-legacy", "typescript"],
18
- importOrder: [
19
- "<THIRD_PARTY_MODULES>",
20
- "^react$",
21
- // "^@/app/(.*)$",
22
- // "^@/pages/(.*)$",
23
- // "^@/widgets/(.*)$",
24
- // "^@/features/(.*)$",
25
- // "^@/entities/(.*)$",
26
- // "^@/shared/(.*)$",
27
- "^@/(.*)$",
28
- "^../(.*)$",
29
- "^./(.*)$",
30
- ],
31
- plugins: ["@trivago/prettier-plugin-sort-imports"],
13
+ importOrderSeparation: true,
14
+ singleAttributePerLine: true,
15
+ importOrderSortSpecifiers: true,
16
+ importOrderCaseInsensitive: true,
17
+ importOrderParserPlugins: ['classProperties', 'decorators-legacy', 'typescript', 'jsx'],
18
+ importOrder: ['<THIRD_PARTY_MODULES>', '^react$', '^@/(.*)$', '^../(.*)$', '^./(.*)$'],
19
+ plugins: ['@trivago/prettier-plugin-sort-imports']
32
20
  }
package/.gitlab-ci.yml DELETED
@@ -1,41 +0,0 @@
1
- stages:
2
- - publish
3
-
4
- publish:npm:
5
- stage: publish
6
- # NOTE: `image` работает только для Docker/Kubernetes executor.
7
- # На Shell executor (как в вашем логе) этот параметр игнорируется.
8
- image: node:22
9
- rules:
10
- # Аналог GitHub Actions: on.push.tags: ["v*"]
11
- # Публикацию лучше разрешать только с protected-тегов, чтобы
12
- # можно было хранить NPM_TOKEN как Protected variable.
13
- - if: '$CI_COMMIT_TAG =~ /^v.*/ && $CI_COMMIT_REF_PROTECTED == "true"'
14
- when: on_success
15
- # На НЕ-protected тегах job будет виден, но только вручную.
16
- # (Так вы увидите job в pipeline, даже если тег ещё не protected.)
17
- - if: '$CI_COMMIT_TAG =~ /^v.*/'
18
- when: manual
19
- - when: never
20
- script:
21
- - node --version
22
- - npm --version
23
- # Фейлимся сразу, если токен не прокинулся (самая частая причина ENEEDAUTH)
24
- - |
25
- if [ -z "${NPM_TOKEN:-}" ]; then
26
- echo "ERROR: NPM_TOKEN is not set for this job."
27
- echo "Check GitLab CI/CD Variables: Protected/Masked/Environment scope and whether the tag/ref is protected."
28
- exit 1
29
- fi
30
- # Явно создаём ~/.npmrc (npm умеет подставлять env vars вида ${NPM_TOKEN})
31
- - |
32
- cat > ~/.npmrc <<'EOF'
33
- registry=https://registry.npmjs.org/
34
- always-auth=true
35
- //registry.npmjs.org/:_authToken=${NPM_TOKEN}
36
- @front-cmdt:registry=https://registry.npmjs.org/
37
- EOF
38
- # Быстрая проверка авторизации (без публикации)
39
- - npm whoami
40
- - npm publish
41
-