dinou 5.0.2 → 5.1.0
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/CHANGELOG.md +22 -0
- package/README.md +67 -4
- package/dinou/core/babel-esm-loader.js +48 -1
- package/dinou/core/build-static-pages.js +120 -4
- package/dinou/core/cache-revalidate.js +145 -0
- package/dinou/core/client-error-webpack.jsx +194 -23
- package/dinou/core/client-error.jsx +194 -23
- package/dinou/core/client-webpack.jsx +111 -2
- package/dinou/core/client.jsx +111 -2
- package/dinou/core/generate-static-page.js +2 -1
- package/dinou/core/generate-static-pages.js +1 -0
- package/dinou/core/generate-static-rsc.js +1 -2
- package/dinou/core/path-utils.js +10 -0
- package/dinou/core/server.js +101 -40
- package/dinou/esbuild/helpers-esbuild/get-config-esbuild-prod.mjs +3 -0
- package/dinou/package.json +6 -1
- package/dinou/server.d.ts +12 -0
- package/dinou/server.js +10 -0
- package/dinou/server.mjs +9 -0
- package/dinou/webpack/loaders/server-functions-loader.js +6 -1
- package/dinou/webpack/plugins/manifest-generator-plugin.js +1 -1
- package/dinou/webpack/webpack.config.js +12 -1
- package/package.json +1 -1
package/dinou/server.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export async function revalidatePath(path) {
|
|
2
|
+
const { revalidatePath: fn } = await import("./core/cache-revalidate.js");
|
|
3
|
+
return fn(path);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export async function revalidateTag(tag) {
|
|
7
|
+
const { revalidateTag: fn } = await import("./core/cache-revalidate.js");
|
|
8
|
+
return fn(tag);
|
|
9
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
+
|
|
3
|
+
const { normalizePathCase } = require("../../core/path-utils.js");
|
|
2
4
|
const parseExports = require("../../core/parse-exports.js");
|
|
3
5
|
const { useServerRegex } = require("../../constants.js");
|
|
4
6
|
|
|
@@ -16,7 +18,10 @@ module.exports = function (source) {
|
|
|
16
18
|
|
|
17
19
|
// Build IDs
|
|
18
20
|
const moduleId = this.resourcePath;
|
|
19
|
-
const relativePath = path.relative(
|
|
21
|
+
const relativePath = path.relative(
|
|
22
|
+
normalizePathCase(process.cwd()),
|
|
23
|
+
normalizePathCase(moduleId)
|
|
24
|
+
);
|
|
20
25
|
const normalizedPath = relativePath.replace(/\\/g, "/");
|
|
21
26
|
|
|
22
27
|
const fileUrl = `file:///${normalizedPath}`;
|
|
@@ -14,7 +14,7 @@ class ManifestGeneratorPlugin {
|
|
|
14
14
|
compilation.hooks.processAssets.tap(
|
|
15
15
|
{
|
|
16
16
|
name: pluginName,
|
|
17
|
-
stage: Compilation.
|
|
17
|
+
stage: Compilation.PROCESS_ASSETS_STAGE_ANALYSE,
|
|
18
18
|
},
|
|
19
19
|
(assets) => {
|
|
20
20
|
// Traverse chunks to generate manifest
|
|
@@ -45,7 +45,17 @@ const outputDirs = [
|
|
|
45
45
|
|
|
46
46
|
function cleanDir(dir) {
|
|
47
47
|
if (fs.existsSync(dir)) {
|
|
48
|
-
|
|
48
|
+
try {
|
|
49
|
+
const files = fs.readdirSync(dir);
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const fullPath = path.join(dir, file);
|
|
52
|
+
fs.rmSync(fullPath, { recursive: true, force: true });
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
try {
|
|
56
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
57
|
+
} catch (err) {}
|
|
58
|
+
}
|
|
49
59
|
}
|
|
50
60
|
}
|
|
51
61
|
|
|
@@ -61,6 +71,7 @@ module.exports = async () => {
|
|
|
61
71
|
maxEntrypointSize: 512000,
|
|
62
72
|
maxAssetSize: 512000,
|
|
63
73
|
},
|
|
74
|
+
cache: false,
|
|
64
75
|
mode: isDevelopment ? "development" : "production",
|
|
65
76
|
entry: {
|
|
66
77
|
main: [path.resolve(__dirname, "../core/client-webpack.jsx")].filter(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinou",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Lightweight-Ejectable Full-Stack React 19 Framework with support for React Server Components (RSC), Server Functions, Server-Side Rendering (SSR), Static Generation (SSG), Incremental Static Generation (ISG), and Incremental Static Regeneration (ISR)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|