tool-snippets 0.0.9 → 0.0.10

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.
Files changed (2) hide show
  1. package/README.md +50 -53
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,3 @@
1
- Для WebStorm и VS Code:
2
-
3
1
  ```markdown
4
2
  # ToolSnippets
5
3
 
@@ -38,7 +36,7 @@ npm run SNIPPETS:vscode
38
36
 
39
37
  ## Использование
40
38
 
41
- В редакторе начните вводить префикс сниппета (например `tool_deb`, `tool#forEach`, `tool___subscribe`) — IntelliSense предложит подстановку.
39
+ В редакторе начните вводить префикс сниппета (например `tool-ts-debugger`, `tool-global-forEach`, `tool-ng-subscribe`) — IntelliSense предложит подстановку.
42
40
 
43
41
  ## Структура пакета
44
42
 
@@ -69,64 +67,63 @@ npm publish
69
67
 
70
68
  - Node.js (для скриптов установки)
71
69
 
72
- ### Группы:
73
-
74
- **1. Массивы / циклы**
75
- - `tool#forEach`, `tool#switch`, `tool#switch_NEVER`
76
-
77
- **2. Angular хуки**
78
- - `tool_comp_1_ngOnChanges`, `tool_comp_2_ngOnInit`, `tool_comp_3_ngAfterViewInit`, `tool_comp_4_ngOnDestroy`
70
+ ## Схема префиксов
79
71
 
80
- **3. Angular подписки / DI / ViewChild**
81
- - `tool___subscribe`, `tool___Injector`, `tool____ViewChild_Child`, `tool____ViewChild_Element`
72
+ Префикс = `tool-<группа>-<действие>`.
82
73
 
83
- **4. Angular getter/setter**
84
- - `tool____get_set`, `tool____get_set@Input()`
74
+ ### Группы
85
75
 
86
- **5. TypeScript типы**
87
- - `tool--typePickPartialOmit`, `tool--type_keyof`, `tool--typeTNullable`, `tool--typePartial`, `tool#type_never`, `tool--Interface with readonly`
76
+ **1. `tool-hook-*` — хуки жизненного цикла Angular**
77
+ - `tool-hook-onChanges`, `tool-hook-onInit`, `tool-hook-afterViewInit`, `tool-hook-onDestroy`
88
78
 
89
- **6. TypeScript const / Record**
90
- - `tool-as_const_1`, `tool-as_const_2_Record`, `tool-as_const_3_satisfies_Record`
79
+ **2. `tool-ng-*` — Angular (DI, подписки, ViewChild, get/set)**
80
+ - `tool-ng-subscribe`, `tool-ng-injector`, `tool-ng-viewChild`, `tool-ng-viewChildEl`, `tool-ng-getset`, `tool-ng-getset-input`
91
81
 
92
- **7. try/catch**
93
- - `tool__tryCatch`, `tool__tryCatch.await`
82
+ **3. `tool-type-*` — объявления типов (`type`, `interface`)**
83
+ - `tool-type-pickPartialOmit`, `tool-type-keyof`, `tool-type-nullable`, `tool-type-partial`, `tool-type-never`, `tool-type-readonly`
94
84
 
95
- **8. Отладка**
96
- - `tool_deb`, `tool---globalErrorListeners`, `tool---Proxy_Логирование`
85
+ **4. `tool-ts-*` — значения/выражения TS (`as const`, `Record`, `satisfies`, try, отладка)**
86
+ - `tool-ts-asConst`, `tool-ts-record`, `tool-ts-recordSatisfies`, `tool-ts-try`, `tool-ts-try-await`, `tool-ts-debugger`, `tool-ts-proxy-log`
97
87
 
98
- **9. Глобальные объекты**
99
- - `tool----windowГлобальный_объект`
88
+ **5. `tool-global-*` — общее (массивы, ветвления, глобальные объекты, глобальные ошибки)**
89
+ - `tool-global-forEach`, `tool-global-switch`, `tool-global-switch-never`, `tool-global-window`, `tool-global-errors`
100
90
 
101
- ### Примеры сниппетов
91
+ ## Примеры сниппетов
102
92
 
103
93
  | Префикс | Описание |
104
94
  |---|---|
105
- | `tool#forEach` | forEach по массиву |
106
- | `tool_deb` | `debugger;` |
107
- | `tool_comp_1_ngOnChanges` | хук `ngOnChanges` |
108
- | `tool_comp_2_ngOnInit` | хук `ngOnInit` |
109
- | `tool_comp_3_ngAfterViewInit` | хук `ngAfterViewInit` |
110
- | `tool_comp_4_ngOnDestroy` | хук `ngOnDestroy` |
111
- | `tool___subscribe` | подписка на Observable с `takeUntil` |
112
- | `tool__tryCatch` | блок `try-catch-finally` |
113
- | `tool__tryCatch.await` | tryCatch для promise |
114
- | `tool-as_const_1` | объект `as const` |
115
- | `tool-as_const_2_Record` | `Record<K, V>` + `as const` |
116
- | `tool-as_const_3_satisfies_Record` | `as const satisfies Record` |
117
- | `tool--typePickPartialOmit` | `Pick & Partial<Omit>` |
118
- | `tool--type_keyof` | `keyof` |
119
- | `tool--typeTNullable` | `TNullable<T>` |
120
- | `tool--typePartial` | `Partial<T>` |
121
- | `tool--Interface with readonly` | interface с `readonly` |
122
- | `tool___Injector` | сервис через `Injector` |
123
- | `tool____ViewChild_Child` | `@ViewChild` (компонент) |
124
- | `tool____ViewChild_Element` | `@ViewChild` (ElementRef) |
125
- | `tool____get_set` | getter/setter |
126
- | `tool____get_set@Input()` | getter/setter с `@Input()` |
127
- | `tool---Proxy_Логирование` | Proxy-логирование изменений |
128
- | `tool#type_never` | `switch` + `never` (exhaustive check) |
129
- | `tool#switch` | `switch` блок |
130
- | `tool#switch_NEVER` | `switch` + `never` |
131
- | `tool----windowГлобальный_объект` | declare global window |
132
- | `tool---globalErrorListeners` | global error listeners |
95
+ | `tool-hook-onChanges` | хук `ngOnChanges` |
96
+ | `tool-hook-onInit` | хук `ngOnInit` |
97
+ | `tool-hook-afterViewInit` | хук `ngAfterViewInit` |
98
+ | `tool-hook-onDestroy` | хук `ngOnDestroy` |
99
+ | `tool-ng-subscribe` | подписка на Observable с `takeUntil` |
100
+ | `tool-ng-injector` | сервис через `Injector` |
101
+ | `tool-ng-viewChild` | `@ViewChild` (компонент) |
102
+ | `tool-ng-viewChildEl` | `@ViewChild` (ElementRef) |
103
+ | `tool-ng-getset` | getter/setter |
104
+ | `tool-ng-getset-input` | getter/setter с `@Input()` |
105
+ | `tool-type-pickPartialOmit` | `Pick & Partial<Omit>` |
106
+ | `tool-type-keyof` | `keyof` |
107
+ | `tool-type-nullable` | `TNullable<T>` |
108
+ | `tool-type-partial` | `Partial<T>` |
109
+ | `tool-type-never` | `switch` + `never` (exhaustive check) |
110
+ | `tool-type-readonly` | interface с `readonly` |
111
+ | `tool-ts-asConst` | объект `as const` |
112
+ | `tool-ts-record` | `Record<K, V>` + `as const` |
113
+ | `tool-ts-recordSatisfies` | `as const satisfies Record` |
114
+ | `tool-ts-try` | блок `try-catch-finally` |
115
+ | `tool-ts-try-await` | tryCatch для promise |
116
+ | `tool-ts-debugger` | `debugger;` |
117
+ | `tool-ts-proxy-log` | Proxy-логирование изменений |
118
+ | `tool-global-forEach` | forEach по массиву |
119
+ | `tool-global-switch` | `switch` блок |
120
+ | `tool-global-switch-never` | `switch` + `never` |
121
+ | `tool-global-window` | declare global window |
122
+ | `tool-global-errors` | global error listeners |
123
+ ```
124
+
125
+ Изменения:
126
+ - В «Использование» примеры префиксов заменены на новые.
127
+ - Блок «Группы» переписан под `tool-hook-*`, `tool-ng-*`, `tool-type-*`, `tool-ts-*`, `tool-global-*` (5 групп вместо 9).
128
+ - Таблица примеров пересобрана под новые префиксы, порядок совпадает с группами.
129
+ - Добавлено короткое пояснение схемы `tool-<группа>-<действие>`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tool-snippets",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.0"