@liiift-studio/deploy-vercel-from-sanity 1.0.0 → 1.0.1
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 +3 -5
- package/dist/index.mjs +3 -5
- package/package.json +1 -1
- package/src/components/DeployItem.tsx +3 -5
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ var import_icons5 = require("@sanity/icons");
|
|
|
35
35
|
|
|
36
36
|
// src/components/DeployItem.tsx
|
|
37
37
|
var import_react2 = require("react");
|
|
38
|
+
var import_react_dom = require("react-dom");
|
|
38
39
|
var import_ui3 = require("@sanity/ui");
|
|
39
40
|
var import_icons2 = require("@sanity/icons");
|
|
40
41
|
|
|
@@ -358,7 +359,7 @@ function DeployItem({ target, token, onDelete, onEdit }) {
|
|
|
358
359
|
}, [isActive, latest?.created]);
|
|
359
360
|
const deploy = (0, import_react2.useCallback)(async () => {
|
|
360
361
|
setDeployError(null);
|
|
361
|
-
setTriggering(true);
|
|
362
|
+
(0, import_react_dom.flushSync)(() => setTriggering(true));
|
|
362
363
|
try {
|
|
363
364
|
await triggerDeploy(target.url);
|
|
364
365
|
setTimeout(fetchDeployments, 2e3);
|
|
@@ -432,10 +433,7 @@ function DeployItem({ target, token, onDelete, onEdit }) {
|
|
|
432
433
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", style: { marginLeft: "-0.1em", opacity: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" }) })
|
|
433
434
|
] }) }),
|
|
434
435
|
token && !loadingInitial && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
435
|
-
triggering ? /* @__PURE__ */ (0, import_jsx_runtime3.
|
|
436
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Spinner, { muted: true }),
|
|
437
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Badge, { tone: "caution", padding: 2, children: "Triggering\u2026" })
|
|
438
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StatusBadge, { state: latest?.state, showSpinner: true }),
|
|
436
|
+
triggering ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_ui3.Badge, { tone: "caution", padding: 2, children: "Triggering\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StatusBadge, { state: latest?.state, showSpinner: true }),
|
|
439
437
|
isActiveState(latest?.state) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
440
438
|
import_ui3.Button,
|
|
441
439
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import { TokenIcon, TrashIcon as TrashIcon2, WarningOutlineIcon as WarningOutlin
|
|
|
21
21
|
|
|
22
22
|
// src/components/DeployItem.tsx
|
|
23
23
|
import { useState as useState2, useEffect as useEffect2, useCallback as useCallback2, useRef } from "react";
|
|
24
|
+
import { flushSync } from "react-dom";
|
|
24
25
|
import {
|
|
25
26
|
Card as Card2,
|
|
26
27
|
Box as Box2,
|
|
@@ -380,7 +381,7 @@ function DeployItem({ target, token, onDelete, onEdit }) {
|
|
|
380
381
|
}, [isActive, latest?.created]);
|
|
381
382
|
const deploy = useCallback2(async () => {
|
|
382
383
|
setDeployError(null);
|
|
383
|
-
setTriggering(true);
|
|
384
|
+
flushSync(() => setTriggering(true));
|
|
384
385
|
try {
|
|
385
386
|
await triggerDeploy(target.url);
|
|
386
387
|
setTimeout(fetchDeployments, 2e3);
|
|
@@ -454,10 +455,7 @@ function DeployItem({ target, token, onDelete, onEdit }) {
|
|
|
454
455
|
/* @__PURE__ */ jsx3("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", style: { marginLeft: "-0.1em", opacity: 0.5 }, children: /* @__PURE__ */ jsx3("path", { d: "M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" }) })
|
|
455
456
|
] }) }),
|
|
456
457
|
token && !loadingInitial && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
457
|
-
triggering ? /* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */ jsx3(Spinner3, { muted: true }),
|
|
459
|
-
/* @__PURE__ */ jsx3(Badge3, { tone: "caution", padding: 2, children: "Triggering\u2026" })
|
|
460
|
-
] }) : /* @__PURE__ */ jsx3(StatusBadge, { state: latest?.state, showSpinner: true }),
|
|
458
|
+
triggering ? /* @__PURE__ */ jsx3(Badge3, { tone: "caution", padding: 2, children: "Triggering\u2026" }) : /* @__PURE__ */ jsx3(StatusBadge, { state: latest?.state, showSpinner: true }),
|
|
461
459
|
isActiveState(latest?.state) && /* @__PURE__ */ jsx3(
|
|
462
460
|
Button2,
|
|
463
461
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liiift-studio/deploy-vercel-from-sanity",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Sanity Studio plugin — trigger and monitor Vercel deployments with full status, history, and build logs. Supports v3, v4, and v5.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Liiift Studio",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Per-deploy-target card — shows status, build timer, history, cancel, deploy, copy URL, and error logs
|
|
2
2
|
import { useState, useEffect, useCallback, useRef } from 'react'
|
|
3
|
+
import { flushSync } from 'react-dom'
|
|
3
4
|
import {
|
|
4
5
|
Card, Box, Stack, Flex, Text, Button, Tooltip, Badge, Spinner,
|
|
5
6
|
MenuButton, Menu, MenuItem, Code, useToast,
|
|
@@ -112,7 +113,7 @@ export function DeployItem({ target, token, onDelete, onEdit }: DeployItemProps)
|
|
|
112
113
|
// ── Actions ───────────────────────────────────────────────────────────────
|
|
113
114
|
const deploy = useCallback(async () => {
|
|
114
115
|
setDeployError(null)
|
|
115
|
-
setTriggering(true)
|
|
116
|
+
flushSync(() => setTriggering(true))
|
|
116
117
|
try {
|
|
117
118
|
await triggerDeploy(target.url)
|
|
118
119
|
setTimeout(fetchDeployments, 2000)
|
|
@@ -214,10 +215,7 @@ export function DeployItem({ target, token, onDelete, onEdit }: DeployItemProps)
|
|
|
214
215
|
{token && !loadingInitial && (
|
|
215
216
|
<>
|
|
216
217
|
{triggering ? (
|
|
217
|
-
<
|
|
218
|
-
<Spinner muted />
|
|
219
|
-
<Badge tone="caution" padding={2}>Triggering…</Badge>
|
|
220
|
-
</Flex>
|
|
218
|
+
<Badge tone="caution" padding={2}>Triggering…</Badge>
|
|
221
219
|
) : (
|
|
222
220
|
<StatusBadge state={latest?.state} showSpinner />
|
|
223
221
|
)}
|