veryfront 0.1.1007 → 0.1.1008
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/cli/commands/init/config-generator.d.ts.map +1 -1
- package/esm/cli/commands/init/config-generator.js +10 -1
- package/esm/deno.js +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.d.ts.map +1 -1
- package/esm/src/routing/api/module-loader/esbuild-plugin.js +24 -9
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/config-generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/init/config-generator.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC1C,CAAC,CAAC;CACJ;AAED,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CA+Df"}
|
|
@@ -3,6 +3,12 @@ import { join } from "../../../src/platform/compat/path/index.js";
|
|
|
3
3
|
import { createFileSystem } from "../../../src/platform/index.js";
|
|
4
4
|
// Keep init scaffold aligned with current framework default React major/minor.
|
|
5
5
|
const DEFAULT_INIT_REACT_VERSION = "19.2.4";
|
|
6
|
+
const REQUIRED_INIT_EXTENSION_PACKAGES = [
|
|
7
|
+
"@veryfront/ext-bundler-esbuild",
|
|
8
|
+
"@veryfront/ext-content-mdx",
|
|
9
|
+
"@veryfront/ext-css-tailwind",
|
|
10
|
+
"@veryfront/ext-parser-babel",
|
|
11
|
+
];
|
|
6
12
|
export async function createPackageJson(projectDir, projectName, options = {}) {
|
|
7
13
|
const fs = createFileSystem();
|
|
8
14
|
// Read any existing package.json (e.g. from template) to merge dependencies
|
|
@@ -26,6 +32,8 @@ export async function createPackageJson(projectDir, projectName, options = {}) {
|
|
|
26
32
|
}
|
|
27
33
|
}
|
|
28
34
|
const dirName = projectDir.split(/[/\\]/).pop();
|
|
35
|
+
const veryfrontVersionRange = `^${VERSION}`;
|
|
36
|
+
const requiredExtensionDeps = Object.fromEntries(REQUIRED_INIT_EXTENSION_PACKAGES.map((packageName) => [packageName, veryfrontVersionRange]));
|
|
29
37
|
const packageJson = {
|
|
30
38
|
name: projectName ?? dirName ?? "veryfront-project",
|
|
31
39
|
version: "0.1.0",
|
|
@@ -41,9 +49,10 @@ export async function createPackageJson(projectDir, projectName, options = {}) {
|
|
|
41
49
|
dependencies: {
|
|
42
50
|
...templateDeps,
|
|
43
51
|
...integrationDeps,
|
|
52
|
+
...requiredExtensionDeps,
|
|
44
53
|
react: `^${DEFAULT_INIT_REACT_VERSION}`,
|
|
45
54
|
"react-dom": `^${DEFAULT_INIT_REACT_VERSION}`,
|
|
46
|
-
veryfront:
|
|
55
|
+
veryfront: veryfrontVersionRange,
|
|
47
56
|
zod: "^3.24.0",
|
|
48
57
|
},
|
|
49
58
|
};
|
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"esbuild-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/src/routing/api/module-loader/esbuild-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAO5E,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA8GD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,EAAE,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"esbuild-plugin.d.ts","sourceRoot":"","sources":["../../../../../src/src/routing/api/module-loader/esbuild-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAO5E,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA8GD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,EAAE,GAAG,MAAM,CA6Q9E"}
|
|
@@ -104,6 +104,25 @@ export function createHTTPPlugin(options) {
|
|
|
104
104
|
function delay(ms) {
|
|
105
105
|
return new Promise((resolve) => dntShim.setTimeout(resolve, ms));
|
|
106
106
|
}
|
|
107
|
+
function describePersistenceError(error) {
|
|
108
|
+
if (!(error instanceof Error))
|
|
109
|
+
return typeof error;
|
|
110
|
+
const code = error.code;
|
|
111
|
+
const name = error.name || "Error";
|
|
112
|
+
return typeof code === "string" && code ? `${name}(${code})` : name;
|
|
113
|
+
}
|
|
114
|
+
async function persistLockfileEntry(url, entry) {
|
|
115
|
+
if (!lockfile)
|
|
116
|
+
return;
|
|
117
|
+
try {
|
|
118
|
+
await lockfile.set(url, entry);
|
|
119
|
+
await lockfile.flush();
|
|
120
|
+
logger.debug(`[http] lockfile updated: ${url} -> ${entry.resolved}`);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
logger.warn(`[http] could not persist lockfile entry for ${url}: ${describePersistenceError(error)}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
107
126
|
async function fetchRemoteModule(url) {
|
|
108
127
|
for (let attempt = 1; attempt <= HTTP_MODULE_FETCH_MAX_ATTEMPTS; attempt += 1) {
|
|
109
128
|
const response = await fetchWithTimeout(url).catch((error) => new Response(String(error?.message ?? error), {
|
|
@@ -252,15 +271,11 @@ export function createHTTPPlugin(options) {
|
|
|
252
271
|
const text = await res.text();
|
|
253
272
|
const resolvedUrl = res.url || requestUrl;
|
|
254
273
|
const integrity = await computeIntegrity(text);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
});
|
|
261
|
-
await lockfile.flush();
|
|
262
|
-
logger.debug(`[http] lockfile updated: ${args.path} -> ${resolvedUrl}`);
|
|
263
|
-
}
|
|
274
|
+
await persistLockfileEntry(args.path, {
|
|
275
|
+
resolved: resolvedUrl,
|
|
276
|
+
integrity,
|
|
277
|
+
fetchedAt: new Date().toISOString(),
|
|
278
|
+
});
|
|
264
279
|
await moduleCache?.write(args.path, text, resolvedUrl, integrity);
|
|
265
280
|
await moduleCache?.write(requestUrl, text, resolvedUrl, integrity);
|
|
266
281
|
await moduleCache?.write(resolvedUrl, text, resolvedUrl, integrity);
|