@aglyn/shared-util-vendor 1.0.0-beta.143 → 1.0.0-beta.144
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 +61 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,65 @@
|
|
|
1
1
|
# @aglyn/shared-util-vendor
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Thin re-exports of the third-party utilities the Aglyn packages use, under stable names, so that each library is depended on in one place. It is an internal building block of `@aglyn/aglyn`, `@aglyn/besigner`, `@aglyn/plugins-mui` and the shared UI packages. There is little reason to install it on its own; install the underlying library instead.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Beta. Published from the Aglyn monorepo under the `beta` dist-tag; APIs can change between beta releases.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
npm install @aglyn/shared-util-vendor@beta
|
|
10
|
+
|
|
11
|
+
Peer dependency: `react` (`^19.2.8`), used by the `use-debounce` module. The `mobx-computed-fn` module re-exports from `mobx-utils`, which itself needs `mobx` installed.
|
|
12
|
+
|
|
13
|
+
## What's in it
|
|
14
|
+
|
|
15
|
+
From the package root:
|
|
16
|
+
|
|
17
|
+
| Exports | From |
|
|
18
|
+
| -- | -- |
|
|
19
|
+
| `camelCase`, `kebabCase`, `snakeCase`, `constantCase` and the other case functions, `split`, `splitSeparateNumbers`, the `ChangeCase` namespace, and the older aliases `paramCase` (= `kebabCase`) and `headerCase` (= `trainCase`) | `change-case` |
|
|
20
|
+
| `hoistNonReactStatics` | `hoist-non-react-statics` |
|
|
21
|
+
| `objectDeepMerge`, `objectDeepMergeCustom`, and `objectDeepMergeReplaceArrays` (a later array replaces an earlier one instead of being concatenated; meant for configuration objects) | `deepmerge-ts` |
|
|
22
|
+
| `createUid`, `createUidWithAlphabet`, `createUidCustom`, `createUidRandomBytes` | `nanoid` |
|
|
23
|
+
|
|
24
|
+
By subpath only. These are deliberately kept off the root so that importing anything from the root does not pull their packages into a browser bundle:
|
|
25
|
+
|
|
26
|
+
| Import path | Exports | From |
|
|
27
|
+
| -- | -- | -- |
|
|
28
|
+
| `@aglyn/shared-util-vendor/deep-equal` | `deepEqual` | `deep-equal` |
|
|
29
|
+
| `@aglyn/shared-util-vendor/fuse` | `Fuse` (also default) | `fuse.js` |
|
|
30
|
+
| `@aglyn/shared-util-vendor/mitt-emitter` | `Mitt` and its types | `mitt` |
|
|
31
|
+
| `@aglyn/shared-util-vendor/mobx-computed-fn` | `computedFn` | `mobx-utils` |
|
|
32
|
+
| `@aglyn/shared-util-vendor/object-deep-fill-in` | `objectDeepMergeFillIn` (never overwrites an existing property) | `mout` |
|
|
33
|
+
| `@aglyn/shared-util-vendor/object-flatten` | `objectFlatten`, `objectUnflatten` | `flat` |
|
|
34
|
+
| `@aglyn/shared-util-vendor/platform-identification` | `platformIdentification()` | `platform` |
|
|
35
|
+
| `@aglyn/shared-util-vendor/uid-alphabets` | `UidAlphabets` | `nanoid-dictionary` |
|
|
36
|
+
| `@aglyn/shared-util-vendor/use-debounce` | `useDebounce`, `useDebouncedCallback`, `useThrottledCallback` | `use-debounce` |
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import {
|
|
42
|
+
createUid,
|
|
43
|
+
kebabCase,
|
|
44
|
+
objectDeepMergeReplaceArrays,
|
|
45
|
+
} from '@aglyn/shared-util-vendor'
|
|
46
|
+
import { deepEqual } from '@aglyn/shared-util-vendor/deep-equal'
|
|
47
|
+
|
|
48
|
+
const id = createUid()
|
|
49
|
+
const slug = kebabCase('PascalCase') // 'pascal-case'
|
|
50
|
+
|
|
51
|
+
const merged = objectDeepMergeReplaceArrays(
|
|
52
|
+
{ variants: ['a', 'b'] },
|
|
53
|
+
{ variants: ['z'] },
|
|
54
|
+
) // { variants: ['z'] }
|
|
55
|
+
|
|
56
|
+
deepEqual({ a: 1 }, { a: 1 }) // true
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## How it fits
|
|
60
|
+
|
|
61
|
+
A `shared` package: generic, with no knowledge of Aglyn's model, and it imports no other Aglyn package. Shared packages may only import other shared packages and hold no plugin's domain. `@aglyn/aglyn`, `@aglyn/aglyn-node-renderer`, `@aglyn/besigner`, `@aglyn/besigner-ui`, `@aglyn/plugins-mui`, `@aglyn/shared-ui-jsx`, `@aglyn/shared-ui-jsx-forms`, `@aglyn/shared-ui-snackstack` and `@aglyn/shared-ui-theme` depend on it.
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/shared/util/vendor
|