hadars 0.4.1 → 0.4.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.
Files changed (58) hide show
  1. package/dist/{chunk-TV37IMRB.js → chunk-2TMQUXFL.js} +10 -10
  2. package/dist/{chunk-2J2L2H3H.js → chunk-NYLXE7T7.js} +6 -6
  3. package/dist/{chunk-OS3V4CPN.js → chunk-OZUZS2PD.js} +4 -4
  4. package/dist/cli.js +462 -496
  5. package/dist/cloudflare.cjs +11 -11
  6. package/dist/cloudflare.js +3 -3
  7. package/dist/index.d.cts +8 -4
  8. package/dist/index.d.ts +8 -4
  9. package/dist/lambda.cjs +11 -11
  10. package/dist/lambda.js +7 -7
  11. package/dist/loader.cjs +90 -54
  12. package/dist/slim-react/index.cjs +13 -13
  13. package/dist/slim-react/index.js +2 -2
  14. package/dist/slim-react/jsx-runtime.cjs +2 -4
  15. package/dist/slim-react/jsx-runtime.js +1 -1
  16. package/dist/ssr-render-worker.js +174 -161
  17. package/dist/ssr-watch.js +40 -74
  18. package/package.json +8 -10
  19. package/cli-lib.ts +0 -676
  20. package/cli.ts +0 -36
  21. package/index.ts +0 -17
  22. package/src/build.ts +0 -805
  23. package/src/cloudflare.ts +0 -140
  24. package/src/index.tsx +0 -41
  25. package/src/lambda.ts +0 -287
  26. package/src/slim-react/context.ts +0 -55
  27. package/src/slim-react/dispatcher.ts +0 -87
  28. package/src/slim-react/hooks.ts +0 -137
  29. package/src/slim-react/index.ts +0 -232
  30. package/src/slim-react/jsx-runtime.ts +0 -7
  31. package/src/slim-react/jsx.ts +0 -53
  32. package/src/slim-react/render.ts +0 -1101
  33. package/src/slim-react/renderContext.ts +0 -294
  34. package/src/slim-react/types.ts +0 -33
  35. package/src/source/context.ts +0 -113
  36. package/src/source/graphiql.ts +0 -101
  37. package/src/source/inference.ts +0 -260
  38. package/src/source/runner.ts +0 -138
  39. package/src/source/store.ts +0 -50
  40. package/src/ssr-render-worker.ts +0 -116
  41. package/src/ssr-watch.ts +0 -62
  42. package/src/static.ts +0 -109
  43. package/src/types/global.d.ts +0 -5
  44. package/src/types/hadars.ts +0 -350
  45. package/src/utils/Head.tsx +0 -462
  46. package/src/utils/clientScript.tsx +0 -71
  47. package/src/utils/cookies.ts +0 -16
  48. package/src/utils/loader.ts +0 -335
  49. package/src/utils/proxyHandler.tsx +0 -104
  50. package/src/utils/request.tsx +0 -9
  51. package/src/utils/response.tsx +0 -141
  52. package/src/utils/rspack.ts +0 -467
  53. package/src/utils/runtime.ts +0 -19
  54. package/src/utils/serve.ts +0 -155
  55. package/src/utils/ssrHandler.ts +0 -239
  56. package/src/utils/staticFile.ts +0 -43
  57. package/src/utils/template.html +0 -11
  58. package/src/utils/upgradeRequest.tsx +0 -19
package/cli.ts DELETED
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawn } from 'node:child_process';
3
- import { runCli } from './cli-lib'
4
-
5
- // When the #!/usr/bin/env node shebang forces Node.js as the interpreter,
6
- // try to re-exec with Bun so the server runs under Bun's runtime
7
- // (native Bun.serve, WebSocket support, etc.).
8
- // Falls back to Node.js silently if bun is not in PATH.
9
- if (typeof (globalThis as any).Bun === 'undefined' && typeof (globalThis as any).Deno === 'undefined') {
10
- const child = spawn('bun', [process.argv[1]!, ...process.argv.slice(2)], {
11
- stdio: 'inherit',
12
- env: process.env,
13
- });
14
- const sigs = ['SIGINT', 'SIGTERM', 'SIGHUP'] as const;
15
- const fwd = (sig: NodeJS.Signals) => () => { try { child.kill(sig); } catch {} };
16
- for (const sig of sigs) process.on(sig, fwd(sig));
17
- child.on('error', (err: any) => {
18
- for (const sig of sigs) process.removeAllListeners(sig);
19
- if (err.code !== 'ENOENT') { console.error(err); process.exit(1); }
20
- // bun not found — fall through and run with Node.js
21
- runCli(process.argv).catch((e) => {
22
- console.error(e);
23
- try { process.exit(1); } catch (_) { throw e; }
24
- });
25
- });
26
- child.on('exit', (code: number | null) => process.exit(code ?? 0));
27
- } else {
28
- runCli(process.argv).catch((err) => {
29
- console.error(err)
30
- try {
31
- process.exit(1)
32
- } catch (_) {
33
- throw err
34
- }
35
- })
36
- }
package/index.ts DELETED
@@ -1,17 +0,0 @@
1
- // Bun entry point — re-exports the full public API from source so that
2
- // hadars running TypeScript directly gets the same exports as
3
- // the compiled `dist/index.js` used by Node.js / Deno.
4
- export type {
5
- HadarsOptions,
6
- HadarsProps,
7
- HadarsRequest,
8
- HadarsGetFinalProps,
9
- HadarsGetInitialProps,
10
- HadarsGetClientProps,
11
- HadarsEntryModule,
12
- HadarsApp,
13
- HadarsStaticContext,
14
- GraphQLExecutor,
15
- HadarsSourceEntry,
16
- } from "./src/types/hadars";
17
- export { HadarsHead, HadarsContext, loadModule } from "./src/index";