@sanity/cli 3.97.2-next.0-747b651c2b-202507081113 → 3.97.2-next.1.d21610bb51
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/lib/_chunks-cjs/cli.js +3 -11
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/package.json +21 -19
package/lib/_chunks-cjs/cli.js
CHANGED
|
@@ -8121,22 +8121,14 @@ Examples
|
|
|
8121
8121
|
signature: "<name> [--data <json>] [--file <filename>] [--timeout <seconds>] [--api <version>] [--dataset <name>] [--project-id] <id>] [--with-user-token]",
|
|
8122
8122
|
description: "Invoke a local Sanity Function",
|
|
8123
8123
|
async action(args, context) {
|
|
8124
|
-
const { apiClient, output
|
|
8124
|
+
const { apiClient, output } = context, [name] = args.argsWithoutOptions, flags = { ...defaultFlags$1, ...args.extOptions }, client2 = apiClient({
|
|
8125
8125
|
requireUser: !0,
|
|
8126
8126
|
requireProject: !1
|
|
8127
8127
|
}), { dataset, projectId, token: token2 } = client2.config(), actualDataset = dataset === "~dummy-placeholder-dataset-" ? void 0 : dataset;
|
|
8128
8128
|
if (!token2) throw new Error("No API token found. Please run `sanity login`.");
|
|
8129
8129
|
if (!name)
|
|
8130
8130
|
throw new Error("You must provide a function name as the first argument");
|
|
8131
|
-
const { initBlueprintConfig } = await import("@sanity/runtime-cli/cores"), { functionTestCore } = await import("@sanity/runtime-cli/cores/functions"),
|
|
8132
|
-
projectId && projectId !== bpProjectId && (output.print(
|
|
8133
|
-
chalk2.yellow("WARNING"),
|
|
8134
|
-
`Project ID ${chalk2.cyan(projectId)} in ${chalk2.green("sanity.cli.ts")} does not match Project ID ${chalk2.cyan(bpProjectId)} in ${chalk2.green("./sanity/blueprint.config.json")}.`
|
|
8135
|
-
), output.print(
|
|
8136
|
-
`Defaulting to Project ID ${chalk2.cyan(bpProjectId)}. To override use the ${chalk2.green("--project-id")} flag.
|
|
8137
|
-
`
|
|
8138
|
-
));
|
|
8139
|
-
const cmdConfig = await initBlueprintConfig({
|
|
8131
|
+
const { initBlueprintConfig } = await import("@sanity/runtime-cli/cores"), { functionTestCore } = await import("@sanity/runtime-cli/cores/functions"), cmdConfig = await initBlueprintConfig({
|
|
8140
8132
|
bin: "sanity",
|
|
8141
8133
|
log: (message) => output.print(message),
|
|
8142
8134
|
token: token2
|
|
@@ -8151,7 +8143,7 @@ Examples
|
|
|
8151
8143
|
timeout: flags.timeout,
|
|
8152
8144
|
api: flags.api,
|
|
8153
8145
|
dataset: flags.dataset || actualDataset,
|
|
8154
|
-
"project-id": flags["project-id"] ||
|
|
8146
|
+
"project-id": flags["project-id"] || projectId,
|
|
8155
8147
|
"with-user-token": flags["with-user-token"]
|
|
8156
8148
|
}
|
|
8157
8149
|
});
|