@onexapis/cli 1.1.10 → 1.1.12
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/dist/cli.js +282 -17
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +282 -17
- package/dist/cli.mjs.map +1 -1
- package/dist/index.js +282 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +282 -17
- package/dist/index.mjs.map +1 -1
- package/dist/preview/preview-app.tsx +42 -1
- package/package.json +1 -1
|
@@ -14,6 +14,16 @@ import * as coreComponents from "@onexapis/core/components";
|
|
|
14
14
|
import * as coreRegistry from "@onexapis/core/registry";
|
|
15
15
|
import * as coreCommerce from "@onexapis/core/commerce";
|
|
16
16
|
import * as coreCommerceHooks from "@onexapis/core/commerce/hooks";
|
|
17
|
+
import * as coreAuth from "@onexapis/core/auth";
|
|
18
|
+
import * as coreCart from "@onexapis/core/cart";
|
|
19
|
+
import * as coreProducts from "@onexapis/core/products";
|
|
20
|
+
import * as coreOrders from "@onexapis/core/orders";
|
|
21
|
+
import * as coreBlog from "@onexapis/core/blog";
|
|
22
|
+
import * as coreFinance from "@onexapis/core/finance";
|
|
23
|
+
import * as coreInternal from "@onexapis/core/internal";
|
|
24
|
+
import * as coreTypes from "@onexapis/core/types";
|
|
25
|
+
import { CartProvider } from "@onexapis/core/contexts";
|
|
26
|
+
import { LocaleProvider } from "@onexapis/core/contexts";
|
|
17
27
|
|
|
18
28
|
// Set React globals
|
|
19
29
|
(globalThis as any).__ONEX_REACT__ = React;
|
|
@@ -23,7 +33,26 @@ import * as coreCommerceHooks from "@onexapis/core/commerce/hooks";
|
|
|
23
33
|
// Set core globals with subpath modules
|
|
24
34
|
// Theme bundle accesses: globalThis.__ONEX_CORE__["renderers"], globalThis.__ONEX_CORE__["utils"]
|
|
25
35
|
// This matches the pattern in: apps/storefront/lib/setup-theme-globals.ts
|
|
36
|
+
// Spread all subpath modules at the root level so that root imports
|
|
37
|
+
// (e.g. `import { filterEnabledComponents } from "@onexapis/core"`) also resolve.
|
|
38
|
+
// The storefront does `...coreRoot` but we can't import root @onexapis/core here
|
|
39
|
+
// (it pulls server code), so we approximate by spreading subpath modules.
|
|
26
40
|
(globalThis as any).__ONEX_CORE__ = {
|
|
41
|
+
...coreRenderers,
|
|
42
|
+
...coreUtils,
|
|
43
|
+
...coreContexts,
|
|
44
|
+
...coreComponents,
|
|
45
|
+
...coreRegistry,
|
|
46
|
+
...coreCommerce,
|
|
47
|
+
...coreCommerceHooks,
|
|
48
|
+
...coreAuth,
|
|
49
|
+
...coreCart,
|
|
50
|
+
...coreProducts,
|
|
51
|
+
...coreOrders,
|
|
52
|
+
...coreBlog,
|
|
53
|
+
...coreFinance,
|
|
54
|
+
...coreInternal,
|
|
55
|
+
...coreTypes,
|
|
27
56
|
renderers: coreRenderers,
|
|
28
57
|
utils: coreUtils,
|
|
29
58
|
contexts: coreContexts,
|
|
@@ -31,6 +60,14 @@ import * as coreCommerceHooks from "@onexapis/core/commerce/hooks";
|
|
|
31
60
|
registry: coreRegistry,
|
|
32
61
|
commerce: coreCommerce,
|
|
33
62
|
"commerce/hooks": coreCommerceHooks,
|
|
63
|
+
auth: coreAuth,
|
|
64
|
+
cart: coreCart,
|
|
65
|
+
products: coreProducts,
|
|
66
|
+
orders: coreOrders,
|
|
67
|
+
blog: coreBlog,
|
|
68
|
+
finance: coreFinance,
|
|
69
|
+
internal: coreInternal,
|
|
70
|
+
types: coreTypes,
|
|
34
71
|
};
|
|
35
72
|
|
|
36
73
|
// Initialize CommerceClient for preview
|
|
@@ -528,6 +565,10 @@ const queryClient = new QueryClient({
|
|
|
528
565
|
const root = createRoot(document.getElementById("onex-preview-root")!);
|
|
529
566
|
root.render(
|
|
530
567
|
<QueryClientProvider client={queryClient}>
|
|
531
|
-
<
|
|
568
|
+
<LocaleProvider locale="en">
|
|
569
|
+
<CartProvider>
|
|
570
|
+
<PreviewApp />
|
|
571
|
+
</CartProvider>
|
|
572
|
+
</LocaleProvider>
|
|
532
573
|
</QueryClientProvider>
|
|
533
574
|
);
|