-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move next admin packages to core repo (#5983)
**What** - Move packages for `next` version of admin to core repo **Other** - Since this PR introduces packages that depend on Vite 5, it also introduces @types/node@^20. We have never had a direct dependency on the types package for Node, and as far as I can see that has resulted in us using the types from Node.js@8, as those are a dependency of one of our dependencies. With the introduction of @types/node@^20, two of our packages had TS errors because they were using the NodeJS.Timer type, which was deprecated in Node.js@14. We should add specific @types/node packages to all our packages, but I haven't done so in this PR to keep it as clean as possible. - Q: @olivermrbl I've added the new packages to the ignore list for changeset, is this enough to prevent them from being published?
- Loading branch information
1 parent
479a8b8
commit f868775
Showing
491 changed files
with
11,332 additions
and
428 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
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 @@ | ||
--- | ||
"create-medusa-app": patch | ||
"medusa-core-utils": patch | ||
--- | ||
|
||
fix(create-medusa-app,medusa-core-utils): Use NodeJS.Timeout instead of NodeJS.Timer as the latter was deprecated in v14. | ||
chore(icons): Update icons to latest version. |
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 @@ | ||
# cli |
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 @@ | ||
#!/usr/bin/env node | ||
function start() { | ||
return import("../dist/cli/index.mjs"); | ||
} | ||
|
||
start(); |
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,34 @@ | ||
{ | ||
"name": "@medusajs/admin-bundler", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"build": "rimraf dist && tsup" | ||
}, | ||
"bin": { | ||
"medusa-admin": "./bin/medusa-admin.js" | ||
}, | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"module": "dist/index.mjs", | ||
"files": [ | ||
"dist" | ||
], | ||
"devDependencies": { | ||
"rimraf": "5.0.1", | ||
"tsup": "^8.0.1", | ||
"typescript": "^5.3.3" | ||
}, | ||
"dependencies": { | ||
"@medusajs/ui-preset": "^1.0.2", | ||
"@medusajs/vite-plugin-extension": "*", | ||
"@vitejs/plugin-react": "^4.2.1", | ||
"autoprefixer": "^10.4.16", | ||
"commander": "^11.1.0", | ||
"deepmerge": "^4.3.1", | ||
"glob": "^7.1.6", | ||
"postcss": "^8.4.32", | ||
"tailwindcss": "^3.3.6", | ||
"vite": "5.0.10" | ||
}, | ||
"packageManager": "yarn@3.2.1" | ||
} |
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,22 @@ | ||
import { resolve } from "path" | ||
import { build as command } from "vite" | ||
|
||
import { createViteConfig } from "./create-vite-config" | ||
|
||
type BuildArgs = { | ||
root?: string | ||
} | ||
|
||
export async function build({ root }: BuildArgs) { | ||
const config = await createViteConfig({ | ||
build: { | ||
outDir: resolve(process.cwd(), "build"), | ||
}, | ||
}) | ||
|
||
if (!config) { | ||
return | ||
} | ||
|
||
await command(config) | ||
} |
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,46 @@ | ||
import { readFileSync } from "fs" | ||
import glob from "glob" | ||
import { relative, resolve } from "path" | ||
import { build as command } from "vite" | ||
|
||
type BundleArgs = { | ||
root?: string | undefined | ||
watch?: boolean | undefined | ||
} | ||
|
||
export async function bundle({ watch, root }: BundleArgs) { | ||
const resolvedRoot = root | ||
? resolve(process.cwd(), root) | ||
: resolve(process.cwd(), "src", "admin") | ||
|
||
const files = glob.sync(`${resolvedRoot}/**/*.{ts,tsx,js,jsx}`) | ||
|
||
const input: Record<string, string> = {} | ||
for (const file of files) { | ||
const relativePath = relative(resolvedRoot, file) | ||
input[relativePath] = file | ||
} | ||
|
||
const packageJson = JSON.parse( | ||
readFileSync(resolve(process.cwd(), "package.json"), "utf-8") | ||
) | ||
const external = [ | ||
...Object.keys(packageJson.dependencies), | ||
"@medusajs/ui", | ||
"@medusajs/ui-preset", | ||
"react", | ||
"react-dom", | ||
"react-router-dom", | ||
"react-hook-form", | ||
] | ||
|
||
await command({ | ||
build: { | ||
watch: watch ? {} : undefined, | ||
rollupOptions: { | ||
input: input, | ||
external: external, | ||
}, | ||
}, | ||
}) | ||
} |
Oops, something went wrong.