@medusajs/admin-vite-plugin 2.22.2 → 2.22.3-snapshot-20261103230838
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/dist/index.js +7 -4
- package/dist/index.mjs +7 -4
- package/package.json +6 -6
package/AGENTS.md
CHANGED
|
@@ -14,7 +14,7 @@ What it picks up, relative to each source:
|
|
|
14
14
|
| Path | Requirement |
|
|
15
15
|
| --- | --- |
|
|
16
16
|
| `widgets/**` | default export + `export const config = defineWidgetConfig({ zone })` |
|
|
17
|
-
| `routes/**/page.{tsx,jsx,ts,js}` (depth >= 1) | default export; optional `config`, `handle`, `loader` |
|
|
17
|
+
| `routes/**/page.{tsx,jsx,ts,js}` (depth >= 1) | default export; optional `config`, `handle`, `loader`. `config.label`, `translationNs` and `permissions` are copied onto the route handle (an exported `handle` overrides them); `config.permissions` is also emitted on the menu item |
|
|
18
18
|
| `layouts/**` | default export + `config` named export |
|
|
19
19
|
| `i18n/index.*` (top level only) | default export; multiple sources are `deepMerge`d |
|
|
20
20
|
| `custom-fields/**` | experimental custom-fields config |
|
package/dist/index.js
CHANGED
|
@@ -1307,14 +1307,15 @@ function generateCode4(results) {
|
|
|
1307
1307
|
`;
|
|
1308
1308
|
}
|
|
1309
1309
|
function formatMenuItem(route) {
|
|
1310
|
-
const { label, icon, path: path6, nested, rank, translationNs } = route;
|
|
1310
|
+
const { label, icon, path: path6, nested, rank, translationNs, permissions } = route;
|
|
1311
1311
|
return `{
|
|
1312
1312
|
label: ${label},
|
|
1313
1313
|
icon: ${icon || "undefined"},
|
|
1314
1314
|
path: "${path6}",
|
|
1315
1315
|
nested: ${nested ? `"${nested}"` : "undefined"},
|
|
1316
1316
|
rank: ${rank !== void 0 ? rank : "undefined"},
|
|
1317
|
-
translationNs: ${translationNs ? `${translationNs}` : "undefined"}
|
|
1317
|
+
translationNs: ${translationNs ? `${translationNs}` : "undefined"},
|
|
1318
|
+
permissions: ${permissions ? `${permissions}` : "undefined"}
|
|
1318
1319
|
}`;
|
|
1319
1320
|
}
|
|
1320
1321
|
async function getFilesFromSources5(sources) {
|
|
@@ -1358,7 +1359,8 @@ function generateMenuItem(config, file, index) {
|
|
|
1358
1359
|
path: getRoute(file),
|
|
1359
1360
|
nested: config.nested,
|
|
1360
1361
|
rank: config.rank,
|
|
1361
|
-
translationNs: config.translationNs ? `${configName}.translationNs` : void 0
|
|
1362
|
+
translationNs: config.translationNs ? `${configName}.translationNs` : void 0,
|
|
1363
|
+
permissions: config.permissions ? `${configName}.permissions` : void 0
|
|
1362
1364
|
};
|
|
1363
1365
|
}
|
|
1364
1366
|
async function getRouteConfig(file) {
|
|
@@ -1460,6 +1462,7 @@ function processConfigProperties(properties, file) {
|
|
|
1460
1462
|
return {
|
|
1461
1463
|
label: hasLabel,
|
|
1462
1464
|
icon: hasProperty("icon"),
|
|
1465
|
+
permissions: hasProperty("permissions"),
|
|
1463
1466
|
nested: nestedValue,
|
|
1464
1467
|
rank: rankValue,
|
|
1465
1468
|
translationNs: translationNsValue
|
|
@@ -1671,7 +1674,7 @@ function generateHandle(index, hasHandle, hasConfig) {
|
|
|
1671
1674
|
return generateHandleName(index);
|
|
1672
1675
|
}
|
|
1673
1676
|
const configName = generateRouteConfigName2(index);
|
|
1674
|
-
const labelFields = `label: ${configName}.label, translationNs: ${configName}.translationNs`;
|
|
1677
|
+
const labelFields = `label: ${configName}.label, translationNs: ${configName}.translationNs, permissions: ${configName}.permissions`;
|
|
1675
1678
|
return hasHandle ? `{ ${labelFields}, ...${generateHandleName(index)} }` : `{ ${labelFields} }`;
|
|
1676
1679
|
}
|
|
1677
1680
|
function generateRouteComponentName(index) {
|
package/dist/index.mjs
CHANGED
|
@@ -1298,14 +1298,15 @@ function generateCode4(results) {
|
|
|
1298
1298
|
`;
|
|
1299
1299
|
}
|
|
1300
1300
|
function formatMenuItem(route) {
|
|
1301
|
-
const { label, icon, path: path6, nested, rank, translationNs } = route;
|
|
1301
|
+
const { label, icon, path: path6, nested, rank, translationNs, permissions } = route;
|
|
1302
1302
|
return `{
|
|
1303
1303
|
label: ${label},
|
|
1304
1304
|
icon: ${icon || "undefined"},
|
|
1305
1305
|
path: "${path6}",
|
|
1306
1306
|
nested: ${nested ? `"${nested}"` : "undefined"},
|
|
1307
1307
|
rank: ${rank !== void 0 ? rank : "undefined"},
|
|
1308
|
-
translationNs: ${translationNs ? `${translationNs}` : "undefined"}
|
|
1308
|
+
translationNs: ${translationNs ? `${translationNs}` : "undefined"},
|
|
1309
|
+
permissions: ${permissions ? `${permissions}` : "undefined"}
|
|
1309
1310
|
}`;
|
|
1310
1311
|
}
|
|
1311
1312
|
async function getFilesFromSources5(sources) {
|
|
@@ -1349,7 +1350,8 @@ function generateMenuItem(config, file, index) {
|
|
|
1349
1350
|
path: getRoute(file),
|
|
1350
1351
|
nested: config.nested,
|
|
1351
1352
|
rank: config.rank,
|
|
1352
|
-
translationNs: config.translationNs ? `${configName}.translationNs` : void 0
|
|
1353
|
+
translationNs: config.translationNs ? `${configName}.translationNs` : void 0,
|
|
1354
|
+
permissions: config.permissions ? `${configName}.permissions` : void 0
|
|
1353
1355
|
};
|
|
1354
1356
|
}
|
|
1355
1357
|
async function getRouteConfig(file) {
|
|
@@ -1451,6 +1453,7 @@ function processConfigProperties(properties, file) {
|
|
|
1451
1453
|
return {
|
|
1452
1454
|
label: hasLabel,
|
|
1453
1455
|
icon: hasProperty("icon"),
|
|
1456
|
+
permissions: hasProperty("permissions"),
|
|
1454
1457
|
nested: nestedValue,
|
|
1455
1458
|
rank: rankValue,
|
|
1456
1459
|
translationNs: translationNsValue
|
|
@@ -1662,7 +1665,7 @@ function generateHandle(index, hasHandle, hasConfig) {
|
|
|
1662
1665
|
return generateHandleName(index);
|
|
1663
1666
|
}
|
|
1664
1667
|
const configName = generateRouteConfigName2(index);
|
|
1665
|
-
const labelFields = `label: ${configName}.label, translationNs: ${configName}.translationNs`;
|
|
1668
|
+
const labelFields = `label: ${configName}.label, translationNs: ${configName}.translationNs, permissions: ${configName}.permissions`;
|
|
1666
1669
|
return hasHandle ? `{ ${labelFields}, ...${generateHandleName(index)} }` : `{ ${labelFields} }`;
|
|
1667
1670
|
}
|
|
1668
1671
|
function generateRouteComponentName(index) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/admin-vite-plugin",
|
|
3
|
-
"version": "2.22.
|
|
3
|
+
"version": "2.22.3-snapshot-20261103230838",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"vite": "^5.4.21 || ^6.0.0 || ^7.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@babel/parser": "
|
|
44
|
-
"@babel/traverse": "
|
|
45
|
-
"@babel/types": "
|
|
46
|
-
"@medusajs/admin-shared": "2.22.
|
|
43
|
+
"@babel/parser": "8.0.10",
|
|
44
|
+
"@babel/traverse": "8.0.10",
|
|
45
|
+
"@babel/types": "8.0.10",
|
|
46
|
+
"@medusajs/admin-shared": "2.22.3-snapshot-20261103230838",
|
|
47
47
|
"fdir": "6.1.1",
|
|
48
|
-
"magic-string": "
|
|
48
|
+
"magic-string": "1.4.3",
|
|
49
49
|
"outdent": "^0.8.0",
|
|
50
50
|
"picocolors": "^1.1.0"
|
|
51
51
|
},
|