@sanity/runtime-cli 16.0.2 → 17.0.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/README.md +27 -22
- package/dist/commands/blueprints/init.js +5 -2
- package/dist/cores/blueprints/init.js +16 -2
- package/dist/server/app.js +4 -2
- package/dist/server/static/vendor/design-tokens/color.css +48 -48
- package/dist/server/static/vendor/design-tokens/index.css +0 -1
- package/dist/server/static/vendor/vendor.bundle.js +3803 -3304
- package/dist/utils/interactive.d.ts +1 -0
- package/dist/utils/interactive.js +4 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.js +1 -0
- package/dist/utils/style-text.js +4 -5
- package/dist/utils/traced-fetch.js +2 -0
- package/oclif.manifest.json +4 -3
- package/package.json +15 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isInteractive: boolean;
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare function Logger(log: (msg: string) => void, flags?: {
|
|
|
5
5
|
json?: boolean;
|
|
6
6
|
}): {
|
|
7
7
|
(msg: string): void;
|
|
8
|
+
isTraceEnabled: boolean;
|
|
8
9
|
trace(formatter: unknown, ...args: unknown[]): false | void;
|
|
9
10
|
verbose(formatter: unknown, ...args: unknown[]): false | void;
|
|
10
11
|
info(formatter: unknown, ...args: unknown[]): false | void;
|
package/dist/utils/logger.js
CHANGED
|
@@ -13,6 +13,7 @@ export function Logger(log, flags = {}) {
|
|
|
13
13
|
log(msg);
|
|
14
14
|
};
|
|
15
15
|
const level = flags.verbose ? LogLevel.VERBOSE : flags.trace ? LogLevel.TRACE : LogLevel.INFO;
|
|
16
|
+
logger.isTraceEnabled = level <= LogLevel.TRACE;
|
|
16
17
|
logger.trace = (formatter, ...args) => level <= LogLevel.TRACE && logger(format(formatter, ...args));
|
|
17
18
|
logger.verbose = (formatter, ...args) => level <= LogLevel.VERBOSE && logger(format(formatter, ...args));
|
|
18
19
|
logger.info = (formatter, ...args) => level <= LogLevel.INFO && logger(format(formatter, ...args));
|
package/dist/utils/style-text.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { env
|
|
1
|
+
import { env } from 'node:process';
|
|
2
2
|
import { styleText as nodeStyleText } from 'node:util';
|
|
3
|
+
import { isInteractive } from './interactive.js';
|
|
3
4
|
function supportsColor() {
|
|
4
5
|
/*
|
|
5
6
|
* https://force-color.org
|
|
@@ -32,10 +33,8 @@ function supportsColor() {
|
|
|
32
33
|
if (env.NODE_DISABLE_COLORS !== undefined && env.NODE_DISABLE_COLORS !== '') {
|
|
33
34
|
return false;
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
return typeof stdout?.isTTY === 'boolean' && stdout.isTTY;
|
|
36
|
+
// if interactive, use colors
|
|
37
|
+
return isInteractive;
|
|
39
38
|
}
|
|
40
39
|
export const styleText = (format, text) => {
|
|
41
40
|
if (!supportsColor())
|
|
@@ -173,6 +173,8 @@ export function createTracedFetch(logger, options) {
|
|
|
173
173
|
...options,
|
|
174
174
|
};
|
|
175
175
|
return async (input, init) => {
|
|
176
|
+
if (!logger.isTraceEnabled)
|
|
177
|
+
return fetch(input, init);
|
|
176
178
|
const requestId = randomUUID().slice(0, 3);
|
|
177
179
|
const url = typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url;
|
|
178
180
|
const method = init?.method || 'GET';
|
package/oclif.manifest.json
CHANGED
|
@@ -839,13 +839,14 @@
|
|
|
839
839
|
"aliases": [],
|
|
840
840
|
"args": {
|
|
841
841
|
"dir": {
|
|
842
|
-
"description": "Directory to create the local Blueprint in",
|
|
842
|
+
"description": "Directory to create the local Blueprint in (defaults to the current directory)",
|
|
843
843
|
"name": "dir"
|
|
844
844
|
}
|
|
845
845
|
},
|
|
846
|
-
"description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.",
|
|
846
|
+
"description": "A Blueprint is your local infrastructure-as-code configuration that defines Sanity resources (datasets, functions, etc.). A Stack is the remote deployment target where your Blueprint is applied.\n[NOTE: Currently, accounts are limited to three (3) Stacks per project scope.]\n\nThis is typically the first command you run in a new project. It creates a local Blueprint manifest file (sanity.blueprint.ts, .js, or .json) and provisions a new remote Stack.\nAdditionally, a Blueprint configuration file is created in .sanity/ containing the scope and Stack IDs. This is .gitignored by default.\n\nAfter initialization, use 'blueprints plan' to preview changes, then 'blueprints deploy' to apply them.\n\nRunning without a directory prompts to confirm the current directory. Run 'blueprints init .' to initialize in the current directory without a prompt.",
|
|
847
847
|
"examples": [
|
|
848
848
|
"<%= config.bin %> <%= command.id %>",
|
|
849
|
+
"<%= config.bin %> <%= command.id %> .",
|
|
849
850
|
"<%= config.bin %> <%= command.id %> [directory]",
|
|
850
851
|
"<%= config.bin %> <%= command.id %> --blueprint-type <json|js|ts>",
|
|
851
852
|
"<%= config.bin %> <%= command.id %> --organization-id <organizationId>",
|
|
@@ -2996,5 +2997,5 @@
|
|
|
2996
2997
|
]
|
|
2997
2998
|
}
|
|
2998
2999
|
},
|
|
2999
|
-
"version": "
|
|
3000
|
+
"version": "17.0.0"
|
|
3000
3001
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/runtime-cli",
|
|
3
3
|
"description": "Sanity's Runtime CLI for Blueprints and Functions",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "17.0.0",
|
|
5
5
|
"author": "Sanity Runtime Team",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">=22.12"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"./bin",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"test:depmgmt": "vitest run --config ./test-depmgmt/vitest.config.ts",
|
|
51
51
|
"test:coverage": "vitest run --coverage --coverage.include \"runtime-cli/src/**/*\"",
|
|
52
52
|
"test:scenarios": "vitest run test/scenarios",
|
|
53
|
+
"test:playwright": "playwright install chromium && playwright install-deps chromium && playwright test",
|
|
53
54
|
"test:bp-version-smoke": "node ./test/blueprints-version-smoke.js",
|
|
54
55
|
"test:unit": "vitest run --exclude \"test/scenarios/**/*\"",
|
|
55
56
|
"test:vitest": "vitest run",
|
|
@@ -57,27 +58,27 @@
|
|
|
57
58
|
"watch": "tsc --watch"
|
|
58
59
|
},
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"@architect/hydrate": "
|
|
61
|
-
"@architect/inventory": "
|
|
62
|
-
"@inquirer/prompts": "^8.
|
|
63
|
-
"@oclif/core": "^4.11.
|
|
64
|
-
"@oclif/plugin-help": "^6.2.
|
|
61
|
+
"@architect/hydrate": "~6.0.0",
|
|
62
|
+
"@architect/inventory": "~6.0.0",
|
|
63
|
+
"@inquirer/prompts": "^8.5.2",
|
|
64
|
+
"@oclif/core": "^4.11.6",
|
|
65
|
+
"@oclif/plugin-help": "^6.2.50",
|
|
65
66
|
"@sanity-labs/design-tokens": "^0.0.2-alpha.2",
|
|
66
67
|
"@sanity/blueprints": "^0.20.1",
|
|
67
68
|
"@sanity/blueprints-parser": "^0.4.0",
|
|
68
|
-
"@sanity/client": "^7.22.
|
|
69
|
+
"@sanity/client": "^7.22.1",
|
|
69
70
|
"adm-zip": "^0.5.17",
|
|
70
71
|
"array-treeify": "^0.1.5",
|
|
71
72
|
"cardinal": "^2.1.1",
|
|
72
|
-
"empathic": "^2.0.
|
|
73
|
+
"empathic": "^2.0.1",
|
|
73
74
|
"eventsource": "^4.1.0",
|
|
74
|
-
"groq-js": "^1.30.
|
|
75
|
+
"groq-js": "^1.30.2",
|
|
75
76
|
"jiti": "^2.7.0",
|
|
76
77
|
"mime-types": "^3.0.2",
|
|
77
78
|
"ora": "^9.4.0",
|
|
78
79
|
"tar-stream": "^3.2.0",
|
|
79
80
|
"vite": "^8.0.16",
|
|
80
|
-
"ws": "^8.
|
|
81
|
+
"ws": "^8.21.0",
|
|
81
82
|
"xdg-basedir": "^5.1.0"
|
|
82
83
|
},
|
|
83
84
|
"devDependencies": {
|
|
@@ -93,10 +94,10 @@
|
|
|
93
94
|
"@types/adm-zip": "^0.5.8",
|
|
94
95
|
"@types/cardinal": "^2.1.1",
|
|
95
96
|
"@types/mime-types": "^3.0.1",
|
|
96
|
-
"@types/node": "
|
|
97
|
+
"@types/node": "^22",
|
|
97
98
|
"@types/tar-stream": "^3.1.4",
|
|
98
99
|
"@types/ws": "^8.18.1",
|
|
99
|
-
"@vitest/coverage-v8": "
|
|
100
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
100
101
|
"codemirror": "^6.0.2",
|
|
101
102
|
"mentoss": "^0.13.0",
|
|
102
103
|
"oclif": "^4.23.0",
|
|
@@ -106,7 +107,7 @@
|
|
|
106
107
|
"shx": "^0.4.0",
|
|
107
108
|
"ts-node": "^10.9.2",
|
|
108
109
|
"typescript": "^6.0.3",
|
|
109
|
-
"vitest": "4.1.
|
|
110
|
+
"vitest": "4.1.9"
|
|
110
111
|
},
|
|
111
112
|
"oclif": {
|
|
112
113
|
"bin": "sanity-run",
|