@tinacms/cli 0.60.4 → 0.60.7
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 +36 -0
- package/dist/cmds/compile/defaultSchema.d.ts +1 -1
- package/dist/cmds/init/index.d.ts +1 -1
- package/dist/cmds/init/setup-files/index.d.ts +1 -1
- package/dist/cmds/init/setup-files/tinaProvider.d.ts +14 -0
- package/dist/cmds/start-server/errors/index.d.ts +19 -0
- package/dist/cmds/start-server/index.d.ts +2 -1
- package/dist/cmds/start-server/lock.d.ts +18 -0
- package/dist/index.js +323 -120
- package/dist/lib/getSchemaPath.d.ts +15 -0
- package/dist/lib/index.d.ts +13 -0
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# tinacms-cli
|
|
2
2
|
|
|
3
|
+
## 0.60.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9e436f145: Update CLI to use defineConfig
|
|
8
|
+
- 851e4be73: Update tina init to use the new way of laying out tina config
|
|
9
|
+
- cc99e4309: update admin file path to /pages/admin.js to support the hash router
|
|
10
|
+
- @tinacms/datalayer@0.0.2
|
|
11
|
+
- @tinacms/graphql@0.59.7
|
|
12
|
+
- @tinacms/metrics@0.0.2
|
|
13
|
+
|
|
14
|
+
## 0.60.6
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 98622111d: Use [esbuild](https://esbuild.github.io/) to build the schema instead of typescript.
|
|
19
|
+
|
|
20
|
+
This allows the user to
|
|
21
|
+
|
|
22
|
+
- use non typescript files like JS, JSX, TS
|
|
23
|
+
- Import from outside of the tina folder
|
|
24
|
+
|
|
25
|
+
The downside
|
|
26
|
+
|
|
27
|
+
- Now type errors will still pass (The schema will compile) and one will get an error at runtime instead of compile time
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [c730fa1dd]
|
|
30
|
+
- Updated dependencies [cd0f6f022]
|
|
31
|
+
- @tinacms/graphql@0.59.7
|
|
32
|
+
|
|
33
|
+
## 0.60.5
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 399fbf4fa: Fix an issue where builds weren't happening during CI, this is only an issue for the experimental data layer
|
|
38
|
+
|
|
3
39
|
## 0.60.4
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -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 } from \"
|
|
13
|
+
export declare const defaultSchema = "\nimport { defineSchema, defineConfig } from \"tinacms\";\n\nexport default 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: \"string\",\n label: \"Blog Post Body\",\n name: \"body\",\n isBody: true,\n ui: {\n component: \"textarea\"\n },\n },\n ],\n },\n ],\n});\n\n\n\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 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});\n";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function initTina(ctx: any, next: () => void, options: any): Promise<void>;
|
|
2
2
|
export declare function installDeps(ctx: any, next: () => void, options: any): Promise<void>;
|
|
3
|
-
export declare function tinaSetup(
|
|
3
|
+
export declare function tinaSetup(_ctx: any, next: () => void, _options: any): Promise<void>;
|
|
4
4
|
export declare function successMessage(ctx: any, next: () => void, options: any): Promise<void>;
|
|
@@ -13,4 +13,4 @@ limitations under the License.
|
|
|
13
13
|
export declare const adminPage = "import { TinaAdmin } from 'tinacms';\nexport default TinaAdmin;\n";
|
|
14
14
|
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## Oscula mihi\n\nLorem 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";
|
|
15
15
|
export declare const nextPostPage: () => string;
|
|
16
|
-
export declare const AppJsContent: (extraImports?: string) => string;
|
|
16
|
+
export declare const AppJsContent: (usingSrc: boolean, extraImports?: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
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 TinaProvider = "import TinaCMS from 'tinacms'\nimport { tinaConfig } from '../schema.ts'\n\n// Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle.\n// Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode\n/**\n *\n * @private Do not import this directly, please import the dynamic provider instead\n */\nconst TinaProvider = ({ children }) => {\n return <TinaCMS {...tinaConfig}>{children}</TinaCMS>\n}\n\nexport default TinaProvider\n";
|
|
14
|
+
export declare const TinaProviderDynamic = "import dynamic from 'next/dynamic'\nconst TinaProvider = dynamic(() => import('./TinaProvider'), { ssr: false })\nimport { TinaEditProvider } from 'tinacms/dist/edit-state'\n\nconst DynamicTina = ({ children }) => {\n return (\n <>\n <TinaEditProvider editMode={<TinaProvider>{children}</TinaProvider>}>\n {children}\n </TinaEditProvider>\n </>\n )\n}\n\nexport default DynamicTina\n";
|
|
@@ -0,0 +1,19 @@
|
|
|
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 class BuildSchemaError extends Error {
|
|
14
|
+
constructor(message: any);
|
|
15
|
+
}
|
|
16
|
+
export declare class ExecuteSchemaError extends Error {
|
|
17
|
+
constructor(message: any);
|
|
18
|
+
}
|
|
19
|
+
export declare const handleServerErrors: (e: Error) => void;
|
|
@@ -13,10 +13,11 @@ limitations under the License.
|
|
|
13
13
|
interface Options {
|
|
14
14
|
port?: number;
|
|
15
15
|
command?: string;
|
|
16
|
+
watchFolders?: string[];
|
|
16
17
|
experimentalData?: boolean;
|
|
17
18
|
noWatch?: boolean;
|
|
18
19
|
noSDK: boolean;
|
|
19
20
|
noTelemetry: boolean;
|
|
20
21
|
}
|
|
21
|
-
export declare function startServer(_ctx: any, _next: any, { port, command, noWatch, experimentalData, noSDK, noTelemetry, }: Options): Promise<void>;
|
|
22
|
+
export declare function startServer(_ctx: any, _next: any, { port, command, noWatch, experimentalData, noSDK, noTelemetry, watchFolders, }: Options): Promise<void>;
|
|
22
23
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
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 class AsyncLock {
|
|
14
|
+
disable: any;
|
|
15
|
+
promise: any;
|
|
16
|
+
constructor();
|
|
17
|
+
enable(): void;
|
|
18
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -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.
|
|
117
|
+
var version = "0.60.7";
|
|
118
118
|
|
|
119
119
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/utils/theme.ts
|
|
120
120
|
var import_chalk = __toModule(require("chalk"));
|
|
@@ -391,20 +391,18 @@ schema {
|
|
|
391
391
|
|
|
392
392
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/start-server/index.ts
|
|
393
393
|
var import_child_process = __toModule(require("child_process"));
|
|
394
|
-
var
|
|
394
|
+
var import_path4 = __toModule(require("path"));
|
|
395
395
|
var import_graphql7 = __toModule(require("@tinacms/graphql"));
|
|
396
396
|
var import_datalayer2 = __toModule(require("@tinacms/datalayer"));
|
|
397
397
|
|
|
398
398
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/compile/index.ts
|
|
399
|
-
var
|
|
400
|
-
var
|
|
401
|
-
var
|
|
402
|
-
var import_fs_extra2 = __toModule(require("fs-extra"));
|
|
403
|
-
var ts = __toModule(require("typescript"));
|
|
399
|
+
var import_path3 = __toModule(require("path"));
|
|
400
|
+
var import_fs_extra3 = __toModule(require("fs-extra"));
|
|
401
|
+
var import_esbuild = __toModule(require("esbuild"));
|
|
404
402
|
|
|
405
403
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/compile/defaultSchema.ts
|
|
406
404
|
var defaultSchema = `
|
|
407
|
-
import { defineSchema } from "
|
|
405
|
+
import { defineSchema, defineConfig } from "tinacms";
|
|
408
406
|
|
|
409
407
|
export default defineSchema({
|
|
410
408
|
collections: [
|
|
@@ -431,70 +429,227 @@ export default defineSchema({
|
|
|
431
429
|
},
|
|
432
430
|
],
|
|
433
431
|
});
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
// Your tina config
|
|
437
|
+
// ==============
|
|
438
|
+
const branch = 'main'
|
|
439
|
+
// When working locally, hit our local filesystem.
|
|
440
|
+
// On a Vercel deployment, hit the Tina Cloud API
|
|
441
|
+
const apiURL =
|
|
442
|
+
process.env.NODE_ENV == 'development'
|
|
443
|
+
? 'http://localhost:4001/graphql'
|
|
444
|
+
: \`https://content.tinajs.io/content/\${process.env.NEXT_PUBLIC_TINA_CLIENT_ID}/github/\${branch}\`
|
|
445
|
+
|
|
446
|
+
export const tinaConfig = defineConfig({
|
|
447
|
+
apiURL,
|
|
448
|
+
cmsCallback: (cms) => {
|
|
449
|
+
// add your CMS callback code here (if you want)
|
|
450
|
+
|
|
451
|
+
// The Route Mapper
|
|
452
|
+
/**
|
|
453
|
+
* 1. Import \`tinacms\` and \`RouteMappingPlugin\`
|
|
454
|
+
**/
|
|
455
|
+
import("tinacms").then(({ RouteMappingPlugin }) => {
|
|
456
|
+
/**
|
|
457
|
+
* 2. Define the \`RouteMappingPlugin\` see https://tina.io/docs/tinacms-context/#the-routemappingplugin for more details
|
|
458
|
+
**/
|
|
459
|
+
const RouteMapping = new RouteMappingPlugin((collection, document) => {
|
|
460
|
+
return undefined;
|
|
461
|
+
});
|
|
462
|
+
/**
|
|
463
|
+
* 3. Add the \`RouteMappingPlugin\` to the \`cms\`.
|
|
464
|
+
**/
|
|
465
|
+
cms.plugins.add(RouteMapping);
|
|
466
|
+
});
|
|
467
|
+
},
|
|
468
|
+
});
|
|
434
469
|
`;
|
|
435
470
|
|
|
471
|
+
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/lib/getSchemaPath.ts
|
|
472
|
+
var import_path2 = __toModule(require("path"));
|
|
473
|
+
var import_fs_extra2 = __toModule(require("fs-extra"));
|
|
474
|
+
var ErrorMessage = "Must provide a `.tina/schema.{ts,js,tsx,jsx}`";
|
|
475
|
+
var getSchemaPath = ({ projectDir }) => {
|
|
476
|
+
if (!import_fs_extra2.default.existsSync(projectDir)) {
|
|
477
|
+
throw new Error(ErrorMessage);
|
|
478
|
+
}
|
|
479
|
+
const inputPathTS = import_path2.default.join(projectDir, "schema.ts");
|
|
480
|
+
const inputPathJS = import_path2.default.join(projectDir, "schema.js");
|
|
481
|
+
const inputPathTSX = import_path2.default.join(projectDir, "schema.tsx");
|
|
482
|
+
const inputPathJSX = import_path2.default.join(projectDir, "schema.jsx");
|
|
483
|
+
let inputFile;
|
|
484
|
+
if (import_fs_extra2.default.existsSync(inputPathTS)) {
|
|
485
|
+
inputFile = inputPathTS;
|
|
486
|
+
} else if (import_fs_extra2.default.existsSync(inputPathJS)) {
|
|
487
|
+
inputFile = inputPathJS;
|
|
488
|
+
} else if (import_fs_extra2.default.existsSync(inputPathTSX)) {
|
|
489
|
+
inputFile = inputPathTSX;
|
|
490
|
+
} else if (import_fs_extra2.default.existsSync(inputPathJSX)) {
|
|
491
|
+
inputFile = inputPathJSX;
|
|
492
|
+
}
|
|
493
|
+
if (!inputFile) {
|
|
494
|
+
throw new Error(ErrorMessage);
|
|
495
|
+
}
|
|
496
|
+
return inputFile;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/start-server/errors/index.ts
|
|
500
|
+
var BuildSchemaError = class extends Error {
|
|
501
|
+
constructor(message) {
|
|
502
|
+
super(message);
|
|
503
|
+
this.name = "BuildSchemaError";
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
var ExecuteSchemaError = class extends Error {
|
|
507
|
+
constructor(message) {
|
|
508
|
+
super(message);
|
|
509
|
+
this.name = "ExecuteSchemaError";
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
var handleServerErrors = (e) => {
|
|
513
|
+
if (e instanceof BuildSchemaError) {
|
|
514
|
+
logger.error(`${dangerText("ERROR: your schema was not successfully built: see https://tina.io/docs/errors/esbuild-error/ for more details")}
|
|
515
|
+
Error Message Below
|
|
516
|
+
${e}`);
|
|
517
|
+
} else if (e instanceof ExecuteSchemaError) {
|
|
518
|
+
logger.error(`${dangerText("ERROR: your schema was not successfully executed: see https://tina.io/docs/errors/esbuild-error/ for more details")}
|
|
519
|
+
Error Message Below
|
|
520
|
+
${e}`);
|
|
521
|
+
} else {
|
|
522
|
+
logger.info(dangerText("Compilation failed with errors. Server has not been restarted.") + ` see error below
|
|
523
|
+
${e.message}`);
|
|
524
|
+
}
|
|
525
|
+
};
|
|
526
|
+
|
|
436
527
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/compile/index.ts
|
|
437
|
-
var tinaPath =
|
|
438
|
-
var
|
|
439
|
-
var
|
|
440
|
-
var
|
|
528
|
+
var tinaPath = import_path3.default.join(process.cwd(), ".tina");
|
|
529
|
+
var packageJSONFilePath = import_path3.default.join(process.cwd(), "package.json");
|
|
530
|
+
var tinaGeneratedPath = import_path3.default.join(tinaPath, "__generated__");
|
|
531
|
+
var tinaTempPath = import_path3.default.join(tinaGeneratedPath, "temp");
|
|
532
|
+
var tinaConfigPath = import_path3.default.join(tinaGeneratedPath, "config");
|
|
441
533
|
var resetGeneratedFolder = async () => {
|
|
442
534
|
try {
|
|
443
|
-
await
|
|
535
|
+
await import_fs_extra3.default.rmdir(tinaGeneratedPath, {
|
|
444
536
|
recursive: true
|
|
445
537
|
});
|
|
446
538
|
} catch (e) {
|
|
447
539
|
console.log(e);
|
|
448
540
|
}
|
|
449
|
-
await
|
|
450
|
-
await
|
|
541
|
+
await import_fs_extra3.default.mkdir(tinaGeneratedPath);
|
|
542
|
+
await import_fs_extra3.default.outputFile(import_path3.default.join(tinaGeneratedPath, ".gitignore"), "db");
|
|
543
|
+
};
|
|
544
|
+
var cleanup = async ({ tinaTempPath: tinaTempPath2 }) => {
|
|
545
|
+
await import_fs_extra3.default.remove(tinaTempPath2);
|
|
451
546
|
};
|
|
452
547
|
var compile = async (_ctx, _next) => {
|
|
453
548
|
logger.info(logText("Compiling..."));
|
|
454
|
-
|
|
549
|
+
let schemaExists = true;
|
|
550
|
+
try {
|
|
551
|
+
getSchemaPath({ projectDir: tinaPath });
|
|
552
|
+
} catch {
|
|
553
|
+
schemaExists = false;
|
|
554
|
+
}
|
|
555
|
+
if (!schemaExists) {
|
|
455
556
|
logger.info(dangerText(`
|
|
456
557
|
.tina/schema.ts not found, Creating one for you...
|
|
457
558
|
See Documentation: https://tina.io/docs/tina-cloud/cli/#getting-started"
|
|
458
559
|
`));
|
|
459
|
-
const file =
|
|
460
|
-
await
|
|
461
|
-
await
|
|
560
|
+
const file = import_path3.default.join(tinaPath, "schema.ts");
|
|
561
|
+
await import_fs_extra3.default.ensureFile(file);
|
|
562
|
+
await import_fs_extra3.default.writeFile(file, defaultSchema);
|
|
563
|
+
}
|
|
564
|
+
try {
|
|
565
|
+
await transpile(tinaPath, tinaTempPath);
|
|
566
|
+
} catch (e) {
|
|
567
|
+
await cleanup({ tinaTempPath });
|
|
568
|
+
throw new BuildSchemaError(e);
|
|
462
569
|
}
|
|
463
|
-
await transpile2(tinaPath, tinaTempPath);
|
|
464
570
|
Object.keys(require.cache).map((key) => {
|
|
465
571
|
if (key.startsWith(tinaTempPath)) {
|
|
466
572
|
delete require.cache[require.resolve(key)];
|
|
467
573
|
}
|
|
468
574
|
});
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
575
|
+
try {
|
|
576
|
+
const schemaFunc = require(import_path3.default.join(tinaTempPath, "schema.js"));
|
|
577
|
+
const schemaObject = schemaFunc.default;
|
|
578
|
+
await import_fs_extra3.default.outputFile(import_path3.default.join(tinaConfigPath, "schema.json"), JSON.stringify(schemaObject, null, 2));
|
|
579
|
+
await cleanup({ tinaTempPath });
|
|
580
|
+
} catch (e) {
|
|
581
|
+
await cleanup({ tinaTempPath });
|
|
582
|
+
throw new ExecuteSchemaError(e);
|
|
583
|
+
}
|
|
473
584
|
};
|
|
474
|
-
var
|
|
475
|
-
logger.info(logText("
|
|
476
|
-
const
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
585
|
+
var transpile = async (projectDir, tempDir) => {
|
|
586
|
+
logger.info(logText("Building javascript..."));
|
|
587
|
+
const packageJSON = JSON.parse(import_fs_extra3.default.readFileSync(packageJSONFilePath).toString() || "{}");
|
|
588
|
+
const deps = (packageJSON == null ? void 0 : packageJSON.dependencies) || [];
|
|
589
|
+
const peerDeps = (packageJSON == null ? void 0 : packageJSON.peerDependencies) || [];
|
|
590
|
+
const devDeps = (packageJSON == null ? void 0 : packageJSON.devDependencies) || [];
|
|
591
|
+
const external = Object.keys(__spreadValues(__spreadValues(__spreadValues({}, deps), peerDeps), devDeps));
|
|
592
|
+
const inputFile = getSchemaPath({ projectDir });
|
|
593
|
+
const outputPath = import_path3.default.join(tempDir, "schema.js");
|
|
594
|
+
await (0, import_esbuild.build)({
|
|
595
|
+
bundle: true,
|
|
596
|
+
platform: "neutral",
|
|
597
|
+
target: ["node10.4"],
|
|
598
|
+
entryPoints: [inputFile],
|
|
599
|
+
treeShaking: true,
|
|
600
|
+
external: [...external, "./node_modules/*"],
|
|
601
|
+
loader: loaders,
|
|
602
|
+
outfile: outputPath
|
|
603
|
+
});
|
|
604
|
+
logger.info(logText(`Javascript built`));
|
|
490
605
|
};
|
|
491
606
|
var defineSchema = (config) => {
|
|
492
607
|
return config;
|
|
493
608
|
};
|
|
609
|
+
var loaders = {
|
|
610
|
+
".aac": "file",
|
|
611
|
+
".css": "file",
|
|
612
|
+
".eot": "file",
|
|
613
|
+
".flac": "file",
|
|
614
|
+
".gif": "file",
|
|
615
|
+
".jpeg": "file",
|
|
616
|
+
".jpg": "file",
|
|
617
|
+
".json": "json",
|
|
618
|
+
".mp3": "file",
|
|
619
|
+
".mp4": "file",
|
|
620
|
+
".ogg": "file",
|
|
621
|
+
".otf": "file",
|
|
622
|
+
".png": "file",
|
|
623
|
+
".svg": "file",
|
|
624
|
+
".ttf": "file",
|
|
625
|
+
".wav": "file",
|
|
626
|
+
".webm": "file",
|
|
627
|
+
".webp": "file",
|
|
628
|
+
".woff": "file",
|
|
629
|
+
".woff2": "file",
|
|
630
|
+
".js": "jsx",
|
|
631
|
+
".jsx": "jsx",
|
|
632
|
+
".tsx": "tsx"
|
|
633
|
+
};
|
|
494
634
|
|
|
495
635
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/start-server/index.ts
|
|
496
636
|
var import_chokidar = __toModule(require("chokidar"));
|
|
497
637
|
var import_metrics = __toModule(require("@tinacms/metrics"));
|
|
638
|
+
|
|
639
|
+
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/start-server/lock.ts
|
|
640
|
+
var AsyncLock = class {
|
|
641
|
+
constructor() {
|
|
642
|
+
this.disable = () => {
|
|
643
|
+
};
|
|
644
|
+
this.promise = Promise.resolve();
|
|
645
|
+
}
|
|
646
|
+
enable() {
|
|
647
|
+
this.promise = new Promise((resolve2) => this.disable = resolve2);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/start-server/index.ts
|
|
652
|
+
var lock = new AsyncLock();
|
|
498
653
|
var gqlPackageFile = require.resolve("@tinacms/graphql");
|
|
499
654
|
async function startServer(_ctx, _next, {
|
|
500
655
|
port = 4001,
|
|
@@ -502,8 +657,10 @@ async function startServer(_ctx, _next, {
|
|
|
502
657
|
noWatch,
|
|
503
658
|
experimentalData,
|
|
504
659
|
noSDK,
|
|
505
|
-
noTelemetry
|
|
660
|
+
noTelemetry,
|
|
661
|
+
watchFolders
|
|
506
662
|
}) {
|
|
663
|
+
lock.disable();
|
|
507
664
|
const rootPath2 = process.cwd();
|
|
508
665
|
const t = new import_metrics.Telemetry({ disabled: Boolean(noTelemetry) });
|
|
509
666
|
t.submitRecord({
|
|
@@ -541,19 +698,45 @@ stack: ${code.stack || "No stack was provided"}`);
|
|
|
541
698
|
}
|
|
542
699
|
};
|
|
543
700
|
let ready = false;
|
|
701
|
+
const build2 = async (noSDK2) => {
|
|
702
|
+
await lock.promise;
|
|
703
|
+
lock.enable();
|
|
704
|
+
try {
|
|
705
|
+
if (!process.env.CI && !noWatch) {
|
|
706
|
+
await resetGeneratedFolder();
|
|
707
|
+
}
|
|
708
|
+
const database2 = await (0, import_graphql7.createDatabase)({ store, bridge });
|
|
709
|
+
await compile(null, null);
|
|
710
|
+
const schema = await (0, import_graphql7.buildSchema)(rootPath2, database2);
|
|
711
|
+
await genTypes({ schema }, () => {
|
|
712
|
+
}, { noSDK: noSDK2 });
|
|
713
|
+
} catch (error) {
|
|
714
|
+
throw error;
|
|
715
|
+
} finally {
|
|
716
|
+
lock.disable();
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
const foldersToWatch = (watchFolders || []).map((x) => import_path4.default.join(rootPath2, x));
|
|
544
720
|
if (!noWatch && !process.env.CI) {
|
|
545
|
-
import_chokidar.default.watch([
|
|
546
|
-
|
|
721
|
+
import_chokidar.default.watch([
|
|
722
|
+
...foldersToWatch,
|
|
723
|
+
`${rootPath2}/.tina/**/*.{ts,gql,graphql,js,tsx,jsx}`
|
|
724
|
+
], {
|
|
725
|
+
ignored: [
|
|
726
|
+
"**/node_modules/**/*",
|
|
727
|
+
"**/.next/**/*",
|
|
728
|
+
`${import_path4.default.resolve(rootPath2)}/.tina/__generated__/**/*`
|
|
729
|
+
]
|
|
547
730
|
}).on("ready", async () => {
|
|
548
731
|
console.log("Generating Tina config");
|
|
549
732
|
try {
|
|
550
733
|
if (shouldBuild) {
|
|
551
|
-
await
|
|
734
|
+
await build2(noSDK);
|
|
552
735
|
}
|
|
553
736
|
ready = true;
|
|
554
737
|
startSubprocess();
|
|
555
738
|
} catch (e) {
|
|
556
|
-
|
|
739
|
+
handleServerErrors(e);
|
|
557
740
|
console.log(e);
|
|
558
741
|
process.exit(0);
|
|
559
742
|
}
|
|
@@ -562,11 +745,10 @@ stack: ${code.stack || "No stack was provided"}`);
|
|
|
562
745
|
logger.info("Tina change detected, regenerating config");
|
|
563
746
|
try {
|
|
564
747
|
if (shouldBuild) {
|
|
565
|
-
await
|
|
748
|
+
await build2(noSDK);
|
|
566
749
|
}
|
|
567
750
|
} catch (e) {
|
|
568
|
-
|
|
569
|
-
${e.message}`);
|
|
751
|
+
handleServerErrors(e);
|
|
570
752
|
t.submitRecord({
|
|
571
753
|
event: {
|
|
572
754
|
name: "tinacms:cli:server:error",
|
|
@@ -576,17 +758,11 @@ stack: ${code.stack || "No stack was provided"}`);
|
|
|
576
758
|
}
|
|
577
759
|
}
|
|
578
760
|
});
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
await resetGeneratedFolder();
|
|
761
|
+
} else {
|
|
762
|
+
if (shouldBuild) {
|
|
763
|
+
await build2(noSDK);
|
|
583
764
|
}
|
|
584
|
-
|
|
585
|
-
await compile(null, null);
|
|
586
|
-
const schema = await (0, import_graphql7.buildSchema)(rootPath2, database2);
|
|
587
|
-
await genTypes({ schema }, () => {
|
|
588
|
-
}, { noSDK: noSDK2 });
|
|
589
|
-
};
|
|
765
|
+
}
|
|
590
766
|
const state = {
|
|
591
767
|
server: null,
|
|
592
768
|
sockets: []
|
|
@@ -643,8 +819,8 @@ stack: ${code.stack || "No stack was provided"}`);
|
|
|
643
819
|
}
|
|
644
820
|
|
|
645
821
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/init/index.ts
|
|
646
|
-
var
|
|
647
|
-
var
|
|
822
|
+
var import_fs_extra4 = __toModule(require("fs-extra"));
|
|
823
|
+
var import_path5 = __toModule(require("path"));
|
|
648
824
|
var import_progress = __toModule(require("progress"));
|
|
649
825
|
var import_prompts = __toModule(require("prompts"));
|
|
650
826
|
var import_metrics2 = __toModule(require("@tinacms/metrics"));
|
|
@@ -959,41 +1135,58 @@ var nextPostPage = () => `// THIS FILE HAS BEEN GENERATED WITH THE TINA CLI.
|
|
|
959
1135
|
};
|
|
960
1136
|
|
|
961
1137
|
`;
|
|
962
|
-
var AppJsContent = (extraImports) => `import
|
|
963
|
-
|
|
964
|
-
const TinaCMS = dynamic(() => import('tinacms'), { ssr: false })
|
|
1138
|
+
var AppJsContent = (usingSrc, extraImports) => `import Tina from '${usingSrc ? "../" : ""}../.tina/components/TinaDynamicProvider.js'
|
|
1139
|
+
|
|
965
1140
|
${extraImports || ""}
|
|
1141
|
+
const App = ({ Component, pageProps }) => {
|
|
1142
|
+
return (
|
|
1143
|
+
<Tina>
|
|
1144
|
+
<Component {...pageProps} />
|
|
1145
|
+
</Tina>
|
|
1146
|
+
)
|
|
1147
|
+
}
|
|
966
1148
|
|
|
967
|
-
|
|
968
|
-
const apiURL =
|
|
969
|
-
process.env.NODE_ENV == "development"
|
|
970
|
-
? "http://localhost:4001/graphql"
|
|
971
|
-
: \`https://content.tinajs.io/content/\${process.env.NEXT_PUBLIC_TINA_CLIENT_ID}/github/\${branch}\`;
|
|
1149
|
+
export default App
|
|
972
1150
|
|
|
973
|
-
|
|
1151
|
+
`;
|
|
1152
|
+
|
|
1153
|
+
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/init/index.ts
|
|
1154
|
+
var import_chalk2 = __toModule(require("chalk"));
|
|
1155
|
+
|
|
1156
|
+
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/init/setup-files/tinaProvider.ts
|
|
1157
|
+
var TinaProvider = `import TinaCMS from 'tinacms'
|
|
1158
|
+
import { tinaConfig } from '../schema.ts'
|
|
1159
|
+
|
|
1160
|
+
// Importing the TinaProvider directly into your page will cause Tina to be added to the production bundle.
|
|
1161
|
+
// Instead, import the tina/provider/index default export to have it dynamially imported in edit-moode
|
|
1162
|
+
/**
|
|
1163
|
+
*
|
|
1164
|
+
* @private Do not import this directly, please import the dynamic provider instead
|
|
1165
|
+
*/
|
|
1166
|
+
const TinaProvider = ({ children }) => {
|
|
1167
|
+
return <TinaCMS {...tinaConfig}>{children}</TinaCMS>
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
export default TinaProvider
|
|
1171
|
+
`;
|
|
1172
|
+
var TinaProviderDynamic = `import dynamic from 'next/dynamic'
|
|
1173
|
+
const TinaProvider = dynamic(() => import('./TinaProvider'), { ssr: false })
|
|
1174
|
+
import { TinaEditProvider } from 'tinacms/dist/edit-state'
|
|
1175
|
+
|
|
1176
|
+
const DynamicTina = ({ children }) => {
|
|
974
1177
|
return (
|
|
975
1178
|
<>
|
|
976
|
-
<TinaEditProvider
|
|
977
|
-
|
|
978
|
-
<TinaCMS
|
|
979
|
-
apiURL={apiURL}
|
|
980
|
-
|
|
981
|
-
>
|
|
982
|
-
<Component {...pageProps} />
|
|
983
|
-
</TinaCMS>
|
|
984
|
-
}
|
|
985
|
-
>
|
|
986
|
-
<Component {...pageProps} />
|
|
1179
|
+
<TinaEditProvider editMode={<TinaProvider>{children}</TinaProvider>}>
|
|
1180
|
+
{children}
|
|
987
1181
|
</TinaEditProvider>
|
|
988
1182
|
</>
|
|
989
1183
|
)
|
|
990
1184
|
}
|
|
991
1185
|
|
|
992
|
-
export default
|
|
1186
|
+
export default DynamicTina
|
|
993
1187
|
`;
|
|
994
1188
|
|
|
995
1189
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/init/index.ts
|
|
996
|
-
var import_chalk2 = __toModule(require("chalk"));
|
|
997
1190
|
function execShellCommand(cmd) {
|
|
998
1191
|
const exec = require("child_process").exec;
|
|
999
1192
|
return new Promise((resolve2, _reject) => {
|
|
@@ -1026,26 +1219,32 @@ async function installDeps(ctx, next, options) {
|
|
|
1026
1219
|
next();
|
|
1027
1220
|
}
|
|
1028
1221
|
var baseDir = process.cwd();
|
|
1029
|
-
var
|
|
1030
|
-
var
|
|
1031
|
-
var
|
|
1032
|
-
var
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1222
|
+
var blogContentPath = import_path5.default.join(baseDir, "content", "posts");
|
|
1223
|
+
var blogPostPath = import_path5.default.join(blogContentPath, "HelloWorld.md");
|
|
1224
|
+
var TinaFolder = import_path5.default.join(baseDir, ".tina");
|
|
1225
|
+
var componentFolder = import_path5.default.join(TinaFolder, "components");
|
|
1226
|
+
var TinaProviderPath = import_path5.default.join(componentFolder, "TinaProvider.js");
|
|
1227
|
+
var TinaDynamicProvider = import_path5.default.join(componentFolder, "TinaDynamicProvider.js");
|
|
1228
|
+
async function tinaSetup(_ctx, next, _options) {
|
|
1229
|
+
const useingSrc = import_fs_extra4.default.pathExistsSync(import_path5.default.join(baseDir, "src"));
|
|
1230
|
+
if (!import_fs_extra4.default.pathExistsSync(blogPostPath)) {
|
|
1036
1231
|
logger.info(logText("Adding a content folder..."));
|
|
1037
|
-
|
|
1038
|
-
|
|
1232
|
+
import_fs_extra4.default.mkdirpSync(blogContentPath);
|
|
1233
|
+
import_fs_extra4.default.writeFileSync(blogPostPath, blogPost);
|
|
1234
|
+
}
|
|
1235
|
+
if (!import_fs_extra4.default.existsSync(TinaProviderPath) && !import_fs_extra4.default.existsSync(TinaDynamicProvider)) {
|
|
1236
|
+
import_fs_extra4.default.mkdirpSync(componentFolder);
|
|
1237
|
+
import_fs_extra4.default.writeFileSync(TinaProviderPath, TinaProvider);
|
|
1238
|
+
import_fs_extra4.default.writeFileSync(TinaDynamicProvider, TinaProviderDynamic);
|
|
1039
1239
|
}
|
|
1040
1240
|
logger.level = "info";
|
|
1041
|
-
const pagesPath =
|
|
1042
|
-
const appPath =
|
|
1043
|
-
const appPathTS =
|
|
1044
|
-
const appExtension =
|
|
1045
|
-
|
|
1046
|
-
if (!import_fs_extra3.default.pathExistsSync(appPath) && !import_fs_extra3.default.pathExistsSync(appPathTS)) {
|
|
1241
|
+
const pagesPath = import_path5.default.join(baseDir, useingSrc ? "src" : "", "pages");
|
|
1242
|
+
const appPath = import_path5.default.join(pagesPath, "_app.js");
|
|
1243
|
+
const appPathTS = import_path5.default.join(pagesPath, "_app.tsx");
|
|
1244
|
+
const appExtension = import_fs_extra4.default.existsSync(appPath) ? ".js" : ".tsx";
|
|
1245
|
+
if (!import_fs_extra4.default.pathExistsSync(appPath) && !import_fs_extra4.default.pathExistsSync(appPathTS)) {
|
|
1047
1246
|
logger.info(logText("Adding _app.js ... \u2705"));
|
|
1048
|
-
|
|
1247
|
+
import_fs_extra4.default.writeFileSync(appPath, AppJsContent(useingSrc));
|
|
1049
1248
|
} else {
|
|
1050
1249
|
const override = await (0, import_prompts.default)({
|
|
1051
1250
|
name: "res",
|
|
@@ -1054,28 +1253,27 @@ async function tinaSetup(ctx, next, options) {
|
|
|
1054
1253
|
});
|
|
1055
1254
|
if (override.res) {
|
|
1056
1255
|
logger.info(logText(`Adding _app${appExtension} ... \u2705`));
|
|
1057
|
-
const appPathWithExtension =
|
|
1058
|
-
const fileContent =
|
|
1256
|
+
const appPathWithExtension = import_path5.default.join(pagesPath, `_app${appExtension}`);
|
|
1257
|
+
const fileContent = import_fs_extra4.default.pathExistsSync(appPath) ? (0, import_fs_extra4.readFileSync)(appPath) : (0, import_fs_extra4.readFileSync)(appPathTS);
|
|
1059
1258
|
const matches = [
|
|
1060
1259
|
...fileContent.toString().matchAll(/^.*import.*\.css("|').*$/gm)
|
|
1061
1260
|
];
|
|
1062
1261
|
const primaryMatches = matches.map((x) => x[0]);
|
|
1063
|
-
|
|
1262
|
+
import_fs_extra4.default.writeFileSync(appPathWithExtension, AppJsContent(useingSrc, primaryMatches.join("\n")));
|
|
1064
1263
|
} else {
|
|
1065
|
-
wrapper = true;
|
|
1066
1264
|
logger.info(dangerText(`Heads up, to enable live-editing you'll need to wrap your page or site in Tina:
|
|
1067
|
-
`, warnText(AppJsContent())));
|
|
1265
|
+
`, warnText(AppJsContent(useingSrc))));
|
|
1068
1266
|
}
|
|
1069
1267
|
}
|
|
1070
|
-
const tinaBlogPagePath =
|
|
1071
|
-
const tinaBlogPagePathFile =
|
|
1072
|
-
if (!
|
|
1073
|
-
|
|
1074
|
-
|
|
1268
|
+
const tinaBlogPagePath = import_path5.default.join(pagesPath, "demo", "blog");
|
|
1269
|
+
const tinaBlogPagePathFile = import_path5.default.join(tinaBlogPagePath, "[filename].js");
|
|
1270
|
+
if (!import_fs_extra4.default.pathExistsSync(tinaBlogPagePathFile)) {
|
|
1271
|
+
import_fs_extra4.default.mkdirpSync(tinaBlogPagePath);
|
|
1272
|
+
import_fs_extra4.default.writeFileSync(tinaBlogPagePathFile, nextPostPage());
|
|
1075
1273
|
}
|
|
1076
1274
|
logger.info("Adding a content folder... \u2705");
|
|
1077
|
-
const packagePath =
|
|
1078
|
-
const pack = JSON.parse((0,
|
|
1275
|
+
const packagePath = import_path5.default.join(baseDir, "package.json");
|
|
1276
|
+
const pack = JSON.parse((0, import_fs_extra4.readFileSync)(packagePath).toString());
|
|
1079
1277
|
const oldScripts = pack.scripts || {};
|
|
1080
1278
|
const newPack = JSON.stringify(__spreadProps(__spreadValues({}, pack), {
|
|
1081
1279
|
scripts: __spreadProps(__spreadValues({}, oldScripts), {
|
|
@@ -1084,14 +1282,14 @@ async function tinaSetup(ctx, next, options) {
|
|
|
1084
1282
|
"tina-start": 'yarn tinacms server:start -c "next start"'
|
|
1085
1283
|
})
|
|
1086
1284
|
}), null, 2);
|
|
1087
|
-
(0,
|
|
1088
|
-
const adminPath =
|
|
1089
|
-
if (
|
|
1090
|
-
logger.warn(`Unable to add /pages/admin
|
|
1285
|
+
(0, import_fs_extra4.writeFileSync)(packagePath, newPack);
|
|
1286
|
+
const adminPath = import_path5.default.join(pagesPath, "admin.js");
|
|
1287
|
+
if (import_fs_extra4.default.pathExistsSync(import_path5.default.join(pagesPath, "admin"))) {
|
|
1288
|
+
logger.warn(`Unable to add /pages/admin.js, this path already exists.
|
|
1091
1289
|
Learn more about toggling edit-mode at https://tina.io/docs/tinacms-context/#manually-toggling-edit-mode`);
|
|
1092
1290
|
return next();
|
|
1093
1291
|
}
|
|
1094
|
-
(0,
|
|
1292
|
+
(0, import_fs_extra4.outputFileSync)(adminPath, adminPage);
|
|
1095
1293
|
next();
|
|
1096
1294
|
}
|
|
1097
1295
|
async function successMessage(ctx, next, options) {
|
|
@@ -1108,7 +1306,7 @@ var import_datalayer3 = __toModule(require("@tinacms/datalayer"));
|
|
|
1108
1306
|
|
|
1109
1307
|
// pnp:/home/runner/work/tinacms/tinacms/packages/@tinacms/cli/src/cmds/audit/audit.ts
|
|
1110
1308
|
var import_graphql8 = __toModule(require("@tinacms/graphql"));
|
|
1111
|
-
var
|
|
1309
|
+
var import_path6 = __toModule(require("path"));
|
|
1112
1310
|
var import_graphql9 = __toModule(require("@tinacms/graphql"));
|
|
1113
1311
|
var import_chalk3 = __toModule(require("chalk"));
|
|
1114
1312
|
var auditCollection = async (args) => {
|
|
@@ -1146,7 +1344,7 @@ var auditCollection = async (args) => {
|
|
|
1146
1344
|
warning = true;
|
|
1147
1345
|
logger.warn(import_chalk3.default.yellowBright(`WARNING: there is a file with extension \`${node.sys.extension}\` but in your schema it is defined to be \`.${format}\`
|
|
1148
1346
|
|
|
1149
|
-
location: ${
|
|
1347
|
+
location: ${import_path6.default.join(rootPath2, node.sys.path)}`));
|
|
1150
1348
|
}
|
|
1151
1349
|
});
|
|
1152
1350
|
return warning;
|
|
@@ -1182,7 +1380,7 @@ var auditDocuments = async (args) => {
|
|
|
1182
1380
|
const documents = result.data.getCollection.documents.edges;
|
|
1183
1381
|
for (let i = 0; i < documents.length; i++) {
|
|
1184
1382
|
const node = documents[i].node;
|
|
1185
|
-
const fullPath =
|
|
1383
|
+
const fullPath = import_path6.default.join(rootPath2, node.sys.path);
|
|
1186
1384
|
logger.info(`Checking document: ${fullPath}`);
|
|
1187
1385
|
const documentQuery = `query {
|
|
1188
1386
|
getDocument(collection: "${collection.name}", relativePath: "${node.sys.relativePath}") {
|
|
@@ -1379,7 +1577,7 @@ var noSDKCodegenOption = {
|
|
|
1379
1577
|
};
|
|
1380
1578
|
var cleanOption = {
|
|
1381
1579
|
name: "--clean",
|
|
1382
|
-
description: "
|
|
1580
|
+
description: "Updates all content files to remove any data not explicitly permitted by the current schema definition"
|
|
1383
1581
|
};
|
|
1384
1582
|
var useDefaultValuesOption = {
|
|
1385
1583
|
name: "--useDefaultValues",
|
|
@@ -1389,6 +1587,10 @@ var noTelemetryOption = {
|
|
|
1389
1587
|
name: "--noTelemetry",
|
|
1390
1588
|
description: "Disable anonymous telemetry that is collected"
|
|
1391
1589
|
};
|
|
1590
|
+
var watchFileOption = {
|
|
1591
|
+
name: "-w, --watchFolders [folders...]",
|
|
1592
|
+
description: "a list of folders (relative to where this is being run) that the cli will watch for changes"
|
|
1593
|
+
};
|
|
1392
1594
|
var baseCmds = [
|
|
1393
1595
|
{
|
|
1394
1596
|
command: CMD_START_SERVER,
|
|
@@ -1399,7 +1601,8 @@ var baseCmds = [
|
|
|
1399
1601
|
experimentalDatalayer,
|
|
1400
1602
|
noWatchOption,
|
|
1401
1603
|
noSDKCodegenOption,
|
|
1402
|
-
noTelemetryOption
|
|
1604
|
+
noTelemetryOption,
|
|
1605
|
+
watchFileOption
|
|
1403
1606
|
],
|
|
1404
1607
|
action: (options) => chain([startServer], options)
|
|
1405
1608
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
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 getSchemaPath: ({ projectDir }: {
|
|
14
|
+
projectDir: string;
|
|
15
|
+
}) => any;
|
|
@@ -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 * from './getSchemaPath';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/cli",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@tinacms/scripts": "0.50.
|
|
24
|
+
"@tinacms/scripts": "0.50.7",
|
|
25
25
|
"@types/clear": "0.1.0",
|
|
26
26
|
"@types/cors": "2.8.5",
|
|
27
27
|
"@types/express": "^4.17.7",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"@types/progress": "^2.0.3",
|
|
39
39
|
"@types/prompts": "^2.0.13",
|
|
40
40
|
"@types/yup": "^0.29.11",
|
|
41
|
-
"jest": "^27.0.6"
|
|
41
|
+
"jest": "^27.0.6",
|
|
42
|
+
"typescript": "^4.3.5"
|
|
42
43
|
},
|
|
43
44
|
"scripts": {
|
|
44
45
|
"build": "echo \"Run `yarn build` from the root of the repository instead\"",
|
|
@@ -57,8 +58,10 @@
|
|
|
57
58
|
"@graphql-tools/graphql-file-loader": "^7.2.0",
|
|
58
59
|
"@graphql-tools/load": "^7.3.2",
|
|
59
60
|
"@tinacms/datalayer": "0.0.2",
|
|
60
|
-
"@tinacms/graphql": "0.59.
|
|
61
|
+
"@tinacms/graphql": "0.59.7",
|
|
61
62
|
"@tinacms/metrics": "0.0.2",
|
|
63
|
+
"@yarnpkg/esbuild-plugin-pnp": "^2.0.1-rc.3",
|
|
64
|
+
"add": "^2.0.6",
|
|
62
65
|
"ajv": "^6.12.3",
|
|
63
66
|
"altair-express-middleware": "4.0.6",
|
|
64
67
|
"auto-bind": "^4.0.0",
|
|
@@ -66,8 +69,9 @@
|
|
|
66
69
|
"body-parser": "^1.19.0",
|
|
67
70
|
"chalk": "^2.4.2",
|
|
68
71
|
"chokidar": "^3.5.1",
|
|
69
|
-
"commander": "
|
|
72
|
+
"commander": "^9.0.0",
|
|
70
73
|
"cors": "^2.8.5",
|
|
74
|
+
"esbuild": "^0.14.20",
|
|
71
75
|
"esm": "3.2.25",
|
|
72
76
|
"express": "^4.17.1",
|
|
73
77
|
"fast-glob": "^3.2.4",
|
|
@@ -80,7 +84,7 @@
|
|
|
80
84
|
"normalize-path": "^3.0.0",
|
|
81
85
|
"progress": "^2.0.3",
|
|
82
86
|
"prompts": "^2.4.1",
|
|
83
|
-
"
|
|
87
|
+
"yarn": "^1.22.17",
|
|
84
88
|
"yup": "^0.32.9"
|
|
85
89
|
},
|
|
86
90
|
"publishConfig": {
|