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.
- package/dist/{chunk-TV37IMRB.js → chunk-2TMQUXFL.js} +10 -10
- package/dist/{chunk-2J2L2H3H.js → chunk-NYLXE7T7.js} +6 -6
- package/dist/{chunk-OS3V4CPN.js → chunk-OZUZS2PD.js} +4 -4
- package/dist/cli.js +462 -496
- package/dist/cloudflare.cjs +11 -11
- package/dist/cloudflare.js +3 -3
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/lambda.cjs +11 -11
- package/dist/lambda.js +7 -7
- package/dist/loader.cjs +90 -54
- package/dist/slim-react/index.cjs +13 -13
- package/dist/slim-react/index.js +2 -2
- package/dist/slim-react/jsx-runtime.cjs +2 -4
- package/dist/slim-react/jsx-runtime.js +1 -1
- package/dist/ssr-render-worker.js +174 -161
- package/dist/ssr-watch.js +40 -74
- package/package.json +8 -10
- package/cli-lib.ts +0 -676
- package/cli.ts +0 -36
- package/index.ts +0 -17
- package/src/build.ts +0 -805
- package/src/cloudflare.ts +0 -140
- package/src/index.tsx +0 -41
- package/src/lambda.ts +0 -287
- package/src/slim-react/context.ts +0 -55
- package/src/slim-react/dispatcher.ts +0 -87
- package/src/slim-react/hooks.ts +0 -137
- package/src/slim-react/index.ts +0 -232
- package/src/slim-react/jsx-runtime.ts +0 -7
- package/src/slim-react/jsx.ts +0 -53
- package/src/slim-react/render.ts +0 -1101
- package/src/slim-react/renderContext.ts +0 -294
- package/src/slim-react/types.ts +0 -33
- package/src/source/context.ts +0 -113
- package/src/source/graphiql.ts +0 -101
- package/src/source/inference.ts +0 -260
- package/src/source/runner.ts +0 -138
- package/src/source/store.ts +0 -50
- package/src/ssr-render-worker.ts +0 -116
- package/src/ssr-watch.ts +0 -62
- package/src/static.ts +0 -109
- package/src/types/global.d.ts +0 -5
- package/src/types/hadars.ts +0 -350
- package/src/utils/Head.tsx +0 -462
- package/src/utils/clientScript.tsx +0 -71
- package/src/utils/cookies.ts +0 -16
- package/src/utils/loader.ts +0 -335
- package/src/utils/proxyHandler.tsx +0 -104
- package/src/utils/request.tsx +0 -9
- package/src/utils/response.tsx +0 -141
- package/src/utils/rspack.ts +0 -467
- package/src/utils/runtime.ts +0 -19
- package/src/utils/serve.ts +0 -155
- package/src/utils/ssrHandler.ts +0 -239
- package/src/utils/staticFile.ts +0 -43
- package/src/utils/template.html +0 -11
- 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";
|