tyneq 1.0.0 → 1.0.2
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 +67 -1
- package/dist/{TyneqCachedTerminalOperator.d.ts → TyneqCachedTerminalOperator-BrW77zIy.d.ts} +328 -173
- package/dist/{TyneqCachedTerminalOperator.d.cts → TyneqCachedTerminalOperator-EaNiNt61.d.cts} +328 -173
- package/dist/chunk-5R4AALC7.js +680 -0
- package/dist/chunk-C5PBY3ZU.cjs +46 -0
- package/dist/chunk-OWKUE3AC.cjs +680 -0
- package/dist/chunk-PCBN5AFG.js +46 -0
- package/dist/chunk-VJAICXA6.cjs +3788 -0
- package/dist/chunk-ZP6WMZCK.js +3788 -0
- package/dist/core-C54TSmgW.d.cts +1390 -0
- package/dist/core-C54TSmgW.d.ts +1390 -0
- package/dist/index.cjs +638 -843
- package/dist/index.d.cts +405 -605
- package/dist/index.d.ts +405 -605
- package/dist/index.js +630 -781
- package/dist/plugin/index.cjs +51 -24
- package/dist/plugin/index.d.cts +35 -38
- package/dist/plugin/index.d.ts +35 -38
- package/dist/plugin/index.js +51 -2
- package/dist/utility/index.cjs +18 -9
- package/dist/utility/index.d.cts +312 -2
- package/dist/utility/index.d.ts +312 -2
- package/dist/utility/index.js +18 -3
- package/package.json +5 -5
- package/dist/Lazy.cjs +0 -762
- package/dist/Lazy.cjs.map +0 -1
- package/dist/Lazy.js +0 -691
- package/dist/Lazy.js.map +0 -1
- package/dist/TyneqCachedTerminalOperator.cjs +0 -4950
- package/dist/TyneqCachedTerminalOperator.cjs.map +0 -1
- package/dist/TyneqCachedTerminalOperator.d.cts.map +0 -1
- package/dist/TyneqCachedTerminalOperator.d.ts.map +0 -1
- package/dist/TyneqCachedTerminalOperator.js +0 -4741
- package/dist/TyneqCachedTerminalOperator.js.map +0 -1
- package/dist/ValidationBuilder.cjs +0 -80
- package/dist/ValidationBuilder.cjs.map +0 -1
- package/dist/ValidationBuilder.d.cts +0 -319
- package/dist/ValidationBuilder.d.cts.map +0 -1
- package/dist/ValidationBuilder.d.ts +0 -319
- package/dist/ValidationBuilder.d.ts.map +0 -1
- package/dist/ValidationBuilder.js +0 -69
- package/dist/ValidationBuilder.js.map +0 -1
- package/dist/core.d.cts +0 -1393
- package/dist/core.d.cts.map +0 -1
- package/dist/core.d.ts +0 -1393
- package/dist/core.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/plugin/index.d.cts.map +0 -1
- package/dist/plugin/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -169,7 +169,73 @@ Two registration styles: functional (generators, factories, terminals) and class
|
|
|
169
169
|
npm install tyneq
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
- TypeScript 5.0 or higher
|
|
175
|
+
- `"strictNullChecks": true` in your tsconfig
|
|
176
|
+
|
|
177
|
+
No `@types` package needed.
|
|
178
|
+
|
|
179
|
+
## Stage 3 Decorators
|
|
180
|
+
|
|
181
|
+
tyneq is implemented with TC39 Stage 3 decorators - the standardized decorator proposal
|
|
182
|
+
that shipped in TypeScript 5.0 and requires no extra tsconfig flags. This is a different
|
|
183
|
+
model from the legacy `experimentalDecorators` syntax used by NestJS, Angular, and
|
|
184
|
+
InversifyJS.
|
|
185
|
+
|
|
186
|
+
**Using built-in operators requires nothing from you.** The decorator machinery lives
|
|
187
|
+
entirely inside tyneq's compiled output. Calling `.where()`, `.select()`, or any terminal
|
|
188
|
+
is just calling a plain method. No decorator support is needed on your side at all.
|
|
189
|
+
|
|
190
|
+
**Using the class-based plugin API does require Stage 3 decorators in your project.**
|
|
191
|
+
If you write custom operators using `@operator`, `@terminal`, `@orderedOperator`, or
|
|
192
|
+
`@cachedOperator`, your tsconfig must not have `experimentalDecorators: true`, because
|
|
193
|
+
TypeScript supports only one decorator model at a time. If your project already uses
|
|
194
|
+
the legacy model, the functional plugin API is fully equivalent and has no such constraint.
|
|
195
|
+
|
|
196
|
+
### How the dist handles decorators
|
|
197
|
+
|
|
198
|
+
The published `dist` is compiled by tsup (esbuild) targeting `es2017`. esbuild
|
|
199
|
+
transforms Stage 3 decorator syntax into plain helper functions (`__decorateClass`,
|
|
200
|
+
`__decorateElement`) at build time, so the output works in every Node version, bundler,
|
|
201
|
+
and consumer project - including those with no native decorator support at all.
|
|
202
|
+
|
|
203
|
+
| Aspect | Detail |
|
|
204
|
+
|---|---|
|
|
205
|
+
| Raw `@decorator` syntax in dist | No - compiled to helper functions |
|
|
206
|
+
| Node 18+ | Works |
|
|
207
|
+
| Projects with `experimentalDecorators: true` | Works (built-ins and functional plugin API) |
|
|
208
|
+
| Extra bundle overhead | Small - one shared set of helpers per entry point |
|
|
209
|
+
|
|
210
|
+
**Trade-offs to be aware of:**
|
|
211
|
+
|
|
212
|
+
- Helper-function output is slightly larger than native decorator syntax would be. The
|
|
213
|
+
helpers are small and shared across all operators within an entry point, so in practice
|
|
214
|
+
the impact is minimal.
|
|
215
|
+
- Tools that understand Stage 3 decorator syntax natively (newer runtimes, bundlers) do
|
|
216
|
+
not get any advantage from the raw syntax - they just run the helper functions instead.
|
|
217
|
+
- This is the correct approach for a published package right now. Shipping raw `@decorator`
|
|
218
|
+
syntax would silently break consumers on Node versions or bundlers that do not handle it.
|
|
219
|
+
|
|
220
|
+
**Future:** When TC39 Stage 3 decorators are universally supported in all target runtimes
|
|
221
|
+
and bundlers, the build toolchain will be updated to pass decorator syntax through natively,
|
|
222
|
+
removing the helper-function overhead. Until that point, the helper-based output is the safe
|
|
223
|
+
and correct choice.
|
|
224
|
+
|
|
225
|
+
## Compatibility
|
|
226
|
+
|
|
227
|
+
**All projects:** Built-in operators and sequences work without any decorator support. Import
|
|
228
|
+
and use normally.
|
|
229
|
+
|
|
230
|
+
**Projects with `experimentalDecorators: true`** (NestJS, Angular, InversifyJS): The built-in
|
|
231
|
+
operators and the functional plugin API (`createGeneratorOperator`, `createOperator`, and
|
|
232
|
+
related helpers) work without any changes. The class-based decorator plugin API (`@operator`,
|
|
233
|
+
`@terminal`, and related decorators) cannot be used because TypeScript supports only one
|
|
234
|
+
decorator model at a time. Use the functional API instead - it is fully equivalent and the
|
|
235
|
+
recommended path in these projects.
|
|
236
|
+
|
|
237
|
+
**Projects with TypeScript 5.0+ and no `experimentalDecorators`:** Full access to everything,
|
|
238
|
+
including the class-based plugin API decorators.
|
|
173
239
|
|
|
174
240
|
---
|
|
175
241
|
|