Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move next admin packages to core repo #5983

Merged
merged 24 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f4eb892
move next admin packages to core repo
kasperkristensen Jan 2, 2024
75568d4
fix changeset config
kasperkristensen Jan 2, 2024
4cf852e
fix changeset config
kasperkristensen Jan 3, 2024
bd16e3a
undo change
kasperkristensen Jan 3, 2024
b9be811
Merge branch 'develop' into chore/move-admin-next-version
kasperkristensen Jan 3, 2024
bdb655c
add changeset
kasperkristensen Jan 3, 2024
7728d56
Merge branch 'chore/move-admin-next-version' of https://github.com/me…
kasperkristensen Jan 3, 2024
e4f5adc
Merge branch 'develop' into chore/move-admin-next-version
kasperkristensen Jan 3, 2024
1e3bd15
downgrade glob
kasperkristensen Jan 3, 2024
a2bbfde
Merge branch 'chore/move-admin-next-version' of https://github.com/me…
kasperkristensen Jan 3, 2024
737337b
use glob.sync
kasperkristensen Jan 3, 2024
26a8cd5
Merge branch 'develop' into chore/move-admin-next-version
kasperkristensen Jan 3, 2024
ff8a9d8
downgrade rimraf
kasperkristensen Jan 3, 2024
ac6a2f1
Merge branch 'develop' into chore/move-admin-next-version
kasperkristensen Jan 4, 2024
c54ad12
add more settings
kasperkristensen Jan 4, 2024
349c8f3
pull icon updates
kasperkristensen Jan 4, 2024
1726ef7
merge
kasperkristensen Jan 4, 2024
9032dc8
update changeset
kasperkristensen Jan 4, 2024
c8c7a64
push settings
kasperkristensen Jan 8, 2024
5e5c86a
lint
kasperkristensen Jan 8, 2024
932b665
Merge branch 'develop' into chore/move-admin-next-version
kasperkristensen Jan 8, 2024
b9896f0
Merge branch 'develop' into chore/move-admin-next-version
kasperkristensen Jan 8, 2024
b624502
update env var
kasperkristensen Jan 8, 2024
bcb0554
Merge branch 'chore/move-admin-next-version' of https://github.com/me…
kasperkristensen Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 9 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@
"access": "public",
"baseBranch": "develop",
"updateInternalDependencies": "patch",
"ignore": ["integration-tests-api", "integration-tests-plugins", "integration-tests-repositories"],
"ignore": [
"integration-tests-api",
"integration-tests-plugins",
"integration-tests-repositories",
"@medusajs/dashboard",
"@medusajs/admin-shared",
"@medusajs/admin-bundler",
"@medusajs/vite-plugin-extension"
],
"snapshot": {
"useCalculatedVersion": true
},
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}

}
7 changes: 7 additions & 0 deletions .changeset/hip-squids-return.md
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.
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,27 @@ module.exports = {
],
},
},
{
files: ["packages/admin-next/dashboard/**/*"],
env: { browser: true, es2020: true, node: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ["dist"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./packages/admin-next/dashboard/tsconfig.json",
},
plugins: ["react-refresh"],
rules: {
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
{
files: ["packages/admin-ui/lib/**/*.ts"],
parser: "@typescript-eslint/parser",
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"packages/medusa-js",
"packages/medusa-react",
"packages/*",
"packages/admin-next/*",
"packages/design-system/*",
"packages/generated/*",
"packages/oas/*",
Expand Down Expand Up @@ -38,6 +39,7 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.6.12",
"eslint-plugin-unused-imports": "^2.0.0",
"express": "^4.17.1",
Expand Down
1 change: 1 addition & 0 deletions packages/admin-next/admin-bundler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# cli
6 changes: 6 additions & 0 deletions packages/admin-next/admin-bundler/bin/medusa-admin.js
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();
34 changes: 34 additions & 0 deletions packages/admin-next/admin-bundler/package.json
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"
}
22 changes: 22 additions & 0 deletions packages/admin-next/admin-bundler/src/api/build.ts
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)
}
46 changes: 46 additions & 0 deletions packages/admin-next/admin-bundler/src/api/bundle.ts
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,
},
},
})
}
Loading