@tinacms/cli 0.0.0-e5c0e91-20250421003142 → 0.0.0-e6ffde4-20251216055147

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- The _TinaCloud CLI_ can be used to set up your project with TinaCloud configuration, and run a local version of the TinaCloud content-api (using your file system's content). For a real-world example of how this is being used checkout the [TinaCloud Starter](https://github.com/tinacms/tina-cloud-starter).
1
+ The _TinaCloud CLI_ can be used to set up your project with TinaCloud configuration, and run a local version of the TinaCloud content-api (using your file system's content). For a real-world example of how this is being used checkout the [TinaCloud Starter](https://github.com/tinacms/tina-nextjs-starter).
2
2
 
3
3
  ## Installation
4
4
 
@@ -24,7 +24,7 @@ Usage: @tinacms/cli command [options]
24
24
  Options:
25
25
  -V, --version output the version number
26
26
  -h, --help display help for command
27
- -v, --verbose increase verbosity of console output
27
+ -v, --verbose increase verbosity of console output
28
28
 
29
29
  Commands:
30
30
  server:start [options] Start Filesystem Graphql Server
@@ -137,7 +137,7 @@ The top-level key in the schema is an array of _collections_, a `collection` inf
137
137
 
138
138
  ### `templates`
139
139
 
140
- Templates are responsible for defining the shape of your content, you'll see in the schema for [the starter](https://github.com/tinacms/tina-cloud-starter) that we use `templates` for `collections` as well as `blocks`. One important thing to note is that since a `collection` can have multiple `templates`, each file in your collection must store a `_template` key in it's frontmatter:
140
+ Templates are responsible for defining the shape of your content, you'll see in the schema for [the starter](https://github.com/tinacms/tina-nextjs-starter) that we use `templates` for `collections` as well as `blocks`. One important thing to note is that since a `collection` can have multiple `templates`, each file in your collection must store a `_template` key in it's frontmatter:
141
141
 
142
142
  ```markdown
143
143
  ---
@@ -151,7 +151,7 @@ When you use Tina's GraphQL forms, we know about all of the relationships in you
151
151
 
152
152
  ### `fields`
153
153
 
154
- For the most part, you can think of `fields` as the backend equivalent to [Tina field plugins](https://tina.io/docs/plugins/fields/). You might notice that we're defining a `type` on each field, rather than a `component`. This is because the backend isn't concerned with `component`s, only the shape of your content. By default we use the built-in Tina fields, to customize your `component` read the [field customization](https://tina.io/docs/tina-cloud/client/#field-customization) instructions.
154
+ For the most part, you can think of `fields` as the backend equivalent to [Tina field plugins](https://tina.io/docs/plugins/fields/). You might notice that we're defining a `type` on each field, rather than a `component`. This is because the backend isn't concerned with `component`s, only the shape of your content. By default we use the built-in Tina fields, to customize your `component` read the [field customization](https://tina.io/docs/tinacloud/client/#field-customization) instructions.
155
155
 
156
156
  #### `reference` & `reference-list`
157
157
 
@@ -229,7 +229,7 @@ getPostsDocument(relativePath: "voteForPedro.md") {
229
229
  }
230
230
  ```
231
231
 
232
- To learn how to work with this data on a Tina-enabled site, check out the [client documentation](https://tina.io/docs/tina-cloud/client/)
232
+ To learn how to work with this data on a Tina-enabled site, check out the [client documentation](https://tina.io/docs/tinacloud/client/)
233
233
 
234
234
  > This API is currently somewhat limited. Specifically there's no support for filtering and sorting "list" queries. We have plans to tackle that in upcoming cycles
235
235
 
package/bin/tinacms CHANGED
@@ -1,13 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const version = process.version.slice(1)
4
- const [major, minor] = version.split('.')
3
+ const version = process.version.slice(1);
4
+ const [major, minor] = version.split('.');
5
5
  if (major < 14 || (major == 14 && minor < 18)) {
6
6
  console.error(
7
7
  'ERROR: Node.js version lower than 14.18 is not supported in tinacms, please update to the latest LTS version. See https://nodejs.org/en/download/ for more details'
8
- )
8
+ );
9
9
  } else {
10
- const cli = require('../dist/index.js')
11
- const [node, app, ...args] = process.argv
12
- cli.default.runExit(args)
10
+ const [node, app, ...args] = process.argv;
11
+ import('../dist/index.js')
12
+ .then((cli) => {
13
+ cli.default.runExit(args);
14
+ })
15
+ .catch((err) => {
16
+ console.error('Failed to load CLI:', err);
17
+ process.exit(1);
18
+ });
13
19
  }
@@ -1,4 +1,4 @@
1
- import type { Collection, TinaField } from '@tinacms/schema-tools';
1
+ import type { Collection, TinaField, ContentFrontmatterFormat } from '@tinacms/schema-tools';
2
2
  export declare const stringifyLabel: (label: string) => string;
3
3
  export declare const stringifyLabelWithField: (label: string) => string;
4
4
  export declare const generateAllTemplates: ({ pathToForestryConfig, }: {
@@ -8,7 +8,7 @@ export declare const generateAllTemplates: ({ pathToForestryConfig, }: {
8
8
  templateObj: any;
9
9
  }>>;
10
10
  export declare const generateCollections: ({ pathToForestryConfig, usingTypescript, frontMatterFormat, }: {
11
- frontMatterFormat?: "toml" | "yaml" | "json";
11
+ frontMatterFormat?: ContentFrontmatterFormat;
12
12
  pathToForestryConfig: string;
13
13
  usingTypescript: boolean;
14
14
  }) => Promise<{
@@ -59,7 +59,6 @@ declare const forestryFieldWithoutField: z.ZodObject<{
59
59
  };
60
60
  }>>;
61
61
  }, "strip", z.ZodTypeAny, {
62
- type?: "number" | "boolean" | "file" | "text" | "color" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
63
62
  default?: any;
64
63
  name?: string;
65
64
  config?: {
@@ -76,10 +75,10 @@ declare const forestryFieldWithoutField: z.ZodObject<{
76
75
  };
77
76
  };
78
77
  label?: string;
78
+ type?: "number" | "boolean" | "text" | "color" | "file" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
79
79
  template?: string;
80
80
  template_types?: string[];
81
81
  }, {
82
- type?: "number" | "boolean" | "file" | "text" | "color" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
83
82
  default?: any;
84
83
  name?: string;
85
84
  config?: {
@@ -96,6 +95,7 @@ declare const forestryFieldWithoutField: z.ZodObject<{
96
95
  };
97
96
  };
98
97
  label?: string;
98
+ type?: "number" | "boolean" | "text" | "color" | "file" | "include" | "list" | "datetime" | "select" | "image_gallery" | "textarea" | "tag_list" | "field_group" | "field_group_list" | "blocks";
99
99
  template?: string;
100
100
  template_types?: string[];
101
101
  }>;
@@ -149,12 +149,12 @@ export declare const parseSections: ({ val }: {
149
149
  val: unknown;
150
150
  }) => {
151
151
  sections?: {
152
- exclude?: string;
153
- type?: "heading" | "document" | "directory" | "jekyll-pages" | "jekyll-posts";
154
152
  match?: string;
155
153
  templates?: string[];
156
154
  label?: string;
157
155
  path?: string;
156
+ type?: "heading" | "document" | "directory" | "jekyll-pages" | "jekyll-posts";
157
+ exclude?: string;
158
158
  create?: "none" | "all" | "documents";
159
159
  new_doc_ext?: string;
160
160
  read_only?: boolean;
@@ -1,4 +1,5 @@
1
1
  import { CLICommand } from '../index';
2
+ import { ContentFrontmatterFormat } from '@tinacms/schema-tools';
2
3
  export interface Framework {
3
4
  name: 'next' | 'hugo' | 'jekyll' | 'other';
4
5
  reactive: boolean;
@@ -20,11 +21,10 @@ export type GeneratedFile = {
20
21
  parentPath: string;
21
22
  };
22
23
  };
23
- export type FrontmatterFormat = 'yaml' | 'toml' | 'json';
24
24
  export type InitEnvironment = {
25
25
  hasTinaDeps: boolean;
26
26
  forestryConfigExists: boolean;
27
- frontMatterFormat: FrontmatterFormat;
27
+ frontMatterFormat: ContentFrontmatterFormat;
28
28
  gitIgnoreExists: boolean;
29
29
  gitIgnoreNodeModulesExists: boolean;
30
30
  gitIgnoreTinaEnvExists: boolean;
@@ -1,5 +1,6 @@
1
1
  import { Framework, InitEnvironment } from '../';
2
2
  import { Config, ImportStatement } from './types';
3
+ import { ContentFrontmatterFormat } from '@tinacms/schema-tools';
3
4
  export * from './askTinaCloudSetup';
4
5
  export * from './types';
5
6
  export * from './gitProvider';
@@ -7,14 +8,14 @@ export * from './databaseAdapter';
7
8
  export * from './authProvider';
8
9
  export declare const askCommonSetUp: () => Promise<{
9
10
  framework: Framework;
10
- packageManager: "pnpm" | "yarn" | "npm";
11
+ packageManager: "pnpm" | "yarn" | "npm" | "bun";
11
12
  }>;
12
13
  export declare const askForestryMigrate: ({ framework, env, }: {
13
14
  framework: Framework;
14
15
  env: InitEnvironment;
15
16
  }) => Promise<{
16
17
  forestryMigrate: boolean;
17
- frontMatterFormat?: "yaml" | "toml" | "json";
18
+ frontMatterFormat?: ContentFrontmatterFormat;
18
19
  }>;
19
20
  export declare const askTinaSetupPrompts: (params: {
20
21
  frameworkName: string;
@@ -1,11 +1,12 @@
1
+ import { ContentFrontmatterFormat } from '@tinacms/schema-tools';
1
2
  import { Framework, GeneratedFileType } from '../';
2
3
  export type Config = {
3
4
  typescript: boolean;
4
5
  publicFolder?: string;
5
6
  framework: Framework;
6
- packageManager: 'pnpm' | 'yarn' | 'npm';
7
+ packageManager: 'pnpm' | 'yarn' | 'npm' | 'bun';
7
8
  forestryMigrate: boolean;
8
- frontMatterFormat?: 'yaml' | 'toml' | 'json';
9
+ frontMatterFormat?: ContentFrontmatterFormat;
9
10
  hosting?: 'tina-cloud' | 'self-host';
10
11
  gitProvider?: PromptGitProvider;
11
12
  databaseAdapter?: PromptDatabaseAdapter;
package/dist/index.d.ts CHANGED
@@ -1 +1,4 @@
1
- export * from "../src/index"
1
+ import { Cli } from 'clipanion';
2
+ export type { Schema, TinaSchema, Collection, TinaTemplate, } from '@tinacms/graphql';
3
+ declare const cli: Cli<import("clipanion").BaseContext>;
4
+ export default cli;