ts_schema_spec 0.6.1 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3c86744b3644ad258aa39eff8ff11b55df1cc933003276126f7b1b3d9952d91
4
- data.tar.gz: e0a59266d59248a00e092c96b85978bde02bf19d1dd85f6b382addc3ca9fb32b
3
+ metadata.gz: 1d8e48873074ac373b562a69c895679dc7afbe1a21d81df9910f8e9f766c2fcc
4
+ data.tar.gz: bdc53ec65a7c01ff8c63d9ce95525cf01587d25bbf0726b7566a129724401fff
5
5
  SHA512:
6
- metadata.gz: dbcc3f50c232a8cf847db8804abc4af17140f884c051b414fea6f6cd56d0f93127c2e002b2856c255305dc3685b236329dd2a58dc6e552f99dc11b6d441ccd4d
7
- data.tar.gz: 83f7161eebc10dd01d0634fa4eb022c7d5afa5f8ace26690bfa5022c5fa624409f167497dcaf9c2ef2cd3b05ea452dccf7124bd64581c5cba456b162cad2fc97
6
+ metadata.gz: 482f0478728009f5bc10ac65f2a9046c5c1d28393d394bddfbd3c59ad4f029a26d9b9eb9587006d4b065756c3b6e6fc59eea95fc60e4f136b8454760cc7eb0e7
7
+ data.tar.gz: 6a65b04776bd6c9eb5c12a6bf96b97cbd939d6e7215171e71e71c10f8fbee8f9c4925bb59444110714d262a05e4c0793d73c62da394b48798271bb689d56012c
data/README.md CHANGED
@@ -148,14 +148,14 @@ empty array.
148
148
 
149
149
  ## API
150
150
 
151
- | Call | Returns |
152
- | --------------------------------------- | ----------------------------------------------------------- |
153
- | `TsSchemaSpec.schema_for(path, type)` | a `JSONSchemer` schema scoped to that exported type |
154
- | `match_ts_schema(path, type)` | matcher; validates a hash, or every item of an array |
155
- | `react_component_props(name[, html])` | array of props hashes, one per mount |
156
- | `TsSchemaSpec::Skill.check!(root)` | raises if the installed skill is stale or missing |
157
- | `TsSchemaSpec.configure` | sets `tsconfig` and extra generator arguments |
158
- | `TsSchemaSpec.clear_cache!` | drops the generated-schema cache |
151
+ | Call | Returns |
152
+ | ------------------------------------- | ---------------------------------------------------- |
153
+ | `TsSchemaSpec.schema_for(path, type)` | a `JSONSchemer` schema scoped to that exported type |
154
+ | `match_ts_schema(path, type)` | matcher; validates a hash, or every item of an array |
155
+ | `react_component_props(name[, html])` | array of props hashes, one per mount |
156
+ | `TsSchemaSpec::Skill.check!(root)` | raises if the installed skill is stale or missing |
157
+ | `TsSchemaSpec.configure` | sets `tsconfig` and extra generator arguments |
158
+ | `TsSchemaSpec.clear_cache!` | drops the generated-schema cache |
159
159
 
160
160
  `match_ts_schema` was called `match_schema` before 0.6.1. The old name still
161
161
  works but is deprecated and will be removed.
@@ -246,14 +246,14 @@ The cache lives in the process, so parallel test workers each pay for it once.
246
246
 
247
247
  ## Troubleshooting
248
248
 
249
- | Symptom | Cause |
250
- | ---------------------------------------------------- | -------------------------------------------------------------- |
251
- | `GenerationError: ... Is it exported?` | the type has no `export`, or the name is misspelled |
252
- | `GenerationError` listing a rerunnable command | run it — the generator's own stderr is in the message |
253
- | passes against an obviously wrong payload | the type is all-optional, or an unresolved import became `{}` |
254
- | `could not run npx ts-json-schema-generator` | the generator is not in your `node_modules` |
255
- | `disallowed additional property` | see above — the payload sends what TypeScript does not declare |
256
- | `has no data-react-props attribute` | hand-written markup, or a mount from another integration |
249
+ | Symptom | Cause |
250
+ | ---------------------------------------------- | -------------------------------------------------------------- |
251
+ | `GenerationError: ... Is it exported?` | the type has no `export`, or the name is misspelled |
252
+ | `GenerationError` listing a rerunnable command | run it — the generator's own stderr is in the message |
253
+ | passes against an obviously wrong payload | the type is all-optional, or an unresolved import became `{}` |
254
+ | `could not run npx ts-json-schema-generator` | the generator is not in your `node_modules` |
255
+ | `disallowed additional property` | see above — the payload sends what TypeScript does not declare |
256
+ | `has no data-react-props attribute` | hand-written markup, or a mount from another integration |
257
257
 
258
258
  ## What this can't catch
259
259
 
@@ -263,7 +263,7 @@ Worth knowing before you rely on it.
263
263
  a spec for; an uncovered endpoint is exactly as exposed as before. That is what
264
264
  the skill is for, and it is convention rather than enforcement.
265
265
 
266
- **It only checks what TypeScript declares.** If Rails *intends* to send a field
266
+ **It only checks what TypeScript declares.** If Rails _intends_ to send a field
267
267
  nobody typed — say `as_json(only:)` carrying a misspelled attribute, which
268
268
  Rails drops silently — no generated schema requires it, so nothing fails. A
269
269
  structured serializer catches that class of mistake; this does not.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TsSchemaSpec
4
- VERSION = "0.6.1"
4
+ VERSION = "0.6.2"
5
5
  end
@@ -65,9 +65,9 @@ implying the spec covers them.
65
65
 
66
66
  ## Step 4 — Write the test
67
67
 
68
- | Action | Data source |
69
- | ------ | ----------- |
70
- | `render json:` | `response.parsed_body["key"]` |
68
+ | Action | Data source |
69
+ | ----------------- | ---------------------------------------- |
70
+ | `render json:` | `response.parsed_body["key"]` |
71
71
  | `react_component` | `react_component_props("ComponentName")` |
72
72
 
73
73
  `react_component_props` returns **an array**, one entry per mount, and needs
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ts_schema_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vernon Coffey