veryfront 0.1.58 → 0.1.59
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/esm/deno.js +1 -1
- package/esm/src/modules/server/module-server.d.ts.map +1 -1
- package/esm/src/modules/server/module-server.js +8 -3
- package/esm/src/transforms/import-rewriter/strategies/veryfront-strategy.d.ts.map +1 -1
- package/esm/src/transforms/import-rewriter/strategies/veryfront-strategy.js +8 -1
- package/esm/src/utils/version.d.ts +1 -1
- package/esm/src/utils/version.d.ts.map +1 -1
- package/esm/src/utils/version.js +3 -6
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/modules/server/module-server.ts +8 -3
- package/src/src/transforms/import-rewriter/strategies/veryfront-strategy.ts +9 -1
- package/src/src/utils/version.ts +3 -8
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAIlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAkBtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAIlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAkBtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAsDrD,CAAC;AASF,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAqTzG;AAwND;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAG7D"}
|
|
@@ -3,7 +3,7 @@ import * as dntShim from "../../../_dnt.shims.js";
|
|
|
3
3
|
import { join } from "../../platform/compat/path/index.js";
|
|
4
4
|
import { createFileSystem } from "../../platform/compat/fs.js";
|
|
5
5
|
import { transformToESM } from "../../transforms/esm-transform.js";
|
|
6
|
-
import { serverLogger } from "../../utils/index.js";
|
|
6
|
+
import { serverLogger, VERSION } from "../../utils/index.js";
|
|
7
7
|
import { HTTP_NOT_FOUND, HTTP_OK, HTTP_SERVER_ERROR } from "../../utils/index.js";
|
|
8
8
|
import { getContentTypeForPath } from "../../server/handlers/utils/content-types.js";
|
|
9
9
|
import { createSecureFs } from "../../security/index.js";
|
|
@@ -76,6 +76,10 @@ export default {};
|
|
|
76
76
|
`export default {};`,
|
|
77
77
|
].join("\n") + "\n",
|
|
78
78
|
"_dnt.polyfills": `export default {};\n`,
|
|
79
|
+
// Deno import-map alias stub for browser/HTTP-served framework modules.
|
|
80
|
+
// Must be a JS module (not JSON) because esbuild strips `with { type: "json" }`
|
|
81
|
+
// at es2020 target, and browsers reject JSON MIME type without the assertion.
|
|
82
|
+
"_veryfront/_deno-config": `export default ${JSON.stringify({ version: VERSION })};\n`,
|
|
79
83
|
};
|
|
80
84
|
const DEV_MODULE_PREFIX = /^\/(?:_vf_modules|_veryfront\/modules)\//;
|
|
81
85
|
const SNIPPET_MODULE_PREFIX = /^\/_vf_modules\/_snippets\/([a-f0-9]+)\.js/;
|
|
@@ -331,6 +335,7 @@ const EMBEDDED_SRC_DIR = join(FRAMEWORK_ROOT, "dist", "framework-src");
|
|
|
331
335
|
async function findSourceFile(secureFs, projectDir, basePath) {
|
|
332
336
|
// Extensions including .src for compiled binary embedded sources
|
|
333
337
|
const extensions = [
|
|
338
|
+
".json",
|
|
334
339
|
".tsx.src",
|
|
335
340
|
".ts.src",
|
|
336
341
|
".jsx.src",
|
|
@@ -347,7 +352,7 @@ async function findSourceFile(secureFs, projectDir, basePath) {
|
|
|
347
352
|
logger.debug("findSourceFile called", { projectDir, basePath });
|
|
348
353
|
const hasKnownExt = extensions.some((ext) => basePath.endsWith(ext));
|
|
349
354
|
const rawBasePathWithoutExt = hasKnownExt
|
|
350
|
-
? basePath.replace(/\.(tsx|ts|jsx|js|mdx|md)(\.src)?$/, "")
|
|
355
|
+
? basePath.replace(/\.(json|tsx|ts|jsx|js|mdx|md)(\.src)?$/, "")
|
|
351
356
|
: basePath;
|
|
352
357
|
let basePathWithoutExt = rawBasePathWithoutExt.replace(/^\/+/, "");
|
|
353
358
|
if (basePathWithoutExt.startsWith("_vf_modules/")) {
|
|
@@ -374,7 +379,7 @@ async function findSourceFile(secureFs, projectDir, basePath) {
|
|
|
374
379
|
basePath: basePathWithoutExt,
|
|
375
380
|
});
|
|
376
381
|
return {
|
|
377
|
-
path: `embedded:${
|
|
382
|
+
path: `embedded:${basePath}`,
|
|
378
383
|
isFrameworkFile: true,
|
|
379
384
|
embeddedContent,
|
|
380
385
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veryfront-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/import-rewriter/strategies/veryfront-strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAkBrB,qBAAa,iBAAkB,YAAW,qBAAqB;IAC7D,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,QAAQ,OAAO;IAExB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"veryfront-strategy.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/import-rewriter/strategies/veryfront-strategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACd,MAAM,aAAa,CAAC;AAkBrB,qBAAa,iBAAkB,YAAW,qBAAqB;IAC7D,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,QAAQ,OAAO;IAExB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,OAAO;IASzD,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,EAAE,cAAc,GAAG,aAAa;CAkDvE;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -22,10 +22,17 @@ export class VeryfrontStrategy {
|
|
|
22
22
|
matches(specifier, _ctx) {
|
|
23
23
|
return (specifier.startsWith("#veryfront/") ||
|
|
24
24
|
specifier.startsWith("veryfront/") ||
|
|
25
|
-
specifier === "veryfront"
|
|
25
|
+
specifier === "veryfront" ||
|
|
26
|
+
specifier === "#deno-config");
|
|
26
27
|
}
|
|
27
28
|
rewrite(info, ctx) {
|
|
28
29
|
const specifier = info.specifier;
|
|
30
|
+
// Handle #deno-config — Deno import-map alias that doesn't exist in browsers.
|
|
31
|
+
// Rewrite to a JS module (not JSON) because esbuild strips `with { type: "json" }`
|
|
32
|
+
// at es2020 target and browsers reject JSON MIME without the assertion.
|
|
33
|
+
if (specifier === "#deno-config") {
|
|
34
|
+
return { specifier: "/_vf_modules/_veryfront/_deno-config.js" };
|
|
35
|
+
}
|
|
29
36
|
// Handle #veryfront/* (internal framework imports)
|
|
30
37
|
if (specifier.startsWith("#veryfront/")) {
|
|
31
38
|
const path = specifier.slice("#veryfront/".length);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../src/src/utils/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,eAAO,MAAM,iBAAiB,EAAE,MAAmB,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,YAAY,CAM1E"}
|
package/esm/src/utils/version.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
// Use deno.json version directly to avoid env access at module load
|
|
6
|
-
export const VERSION = getVersionFromDeno();
|
|
1
|
+
// Keep in sync with deno.json version.
|
|
2
|
+
// scripts/release.ts updates this constant during releases.
|
|
3
|
+
export const VERSION = "0.1.59";
|
|
7
4
|
export const SERVER_START_TIME = Date.now();
|
|
8
5
|
export function createBuildVersion(projectUpdatedAt) {
|
|
9
6
|
return {
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from "../../platform/compat/path/index.js";
|
|
|
6
6
|
import type { RuntimeAdapter } from "../../platform/adapters/base.js";
|
|
7
7
|
import { createFileSystem } from "../../platform/compat/fs.js";
|
|
8
8
|
import { type TransformOptions, transformToESM } from "../../transforms/esm-transform.js";
|
|
9
|
-
import { serverLogger } from "../../utils/index.js";
|
|
9
|
+
import { serverLogger, VERSION } from "../../utils/index.js";
|
|
10
10
|
import { HTTP_NOT_FOUND, HTTP_OK, HTTP_SERVER_ERROR } from "../../utils/index.js";
|
|
11
11
|
import { getContentTypeForPath } from "../../server/handlers/utils/content-types.js";
|
|
12
12
|
import { createSecureFs } from "../../security/index.js";
|
|
@@ -81,6 +81,10 @@ export default {};
|
|
|
81
81
|
`export default {};`,
|
|
82
82
|
].join("\n") + "\n",
|
|
83
83
|
"_dnt.polyfills": `export default {};\n`,
|
|
84
|
+
// Deno import-map alias stub for browser/HTTP-served framework modules.
|
|
85
|
+
// Must be a JS module (not JSON) because esbuild strips `with { type: "json" }`
|
|
86
|
+
// at es2020 target, and browsers reject JSON MIME type without the assertion.
|
|
87
|
+
"_veryfront/_deno-config": `export default ${JSON.stringify({ version: VERSION })};\n`,
|
|
84
88
|
};
|
|
85
89
|
|
|
86
90
|
const DEV_MODULE_PREFIX = /^\/(?:_vf_modules|_veryfront\/modules)\//;
|
|
@@ -449,6 +453,7 @@ async function findSourceFile(
|
|
|
449
453
|
): Promise<FindSourceFileResult | null> {
|
|
450
454
|
// Extensions including .src for compiled binary embedded sources
|
|
451
455
|
const extensions = [
|
|
456
|
+
".json",
|
|
452
457
|
".tsx.src",
|
|
453
458
|
".ts.src",
|
|
454
459
|
".jsx.src",
|
|
@@ -467,7 +472,7 @@ async function findSourceFile(
|
|
|
467
472
|
|
|
468
473
|
const hasKnownExt = extensions.some((ext) => basePath.endsWith(ext));
|
|
469
474
|
const rawBasePathWithoutExt = hasKnownExt
|
|
470
|
-
? basePath.replace(/\.(tsx|ts|jsx|js|mdx|md)(\.src)?$/, "")
|
|
475
|
+
? basePath.replace(/\.(json|tsx|ts|jsx|js|mdx|md)(\.src)?$/, "")
|
|
471
476
|
: basePath;
|
|
472
477
|
let basePathWithoutExt = rawBasePathWithoutExt.replace(/^\/+/, "");
|
|
473
478
|
if (basePathWithoutExt.startsWith("_vf_modules/")) {
|
|
@@ -496,7 +501,7 @@ async function findSourceFile(
|
|
|
496
501
|
basePath: basePathWithoutExt,
|
|
497
502
|
});
|
|
498
503
|
return {
|
|
499
|
-
path: `embedded:${
|
|
504
|
+
path: `embedded:${basePath}`,
|
|
500
505
|
isFrameworkFile: true,
|
|
501
506
|
embeddedContent,
|
|
502
507
|
};
|
|
@@ -36,13 +36,21 @@ export class VeryfrontStrategy implements ImportRewriteStrategy {
|
|
|
36
36
|
return (
|
|
37
37
|
specifier.startsWith("#veryfront/") ||
|
|
38
38
|
specifier.startsWith("veryfront/") ||
|
|
39
|
-
specifier === "veryfront"
|
|
39
|
+
specifier === "veryfront" ||
|
|
40
|
+
specifier === "#deno-config"
|
|
40
41
|
);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
rewrite(info: ImportSpecifierInfo, ctx: RewriteContext): RewriteResult {
|
|
44
45
|
const specifier = info.specifier;
|
|
45
46
|
|
|
47
|
+
// Handle #deno-config — Deno import-map alias that doesn't exist in browsers.
|
|
48
|
+
// Rewrite to a JS module (not JSON) because esbuild strips `with { type: "json" }`
|
|
49
|
+
// at es2020 target and browsers reject JSON MIME without the assertion.
|
|
50
|
+
if (specifier === "#deno-config") {
|
|
51
|
+
return { specifier: "/_vf_modules/_veryfront/_deno-config.js" };
|
|
52
|
+
}
|
|
53
|
+
|
|
46
54
|
// Handle #veryfront/* (internal framework imports)
|
|
47
55
|
if (specifier.startsWith("#veryfront/")) {
|
|
48
56
|
const path = specifier.slice("#veryfront/".length);
|
package/src/src/utils/version.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return typeof denoConfig.version === "string" ? denoConfig.version : "0.0.0";
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// Use deno.json version directly to avoid env access at module load
|
|
8
|
-
export const VERSION: string = getVersionFromDeno();
|
|
1
|
+
// Keep in sync with deno.json version.
|
|
2
|
+
// scripts/release.ts updates this constant during releases.
|
|
3
|
+
export const VERSION = "0.1.59";
|
|
9
4
|
|
|
10
5
|
export const SERVER_START_TIME: number = Date.now();
|
|
11
6
|
|