@tinacms/cli 2.2.4 → 2.2.6

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,34 @@
1
+ export type DoctorStatus = 'current' | 'local' | 'outdated' | 'unknown';
2
+ export type TinaDependency = {
3
+ name: string;
4
+ declared: string;
5
+ dependencyType: DependencyType;
6
+ installed?: string;
7
+ };
8
+ export type DoctorResult = TinaDependency & {
9
+ latest?: string;
10
+ status: DoctorStatus;
11
+ error?: string;
12
+ };
13
+ type PackageJson = {
14
+ dependencies?: Record<string, string>;
15
+ devDependencies?: Record<string, string>;
16
+ optionalDependencies?: Record<string, string>;
17
+ peerDependencies?: Record<string, string>;
18
+ };
19
+ type DependencyType = 'dependencies' | 'devDependencies' | 'optionalDependencies' | 'peerDependencies';
20
+ export declare function isTinaPackage(name: string): boolean;
21
+ export declare function getTinaDependencies(packageJson: PackageJson): TinaDependency[];
22
+ export declare function readProjectPackageJson(rootPath: string): Promise<any>;
23
+ export declare function resolveInstalledVersions({ rootPath, dependencies, }: {
24
+ rootPath: string;
25
+ dependencies: TinaDependency[];
26
+ }): Promise<TinaDependency[]>;
27
+ export declare function fetchLatestVersion(packageName: string, timeoutMs: number): Promise<string>;
28
+ export declare function classifyDependency(dependency: TinaDependency, latest?: string, error?: string): DoctorResult;
29
+ export declare function checkTinaDependencies({ dependencies, fetchLatest, }: {
30
+ dependencies: TinaDependency[];
31
+ fetchLatest: (name: string) => Promise<string>;
32
+ }): Promise<DoctorResult[]>;
33
+ export declare function formatDoctorTable(results: DoctorResult[]): string;
34
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Command } from 'clipanion';
2
+ export declare class DoctorCommand extends Command {
3
+ static paths: string[][];
4
+ rootPath: string;
5
+ json: boolean;
6
+ timeout: string;
7
+ static usage: import("clipanion").Usage;
8
+ catch(error: unknown): Promise<void>;
9
+ execute(): Promise<number | void>;
10
+ }
@@ -8,6 +8,7 @@ export declare class ConfigManager {
8
8
  rootPath: string;
9
9
  tinaFolderPath: string;
10
10
  isUsingLegacyFolder: boolean;
11
+ private hasWarnedLegacyFolder;
11
12
  tinaConfigFilePath: string;
12
13
  tinaSpaPackagePath: string;
13
14
  contentRootPath?: string;
@@ -63,12 +64,12 @@ export declare class ConfigManager {
63
64
  minor: string;
64
65
  patch: string;
65
66
  };
66
- printGeneratedClientFilePath(): string;
67
- printGeneratedTypesFilePath(): string;
68
- printoutputHTMLFilePath(): string;
69
- printRelativePath(filename: string): string;
70
- printPrebuildFilePath(): string;
71
- printContentRelativePath(filename: string): string;
67
+ printGeneratedClientFilePath(): any;
68
+ printGeneratedTypesFilePath(): any;
69
+ printoutputHTMLFilePath(): any;
70
+ printRelativePath(filename: string): any;
71
+ printPrebuildFilePath(): any;
72
+ printContentRelativePath(filename: string): any;
72
73
  /**
73
74
  * Given a filepath without an extension, find the first match (eg. tsx, ts, jsx, js)
74
75
  */
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Resolves the content root directory for a Tina project.
3
+ *
4
+ * - Single-repo (no `localContentPath`): returns `rootPath`.
5
+ * - Multi-repo with `localContentPath` set and the joined directory present:
6
+ * returns the joined absolute path and logs an info message.
7
+ * - Multi-repo with `localContentPath` set but the joined directory missing:
8
+ * logs a warning citing the config file and falls back to `rootPath`.
9
+ *
10
+ * Extracted from ConfigManager for unit testing. The CLI's ConfigManager
11
+ * cannot be imported from a jest unit test because it uses `import.meta.url`
12
+ * at module scope, which CommonJS-targeted ts-jest cannot parse.
13
+ */
14
+ export declare function resolveContentRootPath(params: {
15
+ rootPath: string;
16
+ tinaFolderPath: string;
17
+ tinaConfigFilePath: string;
18
+ localContentPath: unknown;
19
+ }): Promise<string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tinacms/cli",
3
3
  "type": "module",
4
- "version": "2.2.4",
4
+ "version": "2.2.6",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "files": [
@@ -41,7 +41,7 @@
41
41
  "@types/progress": "^2.0.7",
42
42
  "@types/prompts": "^2.4.9",
43
43
  "jest": "^29.7.0",
44
- "@tinacms/scripts": "1.6.0"
44
+ "@tinacms/scripts": "1.6.1"
45
45
  },
46
46
  "dependencies": {
47
47
  "@graphql-codegen/core": "^2.6.8",
@@ -88,12 +88,12 @@
88
88
  "vite": "^4.5.9",
89
89
  "yup": "^1.6.1",
90
90
  "zod": "^3.24.2",
91
- "@tinacms/graphql": "2.2.5",
92
- "@tinacms/app": "2.4.4",
93
- "@tinacms/schema-tools": "2.7.2",
91
+ "@tinacms/app": "2.4.6",
92
+ "@tinacms/graphql": "2.3.1",
94
93
  "@tinacms/metrics": "2.0.1",
95
- "@tinacms/search": "1.2.11",
96
- "tinacms": "3.7.4"
94
+ "@tinacms/search": "1.2.13",
95
+ "tinacms": "3.7.6",
96
+ "@tinacms/schema-tools": "2.7.4"
97
97
  },
98
98
  "publishConfig": {
99
99
  "registry": "https://registry.npmjs.org"