@tinacms/cli 0.60.25 → 0.60.26

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 DELETED
@@ -1,1218 +0,0 @@
1
- # tinacms-cli
2
-
3
- ## 0.60.25
4
-
5
- ### Patch Changes
6
-
7
- - 0bc18072e: Fixed issue where too many saves at one time would cause server to crash
8
-
9
- ## 0.60.24
10
-
11
- ### Patch Changes
12
-
13
- - 2ef5a1f33: Use media config from the schema in the local media server
14
- - 2ef5a1f33: Uses new `schema.config` when resolving media/asset urls
15
- - b348f8b6b: Experimental isomorphic git bridge implementation
16
- - b46e9a481: Fixed issue where child process would start before parent
17
- - fb73fb355: Renames syncFolder to a mediaRoot when configuring Repo-Based Media
18
- - 7b77fe1b5: Add a default TinaMediaStore for repo-based media
19
- - 3e4b3ea7e: media manage uses relieve dir paths
20
- - 99a13024d: Enables paging for local media manager
21
- - Updated dependencies [2ef5a1f33]
22
- - Updated dependencies [2ef5a1f33]
23
- - Updated dependencies [b348f8b6b]
24
- - Updated dependencies [fb73fb355]
25
- - Updated dependencies [4daf15b36]
26
- - @tinacms/graphql@0.61.0
27
- - @tinacms/datalayer@0.2.0
28
- - @tinacms/schema-tools@0.0.6
29
- - @tinacms/metrics@0.0.3
30
-
31
- ## 0.60.23
32
-
33
- ### Patch Changes
34
-
35
- - Updated dependencies [3325cd226]
36
- - @tinacms/graphql@0.60.8
37
-
38
- ## 0.60.22
39
-
40
- ### Patch Changes
41
-
42
- - b1a4290e6: Use media config from the schema in the local media server
43
- - 1955b8842: Uses new `schema.config` when resolving media/asset urls
44
- - Updated dependencies [f6cb634c2]
45
- - Updated dependencies [b1a4290e6]
46
- - Updated dependencies [1955b8842]
47
- - Updated dependencies [8b81c3cf3]
48
- - @tinacms/graphql@0.60.7
49
- - @tinacms/schema-tools@0.0.5
50
- - @tinacms/datalayer@0.1.1
51
- - @tinacms/metrics@0.0.3
52
-
53
- ## 0.60.21
54
-
55
- ### Patch Changes
56
-
57
- - Updated dependencies [e2aafcd93]
58
- - Updated dependencies [a20fed8b7]
59
- - @tinacms/graphql@0.60.6
60
-
61
- ## 0.60.20
62
-
63
- ### Patch Changes
64
-
65
- - f71f55ac3: Fixd issue where --dev caused a breaking change
66
- - Updated dependencies [57f09bdd7]
67
- - @tinacms/graphql@0.60.5
68
-
69
- ## 0.60.19
70
-
71
- ### Patch Changes
72
-
73
- - d103b27ad: Fix issue where new collections would not be added when CLI restarts
74
- - e06dbb3ca: Adds `waitForDB` cmd to cli
75
- - Updated dependencies [d103b27ad]
76
- - @tinacms/graphql@0.60.4
77
-
78
- ## 0.60.18
79
-
80
- ### Patch Changes
81
-
82
- - 79d112d79: Update cli to accept tinaCloudMediaStore flag and add to metadata during schema compilation
83
- - 91d6e6758: revert platform aware paths in schema introduced in https://github.com/tinacms/tinacms/commit/558cc4368cd2a4b6e87dfb82bbfbb6f569f8a6f8
84
- - b1240328d: Adds local server routes for handling media
85
- - 91d6e6758: Fix issues with experimentalData on windows related to path separator inconsistency and interference with the .tina/**generated** folder
86
- - Updated dependencies [79d112d79]
87
- - Updated dependencies [3f46c6706]
88
- - Updated dependencies [db9168578]
89
- - Updated dependencies [91d6e6758]
90
- - @tinacms/graphql@0.60.3
91
-
92
- ## 0.60.17
93
-
94
- ### Patch Changes
95
-
96
- - 08cdb672a: Adds `useRelativeMedia` support to local graphql client
97
- - 646cad8da: Adds support for using the generated client on the frontend
98
- - f857616f6: Rename sdk to queries
99
- - Updated dependencies [08cdb672a]
100
- - Updated dependencies [fdbfe9a16]
101
- - Updated dependencies [6e2ed31a2]
102
- - @tinacms/graphql@0.60.2
103
- - @tinacms/schema-tools@0.0.4
104
-
105
- ## 0.60.16
106
-
107
- ### Patch Changes
108
-
109
- - 7372f90ca: Adds a new client that can be used on the backend and frontend.
110
- - Updated dependencies [3b11ff6ad]
111
- - @tinacms/graphql@0.60.1
112
-
113
- ## 0.60.15
114
-
115
- ### Patch Changes
116
-
117
- - ceb826916: Fix issue where \_app override from tina init was improperly formatted
118
-
119
- ## 0.60.14
120
-
121
- ### Patch Changes
122
-
123
- - Updated dependencies [6a6f137ae]
124
- - @tinacms/graphql@0.60.0
125
-
126
- ## 0.60.13
127
-
128
- ### Patch Changes
129
-
130
- - 9d28ea29e: hide some existing start:server logging behind --verbose flag. format some messages to make them easier to read
131
-
132
- ## 0.60.12
133
-
134
- ### Patch Changes
135
-
136
- - ef450a53a: - Update tinacms CLI to support schemaFileType option (default 'ts') to allow user to specify the schema file type
137
- - Update telemetry module to optionally check NO_TELEMETRY environment variable for disabling telemetry
138
- - 81b729c24: Update formatting of cli init outputs
139
- - 558cc4368: Make schema init platform-aware and refactor database put requests
140
- - Updated dependencies [4da32454b]
141
- - Updated dependencies [921709a7e]
142
- - Updated dependencies [ef450a53a]
143
- - Updated dependencies [a2906d6fe]
144
- - Updated dependencies [558cc4368]
145
- - Updated dependencies [06666d39f]
146
- - Updated dependencies [3e2d9e43a]
147
- - @tinacms/graphql@0.59.11
148
- - @tinacms/schema-tools@0.0.3
149
- - @tinacms/metrics@0.0.3
150
- - @tinacms/datalayer@0.1.1
151
-
152
- ## 0.60.11
153
-
154
- ### Patch Changes
155
-
156
- - Updated dependencies [cf33bcec1]
157
- - @tinacms/graphql@0.59.10
158
-
159
- ## 0.60.10
160
-
161
- ### Patch Changes
162
-
163
- - 6154d12b8: Check for appropriate versions of react and react-dom before initializing with tinacms init
164
- - 8c23d69a2: Adds an MDX example when you run @tinacms/cli init
165
- - abf25c673: The schema can now to used on the frontend (optional for now but will be the main path moving forward).
166
-
167
- ### How to migrate.
168
-
169
- If you gone though the `tinacms init` process there should be a file called `.tina/components/TinaProvider`. In that file you can import the schema from `schema.ts` and add it to the TinaCMS wrapper component.
170
-
171
- ```tsx
172
- import TinaCMS from 'tinacms'
173
- import schema, { tinaConfig } from '../schema.ts'
174
-
175
- // Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle.
176
- // Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode
177
- /**
178
- *
179
- * @private Do not import this directly, please import the dynamic provider instead
180
- */
181
- const TinaProvider = ({ children }) => {
182
- return (
183
- <TinaCMS {...tinaConfig} schema={schema}>
184
- {children}
185
- </TinaCMS>
186
- )
187
- }
188
-
189
- export default TinaProvider
190
- ```
191
-
192
- - Updated dependencies [8b3be903f]
193
- - Updated dependencies [82174ff50]
194
- - Updated dependencies [a87e1e6fa]
195
- - Updated dependencies [abf25c673]
196
- - Updated dependencies [591640db0]
197
- - Updated dependencies [e8b0de1f7]
198
- - Updated dependencies [b01f2e382]
199
- - @tinacms/datalayer@0.1.0
200
- - @tinacms/graphql@0.59.9
201
-
202
- ## 0.60.9
203
-
204
- ### Patch Changes
205
-
206
- - 048538625: fix: return cms on cmsCallback codegen (to fix broken typing)
207
- - Updated dependencies [e7b27ba3b]
208
- - Updated dependencies [11d55f441]
209
- - @tinacms/graphql@0.59.8
210
-
211
- ## 0.60.8
212
-
213
- ### Patch Changes
214
-
215
- - 919f5cb6c: use standard next script names
216
-
217
- ## 0.60.7
218
-
219
- ### Patch Changes
220
-
221
- - 9e436f145: Update CLI to use defineConfig
222
- - 851e4be73: Update tina init to use the new way of laying out tina config
223
- - cc99e4309: update admin file path to /pages/admin.js to support the hash router
224
- - @tinacms/datalayer@0.0.2
225
- - @tinacms/graphql@0.59.7
226
- - @tinacms/metrics@0.0.2
227
-
228
- ## 0.60.6
229
-
230
- ### Patch Changes
231
-
232
- - 98622111d: Use [esbuild](https://esbuild.github.io/) to build the schema instead of typescript.
233
-
234
- This allows the user to
235
-
236
- - use non typescript files like JS, JSX, TS
237
- - Import from outside of the tina folder
238
-
239
- The downside
240
-
241
- - Now type errors will still pass (The schema will compile) and one will get an error at runtime instead of compile time
242
-
243
- - Updated dependencies [c730fa1dd]
244
- - Updated dependencies [cd0f6f022]
245
- - @tinacms/graphql@0.59.7
246
-
247
- ## 0.60.5
248
-
249
- ### Patch Changes
250
-
251
- - 399fbf4fa: Fix an issue where builds weren't happening during CI, this is only an issue for the experimental data layer
252
-
253
- ## 0.60.4
254
-
255
- ### Patch Changes
256
-
257
- - a05546eb4: Added basic open source telemetry
258
-
259
- See [this discussion](https://github.com/tinacms/tinacms/discussions/2451) for more information and how to opt out.
260
-
261
- - Updated dependencies [8bf0ac832]
262
- - Updated dependencies [a05546eb4]
263
- - @tinacms/metrics@0.0.2
264
- - @tinacms/datalayer@0.0.2
265
- - @tinacms/graphql@0.59.6
266
-
267
- ## 0.60.3
268
-
269
- ### Patch Changes
270
-
271
- - 43b40cc8b: Implement useTina in CLI init
272
- - b399c734c: Fixes support for collection.templates in graphql
273
- - Updated dependencies [b399c734c]
274
- - @tinacms/datalayer@0.0.2
275
- - @tinacms/graphql@0.59.6
276
-
277
- ## 0.60.2
278
-
279
- ### Patch Changes
280
-
281
- - d17de356a: Update CLI to use apiUrl
282
- - a67b0c1d7: Dont reinstantiate bridge and store
283
-
284
- ## 0.60.1
285
-
286
- ### Patch Changes
287
-
288
- - Updated dependencies [8ad8f03fd]
289
- - Updated dependencies [04b7988d5]
290
- - Updated dependencies [e3c41f69d]
291
- - Updated dependencies [f5390e841]
292
- - Updated dependencies [32082e0b3]
293
- - @tinacms/graphql@0.59.5
294
- - @tinacms/datalayer@0.0.1
295
-
296
- ## 0.60.0
297
-
298
- ### Minor Changes
299
-
300
- - 35884152b: Adds and audit command that checks files for errors.
301
-
302
- ### Patch Changes
303
-
304
- - 083aa8ec6: Rebuild database every save while in local mode
305
- - Updated dependencies [b66aefde1]
306
- - Updated dependencies [35884152b]
307
- - Updated dependencies [4948beec6]
308
- - @tinacms/graphql@0.59.4
309
-
310
- ## 0.59.0
311
-
312
- ### Minor Changes
313
-
314
- - 70da62fe8: deprecated the use of `getStaticPropsForTina`
315
-
316
- ### Patch Changes
317
-
318
- - 80732bd97: Create a @tinacms/datalayer package which houses the logic for data management for the GraphQL API. This simplifies the @tinacms/graphql package and allows for a clearer separation.
319
- - Updated dependencies [34cd3a44a]
320
- - Updated dependencies [b006a5ab9]
321
- - Updated dependencies [a324b9c37]
322
- - Updated dependencies [80732bd97]
323
- - Updated dependencies [0bec208e2]
324
- - Updated dependencies [5c070a83f]
325
- - @tinacms/graphql@0.59.3
326
- - @tinacms/datalayer@0.0.1
327
-
328
- ## 0.58.5
329
-
330
- ### Patch Changes
331
-
332
- - Updated dependencies [212685fc3]
333
- - @tinacms/graphql@0.59.2
334
-
335
- ## 0.58.4
336
-
337
- ### Patch Changes
338
-
339
- - 118524507: Fixed typo in admin link
340
- - Updated dependencies [f46c6f987]
341
- - @tinacms/graphql@0.59.1
342
-
343
- ## 0.58.3
344
-
345
- ### Patch Changes
346
-
347
- - Updated dependencies [bd4e1f802]
348
- - Updated dependencies [62bea7019]
349
- - @tinacms/graphql@0.59.0
350
-
351
- ## 0.58.2
352
-
353
- ### Patch Changes
354
-
355
- - Updated dependencies [fffce3af8]
356
- - @tinacms/graphql@0.58.2
357
-
358
- ## 0.58.1
359
-
360
- ### Patch Changes
361
-
362
- - Updated dependencies [4700d7ae4]
363
- - @tinacms/graphql@0.58.1
364
-
365
- ## 0.58.0
366
-
367
- ### Minor Changes
368
-
369
- - fa7a0419f: Adds experimental support for a data layer between file-based content and the GraphQL API. This allows documents to be indexed so the CMS can behave more like a traditional CMS, with the ability enforce foreign reference constraints and filtering/pagination capabilities.
370
- - 8c14f29ef: Updated cli to include a new option, `--noSDK`. When this flag is present it will not generate the SDK.
371
-
372
- ### Patch Changes
373
-
374
- - 9c5f888a3: Modifies `tinacms init` for `TinaAdmin`-ready page
375
- - Updated dependencies [eb5fbfac7]
376
- - Updated dependencies [fa7a0419f]
377
- - Updated dependencies [47d126029]
378
- - @tinacms/graphql@0.58.0
379
-
380
- ## 0.57.2
381
-
382
- ### Patch Changes
383
-
384
- - edb2f4011: Trim path property on collections during compilation
385
- - Updated dependencies [edb2f4011]
386
- - @tinacms/graphql@0.57.2
387
-
388
- ## 0.57.1
389
-
390
- ### Patch Changes
391
-
392
- - 50710e1d0: Add no-check for Typescript-generated file
393
- - c78d981e6: Reset entire **generated** folder on re-compile
394
- - Updated dependencies [60729f60c]
395
- - @tinacms/graphql@0.57.1
396
-
397
- ## 0.57.0
398
-
399
- ### Minor Changes
400
-
401
- - d1ed404ba: Add support for auto-generated SDK for type-safe data fetching
402
-
403
- ### Patch Changes
404
-
405
- - 138ceb8c4: Clean up dependencies
406
- - Updated dependencies [138ceb8c4]
407
- - Updated dependencies [577d6a5ad]
408
- - Updated dependencies [ed277e3bd]
409
- - Updated dependencies [d1ed404ba]
410
- - @tinacms/graphql@0.57.0
411
-
412
- ## 0.56.5
413
-
414
- ### Patch Changes
415
-
416
- - 33ebe7a41: updated cli generated files
417
- - Updated dependencies [4b7795612]
418
- - @tinacms/graphql@0.56.1
419
-
420
- ## 0.56.4
421
-
422
- ### Patch Changes
423
-
424
- - b99baebf1: Add rich-text editor based on mdx, bump React dependency requirement to 16.14
425
- - Updated dependencies [891623c7c]
426
- - Updated dependencies [b99baebf1]
427
- - @tinacms/graphql@0.56.0
428
-
429
- ## 0.56.3
430
-
431
- ### Patch Changes
432
-
433
- - 7c389cb0f: Remove Forestry reference in CLI hint
434
-
435
- ## 0.56.2
436
-
437
- ### Patch Changes
438
-
439
- - Updated dependencies [9ecb392ca]
440
- - @tinacms/graphql@0.55.2
441
-
442
- ## 0.56.1
443
-
444
- ### Patch Changes
445
-
446
- - Updated dependencies [ff4446c8e]
447
- - Updated dependencies [667c33e2a]
448
- - @tinacms/graphql@0.55.1
449
-
450
- ## 0.56.0
451
-
452
- ### Minor Changes
453
-
454
- - f3bddeb4a: Added new warning messages for list UI that we do not support by default
455
- - 455a44359: Add noWatch option to server:start command. When this option is used, the config is not regenerated on file changes.
456
-
457
- ### Patch Changes
458
-
459
- - Updated dependencies [2908f8176]
460
- - Updated dependencies [5d83643b2]
461
- - Updated dependencies [f3bddeb4a]
462
- - @tinacms/graphql@0.55.0
463
-
464
- ## 0.55.2
465
-
466
- ### Patch Changes
467
-
468
- - e6e727697: feat: add simpler err message
469
- - 9b27192fe: Build packages with new scripting, which includes preliminary support for ES modules.
470
- - Updated dependencies [9b27192fe]
471
- - @tinacms/graphql@0.54.3
472
-
473
- ## 0.55.1
474
-
475
- ### Patch Changes
476
-
477
- - d94fec611: Improve exported types for defineSchema
478
- - Updated dependencies [d94fec611]
479
- - @tinacms/graphql@0.54.2
480
-
481
- ## 0.55.0
482
-
483
- ### Minor Changes
484
-
485
- - f4f652dae: Updated regex for CSS in tina init CLI
486
-
487
- ## 0.54.2
488
-
489
- ### Patch Changes
490
-
491
- - Updated dependencies [4de977f63]
492
- - @tinacms/graphql@0.54.1
493
-
494
- ## 0.54.1
495
-
496
- ### Patch Changes
497
-
498
- - Updated dependencies [7663e0f7f]
499
- - @tinacms/graphql@0.54.0
500
-
501
- ## 0.54.0
502
-
503
- ### Minor Changes
504
-
505
- - 069c63b73: Tina init command now adds exit-admin path
506
-
507
- ### Patch Changes
508
-
509
- - Updated dependencies [b4f5e973f]
510
- - @tinacms/graphql@0.53.0
511
-
512
- ## 0.53.3
513
-
514
- ### Patch Changes
515
-
516
- - Updated dependencies [b4bbdda86]
517
- - @tinacms/graphql@0.52.2
518
-
519
- ## 0.53.2
520
-
521
- ### Patch Changes
522
-
523
- - Updated dependencies [b05c91c6]
524
- - @tinacms/graphql@0.52.1
525
-
526
- ## 0.53.1
527
-
528
- ### Patch Changes
529
-
530
- - 7d2307321: Fixed the new line character in the @tinacms/cli init command
531
- - Updated dependencies [aa4507697]
532
- - @tinacms/graphql@0.52.0
533
-
534
- ## 0.53.0
535
-
536
- ### Minor Changes
537
-
538
- - 35d6f5e7: Added better error handleing for childProcess
539
-
540
- ## 0.52.2
541
-
542
- ### Patch Changes
543
-
544
- - Updated dependencies [589c7806]
545
- - @tinacms/graphql@0.51.1
546
-
547
- ## 0.52.1
548
-
549
- ### Patch Changes
550
-
551
- - c66b7eef: added regex to add css files to generated file
552
- - Updated dependencies [5a934f6b]
553
- - Updated dependencies [271a72d7]
554
- - @tinacms/graphql@0.51.0
555
-
556
- ## 0.52.0
557
-
558
- ### Minor Changes
559
-
560
- - d6dd2886: Added styles to generated files from CLI
561
-
562
- ### Patch Changes
563
-
564
- - 853330c1: Fix issue where NEXT_PUBLIC_EDIT_BRANCH was actually NEXT_PUBLIC_EDIT_BRACH in generated file
565
-
566
- ## 0.51.1
567
-
568
- ### Patch Changes
569
-
570
- - Updated dependencies [0970961f]
571
- - @tinacms/graphql@0.50.2
572
-
573
- ## 0.51.0
574
-
575
- ### Minor Changes
576
-
577
- - 25e0be67: update generated files in CLI
578
-
579
- ## 0.50.1
580
-
581
- ### Patch Changes
582
-
583
- - Updated dependencies [65b3e3a3]
584
- - @tinacms/graphql@0.50.1
585
-
586
- ## 0.50.0
587
-
588
- ### Minor Changes
589
-
590
- - 7f3c8c1a: # 🔧 Changes coming to TinaCMS ⚙️
591
-
592
- 👋 You may have noticed we've been hard at-work lately building out a more opinionated approach to TinaCMS. To that end, we've settled around a few key points we'd like to announce. To see the work in progress, check out the [main](https://github.com/tinacms/tinacms/tree/main) branch, which will become the primary branch soon.
593
-
594
- ## Consolidating @tinacms packages in to @tinacms/toolkit
595
-
596
- By nature, Tina relies heavily on React context, and the dependency mismatches from over-modularizing our toolkit has led to many bugs related to missing context. To fix this, we'll be consolidating nearly every package in the @tinacms scope to a single package called `@tinacms/toolkit`
597
-
598
- We'll also be rolling out esm support as it's now much easier to address build improvements
599
-
600
- ## A more focused tinacms package
601
-
602
- The `tinacms` package now comes baked-in with APIs for working with the TinaCMS GraphQL API. Because `@tinacms/toolkit` now encompasses everything you'd need to build your own CMS integration, we're repurposing the `tinacms` package to more accurately reflect the "batteries-included" approach.
603
-
604
- If you haven't been introduced, the GraphQL API is a Git-backed CMS which we'll be leaning into more in the future. With a generous free tier and direct syncing with Github its something we're really excited to push forward. Sign up for free here
605
- Note: tinacms still exports the same APIs, but we'll gradually start moving the backend-agnostic tools to @tinacms/toolkit.
606
-
607
- ## Consolidating the tina-graphql-gateway repo
608
-
609
- The tina-graphql-gateway repo will be absorbed into this one. If you've been working with our GraphQL APIs you'll need to follow our migration guide.
610
-
611
- ## Moving from Lerna to Yarn PNP
612
-
613
- We've had success with Yarn 2 and PNP in other monorepos, if you're a contributor you'll notice some updates to the DX, which should hopefully result in a smoother experience.
614
-
615
- ## FAQ
616
-
617
- ### What about other backends?
618
-
619
- The `@tinacms/toolkit` isn't going anywhere. And if you're using packages like `react-tinacms-strapi` or r`eact-tinacms-github` with success, that won't change much, they'll just be powered by `@tinacms/toolkit` under the hood.
620
-
621
- ### Do I need to do anything?
622
-
623
- We'll be bumping all packages to `0.50.0` to reflect the changes. If you're using @tincams scoped packages those won't receive the upgrade. Unscoped packages like `react-tinacms-editor` will be upgraded, and should be bumped to 0.50.0 as well.
624
- When we move to `1.0.0` we'll be pushing internal APIs to `@tinacms/toolkit`, so that's the long-term location of
625
-
626
- ### Will you continue to patch older versions?
627
-
628
- We'll continue to make security patches, however major bug fixes will likely not see any updates. Keep in mind that `@tinacms/toolkit` will continue to be developed.
629
-
630
- ### Patch Changes
631
-
632
- - Updated dependencies [7f3c8c1a]
633
- - @tinacms/graphql@0.1.0
634
-
635
- ## 0.4.0
636
-
637
- ### Minor Changes
638
-
639
- - 7351d92f: # Define schema changes
640
-
641
- We're going to be leaning on a more _primitive_ concept of how types are defined with Tina, and in doing so will be introducing some breaking changes to the way schemas are defined. Read the detailed [RFC discussion](https://github.com/tinacms/rfcs/pull/18) for more on this topic, specifically the [latter portions](https://github.com/tinacms/rfcs/pull/18#issuecomment-805400313) of the discussion.
642
-
643
- ## Collections now accept a `fields` _or_ `templates` property
644
-
645
- You can now provide `fields` instead of `templates` for your collection, doing so will result in a more straightforward schema definition:
646
-
647
- ```js
648
- {
649
- collections: [
650
- {
651
- name: 'post',
652
- label: 'Post',
653
- path: 'content/posts',
654
- fields: [
655
- {
656
- name: 'title',
657
- label: 'Title',
658
- type: 'string', // read on below to learn more about _type_ changes
659
- },
660
- ],
661
- // defining `fields` and `templates` would result in a compilation error
662
- },
663
- ]
664
- }
665
- ```
666
-
667
- **Why?**
668
-
669
- Previously, a collection could define multiple templates, the ambiguity introduced with this feature meant that your documents needed a `_template` field on them so we'd know which one they belonged to. It also mean having to disambiguate your queries in graphql:
670
-
671
- ```graphql
672
- getPostDocument(relativePage: $relativePath) {
673
- data {
674
- ...on Article_Doc_Data {
675
- title
676
- }
677
- }
678
- }
679
- ```
680
-
681
- Going forward, if you use `fields` on a collection, you can omit the `_template` key and simplify your query:
682
-
683
- ```graphql
684
- getPostDocument(relativePage: $relativePath) {
685
- data {
686
- title
687
- }
688
- }
689
- ```
690
-
691
- ## `type` changes
692
-
693
- Types will look a little bit different, and are meant to reflect the lowest form of the shape they can represent. Moving forward, the `ui` field will represent the UI portion of what you might expect. For a blog post "description" field, you'd define it like this:
694
-
695
- ```js
696
- {
697
- type: "string",
698
- label: "Description",
699
- name: "description",
700
- }
701
- ```
702
-
703
- By default `string` will use the `text` field, but you can change that by specifying the `component`:
704
-
705
- ```js
706
- {
707
- type: "string",
708
- label: "Description",
709
- name: "description",
710
- ui: {
711
- component: "textarea"
712
- }
713
- }
714
- ```
715
-
716
- For the most part, the UI properties are added to the field and adhere to the existing capabilities of Tina's core [field plugins](https://tina.io/docs/fields/). But there's nothing stopping you from providing your own components -- just be sure to register those with the CMS object on the frontend:
717
-
718
- ```js
719
- {
720
- type: "string",
721
- label: "Description",
722
- name: "description",
723
- ui: {
724
- component: "myMapField"
725
- someAdditionalMapConfig: 'some-value'
726
- }
727
- }
728
- ```
729
-
730
- [Register](https://tina.io/docs/fields/custom-fields/#registering-the-plugin) your `myMapField` with Tina:
731
-
732
- ```js
733
- cms.fields.add({
734
- name: 'myMapField',
735
- Component: MapPicker,
736
- })
737
- ```
738
-
739
- ### One important gotcha
740
-
741
- Every property in the `defineSchema` API must be serlializable. Meaning functions will not work. For example, there's no way to define a `validate` or `parse` function at this level. However, you can either use the [formify](https://tina.io/docs/tina-cloud/client/#formify) API to get access to the Tina form, or provide your own logic by specifying a plugin of your choice:
742
-
743
- ```js
744
- {
745
- type: "string",
746
- label: "Description",
747
- name: "description",
748
- ui: {
749
- component: "myText"
750
- }
751
- }
752
- ```
753
-
754
- And then when you register the plugin, provide your custom logic here:
755
-
756
- ```js
757
- import { TextFieldPlugin } from 'tinacms'
758
-
759
- // ...
760
-
761
- cms.fields.add({
762
- ...TextFieldPlugin, // spread existing text plugin
763
- name: 'myText',
764
- validate: value => {
765
- someValidationLogic(value)
766
- },
767
- })
768
- ```
769
-
770
- **Why?**
771
-
772
- The reality is that under the hood this has made no difference to the backend, so we're removing it as a point of friction. Instead, `type` is the true definition of the field's _shape_, while `ui` can be used for customizing the look and behavior of the field's UI.
773
-
774
- ## Defensive coding in Tina
775
-
776
- When working with GraphQL, there are 2 reasons a property may not be present.
777
-
778
- 1. The data is not a required property. That is to say, if I have a blog post document, and "category" is an optional field, we'll need to make sure we factor that into how we render our page:
779
-
780
- ```tsx
781
- const MyPage = props => {
782
- return (
783
- <>
784
- <h2>{props.getPostDocument.data.title}</h2>
785
- <MyCategoryComponent>
786
- {props.getPostDocument.data?.category}
787
- </MyCategoryComponent>
788
- </>
789
- )
790
- }
791
- ```
792
-
793
- 2. The query did not ask for that field:
794
-
795
- ```graphql
796
- {
797
- getPostDocument {
798
- data {
799
- title
800
- }
801
- }
802
- }
803
- ```
804
-
805
- But with Tina, there's a 3rd scenario: the document may be in an invalid state. Meaning, we could mark the field as `required` _and_ query for the appropriate field, and _still_ not have the expected shape of data. Due to the contextual nature of Tina, it's very common to be in an intermediate state, where your data is incomplete simply because you're still working on it. Most APIs would throw an error when a document is in an invalid state. Or, more likely, you couldn't even request it.
806
-
807
- ## Undefined list fields will return `null`
808
-
809
- Previously an listable field which wasn't defined in the document was treated as an emptry array. So for example:
810
-
811
- ```md
812
- ---
813
- title: 'Hello, World'
814
- categories:
815
- - sports
816
- - movies
817
- ---
818
- ```
819
-
820
- The responsee would be `categories: ['sports', 'movies']`. If you omit the items, but kept the empty array:
821
-
822
- ```md
823
- ---
824
- title: 'Hello, World'
825
- categories: []
826
- ---
827
- ```
828
-
829
- The responsee would be `categories: []`. If you omit the field entirely:
830
-
831
- ```md
832
- ---
833
- title: 'Hello, World'
834
- ---
835
- ```
836
-
837
- The response will be `categories: null`. Previously this would have been `[]`, which was incorrect.
838
-
839
- ## For a listable item which is `required: true` you _must_ provide a `ui.defaultItem` property
840
-
841
- ### Why?
842
-
843
- It's possible for Tina's editing capabilities to introduce an invalid state during edits to list items. Imagine the scenario where you are iterating through an array of objects, and each object has a categories array on it we'd like to render:
844
-
845
- ```tsx
846
- const MyPage = props => {
847
- return props.blocks.map(block => {
848
- return (
849
- <>
850
- <h2>{block.categories.split(',')}</h2>
851
- </>
852
- )
853
- })
854
- }
855
- ```
856
-
857
- For a new item, `categories` will be null, so we'll get an error. This only happens when you're editing your page with Tina, so it's not a production-facing issue.
858
-
859
- ## Every `type` can be a list
860
-
861
- Previously, we had a `list` field, which allowed you to supply a `field` property. Instead, _every_ primitive type can be represented as a list:
862
-
863
- ```js
864
- {
865
- type: "string",
866
- label: "Categories",
867
- name: "categories",
868
- list: true
869
- }
870
- ```
871
-
872
- Additionally, enumerable lists and selects are inferred from the `options` property. The following example is represented by a `select` field:
873
-
874
- ```js
875
- {
876
- type: "string",
877
- label: "Categories",
878
- name: "categories",
879
- options: ["fitness", "movies", "music"]
880
- }
881
- ```
882
-
883
- While this, is a `checkbox` field
884
-
885
- ```js
886
- {
887
- type: "string",
888
- label: "Categories",
889
- name: "categories"
890
- list: true,
891
- options: ["fitness", "movies", "music"]
892
- }
893
- ```
894
-
895
- > Note we may introduce an `enum` type, but haven't discussed it thoroughly
896
-
897
- ## Introducing the `object` type
898
-
899
- Tina currently represents the concept of an _object_ in two ways: a `group` (and `group-list`), which is a uniform collection of fields; and `blocks`, which is a polymporphic collection. Moving forward, we'll be introducing a more comporehensive type, which envelopes the behavior of both `group` and `blocks`, and since _every_ field can be a `list`, this also makes `group-list` redundant.
900
-
901
- > Note: we've previously assumed that `blocks` usage would _always_ be as an array. We'll be keeping that assumption with the `blocks` type for compatibility, but `object` will allow for non-array polymorphic objects.
902
-
903
- ### Defining an `object` type
904
-
905
- An `object` type takes either a `fields` _or_ `templates` property (just like the `collections` definition). If you supply `fields`, you'll end up with what is essentially a `group` item. And if you say `list: true`, you'll have what used to be a `group-list` definition.
906
-
907
- Likewise, if you supply a `templates` field and `list: true`, you'll get the same API as `blocks`. However you can also say `list: false` (or omit it entirely), and you'll have a polymorphic object which is _not_ an array.
908
-
909
- This is identical to the current `blocks` definition:
910
-
911
- ```js
912
- {
913
- type: "object",
914
- label: "Page Sections",
915
- name: "pageSections",
916
- list: true,
917
- templates: [{
918
- label: "Hero",
919
- name: "hero",
920
- fields: [{
921
- label: "Title",
922
- name: "title",
923
- type: "string"
924
- }]
925
- }]
926
- }
927
- ```
928
-
929
- And here is one for `group`:
930
-
931
- ```js
932
- {
933
- type: "object",
934
- label: "Hero",
935
- name: "hero",
936
- fields: [{
937
- label: "Title",
938
- name: "title",
939
- type: "string"
940
- }]
941
- }
942
- ```
943
-
944
- ## `dataJSON` field
945
-
946
- You can now request `dataJSON` for the entire data object as a single query key. This is great for more tedius queries like theme files where including each item in the result is cumbersome.
947
-
948
- > Note there is no typescript help for this feature for now
949
-
950
- ```graphql
951
- getThemeDocument(relativePath: $relativePath) {
952
- dataJSON
953
- }
954
- ```
955
-
956
- ```json
957
- {
958
- "getThemeDocument": {
959
- "dataJSON": {
960
- "every": "field",
961
- "in": {
962
- "the": "document"
963
- },
964
- "is": "returned"
965
- }
966
- }
967
- }
968
- ```
969
-
970
- ## Lists queries will now adhere to the GraphQL connection spec
971
-
972
- [Read the spec](https://relay.dev/graphql/connections.htm)
973
-
974
- Previously, lists would return a simple array of items:
975
-
976
- ```graphql
977
- {
978
- getPostsList {
979
- id
980
- }
981
- }
982
- ```
983
-
984
- Which would result in:
985
-
986
- ```json
987
- {
988
- "data": {
989
- "getPostsList": [
990
- {
991
- "id": "content/posts/voteForPedro.md"
992
- }
993
- ]
994
- }
995
- }
996
- ```
997
-
998
- In the new API, you'll need to step through `edges` & `nodes`:
999
-
1000
- ```graphql
1001
- {
1002
- getPostsList {
1003
- edges {
1004
- node {
1005
- id
1006
- }
1007
- }
1008
- }
1009
- }
1010
- ```
1011
-
1012
- ```json
1013
- {
1014
- "data": {
1015
- "getPostsList": {
1016
- "edges": [
1017
- {
1018
- "node": {
1019
- "id": "content/posts/voteForPedro.md"
1020
- }
1021
- }
1022
- ]
1023
- }
1024
- }
1025
- }
1026
- ```
1027
-
1028
- **Why?**
1029
-
1030
- The GraphQL connection spec opens up a more future-proof structure, allowing us to put more information in to the _connection_ itself like how many results have been returned, and how to request the next page of data.
1031
-
1032
- Read [a detailed explanation](https://graphql.org/learn/pagination/) of how the connection spec provides a richer set of capabilities.
1033
-
1034
- > Note: sorting and filtering is still not supported for list queries.
1035
-
1036
- ## `_body` is no longer included by default
1037
-
1038
- There is instead an `isBody` boolean which can be added to any `string` field
1039
-
1040
- **Why?**
1041
-
1042
- Since markdown files sort of have an implicit "body" to them, we were automatically populating a field which represented the body of your markdown file. This wasn't that useful, and kind of annoying. Instead, just attach `isBody` to the field which you want to represent your markdown "body":
1043
-
1044
- ```js
1045
- {
1046
- collections: [{
1047
- name: "post",
1048
- label: "Post",
1049
- path: "content/posts",
1050
- fields: [
1051
- {
1052
- name: "title",
1053
- label: "Title",
1054
- type: "string"
1055
- }
1056
- {
1057
- name: "myBody",
1058
- label: "My Body",
1059
- type: "string",
1060
- component: 'textarea',
1061
- isBody: true
1062
- }
1063
- ]
1064
- }]
1065
- }
1066
- ```
1067
-
1068
- This would result in a form field called `My Body` getting saved to the body of your markdown file (if you're using markdown):
1069
-
1070
- ```md
1071
- ---
1072
- title: Hello, World!
1073
- ---
1074
-
1075
- This is the body of the file, it's edited through the "My Body" field in your form.
1076
- ```
1077
-
1078
- ## References now point to more than one collection.
1079
-
1080
- Instead of a `collection` property, you must now define a `collections` field, which is an array:
1081
-
1082
- ```js
1083
- {
1084
- type: "reference",
1085
- label: "Author",
1086
- name: "author",
1087
- collections: ["author"]
1088
- }
1089
- ```
1090
-
1091
- ```graphql
1092
- {
1093
- getPostDocument(relativePath: "hello.md") {
1094
- data {
1095
- title
1096
- author {
1097
- ...on Author_Document {
1098
- name
1099
- }
1100
- ...on Post_Document {
1101
- title
1102
- }
1103
- }
1104
- }
1105
- }
1106
- ```
1107
-
1108
- ## Other breaking changes
1109
-
1110
- ### The `template` field on polymorphic objects (formerly _blocks_) is now `_template`
1111
-
1112
- **Old API:**
1113
-
1114
- ```md
1115
- ---
1116
- ---
1117
- myBlocks:
1118
- - template: hero
1119
- title: Hello
1120
- ---
1121
- ```
1122
-
1123
- **New API:**
1124
-
1125
- ```md
1126
- ---
1127
- ---
1128
- myBlocks:
1129
- - \_template: hero
1130
- title: Hello
1131
- ---
1132
- ```
1133
-
1134
- ### `data` `__typename` values have changed
1135
-
1136
- They now include the proper namespace to prevent naming collisions and no longer require `_Doc_Data` suffix. All generated `__typename` properties are going to be slightly different. We weren't fully namespacing fields so it wasn't possible to guarantee that no collisions would occur. The pain felt here will likely be most seen when querying and filtering through blocks. This ensures the stability of this type in the future
1137
-
1138
- ```graphql
1139
- {
1140
- getPageDocument(relativePath: "home.md") {
1141
- data {
1142
- title
1143
- myBlocks {
1144
- ...on Page_Hero_Data { # previously this would have been Hero_Data
1145
- # ...
1146
- }
1147
- }
1148
- }
1149
- }
1150
- ```
1151
-
1152
- - 33e27538: Init command now adds admin.tsx file to the users pages folder
1153
- - 8c8fc2ad: Init script now checks for file extention.
1154
-
1155
- ### Patch Changes
1156
-
1157
- - 5cd5ce76: - Improve types for ui field
1158
- - Marks system fields as required so the user has a guarantee that they'll be there
1159
- - Return null for listable fields which are null or undefined
1160
- - Handle null values for reference fields better
1161
- - Updated dependencies [fdb7724b]
1162
- - Updated dependencies [d42e2bcf]
1163
- - Updated dependencies [5cd5ce76]
1164
- - Updated dependencies [8c425440]
1165
- - Updated dependencies [7351d92f]
1166
- - tina-graphql@0.2.0
1167
- - tina-graphql-helpers@0.1.2
1168
-
1169
- ## 0.3.1
1170
-
1171
- ### Patch Changes
1172
-
1173
- - ebe77b21: added iframe to tina init generate page
1174
-
1175
- ## 0.3.0
1176
-
1177
- ### Minor Changes
1178
-
1179
- - fa3967b3: tina-gql init command now updates the users package.json with tina-dev scripts and adds a \_app.js files into the users project
1180
-
1181
- ## 0.2.60
1182
-
1183
- ### Patch Changes
1184
-
1185
- - c21bda17: Allow single command arguments to be passed in the sub command for the server:start command
1186
- - Updated dependencies [348ef1e5]
1187
- - tina-graphql@0.1.25
1188
-
1189
- ## 0.2.58
1190
-
1191
- ### Patch Changes
1192
-
1193
- - Updated dependencies [b36de960]
1194
- - tina-graphql@0.1.24
1195
-
1196
- ## 0.2.57
1197
-
1198
- ### Patch Changes
1199
-
1200
- - Bump packages to reflect new changest capabilities
1201
- - Updated dependencies [undefined]
1202
- - tina-graphql@0.1.23
1203
- - tina-graphql-helpers@0.1.1
1204
-
1205
- ## 0.2.56
1206
-
1207
- ### Patch Changes
1208
-
1209
- - Updated dependencies [undefined]
1210
- - tina-graphql-helpers@0.1.0
1211
- - tina-graphql@0.1.22
1212
-
1213
- ## 0.2.55
1214
-
1215
- ### Patch Changes
1216
-
1217
- - Updated dependencies [undefined]
1218
- - tina-graphql@0.1.21