@tinacms/cli 0.60.2 → 0.60.3

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # tinacms-cli
2
2
 
3
+ ## 0.60.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 43b40cc8b: Implement useTina in CLI init
8
+ - b399c734c: Fixes support for collection.templates in graphql
9
+ - Updated dependencies [b399c734c]
10
+ - @tinacms/datalayer@0.0.2
11
+ - @tinacms/graphql@0.59.6
12
+
3
13
  ## 0.60.2
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ var commander = __toModule(require("commander"));
85
85
 
86
86
  // pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/package.json
87
87
  var name = "@tinacms/cli";
88
- var version = "0.60.2";
88
+ var version = "0.60.3";
89
89
 
90
90
  // pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/utils/theme.ts
91
91
  var import_chalk = __toModule(require("chalk"));
@@ -639,7 +639,19 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
639
639
  import { staticRequest, gql } from "tinacms";
640
640
  import Head from "next/head";
641
641
  import { createGlobalStyle } from "styled-components";
642
-
642
+ import { useTina } from "tinacms/dist/edit-state";
643
+
644
+ const query = gql\`
645
+ query BlogPostQuery($relativePath: String!) {
646
+ getPostsDocument(relativePath: $relativePath) {
647
+ data {
648
+ title
649
+ body
650
+ }
651
+ }
652
+ }
653
+ \`
654
+
643
655
  // Styles for markdown
644
656
  const GlobalStyle = createGlobalStyle\`
645
657
  h1,h2,h3,h4,h5 {
@@ -676,6 +688,12 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
676
688
  const defaultMarked = (markdown) => markdown;
677
689
  // Use the props returned by get static props (this can be deleted when the edit provider and tina-wrapper are moved to _app.js)
678
690
  const BlogPage = (props) => {
691
+ const { data } = useTina({
692
+ query,
693
+ variables: props.variables,
694
+ data: props.data,
695
+ });
696
+
679
697
  return (
680
698
  <>
681
699
  <Head>
@@ -701,12 +719,12 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
701
719
  }}
702
720
  >
703
721
  <h1 className="text-3xl m-8 text-center leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl">
704
- {props.data.getPostsDocument.data.title}
722
+ {data.getPostsDocument.data.title}
705
723
  </h1>
706
724
  {/* Convert markdown to html in the browser only */}
707
725
  {typeof window !== "undefined" && (
708
726
  <ContentSection
709
- content={window.marked.parse(props.data.getPostsDocument.data.body)}
727
+ content={window.marked.parse(data.getPostsDocument.data.body)}
710
728
  ></ContentSection>
711
729
  )}
712
730
  </div>
@@ -727,16 +745,6 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
727
745
  };
728
746
 
729
747
  export const getStaticProps = async ({ params }) => {
730
- const query = gql\`
731
- query BlogPostQuery($relativePath: String!) {
732
- getPostsDocument(relativePath: $relativePath) {
733
- data {
734
- title
735
- body
736
- }
737
- }
738
- }
739
- \`
740
748
  const variables = { relativePath: \`\${params.filename}.md\` }
741
749
  let data = {}
742
750
  try {
@@ -750,7 +758,6 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
750
758
 
751
759
  return {
752
760
  props: {
753
- query,
754
761
  variables,
755
762
  data,
756
763
  //myOtherProp: 'some-other-data',
@@ -920,9 +927,9 @@ const App = ({ Component, pageProps }) => {
920
927
  editMode={
921
928
  <TinaCMS
922
929
  apiURL={apiURL}
923
- {...pageProps}
930
+
924
931
  >
925
- {(livePageProps) => <Component {...livePageProps} />}
932
+ <Component {...pageProps} />
926
933
  </TinaCMS>
927
934
  }
928
935
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "0.60.2",
3
+ "version": "0.60.3",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -56,8 +56,8 @@
56
56
  "@graphql-codegen/visitor-plugin-common": "^2.4.0",
57
57
  "@graphql-tools/graphql-file-loader": "^7.2.0",
58
58
  "@graphql-tools/load": "^7.3.2",
59
- "@tinacms/datalayer": "0.0.1",
60
- "@tinacms/graphql": "0.59.5",
59
+ "@tinacms/datalayer": "0.0.2",
60
+ "@tinacms/graphql": "0.59.6",
61
61
  "ajv": "^6.12.3",
62
62
  "altair-express-middleware": "4.0.6",
63
63
  "auto-bind": "^4.0.0",