Move frontend types into it's own package for a single source of truth

This commit is contained in:
Kayori
2026-10-01 14:25:13 +02:00
parent 97a6dfdd33
commit fee976b69e
4 changed files with 16 additions and 10 deletions
+9
View File
@@ -0,0 +1,9 @@
{
"name": "medusa-plugin-types",
"version": "0.1.0",
"private": true,
"types": "index.d.ts",
"peerDependencies": {
"vue": ">=3.0.0"
}
}
+3
View File
@@ -16,6 +16,7 @@
"axios": "^1.19.0",
"classnames": "^2.5.1",
"graphql": "16.14.2",
"medusa-plugin-types": "file:../../Abstractions/Client",
"pinia": "^4.0.2",
"qr-scanner": "^1.4.2",
"tailwind-material-3": "^3.0.5",
@@ -958,6 +959,8 @@
"mdurl": ["mdurl@2.1.0", "", {}, "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg=="],
"medusa-plugin-types": ["medusa-plugin-types@file:../../Abstractions/Client", { "peerDependencies": { "vue": ">=3.0.0" } }],
"memorystream": ["memorystream@0.3.1", "", {}, "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw=="],
"merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="],
+1
View File
@@ -14,6 +14,7 @@
"api-codegen": "orval"
},
"dependencies": {
"medusa-plugin-types": "file:../../Abstractions/Client",
"@apollo/client": "^3.14.1",
"@iconify/vue": "^5.0.1",
"@material/material-color-utilities": "^0.4.0",
+3 -10
View File
@@ -1,21 +1,14 @@
import type * as Vue from 'vue'
import type * as VueRouter from 'vue-router'
import type * as PiniaLib from 'pinia'
import 'medusa-plugin-types'
export interface PluginExportMap {
[componentKey: string]: Vue.Component
}
export interface MedusaHostHelpers {
getAccessToken: () => string | null
}
export type { PluginExportMap, MedusaHostHelpers } from 'medusa-plugin-types'
declare global {
interface Window {
__medusa_vue__: typeof Vue
__medusa_router__: typeof VueRouter
__medusa_pinia__: typeof PiniaLib
__medusa_plugins__: Record<string, PluginExportMap>
__medusa_host__: MedusaHostHelpers
}
}
}