@amritk/generate-examples 0.5.4 → 0.5.6

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 CHANGED
@@ -5,9 +5,11 @@
5
5
  **Programmatic API for generating fast-check arbitraries and example values from JSON Schemas.**
6
6
 
7
7
  ![status](https://img.shields.io/badge/status-pre--alpha-ef4444?style=flat-square) 
8
+ ![version](https://img.shields.io/npm/v/@amritk/generate-examples?style=flat-square&logo=npm&logoColor=white&label=version&color=6366f1) 
8
9
  ![license](https://img.shields.io/badge/license-MIT-22c55e?style=flat-square) 
9
10
  ![JSON Schema](https://img.shields.io/badge/JSON%20Schema-2020--12-f97316?style=flat-square) 
10
- ![node](https://img.shields.io/badge/node-%E2%89%A520-339933?style=flat-square&logo=node.js&logoColor=white)
11
+ ![node](https://img.shields.io/badge/node-%E2%89%A520-339933?style=flat-square&logo=node.js&logoColor=white) 
12
+ ![vibe coded](https://img.shields.io/badge/vibe-coded-a855f7?style=flat-square)
11
13
 
12
14
  </div>
13
15
 
@@ -9,7 +9,10 @@ const generateExampleFile = (schema, typeName, options) => {
9
9
  rootSchema: options?.rootSchema,
10
10
  typeSuffix
11
11
  });
12
- const typeDefinition = generateTypeDefinition(schema, typeName, { typeSuffix });
12
+ const typeDefinition = generateTypeDefinition(schema, typeName, {
13
+ typeSuffix,
14
+ ...options?.rootSchema !== void 0 ? { rootSchema: options.rootSchema } : {}
15
+ });
13
16
  const arbitrary = generateArbitrary(schema, typeName, typeSuffix, options?.lazyRefFilenames, options?.rootSchema);
14
17
  const example = generateExampleConst(schema, typeName, options?.rootSchema);
15
18
  let result = `import * as fc from 'fast-check'
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@amritk/generate-examples",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Generate fast-check arbitraries and example values from JSON Schemas.",
5
5
  "module": "./dist/index.js",
6
6
  "type": "module",
7
+ "sideEffects": false,
8
+ "engines": {
9
+ "node": ">=20"
10
+ },
7
11
  "license": "MIT",
8
12
  "author": "amritk",
9
13
  "keywords": [
@@ -48,8 +52,8 @@
48
52
  },
49
53
  "dependencies": {
50
54
  "json-schema-typed": "^8.0.1",
51
- "@amritk/helpers": "0.13.4",
52
- "@amritk/runtime-validators": "0.8.0"
55
+ "@amritk/helpers": "0.14.0",
56
+ "@amritk/runtime-validators": "0.9.1"
53
57
  },
54
58
  "devDependencies": {
55
59
  "ajv": "^8.17.1"