@evjs/build-tools 0.0.1-rc.18 → 0.0.1-rc.28
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/README.md +4 -4
- package/esm/entry.d.ts.map +1 -1
- package/esm/entry.js +4 -2
- package/esm/entry.js.map +1 -1
- package/esm/types.d.ts +10 -6
- package/esm/types.d.ts.map +1 -1
- package/esm/types.js +6 -6
- package/esm/types.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
|
|
34
34
|
// Generate server entry source
|
|
35
35
|
const entrySource = generateServerEntry(
|
|
36
|
-
{ appFactory: "@evjs/
|
|
36
|
+
{ appFactory: "@evjs/server#createApp" },
|
|
37
37
|
["/path/to/api/users.server.ts"],
|
|
38
38
|
);
|
|
39
39
|
|
|
@@ -67,9 +67,9 @@ All generated code passes through `emitCode()` — a SWC `parseSync → printSyn
|
|
|
67
67
|
All runtime identifiers (module paths, function names, property names) are centralized in a single `RUNTIME` constant — no hardcoded strings in templates:
|
|
68
68
|
|
|
69
69
|
```ts
|
|
70
|
-
RUNTIME.serverModule // "@evjs/
|
|
71
|
-
RUNTIME.appModule // "@evjs/
|
|
72
|
-
RUNTIME.clientTransportModule // "@evjs/
|
|
70
|
+
RUNTIME.serverModule // "@evjs/server/register"
|
|
71
|
+
RUNTIME.appModule // "@evjs/server"
|
|
72
|
+
RUNTIME.clientTransportModule // "@evjs/client/transport"
|
|
73
73
|
RUNTIME.registerServerFn // "registerServerFn"
|
|
74
74
|
RUNTIME.clientCall // "__fn_call"
|
|
75
75
|
RUNTIME.clientRegister // "__fn_register"
|
package/esm/entry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,iBAAiB,EAAE,MAAM,EAAE,GAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,iBAAiB,GAAG,SAAS,EACrC,iBAAiB,EAAE,MAAM,EAAE,GAC1B,MAAM,CAqBR"}
|
package/esm/entry.js
CHANGED
|
@@ -21,9 +21,11 @@ export function generateServerEntry(config, serverModulePaths) {
|
|
|
21
21
|
.join("\n");
|
|
22
22
|
const fnsExports = serverModulePaths.map((_p, i) => `_fns_${i}`);
|
|
23
23
|
const allExports = [...fnsExports];
|
|
24
|
+
const appExport = config?.entry
|
|
25
|
+
? `export * from ${JSON.stringify(config.entry)};`
|
|
26
|
+
: `export { createApp } from "${RUNTIME.appModule}";`;
|
|
24
27
|
return emitCode([
|
|
25
|
-
|
|
26
|
-
...(config?.middleware ?? []),
|
|
28
|
+
appExport,
|
|
27
29
|
moduleImports,
|
|
28
30
|
allExports.length ? `export { ${allExports.join(", ")} };` : "",
|
|
29
31
|
]
|
package/esm/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAA0B,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAqC,EACrC,iBAA2B;IAE3B,MAAM,aAAa,GAAG,iBAAiB;SACpC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,oBAAo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AC,CAAC,CAAC,EAAE;KAChE;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;AACJ,CAAC"}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/** Configuration for the generated server entry. */
|
|
2
2
|
export interface ServerEntryConfig {
|
|
3
|
+
/**
|
|
4
|
+
* Explicit server entry file. If provided, overrides auto-generated entry.
|
|
5
|
+
*/
|
|
6
|
+
entry?: string;
|
|
3
7
|
/**
|
|
4
8
|
* Middleware module paths to auto-register in the server entry.
|
|
5
9
|
*/
|
|
@@ -23,19 +27,19 @@ export interface TransformOptions {
|
|
|
23
27
|
* Runtime identifiers used in generated code.
|
|
24
28
|
*
|
|
25
29
|
* These are build-time constants — the actual module paths and function names
|
|
26
|
-
* that appear in codegen output. They must stay in sync with the `@evjs/
|
|
27
|
-
* package exports.
|
|
30
|
+
* that appear in codegen output. They must stay in sync with the `@evjs/client`
|
|
31
|
+
* and `@evjs/server` package exports.
|
|
28
32
|
*
|
|
29
33
|
* Note: `DEFAULT_ENDPOINT` (the default HTTP path for server functions) is a runtime
|
|
30
|
-
* concern and lives in `@evjs/
|
|
34
|
+
* concern and lives in `@evjs/shared/src/constants.ts`, not here.
|
|
31
35
|
*/
|
|
32
36
|
export declare const RUNTIME: {
|
|
33
37
|
/** Module path for server-side function registration (no Hono dependency). */
|
|
34
|
-
readonly serverModule: "@evjs/
|
|
38
|
+
readonly serverModule: "@evjs/server/register";
|
|
35
39
|
/** Module path for the server app factory (Hono app + server function handler). */
|
|
36
|
-
readonly appModule: "@evjs/
|
|
40
|
+
readonly appModule: "@evjs/server";
|
|
37
41
|
/** Module path for client-side transport stubs. */
|
|
38
|
-
readonly clientTransportModule: "@evjs/
|
|
42
|
+
readonly clientTransportModule: "@evjs/client/transport";
|
|
39
43
|
/** Server function registration call name. */
|
|
40
44
|
readonly registerServerFn: "registerServerFn";
|
|
41
45
|
/** Client-side server function call name. */
|
package/esm/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KACvC,IAAI,CAAC;CACX;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO;IAClB,8EAA8E;;IAE9E,mFAAmF;;IAEnF,mDAAmD;;IAEnD,8CAA8C;;IAE9C,6CAA6C;;IAE7C,mDAAmD;;CAE3C,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,QAAQ,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,KACvC,IAAI,CAAC;CACX;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO;IAClB,8EAA8E;;IAE9E,mFAAmF;;IAEnF,mDAAmD;;IAEnD,8CAA8C;;IAE9C,6CAA6C;;IAE7C,mDAAmD;;CAE3C,CAAC"}
|
package/esm/types.js
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
* Runtime identifiers used in generated code.
|
|
3
3
|
*
|
|
4
4
|
* These are build-time constants — the actual module paths and function names
|
|
5
|
-
* that appear in codegen output. They must stay in sync with the `@evjs/
|
|
6
|
-
* package exports.
|
|
5
|
+
* that appear in codegen output. They must stay in sync with the `@evjs/client`
|
|
6
|
+
* and `@evjs/server` package exports.
|
|
7
7
|
*
|
|
8
8
|
* Note: `DEFAULT_ENDPOINT` (the default HTTP path for server functions) is a runtime
|
|
9
|
-
* concern and lives in `@evjs/
|
|
9
|
+
* concern and lives in `@evjs/shared/src/constants.ts`, not here.
|
|
10
10
|
*/
|
|
11
11
|
export const RUNTIME = {
|
|
12
12
|
/** Module path for server-side function registration (no Hono dependency). */
|
|
13
|
-
serverModule: "@evjs/
|
|
13
|
+
serverModule: "@evjs/server/register",
|
|
14
14
|
/** Module path for the server app factory (Hono app + server function handler). */
|
|
15
|
-
appModule: "@evjs/
|
|
15
|
+
appModule: "@evjs/server",
|
|
16
16
|
/** Module path for client-side transport stubs. */
|
|
17
|
-
clientTransportModule: "@evjs/
|
|
17
|
+
clientTransportModule: "@evjs/client/transport",
|
|
18
18
|
/** Server function registration call name. */
|
|
19
19
|
registerServerFn: "registerServerFn",
|
|
20
20
|
/** Client-side server function call name. */
|
package/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,8EAA8E;IAC9E,YAAY,EAAE,uBAAuB;IACrC,mFAAmF;IACnF,SAAS,EAAE,cAAc;IACzB,mDAAmD;IACnD,qBAAqB,EAAE,wBAAwB;IAC/C,8CAA8C;IAC9C,gBAAgB,EAAE,kBAAkB;IACpC,6CAA6C;IAC7C,UAAU,EAAE,WAAW;IACvB,mDAAmD;IACnD,cAAc,EAAE,eAAe;CACvB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evjs/build-tools",
|
|
3
|
-
"version": "0.0.1-rc.
|
|
3
|
+
"version": "0.0.1-rc.28",
|
|
4
4
|
"description": "Bundler-agnostic build utilities for the ev framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"author": "xusd320",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@swc/core": "^1.15.
|
|
34
|
+
"@swc/core": "^1.15.21"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@swc/types": "^0.1.25",
|
|
38
|
-
"typescript": "^
|
|
38
|
+
"typescript": "^6.0.2"
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/evaijs/evjs#readme",
|
|
41
41
|
"bugs": {
|