@nerest/nerest 1.6.0 → 1.7.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/README.md +0 -8
- package/build/configs/shared.ts +0 -3
- package/client/index.ts +0 -8
- package/dist/build/configs/shared.js +0 -1
- package/dist/client/index.js +0 -5
- package/dist/server/hooks/logger.d.ts +1 -1
- package/package.json +19 -19
- package/schemas/nerest-build.schema.d.ts +0 -4
- package/schemas/nerest-build.schema.json +0 -7
package/README.md
CHANGED
|
@@ -121,14 +121,6 @@ Include specified PostCSS plugins in the build by providing their full package n
|
|
|
121
121
|
|
|
122
122
|
In the above example, `postcss-extend` is added to vite's PostCSS configuration with default options, enabling the use of `@extend` rules in CSS code. `postcss-short` is added with specific options provided.
|
|
123
123
|
|
|
124
|
-
#### clientSideEffects: `string[]`
|
|
125
|
-
|
|
126
|
-
List of names of apps that have client side-effects, for example have their own self-initialization code that runs on import. Their entries will be loaded when hydration starts to run side-effect code.
|
|
127
|
-
|
|
128
|
-
```
|
|
129
|
-
"clientSideEffects": ["foo", "bar"]
|
|
130
|
-
```
|
|
131
|
-
|
|
132
124
|
### Runtime
|
|
133
125
|
|
|
134
126
|
If the module `nerest/runtime.ts` exists in the micro frontend's root directory and exports a default function, it will be executed when the server starts. The Fastify app instance will be passed as the function's only argument. Example of `nerest/runtime.ts`:
|
package/build/configs/shared.ts
CHANGED
|
@@ -18,9 +18,6 @@ export async function viteConfigShared({
|
|
|
18
18
|
}: BuildArgs): Promise<InlineConfig> {
|
|
19
19
|
// This will be available to client scripts with import.meta.env
|
|
20
20
|
process.env.NEREST_PROJECT_NAME = project.name;
|
|
21
|
-
process.env.NEREST_CLIENT_SIDE_EFFECTS = JSON.stringify(
|
|
22
|
-
buildConfig?.clientSideEffects ?? []
|
|
23
|
-
);
|
|
24
21
|
|
|
25
22
|
return {
|
|
26
23
|
root,
|
package/client/index.ts
CHANGED
|
@@ -46,11 +46,3 @@ if (document.readyState !== 'complete') {
|
|
|
46
46
|
} else {
|
|
47
47
|
runHydration();
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
// Entries might be self-initializing (e.g. client-only apps) or have other
|
|
51
|
-
// side effects. In that case we have to load them eagerly, so that their
|
|
52
|
-
// initialization code can run, even if there is nothing to hydrate.
|
|
53
|
-
const clientSideEffects: string[] | undefined = JSON.parse(
|
|
54
|
-
import.meta.env.NEREST_CLIENT_SIDE_EFFECTS
|
|
55
|
-
);
|
|
56
|
-
clientSideEffects?.forEach((name) => modules[`/apps/${name}/index.tsx`]?.());
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export async function viteConfigShared({ root, base, buildConfig, project, }) {
|
|
2
2
|
// This will be available to client scripts with import.meta.env
|
|
3
3
|
process.env.NEREST_PROJECT_NAME = project.name;
|
|
4
|
-
process.env.NEREST_CLIENT_SIDE_EFFECTS = JSON.stringify(buildConfig?.clientSideEffects ?? []);
|
|
5
4
|
return {
|
|
6
5
|
root,
|
|
7
6
|
base,
|
package/dist/client/index.js
CHANGED
|
@@ -32,8 +32,3 @@ if (document.readyState !== 'complete') {
|
|
|
32
32
|
else {
|
|
33
33
|
runHydration();
|
|
34
34
|
}
|
|
35
|
-
// Entries might be self-initializing (e.g. client-only apps) or have other
|
|
36
|
-
// side effects. In that case we have to load them eagerly, so that their
|
|
37
|
-
// initialization code can run, even if there is nothing to hydrate.
|
|
38
|
-
const clientSideEffects = JSON.parse(import.meta.env.NEREST_CLIENT_SIDE_EFFECTS);
|
|
39
|
-
clientSideEffects?.forEach((name) => modules[`/apps/${name}/index.tsx`]?.());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function runLoggerHook(loader: () => Promise<unknown>): Promise<boolean | (import("fastify").FastifyLoggerOptions<import("fastify").RawServerDefault, import("fastify").FastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider.js").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>>, import("fastify").FastifyReply<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>> & import("
|
|
1
|
+
export declare function runLoggerHook(loader: () => Promise<unknown>): Promise<boolean | (import("fastify").FastifyLoggerOptions<import("fastify").RawServerDefault, import("fastify").FastifyRequest<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown, import("fastify").FastifyBaseLogger, import("fastify/types/type-provider.js").ResolveFastifyRequestType<import("fastify").FastifyTypeProviderDefault, import("fastify").FastifySchema, import("fastify").RouteGenericInterface>>, import("fastify").FastifyReply<import("fastify").RouteGenericInterface, import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>> & import("pino").LoggerOptions<never, boolean>) | null | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nerest/nerest",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "React micro frontend framework",
|
|
5
5
|
"homepage": "https://github.com/nerestjs/nerest",
|
|
6
6
|
"repository": {
|
|
@@ -49,38 +49,38 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@apidevtools/json-schema-ref-parser": "^14.
|
|
52
|
+
"@apidevtools/json-schema-ref-parser": "^14.2.1",
|
|
53
53
|
"@fastify/middie": "^9.0.3",
|
|
54
54
|
"@fastify/static": "^8.2.0",
|
|
55
|
-
"@fastify/swagger": "^9.5.
|
|
55
|
+
"@fastify/swagger": "^9.5.2",
|
|
56
56
|
"@fastify/swagger-ui": "^5.2.3",
|
|
57
57
|
"ajv": "^8.17.1",
|
|
58
58
|
"ajv-formats": "^3.0.1",
|
|
59
|
-
"dotenv": "^17.
|
|
59
|
+
"dotenv": "^17.2.3",
|
|
60
60
|
"fast-glob": "^3.3.3",
|
|
61
|
-
"fast-uri": "^3.0
|
|
62
|
-
"fastify": "^5.
|
|
63
|
-
"fastify-graceful-shutdown": "^
|
|
61
|
+
"fast-uri": "^3.1.0",
|
|
62
|
+
"fastify": "^5.6.1",
|
|
63
|
+
"fastify-graceful-shutdown": "^5.0.0",
|
|
64
64
|
"json-schema-to-typescript": "^15.0.4",
|
|
65
|
-
"vite": "^7.
|
|
65
|
+
"vite": "^7.1.10",
|
|
66
66
|
"vite-plugin-externals": "^0.6.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@commitlint/cli": "^
|
|
70
|
-
"@commitlint/config-conventional": "^
|
|
71
|
-
"@playwright/test": "^1.
|
|
69
|
+
"@commitlint/cli": "^20.1.0",
|
|
70
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
71
|
+
"@playwright/test": "^1.56.1",
|
|
72
72
|
"@tinkoff/eslint-config": "^5.0.1",
|
|
73
73
|
"@tinkoff/eslint-config-react": "^5.0.1",
|
|
74
74
|
"@tinkoff/prettier-config": "^5.0.0",
|
|
75
|
-
"@types/react": "^19.
|
|
76
|
-
"@types/react-dom": "^19.
|
|
75
|
+
"@types/react": "^19.2.2",
|
|
76
|
+
"@types/react-dom": "^19.2.2",
|
|
77
77
|
"execa": "^9.6.0",
|
|
78
|
-
"lint-staged": "^16.
|
|
79
|
-
"react": "^19.
|
|
80
|
-
"react-dom": "^19.
|
|
81
|
-
"simple-git-hooks": "^2.13.
|
|
82
|
-
"sort-package-json": "^3.
|
|
83
|
-
"typescript": "^5.
|
|
78
|
+
"lint-staged": "^16.2.4",
|
|
79
|
+
"react": "^19.2.0",
|
|
80
|
+
"react-dom": "^19.2.0",
|
|
81
|
+
"simple-git-hooks": "^2.13.1",
|
|
82
|
+
"sort-package-json": "^3.4.0",
|
|
83
|
+
"typescript": "^5.9.3",
|
|
84
84
|
"vitest": "^3.2.4"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
@@ -26,9 +26,5 @@ export interface BuildConfiguration {
|
|
|
26
26
|
};
|
|
27
27
|
[k: string]: unknown;
|
|
28
28
|
};
|
|
29
|
-
/**
|
|
30
|
-
* List of names of apps that have client side-effects, for example have their own self-initialization code that runs on import. Their entries will be loaded when hydration starts to run side-effect code.
|
|
31
|
-
*/
|
|
32
|
-
clientSideEffects?: string[];
|
|
33
29
|
[k: string]: unknown;
|
|
34
30
|
}
|
|
@@ -30,13 +30,6 @@
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
},
|
|
34
|
-
"clientSideEffects": {
|
|
35
|
-
"description": "List of names of apps that have client side-effects, for example have their own self-initialization code that runs on import. Their entries will be loaded when hydration starts to run side-effect code.",
|
|
36
|
-
"type": "array",
|
|
37
|
-
"items": {
|
|
38
|
-
"type": "string"
|
|
39
|
-
}
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
}
|