@tinacms/cli 2.5.5 → 2.6.0
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/bin/tinacms +3 -3
- package/dist/cmds/forestry-migrate/util/index.d.ts +14 -14
- package/dist/index.js +1152 -676
- package/dist/next/codegen/index.d.ts +2 -2
- package/dist/next/commands/baseCommands.d.ts +1 -0
- package/dist/next/commands/dev-command/html.d.ts +1 -1
- package/dist/next/commands/dev-command/index.d.ts +1 -1
- package/dist/next/commands/dev-command/server/media.d.ts +26 -0
- package/dist/next/config-build-error.d.ts +4 -0
- package/dist/next/config-manager.d.ts +1 -1
- package/dist/next/version-coherence.d.ts +62 -0
- package/dist/next/vite/index.d.ts +9 -1
- package/dist/next/vite/plugins.d.ts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/package.json +20 -18
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { GraphQLSchema, DocumentNode } from 'graphql';
|
|
2
|
-
import { ConfigManager } from '../config-manager';
|
|
3
1
|
import type { TinaSchema } from '@tinacms/schema-tools';
|
|
2
|
+
import type { DocumentNode, GraphQLSchema } from 'graphql';
|
|
3
|
+
import { ConfigManager } from '../config-manager';
|
|
4
4
|
export declare const TINA_HOST = "content.tinajs.io";
|
|
5
5
|
export declare class Codegen {
|
|
6
6
|
configManager: ConfigManager;
|
|
@@ -18,6 +18,7 @@ export declare abstract class BaseCommand extends Command {
|
|
|
18
18
|
noTelemetry: boolean;
|
|
19
19
|
abstract execute(): Promise<number | void>;
|
|
20
20
|
startSubCommand(): Promise<void>;
|
|
21
|
+
warnOnVersionSkew(rootPath: string): void;
|
|
21
22
|
logDeprecationWarnings(): void;
|
|
22
23
|
indexContentWithSpinner({ database, graphQLSchema, tinaSchema, configManager, partialReindex, text, }: {
|
|
23
24
|
database: Database;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const devHTML: (port: string) => string;
|
|
1
|
+
export declare const devHTML: (port: string, basePath: string) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Database } from '@tinacms/graphql';
|
|
2
2
|
import { SearchIndexer } from '@tinacms/search';
|
|
3
|
-
import AsyncLock from '
|
|
3
|
+
import { AsyncLock } from 'tinacms/dist/client';
|
|
4
4
|
import { ConfigManager } from '../../config-manager';
|
|
5
5
|
import { BaseCommand } from '../baseCommands';
|
|
6
6
|
export declare class DevCommand extends BaseCommand {
|
|
@@ -4,12 +4,14 @@ export declare const createMediaRouter: (config: PathConfig) => {
|
|
|
4
4
|
handleList: (req: any, res: any) => Promise<void>;
|
|
5
5
|
handleDelete: (req: Connect.IncomingMessage, res: any) => Promise<void>;
|
|
6
6
|
handlePost: (req: Connect.IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
7
|
+
handleRename: (req: Connect.IncomingMessage, res: any) => Promise<void>;
|
|
7
8
|
};
|
|
8
9
|
export declare const parseMediaFolder: (str: string) => string;
|
|
9
10
|
interface MediaArgs {
|
|
10
11
|
searchPath: string;
|
|
11
12
|
cursor?: string;
|
|
12
13
|
limit?: string;
|
|
14
|
+
search?: string;
|
|
13
15
|
}
|
|
14
16
|
interface File {
|
|
15
17
|
src: string;
|
|
@@ -34,6 +36,14 @@ type SuccessRecord = {
|
|
|
34
36
|
ok: false;
|
|
35
37
|
message: string;
|
|
36
38
|
};
|
|
39
|
+
export type RenameFailureCode = 'NOT_FOUND' | 'NAME_COLLISION' | 'UNSUPPORTED' | 'BACKEND_FAILURE';
|
|
40
|
+
type RenameRecord = {
|
|
41
|
+
ok: true;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
code: RenameFailureCode;
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
37
47
|
/**
|
|
38
48
|
* Handles media file operations (list, delete) for the Vite-based dev server.
|
|
39
49
|
*
|
|
@@ -57,6 +67,22 @@ export declare class MediaModel {
|
|
|
57
67
|
readonly mediaRoot: string;
|
|
58
68
|
constructor({ rootPath, publicFolder, mediaRoot }: PathConfig);
|
|
59
69
|
listMedia(args: MediaArgs): Promise<ListMediaRes>;
|
|
70
|
+
private searchMedia;
|
|
71
|
+
/**
|
|
72
|
+
* @security Both paths go through `resolveStrictlyWithinBase`, which rejects
|
|
73
|
+
* traversal, symlink escapes and the media root itself.
|
|
74
|
+
*/
|
|
75
|
+
renameMedia(args: {
|
|
76
|
+
from: string;
|
|
77
|
+
to: string;
|
|
78
|
+
}): Promise<RenameRecord>;
|
|
79
|
+
/**
|
|
80
|
+
* A case-insensitive filesystem can treat `a.jpg` -> `A.jpg` as a no-op, so
|
|
81
|
+
* hop through a unique sibling name. On failure the source is put back; if
|
|
82
|
+
* even that fails the file survives under the staging name, which
|
|
83
|
+
* StagedRenameError reports rather than leaving it to be found by accident.
|
|
84
|
+
*/
|
|
85
|
+
private renameViaStaging;
|
|
60
86
|
deleteMedia(args: MediaArgs): Promise<SuccessRecord>;
|
|
61
87
|
}
|
|
62
88
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Loader } from 'esbuild';
|
|
2
1
|
import { Config } from '@tinacms/schema-tools';
|
|
2
|
+
import type { Loader } from 'esbuild';
|
|
3
3
|
export declare const TINA_FOLDER = "tina";
|
|
4
4
|
export declare const LEGACY_TINA_FOLDER = ".tina";
|
|
5
5
|
export declare const GENERATED_FOLDER = "__generated__";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Warns when the TinaCMS packages resolved from a user's project can't
|
|
3
|
+
* satisfy the running CLI's declared ranges. pnpm rewrites the internal
|
|
4
|
+
* `workspace:^` refs at publish time (exact pins on older releases), so the
|
|
5
|
+
* CLI's own package.json states which sibling versions it expects. A resolved
|
|
6
|
+
* sibling outside that range means a held-back package (stale lockfile entry,
|
|
7
|
+
* partial upgrade, pnpm minimumReleaseAge) - a failure that is otherwise
|
|
8
|
+
* silent. Warning only - this must never fail `dev` or `build`.
|
|
9
|
+
*/
|
|
10
|
+
/** Sibling packages the published CLI declares from its own release. */
|
|
11
|
+
export declare const CORE_PACKAGES: readonly ["tinacms", "@tinacms/graphql", "@tinacms/schema-tools"];
|
|
12
|
+
export interface ResolvedPackage {
|
|
13
|
+
version: string;
|
|
14
|
+
dir: string;
|
|
15
|
+
}
|
|
16
|
+
export interface VersionCoherenceInput {
|
|
17
|
+
cliVersion: string;
|
|
18
|
+
cliDependencies: Record<string, string>;
|
|
19
|
+
resolvedFromProject: Record<string, ResolvedPackage | undefined>;
|
|
20
|
+
/**
|
|
21
|
+
* `tinacms` as resolved from `@tinacms/app`, the copy the admin bundle is
|
|
22
|
+
* built from (Vite dedupes `tinacms` starting at the @tinacms/app root).
|
|
23
|
+
*/
|
|
24
|
+
tinacmsResolvedFromApp?: ResolvedPackage;
|
|
25
|
+
}
|
|
26
|
+
/** Resolves a module entry path, e.g. via require.resolve. Must throw when not found. */
|
|
27
|
+
export type ResolveEntry = (packageName: string, fromDir: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* True when `version` satisfies `spec`. Only the two shapes pnpm publishes
|
|
30
|
+
* for workspace refs are supported: exact `X.Y.Z` and caret `^X.Y.Z`.
|
|
31
|
+
* Anything else (including prereleases and the monorepo's unrewritten
|
|
32
|
+
* `workspace:^`) returns undefined, meaning "can't tell - don't warn".
|
|
33
|
+
*/
|
|
34
|
+
export declare const satisfiesDeclaredRange: (version: string, spec: string) => boolean | undefined;
|
|
35
|
+
interface PackageJson {
|
|
36
|
+
name?: string;
|
|
37
|
+
version?: string;
|
|
38
|
+
dependencies?: Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Walks up from `startDir` to the package.json belonging to `packageName`.
|
|
42
|
+
* Several core packages have `exports` maps that don't expose
|
|
43
|
+
* `./package.json`, so it can't be require.resolve'd directly.
|
|
44
|
+
*/
|
|
45
|
+
export declare const findPackageJsonAbove: (startDir: string, packageName: string) => {
|
|
46
|
+
dir: string;
|
|
47
|
+
packageJson: PackageJson;
|
|
48
|
+
} | undefined;
|
|
49
|
+
export declare const resolvePackage: (packageName: string, fromDir: string, resolveEntry: ResolveEntry) => ResolvedPackage | undefined;
|
|
50
|
+
export declare const getVersionCoherenceWarnings: (input: VersionCoherenceInput) => string[];
|
|
51
|
+
/**
|
|
52
|
+
* Gathers the installed versions and returns the skew warnings, or [] when
|
|
53
|
+
* everything is coherent. `cliModuleDir` locates the running CLI's own
|
|
54
|
+
* package.json and its copy of `@tinacms/app`; `resolveEntry` is injected so
|
|
55
|
+
* this stays testable without `import.meta`.
|
|
56
|
+
*/
|
|
57
|
+
export declare const collectVersionCoherenceWarnings: ({ rootPath, cliModuleDir, resolveEntry, }: {
|
|
58
|
+
rootPath: string;
|
|
59
|
+
cliModuleDir: string;
|
|
60
|
+
resolveEntry: ResolveEntry;
|
|
61
|
+
}) => string[];
|
|
62
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Database } from '@tinacms/graphql';
|
|
2
|
-
import {
|
|
2
|
+
import type { BuildOptions, InlineConfig, Plugin } from 'vite';
|
|
3
3
|
import type { ConfigManager } from '../config-manager';
|
|
4
4
|
/**
|
|
5
5
|
* This type is duplicated in he `TinaMediaStore`
|
|
@@ -22,6 +22,14 @@ interface StaticMediaItem {
|
|
|
22
22
|
export interface StaticMedia {
|
|
23
23
|
[offset: string]: StaticMediaItem[];
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The URL base Vite serves the admin SPA under (e.g. `/admin/`, or
|
|
27
|
+
* `/<basePath>/admin/`). Vite 6 serves its dev endpoints (`@vite/client`,
|
|
28
|
+
* `@react-refresh`, `src/main.tsx`) under this base — Vite 4 served them at
|
|
29
|
+
* the server root regardless — so `devHTML` must prefix them with the same
|
|
30
|
+
* value. Shared here so the two can't drift.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getBasePath: (configManager: ConfigManager) => string;
|
|
25
33
|
export declare const createConfig: ({ configManager, apiURL, plugins, noWatch, rollupOptions, }: {
|
|
26
34
|
configManager: ConfigManager;
|
|
27
35
|
database: Database;
|
|
@@ -6,14 +6,14 @@ import { transformWithEsbuild } from 'vite';
|
|
|
6
6
|
import type { ConfigManager } from '../config-manager';
|
|
7
7
|
export declare const transformTsxPlugin: ({ configManager: _configManager, }: {
|
|
8
8
|
configManager: ConfigManager;
|
|
9
|
-
}) => Plugin
|
|
9
|
+
}) => Plugin<any>;
|
|
10
10
|
export declare const devServerEndPointsPlugin: ({ configManager, apiURL, database, searchIndex, databaseLock, }: {
|
|
11
11
|
apiURL: string;
|
|
12
12
|
database: Database;
|
|
13
13
|
configManager: ConfigManager;
|
|
14
14
|
searchIndex: any;
|
|
15
15
|
databaseLock: (fn: () => Promise<void>) => Promise<void>;
|
|
16
|
-
}) => Plugin
|
|
16
|
+
}) => Plugin<any>;
|
|
17
17
|
export interface ViteSvgrOptions {
|
|
18
18
|
/**
|
|
19
19
|
* Export React component as default. Notice that it will overrides
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { type TypeOfChangeType } from '@graphql-inspector/core';
|
|
5
5
|
export declare const parseMediaFolder: (str: string) => string;
|
|
6
|
-
export declare const getFaqLink: (type:
|
|
6
|
+
export declare const getFaqLink: (type: TypeOfChangeType) => string | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"react-dom": ">=18.3.1 <20.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.28.5",
|
|
29
|
+
"@babel/preset-env": "^7.28.5",
|
|
28
30
|
"@types/clear": "0.1.0",
|
|
29
31
|
"@types/cli-spinner": "^0.2.3",
|
|
30
32
|
"@types/cors": "2.8.5",
|
|
@@ -39,19 +41,20 @@
|
|
|
39
41
|
"@types/node": "^22.13.1",
|
|
40
42
|
"@types/progress": "^2.0.7",
|
|
41
43
|
"@types/prompts": "^2.4.9",
|
|
44
|
+
"babel-jest": "^29.7.0",
|
|
42
45
|
"jest": "^29.7.0",
|
|
43
46
|
"mongodb-level": "^0.0.4",
|
|
44
47
|
"sqlite-level": "^2.1.0",
|
|
45
48
|
"ts-jest": "^29.2.5",
|
|
46
|
-
"@tinacms/scripts": "1.6.
|
|
49
|
+
"@tinacms/scripts": "1.6.3"
|
|
47
50
|
},
|
|
48
51
|
"dependencies": {
|
|
49
|
-
"@graphql-codegen/core": "^2.
|
|
50
|
-
"@graphql-codegen/plugin-helpers": "^7.0
|
|
51
|
-
"@graphql-codegen/typescript": "^
|
|
52
|
-
"@graphql-codegen/typescript-operations": "^
|
|
53
|
-
"@graphql-codegen/visitor-plugin-common": "^
|
|
54
|
-
"@graphql-inspector/core": "^
|
|
52
|
+
"@graphql-codegen/core": "^6.2.0",
|
|
53
|
+
"@graphql-codegen/plugin-helpers": "^7.1.0",
|
|
54
|
+
"@graphql-codegen/typescript": "^6.1.0",
|
|
55
|
+
"@graphql-codegen/typescript-operations": "^6.1.0",
|
|
56
|
+
"@graphql-codegen/visitor-plugin-common": "^7.2.0",
|
|
57
|
+
"@graphql-inspector/core": "^6.2.1",
|
|
55
58
|
"@graphql-tools/graphql-file-loader": "^7.5.17",
|
|
56
59
|
"@graphql-tools/load": "^7.8.14",
|
|
57
60
|
"@rollup/pluginutils": "^5.1.4",
|
|
@@ -59,9 +62,8 @@
|
|
|
59
62
|
"@tailwindcss/aspect-ratio": "^0.4.2",
|
|
60
63
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
61
64
|
"@tailwindcss/typography": "^0.5.20",
|
|
62
|
-
"@vitejs/plugin-react": "
|
|
65
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
63
66
|
"altair-express-middleware": "^7.3.6",
|
|
64
|
-
"async-lock": "^1.4.1",
|
|
65
67
|
"auto-bind": "^4.0.0",
|
|
66
68
|
"body-parser": "^1.20.3",
|
|
67
69
|
"busboy": "^1.6.0",
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
"cors": "^2.8.5",
|
|
73
75
|
"crypto-js": "^4.2.0",
|
|
74
76
|
"dotenv": "^16.4.7",
|
|
75
|
-
"esbuild": "^0.
|
|
77
|
+
"esbuild": "^0.28.1",
|
|
76
78
|
"fs-extra": "^11.3.0",
|
|
77
79
|
"graphql": "15.8.0",
|
|
78
80
|
"js-yaml": "^4.1.0",
|
|
@@ -88,15 +90,15 @@
|
|
|
88
90
|
"tailwindcss": "^3.4.17",
|
|
89
91
|
"typanion": "3.13.0",
|
|
90
92
|
"typescript": "^5.7.3",
|
|
91
|
-
"vite": "^4.
|
|
93
|
+
"vite": "^6.4.3",
|
|
92
94
|
"yup": "^1.6.1",
|
|
93
95
|
"zod": "^3.24.2",
|
|
94
|
-
"@tinacms/app": "2.5.
|
|
95
|
-
"@tinacms/graphql": "2.4.
|
|
96
|
-
"@tinacms/
|
|
97
|
-
"@tinacms/
|
|
98
|
-
"@tinacms/search": "1.2.
|
|
99
|
-
"tinacms": "3.
|
|
96
|
+
"@tinacms/app": "^2.5.11",
|
|
97
|
+
"@tinacms/graphql": "^2.4.9",
|
|
98
|
+
"@tinacms/schema-tools": "^2.9.0",
|
|
99
|
+
"@tinacms/metrics": "^2.1.1",
|
|
100
|
+
"@tinacms/search": "^1.2.23",
|
|
101
|
+
"tinacms": "^3.12.0"
|
|
100
102
|
},
|
|
101
103
|
"publishConfig": {
|
|
102
104
|
"registry": "https://registry.npmjs.org"
|