@abdokouta/react-support 1.1.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.0.0] - 2026-04-05
6
+
7
+ ### Stable Release
8
+
9
+ - First production-grade stable release
10
+ - All features from previous versions are now considered stable and production-ready
11
+ - API is now stabilized — breaking changes will follow semver from this point forward
12
+
13
+ ## [1.2.0] - 2026-04-05
14
+
15
+ ### Refactored
16
+
17
+ - Centralized all types and interfaces into `src/types/` with `.type.ts`
18
+ convention
19
+ - Extracted utility functions into `src/utils/` with `.util.ts` convention
20
+ - Moved `MultipleInstanceManager` into `src/managers/` module
21
+ - Removed `RegistryCollection` adapter — `BaseRegistry` now uses `MapCollection`
22
+ directly
23
+ - Switched all internal imports to `@/*` path aliases
24
+ - Removed facade source files (types extracted to `src/types/`)
25
+ - Updated root barrel to only export types from `src/types/`
26
+
27
+ ### Fixed
28
+
29
+ - Added `ES2020` and `DOM` libs to tsconfig for `Map`, `URL`, `Buffer`, and
30
+ `btoa` support
31
+ - Added `node` to tsconfig types for Node.js globals
32
+ - Fixed strict null checks in `Str.pluralStudly` and `Str.replaceArray`
33
+
34
+ ### Changed
35
+
36
+ - Migrated ESLint config from JS to TypeScript
37
+ - Added `.prettierrc.ts` configuration
38
+
5
39
  ## [1.0.0] - 2024-03-31
6
40
 
7
41
  ### Added
package/README.md CHANGED
@@ -1,58 +1,79 @@
1
- # @abdokouta/support
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/pixielity-inc/react-support/main/assets/banner.svg" alt="@abdokouta/react-support" width="100%" />
3
+ </p>
2
4
 
3
- Laravel-style utilities for JavaScript/TypeScript. Provides powerful string manipulation, collection handling, and registry patterns inspired by Laravel's support package.
5
+ <h1 align="center">@abdokouta/react-support</h1>
4
6
 
5
- ## Features
7
+ <p align="center">
8
+ <strong>Laravel-style utilities for JavaScript/TypeScript</strong>
9
+ </p>
6
10
 
7
- - 🎯 **Str Class**: 100+ string manipulation methods matching Laravel's API
8
- - 📦 **Collection**: Array collection with 50+ chainable methods (powered by collect.js)
9
- - 🗺️ **MapCollection**: Map data structure with collection methods
10
- - 🎲 **SetCollection**: Set data structure with collection methods
11
- - 🏗️ **BaseRegistry**: Generic registry pattern for building extensible systems
12
- - 💪 **TypeScript**: Full type safety with comprehensive type definitions
13
- - 🔗 **Chainable**: Fluent, chainable API for elegant code
14
- - 🚀 **Zero Config**: Works out of the box
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@abdokouta/react-support"><img src="https://img.shields.io/npm/v/@abdokouta/react-support.svg?style=flat-square" alt="npm version" /></a>
13
+ <a href="https://www.npmjs.com/package/@abdokouta/react-support"><img src="https://img.shields.io/npm/dm/@abdokouta/react-support.svg?style=flat-square" alt="npm downloads" /></a>
14
+ <a href="https://github.com/pixielity-inc/react-support/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@abdokouta/react-support.svg?style=flat-square" alt="license" /></a>
15
+ <a href="https://github.com/pixielity-inc/react-support"><img src="https://img.shields.io/github/stars/pixielity-inc/react-support?style=flat-square" alt="GitHub stars" /></a>
16
+ </p>
15
17
 
16
- ## Installation
18
+ <p align="center">
19
+ Powerful string manipulation, collection handling, facades, and registry patterns inspired by Laravel
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## ✨ Features
25
+
26
+ - 🎯 **Str Class** - 100+ string manipulation methods matching Laravel's API
27
+ - 📦 **Collection** - Array collection with 50+ chainable methods (powered by
28
+ collect.js)
29
+ - 🗺️ **MapCollection** - Map data structure with collection methods
30
+ - 🎲 **SetCollection** - Set data structure with collection methods
31
+ - 🏗️ **BaseRegistry** - Generic registry pattern for building extensible systems
32
+ - 🎭 **Facades** - Laravel-style facades for clean service access
33
+ - 💪 **TypeScript** - Full type safety with comprehensive type definitions
34
+ - 🔗 **Chainable** - Fluent, chainable API for elegant code
35
+ - 🚀 **Zero Config** - Works out of the box
36
+
37
+ ## 📦 Installation
17
38
 
18
39
  ```bash
19
- npm install @abdokouta/support
40
+ npm install @abdokouta/react-support
20
41
  # or
21
- pnpm add @abdokouta/support
42
+ pnpm add @abdokouta/react-support
22
43
  # or
23
- yarn add @abdokouta/support
44
+ yarn add @abdokouta/react-support
24
45
  ```
25
46
 
26
- ## Usage
47
+ ## 🚀 Usage
27
48
 
28
49
  ### Str Class
29
50
 
30
51
  ```typescript
31
- import { Str } from '@abdokouta/support';
52
+ import { Str } from '@abdokouta/react-support';
32
53
 
33
54
  // String manipulation
34
- Str.camel('foo_bar'); // 'fooBar'
35
- Str.snake('fooBar'); // 'foo_bar'
36
- Str.kebab('fooBar'); // 'foo-bar'
37
- Str.studly('foo_bar'); // 'FooBar'
38
- Str.title('a nice title'); // 'A Nice Title'
55
+ Str.camel('foo_bar'); // 'fooBar'
56
+ Str.snake('fooBar'); // 'foo_bar'
57
+ Str.kebab('fooBar'); // 'foo-bar'
58
+ Str.studly('foo_bar'); // 'FooBar'
59
+ Str.title('a nice title'); // 'A Nice Title'
39
60
 
40
61
  // String inspection
41
- Str.contains('This is my name', 'my'); // true
42
- Str.startsWith('Hello World', 'Hello'); // true
43
- Str.endsWith('Hello World', 'World'); // true
44
- Str.isJson('{"key": "value"}'); // true
45
- Str.isUrl('https://example.com'); // true
62
+ Str.contains('This is my name', 'my'); // true
63
+ Str.startsWith('Hello World', 'Hello'); // true
64
+ Str.endsWith('Hello World', 'World'); // true
65
+ Str.isJson('{"key": "value"}'); // true
66
+ Str.isUrl('https://example.com'); // true
46
67
  Str.isUuid('a0a2a2d2-0b87-4a18-83f2-2529882be2de'); // true
47
68
 
48
69
  // String extraction
49
70
  Str.after('This is my name', 'This is'); // ' my name'
50
- Str.before('This is my name', 'my'); // 'This is '
71
+ Str.before('This is my name', 'my'); // 'This is '
51
72
  Str.between('This is my name', 'This', 'name'); // ' is my '
52
73
 
53
74
  // String modification
54
- Str.limit('The quick brown fox', 10); // 'The quick...'
55
- Str.slug('Laravel 5 Framework', '-'); // 'laravel-5-framework'
75
+ Str.limit('The quick brown fox', 10); // 'The quick...'
76
+ Str.slug('Laravel 5 Framework', '-'); // 'laravel-5-framework'
56
77
 
57
78
  // And 80+ more methods!
58
79
  ```
@@ -60,65 +81,82 @@ Str.slug('Laravel 5 Framework', '-'); // 'laravel-5-framework'
60
81
  ### Collection (Array)
61
82
 
62
83
  ```typescript
63
- import { collect } from '@abdokouta/support';
84
+ import { collect } from '@abdokouta/react-support';
64
85
 
65
86
  // Create a collection
66
87
  const collection = collect([1, 2, 3, 4, 5]);
67
88
 
68
89
  // Chainable methods
69
90
  collection
70
- .filter(item => item > 2)
71
- .map(item => item * 2)
72
- .sum(); // 24
91
+ .filter((item) => item > 2)
92
+ .map((item) => item * 2)
93
+ .sum(); // 24
73
94
 
74
95
  // Working with objects
75
96
  const users = collect([
76
97
  { name: 'John', age: 30 },
77
98
  { name: 'Jane', age: 25 },
78
- { name: 'Bob', age: 35 }
99
+ { name: 'Bob', age: 35 },
79
100
  ]);
80
101
 
81
102
  users.where('age', '>', 25).pluck('name').all();
82
103
  // ['John', 'Bob']
83
104
 
84
105
  // Aggregation
85
- collect([1, 2, 3, 4, 5]).sum(); // 15
86
- collect([1, 2, 3, 4, 5]).avg(); // 3
87
- collect([1, 2, 3, 4, 5]).max(); // 5
88
- collect([1, 2, 3, 4, 5]).min(); // 1
106
+ collect([1, 2, 3, 4, 5]).sum(); // 15
107
+ collect([1, 2, 3, 4, 5]).avg(); // 3
108
+ collect([1, 2, 3, 4, 5]).max(); // 5
109
+ collect([1, 2, 3, 4, 5]).min(); // 1
110
+ ```
111
+
112
+ ### Facades
113
+
114
+ ```typescript
115
+ import { Facade, createFacade } from '@abdokouta/react-support';
116
+ import { Container } from '@abdokouta/react-di';
117
+
118
+ // Set the container for facades
119
+ Facade.setFacadeContainer(Container.getContainer());
120
+
121
+ // Create a facade for a service
122
+ const Config = createFacade<IConfigService>('ConfigService');
123
+
124
+ // Use the facade
125
+ Config.get('app.name');
126
+ Config.set('app.debug', true);
89
127
  ```
90
128
 
91
129
  ### MapCollection
92
130
 
93
131
  ```typescript
94
- import { collectMap } from '@abdokouta/support';
132
+ import { collectMap } from '@abdokouta/react-support';
95
133
 
96
134
  const map = collectMap({ name: 'John', age: 30 });
97
135
 
98
136
  map.set('city', 'New York');
99
- map.get('name'); // 'John'
100
- map.has('age'); // true
101
- map.keys(); // ['name', 'age', 'city']
102
- map.values(); // ['John', 30, 'New York']
137
+ map.get('name'); // 'John'
138
+ map.has('age'); // true
139
+ map.keys(); // ['name', 'age', 'city']
140
+ map.values(); // ['John', 30, 'New York']
103
141
  ```
104
142
 
105
143
  ### SetCollection
106
144
 
107
145
  ```typescript
108
- import { collectSet } from '@abdokouta/support';
146
+ import { collectSet } from '@abdokouta/react-support';
109
147
 
110
148
  const set1 = collectSet([1, 2, 3]);
111
149
  const set2 = collectSet([2, 3, 4]);
112
150
 
113
- set1.union(set2).all(); // [1, 2, 3, 4]
114
- set1.intersect(set2).all(); // [2, 3]
115
- set1.diff(set2).all(); // [1]
151
+ set1.union(set2).all(); // [1, 2, 3, 4]
152
+ set1.intersect(set2).all(); // [2, 3]
153
+ set1.diff(set2).all(); // [1]
116
154
  ```
117
155
 
118
156
  ### BaseRegistry
119
157
 
120
158
  ```typescript
121
- import { BaseRegistry } from '@abdokouta/support';
159
+ import { BaseRegistry } from '@abdokouta/react-support';
122
160
 
123
161
  // Create a typed registry
124
162
  interface Theme {
@@ -135,7 +173,7 @@ const themeRegistry = new BaseRegistry<Theme>({
135
173
  },
136
174
  afterAdd: (key, theme) => {
137
175
  console.log(`Registered theme: ${theme.name}`);
138
- }
176
+ },
139
177
  });
140
178
 
141
179
  // Register items
@@ -148,12 +186,18 @@ const allThemes = themeRegistry.getAll();
148
186
  const hasTheme = themeRegistry.has('dark');
149
187
  ```
150
188
 
151
- ## TypeScript Support
189
+ ## 📘 TypeScript Support
152
190
 
153
191
  Full TypeScript support with comprehensive type definitions:
154
192
 
155
193
  ```typescript
156
- import { Str, Collection, MapCollection, SetCollection, BaseRegistry } from '@abdokouta/support';
194
+ import {
195
+ Str,
196
+ Collection,
197
+ MapCollection,
198
+ SetCollection,
199
+ BaseRegistry,
200
+ } from '@abdokouta/react-support';
157
201
 
158
202
  // Type-safe collections
159
203
  const numbers: Collection<number> = collect([1, 2, 3]);
@@ -168,11 +212,11 @@ const tags: SetCollection<string> = collectSet(['tag1', 'tag2']);
168
212
  const registry = new BaseRegistry<MyType>();
169
213
  ```
170
214
 
171
- ## License
215
+ ## 📄 License
172
216
 
173
217
  MIT
174
218
 
175
- ## Credits
219
+ ## 🙏 Credits
176
220
 
177
221
  - Inspired by [Laravel](https://laravel.com)'s support package
178
222
  - Array collections powered by [collect.js](https://collect.js.org/)