@actuate-media/plugin-commerce 0.1.0 → 0.1.2
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/CHANGELOG.md +35 -0
- package/dist/__tests__/index.test.js +6 -11
- package/dist/__tests__/index.test.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# @actuate-media/plugin-commerce
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e25cd48: Standardize React peer ranges to `^18.0.0 || ^19.0.0`.
|
|
8
|
+
|
|
9
|
+
Plugin React peer ranges were inconsistent: `plugin-ai`, `plugin-commerce`, and
|
|
10
|
+
`plugin-seo` pinned `react: ^19.2.0` (excluding React 18, which `cms-core`
|
|
11
|
+
supports via `react >=18.0.0`), while the others used `^18.0.0 || ^19.2.0`
|
|
12
|
+
(excluding React 19.0/19.1). Either produced an `ERESOLVE` install failure for
|
|
13
|
+
consumers on the excluded versions. All bundled plugins now declare `react`
|
|
14
|
+
(and `react-dom` where already peered) as `^18.0.0 || ^19.0.0`.
|
|
15
|
+
|
|
16
|
+
## 0.1.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- cd8a061: Remove dead sidebar nav from bundled plugins and guard the whole class.
|
|
21
|
+
|
|
22
|
+
`plugin-ai`, `plugin-commerce`, and `plugin-blocks` each advertised
|
|
23
|
+
`adminNavItems` paths (`/ai/*`, `/commerce/*`, `/blocks`) that the admin router
|
|
24
|
+
has no view for — plugins cannot register views, and these plugins register no
|
|
25
|
+
collection backing those paths — so every one of those sidebar links landed on
|
|
26
|
+
the 404 page. The commerce items were also duplicates of the working collection
|
|
27
|
+
nav (its collections already appear under the "Commerce" group at their real
|
|
28
|
+
`/<slug>` routes).
|
|
29
|
+
- Dropped the dead `adminNavItems` from all three plugins. Commerce collections
|
|
30
|
+
remain reachable at `/products`, `/orders`, `/discounts`, …; plugin-ai and
|
|
31
|
+
plugin-blocks are backend/page-builder plugins with no standalone admin route.
|
|
32
|
+
- Added `cms-admin`'s `router/admin-routes` resolver (`adminPathResolves`) plus
|
|
33
|
+
a table-driven test asserting **every** bundled plugin's nav paths resolve to a
|
|
34
|
+
real view, and a drift test that keeps the known-route list in sync with
|
|
35
|
+
`AdminRoot`. This is the systemic guard for a bug class that has now shipped in
|
|
36
|
+
published packages three times.
|
|
37
|
+
|
|
3
38
|
## 0.1.0
|
|
4
39
|
|
|
5
40
|
### Minor Changes
|
|
@@ -13,18 +13,13 @@ describe('commerce', () => {
|
|
|
13
13
|
expect(plugin.collections).toBeDefined();
|
|
14
14
|
expect(Object.keys(plugin.collections ?? {}).length).toBeGreaterThan(0);
|
|
15
15
|
});
|
|
16
|
-
it('
|
|
16
|
+
it('does not register dead admin nav items', () => {
|
|
17
|
+
// The old /commerce/* nav paths had no admin view and duplicated the
|
|
18
|
+
// working collection nav — commerce collections already surface under
|
|
19
|
+
// their "Commerce" group at /products, /orders, /discounts, …. Guarded
|
|
20
|
+
// centrally by cms-admin's plugin-nav-resolves test.
|
|
17
21
|
const plugin = commercePlugin();
|
|
18
|
-
expect(plugin.adminNavItems).
|
|
19
|
-
{ label: 'Products', icon: 'package', path: '/commerce/products' },
|
|
20
|
-
{ label: 'Orders', icon: 'shopping-cart', path: '/commerce/orders' },
|
|
21
|
-
{ label: 'Discounts', icon: 'percent', path: '/commerce/discounts' },
|
|
22
|
-
{
|
|
23
|
-
label: 'Commerce Dashboard',
|
|
24
|
-
icon: 'bar-chart',
|
|
25
|
-
path: '/commerce/dashboard',
|
|
26
|
-
},
|
|
27
|
-
]);
|
|
22
|
+
expect(plugin.adminNavItems).toBeUndefined();
|
|
28
23
|
});
|
|
29
24
|
it('registers hooks', () => {
|
|
30
25
|
const plugin = commercePlugin();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QACzB,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;YAC/B,MAAM,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,MAAM,GAAG,cAAc,EAAE,CAAA;YAC/B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAA;YACnC,MAAM,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC3C,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAA;YACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QACzE,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../src/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO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AAa,CAAC,MAAM,CAAC,CAAA;QACzD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;YACtC,MAAM,MAAM,GAAG,cAAc,CAAC,EAAE,CAAC,CAAA;YACjC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QACtC,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAKpF,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE;QACP,SAAS,EAAE,MAAM,CAAA;QACjB,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,GAAG,CAAC,EAAE;QACJ,aAAa,CAAC,EAAE,OAAO,CAAA;KACxB,CAAA;IACD,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;CACF;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,MAAM,GAAE,oBAAyB,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAKpF,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE;QACP,SAAS,EAAE,MAAM,CAAA;QACjB,aAAa,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,GAAG,CAAC,EAAE;QACJ,aAAa,CAAC,EAAE,OAAO,CAAA;KACxB,CAAA;IACD,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;CACF;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,MAAM,GAAE,oBAAyB,GAAG,gBAAgB,CAYlF;AAED,YAAY,EAAE,oBAAoB,IAAI,cAAc,EAAE,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -8,16 +8,11 @@ export function commercePlugin(config = {}) {
|
|
|
8
8
|
name: 'commerce',
|
|
9
9
|
fields: commerceFields,
|
|
10
10
|
collections: commerceCollections,
|
|
11
|
-
adminNavItems:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
label: 'Commerce Dashboard',
|
|
17
|
-
icon: 'bar-chart',
|
|
18
|
-
path: '/commerce/dashboard',
|
|
19
|
-
},
|
|
20
|
-
],
|
|
11
|
+
// No adminNavItems: the commerce collections already surface in the sidebar
|
|
12
|
+
// under their "Commerce" group at their real /<slug> routes (/products,
|
|
13
|
+
// /orders, /discounts, …). The old /commerce/* items pointed at routes the
|
|
14
|
+
// admin router has no view for, so they were dead 404s that also duplicated
|
|
15
|
+
// the working collection nav. Guarded by cms-admin's plugin-nav-resolves test.
|
|
21
16
|
hooks: commerceHooks,
|
|
22
17
|
});
|
|
23
18
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyB,MAAM,gCAAgC,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAgB1C,iGAAiG;AACjG,MAAM,UAAU,cAAc,CAAC,SAA+B,EAAE;IAC9D,OAAO,YAAY,CAAC;QAClB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,cAAc;QACtB,WAAW,EAAE,mBAAmB;QAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyB,MAAM,gCAAgC,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAgB1C,iGAAiG;AACjG,MAAM,UAAU,cAAc,CAAC,SAA+B,EAAE;IAC9D,OAAO,YAAY,CAAC;QAClB,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,cAAc;QACtB,WAAW,EAAE,mBAAmB;QAChC,4EAA4E;QAC5E,wEAAwE;QACxE,2EAA2E;QAC3E,4EAA4E;QAC5E,+EAA+E;QAC/E,KAAK,EAAE,aAAa;KACrB,CAAC,CAAA;AACJ,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actuate-media/plugin-commerce",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"@types/react": "^19.0.0",
|
|
29
29
|
"typescript": "^5.7.0",
|
|
30
30
|
"vitest": "^4.1.0",
|
|
31
|
-
"@actuate-media/cms-core": "0.93.
|
|
31
|
+
"@actuate-media/cms-core": "0.93.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@actuate-media/cms-core": ">=0.1.0",
|
|
35
|
-
"react": "^19.
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc --project tsconfig.json",
|