@onexapis/cli 1.1.48 → 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.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
 
@@ -4829,6 +4862,8 @@ Or use the --bump flag:
4829
4862
  if (!pubResponse.ok || !pubBody.bundleUploadUrl) {
4830
4863
  logger.stopSpinner(false, "Failed to get upload URLs");
4831
4864
  logger.error(pubBody.error || "Server error");
4865
+ logger.error(`Status: ${pubResponse.status} ${pubResponse.statusText}`);
4866
+ logger.error(`Response: ${JSON.stringify(pubBody).slice(0, 500)}`);
4832
4867
  process.exit(1);
4833
4868
  }
4834
4869
  bundleUploadUrl = pubBody.bundleUploadUrl;
@@ -4962,13 +4997,21 @@ Or use the --bump flag:
4962
4997
  const confirmBody = confirmData.statusCode ? confirmData.body : confirmData;
4963
4998
  if (!confirmResponse.ok || !confirmBody.success) {
4964
4999
  logger.stopSpinner(false, "Publishing failed");
4965
- if (confirmBody.violations) {
5000
+ const violations = confirmBody.violations || confirmData.violations;
5001
+ if (violations && violations.length > 0) {
4966
5002
  logger.error("Theme rejected \u2014 security violations found:");
4967
- for (const v of confirmBody.violations) {
4968
- logger.log(` \u274C ${v.file}: ${v.violation}`);
5003
+ for (const v of violations) {
5004
+ logger.log(
5005
+ ` \u274C ${v.file || v.path || "?"}: ${v.violation || v.message || JSON.stringify(v)}`
5006
+ );
4969
5007
  }
4970
5008
  } else {
4971
5009
  logger.error(confirmBody.error || "Unknown error");
5010
+ logger.error(confirmBody.message || "");
5011
+ logger.error(
5012
+ `Status: ${confirmResponse.status} ${confirmResponse.statusText}`
5013
+ );
5014
+ logger.error(`Response: ${JSON.stringify(confirmBody).slice(0, 2e3)}`);
4972
5015
  }
4973
5016
  if (confirmBody.warnings?.length) {
4974
5017
  logger.newLine();