Skip to content

Commit e91e8ae

Browse files
Merge remote-tracking branch 'origin/master'
# Conflicts: # DATA_SCHEMA.md
2 parents 154b3ca + 3657dcf commit e91e8ae

File tree

25 files changed

+155
-170
lines changed

25 files changed

+155
-170
lines changed

DATA_SCHEMA.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Medusa Plugin Data Schema
22

33
A dependency like this is one thats used and found in the webpack graph
4+
45
```json
56
{
67
"name": "@ant-design/icons",
@@ -11,14 +12,16 @@ A dependency like this is one thats used and found in the webpack graph
1112
```
1213

1314
one like this is found in the package.json file, but was not actually used in the webpack final build graph
15+
1416
```json
1517
{
1618
"name": "antd",
1719
"version": "4.19"
1820
},
1921
```
2022

21-
The whole schema as current
23+
The whole schema as current
24+
2225
```json
2326
{
2427
"dependencies": [
@@ -229,19 +232,14 @@ The whole schema as current
229232
"id": "home:ProductCarousel",
230233
"name": "ProductCarousel",
231234
"applicationID": "home",
232-
"requires": [
233-
"react",
234-
"antd"
235-
],
235+
"requires": ["react", "antd"],
236236
"file": "./src/ProductCarousel"
237237
},
238238
{
239239
"id": "home:HeroImage",
240240
"name": "HeroImage",
241241
"applicationID": "home",
242-
"requires": [
243-
"react"
244-
],
242+
"requires": ["react"],
245243
"file": "./src/HeroImage"
246244
}
247245
],
@@ -251,6 +249,6 @@ The whole schema as current
251249
}
252250
```
253251

254-
255252
## Ideal Schema
253+
256254
TBD?

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ And add the plugin to the `plugins` array and alter the parameters to suit.
5858
```js
5959
new DashboardPlugin({
6060
filename: "dashboard.json",
61-
dashboardURL: "http://localhost:3000/api/update",
61+
dashboardURL: "http://localhost:3333/update",
6262
metadata: {
6363
baseUrl: "http://localhost:3002",
6464
source: {
@@ -69,10 +69,10 @@ new DashboardPlugin({
6969
});
7070
```
7171

72-
Neither `filename` nor `dashboardURL` are required. It's up to you how and when to invoke this plugin and how to store that data and send it to the dashboard. The `/api/update` endpoint just takes a JSON payload 'as-is'. To post the `dashboard.json` data manually use a `curl` request like this:
72+
Neither `filename` nor `dashboardURL` are required. It's up to you how and when to invoke this plugin and how to store that data and send it to the dashboard. The `/update` endpoint just takes a JSON payload 'as-is'. To post the `dashboard.json` data manually use a `curl` request like this:
7373

7474
```shell script
75-
> curl "http://localhost:3000/api/update" -X POST \
75+
> curl "http://localhost:3333/update" -X POST \
7676
-d @dashboard-example/utils/dist/dashboard.json \
7777
-H "Content-type: application/json"
7878
```

dashboard-data-creator/builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fetch from "node-fetch";
22
import moment from "moment";
33

4-
export const dashboardEndpoint = "http://localhost:3000/api/update";
5-
export const dashboardGraphQLEndpoint = "http://localhost:3000/api/graphql";
4+
export const dashboardEndpoint = "http://localhost:3333/update";
5+
export const dashboardGraphQLEndpoint = "http://localhost:3333/update";
66

77
const RANDOM_FILE_NAMES = [
88
"index.js",

dashboard-example/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
DASHBOARD_READ_TOKEN=e75c10ba-749d-4451-8fb0-4ad972ebf970
2-
DASHBOARD_READ_WRITE=c754d13b-a294-462e-b0ef-71d2ad307426
1+
DASHBOARD_READ_TOKEN=ID
2+
DASHBOARD_WRITE_TOKEN=ID
33
DASHBOARD_BASE_URL=http://localhost:3333

dashboard-example/.env.m

Lines changed: 0 additions & 3 deletions
This file was deleted.

dashboard-example/.env.n

Lines changed: 0 additions & 3 deletions
This file was deleted.

dashboard-example/.env.o

Lines changed: 0 additions & 3 deletions
This file was deleted.

dashboard-example/dsl/webpack.config.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module.exports = {
2727
filename: "[name].[contenthash].js",
2828
chunkFilename: "[name].[contenthash].js",
2929
publicPath: `auto`,
30-
uniqueName: `dsl.${require("./package.json").version}`,
3130
},
3231
cache: false,
3332
module: {
@@ -90,9 +89,9 @@ module.exports = {
9089
template: "./public/index.html",
9190
}),
9291
new DashboardPlugin({
93-
versionStrategy: "gitSha",
92+
versionStrategy: "red",
9493
filename: "dashboard.json",
95-
dashboardURL: `${process.env.DASHBOARD_BASE_URL}/api/update?token=${process.env.DASHBOARD_WRITE_TOKEN}`,
94+
dashboardURL: `${process.env.DASHBOARD_BASE_URL}/update?token=${process.env.DASHBOARD_WRITE_TOKEN}`,
9695
metadata: {
9796
baseUrl: "http://localhost:3002",
9897
source: {

dashboard-example/home/public/index.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
<html>
22
<head>
3-
<!-- <link rel="preconnect" href="https://federation-dashboard-alpha.vercel.app/">-->
4-
<!-- <link rel="prefetch" as="document" href="https://federation-dashboard-alpha.vercel.app/api/get-remote?token=e75c10ba-749d-4451-8fb0-4ad972ebf970&currentHost=home&remoteName=utils">-->
5-
<!-- <link rel="prefetch" as="document" href="https://federation-dashboard-alpha.vercel.app/api/get-remote?token=e75c10ba-749d-4451-8fb0-4ad972ebf970&currentHost=home&remoteName=home">-->
6-
<!-- <link rel="prefetch" as="document" href="https://federation-dashboard-alpha.vercel.app/api/get-remote?token=e75c10ba-749d-4451-8fb0-4ad972ebf970&currentHost=home&remoteName=search">-->
7-
<!-- <link rel="prefetch" as="document" href="https://federation-dashboard-alpha.vercel.app/api/get-remote?token=e75c10ba-749d-4451-8fb0-4ad972ebf970&currentHost=home&remoteName=nav">-->
8-
<!-- <link rel="prefetch" as="document" href="https://federation-dashboard-alpha.vercel.app/api/get-remote?token=e75c10ba-749d-4451-8fb0-4ad972ebf970&currentHost=home&remoteName=dsl">-->
9-
<!-- <script src="https://medusa-example-dsl.vercel.app/remoteEntry.js"></script>-->
10-
<!-- <script src="http://localhost:3002/remoteEntry.js"></script> -->
11-
<!-- <script src="https://medusa-example-nav.vercel.app/remoteEntry.js"></script>-->
12-
<!-- <script src="http://localhost:3003/remoteEntry.js"></script> -->
13-
<!-- <script src="https://medusa-example-search.vercel.app/remoteEntry.js"></script>-->
14-
<!-- <script src="http://localhost:3004/remoteEntry.js"></script> -->
15-
<!-- <script src="https://medusa-example-utils.vercel.app/remoteEntry.js"></script>-->
16-
<!-- <script src="http://localhost:3005/remoteEntry.js"></script> -->
173
</head>
184
<body>
195
<div id="root"></div>

dashboard-example/home/webpack.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const {
2020
} = require("webpack");
2121
const path = require("path");
2222

23-
const dashboardURL = `${process.env.DASHBOARD_BASE_URL}/api/get-remote?token=${process.env.DASHBOARD_READ_TOKEN}`;
23+
const dashboardURL = `${process.env.DASHBOARD_BASE_URL}/get-remote?token=${process.env.DASHBOARD_READ_TOKEN}`;
2424

2525
module.exports = {
2626
entry: "./src/index",
@@ -114,9 +114,9 @@ module.exports = {
114114
excludeChunks: ["remoteEntry"],
115115
}),
116116
new DashboardPlugin({
117-
versionStrategy: "gitSha",
117+
versionStrategy: Date.now(),
118118
filename: "dashboard.json",
119-
dashboardURL: `${process.env.DASHBOARD_BASE_URL}/api/update?token=${process.env.DASHBOARD_WRITE_TOKEN}`,
119+
dashboardURL: `${process.env.DASHBOARD_BASE_URL}/update?token=${process.env.DASHBOARD_WRITE_TOKEN}`,
120120
versionChangeWebhook: "http://cnn.com/",
121121
metadata: {
122122
clientUrl: process.env.DASHBOARD_BASE_URL,

0 commit comments

Comments
 (0)