@dxtmisha/functional-basic 1.6.1 → 1.6.3
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 +16 -0
- package/ai-description.md +16 -18
- package/ai-doc.md +6 -0
- package/ai-types.md +739 -1225
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.6.2] - 2026-07-06
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- **Documentation**: Updated AI documentation and developer guides (`ai-doc.md`, `ai-doc.ru.md`) with explicit rules for structuring, exporting, and managing types, interfaces, enums, and API schemas (specifically mandating the use of `@effect/schema` when available in project dependencies).
|
|
9
|
+
|
|
10
|
+
## [1.6.1] - 2026-07-04
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- **Build System**: Corrected the `types` and `exports` mapping paths in `package.json` from `dist/src/library.d.ts` to `dist/library.d.ts`.
|
|
14
|
+
|
|
15
|
+
## [1.6.0] - 2026-07-03
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- **isMetaKey**: Introduced `isMetaKey` utility function to detect active modifier key presses (`metaKey`, `altKey`, `ctrlKey`) in KeyboardEvent objects.
|
|
19
|
+
- **Tests**: Created a comprehensive test suite `isMetaKey.test.ts` to verify modifier key detection.
|
|
20
|
+
|
|
5
21
|
## [1.5.0] - 2026-07-02
|
|
6
22
|
|
|
7
23
|
### Added
|
package/ai-description.md
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
Core Purpose
|
|
1
|
+
### Core Purpose
|
|
2
|
+
The library provides an isomorphic utility framework for managing high-level application concerns in JavaScript/TypeScript environments (SSR and DOM). It includes robust abstractions for API communication (REST/Fetch), structured state management, DOM-safe event handling, internationalization, and reactive data storage.
|
|
2
3
|
|
|
3
|
-
Key Expositions
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
6. EventItem: A robust wrapper for DOM listeners that includes auto-cleanup, lifecycle control, and specialized optimizations (e.g., resize/scroll-sync).
|
|
10
|
-
7. Translation System: Asynchronous/Synchronous multi-locale translation manager with fallback logic and file-based loading.
|
|
4
|
+
### Key Expositions
|
|
5
|
+
* **API & Networking**: `Api` (singleton interface), `ApiInstance` (core requester), `ApiCache` (request memoization), `ApiError` (centralized error handling), `ApiHydration` (SSR data serialization), and `ApiHeaders`.
|
|
6
|
+
* **State & Storage**: `DataStorage` (persistent storage with prefixes/expiration), `ServerStorage` (SSR-safe context isolation), `CookieStorage` (isomorphic cookie management), `Query`/`Hash` (URL-state management), and `Global` (app-wide data).
|
|
7
|
+
* **UI & Events**: `EventItem` (DOM-safe, optimized event management with `ResizeObserver` and `scroll-sync`), `LoadingInstance` (global loading state), and `ScrollbarWidth` (layout utility).
|
|
8
|
+
* **Localization & Formatting**: `Geo` (locale/timezone management), `GeoIntl` (Intl API wrapper), `GeoUnit` (metric/imperial conversion), `Translate` (i18n), and `Formatters` (currency, number, date, and pluralization utility).
|
|
9
|
+
* **Utilities & Data**: `Formatters`, `SearchList` (search matching/caching), `ResumableTimer`, and a suite of functional utilities for object cloning, string/date manipulation, and DOM operations.
|
|
11
10
|
|
|
12
|
-
Triggers for Studying ai-types.md
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- You are extending search logic or defining new search list result types.
|
|
11
|
+
### Triggers for Studying ai-types.md
|
|
12
|
+
Review `ai-types.md` whenever the following requirements arise:
|
|
13
|
+
1. **API Integration**: You need to implement new request methods, custom error handling for specific HTTP status codes, or configure global API middleware (`wrapper`/`preparation`).
|
|
14
|
+
2. **I18n/Formatting**: You are dealing with complex localization rules, unit conversions (Geo/Units), or pluralization requirements.
|
|
15
|
+
3. **SSR Consistency**: You are implementing features that must function identically on both the server and client (Hydration, `ServerStorage`, or `Datetime` formatting).
|
|
16
|
+
4. **Complex State**: You need to map or query data structures in memory using `SearchList` or utilize `BroadcastChannel` for cross-context messaging.
|
|
19
17
|
|
|
20
|
-
Integration Context
|
|
21
|
-
|
|
18
|
+
### Integration Context
|
|
19
|
+
The library acts as a foundational service layer between the application logic and the runtime environment. It is designed to be framework-agnostic but is particularly optimized for SSR-heavy environments (like Vue/React) where hydration of state (via `ServerStorage`) and safe access to global browser objects (via `isDomRuntime`) are critical. It wraps native `fetch`, `localStorage`, `sessionStorage`, `BroadcastChannel`, and `Intl` APIs into structured, type-safe, and singleton-accessible services.
|
package/ai-doc.md
CHANGED
|
@@ -53,6 +53,12 @@ Members in every class MUST be ordered in the following sequence:
|
|
|
53
53
|
* Use `ServerStorage.get('key', () => new Instance())` for request-isolated singletons.
|
|
54
54
|
* Use `isDomRuntime()` checks before accessing browser-only APIs like `window`, `document`, or `location`.
|
|
55
55
|
|
|
56
|
+
3. TYPES, INTERFACES, AND ENUMS
|
|
57
|
+
- Location: All types, interfaces, and enums must be located in the `src/types` directory if it exists in the project. If the `src/types` directory does not exist, they must be defined in the same file where they are used.
|
|
58
|
+
- Naming: All files containing types must have the suffix `Types` in their name (e.g., `*Types.ts` or `*Types.d.ts`).
|
|
59
|
+
- Export: All types, interfaces, and enums must be explicitly exported.
|
|
60
|
+
- API Types/Schemas: All types and interfaces for working with APIs must be defined/generated using the `@effect/schema` library if it is present in the project's dependencies (if the project is a monorepo, also check root dependencies).
|
|
61
|
+
|
|
56
62
|
=============================================================================
|
|
57
63
|
DEVELOPER GUIDE: USING `@dxtmisha/functional-basic` AS A LIBRARY
|
|
58
64
|
=============================================================================
|