@salsita-ai/common 0.0.0-stage → 0.49.0-develop.d4bea2382c
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/CHANGELOG.md +278 -0
- package/LICENSE +61 -0
- package/README.md +34 -2
- package/dist/env/index.d.ts +14 -0
- package/dist/env/index.js +1 -0
- package/dist/eslint/index.d.ts +13 -0
- package/dist/eslint/index.js +1 -0
- package/dist/prettier/index.d.ts +2 -0
- package/dist/prettier/index.js +1 -0
- package/dist/utils/assert-existence.d.ts +8 -0
- package/dist/utils/assert-existence.js +1 -0
- package/dist/utils/branded-types.d.ts +13 -0
- package/dist/utils/branded-types.js +1 -0
- package/dist/utils/canonical-stringify.d.ts +10 -0
- package/dist/utils/canonical-stringify.js +1 -0
- package/dist/utils/colors.d.ts +9 -0
- package/dist/utils/colors.js +1 -0
- package/dist/utils/composite-key-map.d.ts +42 -0
- package/dist/utils/composite-key-map.js +1 -0
- package/dist/utils/console-logger.d.ts +6 -0
- package/dist/utils/console-logger.js +1 -0
- package/dist/utils/create-selector.d.ts +65 -0
- package/dist/utils/create-selector.js +1 -0
- package/dist/utils/deep-partial.d.ts +3 -0
- package/dist/utils/deep-partial.js +1 -0
- package/dist/utils/empty.d.ts +1 -0
- package/dist/utils/empty.js +1 -0
- package/dist/utils/extended-json-schema.d.ts +15 -0
- package/dist/utils/extended-json-schema.js +1 -0
- package/dist/utils/index.d.ts +30 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/info-error.d.ts +9 -0
- package/dist/utils/info-error.js +1 -0
- package/dist/utils/is-array.d.ts +8 -0
- package/dist/utils/is-array.js +1 -0
- package/dist/utils/is-equal-array.d.ts +6 -0
- package/dist/utils/is-equal-array.js +1 -0
- package/dist/utils/is-equal-nullish.d.ts +6 -0
- package/dist/utils/is-equal-nullish.js +1 -0
- package/dist/utils/is-non-empty-string.d.ts +6 -0
- package/dist/utils/is-non-empty-string.js +1 -0
- package/dist/utils/is-non-nullish.d.ts +6 -0
- package/dist/utils/is-non-nullish.js +1 -0
- package/dist/utils/is-shallow-equal.d.ts +8 -0
- package/dist/utils/is-shallow-equal.js +1 -0
- package/dist/utils/localizable.d.ts +98 -0
- package/dist/utils/localizable.js +1 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.js +1 -0
- package/dist/utils/memo-once.d.ts +1 -0
- package/dist/utils/memo-once.js +1 -0
- package/dist/utils/object-with-key.d.ts +17 -0
- package/dist/utils/object-with-key.js +1 -0
- package/dist/utils/observable-with-last-value.d.ts +9 -0
- package/dist/utils/observable-with-last-value.js +1 -0
- package/dist/utils/omit.d.ts +12 -0
- package/dist/utils/omit.js +1 -0
- package/dist/utils/sticky-cache.d.ts +29 -0
- package/dist/utils/sticky-cache.js +1 -0
- package/dist/utils/try-or-default.d.ts +1 -0
- package/dist/utils/try-or-default.js +1 -0
- package/dist/utils/union-to-intersection.d.ts +12 -0
- package/dist/utils/union-to-intersection.js +1 -0
- package/dist/utils/value-of.d.ts +1 -0
- package/dist/utils/value-of.js +1 -0
- package/dist/utils/with-optional.d.ts +1 -0
- package/dist/utils/with-optional.js +1 -0
- package/dist/utils/with-required.d.ts +3 -0
- package/dist/utils/with-required.js +1 -0
- package/dist/utils/zod-types.d.ts +18 -0
- package/dist/utils/zod-types.js +1 -0
- package/package.json +95 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to the @salsita-ai/common package will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.48.0]
|
|
6
|
+
|
|
7
|
+
change!: remove the unused process-local `AsyncCache` utility (CON-2556, CON-2685)
|
|
8
|
+
|
|
9
|
+
**Migration:** replace `AsyncCache` with a caller-owned cache appropriate for the application's runtime. Server applications should use shared storage when cache entries must remain coherent across instances.
|
|
10
|
+
|
|
11
|
+
change!(common): filter console logs below info by default
|
|
12
|
+
|
|
13
|
+
`initConsoleLogger` now omits debug and verbose messages unless its `level` option is `debug`. Console calls also omit trailing `undefined` arguments.
|
|
14
|
+
|
|
15
|
+
Migration: pass `initConsoleLogger({ level: 'debug' })` to preserve the previous always-on debug and verbose output.
|
|
16
|
+
|
|
17
|
+
fix: require explicitly pinned state reads when composing memoized selectors
|
|
18
|
+
|
|
19
|
+
chore: build and type-check with the TypeScript 7 native compiler
|
|
20
|
+
|
|
21
|
+
chore: resolve all pnpm audit findings (CON-2655)
|
|
22
|
+
|
|
23
|
+
Bump @babel/core to 7.29.7, clearing the sourceMappingURL arbitrary-file-read advisory for consumers installing this package, as part of bringing `pnpm audit` to zero findings workspace-wide.
|
|
24
|
+
|
|
25
|
+
feat: add `canonicalStringify`, a key-sorted deterministic JSON serializer for stable hashing (CON-2755)
|
|
26
|
+
|
|
27
|
+
## [0.47.0]
|
|
28
|
+
|
|
29
|
+
- Empty
|
|
30
|
+
|
|
31
|
+
## [0.46.0]
|
|
32
|
+
|
|
33
|
+
- Empty
|
|
34
|
+
|
|
35
|
+
## [0.45.0]
|
|
36
|
+
|
|
37
|
+
### 2026-06-01 commit dd378335f PR #1582
|
|
38
|
+
|
|
39
|
+
chore: bump @lingui/core 4.11.3 → 5.9.5
|
|
40
|
+
|
|
41
|
+
See `@salsita-ai/platform-project-sdk` changelog for the lingui 4 → 5 migration guide.
|
|
42
|
+
|
|
43
|
+
### 2026-06-01 commit eba73549e PR #1581
|
|
44
|
+
|
|
45
|
+
chore: bump @swc/core 1.4.2 → 1.7.28, @swc/cli 0.3.10 → 0.7.10
|
|
46
|
+
|
|
47
|
+
### 2026-06-01 commit fabe5ce58 PR #1580
|
|
48
|
+
|
|
49
|
+
chore: bump typescript 5.7.2 → 5.9.3, `@types/eslint` 8.56.5 → 9.6.1
|
|
50
|
+
|
|
51
|
+
### 2026-06-01 commit 868ced09c PR #1572
|
|
52
|
+
|
|
53
|
+
chore: drop unused chokidar dep; bump prettier 3.2.{2,5} → 3.8.3 (deps + peerDeps)
|
|
54
|
+
|
|
55
|
+
### 2026-06-01 commit fdd0ae84c PR #1570
|
|
56
|
+
|
|
57
|
+
chore: dep updates
|
|
58
|
+
|
|
59
|
+
- `envalid` 8.0.0 → 8.1.1 (deps + peerDeps)
|
|
60
|
+
- `rxjs` 7.8.1 → 7.8.2 (deps + peerDeps)
|
|
61
|
+
- `dotenv` 16.4.1 → 17.4.2; added `quiet: true` to `config()` in `env/index.ts` to silence v17's new injection logs
|
|
62
|
+
- `lodash-es` 4.17.21 → 4.18.1 (CVE-2026-4800, CVE-2026-2950, CVE-2025-13465)
|
|
63
|
+
|
|
64
|
+
## [0.44.0]
|
|
65
|
+
|
|
66
|
+
- Empty
|
|
67
|
+
|
|
68
|
+
## [0.43.0]
|
|
69
|
+
|
|
70
|
+
- Empty
|
|
71
|
+
|
|
72
|
+
## [0.42.0]
|
|
73
|
+
|
|
74
|
+
- Empty
|
|
75
|
+
|
|
76
|
+
## [0.41.0]
|
|
77
|
+
|
|
78
|
+
- Empty
|
|
79
|
+
|
|
80
|
+
## [0.40.0]
|
|
81
|
+
|
|
82
|
+
- Empty
|
|
83
|
+
|
|
84
|
+
## [0.39.0]
|
|
85
|
+
|
|
86
|
+
- Empty
|
|
87
|
+
|
|
88
|
+
## [0.38.0]
|
|
89
|
+
|
|
90
|
+
- Empty
|
|
91
|
+
|
|
92
|
+
## [0.37.0]
|
|
93
|
+
|
|
94
|
+
- Empty
|
|
95
|
+
|
|
96
|
+
## [0.36.0]
|
|
97
|
+
|
|
98
|
+
- Empty
|
|
99
|
+
|
|
100
|
+
## [0.35.0]
|
|
101
|
+
|
|
102
|
+
- fix: `readConfigRecursive` no longer logs warning when PNPM workspace file is not found
|
|
103
|
+
|
|
104
|
+
## [0.34.0]
|
|
105
|
+
|
|
106
|
+
- Empty
|
|
107
|
+
|
|
108
|
+
## [0.33.0]
|
|
109
|
+
|
|
110
|
+
- Empty
|
|
111
|
+
|
|
112
|
+
## [0.32.0]
|
|
113
|
+
|
|
114
|
+
- feat: Add `tryOrDefault` utility function for safe function execution with fallback value
|
|
115
|
+
|
|
116
|
+
## [0.31.0]
|
|
117
|
+
|
|
118
|
+
- fix: `readConfigRecursive` (recursive .env file resolving) logs warning instead of an error when PNPM workspace file is not found
|
|
119
|
+
|
|
120
|
+
## [0.30.0]
|
|
121
|
+
|
|
122
|
+
- Empty
|
|
123
|
+
|
|
124
|
+
## [0.29.0]
|
|
125
|
+
|
|
126
|
+
- change!: Remove `resolveLocalizableString` in favor of `resolveLocalizable`
|
|
127
|
+
- feat: Introduce `MultilingualString` as another variant of `Localizable` which uses a hash of language code and translation - mainly useful for data coming from the admin portal
|
|
128
|
+
|
|
129
|
+
- feat: `memoOnce` added for singleton factories and "trigger once" effects
|
|
130
|
+
|
|
131
|
+
- feat: `ObservableWithLastValue` type moved here from `@salsita-ai/platform-project-sdk/react`
|
|
132
|
+
|
|
133
|
+
- feat: `toObservableWithLastValue` added - use it to create an observable suited for eager reading from any observable,
|
|
134
|
+
when you know the initial value
|
|
135
|
+
|
|
136
|
+
## [0.28.0]
|
|
137
|
+
|
|
138
|
+
- Empty
|
|
139
|
+
|
|
140
|
+
## [0.27.0]
|
|
141
|
+
|
|
142
|
+
- Empty
|
|
143
|
+
|
|
144
|
+
## [0.26.0]
|
|
145
|
+
|
|
146
|
+
- Empty
|
|
147
|
+
|
|
148
|
+
## [0.25.0]
|
|
149
|
+
|
|
150
|
+
- Empty
|
|
151
|
+
|
|
152
|
+
## [0.24.0]
|
|
153
|
+
|
|
154
|
+
- Empty
|
|
155
|
+
|
|
156
|
+
## [0.23.0]
|
|
157
|
+
|
|
158
|
+
- Empty
|
|
159
|
+
|
|
160
|
+
## [0.22.0] (2025-1-29)
|
|
161
|
+
|
|
162
|
+
- Empty
|
|
163
|
+
|
|
164
|
+
## [0.21.0] (2025-1-22)
|
|
165
|
+
|
|
166
|
+
- Empty
|
|
167
|
+
|
|
168
|
+
## [0.20.0] (2025-1-15)
|
|
169
|
+
|
|
170
|
+
- Empty
|
|
171
|
+
|
|
172
|
+
## [0.19.0] (2025-1-8)
|
|
173
|
+
|
|
174
|
+
- Empty
|
|
175
|
+
|
|
176
|
+
## [0.18.2] (2025-1-7)
|
|
177
|
+
|
|
178
|
+
- Empty
|
|
179
|
+
|
|
180
|
+
## [0.18.1] (2025-1-7)
|
|
181
|
+
|
|
182
|
+
- Empty
|
|
183
|
+
|
|
184
|
+
## [0.18.0] (2025-1-7)
|
|
185
|
+
|
|
186
|
+
- change!: Migrated from utils to common - now includes /env, /prettier, /eslint, /utils
|
|
187
|
+
|
|
188
|
+
To migrate rename the imports to the new paths
|
|
189
|
+
|
|
190
|
+
## [0.17.0] (2024-12-18)
|
|
191
|
+
|
|
192
|
+
- Empty
|
|
193
|
+
|
|
194
|
+
## [0.16.0] (2024-11-26)
|
|
195
|
+
|
|
196
|
+
- Empty
|
|
197
|
+
|
|
198
|
+
## [0.15.0] (2024-11-19)
|
|
199
|
+
|
|
200
|
+
- Empty
|
|
201
|
+
|
|
202
|
+
## [0.14.0] (2024-11-15)
|
|
203
|
+
|
|
204
|
+
- feat: `initConsoleLogger` moved to this package from `react-sdk`
|
|
205
|
+
|
|
206
|
+
## [0.13.0] (2024-11-7)
|
|
207
|
+
|
|
208
|
+
- Empty
|
|
209
|
+
|
|
210
|
+
## [0.12.0] (2024-11-5)
|
|
211
|
+
|
|
212
|
+
- Empty
|
|
213
|
+
|
|
214
|
+
## [0.11.0] (2024-10-25)
|
|
215
|
+
|
|
216
|
+
- feat: Added basic types and helpers for localizable strings: `Localizable`, `isMessageDescriptor`, `resolveLocalizable`
|
|
217
|
+
|
|
218
|
+
## [0.10.0] (2024-10-22)
|
|
219
|
+
|
|
220
|
+
- Empty
|
|
221
|
+
|
|
222
|
+
## [0.9.0] (2024-10-16)
|
|
223
|
+
|
|
224
|
+
- Empty
|
|
225
|
+
|
|
226
|
+
## [0.8.0] (2024-10-10)
|
|
227
|
+
|
|
228
|
+
- Empty
|
|
229
|
+
|
|
230
|
+
## [0.7.0] (2024-10-9)
|
|
231
|
+
|
|
232
|
+
- Empty
|
|
233
|
+
|
|
234
|
+
## [0.6.0] (2024-10-2)
|
|
235
|
+
|
|
236
|
+
- Empty
|
|
237
|
+
|
|
238
|
+
## [0.5.0] (2024-9-27)
|
|
239
|
+
|
|
240
|
+
### Bug Fixes
|
|
241
|
+
|
|
242
|
+
- None
|
|
243
|
+
|
|
244
|
+
### Features
|
|
245
|
+
|
|
246
|
+
- None
|
|
247
|
+
|
|
248
|
+
## [0.4.0] (2024-9-23)
|
|
249
|
+
|
|
250
|
+
### Bug Fixes
|
|
251
|
+
|
|
252
|
+
- None
|
|
253
|
+
|
|
254
|
+
### Features
|
|
255
|
+
|
|
256
|
+
- Providing .d.ts files for the published build
|
|
257
|
+
|
|
258
|
+
## [0.3.0] (2024-9-20)
|
|
259
|
+
|
|
260
|
+
### Bug Fixes
|
|
261
|
+
|
|
262
|
+
- None
|
|
263
|
+
|
|
264
|
+
### Features
|
|
265
|
+
|
|
266
|
+
- Adding appendToGlobalContext() to Logger interface
|
|
267
|
+
|
|
268
|
+
## 0.2.0 (2024-9-4)
|
|
269
|
+
|
|
270
|
+
Initial testing release
|
|
271
|
+
|
|
272
|
+
## 0.1.0 (2024-9-3)
|
|
273
|
+
|
|
274
|
+
Initial testing release
|
|
275
|
+
|
|
276
|
+
## 0.0.1 (2024-8-12)
|
|
277
|
+
|
|
278
|
+
Initial testing release
|
package/LICENSE
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Salsita SDK License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Salsita s.r.o. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and its associated documentation (the "Software") are
|
|
6
|
+
proprietary to Salsita s.r.o., Štefánikova 18/25, 150 00 Prague 5,
|
|
7
|
+
Czech Republic, Company ID 272 04 201 ("Salsita"). The Software is
|
|
8
|
+
licensed, not sold. By installing, copying or using the Software you
|
|
9
|
+
agree to this license and to the Salsita SDK Terms at
|
|
10
|
+
https://salsita.ai/terms (the "Terms"). If you do not agree,
|
|
11
|
+
do not use the Software.
|
|
12
|
+
|
|
13
|
+
1. License grant
|
|
14
|
+
Subject to this license and the Terms, Salsita grants you a limited,
|
|
15
|
+
non-exclusive, non-transferable, non-sublicensable, revocable license to:
|
|
16
|
+
(a) install and use the Software to develop, test and evaluate
|
|
17
|
+
applications built for the Salsita platform; and
|
|
18
|
+
(b) use the Software in production, and distribute it in compiled form
|
|
19
|
+
as part of such applications, only while you hold an active
|
|
20
|
+
Salsita account in good standing.
|
|
21
|
+
|
|
22
|
+
2. Restrictions
|
|
23
|
+
Except as expressly permitted above or by applicable law, you may not:
|
|
24
|
+
(a) redistribute, sublicense, sell, rent or lease the Software, or make
|
|
25
|
+
it available to third parties as a standalone product;
|
|
26
|
+
(b) modify, translate or create derivative works of the Software;
|
|
27
|
+
(c) reverse engineer, decompile or disassemble the Software, or attempt
|
|
28
|
+
to derive its source code;
|
|
29
|
+
(d) use the Software with, or to build, a product or service that
|
|
30
|
+
competes with or replaces the Salsita platform;
|
|
31
|
+
(e) remove or alter any copyright, trademark or licence notice.
|
|
32
|
+
|
|
33
|
+
3. Ownership
|
|
34
|
+
Salsita and its licensors retain all right, title and interest in the
|
|
35
|
+
Software, including all intellectual property rights. No rights are
|
|
36
|
+
granted except those expressly stated in this license.
|
|
37
|
+
|
|
38
|
+
4. Third-party components
|
|
39
|
+
The Software may include third-party components distributed under their
|
|
40
|
+
own licences. Those licences govern your use of those components.
|
|
41
|
+
|
|
42
|
+
5. Termination
|
|
43
|
+
This license ends automatically if you breach it or if your account is
|
|
44
|
+
closed. On termination you must stop using the Software and delete all
|
|
45
|
+
copies in your possession. Sections 2, 3, 6 and 7 survive termination.
|
|
46
|
+
|
|
47
|
+
6. Disclaimer of warranty
|
|
48
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
49
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
50
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
51
|
+
|
|
52
|
+
7. Limitation of liability
|
|
53
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, SALSITA SHALL NOT BE LIABLE FOR
|
|
54
|
+
ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR
|
|
55
|
+
FOR ANY LOSS OF PROFITS, REVENUE OR DATA, ARISING OUT OF OR RELATED TO
|
|
56
|
+
THE SOFTWARE, WHETHER IN CONTRACT, TORT OR OTHERWISE.
|
|
57
|
+
|
|
58
|
+
8. Terms
|
|
59
|
+
The Terms supplement this license. If the Terms and this license
|
|
60
|
+
conflict, the Terms prevail. If you have a separate signed agreement
|
|
61
|
+
with Salsita covering the Software, that agreement prevails over both.
|
package/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @salsita-ai/common
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared utilities of the Salsita SDK: small runtime and type helpers, validated environment loading, and the ESLint and Prettier configurations that generated projects use.
|
|
4
|
+
|
|
5
|
+
A project on the application-spec pipeline does not install this package itself: `@salsita-ai/sdk` depends on it and re-exports every entry point, so the project imports it through the SDK. Projects in the legacy format still declare it directly and import it by its own name; both paths resolve to the same code.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createEnvReader } from '@salsita-ai/sdk/common/env'
|
|
9
|
+
import { Branded } from '@salsita-ai/sdk/common/utils'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Entry points
|
|
13
|
+
|
|
14
|
+
There is no package-root export. Import from one of the paths declared in `package.json`.
|
|
15
|
+
|
|
16
|
+
| Entry point | Contents |
|
|
17
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| `utils` | General-purpose helpers for browser and Node: branded types, assertions, equality and nullish checks, cache and selector helpers, localization shapes, color parsing, Zod helpers. |
|
|
19
|
+
| `env` | `createEnvReader`, which loads environment variables into an `envalid` specification. |
|
|
20
|
+
| `eslint` | Shared flat ESLint configurations: `eslintrc`, `eslintrcReactWithStoryBook`, and the optional `devLinguiEslintrcRules`. |
|
|
21
|
+
| `prettier` | `prettierrc`, the shared Prettier configuration with its import-order plugin setup. |
|
|
22
|
+
|
|
23
|
+
### Environment loading
|
|
24
|
+
|
|
25
|
+
`createEnvReader` reads variables with this precedence, highest first:
|
|
26
|
+
|
|
27
|
+
1. Variables already present in `process.env`.
|
|
28
|
+
2. `.env.generated`, written by the CLI with deployment values.
|
|
29
|
+
3. `.env`, the developer's own values and credentials.
|
|
30
|
+
|
|
31
|
+
It searches the current package and the pnpm workspace root, expands variable references after merging, and validates the result with the supplied `envalid` specs. A value in `.env` therefore never overrides a process or generated deployment value. The consuming project owns its `.env.example`; this package has no environment variables of its own.
|
|
32
|
+
|
|
33
|
+
## Licence
|
|
34
|
+
|
|
35
|
+
Proprietary software of Salsita s.r.o., published under the Salsita SDK License (the `LICENSE` file in this package) and the terms at https://salsita.ai/terms. The published package contains minified code without source maps.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CleanOptions, CleanedEnv } from 'envalid';
|
|
2
|
+
/**
|
|
3
|
+
* Create a function that reads and parses the environment variables.
|
|
4
|
+
*
|
|
5
|
+
* The variables are read from
|
|
6
|
+
* - the process environment,
|
|
7
|
+
* - `.env.generated` file
|
|
8
|
+
* - and `.env` file
|
|
9
|
+
*
|
|
10
|
+
* in this order of precedence.
|
|
11
|
+
*
|
|
12
|
+
* The function parses the variable based on the provided `envalid` specs and options
|
|
13
|
+
*/
|
|
14
|
+
export declare const createEnvReader: <S>(specs: S, options?: CleanOptions<S>) => () => CleanedEnv<S>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{config as r}from"dotenv";import{expand as e}from"dotenv-expand";import{cleanEnv as o}from"envalid";import{findUpSync as t,pathExistsSync as n}from"find-up";import{dirname as p,resolve as s}from"node:path";let d=(e,o)=>{let d=process.cwd(),a=[d],i=t("pnpm-workspace.yaml",{stopAt:"../../.."});if(i){let r=p(i);r!==d&&a.unshift(r)}return a.reduce((t,p)=>{let d=s(p,o);if(!n(d))return t;let a=r({processEnv:e,path:d,quiet:!0});return a.error&&(console.error("DotEnv error:",a.error),t.error=t.error??a.error),Object.assign(t.parsed,a.parsed),t},{error:void 0,parsed:{}})};export const createEnvReader=(r,t={})=>()=>{let n={...process.env},p=d(n,".env.generated"),s=d(n,".env");return e({...s,parsed:{...s.parsed,...p.parsed},ignoreProcessEnv:!0}),o(n,r,t)};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Linter } from 'eslint';
|
|
2
|
+
export declare const eslintrc: Linter.Config[];
|
|
3
|
+
export declare const eslintrcReactWithStoryBook: Linter.Config[];
|
|
4
|
+
/**
|
|
5
|
+
* This is good for finding out potential undiscovered translatable locales, but is too strict and
|
|
6
|
+
* too badly configurable to be used as a permanent rule.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { devLinguiEslintrcRules, eslintrc } from '@salsita-ai/sdk/common/eslint'
|
|
10
|
+
|
|
11
|
+
export default [...eslintrc, ...devLinguiEslintrcRules]
|
|
12
|
+
*/
|
|
13
|
+
export declare const devLinguiEslintrcRules: Linter.Config[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"@eslint/js";import r from"eslint-plugin-import";import t from"eslint-plugin-lingui";import s from"eslint-plugin-lodash";import o from"eslint-plugin-react";import i from"eslint-plugin-react-hooks";import n from"eslint-plugin-storybook";import l from"eslint-plugin-unused-imports";import p from"globals";import c from"typescript-eslint";let a=[{ignores:["**/*.cjs","**/dist/**","**/.phoenix/**"]},e.configs.recommended,...c.configs.recommended,{plugins:{"react-hooks":i,lodash:s,"unused-imports":l,lingui:t,import:r},languageOptions:{globals:{...p.browser,...p.node},parserOptions:{project:["./tsconfig.json"]}},rules:{"react-hooks/exhaustive-deps":["error",{additionalHooks:"(\\*\\.)?(useStoreSelector|useRenderedSelector|useStoreSelector$|useRenderedSelector$)"}],"react-hooks/rules-of-hooks":"error","import/order":["error",{groups:[["builtin","external"],"internal"],"newlines-between":"always-and-inside-groups"}],"lodash/import-scope":["error","method"],"unused-imports/no-unused-imports":"error","@typescript-eslint/consistent-type-definitions":["off"]}},{files:["**/*.tsx"],plugins:{react:o},rules:{"react/jsx-curly-brace-presence":["error",{props:"never",children:"never"}]}},{files:["**/*.ts","**/*.tsx"],rules:{"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-empty-object-type":"off","@typescript-eslint/ban-ts-comment":["error",{"ts-expect-error":"allow-with-description","ts-ignore":"allow-with-description","ts-nocheck":!0,"ts-check":!1,minimumDescriptionLength:10}],"@typescript-eslint/consistent-type-assertions":["error",{assertionStyle:"as",objectLiteralTypeAssertions:"allow"}],"@typescript-eslint/consistent-type-exports":["error",{fixMixedExportsWithInlineTypeSpecifier:!1}],"@typescript-eslint/consistent-type-imports":["error",{prefer:"type-imports",fixStyle:"separate-type-imports"}],"@typescript-eslint/explicit-function-return-type":"off","@typescript-eslint/method-signature-style":"off","@typescript-eslint/no-misused-promises":["error",{checksVoidReturn:!1}],"@typescript-eslint/no-non-null-assertion":"off","@typescript-eslint/no-unnecessary-type-assertion":"off","@typescript-eslint/no-unused-vars":["error",{args:"after-used",argsIgnorePattern:"^_",caughtErrors:"none",ignoreRestSiblings:!0,vars:"all",varsIgnorePattern:"^_"}],"@typescript-eslint/no-useless-constructor":"error","@typescript-eslint/prefer-nullish-coalescing":["error",{ignoreConditionalTests:!0,ignoreMixedLogicalExpressions:!0,ignoreIfStatements:!0}],"@typescript-eslint/promise-function-async":"off","@typescript-eslint/restrict-template-expressions":"off","@typescript-eslint/return-await":["error","in-try-catch"],"comma-dangle":"off","import/no-duplicates":"error","import/order":"error","max-params":"off","no-console":["error",{allow:["error","debug"]}],"no-constant-condition":["error",{checkLoops:!1}],"no-unused-vars":"off","@typescript-eslint/no-unused-expressions":["error",{allowShortCircuit:!0,allowTernary:!0,allowTaggedTemplates:!0}],"lingui/no-expression-in-message":"off","prefer-const":"error","spaced-comment":["error","always",{markers:["/"]}],"lingui/t-call-in-function":2,"lingui/no-single-variables-to-translate":2,"lingui/no-single-tag-to-translate":2,"lingui/no-trans-inside-trans":2}},{files:["**/*.spec.ts","**/*.spec.tsx"],rules:{"@typescript-eslint/dot-notation":"off","@typescript-eslint/no-floating-promises":"off"}}];export const eslintrc=[...a];export const eslintrcReactWithStoryBook=[...a,...n.configs["flat/recommended"]];export const devLinguiEslintrcRules=[{files:["**/*.tsx"],ignores:["**/*.stories.tsx"],rules:{"lingui/no-unlocalized-strings":["error",{ignoreAttribute:["style","sx","onClick"],ignoreFunction:["styled","useMediaQuery","Error","sendMessage","useThemeProps","matchMedia","msg"],ignoreProperty:["gridTemplate","miscellaneousSlot","slot","reactiveMotionDiv","container","styled","useMediaQuery","Error","sendMessage","msg","i18n.load"]}]}}];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as r}from"node:module";let t=r(import.meta.url);export const prettierrc={arrowParens:"avoid",importOrder:["^@salsita-ai/(.*)$","^#package/(.*)$","^[./]"],importOrderSeparation:!0,importOrderSortSpecifiers:!0,plugins:[t.resolve("@trivago/prettier-plugin-sort-imports")],printWidth:120,semi:!1,singleQuote:!0,tabWidth:2,trailingComma:"es5",useTabs:!1};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class AssertionError extends Error {
|
|
2
|
+
}
|
|
3
|
+
/**
|
|
4
|
+
* Utility for typechecking of always defined value. Throws error if this condition is not met.
|
|
5
|
+
* Use this in situations where you always know the value is defined, but TSC can not tell that.
|
|
6
|
+
* Use with caution, in most cases you can solve the issue with union types.
|
|
7
|
+
*/
|
|
8
|
+
export declare const assertExistence: <Value>(value: Value | undefined | null, message?: string) => Value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class AssertionError extends Error{}export const assertExistence=(r,e="Assertion failed, value is undefined or null")=>{if(null==r)throw new AssertionError(e);return r};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Using class prevents spreads, it enforces consistent usage of the type factory.
|
|
3
|
+
*/
|
|
4
|
+
export declare class Brand<T extends string> {
|
|
5
|
+
private readonly __brand;
|
|
6
|
+
}
|
|
7
|
+
export type Branded<K extends string, T> = Readonly<T> & Brand<K>;
|
|
8
|
+
export type WithBrand<T> = T & Brand<never>;
|
|
9
|
+
/**
|
|
10
|
+
* Utility for nominal typing. Use this to define domain types to fulfill invariants
|
|
11
|
+
* and prevent accidental mixing of types.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Branded<T>(value: T): WithBrand<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class Brand{__brand}export function Branded(r){return r}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic JSON serializer with sorted object keys at every level.
|
|
3
|
+
*
|
|
4
|
+
* `JSON.stringify` follows insertion order, so the same data could serialize differently after
|
|
5
|
+
* object spread, `Object.assign`, or a differently ordered YAML source. Sorting keys makes the
|
|
6
|
+
* output, and any hash derived from it, depend only on the data itself.
|
|
7
|
+
*
|
|
8
|
+
* Intended for JSON-like values: primitives, arrays, and plain objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare const canonicalStringify: (value: unknown) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const canonicalStringify=i=>null==i||"boolean"==typeof i||"number"==typeof i||"string"==typeof i?JSON.stringify(i):Array.isArray(i)?"["+i.map(canonicalStringify).join(",")+"]":"object"!=typeof i||null===i||Array.isArray(i)?JSON.stringify(i):"{"+Object.keys(i).sort().map(n=>JSON.stringify(n)+":"+canonicalStringify(i[n])).join(",")+"}";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type RalColor = `ral-${number}`;
|
|
2
|
+
export type HexColor = `#${string}`;
|
|
3
|
+
export type SimpleColor = 'white' | 'black' | 'red' | 'green' | 'blue' | 'yellow' | 'cyan' | 'magenta';
|
|
4
|
+
export type Color = RalColor | HexColor | SimpleColor;
|
|
5
|
+
export declare const isHexColor: (value: string) => value is HexColor;
|
|
6
|
+
export declare const isRalColor: (value: string) => value is RalColor;
|
|
7
|
+
export declare const isColor: (value: string) => value is Color;
|
|
8
|
+
export declare const isSimpleColor: (value: string) => value is SimpleColor;
|
|
9
|
+
export declare const simpleColorToHex: (color: SimpleColor) => "#000000" | "#0000ff" | "#00ff00" | "#00ffff" | "#ff0000" | "#ff00ff" | "#ffff00" | "#ffffff";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=/^#[0-9a-fA-F]{6}$/;export const isHexColor=f=>e.test(f);let f=/^ral-[0-9]+$/;export const isRalColor=e=>f.test(e);export const isColor=o=>e.test(o)||f.test(o)||isSimpleColor(o);export const isSimpleColor=e=>["white","black","red","green","blue","yellow","cyan","magenta"].includes(e);let o={white:"#ffffff",black:"#000000",red:"#ff0000",green:"#00ff00",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff"};export const simpleColorToHex=e=>o[e];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type MapConstructors<K extends any[]> = {
|
|
2
|
+
[INDEX in keyof K]: new () => MapLike<K[INDEX], unknown>;
|
|
3
|
+
};
|
|
4
|
+
interface MapLike<K, V> {
|
|
5
|
+
get(key: K): V | undefined;
|
|
6
|
+
has(key: K): boolean;
|
|
7
|
+
set(key: K, value: V): this;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Map-like structure that allows using composite keys.
|
|
11
|
+
*
|
|
12
|
+
* Under the hood, it uses a nested map structure - one level for each key in the composite key.
|
|
13
|
+
* Any of the levels can be represented by either a `WeakMap` or a `Map`. This makes
|
|
14
|
+
* it very useful for various caches with composite keys.
|
|
15
|
+
*
|
|
16
|
+
* **Example:**
|
|
17
|
+
* ```ts
|
|
18
|
+
* // define types of the keys and the underlying implementation for each level
|
|
19
|
+
* const map = new CompositeKeyMap<MyObject, string, MyOtherObject>([WeakMap, Map, WeakMap])
|
|
20
|
+
*
|
|
21
|
+
* // set a value
|
|
22
|
+
* map.set([myObject, 'abc', myOtherObject], 'value')
|
|
23
|
+
*
|
|
24
|
+
* // get a value
|
|
25
|
+
* const value = map.get([myObject, 'abc', myOtherObject])
|
|
26
|
+
*
|
|
27
|
+
* // check if a value exists
|
|
28
|
+
* const hasValue = map.has([myObject, 'abc', myOtherObject])
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Deletion is currently not supported, but can be implemented relatively easily.
|
|
32
|
+
*/
|
|
33
|
+
export declare class CompositeKeyMap<K extends any[], V> {
|
|
34
|
+
private readonly mapConstructors;
|
|
35
|
+
private readonly map;
|
|
36
|
+
constructor(mapConstructors: MapConstructors<K>);
|
|
37
|
+
private getLeafMap;
|
|
38
|
+
get(keys: K): V | undefined;
|
|
39
|
+
has(keys: K): boolean;
|
|
40
|
+
set(keys: K, value: V): this;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class CompositeKeyMap{mapConstructors;map;constructor(t){this.mapConstructors=t;let e=t[0];this.map=new e}getLeafMap(t){return t.slice(0,-1).reduce((t,e)=>{if(void 0!==t)return t.get(e)},this.map)}get(t){let e=this.getLeafMap(t);return e?.get(t[t.length-1])}has(t){let e=this.getLeafMap(t);return e?.has(t[t.length-1])??!1}set(t,e){return t.slice(0,-1).reduce((t,e,s)=>{let r=t.get(e);if(void 0===r)r=new this.mapConstructors[s+1],t.set(e,r);else if(!(r instanceof WeakMap)&&!(r instanceof Map))throw Error(`Key ${e} is not a WeakMap or Map`);return r},this.map).set(t[t.length-1],e),this}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type LogLevel, type Logger } from './logger.js';
|
|
2
|
+
/** Options controlling the console logger's initial filtering behavior. */
|
|
3
|
+
export interface ConsoleLoggerOptions {
|
|
4
|
+
readonly level?: LogLevel;
|
|
5
|
+
}
|
|
6
|
+
export declare const initConsoleLogger: (options?: ConsoleLoggerOptions) => Logger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isLogLevelEnabled as o}from"./logger.js";let e=(o,e,r)=>r?[o,e,r]:e?[o,e]:[o];export const initConsoleLogger=(r={})=>{let n=r.level??"info";return{info:(r,l,g)=>{o("info",n)&&console.log(...e(r,l,g))},error:(r,l,g)=>{o("error",n)&&console.error(...e(r,l,g))},warn:(r,l,g)=>{o("warn",n)&&console.warn(...e(r,l,g))},debug:(r,l,g)=>{o("debug",n)&&console.debug(...e(r,l,g))},verbose:(r,l,g)=>{o("debug",n)&&console.debug(...e(r,l,g))},appendToGlobalContext:()=>{}}};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Logger } from './logger.js';
|
|
2
|
+
/**
|
|
3
|
+
* A function that takes a state and returns data derived from that state.
|
|
4
|
+
*
|
|
5
|
+
* Selectors are pure functions of the state and are composable — a selector can be used
|
|
6
|
+
* as an input of another selector created with `createSelector`, forming an explicit
|
|
7
|
+
* dependency graph where each node only recomputes when its own inputs change.
|
|
8
|
+
*/
|
|
9
|
+
declare const SELECTOR: unique symbol;
|
|
10
|
+
export type Selector<STATE = any, RESULT = unknown> = ((state: STATE, ctx?: SelectorContext) => RESULT) & {
|
|
11
|
+
readonly [SELECTOR]: true;
|
|
12
|
+
};
|
|
13
|
+
export interface SelectorContext {
|
|
14
|
+
readonly logger: Logger;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* An array of input selectors.
|
|
18
|
+
*/
|
|
19
|
+
export type SelectorArray<STATE = any> = readonly Selector<STATE>[];
|
|
20
|
+
/**
|
|
21
|
+
* The callable shape of `createSelector`, mirroring reselect's `CreateSelectorFunction`
|
|
22
|
+
* (array-form signature only). `STATE` is `any` for the default instance and pinned by
|
|
23
|
+
* {@link CreateSelectorFunction.withTypes} — prefer the pinned form, it is what types the
|
|
24
|
+
* state parameter of selectors created by {@link CreateSelectorFunction.leaf}.
|
|
25
|
+
*/
|
|
26
|
+
export interface CreateSelectorFunction<STATE = any> {
|
|
27
|
+
/**
|
|
28
|
+
* Creates a memoized selector from a tuple of input selectors and a `combine` function.
|
|
29
|
+
*
|
|
30
|
+
* The inputs are typed as a reverse mapped tuple over the `combine` arguments — TS
|
|
31
|
+
* infers `ARGS` from whichever side is concrete first: a named `combine` function's
|
|
32
|
+
* parameters, or the input selectors' return types. This sidesteps the inference-order
|
|
33
|
+
* trap where a named combiner processed before the context-sensitive input lambdas
|
|
34
|
+
* fixes the input tuple to its constraint.
|
|
35
|
+
*
|
|
36
|
+
* @param inputs the input selectors; their results become the `combine` arguments
|
|
37
|
+
* @param combine computes the result from the input results
|
|
38
|
+
*/
|
|
39
|
+
<ARGS extends readonly unknown[], RESULT>(inputs: {
|
|
40
|
+
readonly [INDEX in keyof ARGS]: Selector<STATE, ARGS[INDEX]>;
|
|
41
|
+
}, combine: (...args: ARGS) => RESULT): Selector<STATE, RESULT>;
|
|
42
|
+
/**
|
|
43
|
+
* Brands a pure state read so it can be composed as a selector input.
|
|
44
|
+
*/
|
|
45
|
+
leaf<RESULT>(read: (state: STATE) => RESULT): Selector<STATE, RESULT>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a "pre-typed" version of {@link createSelector} with the state type
|
|
48
|
+
* predefined — input selectors then get their state parameter contextually typed, so
|
|
49
|
+
* `state => state.field` needs no annotation. Same as reselect's
|
|
50
|
+
* `createSelector.withTypes<RootState>()`.
|
|
51
|
+
*
|
|
52
|
+
* *Usage example:*
|
|
53
|
+
* ```ts
|
|
54
|
+
* const createAppSelector = createSelector.withTypes<AppState>()
|
|
55
|
+
*
|
|
56
|
+
* const selectVisibleTodos = createAppSelector(
|
|
57
|
+
* [createAppSelector.leaf(state => state.todos), createAppSelector.leaf(state => state.filter)],
|
|
58
|
+
* (todos, filter) => todos.filter(todo => matches(todo, filter))
|
|
59
|
+
* )
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
withTypes<OVERRIDE_STATE extends STATE>(): CreateSelectorFunction<OVERRIDE_STATE>;
|
|
63
|
+
}
|
|
64
|
+
export declare const createSelector: CreateSelectorFunction;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEqualArray as e}from"./is-equal-array.js";export const createSelector=Object.assign((r,t)=>{let l=null;return s=>{if(l&&l.state===s)return l.result;let a=r.map(e=>e(s));if(l&&e(l.args,a))return(l={state:s,args:a,result:l.result}).result;let u=t(...a);return l={state:s,args:a,result:u},u}},{leaf:e=>e,withTypes:()=>createSelector});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Empty = Record<string, unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
2
|
+
export type ExtendedJsonSchema = JSONSchema7 & {
|
|
3
|
+
/**
|
|
4
|
+
* TypeScript type to be used in generated code instead of a type inferred from the schema.
|
|
5
|
+
*/
|
|
6
|
+
tsType?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Modules to import for the `tsType` to be a valid type expression.
|
|
9
|
+
*/
|
|
10
|
+
import?: Array<{
|
|
11
|
+
module: string;
|
|
12
|
+
member: string;
|
|
13
|
+
doNotImportInto?: string[];
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export { isArray } from './is-array.js';
|
|
2
|
+
export { isNonNullish } from './is-non-nullish.js';
|
|
3
|
+
export { isShallowEqual } from './is-shallow-equal.js';
|
|
4
|
+
export { isEqualArray } from './is-equal-array.js';
|
|
5
|
+
export { isEqualNullish } from './is-equal-nullish.js';
|
|
6
|
+
export { canonicalStringify } from './canonical-stringify.js';
|
|
7
|
+
export type { OmitNever, OmitEmpty } from './omit.js';
|
|
8
|
+
export { getStickyCache, createCacheToken, type StickyCache, type CacheToken } from './sticky-cache.js';
|
|
9
|
+
export { type UnionToIntersection } from './union-to-intersection.js';
|
|
10
|
+
export { type Color, type HexColor, type RalColor, isColor, isSimpleColor, isHexColor, isRalColor, simpleColorToHex, } from './colors.js';
|
|
11
|
+
export { type ValueOf } from './value-of.js';
|
|
12
|
+
export { Brand, Branded, type WithBrand } from './branded-types.js';
|
|
13
|
+
export { type Empty } from './empty.js';
|
|
14
|
+
export { assertExistence, AssertionError } from './assert-existence.js';
|
|
15
|
+
export { usingType, usingNullishType, usingOptionalType } from './zod-types.js';
|
|
16
|
+
export { type Logger, type LogLevel, isLogLevelEnabled } from './logger.js';
|
|
17
|
+
export { initConsoleLogger, type ConsoleLoggerOptions } from './console-logger.js';
|
|
18
|
+
export { isNonEmptyString } from './is-non-empty-string.js';
|
|
19
|
+
export type { WithOptional } from './with-optional.js';
|
|
20
|
+
export type { WithRequired } from './with-required.js';
|
|
21
|
+
export { type Localizable, isMessageDescriptor, isMultilingualString, resolveLocalizable, type MultilingualString, MessageDescriptorSchema, EnhancedMessageDescriptorSchema, MultilingualStringSchema, LocalizableSchema, EnhancedLocalizableSchema, } from './localizable.js';
|
|
22
|
+
export { type DeepPartial } from './deep-partial.js';
|
|
23
|
+
export { InfoError } from './info-error.js';
|
|
24
|
+
export { CompositeKeyMap } from './composite-key-map.js';
|
|
25
|
+
export { memoOnce } from './memo-once.js';
|
|
26
|
+
export { type ObservableWithLastValue, toObservableWithLastValue } from './observable-with-last-value.js';
|
|
27
|
+
export { type ObjectWithKey, ObjectWithKeySchema } from './object-with-key.js';
|
|
28
|
+
export { type ExtendedJsonSchema } from './extended-json-schema.js';
|
|
29
|
+
export { tryOrDefault } from './try-or-default.js';
|
|
30
|
+
export * from './create-selector.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{isArray}from"./is-array.js";export{isNonNullish}from"./is-non-nullish.js";export{isShallowEqual}from"./is-shallow-equal.js";export{isEqualArray}from"./is-equal-array.js";export{isEqualNullish}from"./is-equal-nullish.js";export{canonicalStringify}from"./canonical-stringify.js";export{getStickyCache,createCacheToken}from"./sticky-cache.js";export{isColor,isSimpleColor,isHexColor,isRalColor,simpleColorToHex}from"./colors.js";export{Brand,Branded}from"./branded-types.js";export{assertExistence,AssertionError}from"./assert-existence.js";export{usingType,usingNullishType,usingOptionalType}from"./zod-types.js";export{isLogLevelEnabled}from"./logger.js";export{initConsoleLogger}from"./console-logger.js";export{isNonEmptyString}from"./is-non-empty-string.js";export{isMessageDescriptor,isMultilingualString,resolveLocalizable,MessageDescriptorSchema,EnhancedMessageDescriptorSchema,MultilingualStringSchema,LocalizableSchema,EnhancedLocalizableSchema}from"./localizable.js";export{InfoError}from"./info-error.js";export{CompositeKeyMap}from"./composite-key-map.js";export{memoOnce}from"./memo-once.js";export{toObservableWithLastValue}from"./observable-with-last-value.js";export{ObjectWithKeySchema}from"./object-with-key.js";export{tryOrDefault}from"./try-or-default.js";export*from"./create-selector.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InfoError should serve as an Error class replacement
|
|
3
|
+
* for cases when you want to throw an error,
|
|
4
|
+
* but you don't want to report it as an actual aplication error.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InfoError extends Error {
|
|
7
|
+
static name: string;
|
|
8
|
+
name: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class InfoError extends Error{static name="InfoError";name="InfoError"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A variant of `Array.isArray` which also works on readonly arrays.
|
|
3
|
+
*/
|
|
4
|
+
export declare function isArray<T>(arg: readonly T[] | any): arg is readonly any[];
|
|
5
|
+
/**
|
|
6
|
+
* A variant of `Array.isArray` which also works on readonly arrays.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isArray<T>(arg: T[] | any): arg is any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isArray(r){return Array.isArray(r)}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if two arrays are equal - i.e. same length and same elements in the same order.
|
|
3
|
+
*
|
|
4
|
+
* Provide a custom `isEqualElement` function to compare individual elements, defaults to `Object.is`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isEqualArray<T>(arrayA: T[] | readonly T[], arrayB: T[] | readonly T[], isEqualElement?: (a: T, b: T) => boolean): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isEqualArray(e,r,t=Object.is){return e===r||!!e&&!!r&&e.length===r.length&&e.every((e,n)=>t(e,r[n]))}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A convenience helper that allows to compare two values for equality, even if they are `null` or `undefined`.
|
|
3
|
+
*
|
|
4
|
+
* The provided `isEqualNonNullish` function is guaranteed to receive two non-nullish values.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isEqualNullish: <T>(a: T, b: T, isEqualNonNullish: (a: NonNullable<T>, b: NonNullable<T>) => boolean) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isEqualNullish=(l,u,n)=>l===u||null!=l&&null!=u&&n(l,u);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isNonEmptyString(t){return"string"==typeof t&&t.length>0}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function isNonNullish(n){return null!=n}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if two objects are **SHALLOW** equal - i.e. same keys and same values.
|
|
3
|
+
*
|
|
4
|
+
* Provide a custom `isEqualMember` function to compare individual members, defaults to `Object.is`.
|
|
5
|
+
*
|
|
6
|
+
* If the provided objects are arrays, the `isEqualArray` function is used to compare them.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isShallowEqual<T>(objectA: T, objectB: T, isEqualMember?: (a: T[keyof T], b: T[keyof T]) => boolean): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEqualArray as r}from"./is-equal-array.js";export function isShallowEqual(i,t,e=Object.is){if(Object.is(i,t))return!0;if(Array.isArray(i))return Array.isArray(t)&&r(i,t,e);if(null===i||null===t||"object"!=typeof i||"object"!=typeof t)return!1;for(let r in i)if(!(r in t)||!e(i[r],t[r]))return!1;for(let r in t)if(!(r in i)||!e(i[r],t[r]))return!1;return!0}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { I18n, MessageDescriptor } from '@lingui/core';
|
|
2
|
+
export type MultilingualString = {
|
|
3
|
+
$lang: Record<string, string>;
|
|
4
|
+
};
|
|
5
|
+
export declare const MessageDescriptorSchema: {
|
|
6
|
+
readonly type: 'object';
|
|
7
|
+
readonly properties: {
|
|
8
|
+
readonly id: {
|
|
9
|
+
readonly type: 'string';
|
|
10
|
+
};
|
|
11
|
+
readonly comment: {
|
|
12
|
+
readonly type: 'string';
|
|
13
|
+
};
|
|
14
|
+
readonly message: {
|
|
15
|
+
readonly type: 'string';
|
|
16
|
+
};
|
|
17
|
+
readonly values: {
|
|
18
|
+
readonly type: 'object';
|
|
19
|
+
readonly additionalProperties: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
readonly required: ["id"];
|
|
23
|
+
readonly additionalProperties: false;
|
|
24
|
+
readonly import: [{
|
|
25
|
+
readonly module: '@lingui/core';
|
|
26
|
+
readonly member: 'MessageDescriptor';
|
|
27
|
+
}];
|
|
28
|
+
readonly tsType: 'MessageDescriptor';
|
|
29
|
+
};
|
|
30
|
+
export declare const EnhancedMessageDescriptorSchema: {
|
|
31
|
+
readonly type: 'object';
|
|
32
|
+
readonly properties: {
|
|
33
|
+
readonly $msg: {
|
|
34
|
+
readonly type: 'string';
|
|
35
|
+
};
|
|
36
|
+
readonly $msgId: {
|
|
37
|
+
readonly type: 'string';
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly required: ["$msg"];
|
|
41
|
+
readonly additionalProperties: false;
|
|
42
|
+
readonly import: [{
|
|
43
|
+
readonly module: '@lingui/core';
|
|
44
|
+
readonly member: 'MessageDescriptor';
|
|
45
|
+
}];
|
|
46
|
+
readonly tsType: 'EnhancedMessageDescriptor';
|
|
47
|
+
};
|
|
48
|
+
export type Localizable = string | MessageDescriptor | MultilingualString;
|
|
49
|
+
export declare const isMessageDescriptor: <T>(message: T | MessageDescriptor) => message is MessageDescriptor;
|
|
50
|
+
export declare const isMultilingualString: <T>(message: T | MultilingualString) => message is MultilingualString;
|
|
51
|
+
export declare function resolveLocalizable(message: MessageDescriptor | MultilingualString, i18n: I18n, textLanguages?: readonly string[]): string;
|
|
52
|
+
export declare function resolveLocalizable<T>(message: T | MessageDescriptor | MultilingualString, i18n: I18n, textLanguages?: readonly string[]): string | T;
|
|
53
|
+
export declare const MultilingualStringSchema: {
|
|
54
|
+
readonly import: [{
|
|
55
|
+
readonly module: '@salsita-ai/sdk/common/utils';
|
|
56
|
+
readonly member: 'MultilingualString';
|
|
57
|
+
}];
|
|
58
|
+
readonly tsType: 'MultilingualString';
|
|
59
|
+
readonly type: 'object';
|
|
60
|
+
readonly properties: {
|
|
61
|
+
readonly $lang: {
|
|
62
|
+
readonly type: 'object';
|
|
63
|
+
readonly additionalProperties: {
|
|
64
|
+
readonly type: 'string';
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly required: ["$lang"];
|
|
69
|
+
readonly additionalProperties: false;
|
|
70
|
+
};
|
|
71
|
+
export declare const LocalizableSchema: {
|
|
72
|
+
readonly anyOf: [{
|
|
73
|
+
readonly type: 'string';
|
|
74
|
+
}, {
|
|
75
|
+
readonly $ref: '#/definitions/MessageDescriptor';
|
|
76
|
+
}, {
|
|
77
|
+
readonly $ref: '#/definitions/MultilingualString';
|
|
78
|
+
}];
|
|
79
|
+
readonly import: [{
|
|
80
|
+
readonly module: '@salsita-ai/sdk/common/utils';
|
|
81
|
+
readonly member: 'Localizable';
|
|
82
|
+
}];
|
|
83
|
+
readonly tsType: 'Localizable';
|
|
84
|
+
};
|
|
85
|
+
export declare const EnhancedLocalizableSchema: {
|
|
86
|
+
readonly anyOf: [{
|
|
87
|
+
readonly type: 'string';
|
|
88
|
+
}, {
|
|
89
|
+
readonly $ref: '#/definitions/EnhancedMessageDescriptor';
|
|
90
|
+
}, {
|
|
91
|
+
readonly $ref: '#/definitions/MultilingualString';
|
|
92
|
+
}];
|
|
93
|
+
readonly import: [{
|
|
94
|
+
readonly module: '@salsita-ai/sdk/common/utils';
|
|
95
|
+
readonly member: 'EnhancedLocalizable';
|
|
96
|
+
}];
|
|
97
|
+
readonly tsType: 'EnhancedLocalizable';
|
|
98
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MessageDescriptorSchema={type:"object",properties:{id:{type:"string"},comment:{type:"string"},message:{type:"string"},values:{type:"object",additionalProperties:!0}},required:["id"],additionalProperties:!1,import:[{module:"@lingui/core",member:"MessageDescriptor"}],tsType:"MessageDescriptor"};export const EnhancedMessageDescriptorSchema={type:"object",properties:{$msg:{type:"string"},$msgId:{type:"string"}},required:["$msg"],additionalProperties:!1,import:[{module:"@lingui/core",member:"MessageDescriptor"}],tsType:"EnhancedMessageDescriptor"};export const isMessageDescriptor=e=>"object"==typeof e&&null!==e&&"id"in e;export const isMultilingualString=e=>"object"==typeof e&&null!==e&&"$lang"in e;export function resolveLocalizable(e,i,t){if(isMessageDescriptor(e))return i._(e);if(isMultilingualString(e)){for(let r of[i.locale,...t??[],"en"]){let i=e.$lang[r];if(void 0!==i)return i}return""}return e}export const MultilingualStringSchema={import:[{module:"@salsita-ai/sdk/common/utils",member:"MultilingualString"}],tsType:"MultilingualString",type:"object",properties:{$lang:{type:"object",additionalProperties:{type:"string"}}},required:["$lang"],additionalProperties:!1};export const LocalizableSchema={anyOf:[{type:"string"},{$ref:"#/definitions/MessageDescriptor"},{$ref:"#/definitions/MultilingualString"}],import:[{module:"@salsita-ai/sdk/common/utils",member:"Localizable"}],tsType:"Localizable"};export const EnhancedLocalizableSchema={anyOf:[{type:"string"},{$ref:"#/definitions/EnhancedMessageDescriptor"},{$ref:"#/definitions/MultilingualString"}],import:[{module:"@salsita-ai/sdk/common/utils",member:"EnhancedLocalizable"}],tsType:"EnhancedLocalizable"};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Minimum severity emitted by Phoenix loggers. Debug also enables verbose messages. */
|
|
2
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
3
|
+
export interface Logger {
|
|
4
|
+
info: (message: string, context?: object, error?: Error) => void;
|
|
5
|
+
error: (message: string, context?: object, error?: Error) => void;
|
|
6
|
+
warn: (message: string, context?: object, error?: Error) => void;
|
|
7
|
+
debug: (message: string, context?: object, error?: Error) => void;
|
|
8
|
+
verbose: (message: string, context?: object, error?: Error) => void;
|
|
9
|
+
appendToGlobalContext: (context: object) => void;
|
|
10
|
+
}
|
|
11
|
+
/** Returns whether a message passes the configured minimum severity. */
|
|
12
|
+
export declare const isLogLevelEnabled: (messageLevel: LogLevel, configuredLevel: LogLevel) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e={debug:0,info:1,warn:2,error:3};export const isLogLevelEnabled=(o,r)=>e[o]>=e[r];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const memoOnce: <T>(factory: () => T) => () => T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=Symbol("empty");export const memoOnce=t=>{let m=e;return()=>(m===e&&(m=t()),m)};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ObjectWithKey {
|
|
2
|
+
key: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const ObjectWithKeySchema: {
|
|
5
|
+
readonly type: 'object';
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly key: {
|
|
8
|
+
readonly type: 'string';
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
readonly required: ["key"];
|
|
12
|
+
readonly import: [{
|
|
13
|
+
readonly module: '@salsita-ai/sdk/common/utils';
|
|
14
|
+
readonly member: 'ObjectWithKey';
|
|
15
|
+
}];
|
|
16
|
+
readonly tsType: 'ObjectWithKey';
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ObjectWithKeySchema={type:"object",properties:{key:{type:"string"}},required:["key"],import:[{module:"@salsita-ai/sdk/common/utils",member:"ObjectWithKey"}],tsType:"ObjectWithKey"};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Observable } from 'rxjs';
|
|
2
|
+
export interface ObservableWithLastValue<T> extends Observable<T> {
|
|
3
|
+
readonly value: T;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Creates an observable that has a last value property, initially set to the provided value.
|
|
7
|
+
* Once the observable emits a value, the last value will be updated to the latest emitted value.
|
|
8
|
+
*/
|
|
9
|
+
export declare const toObservableWithLastValue: <T, I>(observable: Observable<T>, initialValue: I) => ObservableWithLastValue<T | I>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{BehaviorSubject as e,share as t}from"rxjs";export const toObservableWithLastValue=(r,o)=>{let n=new e(o),a=t({connector:()=>n,resetOnRefCountZero:!0})(r);return Object.defineProperty(a,"value",{get:()=>n.value}),a};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Omit properties with `never` type from T
|
|
3
|
+
*/
|
|
4
|
+
export type OmitNever<T> = Pick<T, {
|
|
5
|
+
[K in keyof T]: T[K] extends never ? never : K;
|
|
6
|
+
}[keyof T]>;
|
|
7
|
+
/**
|
|
8
|
+
* Omit properties with empty objects as values from T
|
|
9
|
+
*/
|
|
10
|
+
export type OmitEmpty<T> = Pick<T, {
|
|
11
|
+
[K in keyof T]: Record<never, never> extends T[K] ? never : K;
|
|
12
|
+
}[keyof T]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A unique token that can be used to retrieve a sticky cache from a context object.
|
|
3
|
+
* The token carries type information about the cache's key and value types.
|
|
4
|
+
*/
|
|
5
|
+
export interface CacheToken<K, V> {
|
|
6
|
+
_k: K & never;
|
|
7
|
+
_v: V & never;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new cache token to be used with `getStickyCache`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createCacheToken: <K, V>() => CacheToken<K, V>;
|
|
13
|
+
/**
|
|
14
|
+
* A cache that is sticky to a specific context object. It is useful for caching
|
|
15
|
+
* values on arbitrary objects, without these exposing the cache to the outside world
|
|
16
|
+
* or being aware of the cache's existence at all.
|
|
17
|
+
*/
|
|
18
|
+
export interface StickyCache<K, V> {
|
|
19
|
+
get(key: K): V | undefined;
|
|
20
|
+
put(key: K, value: V): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a cache defined by the given token which is sticky to the given context object.
|
|
24
|
+
* If the cache does not exist yet, an empty one is created.
|
|
25
|
+
*
|
|
26
|
+
* @param context arbitrary object to which the cache is sticky
|
|
27
|
+
* @param token a token that uniquely identifies the cache, previously created with `createCacheToken`
|
|
28
|
+
*/
|
|
29
|
+
export declare const getStickyCache: <K, V>(context: object, token: CacheToken<K, V>) => StickyCache<K, V>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const createCacheToken=()=>({});let e=new WeakMap;export const getStickyCache=(t,a)=>{let n=e.get(t);n||(n=new WeakMap,e.set(t,n));let c=n.get(a);if(!c){let e;e=new Map,c={get:t=>e.get(t),put:(t,a)=>e.set(t,a)},n.set(a,c)}return c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tryOrDefault: <T>(fn: () => T, defaultValue: T) => T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const tryOrDefault=(r,t)=>{try{return r()}catch{return t}};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a union type to an intersection type.
|
|
3
|
+
*
|
|
4
|
+
* Useful for merging arbitrary number of object types:
|
|
5
|
+
* ```ts
|
|
6
|
+
* type MergeObjects<T extends object[]> = UnionToIntersection<T[number]>
|
|
7
|
+
*
|
|
8
|
+
* const array = [{a: 1}, {b: 2}, {c: 3}] as const
|
|
9
|
+
* type Merged = MergeObjects<typeof array> // {a: 1, b: 2, c: 3}
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ValueOf<T> = T[keyof T];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type RefinementCtx } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Utility function to run zod validation on custom type factor, use effectType: 'input' in openapi metadata
|
|
4
|
+
* to use the input type as a type to generate the openapi schema.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usingType<T, V>(typeFactory: (arg: V) => T): (arg: V, ctx: RefinementCtx) => T;
|
|
7
|
+
/**
|
|
8
|
+
* Utility function to run zod validation on custom type factor, use effectType: 'input' in openapi metadata
|
|
9
|
+
* to use the input type as a type to generate the openapi schema.
|
|
10
|
+
* It allows the input to be undefined.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usingOptionalType<T, V>(typeFactory: (arg: V) => T): (arg: V | undefined, ctx: RefinementCtx) => T | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Utility function to run zod validation on custom type factor, use effectType: 'input' in openapi metadata
|
|
15
|
+
* to use the input type as a type to generate the openapi schema.
|
|
16
|
+
* It allows the input to be undefined.
|
|
17
|
+
*/
|
|
18
|
+
export declare function usingNullishType<T, V>(typeFactory: (arg: V) => T): (arg: V | undefined | null, ctx: RefinementCtx) => T | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";export function usingType(s){return(r,o)=>{try{return s(r)}catch(s){return s instanceof Error?o.addIssue({code:e.ZodIssueCode.custom,message:s.message}):o.addIssue({code:e.ZodIssueCode.custom,message:"An unknown error occurred."}),e.NEVER}}}export function usingOptionalType(s){return(r,o)=>{if(void 0!==r)try{return s(r)}catch(s){return s instanceof Error?o.addIssue({code:e.ZodIssueCode.custom,message:s.message}):o.addIssue({code:e.ZodIssueCode.custom,message:"An unknown error occurred."}),e.NEVER}}}export function usingNullishType(s){return(r,o)=>{if(void 0!==r){if(null===r)return null;try{return s(r)}catch(s){return s instanceof Error?o.addIssue({code:e.ZodIssueCode.custom,message:s.message}):o.addIssue({code:e.ZodIssueCode.custom,message:"An unknown error occurred."}),e.NEVER}}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,98 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salsita-ai/common",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.49.0-develop.d4bea2382c",
|
|
4
|
+
"description": "Shared Phoenix utilities, environment loading, and lint and formatting configuration.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"salsita",
|
|
7
|
+
"3d",
|
|
8
|
+
"configurator",
|
|
9
|
+
"phoenix"
|
|
10
|
+
],
|
|
11
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
"./utils": {
|
|
18
|
+
"import": "./dist/utils/index.js",
|
|
19
|
+
"types": "./dist/utils/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./eslint": {
|
|
22
|
+
"import": "./dist/eslint/index.js",
|
|
23
|
+
"types": "./dist/eslint/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./prettier": {
|
|
26
|
+
"import": "./dist/prettier/index.js",
|
|
27
|
+
"types": "./dist/prettier/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./env": {
|
|
30
|
+
"import": "./dist/env/index.js",
|
|
31
|
+
"types": "./dist/env/index.d.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"CHANGELOG.md"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@babel/core": "7.29.7",
|
|
40
|
+
"@babel/plugin-syntax-flow": "7.23.3",
|
|
41
|
+
"@babel/plugin-transform-react-jsx": "7.23.4",
|
|
42
|
+
"@eslint/js": "9.39.4",
|
|
43
|
+
"@trivago/prettier-plugin-sort-imports": "4.3.0",
|
|
44
|
+
"@types/json-schema": "7.0.15",
|
|
45
|
+
"dotenv": "17.4.2",
|
|
46
|
+
"dotenv-expand": "10.0.0",
|
|
47
|
+
"eslint-config-prettier": "10.1.8",
|
|
48
|
+
"eslint-plugin-import": "2.32.0",
|
|
49
|
+
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
50
|
+
"eslint-plugin-lingui": "0.13.1",
|
|
51
|
+
"eslint-plugin-lodash": "8.0.0",
|
|
52
|
+
"eslint-plugin-n": "18.0.1",
|
|
53
|
+
"eslint-plugin-promise": "7.3.0",
|
|
54
|
+
"eslint-plugin-react": "7.37.5",
|
|
55
|
+
"eslint-plugin-react-hooks": "6.0.0",
|
|
56
|
+
"eslint-plugin-storybook": "10.4.1",
|
|
57
|
+
"eslint-plugin-unused-imports": "4.4.1",
|
|
58
|
+
"find-up": "7.0.0",
|
|
59
|
+
"globals": "17.6.0",
|
|
60
|
+
"lodash-es": "4.18.1",
|
|
61
|
+
"typescript-eslint": "8.60.0",
|
|
62
|
+
"zod": "3.25.76"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@lingui/core": "5.9.5",
|
|
66
|
+
"@swc/cli": "0.8.1",
|
|
67
|
+
"@swc/core": "1.15.40",
|
|
68
|
+
"@types/babel__core": "7",
|
|
69
|
+
"@types/eslint": "9.6.1",
|
|
70
|
+
"@types/lodash-es": "4.17.12",
|
|
71
|
+
"@types/prettier": "2.7.1",
|
|
72
|
+
"envalid": "8.1.1",
|
|
73
|
+
"eslint": "9.39.4",
|
|
74
|
+
"prettier": "3.8.3",
|
|
75
|
+
"rxjs": "7.8.2",
|
|
76
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
77
|
+
"vitest": "4.1.11",
|
|
78
|
+
"@salsita-ai/common": "0.49.0-develop.d4bea2382c"
|
|
79
|
+
},
|
|
80
|
+
"peerDependencies": {
|
|
81
|
+
"envalid": "8.1.1",
|
|
82
|
+
"eslint": "9.39.4",
|
|
83
|
+
"prettier": "3.8.3",
|
|
84
|
+
"rxjs": "7.8.2"
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"build": "rm -rf dist && tsc --project ./tsconfig.build.json --emitDeclarationOnly --checkers 1 && swc src --out-dir dist --strip-leading-paths && rm -f dist/utils/create-selector.type-check.d.ts",
|
|
88
|
+
"clean": "rm -rf dist && rm -rf node_modules",
|
|
89
|
+
"dev": "swc src --out-dir dist --watch --strip-leading-paths",
|
|
90
|
+
"transpile": "swc src --out-dir dist --strip-leading-paths",
|
|
91
|
+
"lint:check": "eslint src",
|
|
92
|
+
"lint:fix": "eslint src --fix",
|
|
93
|
+
"prettify:check": "prettier --check .",
|
|
94
|
+
"prettify:fix": "prettier --write .",
|
|
95
|
+
"test": "vitest run",
|
|
96
|
+
"ts:check": "tsc --project ./tsconfig.build.json --noEmit --checkers 1"
|
|
97
|
+
}
|
|
6
98
|
}
|