@expressots/shared 3.0.0 → 4.0.0-preview.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.
Files changed (66) hide show
  1. package/LICENSE.md +21 -21
  2. package/README.md +51 -118
  3. package/lib/CHANGELOG.md +27 -7
  4. package/lib/README.md +51 -118
  5. package/lib/cjs/config/index.js +3 -0
  6. package/lib/cjs/config/project-config.js +17 -0
  7. package/lib/cjs/env/cli-options.js +2 -2
  8. package/lib/cjs/env/environment.js +17 -17
  9. package/lib/cjs/env/index.js +1 -1
  10. package/lib/cjs/index.js +4 -4
  11. package/lib/cjs/interfaces/index.js +3 -5
  12. package/lib/cjs/types/config/index.d.ts +1 -1
  13. package/lib/cjs/types/config/project-config.d.ts +6 -1
  14. package/lib/cjs/types/env/cli-options.d.ts +1 -1
  15. package/lib/cjs/types/env/env-options.d.ts +1 -1
  16. package/lib/cjs/types/env/environment.d.ts +1 -1
  17. package/lib/cjs/types/env/index.d.ts +2 -2
  18. package/lib/cjs/types/index.d.ts +4 -4
  19. package/lib/cjs/types/interfaces/application-express.interface.d.ts +9 -4
  20. package/lib/cjs/types/interfaces/console.interface.d.ts +6 -0
  21. package/lib/cjs/types/interfaces/index.d.ts +5 -5
  22. package/lib/cjs/types/interfaces/render/render.types.d.ts +1 -1
  23. package/lib/cjs/types/utils/compiler.d.ts +1 -1
  24. package/lib/cjs/types/utils/index.d.ts +1 -1
  25. package/lib/cjs/utils/index.js +2 -2
  26. package/lib/esm/config/index.js +1 -0
  27. package/lib/esm/config/project-config.js +16 -0
  28. package/lib/esm/env/cli-options.js +15 -0
  29. package/lib/esm/env/constants.js +10 -0
  30. package/lib/esm/env/env-options.js +19 -0
  31. package/lib/esm/env/environment.js +304 -0
  32. package/lib/esm/env/index.js +1 -0
  33. package/lib/esm/env/interfaces.js +1 -0
  34. package/lib/esm/index.mjs +4 -0
  35. package/lib/esm/interfaces/application-express.interface.js +1 -0
  36. package/lib/esm/interfaces/console.interface.js +1 -0
  37. package/lib/esm/interfaces/environment.interface.js +19 -0
  38. package/lib/esm/interfaces/index.js +1 -0
  39. package/lib/esm/interfaces/middleware.interface.js +1 -0
  40. package/lib/esm/interfaces/render/ejs.types.js +2 -0
  41. package/lib/esm/interfaces/render/render.types.js +20 -0
  42. package/lib/esm/package.json +3 -0
  43. package/lib/esm/types/config/index.d.ts +1 -0
  44. package/lib/esm/types/config/project-config.d.ts +43 -0
  45. package/lib/esm/types/env/cli-options.d.ts +7 -0
  46. package/lib/esm/types/env/constants.d.ts +10 -0
  47. package/lib/esm/types/env/env-options.d.ts +9 -0
  48. package/lib/esm/types/env/environment.d.ts +83 -0
  49. package/lib/esm/types/env/index.d.ts +2 -0
  50. package/lib/esm/types/env/interfaces.d.ts +71 -0
  51. package/lib/esm/types/index.d.ts +4 -0
  52. package/lib/esm/types/interfaces/application-express.interface.d.ts +58 -0
  53. package/lib/esm/types/interfaces/console.interface.d.ts +14 -0
  54. package/lib/esm/types/interfaces/environment.interface.d.ts +37 -0
  55. package/lib/esm/types/interfaces/index.d.ts +5 -0
  56. package/lib/esm/types/interfaces/middleware.interface.d.ts +7 -0
  57. package/lib/esm/types/interfaces/render/ejs.types.d.ts +169 -0
  58. package/lib/esm/types/interfaces/render/render.types.d.ts +71 -0
  59. package/lib/esm/types/utils/compiler.d.ts +17 -0
  60. package/lib/esm/types/utils/index.d.ts +1 -0
  61. package/lib/esm/types/utils/logger.d.ts +19 -0
  62. package/lib/esm/utils/compiler.js +69 -0
  63. package/lib/esm/utils/index.js +1 -0
  64. package/lib/esm/utils/logger.js +60 -0
  65. package/lib/package.json +167 -147
  66. package/package.json +167 -147
package/LICENSE.md CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 Richard Zampieri
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) 2021 Richard Zampieri
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,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
- <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">
20
- </a>
21
-
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>
37
-
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>
49
-
50
- <!-- ABOUT THE PROJECT -->
51
-
52
- # About The Project
53
-
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 🐎
55
-
56
- ## Getting Started
57
-
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)
62
-
63
- ## Contributing
64
-
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.
67
-
68
- Why Contribute to Documentation?
69
-
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.
74
-
75
- Ready to contribute?
76
-
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)
80
-
81
- ## Support the project
82
-
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:
84
-
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
91
-
92
- ## License
93
-
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
1
+ <div align="center">
2
+ <a href="https://expresso-ts.com">
3
+ <img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" alt="ExpressoTS" width="120">
4
+ </a>
5
+
6
+ <h1>@expressots/shared</h1>
7
+
8
+ <p>Shared types, interfaces, and utilities used across all ExpressoTS packages.</p>
9
+
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>
15
+
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>
22
+
23
+ ---
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ npm i @expressots/shared
29
+ ```
30
+
31
+ ## What This Package Does
32
+
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.
34
+
35
+ ## Documentation
36
+
37
+ For guides, API reference, architecture patterns, and examples visit **[doc.expresso-ts.com](https://doc.expresso-ts.com)**.
38
+
39
+ ## Contributing
40
+
41
+ See the [Contributing Guide](https://github.com/expressots/expressots/blob/main/CONTRIBUTING.md) for how to get involved.
42
+
43
+ ## Support
44
+
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)
48
+
49
+ ## License
50
+
51
+ MIT — see [LICENSE](./LICENSE.md).
package/lib/CHANGELOG.md CHANGED
@@ -1,20 +1,40 @@
1
-
2
-
1
+ ## [4.0.0-preview.3](https://github.com/expressots/shared/compare/3.0.0...4.0.0-preview.3) (2026-05-25)
2
+
3
+ Part of the ExpressoTS **v4.0.0 preview 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.
4
+
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 (regular `enum`, not `const enum`, so consumers compiling with `isolatedModules: true` such as Vite/Vitest/esbuild/SWC can import it).
9
+ * expose shared content-negotiation primitives consumed by `@expressots/core` formatters.
10
+ * add `Env.when(condition, value, fallback)` helper for environment-specific config resolution.
11
+ * publish dual ESM + CJS builds with subpath exports for both module systems.
12
+ * declare `engines.node: ">=20.18.0"`.
13
+
14
+ ### Bug Fixes
15
+
16
+ * tighten the `IWebServer` / `IWebServerBuilder` typings so v4 adapters can declare their server contract without leaking Express types.
17
+ * `configDotenv()` is now safe to call with no arguments — null-guard added on `options.encoding` / `options.debug` (previously threw `TypeError: Cannot read properties of undefined`).
18
+
19
+ ### Build System
20
+
21
+ * bump dev toolchain to TypeScript 5.5, ESLint 8.57, Jest 29.7, Prettier 3.5.
22
+
3
23
  ## [3.0.0](https://github.com/expressots/shared/compare/3.0.0-beta.3...3.0.0) (2024-12-04)
4
24
 
5
25
 
6
26
  ### Features
7
27
 
8
28
  * refactor IWebServer interface, add IWebServerBuilder ([9a23fff](https://github.com/expressots/shared/commit/9a23fff1e7de8d3880ed90317ffde1037ef1947b))
9
- * update initEnvironment method to return a Promise for better async handling ([6ae9525](https://github.com/expressots/shared/commit/6ae9525b5497dacf81c1861e467bf6e27421ad2e))
10
-
29
+ * update initEnvironment method to return a Promise for better async handling ([6ae9525](https://github.com/expressots/shared/commit/6ae9525b5497dacf81c1861e467bf6e27421ad2e))
30
+
11
31
  ## [3.0.0](https://github.com/expressots/shared/compare/3.0.0-beta.3...3.0.0) (2024-12-03)
12
32
 
13
33
 
14
34
  ### Features
15
35
 
16
- * refactor IWebServer interface, add IWebServerBuilder ([9a23fff](https://github.com/expressots/shared/commit/9a23fff1e7de8d3880ed90317ffde1037ef1947b))
17
-
36
+ * refactor IWebServer interface, add IWebServerBuilder ([9a23fff](https://github.com/expressots/shared/commit/9a23fff1e7de8d3880ed90317ffde1037ef1947b))
37
+
18
38
  ## [3.0.0-beta.3](https://github.com/expressots/shared/compare/0.3.0...0.4.0) (2024-11-28)
19
39
 
20
40
  ### Features
@@ -69,4 +89,4 @@
69
89
 
70
90
  ### Bug Fixes
71
91
 
72
- - testing commitlint ([0e78653](https://github.com/expressots/<<repo_name>>/commit/0e786539402f69fdca3fe5b684d850e523db7698))
92
+ - 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
- <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">
20
- </a>
21
-
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>
37
-
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>
49
-
50
- <!-- ABOUT THE PROJECT -->
51
-
52
- # About The Project
53
-
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 🐎
55
-
56
- ## Getting Started
57
-
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)
62
-
63
- ## Contributing
64
-
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.
67
-
68
- Why Contribute to Documentation?
69
-
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.
74
-
75
- Ready to contribute?
76
-
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)
80
-
81
- ## Support the project
82
-
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:
84
-
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
91
-
92
- ## License
93
-
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
1
+ <div align="center">
2
+ <a href="https://expresso-ts.com">
3
+ <img src="https://github.com/expressots/expressots/blob/main/media/expressots.png" alt="ExpressoTS" width="120">
4
+ </a>
5
+
6
+ <h1>@expressots/shared</h1>
7
+
8
+ <p>Shared types, interfaces, and utilities used across all ExpressoTS packages.</p>
9
+
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>
15
+
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>
22
+
23
+ ---
24
+
25
+ ## Install
26
+
27
+ ```bash
28
+ npm i @expressots/shared
29
+ ```
30
+
31
+ ## What This Package Does
32
+
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.
34
+
35
+ ## Documentation
36
+
37
+ For guides, API reference, architecture patterns, and examples visit **[doc.expresso-ts.com](https://doc.expresso-ts.com)**.
38
+
39
+ ## Contributing
40
+
41
+ See the [Contributing Guide](https://github.com/expressots/expressots/blob/main/CONTRIBUTING.md) for how to get involved.
42
+
43
+ ## Support
44
+
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)
48
+
49
+ ## License
50
+
51
+ MIT — see [LICENSE](./LICENSE.md).
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pattern = void 0;
4
+ var project_config_js_1 = require("./project-config.js");
5
+ Object.defineProperty(exports, "Pattern", { enumerable: true, get: function () { return project_config_js_1.Pattern; } });
@@ -1,2 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Pattern = void 0;
4
+ /**
5
+ * Enum representing different string patterns.
6
+ *
7
+ * - LOWER_CASE: Represents strings in all lowercase letters. E.g. "hello"
8
+ * - KEBAB_CASE: Represents strings separated by hyphens. E.g. "hello-world"
9
+ * - PASCAL_CASE: Represents strings where the first letter of each word is capitalized. E.g. "HelloWorld"
10
+ * - CAMEL_CASE: Represents strings where the first letter of the first word is lowercase and the first letter of subsequent words are capitalized. E.g. "helloWorld"
11
+ * @public API
12
+ */
13
+ var Pattern;
14
+ (function (Pattern) {
15
+ Pattern["LOWER_CASE"] = "lowercase";
16
+ Pattern["KEBAB_CASE"] = "kebab-case";
17
+ Pattern["PASCAL_CASE"] = "PascalCase";
18
+ Pattern["CAMEL_CASE"] = "camelCase";
19
+ })(Pattern || (exports.Pattern = Pattern = {}));
@@ -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);
@@ -186,24 +186,24 @@ function config(options) {
186
186
  * @public API
187
187
  */
188
188
  function configDotenv(options) {
189
- const dotenvPath = path_1.default.resolve(process.cwd(), String(options?.path ?? ".env"));
190
- const encoding = (options.encoding ?? "utf8");
191
- const debug = !!options.debug;
192
- const paths = Array.isArray(options.path)
193
- ? options.path.map(_resolveHome)
194
- : [_resolveHome(dotenvPath)];
189
+ const opts = options ?? {};
190
+ const dotenvPath = path_1.default.resolve(process.cwd(), String(opts.path ?? ".env"));
191
+ const encoding = (opts.encoding ?? "utf8");
192
+ const debug = !!opts.debug;
193
+ const paths = Array.isArray(opts.path) ? opts.path.map(_resolveHome) : [_resolveHome(dotenvPath)];
195
194
  const parsed = {};
196
195
  let lastError;
197
196
  for (const envPath of paths) {
198
197
  try {
199
198
  const fileContent = fs_1.default.readFileSync(envPath, { encoding });
200
199
  const parsedContent = parse(fileContent);
201
- populate(process.env, parsedContent, options);
200
+ Object.assign(parsed, parsedContent);
201
+ populate(process.env, parsedContent, opts);
202
202
  }
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";