@onexapis/cli 1.1.49 → 1.1.50

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 CHANGED
@@ -751,6 +751,7 @@ async function compileStandaloneTheme(themePath, themeName) {
751
751
  },
752
752
  plugins: [
753
753
  reactGlobalPlugin,
754
+ reactQueryGlobalPlugin,
754
755
  createCoreGlobalPlugin(themePath),
755
756
  createThemeDepsStubPlugin(themePath)
756
757
  ],
@@ -846,6 +847,7 @@ async function compileStandaloneThemeDev(themePath, themeName) {
846
847
  },
847
848
  plugins: [
848
849
  reactGlobalPlugin,
850
+ reactQueryGlobalPlugin,
849
851
  createCoreGlobalPlugin(themePath),
850
852
  createThemeDepsStubPlugin(themePath)
851
853
  ],
@@ -1226,7 +1228,7 @@ export function headers() { return new Headers(); }
1226
1228
  }
1227
1229
  return outputPath;
1228
1230
  }
1229
- var PROCESS_SHIM, reactGlobalPlugin;
1231
+ var PROCESS_SHIM, reactGlobalPlugin, reactQueryGlobalPlugin;
1230
1232
  var init_compile_theme = __esm({
1231
1233
  "src/utils/compile-theme.ts"() {
1232
1234
  init_logger();
@@ -1344,6 +1346,37 @@ export const Fragment = _jsxRuntime.Fragment;
1344
1346
  });
1345
1347
  }
1346
1348
  };
1349
+ reactQueryGlobalPlugin = {
1350
+ name: "react-query-global",
1351
+ setup(build2) {
1352
+ build2.onResolve({ filter: /^@tanstack\/react-query$/ }, () => ({
1353
+ path: "react-query-external",
1354
+ namespace: "react-query-global"
1355
+ }));
1356
+ build2.onLoad({ filter: /.*/, namespace: "react-query-global" }, () => ({
1357
+ contents: `
1358
+ if (!globalThis.__REACT_QUERY__) {
1359
+ throw new Error('[Theme Bundle] @tanstack/react-query not initialized. Ensure globalThis.__REACT_QUERY__ is set before loading theme.');
1360
+ }
1361
+ const _rq = globalThis.__REACT_QUERY__;
1362
+ export default _rq;
1363
+ export const {
1364
+ useQuery,
1365
+ useMutation,
1366
+ useQueryClient,
1367
+ useInfiniteQuery,
1368
+ QueryClient,
1369
+ QueryClientProvider,
1370
+ useIsFetching,
1371
+ useIsMutating,
1372
+ usePrefetchQuery,
1373
+ usePrefetchInfiniteQuery,
1374
+ } = _rq;
1375
+ `.trim(),
1376
+ loader: "js"
1377
+ }));
1378
+ }
1379
+ };
1347
1380
  }
1348
1381
  });
1349
1382