@valkyrjaio/sindri 26.0.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.
- package/LICENSE.md +21 -0
- package/README.md +111 -0
- package/package.json +63 -0
- package/src/Sindri/Ast/Abstract/AstReader.ts +710 -0
- package/src/Sindri/Ast/Abstract/RouteAttributeReader.ts +50 -0
- package/src/Sindri/Ast/CliRouteAttributeReader.ts +219 -0
- package/src/Sindri/Ast/CliRouteParameterReader.ts +204 -0
- package/src/Sindri/Ast/ComponentProviderReader.ts +41 -0
- package/src/Sindri/Ast/ConfigReader.ts +213 -0
- package/src/Sindri/Ast/Contract/CliRouteAttributeReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/CliRouteParameterReaderContract.ts +34 -0
- package/src/Sindri/Ast/Contract/ComponentProviderReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/ConfigReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/HttpRouteAttributeReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/HttpRouteMiddlewareReaderContract.ts +61 -0
- package/src/Sindri/Ast/Contract/HttpRouteParameterReaderContract.ts +26 -0
- package/src/Sindri/Ast/Contract/ListenerAttributeReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/ListenerProviderReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/RouteProviderReaderContract.ts +14 -0
- package/src/Sindri/Ast/Contract/ServiceProviderReaderContract.ts +14 -0
- package/src/Sindri/Ast/Data/CliArgumentParameterData.ts +20 -0
- package/src/Sindri/Ast/Data/CliOptionParameterData.ts +24 -0
- package/src/Sindri/Ast/Data/CliRouteData.ts +32 -0
- package/src/Sindri/Ast/Data/ConfigData.ts +20 -0
- package/src/Sindri/Ast/Data/Contract/CliArgumentParameterDataContract.ts +18 -0
- package/src/Sindri/Ast/Data/Contract/CliOptionParameterDataContract.ts +22 -0
- package/src/Sindri/Ast/Data/Contract/CliRouteDataContract.ts +25 -0
- package/src/Sindri/Ast/Data/Contract/ConfigDataContract.ts +16 -0
- package/src/Sindri/Ast/Data/Contract/HandlerDataContract.ts +13 -0
- package/src/Sindri/Ast/Data/Contract/HttpParameterDataContract.ts +17 -0
- package/src/Sindri/Ast/Data/Contract/HttpRouteDataContract.ts +28 -0
- package/src/Sindri/Ast/Data/Contract/ListenerDataContract.ts +16 -0
- package/src/Sindri/Ast/Data/HandlerData.ts +20 -0
- package/src/Sindri/Ast/Data/HttpParameterData.ts +20 -0
- package/src/Sindri/Ast/Data/HttpRouteData.ts +30 -0
- package/src/Sindri/Ast/Data/ListenerData.ts +19 -0
- package/src/Sindri/Ast/Data/Result/CliRouteAttributeResult.ts +14 -0
- package/src/Sindri/Ast/Data/Result/ComponentProviderResult.ts +28 -0
- package/src/Sindri/Ast/Data/Result/ConfigResult.ts +18 -0
- package/src/Sindri/Ast/Data/Result/HttpRouteAttributeResult.ts +19 -0
- package/src/Sindri/Ast/Data/Result/ListenerAttributeResult.ts +14 -0
- package/src/Sindri/Ast/Data/Result/ListenerProviderResult.ts +24 -0
- package/src/Sindri/Ast/Data/Result/RouteProviderResult.ts +24 -0
- package/src/Sindri/Ast/Data/Result/ServiceProviderResult.ts +22 -0
- package/src/Sindri/Ast/HttpRouteAttributeReader.ts +315 -0
- package/src/Sindri/Ast/HttpRouteMiddlewareReader.ts +214 -0
- package/src/Sindri/Ast/HttpRouteParameterReader.ts +193 -0
- package/src/Sindri/Ast/ListenerAttributeReader.ts +131 -0
- package/src/Sindri/Ast/ListenerProviderReader.ts +45 -0
- package/src/Sindri/Ast/RouteProviderReader.ts +45 -0
- package/src/Sindri/Ast/ServiceProviderReader.ts +124 -0
- package/src/Sindri/Ast/Throwable/Contract/AstThrowable.ts +12 -0
- package/src/Sindri/Ast/Throwable/Exception/Abstract/AstInvalidArgumentException.ts +14 -0
- package/src/Sindri/Ast/Throwable/Exception/Abstract/AstRuntimeException.ts +14 -0
- package/src/Sindri/Ast/Throwable/Exception/AstFileReadException.ts +12 -0
- package/src/Sindri/Cli/Command/GenerateDataFromConfigCommand.ts +83 -0
- package/src/Sindri/Constant/CommandName.ts +12 -0
- package/src/Sindri/Constant/SindriInfo.ts +20 -0
- package/src/Sindri/Constant/SindriServiceId.ts +32 -0
- package/src/Sindri/Generate/Abstract/GenerateDataFromAst.ts +391 -0
- package/src/Sindri/Generator/Abstract/AstFileGenerator.ts +54 -0
- package/src/Sindri/Generator/Abstract/FileGenerator.ts +59 -0
- package/src/Sindri/Generator/Ast/Cli/AstCliDataFileGenerator.ts +88 -0
- package/src/Sindri/Generator/Ast/Container/AstContainerDataFileGenerator.ts +86 -0
- package/src/Sindri/Generator/Ast/Event/AstEventDataFileGenerator.ts +79 -0
- package/src/Sindri/Generator/Ast/Http/AstHttpDataFileGenerator.ts +306 -0
- package/src/Sindri/Generator/Cli/Contract/CliDataFileGeneratorContract.ts +23 -0
- package/src/Sindri/Generator/Container/Contract/ContainerDataFileGeneratorContract.ts +21 -0
- package/src/Sindri/Generator/Contract/FileGeneratorContract.ts +15 -0
- package/src/Sindri/Generator/Enum/GenerateStatus.ts +14 -0
- package/src/Sindri/Generator/Event/Contract/EventDataFileGeneratorContract.ts +23 -0
- package/src/Sindri/Generator/Http/Contract/HttpDataFileGeneratorContract.ts +25 -0
- package/src/Sindri/Generator/Throwable/Contract/GeneratorThrowable.ts +12 -0
- package/src/Sindri/Generator/Throwable/Exception/Abstract/GeneratorInvalidArgumentException.ts +16 -0
- package/src/Sindri/Generator/Throwable/Exception/Abstract/GeneratorRuntimeException.ts +14 -0
- package/src/Sindri/Generator/Throwable/Exception/GeneratorUnreachableException.ts +12 -0
- package/src/Sindri/Provider/SindriAstServiceProvider.ts +182 -0
- package/src/Sindri/Provider/SindriCliRouteProvider.ts +32 -0
- package/src/Sindri/Provider/SindriCommandServiceProvider.ts +71 -0
- package/src/Sindri/Provider/SindriComponentProvider.ts +41 -0
- package/src/Sindri/Throwable/Contract/SindriThrowable.ts +12 -0
- package/src/Sindri/Throwable/Exception/Abstract/SindriInvalidArgumentException.ts +16 -0
- package/src/Sindri/Throwable/Exception/Abstract/SindriRuntimeException.ts +14 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Melech Mizrachi
|
|
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 furnished
|
|
10
|
+
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
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<p align="center"><a href="https://valkyrja.io" target="_blank">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/valkyrjaio/art/refs/heads/master/long-banner/orange/typescript.png" width="100%">
|
|
3
|
+
</a></p>
|
|
4
|
+
|
|
5
|
+
# Sindri
|
|
6
|
+
|
|
7
|
+
[Sindri][github sindri] is the build tool for the [Valkyrja][Valkyrja url]
|
|
8
|
+
TypeScript framework.
|
|
9
|
+
|
|
10
|
+
Sindri reads your TypeScript source and generates pre-computed data files for
|
|
11
|
+
faster runtime performance, handling build-time concerns across the Valkyrja
|
|
12
|
+
ecosystem. Named after the dwarven smith in Norse mythology who forged
|
|
13
|
+
Mjölnir and other divine artifacts, Sindri does for your Valkyrja app what
|
|
14
|
+
his namesake did for the gods: crafts the artifacts that make it all work
|
|
15
|
+
faster and better.
|
|
16
|
+
|
|
17
|
+
<p>
|
|
18
|
+
<a href="https://www.npmjs.com/package/@valkyrjaio/sindri"><img src="https://img.shields.io/npm/v/@valkyrjaio/sindri.svg" alt="Latest Version on npm"></a>
|
|
19
|
+
<a href="https://www.npmjs.com/package/@valkyrjaio/sindri"><img src="https://img.shields.io/node/v/@valkyrjaio/sindri.svg" alt="Supported Node.js Version"></a>
|
|
20
|
+
<a href="https://www.npmjs.com/package/@valkyrjaio/sindri"><img src="https://img.shields.io/npm/l/@valkyrjaio/sindri.svg" alt="License"></a>
|
|
21
|
+
<a href="https://github.com/valkyrjaio/sindri-ts/actions/workflows/ci.yml?query=branch%3A26.x"><img src="https://github.com/valkyrjaio/sindri-ts/actions/workflows/ci.yml/badge.svg?branch=26.x" alt="CI Status"></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
## What Sindri Does
|
|
25
|
+
|
|
26
|
+
- **Generates data files** — reads your TypeScript source and produces
|
|
27
|
+
pre-computed container, routing, and event data files so your application
|
|
28
|
+
skips discovery work at runtime
|
|
29
|
+
- **Optimizes runtime performance** — the generated data lets Valkyrja boot
|
|
30
|
+
without reflecting over providers and configuration on every invocation
|
|
31
|
+
- **Handles build-time concerns** — centralizes the code-generation steps
|
|
32
|
+
across the Valkyrja ecosystem
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
### Via npm
|
|
37
|
+
|
|
38
|
+
Add Sindri to an existing Valkyrja project as a dev dependency:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
npm install --save-dev @valkyrjaio/sindri
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Getting Started
|
|
45
|
+
|
|
46
|
+
### Generating Data Files
|
|
47
|
+
|
|
48
|
+
Once your application's providers and configuration are in place, generate the
|
|
49
|
+
pre-computed data files:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
npx sindri data:generate
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Run `npx sindri` with no command to see usage and the list of available
|
|
56
|
+
commands.
|
|
57
|
+
|
|
58
|
+
## Documentation
|
|
59
|
+
|
|
60
|
+
Full Sindri [documentation][docs url] is available on the Valkyrja website.
|
|
61
|
+
|
|
62
|
+
For framework-level questions about Valkyrja itself, see the
|
|
63
|
+
[Valkyrja framework repository][framework url].
|
|
64
|
+
|
|
65
|
+
## Versioning and Release Process
|
|
66
|
+
|
|
67
|
+
Sindri follows [semantic versioning][semantic versioning url] with a major
|
|
68
|
+
release every year, and support for each major version for 2 years from the
|
|
69
|
+
date of release.
|
|
70
|
+
|
|
71
|
+
For more information see our
|
|
72
|
+
[Versioning and Release Process documentation][Versioning and Release Process url].
|
|
73
|
+
|
|
74
|
+
### Supported Versions
|
|
75
|
+
|
|
76
|
+
Bug fixes are provided until 3 months after the next major release. Security
|
|
77
|
+
fixes are provided for 2 years after the initial release.
|
|
78
|
+
|
|
79
|
+
| Version | Node | Release | Bug Fixes Until | Security Fixes Until |
|
|
80
|
+
| :------ | :--- | :------------- | :-------------- | :------------------- |
|
|
81
|
+
| 26 | 22+ | March 31, 2026 | Q2 2027 | Q1 2028 |
|
|
82
|
+
|
|
83
|
+
## Contributing
|
|
84
|
+
|
|
85
|
+
Sindri is an open-source, community-driven project. Thank you for your
|
|
86
|
+
interest in helping develop, maintain, and release it.
|
|
87
|
+
|
|
88
|
+
See [`CONTRIBUTING.md`][contributing url] for the submission process and
|
|
89
|
+
[`VOCABULARY.md`][vocabulary url] for the terminology used across Valkyrja.
|
|
90
|
+
|
|
91
|
+
## Security Issues
|
|
92
|
+
|
|
93
|
+
If you discover a security vulnerability within Sindri, please follow our
|
|
94
|
+
[disclosure procedure][security vulnerabilities url].
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
Sindri is open-source software licensed under the
|
|
99
|
+
[MIT license][MIT license url]. See [`LICENSE.md`](./LICENSE.md).
|
|
100
|
+
|
|
101
|
+
[Valkyrja url]: https://valkyrja.io
|
|
102
|
+
[framework url]: https://github.com/valkyrjaio/valkyrja-ts
|
|
103
|
+
[github sindri]: https://github.com/valkyrjaio/sindri-ts
|
|
104
|
+
[docs url]: https://valkyrja.io
|
|
105
|
+
[Versioning and Release Process url]: https://github.com/valkyrjaio/.github/blob/master/VERSIONING_AND_RELEASE_PROCESS.md
|
|
106
|
+
[contributing url]: https://github.com/valkyrjaio/.github/blob/master/CONTRIBUTING.md
|
|
107
|
+
[vocabulary url]: https://github.com/valkyrjaio/.github/blob/master/VOCABULARY.md
|
|
108
|
+
[security vulnerabilities url]: https://github.com/valkyrjaio/.github/blob/master/SECURITY.md
|
|
109
|
+
[semantic versioning url]: https://semver.org/
|
|
110
|
+
[MIT license url]: https://opensource.org/licenses/MIT
|
|
111
|
+
[license url]: ./LICENSE.md
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@valkyrjaio/sindri",
|
|
3
|
+
"version": "26.0.1",
|
|
4
|
+
"description": "The Valkyrja Sindri build tool.",
|
|
5
|
+
"homepage": "https://www.valkyrja.io/sindri",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"build tool",
|
|
8
|
+
"sindri",
|
|
9
|
+
"valkyrja"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Melech Mizrachi",
|
|
14
|
+
"email": "melechmizrachi@gmail.com"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"bin": {
|
|
24
|
+
"sindri": "dist/bin/sindri.js"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"src"
|
|
29
|
+
],
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=22"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@valkyrjaio/valkyrja": "^26.1.0",
|
|
35
|
+
"ts-morph": "^28.0.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typescript": "cd .github/ci/typescript && npm run check",
|
|
39
|
+
"typescript-outdated-check": "cd .github/ci/typescript && npm install && npm outdated",
|
|
40
|
+
"typescript-outdated-check-major-release": "cd .github/ci/typescript && npm install && npm outdated",
|
|
41
|
+
"typescript-npm-update": "cd .github/ci/typescript && npm update",
|
|
42
|
+
"eslint": "cd .github/ci/eslint && npm run fix",
|
|
43
|
+
"eslint-check": "cd .github/ci/eslint && npm run check",
|
|
44
|
+
"eslint-outdated-check": "cd .github/ci/eslint && npm install && npm outdated",
|
|
45
|
+
"eslint-outdated-check-major-release": "cd .github/ci/eslint && npm install && npm outdated",
|
|
46
|
+
"eslint-npm-update": "cd .github/ci/eslint && npm update",
|
|
47
|
+
"prettier": "cd .github/ci/prettier && npm run fix",
|
|
48
|
+
"prettier-check": "cd .github/ci/prettier && npm run check",
|
|
49
|
+
"prettier-outdated-check": "cd .github/ci/prettier && npm install && npm outdated",
|
|
50
|
+
"prettier-outdated-check-major-release": "cd .github/ci/prettier && npm install && npm outdated",
|
|
51
|
+
"prettier-npm-update": "cd .github/ci/prettier && npm update",
|
|
52
|
+
"vitest": "cd .github/ci/vitest && npm run check",
|
|
53
|
+
"vitest-coverage": "cd .github/ci/vitest && npm run coverage",
|
|
54
|
+
"vitest-outdated-check": "cd .github/ci/vitest && npm install && npm outdated",
|
|
55
|
+
"vitest-outdated-check-major-release": "cd .github/ci/vitest && npm install && npm outdated",
|
|
56
|
+
"vitest-npm-update": "cd .github/ci/vitest && npm update",
|
|
57
|
+
"root-outdated-check": "npm install && npm outdated",
|
|
58
|
+
"root-outdated-check-major-release": "npm install && npm outdated",
|
|
59
|
+
"root-and-suggested-outdated-check": "cd .github/ci/root-and-suggested && npm install && npm outdated",
|
|
60
|
+
"root-and-suggested-outdated-check-major-release": "cd .github/ci/root-and-suggested && npm install && npm outdated",
|
|
61
|
+
"root-and-suggested-npm-update": "cd .github/ci/root-and-suggested && npm update"
|
|
62
|
+
}
|
|
63
|
+
}
|