@tinacms/cli 0.0.0-b4c6a60-20241010070518 → 0.0.0-b54b303-20241210232138

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/dist/index.js CHANGED
@@ -31,7 +31,7 @@ module.exports = __toCommonJS(src_exports);
31
31
  var import_clipanion8 = require("clipanion");
32
32
 
33
33
  // package.json
34
- var version = "1.6.9";
34
+ var version = "1.6.13";
35
35
 
36
36
  // src/next/commands/dev-command/index.ts
37
37
  var import_clipanion2 = require("clipanion");
@@ -2209,7 +2209,7 @@ var BaseCommand = class extends import_clipanion.Command {
2209
2209
  pathFilter
2210
2210
  });
2211
2211
  const tinaPathUpdates = modified.filter(
2212
- (path13) => path13.startsWith(".tina/__generated__/_schema.json") || path13.startsWith("tina/tina-lock.json")
2212
+ (path14) => path14.startsWith(".tina/__generated__/_schema.json") || path14.startsWith("tina/tina-lock.json")
2213
2213
  );
2214
2214
  if (tinaPathUpdates.length > 0) {
2215
2215
  res = await database.indexContent({
@@ -2537,6 +2537,8 @@ DevCommand.usage = import_clipanion2.Command.Usage({
2537
2537
  var import_clipanion3 = require("clipanion");
2538
2538
  var import_progress2 = __toESM(require("progress"));
2539
2539
  var import_fs_extra7 = __toESM(require("fs-extra"));
2540
+ var import_crypto = __toESM(require("crypto"));
2541
+ var import_path6 = __toESM(require("path"));
2540
2542
  var import_graphql11 = require("@tinacms/graphql");
2541
2543
 
2542
2544
  // src/next/commands/build-command/server.ts
@@ -2580,7 +2582,7 @@ var buildProductionSpa = async (configManager, database, apiURL) => {
2580
2582
  // src/next/commands/build-command/index.ts
2581
2583
  var import_schema_tools2 = require("@tinacms/schema-tools");
2582
2584
  var import_graphql12 = require("graphql");
2583
- var import_core2 = require("@graphql-inspector/core");
2585
+ var import_core3 = require("@graphql-inspector/core");
2584
2586
 
2585
2587
  // src/next/commands/build-command/waitForDB.ts
2586
2588
  var import_progress = __toESM(require("progress"));
@@ -2682,6 +2684,20 @@ var waitForDB = async (config2, apiUrl, previewName, verbose) => {
2682
2684
 
2683
2685
  // src/next/commands/build-command/index.ts
2684
2686
  var import_search2 = require("@tinacms/search");
2687
+
2688
+ // src/utils/index.ts
2689
+ var import_core2 = require("@graphql-inspector/core");
2690
+ var getFaqLink = (type) => {
2691
+ switch (type) {
2692
+ case import_core2.ChangeType.FieldRemoved: {
2693
+ return "https://tina.io/docs/introduction/faq#how-do-i-resolve-the-local-graphql-schema-doesnt-match-the-remote-graphql-schema-errors";
2694
+ }
2695
+ default:
2696
+ return null;
2697
+ }
2698
+ };
2699
+
2700
+ // src/next/commands/build-command/index.ts
2685
2701
  var BuildCommand = class extends BaseCommand {
2686
2702
  constructor() {
2687
2703
  super(...arguments);
@@ -2809,7 +2825,7 @@ ${dangerText(e.message)}
2809
2825
  }
2810
2826
  const skipCloudChecks = this.skipCloudChecks || configManager.hasSelfHostedConfig();
2811
2827
  if (!skipCloudChecks) {
2812
- const { hasUpstream } = await this.checkClientInfo(
2828
+ const { hasUpstream, timestamp } = await this.checkClientInfo(
2813
2829
  configManager,
2814
2830
  codegen2.productionUrl,
2815
2831
  this.previewBaseBranch
@@ -2837,7 +2853,16 @@ ${dangerText(e.message)}
2837
2853
  await this.checkGraphqlSchema(
2838
2854
  configManager,
2839
2855
  database,
2840
- codegen2.productionUrl
2856
+ codegen2.productionUrl,
2857
+ timestamp
2858
+ );
2859
+ await this.checkTinaSchema(
2860
+ configManager,
2861
+ database,
2862
+ codegen2.productionUrl,
2863
+ this.previewName,
2864
+ this.verbose,
2865
+ timestamp
2841
2866
  );
2842
2867
  }
2843
2868
  await buildProductionSpa(configManager, database, codegen2.productionUrl);
@@ -2956,11 +2981,13 @@ ${dangerText(e.message)}
2956
2981
  const bar2 = new import_progress2.default("Checking clientId and token. :prog", 1);
2957
2982
  let branchKnown = false;
2958
2983
  let hasUpstream = false;
2984
+ let timestamp;
2959
2985
  try {
2960
2986
  const res = await request({
2961
2987
  token,
2962
2988
  url
2963
2989
  });
2990
+ timestamp = res.timestamp || 0;
2964
2991
  bar2.tick({
2965
2992
  prog: "\u2705"
2966
2993
  });
@@ -3002,7 +3029,8 @@ ${dangerText(e.message)}
3002
3029
  prog: "\u2705"
3003
3030
  });
3004
3031
  return {
3005
- hasUpstream
3032
+ hasUpstream,
3033
+ timestamp
3006
3034
  };
3007
3035
  }
3008
3036
  for (let i = 0; i <= 5; i++) {
@@ -3092,14 +3120,14 @@ ${dangerText(e.message)}
3092
3120
  throw e;
3093
3121
  }
3094
3122
  }
3095
- async checkGraphqlSchema(configManager, database, apiURL) {
3123
+ async checkGraphqlSchema(configManager, database, apiURL, timestamp) {
3096
3124
  const bar2 = new import_progress2.default(
3097
3125
  "Checking local GraphQL Schema matches server. :prog",
3098
3126
  1
3099
3127
  );
3100
3128
  const { config: config2 } = configManager;
3101
3129
  const token = config2.token;
3102
- const remoteSchema = await fetchRemoteGraphqlSchema({
3130
+ const { remoteSchema, remoteVersion } = await fetchRemoteGraphqlSchema({
3103
3131
  url: apiURL,
3104
3132
  token
3105
3133
  });
@@ -3119,7 +3147,7 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
3119
3147
  const localSchemaDocument = await database.getGraphQLSchemaFromBridge();
3120
3148
  const localGraphqlSchema = (0, import_graphql12.buildASTSchema)(localSchemaDocument);
3121
3149
  try {
3122
- const diffResult = await (0, import_core2.diff)(localGraphqlSchema, remoteGqlSchema);
3150
+ const diffResult = await (0, import_core3.diff)(localGraphqlSchema, remoteGqlSchema);
3123
3151
  if (diffResult.length === 0) {
3124
3152
  bar2.tick({
3125
3153
  prog: "\u2705"
@@ -3128,12 +3156,29 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
3128
3156
  bar2.tick({
3129
3157
  prog: "\u274C"
3130
3158
  });
3131
- let errorMessage = `The local GraphQL schema doesn't match the remote GraphQL schema. Please push up your changes to GitHub to update your remote GraphQL schema.`;
3132
- if (config2 == null ? void 0 : config2.branch) {
3133
- errorMessage += `
3159
+ const type = diffResult[0].type;
3160
+ const reason = diffResult[0].message;
3161
+ const errorLevel = diffResult[0].criticality.level;
3162
+ const faqLink = getFaqLink(type);
3163
+ let errorMessage = `The local GraphQL schema doesn't match the remote GraphQL schema. Please push up your changes to GitHub to update your remote GraphQL schema. ${faqLink && `
3164
+ Check out '${faqLink}' for possible solutions.`}`;
3165
+ errorMessage += `
3134
3166
 
3135
- Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
3167
+ Additional info:
3168
+
3169
+ `;
3170
+ if (config2 == null ? void 0 : config2.branch) {
3171
+ errorMessage += ` Branch: ${config2.branch}, Client ID: ${config2.clientId}
3172
+ `;
3136
3173
  }
3174
+ errorMessage += ` Local GraphQL version: ${configManager.getTinaGraphQLVersion()} / Remote GraphQL version: ${remoteVersion}
3175
+ `;
3176
+ errorMessage += ` Last indexed at: ${new Date(
3177
+ timestamp
3178
+ ).toUTCString()}
3179
+ `;
3180
+ errorMessage += ` Reason: [${errorLevel} - ${type}] ${reason}
3181
+ `;
3137
3182
  throw new Error(errorMessage);
3138
3183
  }
3139
3184
  } catch (e) {
@@ -3148,6 +3193,71 @@ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
3148
3193
  }
3149
3194
  }
3150
3195
  }
3196
+ async checkTinaSchema(configManager, database, apiURL, previewName, verbose, timestamp) {
3197
+ const bar2 = new import_progress2.default(
3198
+ "Checking local Tina Schema matches server. :prog",
3199
+ 1
3200
+ );
3201
+ const { config: config2 } = configManager;
3202
+ const token = config2.token;
3203
+ const { clientId, branch, isLocalClient, host } = (0, import_schema_tools2.parseURL)(apiURL);
3204
+ if (isLocalClient || !host || !clientId || !branch) {
3205
+ if (verbose) {
3206
+ logger.info(logText("Not using Tina Cloud, skipping Tina Schema check"));
3207
+ }
3208
+ return;
3209
+ }
3210
+ const { tinaSchema: remoteTinaSchemaSha } = await fetchSchemaSha({
3211
+ url: `https://${host}/db/${clientId}/${previewName || branch}/schemaSha`,
3212
+ token
3213
+ });
3214
+ if (!remoteTinaSchemaSha) {
3215
+ bar2.tick({
3216
+ prog: "\u274C"
3217
+ });
3218
+ let errorMessage = `The remote Tina schema does not exist. Check indexing for this branch.`;
3219
+ if (config2 == null ? void 0 : config2.branch) {
3220
+ errorMessage += `
3221
+
3222
+ Additional info: Branch: ${config2.branch}, Client ID: ${config2.clientId} `;
3223
+ }
3224
+ throw new Error(errorMessage);
3225
+ }
3226
+ if (!database.bridge) {
3227
+ throw new Error(`No bridge configured`);
3228
+ }
3229
+ const localTinaSchema = JSON.parse(
3230
+ await database.bridge.get(
3231
+ import_path6.default.join(database.tinaDirectory, "__generated__", "_schema.json")
3232
+ )
3233
+ );
3234
+ localTinaSchema.version = void 0;
3235
+ const localTinaSchemaSha = import_crypto.default.createHash("sha256").update(JSON.stringify(localTinaSchema)).digest("hex");
3236
+ if (localTinaSchemaSha === remoteTinaSchemaSha) {
3237
+ bar2.tick({
3238
+ prog: "\u2705"
3239
+ });
3240
+ } else {
3241
+ bar2.tick({
3242
+ prog: "\u274C"
3243
+ });
3244
+ let errorMessage = `The local Tina schema doesn't match the remote Tina schema. Please push up your changes to GitHub to update your remote tina schema.`;
3245
+ errorMessage += `
3246
+
3247
+ Additional info:
3248
+
3249
+ `;
3250
+ if (config2 == null ? void 0 : config2.branch) {
3251
+ errorMessage += ` Branch: ${config2.branch}, Client ID: ${config2.clientId}
3252
+ `;
3253
+ }
3254
+ errorMessage += ` Last indexed at: ${new Date(
3255
+ timestamp
3256
+ ).toUTCString()}
3257
+ `;
3258
+ throw new Error(errorMessage);
3259
+ }
3260
+ }
3151
3261
  };
3152
3262
  BuildCommand.paths = [["build"]];
3153
3263
  BuildCommand.usage = import_clipanion3.Command.Usage({
@@ -3214,7 +3324,25 @@ var fetchRemoteGraphqlSchema = async ({
3214
3324
  body
3215
3325
  });
3216
3326
  const data = await res.json();
3217
- return data == null ? void 0 : data.data;
3327
+ return {
3328
+ remoteSchema: data == null ? void 0 : data.data,
3329
+ remoteVersion: res.headers.get("tinacms-grapqhl-version")
3330
+ };
3331
+ };
3332
+ var fetchSchemaSha = async ({
3333
+ url,
3334
+ token
3335
+ }) => {
3336
+ const headers = new Headers();
3337
+ if (token) {
3338
+ headers.append("X-API-KEY", token);
3339
+ }
3340
+ const res = await fetch(url, {
3341
+ method: "GET",
3342
+ headers,
3343
+ cache: "no-cache"
3344
+ });
3345
+ return res.json();
3218
3346
  };
3219
3347
 
3220
3348
  // src/next/commands/audit-command/index.ts
@@ -3469,25 +3597,25 @@ var import_clipanion6 = require("clipanion");
3469
3597
 
3470
3598
  // src/cmds/init/detectEnvironment.ts
3471
3599
  var import_fs_extra8 = __toESM(require("fs-extra"));
3472
- var import_path6 = __toESM(require("path"));
3600
+ var import_path7 = __toESM(require("path"));
3473
3601
  var checkGitignoreForItem = async ({
3474
3602
  baseDir,
3475
3603
  line
3476
3604
  }) => {
3477
- const gitignoreContent = import_fs_extra8.default.readFileSync(import_path6.default.join(baseDir, ".gitignore")).toString();
3605
+ const gitignoreContent = import_fs_extra8.default.readFileSync(import_path7.default.join(baseDir, ".gitignore")).toString();
3478
3606
  return gitignoreContent.split("\n").some((item) => item === line);
3479
3607
  };
3480
3608
  var makeGeneratedFile = async (name2, generatedFileType, parentPath, opts) => {
3481
3609
  const result = {
3482
- fullPathTS: import_path6.default.join(
3610
+ fullPathTS: import_path7.default.join(
3483
3611
  parentPath,
3484
3612
  `${name2}.${(opts == null ? void 0 : opts.typescriptSuffix) || (opts == null ? void 0 : opts.extensionOverride) || "ts"}`
3485
3613
  ),
3486
- fullPathJS: import_path6.default.join(
3614
+ fullPathJS: import_path7.default.join(
3487
3615
  parentPath,
3488
3616
  `${name2}.${(opts == null ? void 0 : opts.extensionOverride) || "js"}`
3489
3617
  ),
3490
- fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ? import_path6.default.join(parentPath, `${name2}.${opts == null ? void 0 : opts.extensionOverride}`) : "",
3618
+ fullPathOverride: (opts == null ? void 0 : opts.extensionOverride) ? import_path7.default.join(parentPath, `${name2}.${opts == null ? void 0 : opts.extensionOverride}`) : "",
3491
3619
  generatedFileType,
3492
3620
  name: name2,
3493
3621
  parentPath,
@@ -3517,16 +3645,16 @@ var detectEnvironment = async ({
3517
3645
  }) => {
3518
3646
  var _a;
3519
3647
  const hasForestryConfig = await import_fs_extra8.default.pathExists(
3520
- import_path6.default.join(pathToForestryConfig, ".forestry", "settings.yml")
3648
+ import_path7.default.join(pathToForestryConfig, ".forestry", "settings.yml")
3521
3649
  );
3522
- const sampleContentPath = import_path6.default.join(
3650
+ const sampleContentPath = import_path7.default.join(
3523
3651
  baseDir,
3524
3652
  "content",
3525
3653
  "posts",
3526
3654
  "hello-world.md"
3527
3655
  );
3528
- const usingSrc = import_fs_extra8.default.pathExistsSync(import_path6.default.join(baseDir, "src")) && (import_fs_extra8.default.pathExistsSync(import_path6.default.join(baseDir, "src", "app")) || import_fs_extra8.default.pathExistsSync(import_path6.default.join(baseDir, "src", "pages")));
3529
- const tinaFolder = import_path6.default.join(baseDir, "tina");
3656
+ const usingSrc = import_fs_extra8.default.pathExistsSync(import_path7.default.join(baseDir, "src")) && (import_fs_extra8.default.pathExistsSync(import_path7.default.join(baseDir, "src", "app")) || import_fs_extra8.default.pathExistsSync(import_path7.default.join(baseDir, "src", "pages")));
3657
+ const tinaFolder = import_path7.default.join(baseDir, "tina");
3530
3658
  const tinaConfigExists = Boolean(
3531
3659
  await import_fs_extra8.default.pathExists(tinaFolder) && (await import_fs_extra8.default.readdir(tinaFolder)).find((x) => x.includes("config"))
3532
3660
  );
@@ -3540,12 +3668,12 @@ var detectEnvironment = async ({
3540
3668
  "next-api-handler": await makeGeneratedFile(
3541
3669
  "[...routes]",
3542
3670
  "next-api-handler",
3543
- import_path6.default.join(...pagesDir, "api", "tina")
3671
+ import_path7.default.join(...pagesDir, "api", "tina")
3544
3672
  ),
3545
3673
  "reactive-example": await makeGeneratedFile(
3546
3674
  "[filename]",
3547
3675
  "reactive-example",
3548
- import_path6.default.join(...pagesDir, "demo", "blog"),
3676
+ import_path7.default.join(...pagesDir, "demo", "blog"),
3549
3677
  {
3550
3678
  typescriptSuffix: "tsx"
3551
3679
  }
@@ -3553,13 +3681,13 @@ var detectEnvironment = async ({
3553
3681
  "users-json": await makeGeneratedFile(
3554
3682
  "index",
3555
3683
  "users-json",
3556
- import_path6.default.join(baseDir, "content", "users"),
3684
+ import_path7.default.join(baseDir, "content", "users"),
3557
3685
  { extensionOverride: "json" }
3558
3686
  ),
3559
3687
  "sample-content": await makeGeneratedFile(
3560
3688
  "hello-world",
3561
3689
  "sample-content",
3562
- import_path6.default.join(baseDir, "content", "posts"),
3690
+ import_path7.default.join(baseDir, "content", "posts"),
3563
3691
  { extensionOverride: "md" }
3564
3692
  )
3565
3693
  };
@@ -3585,13 +3713,13 @@ var detectEnvironment = async ({
3585
3713
  );
3586
3714
  }
3587
3715
  }
3588
- const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path6.default.join(".gitignore"));
3716
+ const hasGitIgnore = await import_fs_extra8.default.pathExists(import_path7.default.join(".gitignore"));
3589
3717
  const hasGitIgnoreNodeModules = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: "node_modules" });
3590
3718
  const hasEnvTina = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env.tina" });
3591
3719
  const hasGitIgnoreEnv = hasGitIgnore && await checkGitignoreForItem({ baseDir, line: ".env" });
3592
3720
  let frontMatterFormat;
3593
3721
  if (hasForestryConfig) {
3594
- const hugoConfigPath = import_path6.default.join(rootPath, "config.toml");
3722
+ const hugoConfigPath = import_path7.default.join(rootPath, "config.toml");
3595
3723
  if (await import_fs_extra8.default.pathExists(hugoConfigPath)) {
3596
3724
  const hugoConfig = await import_fs_extra8.default.readFile(hugoConfigPath, "utf8");
3597
3725
  const metaDataFormat = (_a = hugoConfig.match(/metaDataFormat = "(.*)"/)) == null ? void 0 : _a[1];
@@ -4199,18 +4327,18 @@ var CLICommand = class {
4199
4327
  };
4200
4328
 
4201
4329
  // src/cmds/init/apply.ts
4202
- var import_path10 = __toESM(require("path"));
4330
+ var import_path11 = __toESM(require("path"));
4203
4331
 
4204
4332
  // src/cmds/forestry-migrate/index.ts
4205
4333
  var import_fs_extra10 = __toESM(require("fs-extra"));
4206
- var import_path8 = __toESM(require("path"));
4334
+ var import_path9 = __toESM(require("path"));
4207
4335
  var import_js_yaml2 = __toESM(require("js-yaml"));
4208
4336
  var import_minimatch = __toESM(require("minimatch"));
4209
4337
  var import_graphql16 = require("@tinacms/graphql");
4210
4338
 
4211
4339
  // src/cmds/forestry-migrate/util/index.ts
4212
4340
  var import_fs_extra9 = __toESM(require("fs-extra"));
4213
- var import_path7 = __toESM(require("path"));
4341
+ var import_path8 = __toESM(require("path"));
4214
4342
  var import_js_yaml = __toESM(require("js-yaml"));
4215
4343
  var import_zod = __toESM(require("zod"));
4216
4344
 
@@ -4621,7 +4749,7 @@ var transformForestryFieldsToTinaFields = ({
4621
4749
  return tinaFields;
4622
4750
  };
4623
4751
  var getFieldsFromTemplates = ({ tem, pathToForestryConfig, skipBlocks = false }) => {
4624
- const templatePath = import_path7.default.join(
4752
+ const templatePath = import_path8.default.join(
4625
4753
  pathToForestryConfig,
4626
4754
  ".forestry",
4627
4755
  "front_matter",
@@ -4696,8 +4824,8 @@ var generateAllTemplates = async ({
4696
4824
  pathToForestryConfig
4697
4825
  }) => {
4698
4826
  const allTemplates = (await import_fs_extra10.default.readdir(
4699
- import_path8.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
4700
- )).map((tem) => import_path8.default.basename(tem, ".yml"));
4827
+ import_path9.default.join(pathToForestryConfig, ".forestry", "front_matter", "templates")
4828
+ )).map((tem) => import_path9.default.basename(tem, ".yml"));
4701
4829
  const templateMap = /* @__PURE__ */ new Map();
4702
4830
  const proms = allTemplates.map(async (tem) => {
4703
4831
  try {
@@ -4839,9 +4967,9 @@ var generateCollectionFromForestrySection = (args) => {
4839
4967
  return c;
4840
4968
  } else if (section.type === "document") {
4841
4969
  const filePath = section.path;
4842
- const extname = import_path8.default.extname(filePath);
4843
- const fileName = import_path8.default.basename(filePath, extname);
4844
- const dir = import_path8.default.dirname(filePath);
4970
+ const extname = import_path9.default.extname(filePath);
4971
+ const fileName = import_path9.default.basename(filePath, extname);
4972
+ const dir = import_path9.default.dirname(filePath);
4845
4973
  const ext = checkExt(extname);
4846
4974
  if (ext) {
4847
4975
  const fields = [];
@@ -4904,7 +5032,7 @@ var generateCollections = async ({
4904
5032
  usingTypescript
4905
5033
  });
4906
5034
  const forestryConfig = await import_fs_extra10.default.readFile(
4907
- import_path8.default.join(pathToForestryConfig, ".forestry", "settings.yml")
5035
+ import_path9.default.join(pathToForestryConfig, ".forestry", "settings.yml")
4908
5036
  );
4909
5037
  rewriteTemplateKeysInDocs({
4910
5038
  templateMap,
@@ -4935,11 +5063,11 @@ var rewriteTemplateKeysInDocs = (args) => {
4935
5063
  const { templateObj } = templateMap.get(templateKey);
4936
5064
  (_a = templateObj == null ? void 0 : templateObj.pages) == null ? void 0 : _a.forEach((page) => {
4937
5065
  try {
4938
- const filePath = import_path8.default.join(page);
5066
+ const filePath = import_path9.default.join(page);
4939
5067
  if (import_fs_extra10.default.lstatSync(filePath).isDirectory()) {
4940
5068
  return;
4941
5069
  }
4942
- const extname = import_path8.default.extname(filePath);
5070
+ const extname = import_path9.default.extname(filePath);
4943
5071
  const fileContent = import_fs_extra10.default.readFileSync(filePath).toString();
4944
5072
  const content = (0, import_graphql16.parseFile)(
4945
5073
  fileContent,
@@ -4971,7 +5099,7 @@ var import_fs_extra13 = __toESM(require("fs-extra"));
4971
5099
  // src/next/commands/codemod-command/index.ts
4972
5100
  var import_clipanion5 = require("clipanion");
4973
5101
  var import_fs_extra11 = __toESM(require("fs-extra"));
4974
- var import_path9 = __toESM(require("path"));
5102
+ var import_path10 = __toESM(require("path"));
4975
5103
  var CodemodCommand = class extends import_clipanion5.Command {
4976
5104
  constructor() {
4977
5105
  super(...arguments);
@@ -5015,7 +5143,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
5015
5143
  logger.error(e.message);
5016
5144
  process.exit(1);
5017
5145
  }
5018
- const tinaDestination = import_path9.default.join(configManager.rootPath, "tina");
5146
+ const tinaDestination = import_path10.default.join(configManager.rootPath, "tina");
5019
5147
  if (await import_fs_extra11.default.existsSync(tinaDestination)) {
5020
5148
  logger.info(
5021
5149
  `Folder already exists at ${tinaDestination}. Either delete this folder to complete the codemod, or ensure you have properly copied your config from the ".tina" folder.`
@@ -5030,7 +5158,7 @@ var moveTinaFolder = async (rootPath = process.cwd()) => {
5030
5158
  };
5031
5159
  var writeGitignore = async (rootPath) => {
5032
5160
  await import_fs_extra11.default.outputFileSync(
5033
- import_path9.default.join(rootPath, "tina", ".gitignore"),
5161
+ import_path10.default.join(rootPath, "tina", ".gitignore"),
5034
5162
  "__generated__"
5035
5163
  );
5036
5164
  };
@@ -5868,8 +5996,8 @@ async function apply({
5868
5996
  await addConfigFile({
5869
5997
  configArgs: {
5870
5998
  config: config2,
5871
- publicFolder: import_path10.default.join(
5872
- import_path10.default.relative(process.cwd(), pathToForestryConfig),
5999
+ publicFolder: import_path11.default.join(
6000
+ import_path11.default.relative(process.cwd(), pathToForestryConfig),
5873
6001
  config2.publicFolder
5874
6002
  ),
5875
6003
  collections,
@@ -5936,18 +6064,18 @@ var createPackageJSON = async () => {
5936
6064
  };
5937
6065
  var createGitignore = async ({ baseDir }) => {
5938
6066
  logger.info(logText("No .gitignore found, creating one"));
5939
- import_fs_extra13.default.outputFileSync(import_path10.default.join(baseDir, ".gitignore"), "node_modules");
6067
+ import_fs_extra13.default.outputFileSync(import_path11.default.join(baseDir, ".gitignore"), "node_modules");
5940
6068
  };
5941
6069
  var updateGitIgnore = async ({
5942
6070
  baseDir,
5943
6071
  items
5944
6072
  }) => {
5945
6073
  logger.info(logText(`Adding ${items.join(",")} to .gitignore`));
5946
- const gitignoreContent = import_fs_extra13.default.readFileSync(import_path10.default.join(baseDir, ".gitignore")).toString();
6074
+ const gitignoreContent = import_fs_extra13.default.readFileSync(import_path11.default.join(baseDir, ".gitignore")).toString();
5947
6075
  const newGitignoreContent = [...gitignoreContent.split("\n"), ...items].join(
5948
6076
  "\n"
5949
6077
  );
5950
- await import_fs_extra13.default.writeFile(import_path10.default.join(baseDir, ".gitignore"), newGitignoreContent);
6078
+ await import_fs_extra13.default.writeFile(import_path11.default.join(baseDir, ".gitignore"), newGitignoreContent);
5951
6079
  };
5952
6080
  var addDependencies = async (config2, env, params) => {
5953
6081
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
@@ -6017,22 +6145,22 @@ var writeGeneratedFile = async ({
6017
6145
  content,
6018
6146
  typescript
6019
6147
  }) => {
6020
- const { exists, path: path13, parentPath } = generatedFile.resolve(typescript);
6148
+ const { exists, path: path14, parentPath } = generatedFile.resolve(typescript);
6021
6149
  if (exists) {
6022
6150
  if (overwrite) {
6023
- logger.info(`Overwriting file at ${path13}... \u2705`);
6024
- import_fs_extra13.default.outputFileSync(path13, content);
6151
+ logger.info(`Overwriting file at ${path14}... \u2705`);
6152
+ import_fs_extra13.default.outputFileSync(path14, content);
6025
6153
  } else {
6026
- logger.info(`Not overwriting file at ${path13}.`);
6154
+ logger.info(`Not overwriting file at ${path14}.`);
6027
6155
  logger.info(
6028
- logText(`Please add the following to ${path13}:
6156
+ logText(`Please add the following to ${path14}:
6029
6157
  ${indentText(content)}}`)
6030
6158
  );
6031
6159
  }
6032
6160
  } else {
6033
- logger.info(`Adding file at ${path13}... \u2705`);
6161
+ logger.info(`Adding file at ${path14}... \u2705`);
6034
6162
  await import_fs_extra13.default.ensureDir(parentPath);
6035
- import_fs_extra13.default.outputFileSync(path13, content);
6163
+ import_fs_extra13.default.outputFileSync(path14, content);
6036
6164
  }
6037
6165
  };
6038
6166
  var addConfigFile = async ({
@@ -6115,7 +6243,7 @@ var addContentFile = async ({
6115
6243
  return () => ({
6116
6244
  exists: env.sampleContentExists,
6117
6245
  path: env.sampleContentPath,
6118
- parentPath: import_path10.default.dirname(env.sampleContentPath)
6246
+ parentPath: import_path11.default.dirname(env.sampleContentPath)
6119
6247
  });
6120
6248
  }
6121
6249
  },
@@ -6138,7 +6266,7 @@ ${titleText(" TinaCMS ")} backend initialized!`));
6138
6266
  return `${x.key}=${x.value || "***"}`;
6139
6267
  }).join("\n") + `
6140
6268
  TINA_PUBLIC_IS_LOCAL=true`;
6141
- const envFile = import_path10.default.join(process.cwd(), ".env");
6269
+ const envFile = import_path11.default.join(process.cwd(), ".env");
6142
6270
  if (!import_fs_extra13.default.existsSync(envFile)) {
6143
6271
  logger.info(`Adding .env file to your project... \u2705`);
6144
6272
  import_fs_extra13.default.writeFileSync(envFile, envFileText);
@@ -6202,7 +6330,7 @@ var addReactiveFile = {
6202
6330
  dataLayer
6203
6331
  }) => {
6204
6332
  var _a, _b;
6205
- const packageJsonPath = import_path10.default.join(baseDir, "package.json");
6333
+ const packageJsonPath = import_path11.default.join(baseDir, "package.json");
6206
6334
  await writeGeneratedFile({
6207
6335
  generatedFile,
6208
6336
  typescript: config2.typescript,
@@ -21,15 +21,24 @@ export declare class BuildCommand extends BaseCommand {
21
21
  execute(): Promise<number | void>;
22
22
  checkClientInfo(configManager: ConfigManager, apiURL: string, previewBaseBranch?: string): Promise<{
23
23
  hasUpstream: boolean;
24
+ timestamp: number;
24
25
  }>;
25
26
  syncProject(configManager: ConfigManager, apiURL: string, options?: {
26
27
  upstreamBranch?: string;
27
28
  previewBaseBranch?: string;
28
29
  previewName?: string;
29
30
  }): Promise<void>;
30
- checkGraphqlSchema(configManager: ConfigManager, database: Database, apiURL: string): Promise<void>;
31
+ checkGraphqlSchema(configManager: ConfigManager, database: Database, apiURL: string, timestamp: number): Promise<void>;
32
+ checkTinaSchema(configManager: ConfigManager, database: Database, apiURL: string, previewName: string, verbose: boolean, timestamp: number): Promise<void>;
31
33
  }
32
34
  export declare const fetchRemoteGraphqlSchema: ({ url, token, }: {
33
35
  url: string;
34
36
  token?: string;
37
+ }) => Promise<{
38
+ remoteSchema: any;
39
+ remoteVersion: string;
40
+ }>;
41
+ export declare const fetchSchemaSha: ({ url, token, }: {
42
+ url: string;
43
+ token?: string;
35
44
  }) => Promise<any>;
@@ -1,5 +1,5 @@
1
1
  /**
2
2
 
3
3
  */
4
- import http from 'http';
4
+ import http from 'node:http';
5
5
  export declare const gqlServer: (database: any, verbose: boolean) => Promise<http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>>;
@@ -1,4 +1,6 @@
1
1
  /**
2
2
 
3
3
  */
4
+ import { ChangeType } from '@graphql-inspector/core';
4
5
  export declare const parseMediaFolder: (str: string) => string;
6
+ export declare const getFaqLink: (type: ChangeType) => string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
- "version": "0.0.0-b4c6a60-20241010070518",
3
+ "version": "0.0.0-b54b303-20241210232138",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
@@ -26,9 +26,8 @@
26
26
  "@types/cors": "2.8.5",
27
27
  "@types/crypto-js": "^4.2.2",
28
28
  "@types/express": "^4.17.21",
29
- "@types/express-graphql": "^0.9.0",
30
29
  "@types/figlet": "1.2.0",
31
- "@types/fs-extra": "^9.0.13",
30
+ "@types/fs-extra": "^11.0.4",
32
31
  "@types/jest": "26.0.4",
33
32
  "@types/js-yaml": "^4.0.9",
34
33
  "@types/listr": "0.14.2",
@@ -36,20 +35,20 @@
36
35
  "@types/multer": "^1.4.12",
37
36
  "@types/progress": "^2.0.7",
38
37
  "@types/prompts": "^2.4.9",
39
- "@types/yup": "^0.29.14",
38
+ "@types/yup": "^0.32.0",
40
39
  "jest": "^29.7.0",
41
- "@tinacms/scripts": "0.0.0-b4c6a60-20241010070518"
40
+ "@tinacms/scripts": "1.3.1"
42
41
  },
43
42
  "dependencies": {
44
43
  "@graphql-codegen/core": "^2.6.8",
45
44
  "@graphql-codegen/plugin-helpers": "latest",
46
- "@graphql-codegen/typescript": "^4.0.9",
47
- "@graphql-codegen/typescript-operations": "^4.2.3",
45
+ "@graphql-codegen/typescript": "^4.1.1",
46
+ "@graphql-codegen/typescript-operations": "^4.3.1",
48
47
  "@graphql-codegen/visitor-plugin-common": "^4.1.2",
49
48
  "@graphql-inspector/core": "^4.2.2",
50
49
  "@graphql-tools/graphql-file-loader": "^7.5.17",
51
50
  "@graphql-tools/load": "^7.8.14",
52
- "@rollup/pluginutils": "^5.1.2",
51
+ "@rollup/pluginutils": "^5.1.3",
53
52
  "@svgr/core": "8.1.0",
54
53
  "@tailwindcss/aspect-ratio": "^0.4.2",
55
54
  "@tailwindcss/container-queries": "^0.1.1",
@@ -79,18 +78,18 @@
79
78
  "progress": "^2.0.3",
80
79
  "prompts": "^2.4.2",
81
80
  "readable-stream": "^4.5.2",
82
- "tailwindcss": "^3.4.13",
81
+ "tailwindcss": "^3.4.15",
83
82
  "typanion": "3.13.0",
84
- "typescript": "^5.6.2",
83
+ "typescript": "^5.6.3",
85
84
  "vite": "^4.5.5",
86
- "yup": "^0.32.11",
85
+ "yup": "^1.4.0",
87
86
  "zod": "^3.23.8",
88
- "@tinacms/app": "0.0.0-b4c6a60-20241010070518",
89
- "@tinacms/graphql": "0.0.0-b4c6a60-20241010070518",
90
- "@tinacms/metrics": "1.0.7",
91
- "@tinacms/schema-tools": "0.0.0-b4c6a60-20241010070518",
92
- "@tinacms/search": "0.0.0-b4c6a60-20241010070518",
93
- "tinacms": "0.0.0-b4c6a60-20241010070518"
87
+ "@tinacms/app": "0.0.0-b54b303-20241210232138",
88
+ "@tinacms/metrics": "1.0.8",
89
+ "@tinacms/graphql": "1.5.8",
90
+ "@tinacms/search": "1.0.35",
91
+ "@tinacms/schema-tools": "1.6.8",
92
+ "tinacms": "0.0.0-b54b303-20241210232138"
94
93
  },
95
94
  "publishConfig": {
96
95
  "registry": "https://registry.npmjs.org"