alepha 0.7.6 → 0.7.7

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Feunard
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Feunard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,44 +1,44 @@
1
- <div align="center">
2
-
3
- <h1 >
4
- <img
5
- src="https://raw.githubusercontent.com/feunard/alepha/main/assets/logo.png"
6
- width="128"
7
- height="128"
8
- alt="Logo"
9
- valign="middle"
10
- />
11
- Alepha
12
- </h1>
13
- <p style="max-width: 512px">
14
- 🚧
15
- </p>
16
- <a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/v/alepha.svg" alt="npm"/></a>
17
- <a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/l/alepha.svg" alt="npm"/></a>
18
- <a href="https://codecov.io/gh/feunard/alepha"><img src="https://codecov.io/gh/feunard/alepha/graph/badge.svg?token=ZDLWI514CP" alt="npm"/></a>
19
- <a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/dt/alepha.svg" alt="npm"/></a>
20
- <a href="https://github.com/feunard/alepha"><img src="https://img.shields.io/github/stars/feunard/alepha.svg?style=social" alt="GitHub stars"/></a>
21
- </div>
22
-
23
- ## Installation
24
-
25
- ```bash
26
- npm install alepha
27
- ```
28
-
29
- ## Usage
30
-
31
- Minimalist http server with a single endpoint.
32
-
33
- ```ts
34
- import { run } from "alepha";
35
- import { $action } from "alepha/server";
36
-
37
- class App {
38
- hello = $action({
39
- handler: () => "Hello world!",
40
- })
41
- }
42
-
43
- run(App);
44
- ```
1
+ <div align="center">
2
+
3
+ <h1 >
4
+ <img
5
+ src="https://raw.githubusercontent.com/feunard/alepha/main/assets/logo.png"
6
+ width="128"
7
+ height="128"
8
+ alt="Logo"
9
+ valign="middle"
10
+ />
11
+ Alepha
12
+ </h1>
13
+ <p style="max-width: 512px">
14
+ 🚧
15
+ </p>
16
+ <a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/v/alepha.svg" alt="npm"/></a>
17
+ <a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/l/alepha.svg" alt="npm"/></a>
18
+ <a href="https://codecov.io/gh/feunard/alepha"><img src="https://codecov.io/gh/feunard/alepha/graph/badge.svg?token=ZDLWI514CP" alt="npm"/></a>
19
+ <a href="https://www.npmjs.com/package/alepha"><img src="https://img.shields.io/npm/dt/alepha.svg" alt="npm"/></a>
20
+ <a href="https://github.com/feunard/alepha"><img src="https://img.shields.io/github/stars/feunard/alepha.svg?style=social" alt="GitHub stars"/></a>
21
+ </div>
22
+
23
+ ## Installation
24
+
25
+ ```bash
26
+ npm install alepha
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ Minimalist http server with a single endpoint.
32
+
33
+ ```ts
34
+ import { run } from "alepha";
35
+ import { $action } from "alepha/server";
36
+
37
+ class App {
38
+ hello = $action({
39
+ handler: () => "Hello world!",
40
+ })
41
+ }
42
+
43
+ run(App);
44
+ ```
package/core.d.ts CHANGED
@@ -293,7 +293,8 @@ declare class AsyncLocalStorageProvider {
293
293
  static create: () => AsyncLocalStorage<AsyncLocalStorageData> | undefined;
294
294
  protected als?: AsyncLocalStorage<AsyncLocalStorageData>;
295
295
  constructor();
296
- run<R>(data: AsyncLocalStorageData, callback: () => R): R;
296
+ createContextId(): string;
297
+ run<R>(callback: () => R, data?: Record<string, any>): R;
297
298
  get<T>(key: string): T | undefined;
298
299
  set<T>(key: string, value: T): void;
299
300
  }
package/datetime.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as _alepha_core1 from "@alepha/core";
1
+ import * as _alepha_core0 from "@alepha/core";
2
2
  import { Async } from "@alepha/core";
3
3
  import dayjs, { Dayjs, ManipulateType } from "dayjs";
4
4
  import dayjsDuration from "dayjs/plugin/duration.js";
@@ -54,13 +54,13 @@ type DateTime = dayjs.Dayjs;
54
54
  type Duration = dayjsDuration.Duration;
55
55
  type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
56
56
  declare class DateTimeProvider {
57
- protected log: _alepha_core1.Logger;
57
+ protected log: _alepha_core0.Logger;
58
58
  protected ref: DateTime | null;
59
59
  protected readonly timeouts: Timeout[];
60
60
  protected readonly intervals: Interval[];
61
61
  constructor();
62
- protected readonly start: _alepha_core1.HookDescriptor<"start">;
63
- protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
62
+ protected readonly start: _alepha_core0.HookDescriptor<"start">;
63
+ protected readonly stop: _alepha_core0.HookDescriptor<"stop">;
64
64
  /**
65
65
  * Create a new DateTime instance.
66
66
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alepha",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -15,30 +15,35 @@
15
15
  "main": "./core.js",
16
16
  "types": "./core.d.ts",
17
17
  "dependencies": {
18
- "@alepha/cache": "0.7.6",
19
- "@alepha/cache-redis": "0.7.6",
20
- "@alepha/core": "0.7.6",
21
- "@alepha/datetime": "0.7.6",
22
- "@alepha/lock": "0.7.6",
23
- "@alepha/lock-redis": "0.7.6",
24
- "@alepha/postgres": "0.7.6",
25
- "@alepha/queue": "0.7.6",
26
- "@alepha/queue-redis": "0.7.6",
27
- "@alepha/react": "0.7.6",
28
- "@alepha/react-auth": "0.7.6",
29
- "@alepha/redis": "0.7.6",
30
- "@alepha/retry": "0.7.6",
31
- "@alepha/scheduler": "0.7.6",
32
- "@alepha/security": "0.7.6",
33
- "@alepha/server": "0.7.6",
34
- "@alepha/server-cache": "0.7.6",
35
- "@alepha/server-cookies": "0.7.6",
36
- "@alepha/server-static": "0.7.6",
37
- "@alepha/server-swagger": "0.7.6",
38
- "@alepha/testing": "0.7.6",
39
- "@alepha/topic": "0.7.6",
40
- "@alepha/topic-redis": "0.7.6",
41
- "@alepha/vite": "0.7.6",
18
+ "@alepha/cache": "0.7.7",
19
+ "@alepha/cache-redis": "0.7.7",
20
+ "@alepha/core": "0.7.7",
21
+ "@alepha/datetime": "0.7.7",
22
+ "@alepha/lock": "0.7.7",
23
+ "@alepha/lock-redis": "0.7.7",
24
+ "@alepha/postgres": "0.7.7",
25
+ "@alepha/queue": "0.7.7",
26
+ "@alepha/queue-redis": "0.7.7",
27
+ "@alepha/react": "0.7.7",
28
+ "@alepha/react-auth": "0.7.7",
29
+ "@alepha/react-head": "0.7.7",
30
+ "@alepha/redis": "0.7.7",
31
+ "@alepha/retry": "0.7.7",
32
+ "@alepha/scheduler": "0.7.7",
33
+ "@alepha/security": "0.7.7",
34
+ "@alepha/server": "0.7.7",
35
+ "@alepha/server-cache": "0.7.7",
36
+ "@alepha/server-cookies": "0.7.7",
37
+ "@alepha/server-cors": "0.7.7",
38
+ "@alepha/server-health": "0.7.7",
39
+ "@alepha/server-links": "0.7.7",
40
+ "@alepha/server-proxy": "0.7.7",
41
+ "@alepha/server-static": "0.7.7",
42
+ "@alepha/server-swagger": "0.7.7",
43
+ "@alepha/testing": "0.7.7",
44
+ "@alepha/topic": "0.7.7",
45
+ "@alepha/topic-redis": "0.7.7",
46
+ "@alepha/vite": "0.7.7",
42
47
  "@types/react": "^19.1.8",
43
48
  "react": "^19.1.0"
44
49
  },
@@ -116,6 +121,11 @@
116
121
  "require": "./react/auth.cjs",
117
122
  "types": "./react/auth.d.ts"
118
123
  },
124
+ "./react/head": {
125
+ "import": "./react/head.js",
126
+ "require": "./react/head.cjs",
127
+ "types": "./react/head.d.ts"
128
+ },
119
129
  "./redis": {
120
130
  "import": "./redis.js",
121
131
  "require": "./redis.cjs",
@@ -151,6 +161,26 @@
151
161
  "require": "./server/cookies.cjs",
152
162
  "types": "./server/cookies.d.ts"
153
163
  },
164
+ "./server/cors": {
165
+ "import": "./server/cors.js",
166
+ "require": "./server/cors.cjs",
167
+ "types": "./server/cors.d.ts"
168
+ },
169
+ "./server/health": {
170
+ "import": "./server/health.js",
171
+ "require": "./server/health.cjs",
172
+ "types": "./server/health.d.ts"
173
+ },
174
+ "./server/links": {
175
+ "import": "./server/links.js",
176
+ "require": "./server/links.cjs",
177
+ "types": "./server/links.d.ts"
178
+ },
179
+ "./server/proxy": {
180
+ "import": "./server/proxy.js",
181
+ "require": "./server/proxy.cjs",
182
+ "types": "./server/proxy.d.ts"
183
+ },
154
184
  "./server/static": {
155
185
  "import": "./server/static.js",
156
186
  "require": "./server/static.cjs",
@@ -195,6 +225,7 @@
195
225
  "queue-redis",
196
226
  "react",
197
227
  "react-auth",
228
+ "react-head",
198
229
  "redis",
199
230
  "retry",
200
231
  "scheduler",
@@ -202,6 +233,10 @@
202
233
  "server",
203
234
  "server-cache",
204
235
  "server-cookies",
236
+ "server-cors",
237
+ "server-health",
238
+ "server-links",
239
+ "server-proxy",
205
240
  "server-static",
206
241
  "server-swagger",
207
242
  "testing",