@expressots/shared 3.0.0 → 4.0.0-preview.1

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.
Files changed (63) hide show
  1. package/README.md +31 -98
  2. package/lib/CHANGELOG.md +82 -65
  3. package/lib/README.md +31 -98
  4. package/lib/cjs/env/cli-options.js +2 -2
  5. package/lib/cjs/env/environment.js +10 -10
  6. package/lib/cjs/env/index.js +1 -1
  7. package/lib/cjs/index.js +4 -4
  8. package/lib/cjs/interfaces/index.js +3 -5
  9. package/lib/cjs/types/config/index.d.ts +1 -1
  10. package/lib/cjs/types/config/project-config.d.ts +5 -0
  11. package/lib/cjs/types/env/cli-options.d.ts +1 -1
  12. package/lib/cjs/types/env/env-options.d.ts +1 -1
  13. package/lib/cjs/types/env/environment.d.ts +1 -1
  14. package/lib/cjs/types/env/index.d.ts +2 -2
  15. package/lib/cjs/types/index.d.ts +4 -4
  16. package/lib/cjs/types/interfaces/application-express.interface.d.ts +9 -4
  17. package/lib/cjs/types/interfaces/console.interface.d.ts +6 -0
  18. package/lib/cjs/types/interfaces/index.d.ts +5 -5
  19. package/lib/cjs/types/interfaces/render/render.types.d.ts +1 -1
  20. package/lib/cjs/types/utils/compiler.d.ts +1 -1
  21. package/lib/cjs/types/utils/index.d.ts +1 -1
  22. package/lib/cjs/utils/index.js +2 -2
  23. package/lib/esm/config/index.js +1 -0
  24. package/lib/esm/config/project-config.js +1 -0
  25. package/lib/esm/env/cli-options.js +15 -0
  26. package/lib/esm/env/constants.js +10 -0
  27. package/lib/esm/env/env-options.js +19 -0
  28. package/lib/esm/env/environment.js +304 -0
  29. package/lib/esm/env/index.js +1 -0
  30. package/lib/esm/env/interfaces.js +1 -0
  31. package/lib/esm/index.mjs +4 -0
  32. package/lib/esm/interfaces/application-express.interface.js +1 -0
  33. package/lib/esm/interfaces/console.interface.js +1 -0
  34. package/lib/esm/interfaces/environment.interface.js +19 -0
  35. package/lib/esm/interfaces/index.js +1 -0
  36. package/lib/esm/interfaces/middleware.interface.js +1 -0
  37. package/lib/esm/interfaces/render/ejs.types.js +2 -0
  38. package/lib/esm/interfaces/render/render.types.js +20 -0
  39. package/lib/esm/package.json +3 -0
  40. package/lib/esm/types/config/index.d.ts +1 -0
  41. package/lib/esm/types/config/project-config.d.ts +43 -0
  42. package/lib/esm/types/env/cli-options.d.ts +7 -0
  43. package/lib/esm/types/env/constants.d.ts +10 -0
  44. package/lib/esm/types/env/env-options.d.ts +9 -0
  45. package/lib/esm/types/env/environment.d.ts +83 -0
  46. package/lib/esm/types/env/index.d.ts +2 -0
  47. package/lib/esm/types/env/interfaces.d.ts +71 -0
  48. package/lib/esm/types/index.d.ts +4 -0
  49. package/lib/esm/types/interfaces/application-express.interface.d.ts +58 -0
  50. package/lib/esm/types/interfaces/console.interface.d.ts +14 -0
  51. package/lib/esm/types/interfaces/environment.interface.d.ts +37 -0
  52. package/lib/esm/types/interfaces/index.d.ts +5 -0
  53. package/lib/esm/types/interfaces/middleware.interface.d.ts +7 -0
  54. package/lib/esm/types/interfaces/render/ejs.types.d.ts +169 -0
  55. package/lib/esm/types/interfaces/render/render.types.d.ts +71 -0
  56. package/lib/esm/types/utils/compiler.d.ts +17 -0
  57. package/lib/esm/types/utils/index.d.ts +1 -0
  58. package/lib/esm/types/utils/logger.d.ts +19 -0
  59. package/lib/esm/utils/compiler.js +69 -0
  60. package/lib/esm/utils/index.js +1 -0
  61. package/lib/esm/utils/logger.js +60 -0
  62. package/lib/package.json +154 -147
  63. package/package.json +154 -147
package/README.md CHANGED
@@ -1,118 +1,51 @@
1
- <a name="readme-top"></a>
2
-
3
- <!-- PROJECT SHIELDS -->
4
-
5
- [![Codecov][codecov-shield]][codecov-url]
6
- [![NPM][npm-shield]][npm-url]
7
- ![Build][build-shield]
8
- [![Contributors][contributors-shield]][contributors-url]
9
- [![Forks][forks-shield]][forks-url]
10
- [![Stargazers][stars-shield]][stars-url]
11
- [![Issues][issues-shield]][issues-url]
12
- [![MIT License][license-shield]][license-url]
13
- [![LinkedIn][linkedin-shield]][linkedin-url]
14
-
15
- <!-- PROJECT LOGO -->
16
- <br />
17
1
  <div align="center">
18
- <a href="https://github.com/othneildrew/Best-README-Template">
19
- <img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" alt="Logo" width="120">
2
+ <a href="https://expresso-ts.com">
3
+ <img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" alt="ExpressoTS" width="120">
20
4
  </a>
21
5
 
22
- <h3 align="center">ExpressoTS Framework</h3>
23
-
24
- <p align="center">
25
- Everything you need to know to build applications with ExpressoTS
26
- <br />
27
- <a href="https://doc.expresso-ts.com/"><strong>Explore the docs »</strong></a>
28
- <br />
29
- <br />
30
- <a href="https://github.com/expressots/expressots/discussions">Let's discuss</a>
31
- ·
32
- <a href="https://github.com/expressots/expressots/issues">Report Bug</a>
33
- ·
34
- <a href="https://github.com/expressots/expressots/issues">Request Feature</a>
35
- </p>
36
- </div>
6
+ <h1>@expressots/shared</h1>
37
7
 
38
- <!-- TABLE OF CONTENTS -->
39
- <details>
40
- <summary>Table of Contents</summary>
41
- <ol>
42
- <li><a href="#about-the-project">About The Project</a></li>
43
- <li><a href="#getting-started">Getting Started</a></li>
44
- <li><a href="#contributing">Contributing</a></li>
45
- <li><a href="#support-the-project">Support the project</a></li>
46
- <li><a href="#license">License</a></li>
47
- </ol>
48
- </details>
8
+ <p>Shared types, interfaces, and utilities used across all ExpressoTS packages.</p>
49
9
 
50
- <!-- ABOUT THE PROJECT -->
51
-
52
- # About The Project
10
+ <p>
11
+ <a href="https://www.npmjs.com/package/@expressots/shared"><img src="https://img.shields.io/npm/v/@expressots/shared?style=flat&color=0d0d0d" alt="npm"></a>
12
+ <a href="https://github.com/expressots/shared/blob/main/LICENSE.md"><img src="https://img.shields.io/github/license/expressots/shared?style=flat&color=0d0d0d" alt="License"></a>
13
+ <a href="https://discord.com/invite/PyPJfGK"><img src="https://img.shields.io/badge/Discord-join-0d0d0d?logo=discord&logoColor=white" alt="Discord"></a>
14
+ </p>
53
15
 
54
- ExpressoTS is a [Typescript](https://www.typescriptlang.org/) + [Node.js](https://nodejs.org/en/) lightweight framework for quick building scalable, easy to read and maintain, server-side applications 🐎
16
+ <p>
17
+ <a href="https://doc.expresso-ts.com">Documentation</a> ·
18
+ <a href="https://doc.expresso-ts.com/docs/core/first-steps">Getting Started</a> ·
19
+ <a href="https://discord.com/invite/PyPJfGK">Community</a>
20
+ </p>
21
+ </div>
55
22
 
56
- ## Getting Started
23
+ ---
57
24
 
58
- - Here is our [Site](https://expresso-ts.com/)
59
- - You can find our [Documentation here](https://doc.expresso-ts.com/)
60
- - Checkout our [First Steps documentation](https://doc.expresso-ts.com/docs/overview/first-steps)
61
- - Our [CLI Documentation](https://doc.expresso-ts.com/docs/cli/overview)
25
+ ## Install
62
26
 
63
- ## Contributing
27
+ ```bash
28
+ npm i @expressots/shared
29
+ ```
64
30
 
65
- Welcome to the ExpressoTS community, a place bustling with innovative minds just like yours. We're absolutely thrilled to have you here!
66
- ExpressoTS is more than just a TypeScript framework; it's a collective effort by developers who are passionate about creating a more efficient, secure, and robust web ecosystem. We firmly believe that the best ideas come from a diversity of perspectives, backgrounds, and skills.
31
+ ## What This Package Does
67
32
 
68
- Why Contribute to Documentation?
33
+ This is the shared foundation layer for the ExpressoTS ecosystem. It provides common TypeScript interfaces, configuration types, environment utilities, and helper functions that `@expressots/core`, `@expressots/adapter-express`, and other packages depend on. Most applications consume it indirectly through the core package.
69
34
 
70
- - **Share Knowledge**: If you've figured out something cool, why keep it to yourself?
71
- - **Build Your Portfolio**: Contributing to an open-source project like ExpressoTS is a great way to showcase your skills.
72
- - **Join a Network**: Get to know a community of like-minded developers.
73
- - **Improve the Product**: Help us fill in the gaps, correct errors, or make complex topics easier to understand.
35
+ ## Documentation
74
36
 
75
- Ready to contribute?
37
+ For guides, API reference, architecture patterns, and examples visit **[doc.expresso-ts.com](https://doc.expresso-ts.com)**.
76
38
 
77
- - [Contributing Guidelines](https://github.com/expressots/expressots/blob/main/CONTRIBUTING.md)
78
- - [How to Contribute](https://github.com/expressots/expressots/blob/main/CONTRIBUTING_HOWTO.md)
79
- - [Coding Guidelines](https://github.com/rsaz/TypescriptCodingGuidelines)
39
+ ## Contributing
80
40
 
81
- ## Support the project
41
+ See the [Contributing Guide](https://github.com/expressots/expressots/blob/main/CONTRIBUTING.md) for how to get involved.
82
42
 
83
- ExpressoTS is an independent open source project with ongoing development made possible thanks to your support. If you'd like to help, please consider:
43
+ ## Support
84
44
 
85
- - Become a **[sponsor on GitHub](https://github.com/sponsors/expressots)**
86
- - Follow the **[organization](https://github.com/expressots)** on GitHub and Star ⭐ the project
87
- - Subscribe to the Twitch channel: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)**
88
- - Join our **[Discord](https://discord.com/invite/PyPJfGK)**
89
- - Contribute submitting **[issues and pull requests](https://github.com/expressots/expressots/issues)**
90
- - Share the project with your friends and colleagues
45
+ - [GitHub Sponsors](https://github.com/sponsors/expressots)
46
+ - [Discord](https://discord.com/invite/PyPJfGK)
47
+ - [Report an Issue](https://github.com/expressots/shared/issues)
91
48
 
92
49
  ## License
93
50
 
94
- Distributed under the MIT License. See [`LICENSE.txt`](https://github.com/expressots/expressots/blob/main/LICENSE) for more information.
95
-
96
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
97
-
98
- <!-- MARKDOWN LINKS & IMAGES -->
99
- <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
100
-
101
- [codecov-url]: https://codecov.io/gh/expressots/shared
102
- [codecov-shield]: https://img.shields.io/codecov/c/gh/expressots/shared/main?style=for-the-badge&logo=codecov&labelColor=FB9AD1
103
- [npm-url]: https://www.npmjs.com/package/@expressots/shared
104
- [npm-shield]: https://img.shields.io/npm/v/@expressots/shared?style=for-the-badge&logo=npm&color=9B3922
105
- [build-shield]: https://img.shields.io/github/actions/workflow/status/expressots/adapter-express/build.yaml?branch=main&style=for-the-badge&logo=github
106
- [contributors-shield]: https://img.shields.io/github/contributors/expressots/shared?style=for-the-badge
107
- [contributors-url]: https://github.com/expressots/shared/graphs/contributors
108
- [forks-shield]: https://img.shields.io/github/forks/expressots/shared?style=for-the-badge
109
- [forks-url]: https://github.com/expressots/shared/forks
110
- [stars-shield]: https://img.shields.io/github/stars/expressots/shared?style=for-the-badge
111
- [stars-url]: https://github.com/expressots/shared/stargazers
112
- [issues-shield]: https://img.shields.io/github/issues/expressots/shared?style=for-the-badge
113
- [issues-url]: https://github.com/expressots/shared/issues
114
- [license-shield]: https://img.shields.io/github/license/expressots/shared?style=for-the-badge
115
- [license-url]: https://github.com/expressots/shared/blob/main/LICENSE
116
- [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
117
- [linkedin-url]: https://www.linkedin.com/company/expresso-ts/
118
- [product-screenshot]: images/screenshot.png
51
+ MIT see [LICENSE](./LICENSE.md).
package/lib/CHANGELOG.md CHANGED
@@ -1,72 +1,89 @@
1
+ ## [4.0.0](https://github.com/expressots/shared/compare/3.0.0...4.0.0) (2026-05-12)
1
2
 
3
+ Part of the ExpressoTS **v4.0.0 release bundle**. See the [v4.0.0 release notes](https://expresso-ts.com/docs/4.0.0/prologue/release) and the [upgrade guide](https://expresso-ts.com/docs/4.0.0/prologue/upgrade_guide) for the full picture.
2
4
 
3
- ## [3.0.0](https://github.com/expressots/shared/compare/3.0.0-beta.3...3.0.0) (2024-12-04)
4
-
5
-
6
- ### Features
7
-
8
- * refactor IWebServer interface, add IWebServerBuilder ([9a23fff](https://github.com/expressots/shared/commit/9a23fff1e7de8d3880ed90317ffde1037ef1947b))
5
+ ### Features
6
+
7
+ * extend `ExpressoConfig` with `scaffoldSchematics` covering all v4 schematics (`controller`, `usecase`, `dto`, `module`, `provider`, `entity`, `middleware`, `interceptor`, `event`, `handler`, `guard`, `config`).
8
+ * add type-safe `Pattern` enum for the CLI `scaffoldPattern` option.
9
+ * expose shared content-negotiation primitives consumed by `@expressots/core` formatters.
10
+ * publish dual ESM + CJS builds with subpath exports for both module systems.
11
+
12
+ ### Bug Fixes
13
+
14
+ * tighten the `IWebServer` / `IWebServerBuilder` typings so v4 adapters can declare their server contract without leaking Express types.
15
+
16
+ ### Build System
17
+
18
+ * bump dev toolchain to TypeScript 5.5, ESLint 8.57, Jest 29.7, Prettier 3.5.
19
+
20
+ ## [3.0.0](https://github.com/expressots/shared/compare/3.0.0-beta.3...3.0.0) (2024-12-04)
21
+
22
+
23
+ ### Features
24
+
25
+ * refactor IWebServer interface, add IWebServerBuilder ([9a23fff](https://github.com/expressots/shared/commit/9a23fff1e7de8d3880ed90317ffde1037ef1947b))
9
26
  * update initEnvironment method to return a Promise for better async handling ([6ae9525](https://github.com/expressots/shared/commit/6ae9525b5497dacf81c1861e467bf6e27421ad2e))
10
27
 
11
- ## [3.0.0](https://github.com/expressots/shared/compare/3.0.0-beta.3...3.0.0) (2024-12-03)
12
-
13
-
14
- ### Features
15
-
28
+ ## [3.0.0](https://github.com/expressots/shared/compare/3.0.0-beta.3...3.0.0) (2024-12-03)
29
+
30
+
31
+ ### Features
32
+
16
33
  * refactor IWebServer interface, add IWebServerBuilder ([9a23fff](https://github.com/expressots/shared/commit/9a23fff1e7de8d3880ed90317ffde1037ef1947b))
17
34
 
18
- ## [3.0.0-beta.3](https://github.com/expressots/shared/compare/0.3.0...0.4.0) (2024-11-28)
19
-
20
- ### Features
21
-
22
- - add close method to Server interface for graceful shutdown ([7d0cd8f](https://github.com/expressots/shared/commit/7d0cd8f1e05c5fed96e74b01dc715e5c7eb268d0))
23
-
24
- ## [0.3.0](https://github.com/expressots/shared/compare/0.2.0...0.3.0) (2024-11-24)
25
-
26
- ### Features
27
-
28
- - add entryPoint property to ExpressoConfig interface ([324ac37](https://github.com/expressots/shared/commit/324ac37a7d407c491881998c6ed3288e04a0ae39))
29
-
30
- ## [0.2.0](https://github.com/expressots/shared/compare/0.1.0...0.2.0) (2024-11-16)
31
-
32
- ### Features
33
-
34
- - add interfaces for console, middleware, and environment; update index exports ([30d7dbb](https://github.com/expressots/shared/commit/30d7dbb0c24af12e4537f626be816f2f5d8a81a0))
35
-
36
- ### Bug Fixes
37
-
38
- - standardize quotes in middleware interface file ([6b3f045](https://github.com/expressots/shared/commit/6b3f0459c3ba0bf58d1de920335c6ef7dd438e32))
39
-
40
- ### Tests
41
-
42
- - enhance coverage for configDotenv function and add edge case handling ([58612bd](https://github.com/expressots/shared/commit/58612bd0040b592133bac687cfb29b9c6ece2a94))
43
-
44
- ## 0.1.0 (2024-11-10)
45
-
46
- ### Features
47
-
48
- - add compiler and package definitions ([8352e66](https://github.com/expressots/shared/commit/8352e663c1a3429c70bbf7588380fe92f547e0a9))
49
- - add early ai unit test generation and code coverage ([7eb5f38](https://github.com/expressots/shared/commit/7eb5f380f6b49ce6316a9749daaa7311fda74f04))
50
- - add env and compiler modules ([f93f6c3](https://github.com/expressots/shared/commit/f93f6c3a719d1a1129112bee4e5e9cf6e42ddd89))
51
- - add global config interface ([cbe2e12](https://github.com/expressots/shared/commit/cbe2e127db006273e9049220fe3ed20b964d697b))
52
- - change to beta version ([4e835ca](https://github.com/expressots/shared/commit/4e835ca58933336bc78d66fb42935bf4d02ec641))
53
- - update readme to include badges ([5995b1a](https://github.com/expressots/shared/commit/5995b1a3eab1481aa4552ca76683c6b16ae0dc60))
54
-
55
- ### Bug Fixes
56
-
57
- - add express config file for testing ([d7ae7e1](https://github.com/expressots/shared/commit/d7ae7e1d91a73965be89a9f96df4dfdbc67575d4))
58
- - change dependency installation from npm ci to npm install in CI workflow ([6bc1ece](https://github.com/expressots/shared/commit/6bc1ece4da3c9aca717e769a8d2f615058652579))
59
- - remove compiler load lib ([c8f6085](https://github.com/expressots/shared/commit/c8f6085ffdd2af524522174789cfe51203827bbb))
60
- - reorder build and test steps in CI workflow; update Jest config to ignore specific paths ([4500863](https://github.com/expressots/shared/commit/45008637af232929c8c20df24c3cf4d6b56a082e))
61
- - update CI workflow to use npm ci for dependency installation; refine Jest configs ([356c232](https://github.com/expressots/shared/commit/356c232bbfcf6bad7254ee0ab3417fd82f831a9f))
62
- - update package.json to use exact version numbers for dependencies ([7cdd924](https://github.com/expressots/shared/commit/7cdd924b468af56ccf5bdfaa36b7cad82034e007))
63
-
64
- ### Code Refactoring
65
-
66
- - remove unused env property from ExpressoConfig interface ([97663e8](https://github.com/expressots/shared/commit/97663e8a386ece45111eba0c2f8b66d1eb9c90af))
67
-
68
- ## 0.0.1 (2023-09-05)
69
-
70
- ### Bug Fixes
71
-
35
+ ## [3.0.0-beta.3](https://github.com/expressots/shared/compare/0.3.0...0.4.0) (2024-11-28)
36
+
37
+ ### Features
38
+
39
+ - add close method to Server interface for graceful shutdown ([7d0cd8f](https://github.com/expressots/shared/commit/7d0cd8f1e05c5fed96e74b01dc715e5c7eb268d0))
40
+
41
+ ## [0.3.0](https://github.com/expressots/shared/compare/0.2.0...0.3.0) (2024-11-24)
42
+
43
+ ### Features
44
+
45
+ - add entryPoint property to ExpressoConfig interface ([324ac37](https://github.com/expressots/shared/commit/324ac37a7d407c491881998c6ed3288e04a0ae39))
46
+
47
+ ## [0.2.0](https://github.com/expressots/shared/compare/0.1.0...0.2.0) (2024-11-16)
48
+
49
+ ### Features
50
+
51
+ - add interfaces for console, middleware, and environment; update index exports ([30d7dbb](https://github.com/expressots/shared/commit/30d7dbb0c24af12e4537f626be816f2f5d8a81a0))
52
+
53
+ ### Bug Fixes
54
+
55
+ - standardize quotes in middleware interface file ([6b3f045](https://github.com/expressots/shared/commit/6b3f0459c3ba0bf58d1de920335c6ef7dd438e32))
56
+
57
+ ### Tests
58
+
59
+ - enhance coverage for configDotenv function and add edge case handling ([58612bd](https://github.com/expressots/shared/commit/58612bd0040b592133bac687cfb29b9c6ece2a94))
60
+
61
+ ## 0.1.0 (2024-11-10)
62
+
63
+ ### Features
64
+
65
+ - add compiler and package definitions ([8352e66](https://github.com/expressots/shared/commit/8352e663c1a3429c70bbf7588380fe92f547e0a9))
66
+ - add early ai unit test generation and code coverage ([7eb5f38](https://github.com/expressots/shared/commit/7eb5f380f6b49ce6316a9749daaa7311fda74f04))
67
+ - add env and compiler modules ([f93f6c3](https://github.com/expressots/shared/commit/f93f6c3a719d1a1129112bee4e5e9cf6e42ddd89))
68
+ - add global config interface ([cbe2e12](https://github.com/expressots/shared/commit/cbe2e127db006273e9049220fe3ed20b964d697b))
69
+ - change to beta version ([4e835ca](https://github.com/expressots/shared/commit/4e835ca58933336bc78d66fb42935bf4d02ec641))
70
+ - update readme to include badges ([5995b1a](https://github.com/expressots/shared/commit/5995b1a3eab1481aa4552ca76683c6b16ae0dc60))
71
+
72
+ ### Bug Fixes
73
+
74
+ - add express config file for testing ([d7ae7e1](https://github.com/expressots/shared/commit/d7ae7e1d91a73965be89a9f96df4dfdbc67575d4))
75
+ - change dependency installation from npm ci to npm install in CI workflow ([6bc1ece](https://github.com/expressots/shared/commit/6bc1ece4da3c9aca717e769a8d2f615058652579))
76
+ - remove compiler load lib ([c8f6085](https://github.com/expressots/shared/commit/c8f6085ffdd2af524522174789cfe51203827bbb))
77
+ - reorder build and test steps in CI workflow; update Jest config to ignore specific paths ([4500863](https://github.com/expressots/shared/commit/45008637af232929c8c20df24c3cf4d6b56a082e))
78
+ - update CI workflow to use npm ci for dependency installation; refine Jest configs ([356c232](https://github.com/expressots/shared/commit/356c232bbfcf6bad7254ee0ab3417fd82f831a9f))
79
+ - update package.json to use exact version numbers for dependencies ([7cdd924](https://github.com/expressots/shared/commit/7cdd924b468af56ccf5bdfaa36b7cad82034e007))
80
+
81
+ ### Code Refactoring
82
+
83
+ - remove unused env property from ExpressoConfig interface ([97663e8](https://github.com/expressots/shared/commit/97663e8a386ece45111eba0c2f8b66d1eb9c90af))
84
+
85
+ ## 0.0.1 (2023-09-05)
86
+
87
+ ### Bug Fixes
88
+
72
89
  - testing commitlint ([0e78653](https://github.com/expressots/<<repo_name>>/commit/0e786539402f69fdca3fe5b684d850e523db7698))
package/lib/README.md CHANGED
@@ -1,118 +1,51 @@
1
- <a name="readme-top"></a>
2
-
3
- <!-- PROJECT SHIELDS -->
4
-
5
- [![Codecov][codecov-shield]][codecov-url]
6
- [![NPM][npm-shield]][npm-url]
7
- ![Build][build-shield]
8
- [![Contributors][contributors-shield]][contributors-url]
9
- [![Forks][forks-shield]][forks-url]
10
- [![Stargazers][stars-shield]][stars-url]
11
- [![Issues][issues-shield]][issues-url]
12
- [![MIT License][license-shield]][license-url]
13
- [![LinkedIn][linkedin-shield]][linkedin-url]
14
-
15
- <!-- PROJECT LOGO -->
16
- <br />
17
1
  <div align="center">
18
- <a href="https://github.com/othneildrew/Best-README-Template">
19
- <img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" alt="Logo" width="120">
2
+ <a href="https://expresso-ts.com">
3
+ <img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" alt="ExpressoTS" width="120">
20
4
  </a>
21
5
 
22
- <h3 align="center">ExpressoTS Framework</h3>
23
-
24
- <p align="center">
25
- Everything you need to know to build applications with ExpressoTS
26
- <br />
27
- <a href="https://doc.expresso-ts.com/"><strong>Explore the docs »</strong></a>
28
- <br />
29
- <br />
30
- <a href="https://github.com/expressots/expressots/discussions">Let's discuss</a>
31
- ·
32
- <a href="https://github.com/expressots/expressots/issues">Report Bug</a>
33
- ·
34
- <a href="https://github.com/expressots/expressots/issues">Request Feature</a>
35
- </p>
36
- </div>
6
+ <h1>@expressots/shared</h1>
37
7
 
38
- <!-- TABLE OF CONTENTS -->
39
- <details>
40
- <summary>Table of Contents</summary>
41
- <ol>
42
- <li><a href="#about-the-project">About The Project</a></li>
43
- <li><a href="#getting-started">Getting Started</a></li>
44
- <li><a href="#contributing">Contributing</a></li>
45
- <li><a href="#support-the-project">Support the project</a></li>
46
- <li><a href="#license">License</a></li>
47
- </ol>
48
- </details>
8
+ <p>Shared types, interfaces, and utilities used across all ExpressoTS packages.</p>
49
9
 
50
- <!-- ABOUT THE PROJECT -->
51
-
52
- # About The Project
10
+ <p>
11
+ <a href="https://www.npmjs.com/package/@expressots/shared"><img src="https://img.shields.io/npm/v/@expressots/shared?style=flat&color=0d0d0d" alt="npm"></a>
12
+ <a href="https://github.com/expressots/shared/blob/main/LICENSE.md"><img src="https://img.shields.io/github/license/expressots/shared?style=flat&color=0d0d0d" alt="License"></a>
13
+ <a href="https://discord.com/invite/PyPJfGK"><img src="https://img.shields.io/badge/Discord-join-0d0d0d?logo=discord&logoColor=white" alt="Discord"></a>
14
+ </p>
53
15
 
54
- ExpressoTS is a [Typescript](https://www.typescriptlang.org/) + [Node.js](https://nodejs.org/en/) lightweight framework for quick building scalable, easy to read and maintain, server-side applications 🐎
16
+ <p>
17
+ <a href="https://doc.expresso-ts.com">Documentation</a> ·
18
+ <a href="https://doc.expresso-ts.com/docs/core/first-steps">Getting Started</a> ·
19
+ <a href="https://discord.com/invite/PyPJfGK">Community</a>
20
+ </p>
21
+ </div>
55
22
 
56
- ## Getting Started
23
+ ---
57
24
 
58
- - Here is our [Site](https://expresso-ts.com/)
59
- - You can find our [Documentation here](https://doc.expresso-ts.com/)
60
- - Checkout our [First Steps documentation](https://doc.expresso-ts.com/docs/overview/first-steps)
61
- - Our [CLI Documentation](https://doc.expresso-ts.com/docs/cli/overview)
25
+ ## Install
62
26
 
63
- ## Contributing
27
+ ```bash
28
+ npm i @expressots/shared
29
+ ```
64
30
 
65
- Welcome to the ExpressoTS community, a place bustling with innovative minds just like yours. We're absolutely thrilled to have you here!
66
- ExpressoTS is more than just a TypeScript framework; it's a collective effort by developers who are passionate about creating a more efficient, secure, and robust web ecosystem. We firmly believe that the best ideas come from a diversity of perspectives, backgrounds, and skills.
31
+ ## What This Package Does
67
32
 
68
- Why Contribute to Documentation?
33
+ This is the shared foundation layer for the ExpressoTS ecosystem. It provides common TypeScript interfaces, configuration types, environment utilities, and helper functions that `@expressots/core`, `@expressots/adapter-express`, and other packages depend on. Most applications consume it indirectly through the core package.
69
34
 
70
- - **Share Knowledge**: If you've figured out something cool, why keep it to yourself?
71
- - **Build Your Portfolio**: Contributing to an open-source project like ExpressoTS is a great way to showcase your skills.
72
- - **Join a Network**: Get to know a community of like-minded developers.
73
- - **Improve the Product**: Help us fill in the gaps, correct errors, or make complex topics easier to understand.
35
+ ## Documentation
74
36
 
75
- Ready to contribute?
37
+ For guides, API reference, architecture patterns, and examples visit **[doc.expresso-ts.com](https://doc.expresso-ts.com)**.
76
38
 
77
- - [Contributing Guidelines](https://github.com/expressots/expressots/blob/main/CONTRIBUTING.md)
78
- - [How to Contribute](https://github.com/expressots/expressots/blob/main/CONTRIBUTING_HOWTO.md)
79
- - [Coding Guidelines](https://github.com/rsaz/TypescriptCodingGuidelines)
39
+ ## Contributing
80
40
 
81
- ## Support the project
41
+ See the [Contributing Guide](https://github.com/expressots/expressots/blob/main/CONTRIBUTING.md) for how to get involved.
82
42
 
83
- ExpressoTS is an independent open source project with ongoing development made possible thanks to your support. If you'd like to help, please consider:
43
+ ## Support
84
44
 
85
- - Become a **[sponsor on GitHub](https://github.com/sponsors/expressots)**
86
- - Follow the **[organization](https://github.com/expressots)** on GitHub and Star ⭐ the project
87
- - Subscribe to the Twitch channel: **[Richard Zampieri](https://www.twitch.tv/richardzampieri)**
88
- - Join our **[Discord](https://discord.com/invite/PyPJfGK)**
89
- - Contribute submitting **[issues and pull requests](https://github.com/expressots/expressots/issues)**
90
- - Share the project with your friends and colleagues
45
+ - [GitHub Sponsors](https://github.com/sponsors/expressots)
46
+ - [Discord](https://discord.com/invite/PyPJfGK)
47
+ - [Report an Issue](https://github.com/expressots/shared/issues)
91
48
 
92
49
  ## License
93
50
 
94
- Distributed under the MIT License. See [`LICENSE.txt`](https://github.com/expressots/expressots/blob/main/LICENSE) for more information.
95
-
96
- <p align="right">(<a href="#readme-top">back to top</a>)</p>
97
-
98
- <!-- MARKDOWN LINKS & IMAGES -->
99
- <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
100
-
101
- [codecov-url]: https://codecov.io/gh/expressots/shared
102
- [codecov-shield]: https://img.shields.io/codecov/c/gh/expressots/shared/main?style=for-the-badge&logo=codecov&labelColor=FB9AD1
103
- [npm-url]: https://www.npmjs.com/package/@expressots/shared
104
- [npm-shield]: https://img.shields.io/npm/v/@expressots/shared?style=for-the-badge&logo=npm&color=9B3922
105
- [build-shield]: https://img.shields.io/github/actions/workflow/status/expressots/adapter-express/build.yaml?branch=main&style=for-the-badge&logo=github
106
- [contributors-shield]: https://img.shields.io/github/contributors/expressots/shared?style=for-the-badge
107
- [contributors-url]: https://github.com/expressots/shared/graphs/contributors
108
- [forks-shield]: https://img.shields.io/github/forks/expressots/shared?style=for-the-badge
109
- [forks-url]: https://github.com/expressots/shared/forks
110
- [stars-shield]: https://img.shields.io/github/stars/expressots/shared?style=for-the-badge
111
- [stars-url]: https://github.com/expressots/shared/stargazers
112
- [issues-shield]: https://img.shields.io/github/issues/expressots/shared?style=for-the-badge
113
- [issues-url]: https://github.com/expressots/shared/issues
114
- [license-shield]: https://img.shields.io/github/license/expressots/shared?style=for-the-badge
115
- [license-url]: https://github.com/expressots/shared/blob/main/LICENSE
116
- [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
117
- [linkedin-url]: https://www.linkedin.com/company/expresso-ts/
118
- [product-screenshot]: images/screenshot.png
51
+ MIT see [LICENSE](./LICENSE.md).
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.optionMatcher = optionMatcher;
4
- const constants_1 = require("./constants");
4
+ const constants_js_1 = require("./constants.js");
5
5
  /**
6
6
  * Matches the options passed in the command line
7
7
  * @param args - The arguments passed in the command line
@@ -9,7 +9,7 @@ const constants_1 = require("./constants");
9
9
  */
10
10
  function optionMatcher(args) {
11
11
  return args.reduce((previous, current) => {
12
- const matches = current.match(constants_1.ENV_VAR_REGEX);
12
+ const matches = current.match(constants_js_1.ENV_VAR_REGEX);
13
13
  if (matches) {
14
14
  previous[matches[1]] = matches[2];
15
15
  }
@@ -20,8 +20,8 @@ const fs_1 = __importDefault(require("fs"));
20
20
  const path_1 = __importDefault(require("path"));
21
21
  const os_1 = __importDefault(require("os"));
22
22
  const crypto_1 = __importDefault(require("crypto"));
23
- const constants_1 = require("./constants");
24
- const logger_1 = require("../utils/logger");
23
+ const constants_js_1 = require("./constants.js");
24
+ const logger_js_1 = require("../utils/logger.js");
25
25
  /**
26
26
  * Module to parse the .env.vault file
27
27
  * @param options - The configuration options
@@ -152,7 +152,7 @@ function _resolveHome(envPath) {
152
152
  * @returns The parsed object
153
153
  */
154
154
  function _configVault(options) {
155
- (0, logger_1.log)("Loading env from encrypted .env.vault");
155
+ (0, logger_js_1.log)("Loading env from encrypted .env.vault");
156
156
  const parsed = _parseVault(options);
157
157
  let processEnv = process.env;
158
158
  if (options && options.envObject != null) {
@@ -172,9 +172,9 @@ function config(options) {
172
172
  return configDotenv(options);
173
173
  }
174
174
  const vaultPath = _vaultPath(options);
175
- console.log(vaultPath);
176
175
  if (!vaultPath) {
177
- (0, logger_1.log)(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`, logger_1.LogLevel.Warn);
176
+ const expected = path_1.default.resolve(process.cwd(), ".env.vault");
177
+ (0, logger_js_1.log)(`You set DOTENV_KEY but no .env.vault file was found (expected at ${expected}). Did you forget to build it?`, logger_js_1.LogLevel.Warn);
178
178
  return configDotenv(options);
179
179
  }
180
180
  return _configVault(options);
@@ -203,7 +203,7 @@ function configDotenv(options) {
203
203
  catch (error) {
204
204
  lastError = error;
205
205
  if (debug) {
206
- (0, logger_1.log)(`Failed to load ${envPath} file with error: ${error.message}`, logger_1.LogLevel.Debug);
206
+ (0, logger_js_1.log)(`Failed to load ${envPath} file with error: ${error.message}`, logger_js_1.LogLevel.Debug);
207
207
  }
208
208
  }
209
209
  }
@@ -219,7 +219,7 @@ function parse(envFile) {
219
219
  const obj = {};
220
220
  const lines = envFile.toString().replace(/\r\n?/gm, "\n");
221
221
  let match;
222
- while ((match = constants_1.LINE_REGEX.exec(lines)) != null) {
222
+ while ((match = constants_js_1.LINE_REGEX.exec(lines)) != null) {
223
223
  const key = match[1].trim();
224
224
  let value = match[2]?.trim() ?? "";
225
225
  if (["'", '"', "`"].includes(value[0])) {
@@ -294,18 +294,18 @@ parsed, options = {}) {
294
294
  if (override) {
295
295
  envObject[key] = parsedValue;
296
296
  if (debug) {
297
- (0, logger_1.log)(`"${key}" was overwritten to "${parsedValue}"`, logger_1.LogLevel.Debug);
297
+ (0, logger_js_1.log)(`"${key}" was overwritten to "${parsedValue}"`, logger_js_1.LogLevel.Debug);
298
298
  }
299
299
  }
300
300
  else if (debug) {
301
- (0, logger_1.log)(`"${key}" was NOT overwritten (already exists)`, logger_1.LogLevel.Debug);
301
+ (0, logger_js_1.log)(`"${key}" was NOT overwritten (already exists)`, logger_js_1.LogLevel.Debug);
302
302
  }
303
303
  }
304
304
  else {
305
305
  // Variable doesn't exist in process.env, so set it
306
306
  envObject[key] = parsedValue;
307
307
  if (debug) {
308
- (0, logger_1.log)(`"${key}" was set to "${parsedValue}"`, logger_1.LogLevel.Debug);
308
+ (0, logger_js_1.log)(`"${key}" was set to "${parsedValue}"`, logger_js_1.LogLevel.Debug);
309
309
  }
310
310
  }
311
311
  }
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./environment"), exports);
17
+ __exportStar(require("./environment.js"), exports);
package/lib/cjs/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./config"), exports);
18
- __exportStar(require("./env"), exports);
19
- __exportStar(require("./interfaces"), exports);
20
- __exportStar(require("./utils"), exports);
17
+ __exportStar(require("./config/index.js"), exports);
18
+ __exportStar(require("./env/index.js"), exports);
19
+ __exportStar(require("./interfaces/index.js"), exports);
20
+ __exportStar(require("./utils/index.js"), exports);
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Env = exports.RenderEngine = void 0;
4
- var render_types_1 = require("./render/render.types");
5
- Object.defineProperty(exports, "RenderEngine", { enumerable: true, get: function () { return render_types_1.RenderEngine; } });
6
- var environment_interface_1 = require("./environment.interface");
7
- Object.defineProperty(exports, "Env", { enumerable: true, get: function () { return environment_interface_1.Env; } });
3
+ exports.RenderEngine = void 0;
4
+ var render_types_js_1 = require("./render/render.types.js");
5
+ Object.defineProperty(exports, "RenderEngine", { enumerable: true, get: function () { return render_types_js_1.RenderEngine; } });
@@ -1 +1 @@
1
- export { Pattern, ExpressoConfig } from "./project-config";
1
+ export { Pattern, ExpressoConfig } from "./project-config.js";
@@ -34,5 +34,10 @@ export interface ExpressoConfig {
34
34
  module?: string;
35
35
  provider?: string;
36
36
  middleware?: string;
37
+ interceptor?: string;
38
+ event?: string;
39
+ handler?: string;
40
+ guard?: string;
41
+ config?: string;
37
42
  };
38
43
  }
@@ -1,4 +1,4 @@
1
- import { IConfigOptions } from "./interfaces";
1
+ import { IConfigOptions } from "./interfaces.js";
2
2
  /**
3
3
  * Matches the options passed in the command line
4
4
  * @param args - The arguments passed in the command line
@@ -2,7 +2,7 @@
2
2
  * Module EnvOptions
3
3
  * Responsible for setting the options for the dotenv configuration if provided otherwise it will use the default values.
4
4
  */
5
- import { IConfigOptions } from "./interfaces";
5
+ import { IConfigOptions } from "./interfaces.js";
6
6
  /**
7
7
  * The options for the dotenv configuration.
8
8
  */
@@ -1,4 +1,4 @@
1
- import { IConfigOptions, IConfigOutput, IEnvObject } from "./interfaces";
1
+ import { IConfigOptions, IConfigOutput, IEnvObject } from "./interfaces.js";
2
2
  /**
3
3
  * Module to parse the .env.vault file
4
4
  * @param options - The configuration options
@@ -1,2 +1,2 @@
1
- export { IEnvObject, IConfigOptions, IConfigOutput } from "./interfaces";
2
- export * from "./environment";
1
+ export { IEnvObject, IConfigOptions, IConfigOutput } from "./interfaces.js";
2
+ export * from "./environment.js";