@tinacms/cli 0.60.13 → 0.60.14

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,12 @@
1
1
  # tinacms-cli
2
2
 
3
+ ## 0.60.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6a6f137ae]
8
+ - @tinacms/graphql@0.60.0
9
+
3
10
  ## 0.60.13
4
11
 
5
12
  ### Patch Changes
package/bin/tinacms CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require = require("esm")(module);
4
- require("../dist").init(process.argv);
3
+ require = require('esm')(module)
4
+ require('../dist').init(process.argv)
@@ -1,4 +1,4 @@
1
1
  export declare const adminPage = "import { TinaAdmin } from 'tinacms';\nexport default TinaAdmin;\n";
2
- export declare const blogPost = "---\ntitle: Vote For Pedro\n---\n# Welcome to the blog.\n\n> To edit this site head over to the [`/admin`](/admin) route. Then click the pencil icon in the bottom lefthand corner to start editing \uD83E\uDD99. \n\n# Dixi gaude Arethusa\n\n<PageSection heading=\"Oscula mihi\" content=\"Lorem markdownum numerabilis armentorum platanus, cultros coniunx sibi per\nsilvas, nostris clausit sequemur diverso scopulosque. Fecit tum alta sed non\nfalcato murmura, geminas donata Amyntore, quoque Nox. Invitam inquit, modo\nnocte; ut ignis faciemque manes in imagine sinistra ut mucrone non ramos\nsepulcro supplex. Crescentesque populos motura, fit cumque. Verumque est; retro\nsibi tristia bracchia Aetola telae caruerunt et.\"/>\n\n\n## Mutato fefellimus sit demisit aut alterius sollicito\n\nPhaethonteos vestes quem involvite iuvenca; furiali anne: sati totumque,\n**corpora** cum rapacibus nunc! Nervis repetatne, miserabile doleas, deprensum\nhunc, fluctus Threicio, ad urbes, magicaeque, quid. Per credensque series adicis\npoteram [quidem](#)! Iam uni mensas victrix\nvittas ut flumina Satyri adulter; bellum iacet domitae repercusso truncis urnis\nmille rigidi sub taurum.\n\n\n";
2
+ export declare const blogPost = "---\ntitle: Vote For Pedro\n---\n# Welcome to the blog.\n\n> To edit this site head over to the [`/admin`](/admin) route. Then click the pencil icon in the bottom lefthand corner to start editing \uD83E\uDD99.\n\n# Dixi gaude Arethusa\n\n<PageSection heading=\"Oscula mihi\" content=\"Lorem markdownum numerabilis armentorum platanus, cultros coniunx sibi per\nsilvas, nostris clausit sequemur diverso scopulosque. Fecit tum alta sed non\nfalcato murmura, geminas donata Amyntore, quoque Nox. Invitam inquit, modo\nnocte; ut ignis faciemque manes in imagine sinistra ut mucrone non ramos\nsepulcro supplex. Crescentesque populos motura, fit cumque. Verumque est; retro\nsibi tristia bracchia Aetola telae caruerunt et.\"/>\n\n\n## Mutato fefellimus sit demisit aut alterius sollicito\n\nPhaethonteos vestes quem involvite iuvenca; furiali anne: sati totumque,\n**corpora** cum rapacibus nunc! Nervis repetatne, miserabile doleas, deprensum\nhunc, fluctus Threicio, ad urbes, magicaeque, quid. Per credensque series adicis\npoteram [quidem](#)! Iam uni mensas victrix\nvittas ut flumina Satyri adulter; bellum iacet domitae repercusso truncis urnis\nmille rigidi sub taurum.\n\n\n";
3
3
  export declare const nextPostPage: () => string;
4
4
  export declare const AppJsContent: (usingSrc: boolean, extraImports?: string) => string;
package/dist/index.js CHANGED
@@ -79,7 +79,7 @@ var init_server = __esm({
79
79
  # We've got a simple query set up for you to get started
80
80
  # but there's plenty more for you to explore on your own!
81
81
  query MyQuery {
82
- getCollections {
82
+ collections {
83
83
  documents {
84
84
  id
85
85
  sys {
@@ -114,7 +114,7 @@ var commander = __toModule(require("commander"));
114
114
 
115
115
  // pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/package.json
116
116
  var name = "@tinacms/cli";
117
- var version = "0.60.13";
117
+ var version = "0.60.14";
118
118
 
119
119
  // pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/query-gen/attachSchema.ts
120
120
  var import_graphql = __toModule(require("@tinacms/graphql"));
@@ -393,13 +393,13 @@ var auditCollection = async (args) => {
393
393
  const { collection, database, rootPath: rootPath2 } = args;
394
394
  logger.info(`Checking collection ${collection.name}`);
395
395
  const query = `query {
396
- getCollection(collection: "${collection.name}") {
396
+ collection(collection: "${collection.name}") {
397
397
  format
398
398
  documents {
399
399
  edges {
400
400
  node {
401
401
  ...on Document {
402
- sys {
402
+ _sys {
403
403
  extension
404
404
  path
405
405
  }
@@ -415,15 +415,15 @@ var auditCollection = async (args) => {
415
415
  query,
416
416
  variables: {}
417
417
  });
418
- const format = result.data.getCollection.format;
419
- const docs = result.data.getCollection.documents.edges;
418
+ const format = result.data.collection.format;
419
+ const docs = result.data.collection.documents.edges;
420
420
  docs.forEach((x) => {
421
421
  const node = x.node;
422
- if (node.sys.extension.replace(".", "") !== format) {
422
+ if (node._sys.extension.replace(".", "") !== format) {
423
423
  warning = true;
424
- logger.warn(import_chalk2.default.yellowBright(`WARNING: there is a file with extension \`${node.sys.extension}\` but in your schema it is defined to be \`.${format}\`
424
+ logger.warn(import_chalk2.default.yellowBright(`WARNING: there is a file with extension \`${node._sys.extension}\` but in your schema it is defined to be \`.${format}\`
425
425
 
426
- location: ${import_path2.default.join(rootPath2, node.sys.path)}`));
426
+ location: ${import_path2.default.join(rootPath2, node._sys.path)}`));
427
427
  }
428
428
  });
429
429
  return warning;
@@ -431,14 +431,14 @@ location: ${import_path2.default.join(rootPath2, node.sys.path)}`));
431
431
  var auditDocuments = async (args) => {
432
432
  const { collection, database, rootPath: rootPath2, useDefaultValues } = args;
433
433
  const query = `query {
434
- getCollection(collection: "${collection.name}") {
434
+ collection(collection: "${collection.name}") {
435
435
  format
436
436
  slug
437
437
  documents {
438
438
  edges {
439
439
  node {
440
440
  ...on Document {
441
- sys {
441
+ _sys {
442
442
  extension
443
443
  path
444
444
  relativePath
@@ -456,16 +456,16 @@ var auditDocuments = async (args) => {
456
456
  variables: {}
457
457
  });
458
458
  let error = false;
459
- const documents = result.data.getCollection.documents.edges;
459
+ const documents = result.data.collection.documents.edges;
460
460
  for (let i = 0; i < documents.length; i++) {
461
461
  const node = documents[i].node;
462
- const fullPath = import_path2.default.join(rootPath2, node.sys.path);
462
+ const fullPath = import_path2.default.join(rootPath2, node._sys.path);
463
463
  logger.info(`Checking document: ${fullPath}`);
464
464
  const documentQuery = `query {
465
- getDocument(collection: "${collection.name}", relativePath: "${node.sys.relativePath}") {
465
+ document(collection: "${collection.name}", relativePath: "${node._sys.relativePath}") {
466
466
  __typename
467
467
  ...on Document {
468
- values
468
+ _values
469
469
  }
470
470
  }
471
471
  }`;
@@ -483,7 +483,7 @@ var auditDocuments = async (args) => {
483
483
  }
484
484
  });
485
485
  }
486
- const params = transformDocumentIntoMutationRequestPayload(docResult.data.getDocument.values, {
486
+ const params = transformDocumentIntoMutationRequestPayload(docResult.data.document._values, {
487
487
  includeCollection: true,
488
488
  includeTemplate: typeof collection.templates !== "undefined"
489
489
  }, topLevelDefaults);
@@ -500,7 +500,7 @@ var auditDocuments = async (args) => {
500
500
  variables: {
501
501
  params,
502
502
  collection: collection.name,
503
- relativePath: node.sys.relativePath
503
+ relativePath: node._sys.relativePath
504
504
  },
505
505
  silenceErrors: true
506
506
  });
@@ -637,7 +637,7 @@ title: Vote For Pedro
637
637
  ---
638
638
  # Welcome to the blog.
639
639
 
640
- > To edit this site head over to the [\`/admin\`](/admin) route. Then click the pencil icon in the bottom lefthand corner to start editing \u{1F999}.
640
+ > To edit this site head over to the [\`/admin\`](/admin) route. Then click the pencil icon in the bottom lefthand corner to start editing \u{1F999}.
641
641
 
642
642
  # Dixi gaude Arethusa
643
643
 
@@ -662,7 +662,7 @@ mille rigidi sub taurum.
662
662
  `;
663
663
  var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
664
664
  // This is a demo file once you have tina setup feel free to delete this file
665
-
665
+
666
666
  import { staticRequest, gql } from "tinacms";
667
667
  import Head from "next/head";
668
668
  import { createGlobalStyle } from "styled-components";
@@ -671,11 +671,9 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
671
671
 
672
672
  const query = gql\`
673
673
  query BlogPostQuery($relativePath: String!) {
674
- getPostsDocument(relativePath: $relativePath) {
675
- data {
674
+ posts(relativePath: $relativePath) {
676
675
  title
677
- body
678
- }
676
+ body
679
677
  }
680
678
  }
681
679
  \`
@@ -713,7 +711,7 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
713
711
  text-decoration: underline;
714
712
  }
715
713
  \`;
716
-
714
+
717
715
  const BlogPage = (props) => {
718
716
  const { data } = useTina({
719
717
  query,
@@ -740,10 +738,10 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
740
738
  }}
741
739
  >
742
740
  <h1 className="text-3xl m-8 text-center leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl">
743
- {data.getPostsDocument.data.title}
741
+ {data.posts.title}
744
742
  </h1>
745
743
  <ContentSection
746
- content={data.getPostsDocument.data.body}
744
+ content={data.posts.body}
747
745
  ></ContentSection>
748
746
  </div>
749
747
  <div className="bg-green-100 text-center">
@@ -761,7 +759,7 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
761
759
  </>
762
760
  );
763
761
  };
764
-
762
+
765
763
  export const getStaticProps = async ({ params }) => {
766
764
  const variables = { relativePath: \`\${params.filename}.md\` }
767
765
  let data = {}
@@ -782,16 +780,18 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
782
780
  },
783
781
  }
784
782
  };
785
-
783
+
786
784
  export const getStaticPaths = async () => {
787
785
  const postsListData = (await staticRequest({
788
786
  query: gql\`
789
787
  query GetPostsList {
790
- getPostsList {
788
+ postsConnection {
791
789
  edges {
792
790
  node {
793
- sys {
794
- filename
791
+ ...on Document {
792
+ _sys {
793
+ filename
794
+ }
795
795
  }
796
796
  }
797
797
  }
@@ -799,15 +799,15 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
799
799
  }
800
800
  \`,
801
801
  }));
802
-
802
+
803
803
  return {
804
- paths: postsListData.getPostsList.edges.map((post) => ({
805
- params: { filename: post.node.sys.filename },
804
+ paths: postsListData.postsConnection.edges.map((post) => ({
805
+ params: { filename: post.node._sys.filename },
806
806
  })),
807
807
  fallback: false,
808
808
  };
809
809
  };
810
-
810
+
811
811
  export default BlogPage;
812
812
 
813
813
  const PageSection = props => {
@@ -822,7 +822,7 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
822
822
  const components = {
823
823
  PageSection: PageSection,
824
824
  }
825
-
825
+
826
826
  const ContentSection = ({ content }) => {
827
827
  return (
828
828
  <div className="relative py-16 bg-white overflow-hidden">
@@ -938,7 +938,7 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
938
938
  </div>
939
939
  );
940
940
  };
941
-
941
+
942
942
  `;
943
943
  var AppJsContent = (usingSrc, extraImports) => {
944
944
  const importLine = import_chalk4.default.green(`+ import Tina from '${usingSrc ? "../" : ""}../.tina/components/TinaDynamicProvider.js'`);
@@ -1255,7 +1255,7 @@ var import_esbuild = __toModule(require("esbuild"));
1255
1255
  var defaultSchema = (sep) => `
1256
1256
  import { defineSchema, defineConfig } from "tinacms";
1257
1257
 
1258
- export default defineSchema({
1258
+ const schema = defineSchema({
1259
1259
  collections: [
1260
1260
  {
1261
1261
  label: "Blog Posts",
@@ -1299,8 +1299,7 @@ export default defineSchema({
1299
1299
  ],
1300
1300
  });
1301
1301
 
1302
-
1303
-
1302
+ export default schema
1304
1303
 
1305
1304
  // Your tina config
1306
1305
  // ==============
@@ -1314,6 +1313,7 @@ const apiURL =
1314
1313
 
1315
1314
  export const tinaConfig = defineConfig({
1316
1315
  apiURL,
1316
+ schema,
1317
1317
  cmsCallback: (cms) => {
1318
1318
  // add your CMS callback code here (if you want)
1319
1319
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "0.60.13",
3
+ "version": "0.60.14",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -58,7 +58,7 @@
58
58
  "@graphql-tools/graphql-file-loader": "^7.2.0",
59
59
  "@graphql-tools/load": "^7.3.2",
60
60
  "@tinacms/datalayer": "0.1.1",
61
- "@tinacms/graphql": "0.59.11",
61
+ "@tinacms/graphql": "0.60.0",
62
62
  "@tinacms/metrics": "0.0.3",
63
63
  "@tinacms/schema-tools": "0.0.3",
64
64
  "@yarnpkg/esbuild-plugin-pnp": "^2.0.1-rc.3",