forked from medusajs/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin,admin-ui,medusa): Add Medusa Admin plugin (medusajs#3334)
- Loading branch information
1 parent
d6b1ad1
commit 40de54b
Showing
928 changed files
with
85,430 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@medusajs/admin-ui": patch | ||
"@medusajs/medusa": patch | ||
"@medusajs/admin": patch | ||
--- | ||
|
||
feat(medusa,admin,admin-ui): Add new plugin to serve the admin dashboard from the server. Adds a new plugin injection step `setup`, code placed in the `setup` folder of a plugin will be run before any code from a plugin is injected into the Medusa server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/dist | ||
/build | ||
.vercel | ||
/ui/preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.DS_store | ||
.turbo | ||
/src | ||
/build | ||
.vercel | ||
/ui/preview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<p align="center"> | ||
<a href="https://www.medusajs.com"> | ||
<img alt="Medusa" src="https://user-images.githubusercontent.com/7554214/153162406-bf8fd16f-aa98-4604-b87b-e13ab4baf604.png" width="100" /> | ||
</a> | ||
</p> | ||
<h1 align="center"> | ||
@medusajs/admin-ui | ||
</h1> | ||
|
||
<h4 align="center"> | ||
<a href="https://docs.medusajs.com">Documentation</a> | | ||
<a href="https://demo.medusajs.com/">Medusa Admin Demo</a> | | ||
<a href="https://www.medusajs.com">Website</a> | ||
</h4> | ||
|
||
<p align="center"> | ||
An open source composable commerce engine built for developers. | ||
</p> | ||
<p align="center"> | ||
<a href="https://github.com/medusajs/medusa/blob/master/LICENSE"> | ||
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Medusa is released under the MIT license." /> | ||
</a> | ||
<a href="https://circleci.com/gh/medusajs/medusa"> | ||
<img src="https://circleci.com/gh/medusajs/medusa.svg?style=shield" alt="Current CircleCI build status." /> | ||
</a> | ||
<a href="https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md"> | ||
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" /> | ||
</a> | ||
<a href="https://www.producthunt.com/posts/medusa"><img src="https://img.shields.io/badge/Product%20Hunt-%231%20Product%20of%20the%20Day-%23DA552E" alt="Product Hunt"></a> | ||
<a href="https://discord.gg/xpCwq3Kfn8"> | ||
<img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" /> | ||
</a> | ||
<a href="https://twitter.com/intent/follow?screen_name=medusajs"> | ||
<img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" /> | ||
</a> | ||
</p> | ||
|
||
## The Medusa Admin App. Included with the [`@medusajs/admin`](https://www.npmjs.com/package/@medusajs/admin) plugin. You shouldn't install this package separately. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"name": "@medusajs/admin-ui", | ||
"author": "Kasper Kristensen <[email protected]>", | ||
"license": "MIT", | ||
"version": "0.0.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/medusajs/medusa.git", | ||
"directory": "packages/admin-ui" | ||
}, | ||
"exports": { | ||
".": "./dist/index.js", | ||
"./ui": "./ui", | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"ui" | ||
], | ||
"scripts": { | ||
"dev": "vite -c vite.config.dev.ts --port 7001", | ||
"build": "tsc --build", | ||
"test:ui": "vitest --config vite.config.dev.ts", | ||
"test:ui:once": "vitest --config vite.config.dev.ts --run", | ||
"test": "echo \"Tests disabled temporarily\"" | ||
}, | ||
"dependencies": { | ||
"@hookform/error-message": "^2.0.1", | ||
"@radix-ui/react-accordion": "^1.0.1", | ||
"@radix-ui/react-avatar": "^1.0.1", | ||
"@radix-ui/react-collapsible": "^1.0.1", | ||
"@radix-ui/react-dialog": "^1.0.2", | ||
"@radix-ui/react-dropdown-menu": "^2.0.2", | ||
"@radix-ui/react-popover": "^1.0.3", | ||
"@radix-ui/react-radio-group": "^1.1.1", | ||
"@radix-ui/react-select": "^1.2.0", | ||
"@radix-ui/react-switch": "^1.0.1", | ||
"@radix-ui/react-tooltip": "^1.0.3", | ||
"@segment/analytics-next": "^1.51.1", | ||
"@tanstack/react-query": "4.22.0", | ||
"@tanstack/react-table": "^8.7.9", | ||
"@vitejs/plugin-react": "^3.1.0", | ||
"clsx": "^1.2.1", | ||
"confetti-js": "^0.0.18", | ||
"copy-to-clipboard": "^3.3.1", | ||
"emoji-picker-react": "^4.4.3", | ||
"framer-motion": "^9.1.6", | ||
"medusa-react": "*", | ||
"react": "^18.2.0", | ||
"react-collapsible": "^2.8.3", | ||
"react-country-flag": "^3.0.2", | ||
"react-currency-input-field": "^3.6.8", | ||
"react-datepicker": "^4.8.0", | ||
"react-dnd": "^16.0.1", | ||
"react-dnd-html5-backend": "^16.0.1", | ||
"react-dom": "^18.2.0", | ||
"react-helmet": "^6.0.0", | ||
"react-highlight-words": "^0.18.0", | ||
"react-hook-form": "7.38.0", | ||
"react-hot-toast": "^2.4.0", | ||
"react-hotkeys-hook": "^3.4.7", | ||
"react-json-tree": "^0.17.0", | ||
"react-jwt": "^1.1.4", | ||
"react-router-dom": "^6.8.0", | ||
"react-select": "^5.5.4", | ||
"react-table": "^7.7.0", | ||
"type-fest": "^3.6.0", | ||
"vite": "^4.1.4" | ||
}, | ||
"devDependencies": { | ||
"@medusajs/medusa": "*", | ||
"@tailwindcss/forms": "^0.5.3", | ||
"@tailwindcss/line-clamp": "^0.4.2", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^14.0.0", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/react": "^18.0.27", | ||
"@types/react-dom": "^18.0.10", | ||
"@types/react-table": "^7.7.9", | ||
"autoprefixer": "^10.4.13", | ||
"postcss": "^8.4.21", | ||
"tailwindcss": "3.2.2", | ||
"tailwindcss-radix": "^2.7.0", | ||
"typescript": "^4.9.3", | ||
"vitest": "^0.28.5" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import fse from "fs-extra" | ||
import { resolve } from "path" | ||
import vite from "vite" | ||
import { AdminBuildConfig } from "./types" | ||
import { getCustomViteConfig } from "./utils" | ||
|
||
async function build(options?: AdminBuildConfig) { | ||
const config = getCustomViteConfig(options) | ||
|
||
await vite.build(config).catch((_err) => { | ||
process.exit(1) | ||
}) | ||
|
||
await fse.writeJSON( | ||
resolve(config.build.outDir, "build-manifest.json"), | ||
options | ||
) | ||
} | ||
|
||
async function watch() { | ||
throw new Error("Not implemented") | ||
} | ||
|
||
async function clean() { | ||
throw new Error("Not implemented") | ||
} | ||
|
||
export { build, watch, clean } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { DeepPartial } from "./misc" | ||
|
||
type GlobalsConfig = { | ||
base?: string | ||
backend?: string | ||
} | ||
|
||
type BuildConfig = { | ||
outDir?: string | ||
} | ||
|
||
export type AdminBuildConfig = { | ||
globals?: DeepPartial<GlobalsConfig> | ||
build?: DeepPartial<BuildConfig> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { AdminBuildConfig } from "./build" | ||
|
||
export type AdminUIConfig = { | ||
build?: AdminBuildConfig | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from "./build" | ||
export * from "./misc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export type DeepPartial<T> = { | ||
[P in keyof T]?: T[P] extends (infer U)[] | ||
? DeepPartial<U>[] | ||
: T[P] extends ReadonlyArray<infer V> | ||
? ReadonlyArray<DeepPartial<V>> | ||
: DeepPartial<T[P]> | ||
} | ||
|
||
export type Base<T extends string> = `/${T}/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Base } from "../types" | ||
|
||
export const formatBase = <T extends string>(base: T): Base<T> => { | ||
return `/${base}/` | ||
} |
Oops, something went wrong.