@systemfsoftware/effect-schema-vite 1.5.2 → 1.5.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/CHANGELOG.md +45 -0
- package/dist/effect-schema-vite-untrimmed.d.ts +59 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @systemfsoftware/effect-schema-vite
|
|
2
2
|
|
|
3
|
+
## 1.5.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The peer requirements for `effect` and for the Effect test-runner integration now accept any compatible `4.0.0-rc` release, instead of demanding one exact release candidate.
|
|
8
|
+
|
|
9
|
+
Installing alongside a newer release candidate no longer reports an unmet peer dependency or resolves a second copy of `effect` into the dependency tree.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies:
|
|
12
|
+
- @systemfsoftware/effect-schema-law@0.9.0
|
|
13
|
+
|
|
14
|
+
## 1.5.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Array types are spelled one way. `Array<T>` and `ReadonlyArray<T>` in emitted
|
|
19
|
+
declarations become `T[]` and `readonly T[]`, which the type checker cannot tell
|
|
20
|
+
apart: no exported type changes, only how it is written.
|
|
21
|
+
|
|
22
|
+
- New version is published through npm trusted publishing, so it carries a provenance attestation you can verify.
|
|
23
|
+
|
|
24
|
+
- Declare the effect-schema-law peer dependency as a workspace range so recursive versioning resolves it.
|
|
25
|
+
|
|
26
|
+
- Each of these packages now has a README, so its registry page says what the package is, how
|
|
27
|
+
to install it, and what to import or register — previously the page was blank. The lint
|
|
28
|
+
plugins show the configuration line that enables what they recommend.
|
|
29
|
+
|
|
30
|
+
`@systemfsoftware/stryker-js-mutation-report` also carries its licence text
|
|
31
|
+
|
|
32
|
+
- Generated schema law suites no longer fail to load when a module exports a value derived from a schema rather than a schema itself — a type guard from `Schema.is`, a decoder, an encoder, or an arbitrary. Such an export is skipped instead of being handed to the round-trip laws.
|
|
33
|
+
|
|
34
|
+
- Generated schema laws no longer break when a package exports a value read off a
|
|
35
|
+
codec or JSON-Schema document, such as `Schema.toJsonSchemaDocument(x).schema`.
|
|
36
|
+
Those exports are uses of a schema rather than schemas, and generating
|
|
37
|
+
round-trip laws for one made the whole generated suite fail to load, reporting
|
|
38
|
+
no tests at all. They are now skipped, so the suite runs the laws for the real
|
|
39
|
+
schemas beside them.
|
|
40
|
+
|
|
41
|
+
The set of members recognised as uses is also complete now: the encode side was
|
|
42
|
+
missing its `Exit`, `Option`, `Result` and `Promise` variants, so a schema whose
|
|
43
|
+
declaration used one of those was skipped when it should have been law-tested.
|
|
44
|
+
|
|
45
|
+
- Updated dependencies:
|
|
46
|
+
- @systemfsoftware/effect-schema-law@0.8.0
|
|
47
|
+
|
|
3
48
|
## 1.5.2
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Plugin as Plugin_2 } from 'vite';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build the law-suite body injected into a consumer's `schema-laws.test.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Import specifiers are relative to `lawFilePath`, never to the Vite root: the
|
|
7
|
+
* file being rewritten lives in `src/`, so a root-relative specifier resolves
|
|
8
|
+
* to `src/src/…` and yields a suite that silently imports nothing.
|
|
9
|
+
*
|
|
10
|
+
* Every schema is imported under a generated local alias. Two modules may
|
|
11
|
+
* export the same name, and a bare `import { X }` pair for them is invalid
|
|
12
|
+
* ESM — one binding wins, so a schema silently loses its laws to its
|
|
13
|
+
* namesake while the suite still reports a passing pair for it. An alias also
|
|
14
|
+
* keeps a schema named `it` or `ruleOfSchemas` from shadowing the harness.
|
|
15
|
+
*
|
|
16
|
+
* @since 1.4.0
|
|
17
|
+
*/
|
|
18
|
+
export declare const generateSchemaLaws: (lawFilePath: string, srcDir: string) => string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Vite plugin that walks the consumer's `src/` directory, finds every
|
|
22
|
+
* exported Effect `Schema`, and auto-injects `ruleOfSchemas` round-trip
|
|
23
|
+
* property tests for each one.
|
|
24
|
+
*
|
|
25
|
+
* The laws are injected by rewriting the consumer's own
|
|
26
|
+
* `src/schema-laws.test.ts` — the one test filename the placement taxonomy
|
|
27
|
+
* whitelists by name. It is deliberately NOT a virtual module: the generated
|
|
28
|
+
* body carries real `import` edges to each schema file, so vitest's
|
|
29
|
+
* related-file walk reaches them. A virtual module breaks that walk (its id
|
|
30
|
+
* has no path on disk), which silently drops every generated law from
|
|
31
|
+
* `stryker --related` runs and reports the survivors as coverage gaps.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // vitest.config.ts
|
|
36
|
+
* import { inlineSchemaTests } from '@systemfsoftware/effect-schema-vite'
|
|
37
|
+
*
|
|
38
|
+
* export default defineConfig({
|
|
39
|
+
* plugins: [inlineSchemaTests()],
|
|
40
|
+
* })
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const inlineSchemaTests: (options?: InlineSchemaTestsOptions) => Plugin_2;
|
|
44
|
+
|
|
45
|
+
/** @since 0.1.0 */
|
|
46
|
+
export declare interface InlineSchemaTestsOptions {
|
|
47
|
+
/** Directory to scan for schema files, relative to Vite root. Default: `"src"`. */
|
|
48
|
+
dir?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The one test filename the placement taxonomy whitelists by name. The plugin
|
|
53
|
+
* rewrites this file in the consumer's `src/`; nothing else is touched.
|
|
54
|
+
*
|
|
55
|
+
* @since 1.4.0
|
|
56
|
+
*/
|
|
57
|
+
export declare const LAW_FILE_BASENAME: 'schema-laws.test.ts';
|
|
58
|
+
|
|
59
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/effect-schema-vite",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.4",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
9
|
-
"directory": "packages/effect
|
|
9
|
+
"directory": "packages/core/effect/schema/vite"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/effect
|
|
11
|
+
"homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/core/effect/schema/vite#readme",
|
|
12
12
|
"bugs": "https://github.com/systemfsoftware/systemfsoftware/issues",
|
|
13
13
|
"description": "Vite plugin that auto-discovers Effect Schema exports and injects round-trip property tests via @systemfsoftware/effect-schema-law.",
|
|
14
14
|
"keywords": [
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
"@microsoft/api-extractor": "^7.58.7",
|
|
42
42
|
"@systemfsoftware/arethetypeswrong-cli": "^1.1.1",
|
|
43
43
|
"@types/node": "^24",
|
|
44
|
-
"effect": "4.0.0-rc.
|
|
44
|
+
"effect": "4.0.0-rc.111",
|
|
45
45
|
"oxlint": "^1.77.0",
|
|
46
46
|
"rimraf": "^6.1.3",
|
|
47
47
|
"tsdown": "^0.22.14",
|
|
48
48
|
"vite": "^8",
|
|
49
49
|
"vitest": "^4.1.10",
|
|
50
|
-
"@systemfsoftware/
|
|
51
|
-
"@systemfsoftware/
|
|
50
|
+
"@systemfsoftware/effect-schema-law": "^0.9.0",
|
|
51
|
+
"@systemfsoftware/tsconfig": "^1.3.3",
|
|
52
52
|
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
53
|
-
"@systemfsoftware/
|
|
54
|
-
"@systemfsoftware/
|
|
53
|
+
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
54
|
+
"@systemfsoftware/effect-gherkin-spec": "^2.0.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"effect": "4.0.0-rc.
|
|
57
|
+
"effect": "^4.0.0-rc.111",
|
|
58
58
|
"vite": ">5.0.0",
|
|
59
59
|
"vitest": "*",
|
|
60
|
-
"@systemfsoftware/effect-schema-law": "0.
|
|
60
|
+
"@systemfsoftware/effect-schema-law": "0.9.0"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"provenance": true
|