@tinacms/schema-tools 0.0.0-202222115457 → 0.0.1
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/dist/index.js +1 -1
- package/dist/schema/TinaSchema.d.ts +1 -1
- package/package.json +1 -1
- package/CHANGELOG.md +0 -31
package/dist/index.js
CHANGED
|
@@ -213,7 +213,7 @@ var TinaSchema = class {
|
|
|
213
213
|
}
|
|
214
214
|
return globalTemplate;
|
|
215
215
|
};
|
|
216
|
-
this.getCollectionByFullPath =
|
|
216
|
+
this.getCollectionByFullPath = (filepath) => {
|
|
217
217
|
const collection = this.getCollections().find((collection2) => {
|
|
218
218
|
return filepath.replace("\\", "/").startsWith(collection2.path);
|
|
219
219
|
});
|
|
@@ -54,7 +54,7 @@ export declare class TinaSchema {
|
|
|
54
54
|
fields: import("../types").TinaFieldInner<true>[];
|
|
55
55
|
namespace: string[];
|
|
56
56
|
};
|
|
57
|
-
getCollectionByFullPath: (filepath: string) =>
|
|
57
|
+
getCollectionByFullPath: (filepath: string) => TinaCloudCollection<true>;
|
|
58
58
|
getCollectionAndTemplateByFullPath: (filepath: string, templateName?: string) => {
|
|
59
59
|
collection: TinaCloudCollection<true>;
|
|
60
60
|
template: Templateable;
|
package/package.json
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# @tinacms/schema-tools
|
|
2
|
-
|
|
3
|
-
## 0.0.0-202222115457
|
|
4
|
-
### Patch Changes
|
|
5
|
-
|
|
6
|
-
- abf25c673: The schema can now to used on the frontend (optional for now but will be the main path moving forward).
|
|
7
|
-
|
|
8
|
-
### How to migrate.
|
|
9
|
-
|
|
10
|
-
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.
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
import TinaCMS from 'tinacms'
|
|
14
|
-
import schema, { tinaConfig } from '../schema.ts'
|
|
15
|
-
|
|
16
|
-
// Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle.
|
|
17
|
-
// Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @private Do not import this directly, please import the dynamic provider instead
|
|
21
|
-
*/
|
|
22
|
-
const TinaProvider = ({ children }) => {
|
|
23
|
-
return (
|
|
24
|
-
<TinaCMS {...tinaConfig} schema={schema}>
|
|
25
|
-
{children}
|
|
26
|
-
</TinaCMS>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default TinaProvider
|
|
31
|
-
```
|