@onexapis/cli 1.1.49 → 1.1.51

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.mjs CHANGED
@@ -708,6 +708,7 @@ async function compileStandaloneTheme(themePath, themeName) {
708
708
  },
709
709
  plugins: [
710
710
  reactGlobalPlugin,
711
+ reactQueryGlobalPlugin,
711
712
  createCoreGlobalPlugin(themePath),
712
713
  createThemeDepsStubPlugin(themePath)
713
714
  ],
@@ -803,6 +804,7 @@ async function compileStandaloneThemeDev(themePath, themeName) {
803
804
  },
804
805
  plugins: [
805
806
  reactGlobalPlugin,
807
+ reactQueryGlobalPlugin,
806
808
  createCoreGlobalPlugin(themePath),
807
809
  createThemeDepsStubPlugin(themePath)
808
810
  ],
@@ -1183,7 +1185,7 @@ export function headers() { return new Headers(); }
1183
1185
  }
1184
1186
  return outputPath;
1185
1187
  }
1186
- var PROCESS_SHIM, reactGlobalPlugin;
1188
+ var PROCESS_SHIM, reactGlobalPlugin, reactQueryGlobalPlugin;
1187
1189
  var init_compile_theme = __esm({
1188
1190
  "src/utils/compile-theme.ts"() {
1189
1191
  init_logger();
@@ -1301,6 +1303,37 @@ export const Fragment = _jsxRuntime.Fragment;
1301
1303
  });
1302
1304
  }
1303
1305
  };
1306
+ reactQueryGlobalPlugin = {
1307
+ name: "react-query-global",
1308
+ setup(build2) {
1309
+ build2.onResolve({ filter: /^@tanstack\/react-query$/ }, () => ({
1310
+ path: "react-query-external",
1311
+ namespace: "react-query-global"
1312
+ }));
1313
+ build2.onLoad({ filter: /.*/, namespace: "react-query-global" }, () => ({
1314
+ contents: `
1315
+ if (!globalThis.__REACT_QUERY__) {
1316
+ throw new Error('[Theme Bundle] @tanstack/react-query not initialized. Ensure globalThis.__REACT_QUERY__ is set before loading theme.');
1317
+ }
1318
+ const _rq = globalThis.__REACT_QUERY__;
1319
+ export default _rq;
1320
+ export const {
1321
+ useQuery,
1322
+ useMutation,
1323
+ useQueryClient,
1324
+ useInfiniteQuery,
1325
+ QueryClient,
1326
+ QueryClientProvider,
1327
+ useIsFetching,
1328
+ useIsMutating,
1329
+ usePrefetchQuery,
1330
+ usePrefetchInfiniteQuery,
1331
+ } = _rq;
1332
+ `.trim(),
1333
+ loader: "js"
1334
+ }));
1335
+ }
1336
+ };
1304
1337
  }
1305
1338
  });
1306
1339