@tinacms/cli 0.60.27 → 0.61.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.
@@ -0,0 +1,13 @@
1
+ /**
2
+ Copyright 2021 Forestry.io Holdings, Inc.
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0
7
+ Unless required by applicable law or agreed to in writing, software
8
+ distributed under the License is distributed on an "AS IS" BASIS,
9
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ See the License for the specific language governing permissions and
11
+ limitations under the License.
12
+ */
13
+ export declare const attachPath: (ctx: any, next: () => void, _options: any) => Promise<void>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ Copyright 2021 Forestry.io Holdings, Inc.
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0
7
+ Unless required by applicable law or agreed to in writing, software
8
+ distributed under the License is distributed on an "AS IS" BASIS,
9
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ See the License for the specific language governing permissions and
11
+ limitations under the License.
12
+ */
13
+ import { FilesystemBridge } from '@tinacms/datalayer';
14
+ export declare function makeIsomorphicOptions(fsBridge: FilesystemBridge): Promise<{
15
+ gitRoot: string;
16
+ author: {
17
+ name: string;
18
+ email: string;
19
+ };
20
+ onPut: (filepath: string, data: string) => Promise<void>;
21
+ onDelete: (filepath: string) => Promise<void>;
22
+ }>;
@@ -0,0 +1,42 @@
1
+ /**
2
+ Copyright 2021 Forestry.io Holdings, Inc.
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+ http://www.apache.org/licenses/LICENSE-2.0
7
+ Unless required by applicable law or agreed to in writing, software
8
+ distributed under the License is distributed on an "AS IS" BASIS,
9
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ See the License for the specific language governing permissions and
11
+ limitations under the License.
12
+ */
13
+ import { Bridge, Database } from '@tinacms/graphql';
14
+ import { Store } from '@tinacms/datalayer';
15
+ interface BuildOptions {
16
+ ctx: any;
17
+ database: Database;
18
+ store: Store;
19
+ bridge: Bridge;
20
+ noWatch?: boolean;
21
+ isomorphicGitBridge?: boolean;
22
+ verbose?: boolean;
23
+ dev?: boolean;
24
+ local?: boolean;
25
+ noSDK?: boolean;
26
+ beforeBuild?: () => Promise<any>;
27
+ afterBuild?: () => Promise<any>;
28
+ skipIndex?: boolean;
29
+ }
30
+ interface BuildSetupOptions {
31
+ isomorphicGitBridge?: boolean;
32
+ experimentalData?: boolean;
33
+ }
34
+ export declare const buildSetupCmdBuild: (ctx: any, next: () => void, opts: BuildSetupOptions) => Promise<void>;
35
+ export declare const buildSetupCmdServerStart: (ctx: any, next: () => void, opts: BuildSetupOptions) => Promise<void>;
36
+ export declare const buildSetupCmdAudit: (ctx: any, next: () => void, options: {
37
+ clean: boolean;
38
+ }) => Promise<void>;
39
+ export declare const buildCmdBuild: (ctx: any, next: () => void, options: Omit<BuildOptions & BuildSetupOptions, 'bridge' | 'database' | 'store'>) => Promise<void>;
40
+ export declare const auditCmdBuild: (ctx: any, next: () => void, options: Omit<BuildOptions & BuildSetupOptions, 'bridge' | 'database' | 'store'>) => Promise<void>;
41
+ export declare const build: ({ noWatch, ctx, bridge, database, store, beforeBuild, afterBuild, dev, local, verbose, noSDK, skipIndex, }: BuildOptions) => Promise<void>;
42
+ export {};
@@ -12,10 +12,9 @@ limitations under the License.
12
12
  */
13
13
  import 'dotenv/config';
14
14
  import { Command } from '../command';
15
- export declare const CMD_GEN_TYPES = "schema:types";
16
15
  export declare const CMD_START_SERVER = "server:start";
17
- export declare const CMD_COMPILE_MODELS = "schema:compile";
18
- export declare const CMD_WAIT_FOR_DB = "server:waitForDB";
16
+ export declare const CMD_DEV = "dev";
19
17
  export declare const INIT = "init";
20
18
  export declare const AUDIT = "audit";
19
+ export declare const CMD_BUILD = "build";
21
20
  export declare const baseCmds: Command[];
@@ -10,4 +10,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
- export declare const defaultSchema = "\nimport { defineSchema, defineConfig } from \"tinacms\";\n\nconst schema = defineSchema({\n collections: [\n {\n label: \"Blog Posts\",\n name: \"posts\",\n path: \"content/posts\",\n fields: [\n {\n type: \"string\",\n label: \"Title\",\n name: \"title\",\n },\n {\n type: \"rich-text\",\n label: \"Blog Post Body\",\n name: \"body\",\n isBody: true,\n templates: [\n {\n name: \"PageSection\",\n label: \"Page Section\",\n fields: [\n {\n type: \"string\",\n name: \"heading\",\n label: \"Heading\",\n },\n {\n type: \"string\",\n name: \"content\",\n label: \"Content\",\n ui: {\n component: \"textarea\"\n }\n }\n ],\n },\n ]\n },\n ],\n },\n ],\n});\n\nexport default schema\n\n// Your tina config\n// ==============\nconst branch = 'main'\n// When working locally, hit our local filesystem.\n// On a Vercel deployment, hit the Tina Cloud API\nconst apiURL =\n process.env.NODE_ENV == 'development'\n ? 'http://localhost:4001/graphql'\n : `https://content.tinajs.io/content/${process.env.NEXT_PUBLIC_TINA_CLIENT_ID}/github/${branch}`\n\nexport const tinaConfig = defineConfig({\n apiURL,\n schema,\n cmsCallback: (cms) => {\n // add your CMS callback code here (if you want)\n\n // The Route Mapper\n /**\n * 1. Import `tinacms` and `RouteMappingPlugin`\n **/\n import(\"tinacms\").then(({ RouteMappingPlugin }) => {\n /**\n * 2. Define the `RouteMappingPlugin` see https://tina.io/docs/tinacms-context/#the-routemappingplugin for more details\n **/\n const RouteMapping = new RouteMappingPlugin((collection, document) => {\n return undefined;\n });\n /**\n * 3. Add the `RouteMappingPlugin` to the `cms`.\n **/\n cms.plugins.add(RouteMapping);\n });\n\n return cms;\n },\n});\n";
13
+ export declare const defaultSchema = "\nimport { defineSchema, defineConfig } from 'tinacms'\nimport { client } from './__generated__/client'\n\n\nconst branch =\n process.env.NEXT_PUBLIC_TINA_BRANCH ||\n process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF ||\n process.env.HEAD ||\n 'main'\nconst schema = defineSchema({\n // See https://tina.io/docs/tina-cloud/connecting-site/ for more information about this config\n config: {\n token: '<Your Read Only Token>', // generated on app.tina.io,\n clientId: '<Your Client ID>', // generated on app.tina.io\n branch,\n },\n collections: [\n {\n label: 'Blog Posts',\n name: 'post',\n path: 'content/posts',\n format: 'mdx',\n fields: [\n {\n type: 'string',\n label: 'Title',\n name: 'title',\n },\n {\n type: 'rich-text',\n label: 'Blog Post Body',\n name: 'body',\n isBody: true,\n templates: [\n {\n name: 'PageSection',\n label: 'Page Section',\n fields: [\n {\n type: 'string',\n name: 'heading',\n label: 'Heading',\n },\n {\n type: 'string',\n name: 'content',\n label: 'Content',\n ui: {\n component: 'textarea',\n },\n },\n ],\n },\n ],\n },\n ],\n },\n ],\n})\n\nexport default schema\n\n// Your tina config\n\nexport const tinaConfig = defineConfig({\n client,\n schema,\n cmsCallback: (cms) => {\n // add your CMS callback code here (if you want)\n\n // The Route Mapper\n /**\n * 1. Import `tinacms` and `RouteMappingPlugin`\n **/\n import('tinacms').then(({ RouteMappingPlugin }) => {\n /**\n * 2. Define the `RouteMappingPlugin` see https://tina.io/docs/tinacms-context/#the-routemappingplugin for more details\n **/\n const RouteMapping = new RouteMappingPlugin((collection, document) => {\n return undefined\n })\n /**\n * 3. Add the `RouteMappingPlugin` to the `cms`.\n **/\n cms.plugins.add(RouteMapping)\n })\n\n return cms\n },\n})\n\n";
@@ -11,13 +11,16 @@ See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
13
  import type { TinaCloudSchema } from '@tinacms/graphql';
14
- export declare const resetGeneratedFolder: () => Promise<void>;
14
+ export declare const resetGeneratedFolder: ({ tinaGeneratedPath, usingTs, }: {
15
+ tinaGeneratedPath: string;
16
+ usingTs: boolean;
17
+ }) => Promise<void>;
15
18
  export declare const compileClient: (ctx: any, next: any, options: {
16
19
  clientFileType?: string;
17
20
  verbose?: boolean;
18
21
  dev?: boolean;
19
22
  }) => Promise<any>;
20
- export declare const compileSchema: (_ctx: any, _next: any, options: {
23
+ export declare const compileSchema: (ctx: any, _next: any, options: {
21
24
  schemaFileType?: string;
22
25
  verbose?: boolean;
23
26
  dev?: boolean;
@@ -1,5 +1,7 @@
1
1
  export declare const adminPage = "import { TinaAdmin } from 'tinacms';\nexport default TinaAdmin;\n";
2
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
- export declare const nextPostPage: () => string;
3
+ export declare const nextPostPage: ({ usingSrc, }: {
4
+ usingSrc: boolean;
5
+ }) => string;
4
6
  export declare const AppJsContent: (usingSrc: boolean, extraImports?: string) => string;
5
7
  export declare const AppJsContentPrintout: (usingSrc: boolean, extraImports?: string) => string;
@@ -11,6 +11,13 @@ See the License for the specific language governing permissions and
11
11
  limitations under the License.
12
12
  */
13
13
  import { GraphQLSchema } from 'graphql';
14
- export declare function genTypes({ schema }: {
14
+ import { TinaCloudSchema } from '@tinacms/schema-tools';
15
+ export declare const TINA_HOST = "content.tinajs.io";
16
+ export declare function genClient({ tinaSchema, usingTs, }: {
17
+ tinaSchema: TinaCloudSchema<false>;
18
+ usingTs?: boolean;
19
+ }, next: () => void, options: any): Promise<void>;
20
+ export declare function genTypes({ schema, usingTs }: {
15
21
  schema: GraphQLSchema;
22
+ usingTs?: boolean;
16
23
  }, next: () => void, options: any): Promise<void>;
@@ -21,6 +21,7 @@ interface Options {
21
21
  noTelemetry: boolean;
22
22
  verbose?: boolean;
23
23
  dev?: boolean;
24
+ local: boolean;
24
25
  }
25
- export declare function startServer(_ctx: any, next: any, { port, noWatch, experimentalData, isomorphicGitBridge, noSDK, noTelemetry, watchFolders, verbose, dev, }: Options): Promise<void>;
26
+ export declare function startServer(ctx: any, next: any, { port, noWatch, isomorphicGitBridge, noSDK, noTelemetry, watchFolders, verbose, dev, local, }: Options): Promise<void>;
26
27
  export {};