@power-plant/core 0.0.2 → 0.0.4
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/README.md +220 -0
- package/dist/create-23iLtMb_.cjs +1 -0
- package/dist/create-BR4IeVl4.mjs +2 -0
- package/dist/create-BR4IeVl4.mjs.map +1 -0
- package/dist/create-BqRl9d7m.d.cts +19 -0
- package/dist/create-BqRl9d7m.d.cts.map +1 -0
- package/dist/create-C-rR8nuY.d.mts +23 -0
- package/dist/create-C-rR8nuY.d.mts.map +1 -0
- package/dist/create-Cz9qVT4m.d.cts +23 -0
- package/dist/create-Cz9qVT4m.d.cts.map +1 -0
- package/dist/create-DAGPeYVI.d.cts +25 -0
- package/dist/create-DAGPeYVI.d.cts.map +1 -0
- package/dist/create-DEe398aQ.d.mts +25 -0
- package/dist/create-DEe398aQ.d.mts.map +1 -0
- package/dist/create-DUt-efk7.d.cts +25 -0
- package/dist/create-DUt-efk7.d.cts.map +1 -0
- package/dist/create-DcCu_zM3.d.mts +19 -0
- package/dist/create-DcCu_zM3.d.mts.map +1 -0
- package/dist/create-Qxy2mq7r.d.mts +25 -0
- package/dist/create-Qxy2mq7r.d.mts.map +1 -0
- package/dist/define-BPfeEA9Z.d.cts +14 -0
- package/dist/define-BPfeEA9Z.d.cts.map +1 -0
- package/dist/define-CQZ042K5.d.mts +14 -0
- package/dist/define-CQZ042K5.d.mts.map +1 -0
- package/dist/define-Dw8JgVQ1.d.mts +38 -0
- package/dist/define-Dw8JgVQ1.d.mts.map +1 -0
- package/dist/define-aWeW6VVo.d.cts +38 -0
- package/dist/define-aWeW6VVo.d.cts.map +1 -0
- package/dist/generator/create.cjs +1 -0
- package/dist/generator/create.d.cts +2 -0
- package/dist/generator/create.d.mts +2 -0
- package/dist/generator/create.mjs +2 -0
- package/dist/generator/create.mjs.map +1 -0
- package/dist/generator/helpers.cjs +1 -0
- package/dist/generator/helpers.d.cts +6 -0
- package/dist/generator/helpers.d.cts.map +1 -0
- package/dist/generator/helpers.d.mts +6 -0
- package/dist/generator/helpers.d.mts.map +1 -0
- package/dist/generator/helpers.mjs +2 -0
- package/dist/generator/helpers.mjs.map +1 -0
- package/dist/generator/index.cjs +1 -1
- package/dist/generator/index.d.cts +2 -20
- package/dist/generator/index.d.mts +2 -20
- package/dist/generator/index.mjs +1 -2
- package/dist/{generator-C5O_C4RV.d.cts → generator-BGkKE8HQ.d.mts} +18 -14
- package/dist/generator-BGkKE8HQ.d.mts.map +1 -0
- package/dist/{generator-DZI01B4_.d.mts → generator-Dq0PL5w6.d.cts} +18 -14
- package/dist/generator-Dq0PL5w6.d.cts.map +1 -0
- package/dist/helpers-BqnQPaP5.d.cts +13 -0
- package/dist/helpers-BqnQPaP5.d.cts.map +1 -0
- package/dist/helpers-CgXgqnVu.d.mts +13 -0
- package/dist/helpers-CgXgqnVu.d.mts.map +1 -0
- package/dist/index-BVVgDSdq.d.cts +1 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +12 -8
- package/dist/index.d.mts +12 -8
- package/dist/index.mjs +1 -1
- package/dist/schema/create.cjs +1 -0
- package/dist/schema/create.d.cts +2 -0
- package/dist/schema/create.d.mts +2 -0
- package/dist/schema/create.mjs +1 -0
- package/dist/schema/define.cjs +1 -0
- package/dist/schema/define.d.cts +2 -0
- package/dist/schema/define.d.mts +2 -0
- package/dist/schema/define.mjs +2 -0
- package/dist/schema/define.mjs.map +1 -0
- package/dist/schema/helpers.cjs +1 -0
- package/dist/schema/helpers.d.cts +2 -0
- package/dist/schema/helpers.d.mts +2 -0
- package/dist/schema/helpers.mjs +2 -0
- package/dist/schema/helpers.mjs.map +1 -0
- package/dist/schema/index.cjs +1 -0
- package/dist/schema/index.d.cts +4 -0
- package/dist/schema/index.d.mts +4 -0
- package/dist/schema/index.mjs +1 -0
- package/dist/schema-xFkmOyE6.d.cts +205 -0
- package/dist/schema-xFkmOyE6.d.cts.map +1 -0
- package/dist/schema-xFkmOyE6.d.mts +205 -0
- package/dist/schema-xFkmOyE6.d.mts.map +1 -0
- package/dist/sink/create.cjs +1 -0
- package/dist/sink/create.d.cts +2 -0
- package/dist/sink/create.d.mts +2 -0
- package/dist/sink/create.mjs +2 -0
- package/dist/sink/create.mjs.map +1 -0
- package/dist/sink/define.cjs +1 -0
- package/dist/sink/define.d.cts +37 -0
- package/dist/sink/define.d.cts.map +1 -0
- package/dist/sink/define.d.mts +37 -0
- package/dist/sink/define.d.mts.map +1 -0
- package/dist/sink/define.mjs +2 -0
- package/dist/sink/define.mjs.map +1 -0
- package/dist/sink/helpers.cjs +1 -0
- package/dist/sink/helpers.d.cts +13 -0
- package/dist/sink/helpers.d.cts.map +1 -0
- package/dist/sink/helpers.d.mts +13 -0
- package/dist/sink/helpers.d.mts.map +1 -0
- package/dist/sink/helpers.mjs +2 -0
- package/dist/sink/helpers.mjs.map +1 -0
- package/dist/sink/index.cjs +1 -1
- package/dist/sink/index.d.cts +2 -15
- package/dist/sink/index.d.mts +2 -15
- package/dist/sink/index.mjs +1 -1
- package/dist/sink-CHQncb8H.d.mts +58 -0
- package/dist/sink-CHQncb8H.d.mts.map +1 -0
- package/dist/sink-DHpx94GM.d.cts +58 -0
- package/dist/sink-DHpx94GM.d.cts.map +1 -0
- package/dist/source/create.cjs +1 -0
- package/dist/source/create.d.cts +2 -0
- package/dist/source/create.d.mts +2 -0
- package/dist/source/create.mjs +2 -0
- package/dist/source/create.mjs.map +1 -0
- package/dist/source/define.cjs +1 -0
- package/dist/source/define.d.cts +2 -0
- package/dist/source/define.d.mts +2 -0
- package/dist/source/define.mjs +2 -0
- package/dist/source/define.mjs.map +1 -0
- package/dist/source/helpers.cjs +1 -0
- package/dist/source/helpers.d.cts +13 -0
- package/dist/source/helpers.d.cts.map +1 -0
- package/dist/source/helpers.d.mts +13 -0
- package/dist/source/helpers.d.mts.map +1 -0
- package/dist/source/helpers.mjs +2 -0
- package/dist/source/helpers.mjs.map +1 -0
- package/dist/source/index.cjs +1 -1
- package/dist/source/index.d.cts +3 -16
- package/dist/source/index.d.mts +3 -16
- package/dist/source/index.mjs +1 -1
- package/dist/source-BiOs3_-8.d.mts +57 -0
- package/dist/source-BiOs3_-8.d.mts.map +1 -0
- package/dist/source-txi0ZuzR.d.cts +57 -0
- package/dist/source-txi0ZuzR.d.cts.map +1 -0
- package/package.json +187 -27
- package/dist/config.cjs +0 -0
- package/dist/config.d.cts +0 -10
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts +0 -10
- package/dist/config.d.mts.map +0 -1
- package/dist/config.mjs +0 -2
- package/dist/config.mjs.map +0 -1
- package/dist/extract-BzZLelb2.mjs +0 -2
- package/dist/extract-BzZLelb2.mjs.map +0 -1
- package/dist/extract-DUwG1ZUO.cjs +0 -1
- package/dist/extract-FkKA9g1K.cjs +0 -1
- package/dist/extract-ZIpZAKsq.mjs +0 -2
- package/dist/extract-ZIpZAKsq.mjs.map +0 -1
- package/dist/generator/index.d.cts.map +0 -1
- package/dist/generator/index.d.mts.map +0 -1
- package/dist/generator/index.mjs.map +0 -1
- package/dist/generator-C5O_C4RV.d.cts.map +0 -1
- package/dist/generator-DZI01B4_.d.mts.map +0 -1
- package/dist/sink/index.d.cts.map +0 -1
- package/dist/sink/index.d.mts.map +0 -1
- package/dist/source/index.d.cts.map +0 -1
- package/dist/source/index.d.mts.map +0 -1
- package/dist/types-B2MtSxCp.d.cts +0 -47
- package/dist/types-B2MtSxCp.d.cts.map +0 -1
- package/dist/types-B2MtSxCp.d.mts +0 -47
- package/dist/types-B2MtSxCp.d.mts.map +0 -1
- package/dist/types-DJo-IRmS.d.cts +0 -47
- package/dist/types-DJo-IRmS.d.cts.map +0 -1
- package/dist/types-DJo-IRmS.d.mts +0 -47
- package/dist/types-DJo-IRmS.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -1,4 +1,59 @@
|
|
|
1
1
|
<!-- START header -->
|
|
2
|
+
<!-- prettier-ignore-start -->
|
|
3
|
+
<!-- markdownlint-disable -->
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<div align="center">
|
|
7
|
+
<picture>
|
|
8
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/power-plant/media/banner-1280x640-dark.gif">
|
|
9
|
+
<source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/power-plant/media/banner-1280x640-light.gif">
|
|
10
|
+
<img src="https://public.storm-cdn.com/power-plant/media/banner-1280x640-dark.gif" width="100%" alt="Storm Software" />
|
|
11
|
+
</picture>
|
|
12
|
+
</div>
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
<div align="center">
|
|
16
|
+
<b>
|
|
17
|
+
<a href="https://stormsoftware.com" target="_blank">Website</a> •
|
|
18
|
+
<a href="https://github.com/storm-software/power-plant" target="_blank">GitHub</a> •
|
|
19
|
+
<a href="https://discord.gg/MQ6YVzakM5">Discord</a> • <a href="https://docs.stormsoftware.com/projects/power-plant/" target="_blank">Docs</a> • <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> •
|
|
20
|
+
<a href="https://github.com/storm-software/power-plant/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a>
|
|
21
|
+
</b>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<br />
|
|
25
|
+
|
|
26
|
+
**☢️ Power Plant** is a collection of TypeScript packages and stand-alone developer tools that center on a single, simple concept: **generate anything from a specification**. The goal of Power Plant is to make it easy for developers to generate code, documentation, and other artifacts from a specification, without having to write any boilerplate code themselves.
|
|
27
|
+
|
|
28
|
+
In the background, Power Plant will also gather metadata about the repository and provide it to LLMs and various other tools. **This allows our favorite AI models to understand more than just the source code, but also its context, the reason why it exists, and its intended usage.**
|
|
29
|
+
|
|
30
|
+
The Power Plant monorepo is a collection of packages that are designed to work together, but in many cases can also be used independently.
|
|
31
|
+
|
|
32
|
+
<br />
|
|
33
|
+
|
|
34
|
+
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
35
|
+
|
|
36
|
+
[](https://docs.stormsoftware.com/projects/power-plant) [](http://commitizen.github.io/cz-cli/)  
|
|
37
|
+
|
|
38
|
+
<!-- prettier-ignore-start -->
|
|
39
|
+
<!-- markdownlint-disable -->
|
|
40
|
+
|
|
41
|
+
> [!IMPORTANT]
|
|
42
|
+
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be available through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
|
|
43
|
+
|
|
44
|
+
<!-- markdownlint-restore -->
|
|
45
|
+
<!-- prettier-ignore-end -->
|
|
46
|
+
|
|
47
|
+
<div align="center">
|
|
48
|
+
<a href="https://github.com/storm-software/power-plant" target="_blank">
|
|
49
|
+
<b>Be sure to ⭐ this repository on GitHub so you can keep up to date on any daily progress!</b>
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<br />
|
|
54
|
+
|
|
55
|
+
<!-- markdownlint-restore -->
|
|
56
|
+
<!-- prettier-ignore-end -->
|
|
2
57
|
|
|
3
58
|
<!-- END header -->
|
|
4
59
|
|
|
@@ -41,5 +96,170 @@ Run `nx build core` to build the library.
|
|
|
41
96
|
Run `nx test core` to execute the unit tests via [Vitest](https://vitest.dev/).
|
|
42
97
|
|
|
43
98
|
<!-- START footer -->
|
|
99
|
+
<!-- prettier-ignore-start -->
|
|
100
|
+
<!-- markdownlint-disable -->
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Storm Workspaces
|
|
104
|
+
|
|
105
|
+
Storm workspaces are built using
|
|
106
|
+
<a href="https://nx.dev/" target="_blank">Nx</a>, a set of extensible dev tools
|
|
107
|
+
for monorepos, which helps you develop like Google, Facebook, and Microsoft.
|
|
108
|
+
Building on top of Nx, the Open System provides a set of tools and patterns that
|
|
109
|
+
help you scale your monorepo to many teams while keeping the codebase
|
|
110
|
+
maintainable.
|
|
111
|
+
|
|
112
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
113
|
+
|
|
114
|
+
## Roadmap
|
|
115
|
+
|
|
116
|
+
See the [open issues](https://github.com/storm-software/power-plant/issues) for
|
|
117
|
+
a list of proposed features (and known issues).
|
|
118
|
+
|
|
119
|
+
- [Top Feature Requests](https://github.com/storm-software/power-plant/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc)
|
|
120
|
+
(Add your votes using the 👍 reaction)
|
|
121
|
+
- [Top Bugs](https://github.com/storm-software/power-plant/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc)
|
|
122
|
+
(Add your votes using the 👍 reaction)
|
|
123
|
+
- [Newest Bugs](https://github.com/storm-software/power-plant/issues?q=is%3Aopen+is%3Aissue+label%3Abug)
|
|
124
|
+
|
|
125
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
126
|
+
|
|
127
|
+
## Support
|
|
128
|
+
|
|
129
|
+
Reach out to the maintainer at one of the following places:
|
|
130
|
+
|
|
131
|
+
- [Contact](https://stormsoftware.com/contact)
|
|
132
|
+
- [GitHub discussions](https://github.com/storm-software/power-plant/discussions)
|
|
133
|
+
- <support@stormsoftware.com>
|
|
134
|
+
|
|
135
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
This project is licensed under the **Apache License 2.0**. Feel free to edit and
|
|
140
|
+
distribute this template as you like.
|
|
141
|
+
|
|
142
|
+
See [LICENSE](LICENSE) for more information.
|
|
143
|
+
|
|
144
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
145
|
+
|
|
146
|
+
## Changelog
|
|
147
|
+
|
|
148
|
+
This project adheres to
|
|
149
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). Every release, along
|
|
150
|
+
with the migration instructions, is documented in the [CHANGELOG](CHANGELOG.md)
|
|
151
|
+
file
|
|
152
|
+
|
|
153
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
154
|
+
|
|
155
|
+
## Contributing
|
|
156
|
+
|
|
157
|
+
First off, thanks for taking the time to contribute! Contributions are what
|
|
158
|
+
makes the open-source community such an amazing place to learn, inspire, and
|
|
159
|
+
create. Any contributions you make will benefit everybody else and are **greatly
|
|
160
|
+
appreciated**.
|
|
161
|
+
|
|
162
|
+
Please try to create bug reports that are:
|
|
163
|
+
|
|
164
|
+
- _Reproducible._ Include steps to reproduce the problem.
|
|
165
|
+
- _Specific._ Include as much detail as possible: which version, what
|
|
166
|
+
environment, etc.
|
|
167
|
+
- _Unique._ Do not duplicate existing opened issues.
|
|
168
|
+
- _Scoped to a Single Bug._ One bug per report.
|
|
169
|
+
|
|
170
|
+
Please adhere to this project's [code of conduct](.github/CODE_OF_CONDUCT.md).
|
|
171
|
+
|
|
172
|
+
You can use
|
|
173
|
+
[markdownlint-cli](https://github.com/storm-software/power-plant/markdownlint-cli)
|
|
174
|
+
to check for common markdown style inconsistency.
|
|
175
|
+
|
|
176
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
177
|
+
|
|
178
|
+
## Contributors
|
|
179
|
+
|
|
180
|
+
Thanks goes to these wonderful people
|
|
181
|
+
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
182
|
+
|
|
183
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
184
|
+
|
|
185
|
+
<table>
|
|
186
|
+
<tbody>
|
|
187
|
+
<tr>
|
|
188
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.sullypat.com/"><img src="https://avatars.githubusercontent.com/u/99053093?v=4?s=100" width="100px;" alt="Patrick Sullivan"/><br /><sub><b>Patrick Sullivan</b></sub></a><br /><a href="#design-sullivanpj" title="Design">🎨</a> <a href="https://github.com/storm-software/power-plant/commits?author=sullivanpj" title="Code">💻</a> <a href="#tool-sullivanpj" title="Tools">🔧</a> <a href="https://github.com/storm-software/power-plant/commits?author=sullivanpj" title="Documentation">📖</a> <a href="https://github.com/storm-software/power-plant/commits?author=sullivanpj" title="Tests">⚠️</a></td>
|
|
189
|
+
<td align="center" valign="top" width="14.28%"><a href="https://tylerbenning.com/"><img src="https://avatars.githubusercontent.com/u/7265547?v=4?s=100" width="100px;" alt="Tyler Benning"/><br /><sub><b>Tyler Benning</b></sub></a><br /><a href="#design-tbenning" title="Design">🎨</a></td>
|
|
190
|
+
<td align="center" valign="top" width="14.28%"><a href="http://stormsoftware.com"><img src="https://avatars.githubusercontent.com/u/149802440?v=4?s=100" width="100px;" alt="Stormie"/><br /><sub><b>Stormie</b></sub></a><br /><a href="#maintenance-stormie-bot" title="Maintenance">🚧</a></td>
|
|
191
|
+
</tr>
|
|
192
|
+
</tbody>
|
|
193
|
+
<tfoot>
|
|
194
|
+
<tr>
|
|
195
|
+
<td align="center" size="13px" colspan="7">
|
|
196
|
+
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg" alt="All Contributors">
|
|
197
|
+
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
|
|
198
|
+
</img>
|
|
199
|
+
</td>
|
|
200
|
+
</tr>
|
|
201
|
+
</tfoot>
|
|
202
|
+
</table>
|
|
203
|
+
|
|
204
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
205
|
+
|
|
206
|
+
This project follows the
|
|
207
|
+
[all-contributors](https://github.com/all-contributors/all-contributors)
|
|
208
|
+
specification. Contributions of any kind welcome!
|
|
209
|
+
|
|
210
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
211
|
+
<br />
|
|
212
|
+
|
|
213
|
+
<hr />
|
|
214
|
+
<br />
|
|
215
|
+
|
|
216
|
+
<div align="center">
|
|
217
|
+
<picture>
|
|
218
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/media/banner-1280x320-dark.webp">
|
|
219
|
+
<source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/media/banner-1280x320-light.webp">
|
|
220
|
+
<img src="https://public.storm-cdn.com/storm-software/media/banner-1280x320-dark.webp" width="100%" alt="Storm Software" />
|
|
221
|
+
</picture>
|
|
222
|
+
</div>
|
|
223
|
+
<br />
|
|
224
|
+
|
|
225
|
+
<div align="center">
|
|
226
|
+
<a href="https://stormsoftware.com" target="_blank">Website</a> • <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> • <a href="https://linkedin.com/in/patrick-sullivan-865526b0" target="_blank">LinkedIn</a> • <a href="https://medium.com/@pat.joseph.sullivan" target="_blank">Medium</a> • <a href="https://github.com/storm-software" target="_blank">GitHub</a> • <a href="https://keybase.io/sullivanp" target="_blank">OpenPGP Key</a>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<div align="center">
|
|
230
|
+
<b>Fingerprint:</b> 1BD2 7192 7770 2549 F4C9 F238 E6AD C420 DA5C 4C2D
|
|
231
|
+
</div>
|
|
232
|
+
<br />
|
|
233
|
+
|
|
234
|
+
Storm Software is an open source software development organization and creator
|
|
235
|
+
of Acidic, StormStack and StormCloud.
|
|
236
|
+
|
|
237
|
+
Our mission is to make software development more accessible. Our ideal future is
|
|
238
|
+
one where anyone can create software without years of prior development
|
|
239
|
+
experience serving as a barrier to entry. We hope to achieve this via LLMs,
|
|
240
|
+
Generative AI, and intuitive, high-level data modeling/programming languages.
|
|
241
|
+
|
|
242
|
+
Join us on [Discord](https://discord.gg/MQ6YVzakM5) to chat with the team,
|
|
243
|
+
receive release notifications, ask questions, and get involved.
|
|
244
|
+
|
|
245
|
+
If this sounds interesting, and you would like to help us in creating the next
|
|
246
|
+
generation of development tools, please reach out on our
|
|
247
|
+
[website](https://stormsoftware.com/contact) or join our
|
|
248
|
+
[Slack channel](https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA)!
|
|
249
|
+
|
|
250
|
+
<br />
|
|
251
|
+
|
|
252
|
+
<div align="center"><a href="https://stormsoftware.com" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/storm-software/icons/circle-dark.webp"><source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/storm-software/icons/circle-light.webp"><img src="https://public.storm-cdn.com/storm-software/icons/circle-dark.webp" width="200px" alt="Storm Software" /></picture></a></div>
|
|
253
|
+
<br />
|
|
254
|
+
<div align="center"><a href="https://stormsoftware.com" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/misc/text/visit-us-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/misc/text/visit-us-light.png"><img src="https://public.storm-cdn.com/misc/text/visit-us-dark.png" height="90px" alt="Visit us at stormsoftware.com" /></picture></a></div>
|
|
255
|
+
<br />
|
|
256
|
+
|
|
257
|
+
<div align="right">[ <a href="#table-of-contents">Back to top ▲</a> ]</div>
|
|
258
|
+
<br />
|
|
259
|
+
<br />
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
<!-- markdownlint-restore -->
|
|
263
|
+
<!-- prettier-ignore-end -->
|
|
44
264
|
|
|
45
265
|
<!-- END footer -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./schema/helpers.cjs");let t=require("@stryke/type-checks/is-function"),n=require("@power-plant/schema/extract"),r=require("@power-plant/schema/codegen"),i=require("@power-plant/schema/type-checks"),a=require("@stryke/convert/to-array"),o=require("@stryke/helpers/get-unique"),s=require("@stryke/string-format/kebab-case"),c=require("@stryke/string-format/title-case"),l=require("@stryke/type-checks/is-date"),u=require("@stryke/type-checks/is-number"),d=require("@stryke/type-checks/is-set-object"),f=require("@stryke/type-checks/is-set-string");function p(e,t){let n=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,`0`),i=String(e.getDate()).padStart(2,`0`),a=t?.separator??`-`;return`${n}${a}${r}${a}${i}`}function m(e){return Number.isInteger(e)&&e>=0}Array.from({length:26},(e,t)=>String.fromCodePoint(t+97));function h(e){if(e===null)throw TypeError(`array cannot be null`);for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256);return e}function g(e=21){return h(new Uint8Array(e)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``)}function _(e){return(0,l.isDate)(e)?p(e):(0,u.isNumber)(e)?m(e)&&e>1e9?p(new Date(e)):e.toString():(0,f.isSetString)(e)?e:`1.0`}function v(e,n,r){let i=r??n?.version??e?.version;return(0,t.isFunction)(i)?async(e,t)=>_(await Promise.resolve(i(e,t))):_(i)}function y(e,t,n){return n??t.name??((0,f.isSetString)(e?.name)?e.name:(0,f.isSetString)(e?.title)?e.title:e.$id?(0,s.kebabCase)(e.$id):(0,r.stringifyType)(e))}function b(e,n){let r=y(e,n),i=v(e,n);return r?(0,t.isFunction)(r)?(0,t.isFunction)(i)?async(e,t)=>`${(0,s.kebabCase)(await Promise.resolve(r(e,t)))}@${await Promise.resolve(i(e,t))}`:async(e,t)=>`${(0,s.kebabCase)(await Promise.resolve(r(e,t)))}@${i}`:(0,t.isFunction)(i)?async(e,t)=>`${(0,s.kebabCase)(r)}@${await Promise.resolve(i(e,t))}`:`${(0,s.kebabCase)(r)}@${i}`:g()}function x(e,n,i){let a=i??n.title??e?.title;if(a!==void 0)return a;let o=n.name;return(0,t.isFunction)(o)?async(e,t)=>(0,c.titleCase)(await Promise.resolve(o(e,t))):(0,c.titleCase)(o??(0,r.stringifyType)(e))}function S(e,n,r,i){r.title??=x(n,r);let a=r.title,o=(0,t.isFunction)(a)?async(n,r)=>(0,t.isFunction)(e)?(await Promise.resolve(e(n,r))).replaceAll(/\{\s*title\s*\}/g,await Promise.resolve(a(n,r))):e.replaceAll(/\{\s*title\s*\}/g,await Promise.resolve(a(n,r))):(0,t.isFunction)(e)?async(t,n)=>(await Promise.resolve(e(t,n))).replaceAll(/\{\s*title\s*\}/g,await Promise.resolve(a)):e.replaceAll(/\{\s*title\s*\}/g,a),s=i??r.description??n?.description;if((0,t.isFunction)(s)){let e=s;return async(n,r)=>{let i=await Promise.resolve(e(n,r));return(0,f.isSetString)(i)?i:(0,t.isFunction)(o)?Promise.resolve(o(n,r)):Promise.resolve(o)}}return(0,f.isSetString)(s)?s:o}function C(e,n,r){let i=e=>e.map((e,t)=>(0,f.isSetString)(e)?{name:`example-${t+1}`,description:`Example Specification #${t+1}`,value:e}:(0,d.isSetObject)(e)&&`value`in e&&(0,f.isSetString)(e.value)?{name:`example-${t+1}`,description:e.description||`Example Specification #${t+1}`,value:e.value}:void 0).filter(Boolean),o=r??n.examples??e?.examples??[];return(0,t.isFunction)(o)?async(e,t)=>i((0,a.toArray)(await Promise.resolve(o(e,t)))):i((0,a.toArray)(o))}function w(e,n,r){return(0,t.isFunction)(r)||(0,t.isFunction)(n.links)?async(i,s)=>(0,o.getUnique)((0,a.toArray)((0,t.isFunction)(r)?await Promise.resolve(r(i,s)):r).concat((0,t.isFunction)(n.links)?await Promise.resolve(n.links(i,s)):n.links??[]).concat(e?.docs??[])):(0,o.getUnique)((0,a.toArray)(r).concat(n.links??[]).concat(e?.docs??[]))}function T(e,t){let n=(0,i.isSchemaOf)(e)?e:e??{schema:{}},r={};return r.name=y(n?.schema,r,t?.name),r.version=v(n?.schema,r,t?.version),r.id=b(n?.schema,r),r.title=x(n?.schema,r,t?.title),r.links=w(n?.schema,r,t?.links),t?.deprecated&&(r.deprecated=t?.deprecated),t?.usage&&(r.usage=t?.usage),t?.tags&&(r.tags=t?.tags),r}function E(e,n){let r=e?.schema??{},i=T(e,n);return i.description=S((0,t.isFunction)(i.title)?async(e,t)=>`Accepts a ${await Promise.resolve(i.title(e,t))??``} specification and processes it with a {title} sink.`:`Accepts a ${i.title??``} specification and processes it with a {title} sink.`,r,i,n?.description),i.examples=C(r,i,n?.examples),i}async function D(t,r={}){let{meta:i,schema:a}=e.isSchemaInputObject(t)?t:{schema:t,meta:{}},o=await(0,n.extractSchemaWithSource)(a,r);return{...o,meta:E(o,i)}}Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isSchemaInputObject as e}from"./schema/helpers.mjs";import{isFunction as t}from"@stryke/type-checks/is-function";import{extractSchemaWithSource as n}from"@power-plant/schema/extract";import{stringifyType as r}from"@power-plant/schema/codegen";import{isSchemaOf as i}from"@power-plant/schema/type-checks";import{toArray as a}from"@stryke/convert/to-array";import{getUnique as o}from"@stryke/helpers/get-unique";import{kebabCase as s}from"@stryke/string-format/kebab-case";import{titleCase as c}from"@stryke/string-format/title-case";import{isDate as l}from"@stryke/type-checks/is-date";import{isNumber as u}from"@stryke/type-checks/is-number";import{isSetObject as d}from"@stryke/type-checks/is-set-object";import{isSetString as f}from"@stryke/type-checks/is-set-string";function p(e,t){let n=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,`0`),i=String(e.getDate()).padStart(2,`0`),a=t?.separator??`-`;return`${n}${a}${r}${a}${i}`}function m(e){return Number.isInteger(e)&&e>=0}Array.from({length:26},(e,t)=>String.fromCodePoint(t+97));function h(e){if(e===null)throw TypeError(`array cannot be null`);for(let t=0;t<e.length;t++)e[t]=Math.floor(Math.random()*256);return e}function g(e=21){return h(new Uint8Array(e)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``)}function _(e){return l(e)?p(e):u(e)?m(e)&&e>1e9?p(new Date(e)):e.toString():f(e)?e:`1.0`}function v(e,n,r){let i=r??n?.version??e?.version;return t(i)?async(e,t)=>_(await Promise.resolve(i(e,t))):_(i)}function y(e,t,n){return n??t.name??(f(e?.name)?e.name:f(e?.title)?e.title:e.$id?s(e.$id):r(e))}function b(e,n){let r=y(e,n),i=v(e,n);return r?t(r)?t(i)?async(e,t)=>`${s(await Promise.resolve(r(e,t)))}@${await Promise.resolve(i(e,t))}`:async(e,t)=>`${s(await Promise.resolve(r(e,t)))}@${i}`:t(i)?async(e,t)=>`${s(r)}@${await Promise.resolve(i(e,t))}`:`${s(r)}@${i}`:g()}function x(e,n,i){let a=i??n.title??e?.title;if(a!==void 0)return a;let o=n.name;return t(o)?async(e,t)=>c(await Promise.resolve(o(e,t))):c(o??r(e))}function S(e,n,r,i){r.title??=x(n,r);let a=r.title,o=t(a)?async(n,r)=>t(e)?(await Promise.resolve(e(n,r))).replaceAll(/\{\s*title\s*\}/g,await Promise.resolve(a(n,r))):e.replaceAll(/\{\s*title\s*\}/g,await Promise.resolve(a(n,r))):t(e)?async(t,n)=>(await Promise.resolve(e(t,n))).replaceAll(/\{\s*title\s*\}/g,await Promise.resolve(a)):e.replaceAll(/\{\s*title\s*\}/g,a),s=i??r.description??n?.description;if(t(s)){let e=s;return async(n,r)=>{let i=await Promise.resolve(e(n,r));return f(i)?i:t(o)?Promise.resolve(o(n,r)):Promise.resolve(o)}}return f(s)?s:o}function C(e,n,r){let i=e=>e.map((e,t)=>f(e)?{name:`example-${t+1}`,description:`Example Specification #${t+1}`,value:e}:d(e)&&`value`in e&&f(e.value)?{name:`example-${t+1}`,description:e.description||`Example Specification #${t+1}`,value:e.value}:void 0).filter(Boolean),o=r??n.examples??e?.examples??[];return t(o)?async(e,t)=>i(a(await Promise.resolve(o(e,t)))):i(a(o))}function w(e,n,r){return t(r)||t(n.links)?async(i,s)=>o(a(t(r)?await Promise.resolve(r(i,s)):r).concat(t(n.links)?await Promise.resolve(n.links(i,s)):n.links??[]).concat(e?.docs??[])):o(a(r).concat(n.links??[]).concat(e?.docs??[]))}function T(e,t){let n=i(e)?e:e??{schema:{}},r={};return r.name=y(n?.schema,r,t?.name),r.version=v(n?.schema,r,t?.version),r.id=b(n?.schema,r),r.title=x(n?.schema,r,t?.title),r.links=w(n?.schema,r,t?.links),t?.deprecated&&(r.deprecated=t?.deprecated),t?.usage&&(r.usage=t?.usage),t?.tags&&(r.tags=t?.tags),r}function E(e,n){let r=e?.schema??{},i=T(e,n);return i.description=S(t(i.title)?async(e,t)=>`Accepts a ${await Promise.resolve(i.title(e,t))??``} specification and processes it with a {title} sink.`:`Accepts a ${i.title??``} specification and processes it with a {title} sink.`,r,i,n?.description),i.examples=C(r,i,n?.examples),i}async function D(t,r={}){let{meta:i,schema:a}=e(t)?t:{schema:t,meta:{}},o=await n(a,r);return{...o,meta:E(o,i)}}export{S as i,E as n,T as r,D as t};
|
|
2
|
+
//# sourceMappingURL=create-BR4IeVl4.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-BR4IeVl4.mjs","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { a as InferCreateGeneratorOptions, n as GeneratorInput, t as Generator } from "./generator-Dq0PL5w6.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/generator/create.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a generator from raw schema/source/sink inputs and resolves all descriptors.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This function is used to create a generator from raw schema, source, and sink inputs. It resolves all descriptors and returns a fully constructed generator that can be used to generate output based on the provided schema and options.
|
|
9
|
+
*
|
|
10
|
+
* @template TSpec - The type of the specification that the generator will produce.
|
|
11
|
+
* @template TOptions - The type of the options that will be passed to the generator during generation.
|
|
12
|
+
* @param input - The generator input containing schema, source, sink, and optional meta information.
|
|
13
|
+
* @param options - Optional extraction options for schema, source, and sink.
|
|
14
|
+
* @returns A promise that resolves to a fully constructed generator.
|
|
15
|
+
*/
|
|
16
|
+
declare function createGenerator<TSpec, TOptions extends object, TReturns = void>(input: GeneratorInput<TSpec, TOptions, TReturns>, options?: InferCreateGeneratorOptions<typeof input>): Promise<Generator<TSpec, TOptions, TReturns>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { createGenerator as t };
|
|
19
|
+
//# sourceMappingURL=create-BqRl9d7m.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-BqRl9d7m.d.cts","names":[],"sources":["../src/generator/create.ts"],"mappings":";;;;;AA4CA;;;;;;;;;;iBAAsB,eAAA,kDAKpB,KAAA,EAAO,cAAA,CAAe,KAAA,EAAO,QAAA,EAAU,QAAA,GACvC,OAAA,GAAS,2BAAA,QAAmC,KAAA,IAC3C,OAAA,CAAQ,SAAA,CAAU,KAAA,EAAO,QAAA,EAAU,QAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { i as SchemaMeta, o as SchemaMetaInput, r as SchemaInputObject, s as SchemaOf, t as InferCreateSchemaOptions } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
import { ExtractedSchemaEnvelope, SchemaEnvelopeOf, SchemaSourceInput } from "@power-plant/schema/types";
|
|
3
|
+
|
|
4
|
+
//#region src/schema/create.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Extracts and normalizes {@link SchemaMeta | schema metadata} from a given {@link SchemaMetaInput}. This function ensures that the metadata is in a consistent format, converting version numbers to strings and filtering out any invalid or empty tags.
|
|
7
|
+
*
|
|
8
|
+
* @param schema - The schema from which to extract metadata.
|
|
9
|
+
* @param input - The schema metadata input to extract and normalize.
|
|
10
|
+
* @returns The normalized schema metadata.
|
|
11
|
+
*/
|
|
12
|
+
declare function extractSchemaMeta<TSpec, TOptions extends object>(schema: ExtractedSchemaEnvelope<TSpec>, input?: SchemaMetaInput<TSpec, TOptions>): SchemaMeta<TSpec, TOptions>;
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes any accepted schema input into a concrete schema descriptor.
|
|
15
|
+
*
|
|
16
|
+
* @param input - The schema input to normalize.
|
|
17
|
+
* @param options - Optional options for resolving the schema input.
|
|
18
|
+
* @returns A promise that resolves to a normalized schema descriptor.
|
|
19
|
+
*/
|
|
20
|
+
declare function createSchema<TSpec, TOptions extends object>(input: SchemaSourceInput<TSpec> | SchemaEnvelopeOf<TSpec> | SchemaInputObject<TSpec, TOptions>, options?: InferCreateSchemaOptions<typeof input>): Promise<SchemaOf<TSpec, TOptions>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { extractSchemaMeta as n, createSchema as t };
|
|
23
|
+
//# sourceMappingURL=create-C-rR8nuY.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-C-rR8nuY.d.mts","names":[],"sources":["../src/schema/create.ts"],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { i as SchemaMeta, o as SchemaMetaInput, r as SchemaInputObject, s as SchemaOf, t as InferCreateSchemaOptions } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
import { ExtractedSchemaEnvelope, SchemaEnvelopeOf, SchemaSourceInput } from "@power-plant/schema/types";
|
|
3
|
+
|
|
4
|
+
//#region src/schema/create.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Extracts and normalizes {@link SchemaMeta | schema metadata} from a given {@link SchemaMetaInput}. This function ensures that the metadata is in a consistent format, converting version numbers to strings and filtering out any invalid or empty tags.
|
|
7
|
+
*
|
|
8
|
+
* @param schema - The schema from which to extract metadata.
|
|
9
|
+
* @param input - The schema metadata input to extract and normalize.
|
|
10
|
+
* @returns The normalized schema metadata.
|
|
11
|
+
*/
|
|
12
|
+
declare function extractSchemaMeta<TSpec, TOptions extends object>(schema: ExtractedSchemaEnvelope<TSpec>, input?: SchemaMetaInput<TSpec, TOptions>): SchemaMeta<TSpec, TOptions>;
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes any accepted schema input into a concrete schema descriptor.
|
|
15
|
+
*
|
|
16
|
+
* @param input - The schema input to normalize.
|
|
17
|
+
* @param options - Optional options for resolving the schema input.
|
|
18
|
+
* @returns A promise that resolves to a normalized schema descriptor.
|
|
19
|
+
*/
|
|
20
|
+
declare function createSchema<TSpec, TOptions extends object>(input: SchemaSourceInput<TSpec> | SchemaEnvelopeOf<TSpec> | SchemaInputObject<TSpec, TOptions>, options?: InferCreateSchemaOptions<typeof input>): Promise<SchemaOf<TSpec, TOptions>>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { extractSchemaMeta as n, createSchema as t };
|
|
23
|
+
//# sourceMappingURL=create-Cz9qVT4m.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-Cz9qVT4m.d.cts","names":[],"sources":["../src/schema/create.ts"],"mappings":";;;;;;AA8CA;;;;;iBAAgB,iBAAA,iCACd,MAAA,EAAQ,uBAAA,CAAwB,KAAA,GAChC,KAAA,GAAQ,eAAA,CAAgB,KAAA,EAAO,QAAA,IAC9B,UAAA,CAAW,KAAA,EAAO,QAAA;;;;;;;;iBAoCC,YAAA,iCACpB,KAAA,EACI,iBAAA,CAAkB,KAAA,IAClB,gBAAA,CAAiB,KAAA,IACjB,iBAAA,CAAkB,KAAA,EAAO,QAAA,GAC7B,OAAA,GAAS,wBAAA,QAAgC,KAAA,IACxC,OAAA,CAAQ,QAAA,CAAS,KAAA,EAAO,QAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { s as SchemaOf } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
import { i as SinkInput, n as Sink, o as SinkMeta, s as SinkMetaInput, t as InferCreateSinkOptions } from "./sink-DHpx94GM.cjs";
|
|
3
|
+
import { ExtractedSchemaEnvelope } from "@power-plant/schema/types";
|
|
4
|
+
|
|
5
|
+
//#region src/sink/create.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Extracts and normalizes {@link SinkMeta | sink metadata} from a given {@link SinkMetaInput}. This function ensures that the metadata is in a consistent format, converting version numbers to strings and filtering out any invalid or empty tags.
|
|
8
|
+
*
|
|
9
|
+
* @param schema - The schema that the sink input is expected to conform to.
|
|
10
|
+
* @param input - The sink metadata input to extract and normalize.
|
|
11
|
+
* @returns The normalized sink metadata.
|
|
12
|
+
*/
|
|
13
|
+
declare function extractSinkMeta<TSpec, TOptions extends object>(schema: ExtractedSchemaEnvelope<TSpec> | SchemaOf<TSpec, TOptions>, input?: SinkMetaInput<TSpec, TOptions>): SinkMeta<TSpec, TOptions>;
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes any accepted sink input into a concrete sink descriptor.
|
|
16
|
+
*
|
|
17
|
+
* @param schema - The schema that the sink input is expected to conform to.
|
|
18
|
+
* @param input - The sink input to normalize.
|
|
19
|
+
* @param options - Optional options for resolving the sink input.
|
|
20
|
+
* @returns A promise that resolves to a normalized sink descriptor.
|
|
21
|
+
*/
|
|
22
|
+
declare function createSink<TSpec, TOptions extends object, TReturns = void>(schema: SchemaOf<TSpec, TOptions>, input: SinkInput<TSpec, TOptions, TReturns>, options?: InferCreateSinkOptions<typeof input>): Promise<Sink<TSpec, TOptions, TReturns>>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { extractSinkMeta as n, createSink as t };
|
|
25
|
+
//# sourceMappingURL=create-DAGPeYVI.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-DAGPeYVI.d.cts","names":[],"sources":["../src/sink/create.ts"],"mappings":";;;;;;;AA2CA;;;;;iBAAgB,eAAA,iCACd,MAAA,EAAQ,uBAAA,CAAwB,KAAA,IAAS,QAAA,CAAS,KAAA,EAAO,QAAA,GACzD,KAAA,GAAQ,aAAA,CAAc,KAAA,EAAO,QAAA,IAC5B,QAAA,CAAS,KAAA,EAAO,QAAA;;;;;;;;;iBAoCG,UAAA,kDAKpB,MAAA,EAAQ,QAAA,CAAS,KAAA,EAAO,QAAA,GACxB,KAAA,EAAO,SAAA,CAAU,KAAA,EAAO,QAAA,EAAU,QAAA,GAClC,OAAA,GAAS,sBAAA,QAA8B,KAAA,IACtC,OAAA,CAAQ,IAAA,CAAK,KAAA,EAAO,QAAA,EAAU,QAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { s as SchemaOf } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
import { i as SinkInput, n as Sink, o as SinkMeta, s as SinkMetaInput, t as InferCreateSinkOptions } from "./sink-CHQncb8H.mjs";
|
|
3
|
+
import { ExtractedSchemaEnvelope } from "@power-plant/schema/types";
|
|
4
|
+
|
|
5
|
+
//#region src/sink/create.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Extracts and normalizes {@link SinkMeta | sink metadata} from a given {@link SinkMetaInput}. This function ensures that the metadata is in a consistent format, converting version numbers to strings and filtering out any invalid or empty tags.
|
|
8
|
+
*
|
|
9
|
+
* @param schema - The schema that the sink input is expected to conform to.
|
|
10
|
+
* @param input - The sink metadata input to extract and normalize.
|
|
11
|
+
* @returns The normalized sink metadata.
|
|
12
|
+
*/
|
|
13
|
+
declare function extractSinkMeta<TSpec, TOptions extends object>(schema: ExtractedSchemaEnvelope<TSpec> | SchemaOf<TSpec, TOptions>, input?: SinkMetaInput<TSpec, TOptions>): SinkMeta<TSpec, TOptions>;
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes any accepted sink input into a concrete sink descriptor.
|
|
16
|
+
*
|
|
17
|
+
* @param schema - The schema that the sink input is expected to conform to.
|
|
18
|
+
* @param input - The sink input to normalize.
|
|
19
|
+
* @param options - Optional options for resolving the sink input.
|
|
20
|
+
* @returns A promise that resolves to a normalized sink descriptor.
|
|
21
|
+
*/
|
|
22
|
+
declare function createSink<TSpec, TOptions extends object, TReturns = void>(schema: SchemaOf<TSpec, TOptions>, input: SinkInput<TSpec, TOptions, TReturns>, options?: InferCreateSinkOptions<typeof input>): Promise<Sink<TSpec, TOptions, TReturns>>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { extractSinkMeta as n, createSink as t };
|
|
25
|
+
//# sourceMappingURL=create-DEe398aQ.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-DEe398aQ.d.mts","names":[],"sources":["../src/sink/create.ts"],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { s as SchemaOf } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
import { i as SourceInput, n as Source, o as SourceMeta, s as SourceMetaInput, t as InferCreateSourceOptions } from "./source-txi0ZuzR.cjs";
|
|
3
|
+
import { ExtractedSchemaEnvelope } from "@power-plant/schema/types";
|
|
4
|
+
|
|
5
|
+
//#region src/source/create.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Extracts and normalizes {@link SourceMeta | source metadata} from a given {@link SourceMetaInput}. This function ensures that the metadata is in a consistent format, converting version numbers to strings and filtering out any invalid or empty tags.
|
|
8
|
+
*
|
|
9
|
+
* @param schema - The schema that the source input is expected to conform to.
|
|
10
|
+
* @param input - The source metadata input to extract and normalize.
|
|
11
|
+
* @returns The normalized source metadata.
|
|
12
|
+
*/
|
|
13
|
+
declare function extractSourceMeta<TSpec, TOptions extends object>(schema: ExtractedSchemaEnvelope<TSpec> | SchemaOf<TSpec, TOptions>, input?: SourceMetaInput<TSpec, TOptions>): SourceMeta<TSpec, TOptions>;
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes any accepted source input into a concrete source descriptor.
|
|
16
|
+
*
|
|
17
|
+
* @param schema - The schema that the source input is expected to conform to.
|
|
18
|
+
* @param input - The source input to normalize.
|
|
19
|
+
* @param options - Optional options for resolving the source input.
|
|
20
|
+
* @returns A promise that resolves to a normalized source descriptor.
|
|
21
|
+
*/
|
|
22
|
+
declare function createSource<TSpec, TOptions extends object>(schema: SchemaOf<TSpec, TOptions>, input: SourceInput<TSpec, TOptions>, options?: InferCreateSourceOptions<typeof input>): Promise<Source<TSpec, TOptions>>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { extractSourceMeta as n, createSource as t };
|
|
25
|
+
//# sourceMappingURL=create-DUt-efk7.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-DUt-efk7.d.cts","names":[],"sources":["../src/source/create.ts"],"mappings":";;;;;;;AA2CA;;;;;iBAAgB,iBAAA,iCACd,MAAA,EAAQ,uBAAA,CAAwB,KAAA,IAAS,QAAA,CAAS,KAAA,EAAO,QAAA,GACzD,KAAA,GAAQ,eAAA,CAAgB,KAAA,EAAO,QAAA,IAC9B,UAAA,CAAW,KAAA,EAAO,QAAA;;;;;;;;;iBAoCC,YAAA,iCACpB,MAAA,EAAQ,QAAA,CAAS,KAAA,EAAO,QAAA,GACxB,KAAA,EAAO,WAAA,CAAY,KAAA,EAAO,QAAA,GAC1B,OAAA,GAAS,wBAAA,QAAgC,KAAA,IACxC,OAAA,CAAQ,MAAA,CAAO,KAAA,EAAO,QAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { a as InferCreateGeneratorOptions, n as GeneratorInput, t as Generator } from "./generator-BGkKE8HQ.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/generator/create.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a generator from raw schema/source/sink inputs and resolves all descriptors.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This function is used to create a generator from raw schema, source, and sink inputs. It resolves all descriptors and returns a fully constructed generator that can be used to generate output based on the provided schema and options.
|
|
9
|
+
*
|
|
10
|
+
* @template TSpec - The type of the specification that the generator will produce.
|
|
11
|
+
* @template TOptions - The type of the options that will be passed to the generator during generation.
|
|
12
|
+
* @param input - The generator input containing schema, source, sink, and optional meta information.
|
|
13
|
+
* @param options - Optional extraction options for schema, source, and sink.
|
|
14
|
+
* @returns A promise that resolves to a fully constructed generator.
|
|
15
|
+
*/
|
|
16
|
+
declare function createGenerator<TSpec, TOptions extends object, TReturns = void>(input: GeneratorInput<TSpec, TOptions, TReturns>, options?: InferCreateGeneratorOptions<typeof input>): Promise<Generator<TSpec, TOptions, TReturns>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { createGenerator as t };
|
|
19
|
+
//# sourceMappingURL=create-DcCu_zM3.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-DcCu_zM3.d.mts","names":[],"sources":["../src/generator/create.ts"],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { s as SchemaOf } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
import { i as SourceInput, n as Source, o as SourceMeta, s as SourceMetaInput, t as InferCreateSourceOptions } from "./source-BiOs3_-8.mjs";
|
|
3
|
+
import { ExtractedSchemaEnvelope } from "@power-plant/schema/types";
|
|
4
|
+
|
|
5
|
+
//#region src/source/create.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Extracts and normalizes {@link SourceMeta | source metadata} from a given {@link SourceMetaInput}. This function ensures that the metadata is in a consistent format, converting version numbers to strings and filtering out any invalid or empty tags.
|
|
8
|
+
*
|
|
9
|
+
* @param schema - The schema that the source input is expected to conform to.
|
|
10
|
+
* @param input - The source metadata input to extract and normalize.
|
|
11
|
+
* @returns The normalized source metadata.
|
|
12
|
+
*/
|
|
13
|
+
declare function extractSourceMeta<TSpec, TOptions extends object>(schema: ExtractedSchemaEnvelope<TSpec> | SchemaOf<TSpec, TOptions>, input?: SourceMetaInput<TSpec, TOptions>): SourceMeta<TSpec, TOptions>;
|
|
14
|
+
/**
|
|
15
|
+
* Normalizes any accepted source input into a concrete source descriptor.
|
|
16
|
+
*
|
|
17
|
+
* @param schema - The schema that the source input is expected to conform to.
|
|
18
|
+
* @param input - The source input to normalize.
|
|
19
|
+
* @param options - Optional options for resolving the source input.
|
|
20
|
+
* @returns A promise that resolves to a normalized source descriptor.
|
|
21
|
+
*/
|
|
22
|
+
declare function createSource<TSpec, TOptions extends object>(schema: SchemaOf<TSpec, TOptions>, input: SourceInput<TSpec, TOptions>, options?: InferCreateSourceOptions<typeof input>): Promise<Source<TSpec, TOptions>>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { extractSourceMeta as n, createSource as t };
|
|
25
|
+
//# sourceMappingURL=create-Qxy2mq7r.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-Qxy2mq7r.d.mts","names":[],"sources":["../src/source/create.ts"],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as SchemaInputObject } from "./schema-xFkmOyE6.cjs";
|
|
2
|
+
import { SchemaEnvelopeOf, SchemaSourceInput } from "@power-plant/schema/types";
|
|
3
|
+
|
|
4
|
+
//#region src/schema/define.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Defines a schema input object. If the provided schema is already a schema input object, it will be returned as-is. Otherwise, it will be wrapped in an object with a `schema` property.
|
|
7
|
+
*
|
|
8
|
+
* @param schema - The schema input to define. This can be either a schema source input, a schema envelope, or a schema input object.
|
|
9
|
+
* @returns A schema input object that contains the provided schema. If the input was already a schema input object, it will be returned unchanged.
|
|
10
|
+
*/
|
|
11
|
+
declare function defineSchema<TSpec, TOptions extends object>(schema: SchemaSourceInput<TSpec> | SchemaEnvelopeOf<TSpec> | SchemaInputObject<TSpec, TOptions>): SchemaInputObject<TSpec, TOptions>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { defineSchema as t };
|
|
14
|
+
//# sourceMappingURL=define-BPfeEA9Z.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-BPfeEA9Z.d.cts","names":[],"sources":["../src/schema/define.ts"],"mappings":";;;;;;AA+BA;;;;iBAAgB,YAAA,iCACd,MAAA,EACI,iBAAA,CAAkB,KAAA,IAClB,gBAAA,CAAiB,KAAA,IACjB,iBAAA,CAAkB,KAAA,EAAO,QAAA,IAC5B,iBAAA,CAAkB,KAAA,EAAO,QAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { r as SchemaInputObject } from "./schema-xFkmOyE6.mjs";
|
|
2
|
+
import { SchemaEnvelopeOf, SchemaSourceInput } from "@power-plant/schema/types";
|
|
3
|
+
|
|
4
|
+
//#region src/schema/define.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Defines a schema input object. If the provided schema is already a schema input object, it will be returned as-is. Otherwise, it will be wrapped in an object with a `schema` property.
|
|
7
|
+
*
|
|
8
|
+
* @param schema - The schema input to define. This can be either a schema source input, a schema envelope, or a schema input object.
|
|
9
|
+
* @returns A schema input object that contains the provided schema. If the input was already a schema input object, it will be returned unchanged.
|
|
10
|
+
*/
|
|
11
|
+
declare function defineSchema<TSpec, TOptions extends object>(schema: SchemaSourceInput<TSpec> | SchemaEnvelopeOf<TSpec> | SchemaInputObject<TSpec, TOptions>): SchemaInputObject<TSpec, TOptions>;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { defineSchema as t };
|
|
14
|
+
//# sourceMappingURL=define-CQZ042K5.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-CQZ042K5.d.mts","names":[],"sources":["../src/schema/define.ts"],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { a as SourceInputObject, i as SourceInput } from "./source-BiOs3_-8.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/source/define.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Defines a source input object. If the provided source is already a source input object, it will be returned as-is. Otherwise, it will be wrapped in an object with a `source` property.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { defineSource } from "@power-plant/core";
|
|
10
|
+
*
|
|
11
|
+
* // Define a source from a source function
|
|
12
|
+
* export default defineSource((options) => {
|
|
13
|
+
* // Your source logic here
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // Define a source from an existing source input object
|
|
17
|
+
* export default defineSource({
|
|
18
|
+
* meta: {
|
|
19
|
+
* name: "My Source",
|
|
20
|
+
* version: "1.0.0",
|
|
21
|
+
* description: "A source that does something.",
|
|
22
|
+
* },
|
|
23
|
+
* schema: z.object({
|
|
24
|
+
* // Your schema definition here
|
|
25
|
+
* }),
|
|
26
|
+
* source: (options) => {
|
|
27
|
+
* // Your source logic here
|
|
28
|
+
* },
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param source - The source input to define. This can be either a source input object or a source function.
|
|
33
|
+
* @returns A source input object that contains the provided source. If the input was already a source input object, it will be returned unchanged.
|
|
34
|
+
*/
|
|
35
|
+
declare function defineSource<TSpec, TOptions extends object>(source: SourceInput<TSpec, TOptions>): SourceInputObject<TSpec, TOptions>;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { defineSource as t };
|
|
38
|
+
//# sourceMappingURL=define-Dw8JgVQ1.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-Dw8JgVQ1.d.mts","names":[],"sources":["../src/source/define.ts"],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { a as SourceInputObject, i as SourceInput } from "./source-txi0ZuzR.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/source/define.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Defines a source input object. If the provided source is already a source input object, it will be returned as-is. Otherwise, it will be wrapped in an object with a `source` property.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { defineSource } from "@power-plant/core";
|
|
10
|
+
*
|
|
11
|
+
* // Define a source from a source function
|
|
12
|
+
* export default defineSource((options) => {
|
|
13
|
+
* // Your source logic here
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // Define a source from an existing source input object
|
|
17
|
+
* export default defineSource({
|
|
18
|
+
* meta: {
|
|
19
|
+
* name: "My Source",
|
|
20
|
+
* version: "1.0.0",
|
|
21
|
+
* description: "A source that does something.",
|
|
22
|
+
* },
|
|
23
|
+
* schema: z.object({
|
|
24
|
+
* // Your schema definition here
|
|
25
|
+
* }),
|
|
26
|
+
* source: (options) => {
|
|
27
|
+
* // Your source logic here
|
|
28
|
+
* },
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param source - The source input to define. This can be either a source input object or a source function.
|
|
33
|
+
* @returns A source input object that contains the provided source. If the input was already a source input object, it will be returned unchanged.
|
|
34
|
+
*/
|
|
35
|
+
declare function defineSource<TSpec, TOptions extends object>(source: SourceInput<TSpec, TOptions>): SourceInputObject<TSpec, TOptions>;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { defineSource as t };
|
|
38
|
+
//# sourceMappingURL=define-aWeW6VVo.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-aWeW6VVo.d.cts","names":[],"sources":["../src/source/define.ts"],"mappings":";;;;;AAoDA;;;;;;;;;;;;;;;;;;;;;AAEoC;;;;;;;;iBAFpB,YAAA,iCACd,MAAA,EAAQ,WAAA,CAAY,KAAA,EAAO,QAAA,IAC1B,iBAAA,CAAkB,KAAA,EAAO,QAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../create-23iLtMb_.cjs"),t=require("../sink/create.cjs"),n=require("../source/create.cjs"),r=require("./helpers.cjs");let i=require("@stryke/resolve/load"),a=require("@stryke/type-checks/is-function");async function o(o,s={}){let c;c=r.isGeneratorInputObject(o)?o:await(0,i.load)(o,s);let l=await e.t(c.schema,s),[u,d]=await Promise.all([n.createSource(l,c.source,s),t.createSink(l,c.sink,s)]);return{meta:c.meta,schema:l,source:u,sink:d,generate:async e=>{let t=(0,a.isFunction)(u.source)?await u.source(e):u.source,n=typeof c.meta?.description==`function`?c.meta.description(t):c.meta?.description;return n&&console.log(`Generating ${n}...`),d.sink(t,e)}}}exports.createGenerator=o;
|