@sanity/workbench-cli 1.3.0 → 1.5.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.
Files changed (47) hide show
  1. package/dist/_exports/build.d.ts +10 -0
  2. package/dist/_exports/deploy.d.ts +57 -8
  3. package/dist/_exports/deploy.js +2 -1
  4. package/dist/_exports/deploy.js.map +1 -1
  5. package/dist/_exports/dev.d.ts +52 -8
  6. package/dist/_exports/index.d.ts +10 -2
  7. package/dist/_exports/undeploy.d.ts +258 -0
  8. package/dist/_exports/undeploy.js +3 -0
  9. package/dist/_exports/undeploy.js.map +1 -0
  10. package/dist/actions/build/vite/plugin.js +5 -0
  11. package/dist/actions/build/vite/plugin.js.map +1 -1
  12. package/dist/actions/build/vite/plugins/plugin-sanity-app-id.js +5 -3
  13. package/dist/actions/build/vite/plugins/plugin-sanity-app-id.js.map +1 -1
  14. package/dist/actions/build/vite/plugins/plugin-sanity-environment.js +26 -2
  15. package/dist/actions/build/vite/plugins/plugin-sanity-environment.js.map +1 -1
  16. package/dist/actions/deploy/buildExposes.js +28 -12
  17. package/dist/actions/deploy/buildExposes.js.map +1 -1
  18. package/dist/actions/deploy/checkBuiltOutput.js +4 -3
  19. package/dist/actions/deploy/checkBuiltOutput.js.map +1 -1
  20. package/dist/actions/deploy/deployConfig.js +11 -38
  21. package/dist/actions/deploy/deployConfig.js.map +1 -1
  22. package/dist/actions/deploy/deployWorkbenchApp.js +5 -81
  23. package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -1
  24. package/dist/actions/deploy/getWorkbench.js.map +1 -1
  25. package/dist/actions/dev/deriveInterfaces.js +40 -27
  26. package/dist/actions/dev/deriveInterfaces.js.map +1 -1
  27. package/dist/actions/dev/exposesSetId.js +2 -2
  28. package/dist/actions/dev/exposesSetId.js.map +1 -1
  29. package/dist/actions/dev/registry.js +30 -17
  30. package/dist/actions/dev/registry.js.map +1 -1
  31. package/dist/actions/undeploy/workbenchUndeployAdapter.js +150 -0
  32. package/dist/actions/undeploy/workbenchUndeployAdapter.js.map +1 -0
  33. package/dist/contract.js +32 -0
  34. package/dist/contract.js.map +1 -1
  35. package/dist/defineApp.js +11 -1
  36. package/dist/defineApp.js.map +1 -1
  37. package/dist/defineView.js.map +1 -1
  38. package/dist/resolveWorkbenchApp.js +2 -1
  39. package/dist/resolveWorkbenchApp.js.map +1 -1
  40. package/dist/services/apiVersion.js.map +1 -0
  41. package/dist/services/applications.js +101 -0
  42. package/dist/services/applications.js.map +1 -0
  43. package/dist/services/installations.js +63 -0
  44. package/dist/services/installations.js.map +1 -0
  45. package/package.json +16 -12
  46. package/dist/actions/deploy/apiVersion.js.map +0 -1
  47. /package/dist/{actions/deploy → services}/apiVersion.js +0 -0
@@ -0,0 +1,101 @@
1
+ import { PassThrough } from 'node:stream';
2
+ import { getGlobalCliClient } from '@sanity/cli-core';
3
+ import { isStaging } from '@sanity/cli-core/util';
4
+ import FormData from 'form-data';
5
+ import { APP_WORKBENCH_API_VERSION } from './apiVersion.js';
6
+ export function getWorkbenchUrl(organizationId) {
7
+ return `https://${organizationId}.${isStaging() ? 'run.sanity.work' : 'sanity.run'}`;
8
+ }
9
+ /** Where a deployed application is served on its organization's workbench. */ export function getApplicationUrl(application) {
10
+ const segment = application.type === 'studio' ? 'studio' : 'application';
11
+ return `${getWorkbenchUrl(application.organizationId)}/${segment}/${application.id}`;
12
+ }
13
+ async function getClient() {
14
+ return getGlobalCliClient({
15
+ apiVersion: APP_WORKBENCH_API_VERSION,
16
+ requireUser: true
17
+ });
18
+ }
19
+ export async function getApplication(applicationId) {
20
+ const client = await getClient();
21
+ try {
22
+ return await client.request({
23
+ uri: `/applications/${applicationId}`
24
+ });
25
+ } catch (err) {
26
+ if (err?.statusCode === 404) return null;
27
+ throw err;
28
+ }
29
+ }
30
+ /** Create an application and its first deployment in one call. */ export async function createApplication(options) {
31
+ const { interfaces, isSingleton, organizationId, projectId, slug, tarball, title, type, version, visibility, workspaces } = options;
32
+ const formData = new FormData();
33
+ formData.append('type', type);
34
+ formData.append('title', title);
35
+ formData.append('organizationId', organizationId);
36
+ formData.append('slug', slug);
37
+ if (isSingleton !== undefined) formData.append('isSingleton', String(isSingleton));
38
+ if (visibility) formData.append('visibility', visibility);
39
+ // Studio config is set once, at create — it's immutable on redeploy.
40
+ if (projectId) appendJson(formData, 'config', {
41
+ studio: {
42
+ projectId
43
+ }
44
+ });
45
+ appendDeploymentParts(formData, {
46
+ interfaces,
47
+ tarball,
48
+ version,
49
+ workspaces
50
+ });
51
+ return request(`/applications`, formData);
52
+ }
53
+ /** Deploy a new active version to an existing application. */ export async function createDeployment(options) {
54
+ const { applicationId, interfaces, isAutoUpdating, tarball, version, workspaces } = options;
55
+ const formData = new FormData();
56
+ formData.append('isAutoUpdating', isAutoUpdating.toString());
57
+ appendDeploymentParts(formData, {
58
+ interfaces,
59
+ tarball,
60
+ version,
61
+ workspaces
62
+ });
63
+ return request(`/applications/${applicationId}/deployments`, formData);
64
+ }
65
+ /** Soft-deletes the application and all its deployments; already deleted counts as done. */ export async function deleteApplication(applicationId) {
66
+ const client = await getClient();
67
+ try {
68
+ await client.request({
69
+ method: 'DELETE',
70
+ uri: `/applications/${applicationId}`
71
+ });
72
+ } catch (err) {
73
+ if (err?.statusCode !== 404) throw err;
74
+ }
75
+ }
76
+ function appendDeploymentParts(formData, { interfaces, tarball, version, workspaces }) {
77
+ formData.append('version', version);
78
+ appendJson(formData, 'interfaces', interfaces);
79
+ // Studio-only — the server rejects a workspaces part on non-studio types.
80
+ if (workspaces?.length) appendJson(formData, 'workspaces', workspaces);
81
+ formData.append('tarball', tarball, {
82
+ contentType: 'application/gzip',
83
+ filename: 'app.tar.gz'
84
+ });
85
+ }
86
+ /** Structured parts must arrive as JSON so the server parses them. */ function appendJson(formData, name, value) {
87
+ formData.append(name, JSON.stringify(value), {
88
+ contentType: 'application/json'
89
+ });
90
+ }
91
+ async function request(uri, formData) {
92
+ const client = await getClient();
93
+ return client.request({
94
+ body: formData.pipe(new PassThrough()),
95
+ headers: formData.getHeaders(),
96
+ method: 'POST',
97
+ uri
98
+ });
99
+ }
100
+
101
+ //# sourceMappingURL=applications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/applications.ts"],"sourcesContent":["import {PassThrough} from 'node:stream'\nimport {type Gzip} from 'node:zlib'\n\nimport {type AppVisibility, getGlobalCliClient} from '@sanity/cli-core'\nimport {isStaging} from '@sanity/cli-core/util'\nimport FormData from 'form-data'\n\nimport {type AppInterfaceMetadata} from '../contract.js'\nimport {APP_WORKBENCH_API_VERSION} from './apiVersion.js'\n\nexport type ApplicationType = 'coreApp' | 'studio'\n\nexport interface Application {\n id: string\n organizationId: string\n slug: string | null\n title: string\n type: ApplicationType\n}\n\ninterface BrettInterfaceBase {\n moduleId: string\n name: string\n title: string\n version: string\n}\n\n/**\n * An interface as Brett stores it, discriminated on `type`. `moduleId` is\n * remote-relative — the host prepends the app's id. Brett assigns the id.\n * @internal\n */\nexport type BrettInterface =\n | (BrettInterfaceBase & {metadata: AppInterfaceMetadata | null; type: 'app'})\n | (BrettInterfaceBase & {metadata: null; type: 'panel'})\n | (BrettInterfaceBase & {metadata: null; type: 'worker'})\n\n/** A studio workspace as Brett stores it. */\nexport interface BrettWorkspace {\n dataset: string\n projectId: string\n\n basePath?: string\n icon?: string\n name?: string\n subtitle?: string\n title?: string\n}\n\nexport function getWorkbenchUrl(organizationId: string): string {\n return `https://${organizationId}.${isStaging() ? 'run.sanity.work' : 'sanity.run'}`\n}\n\n/** Where a deployed application is served on its organization's workbench. */\nexport function getApplicationUrl(\n application: Pick<Application, 'id' | 'organizationId' | 'type'>,\n): string {\n const segment = application.type === 'studio' ? 'studio' : 'application'\n return `${getWorkbenchUrl(application.organizationId)}/${segment}/${application.id}`\n}\n\nasync function getClient() {\n return getGlobalCliClient({apiVersion: APP_WORKBENCH_API_VERSION, requireUser: true})\n}\n\nexport async function getApplication(applicationId: string): Promise<Application | null> {\n const client = await getClient()\n try {\n return await client.request({uri: `/applications/${applicationId}`})\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode === 404) return null\n throw err\n }\n}\n\n/** Create an application and its first deployment in one call. */\nexport async function createApplication(options: {\n interfaces: readonly BrettInterface[]\n isSingleton?: boolean\n organizationId: string\n projectId?: string\n slug: string\n tarball: Gzip\n title: string\n type: ApplicationType\n version: string\n visibility?: AppVisibility\n workspaces?: readonly BrettWorkspace[]\n}): Promise<Application> {\n const {\n interfaces,\n isSingleton,\n organizationId,\n projectId,\n slug,\n tarball,\n title,\n type,\n version,\n visibility,\n workspaces,\n } = options\n const formData = new FormData()\n formData.append('type', type)\n formData.append('title', title)\n formData.append('organizationId', organizationId)\n formData.append('slug', slug)\n if (isSingleton !== undefined) formData.append('isSingleton', String(isSingleton))\n if (visibility) formData.append('visibility', visibility)\n // Studio config is set once, at create — it's immutable on redeploy.\n if (projectId) appendJson(formData, 'config', {studio: {projectId}})\n appendDeploymentParts(formData, {interfaces, tarball, version, workspaces})\n return request(`/applications`, formData)\n}\n\n/** Deploy a new active version to an existing application. */\nexport async function createDeployment(options: {\n applicationId: string\n interfaces: readonly BrettInterface[]\n isAutoUpdating: boolean\n tarball: Gzip\n version: string\n workspaces?: readonly BrettWorkspace[]\n}): Promise<{id: string}> {\n const {applicationId, interfaces, isAutoUpdating, tarball, version, workspaces} = options\n const formData = new FormData()\n formData.append('isAutoUpdating', isAutoUpdating.toString())\n appendDeploymentParts(formData, {interfaces, tarball, version, workspaces})\n return request(`/applications/${applicationId}/deployments`, formData)\n}\n\n/** Soft-deletes the application and all its deployments; already deleted counts as done. */\nexport async function deleteApplication(applicationId: string): Promise<void> {\n const client = await getClient()\n try {\n await client.request({method: 'DELETE', uri: `/applications/${applicationId}`})\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode !== 404) throw err\n }\n}\n\nfunction appendDeploymentParts(\n formData: FormData,\n {\n interfaces,\n tarball,\n version,\n workspaces,\n }: {\n interfaces: readonly BrettInterface[]\n tarball: Gzip\n version: string\n workspaces?: readonly BrettWorkspace[]\n },\n): void {\n formData.append('version', version)\n appendJson(formData, 'interfaces', interfaces)\n // Studio-only — the server rejects a workspaces part on non-studio types.\n if (workspaces?.length) appendJson(formData, 'workspaces', workspaces)\n formData.append('tarball', tarball, {contentType: 'application/gzip', filename: 'app.tar.gz'})\n}\n\n/** Structured parts must arrive as JSON so the server parses them. */\nfunction appendJson(formData: FormData, name: string, value: unknown): void {\n formData.append(name, JSON.stringify(value), {contentType: 'application/json'})\n}\n\nasync function request<T>(uri: string, formData: FormData): Promise<T> {\n const client = await getClient()\n return client.request({\n body: formData.pipe(new PassThrough()),\n headers: formData.getHeaders(),\n method: 'POST',\n uri,\n })\n}\n"],"names":["PassThrough","getGlobalCliClient","isStaging","FormData","APP_WORKBENCH_API_VERSION","getWorkbenchUrl","organizationId","getApplicationUrl","application","segment","type","id","getClient","apiVersion","requireUser","getApplication","applicationId","client","request","uri","err","statusCode","createApplication","options","interfaces","isSingleton","projectId","slug","tarball","title","version","visibility","workspaces","formData","append","undefined","String","appendJson","studio","appendDeploymentParts","createDeployment","isAutoUpdating","toString","deleteApplication","method","length","contentType","filename","name","value","JSON","stringify","body","pipe","headers","getHeaders"],"mappings":"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"}
@@ -0,0 +1,63 @@
1
+ import { PassThrough } from 'node:stream';
2
+ import { getGlobalCliClient } from '@sanity/cli-core';
3
+ import FormData from 'form-data';
4
+ import { APP_WORKBENCH_API_VERSION } from './apiVersion.js';
5
+ async function getClient() {
6
+ return getGlobalCliClient({
7
+ apiVersion: APP_WORKBENCH_API_VERSION,
8
+ requireUser: true
9
+ });
10
+ }
11
+ /** The org's active singleton installation, matched on its slug. */ export async function resolveSingletonInstallationId(organizationId, slug) {
12
+ const client = await getClient();
13
+ // `limit=none` returns every installation in one response, no pagination.
14
+ const { data } = await client.request({
15
+ query: {
16
+ limit: 'none',
17
+ organizationId
18
+ },
19
+ uri: '/installations'
20
+ });
21
+ return data.find((item)=>item.application?.slug === slug)?.id;
22
+ }
23
+ /** Upload a config snapshot to the installation as a multipart tarball. */ export async function createConfig(installationId, { tarball, version }) {
24
+ const formData = new FormData();
25
+ formData.append('version', version);
26
+ formData.append('tarball', tarball, {
27
+ contentType: 'application/gzip',
28
+ filename: 'installation-config.tar.gz'
29
+ });
30
+ const client = await getClient();
31
+ await client.request({
32
+ body: formData.pipe(new PassThrough()),
33
+ headers: formData.getHeaders(),
34
+ method: 'POST',
35
+ uri: `/installations/${installationId}/configs`
36
+ });
37
+ }
38
+ /** The installation's deployed config snapshots, newest first. */ export async function listConfigs(installationId) {
39
+ const client = await getClient();
40
+ const { data } = await client.request({
41
+ query: {
42
+ limit: 'none'
43
+ },
44
+ uri: `/installations/${installationId}/configs`
45
+ });
46
+ return data;
47
+ }
48
+ /**
49
+ * Soft-deletes one config snapshot; its content is purged once superseded.
50
+ * Already deleted counts as done, so a partially-failed undeploy can re-run.
51
+ */ export async function deleteConfig(installationId, configId) {
52
+ const client = await getClient();
53
+ try {
54
+ await client.request({
55
+ method: 'DELETE',
56
+ uri: `/installations/${installationId}/configs/${configId}`
57
+ });
58
+ } catch (err) {
59
+ if (err?.statusCode !== 404) throw err;
60
+ }
61
+ }
62
+
63
+ //# sourceMappingURL=installations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/installations.ts"],"sourcesContent":["import {PassThrough} from 'node:stream'\nimport {type Gzip} from 'node:zlib'\n\nimport {getGlobalCliClient} from '@sanity/cli-core'\nimport FormData from 'form-data'\n\nimport {APP_WORKBENCH_API_VERSION} from './apiVersion.js'\n\nexport interface ConfigSnapshot {\n id: string\n\n createdAt?: string\n deployedBy?: string\n /** Whether this snapshot is the one being served; at most one per installation. */\n isActive?: boolean\n}\n\ninterface InstallationListItem {\n id: string\n\n application?: {slug?: string}\n}\n\nasync function getClient() {\n return getGlobalCliClient({apiVersion: APP_WORKBENCH_API_VERSION, requireUser: true})\n}\n\n/** The org's active singleton installation, matched on its slug. */\nexport async function resolveSingletonInstallationId(\n organizationId: string,\n slug: string,\n): Promise<string | undefined> {\n const client = await getClient()\n // `limit=none` returns every installation in one response, no pagination.\n const {data}: {data: InstallationListItem[]} = await client.request({\n query: {limit: 'none', organizationId},\n uri: '/installations',\n })\n return data.find((item) => item.application?.slug === slug)?.id\n}\n\n/** Upload a config snapshot to the installation as a multipart tarball. */\nexport async function createConfig(\n installationId: string,\n {tarball, version}: {tarball: Gzip; version: string},\n): Promise<void> {\n const formData = new FormData()\n formData.append('version', version)\n formData.append('tarball', tarball, {\n contentType: 'application/gzip',\n filename: 'installation-config.tar.gz',\n })\n\n const client = await getClient()\n await client.request({\n body: formData.pipe(new PassThrough()),\n headers: formData.getHeaders(),\n method: 'POST',\n uri: `/installations/${installationId}/configs`,\n })\n}\n\n/** The installation's deployed config snapshots, newest first. */\nexport async function listConfigs(installationId: string): Promise<ConfigSnapshot[]> {\n const client = await getClient()\n const {data}: {data: ConfigSnapshot[]} = await client.request({\n query: {limit: 'none'},\n uri: `/installations/${installationId}/configs`,\n })\n return data\n}\n\n/**\n * Soft-deletes one config snapshot; its content is purged once superseded.\n * Already deleted counts as done, so a partially-failed undeploy can re-run.\n */\nexport async function deleteConfig(installationId: string, configId: string): Promise<void> {\n const client = await getClient()\n try {\n await client.request({\n method: 'DELETE',\n uri: `/installations/${installationId}/configs/${configId}`,\n })\n } catch (err) {\n if ((err as {statusCode?: number})?.statusCode !== 404) throw err\n }\n}\n"],"names":["PassThrough","getGlobalCliClient","FormData","APP_WORKBENCH_API_VERSION","getClient","apiVersion","requireUser","resolveSingletonInstallationId","organizationId","slug","client","data","request","query","limit","uri","find","item","application","id","createConfig","installationId","tarball","version","formData","append","contentType","filename","body","pipe","headers","getHeaders","method","listConfigs","deleteConfig","configId","err","statusCode"],"mappings":"AAAA,SAAQA,WAAW,QAAO,cAAa;AAGvC,SAAQC,kBAAkB,QAAO,mBAAkB;AACnD,OAAOC,cAAc,YAAW;AAEhC,SAAQC,yBAAyB,QAAO,kBAAiB;AAiBzD,eAAeC;IACb,OAAOH,mBAAmB;QAACI,YAAYF;QAA2BG,aAAa;IAAI;AACrF;AAEA,kEAAkE,GAClE,OAAO,eAAeC,+BACpBC,cAAsB,EACtBC,IAAY;IAEZ,MAAMC,SAAS,MAAMN;IACrB,0EAA0E;IAC1E,MAAM,EAACO,IAAI,EAAC,GAAmC,MAAMD,OAAOE,OAAO,CAAC;QAClEC,OAAO;YAACC,OAAO;YAAQN;QAAc;QACrCO,KAAK;IACP;IACA,OAAOJ,KAAKK,IAAI,CAAC,CAACC,OAASA,KAAKC,WAAW,EAAET,SAASA,OAAOU;AAC/D;AAEA,yEAAyE,GACzE,OAAO,eAAeC,aACpBC,cAAsB,EACtB,EAACC,OAAO,EAAEC,OAAO,EAAmC;IAEpD,MAAMC,WAAW,IAAItB;IACrBsB,SAASC,MAAM,CAAC,WAAWF;IAC3BC,SAASC,MAAM,CAAC,WAAWH,SAAS;QAClCI,aAAa;QACbC,UAAU;IACZ;IAEA,MAAMjB,SAAS,MAAMN;IACrB,MAAMM,OAAOE,OAAO,CAAC;QACnBgB,MAAMJ,SAASK,IAAI,CAAC,IAAI7B;QACxB8B,SAASN,SAASO,UAAU;QAC5BC,QAAQ;QACRjB,KAAK,CAAC,eAAe,EAAEM,eAAe,QAAQ,CAAC;IACjD;AACF;AAEA,gEAAgE,GAChE,OAAO,eAAeY,YAAYZ,cAAsB;IACtD,MAAMX,SAAS,MAAMN;IACrB,MAAM,EAACO,IAAI,EAAC,GAA6B,MAAMD,OAAOE,OAAO,CAAC;QAC5DC,OAAO;YAACC,OAAO;QAAM;QACrBC,KAAK,CAAC,eAAe,EAAEM,eAAe,QAAQ,CAAC;IACjD;IACA,OAAOV;AACT;AAEA;;;CAGC,GACD,OAAO,eAAeuB,aAAab,cAAsB,EAAEc,QAAgB;IACzE,MAAMzB,SAAS,MAAMN;IACrB,IAAI;QACF,MAAMM,OAAOE,OAAO,CAAC;YACnBoB,QAAQ;YACRjB,KAAK,CAAC,eAAe,EAAEM,eAAe,SAAS,EAAEc,UAAU;QAC7D;IACF,EAAE,OAAOC,KAAK;QACZ,IAAI,AAACA,KAA+BC,eAAe,KAAK,MAAMD;IAChE;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/workbench-cli",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Internal implementation detail of the Sanity CLI's unstable workbench support. Not intended for direct use.",
5
5
  "homepage": "https://github.com/sanity-io/cli",
6
6
  "bugs": "https://github.com/sanity-io/cli/issues",
@@ -39,41 +39,45 @@
39
39
  "source": "./src/_exports/init.ts",
40
40
  "default": "./dist/_exports/init.js"
41
41
  },
42
+ "./undeploy": {
43
+ "source": "./src/_exports/undeploy.ts",
44
+ "default": "./dist/_exports/undeploy.js"
45
+ },
42
46
  "./package.json": "./package.json"
43
47
  },
44
48
  "publishConfig": {
45
49
  "access": "public"
46
50
  },
47
51
  "dependencies": {
48
- "@module-federation/vite": "1.16.14",
52
+ "@module-federation/vite": "1.17.1",
49
53
  "@vitejs/plugin-react": "^6.0.3",
50
54
  "form-data": "^4.0.5",
51
55
  "tar-fs": "^3.1.2",
52
- "vite": "^8.1.3",
56
+ "vite": "^8.1.5",
53
57
  "zod": "^4.4.3",
54
- "@sanity/cli-core": "^2.3.0"
58
+ "@sanity/cli-core": "^2.5.0"
55
59
  },
56
60
  "devDependencies": {
57
61
  "@eslint/compat": "^2.1.0",
58
- "@sanity/pkg-utils": "^10.8.1",
62
+ "@sanity/pkg-utils": "^11.0.9",
59
63
  "@swc/cli": "^0.8.1",
60
- "@swc/core": "^1.15.41",
64
+ "@swc/core": "^1.15.43",
61
65
  "@types/node": "^22.20.0",
62
66
  "@types/tar-fs": "^2.0.4",
63
- "@vitest/coverage-istanbul": "^4.1.9",
64
- "eslint": "^10.4.1",
67
+ "@vitest/coverage-istanbul": "^4.1.10",
68
+ "eslint": "^10.7.0",
65
69
  "publint": "^0.3.21",
66
- "typescript": "^5.9.3",
67
- "vitest": "^4.1.9",
70
+ "typescript": "^6.0.3",
71
+ "vitest": "^4.1.10",
68
72
  "@repo/package.config": "0.0.1",
69
73
  "@repo/tsconfig": "3.70.0",
70
- "@sanity/eslint-config-cli": "^1.1.2"
74
+ "@sanity/eslint-config-cli": "^1.1.3"
71
75
  },
72
76
  "engines": {
73
77
  "node": ">=22.12"
74
78
  },
75
79
  "scripts": {
76
- "build": "swc --delete-dir-on-start --strip-leading-paths --out-dir dist/ src --ignore '**/*.test.ts' --ignore '**/__tests__/**'",
80
+ "build": "swc --delete-dir-on-start --strip-leading-paths --out-dir dist/ src",
77
81
  "build:types": "pkg-utils build --emitDeclarationOnly",
78
82
  "check:types": "tsc --noEmit",
79
83
  "lint": "eslint .",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/actions/deploy/apiVersion.ts"],"sourcesContent":["// The app endpoints (applications + installations) live behind the\n// experimental `vX` version; a dated version returns 501.\nexport const APP_WORKBENCH_API_VERSION = 'vX'\n"],"names":["APP_WORKBENCH_API_VERSION"],"mappings":"AAAA,mEAAmE;AACnE,0DAA0D;AAC1D,OAAO,MAAMA,4BAA4B,KAAI"}
File without changes