@common-stack/generate-plugin 6.0.8-alpha.5 → 6.0.8-alpha.50
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 +184 -4
- package/lib/common/package-releases/package.json +26 -0
- package/lib/common/package-releases/package.json.cjs +33 -0
- package/lib/common/package-releases/package.json.cjs.map +1 -0
- package/lib/common/package-releases/package.json.mjs +33 -0
- package/lib/common/package-releases/package.json.mjs.map +1 -0
- package/lib/generators/add-backend/files/Dockerfile +2 -0
- package/lib/generators/add-backend/files/package.json +4 -2
- package/lib/generators/add-backend/files/webpack.config.js +3 -1
- package/lib/generators/add-frontend/frameworks/antui/src/context.tsx.template +8 -0
- package/lib/generators/add-frontend/frameworks/antui/{entry.client.tsx.template → src/entry.client.tsx.template} +12 -12
- package/{src/generators/add-frontend/frameworks/antui → lib/generators/add-frontend/frameworks/antui/src}/entry.server.tsx.template +61 -51
- package/{src/generators/add-frontend/frameworks/antui → lib/generators/add-frontend/frameworks/antui/src}/root.tsx.template +6 -15
- package/lib/generators/add-frontend/frameworks/chakraui/{context.tsx.template → src/context.tsx.template} +6 -0
- package/lib/generators/add-frontend/frameworks/chakraui/{entry.client.tsx.template → src/entry.client.tsx.template} +21 -18
- package/{src/generators/add-frontend/frameworks/chakraui → lib/generators/add-frontend/frameworks/chakraui/src}/entry.server.tsx.template +33 -30
- package/lib/generators/add-frontend/frameworks/chakraui/{root.tsx.template → src/root.tsx.template} +8 -4
- package/{src/generators/add-frontend/frameworks/tailwindui → lib/generators/add-frontend/frameworks/tailwindui/src}/entry.client.tsx.template +3 -10
- package/lib/generators/add-frontend/generator.cjs +83 -36
- package/lib/generators/add-frontend/generator.cjs.map +1 -1
- package/lib/generators/add-frontend/generator.mjs +83 -36
- package/lib/generators/add-frontend/generator.mjs.map +1 -1
- package/lib/generators/add-frontend/templates/Dockerfile +4 -0
- package/lib/generators/add-frontend/templates/package.json +7 -3
- package/lib/generators/add-frontend/templates/vite.config.ts.template +18 -1
- package/lib/generators/add-fullstack/files/Jenkinsfile +2 -2
- package/lib/generators/add-fullstack/files/cdecode-config.json +126 -0
- package/lib/generators/add-fullstack/files/package.json +31 -18
- package/lib/generators/add-fullstack/files/rollup.config.base.mjs +17 -95
- package/lib/generators/add-fullstack/files/tools/codegenGenerator.mjs +36 -0
- package/lib/generators/add-fullstack/generator.cjs +8 -4
- package/lib/generators/add-fullstack/generator.cjs.map +1 -1
- package/lib/generators/add-fullstack/generator.mjs +8 -4
- package/lib/generators/add-fullstack/generator.mjs.map +1 -1
- package/lib/generators/add-fullstack/schema.json +1 -1
- package/lib/generators/add-moleculer/files/Dockerfile +2 -0
- package/lib/generators/add-moleculer/files/config.json +5 -0
- package/lib/generators/add-moleculer/files/package.json +10 -6
- package/lib/generators/add-moleculer/files/rollup.config.mjs +14 -1
- package/package.json +3 -3
- package/rollup.config.mjs +3 -0
- package/src/common/package-releases/package.json +26 -0
- package/src/generators/add-frontend/__snapshots__/generator.test.ts.snap +33 -0
- package/src/generators/add-frontend/frameworks/antui/src/context.tsx.template +8 -0
- package/src/generators/add-frontend/frameworks/antui/{entry.client.tsx.template → src/entry.client.tsx.template} +12 -12
- package/{lib/generators/add-frontend/frameworks/antui → src/generators/add-frontend/frameworks/antui/src}/entry.server.tsx.template +61 -51
- package/{lib/generators/add-frontend/frameworks/antui → src/generators/add-frontend/frameworks/antui/src}/root.tsx.template +6 -15
- package/src/generators/add-frontend/frameworks/chakraui/{context.tsx.template → src/context.tsx.template} +6 -0
- package/src/generators/add-frontend/frameworks/chakraui/{entry.client.tsx.template → src/entry.client.tsx.template} +21 -18
- package/{lib/generators/add-frontend/frameworks/chakraui → src/generators/add-frontend/frameworks/chakraui/src}/entry.server.tsx.template +33 -30
- package/src/generators/add-frontend/frameworks/chakraui/{root.tsx.template → src/root.tsx.template} +8 -4
- package/src/generators/add-frontend/frameworks/tailwindui/postcss.config.js +6 -0
- package/{lib/generators/add-frontend/frameworks/tailwindui → src/generators/add-frontend/frameworks/tailwindui/src}/entry.client.tsx.template +3 -10
- package/src/generators/add-frontend/frameworks/tailwindui/tailwind.config.ts.template +12 -0
- package/src/generators/add-frontend/generator.test.ts +79 -0
- package/src/generators/add-frontend/generator.ts +109 -44
- package/src/generators/add-fullstack/files/Jenkinsfile +2 -2
- package/src/generators/add-fullstack/files/cdecode-config.json +126 -0
- package/src/generators/add-fullstack/files/package.json +31 -18
- package/src/generators/add-fullstack/files/rollup.config.base.mjs +17 -95
- package/src/generators/add-fullstack/files/tools/codegenGenerator.mjs +36 -0
- package/src/generators/add-fullstack/generator.ts +8 -4
- package/src/generators/add-fullstack/schema.json +1 -1
- package/src/generators/add-moleculer/files/.dockerignore +2 -1
- package/src/generators/add-moleculer/files/Dockerfile +2 -0
- package/src/generators/add-moleculer/files/config.json +5 -0
- package/src/generators/add-moleculer/files/package.json +10 -6
- package/src/generators/add-moleculer/files/rollup.config.mjs +14 -1
- package/tsconfig.spec.json +9 -0
- package/docker-releases/backend/package.json +0 -134
- package/docker-releases/frontend/antd/package.json +0 -121
- package/lib/generators/add-fullstack/files/codegen.yml +0 -47
- package/lib/generators/add-moleculer/files/src/modules/module.ts.template +0 -31
- package/src/generators/add-frontend/generator.spec.ts +0 -20
- package/src/generators/add-fullstack/files/codegen.yml +0 -47
- package/src/generators/add-moleculer/files/src/modules/module.ts.template +0 -31
- /package/lib/generators/add-frontend/{templates → frameworks/tailwindui}/postcss.config.js +0 -0
- /package/lib/generators/add-frontend/frameworks/tailwindui/{entry.server.tsx.template → src/entry.server.tsx.template} +0 -0
- /package/lib/generators/add-frontend/frameworks/tailwindui/{root.tsx.template → src/root.tsx.template} +0 -0
- /package/lib/generators/add-frontend/frameworks/tailwindui/{tailwind.css → src/tailwind.css} +0 -0
- /package/lib/generators/add-frontend/{templates → frameworks/tailwindui}/tailwind.config.ts.template +0 -0
- /package/lib/generators/add-frontend/{generator.spec.d.ts → generator.test.d.ts} +0 -0
- /package/src/generators/add-frontend/frameworks/tailwindui/{entry.server.tsx.template → src/entry.server.tsx.template} +0 -0
- /package/src/generators/add-frontend/frameworks/tailwindui/{root.tsx.template → src/root.tsx.template} +0 -0
- /package/src/generators/add-frontend/frameworks/tailwindui/{tailwind.css → src/tailwind.css} +0 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import {__awaiter}from'tslib';import {generateFiles,formatFiles}from'@nx/devkit';import*as path from'path';import*as fs from'fs';import {getValid,isValid}from'../../utils/index.mjs';import {updateJenkinsFile}from'./updates/jenkinsfileUpdate.mjs';import {updatePackageJson,updateRepository}from'./updates/packageJsonUpdate.mjs';import {backupLernaJson,restoreLernaJson}from'./updates/lernaJsonUpdate.mjs';import {updateHtmlPlugin}from'./updates/htmlPluginUpdate.mjs';import {updateLicense}from'./updates/licenseUpdate.mjs';import {backupFiles,restoreFiles}from'./updates/ignoreUpdate.mjs';import {generateFrontend}from'../add-frontend/generator.mjs';import {generateBackend}from'../add-backend/generator.mjs';import {generateMoleculer}from'../add-moleculer/generator.mjs';import {generatePackage}from'../add-package/generator.mjs';import'../../executors/update-deploy-version/executor.mjs';function addFullstackGenerator(tree, options) {
|
|
2
2
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3
3
|
var _a;
|
|
4
|
-
|
|
4
|
+
let projectPath = options.path || '';
|
|
5
|
+
if (projectPath !== '') {
|
|
6
|
+
const basePath = process.cwd();
|
|
7
|
+
projectPath = path.relative(basePath, projectPath);
|
|
8
|
+
}
|
|
5
9
|
const projectName = (_a = getValid(options.name)) !== null && _a !== void 0 ? _a : 'fullstack-pro';
|
|
6
|
-
const projectRoot = path.join(
|
|
7
|
-
console.log(`
|
|
10
|
+
const projectRoot = path.join(projectPath, projectName);
|
|
11
|
+
// console.log(`Project Path: ${projectPath}`);
|
|
8
12
|
// backup existing lerna values
|
|
9
13
|
const lernaBackup = backupLernaJson(tree, projectRoot);
|
|
10
14
|
// backup files codegen.yaml
|
|
@@ -25,7 +29,7 @@ import {__awaiter}from'tslib';import {generateFiles,formatFiles}from'@nx/devkit'
|
|
|
25
29
|
restoreFiles(tree, projectRoot, filesBackup);
|
|
26
30
|
yield formatFiles(tree);
|
|
27
31
|
if (isValid(options.config)) {
|
|
28
|
-
const configPath = path.resolve(
|
|
32
|
+
const configPath = path.resolve(projectPath, getValid(options.config));
|
|
29
33
|
if (fs.existsSync(configPath)) {
|
|
30
34
|
try {
|
|
31
35
|
const configs = JSON.parse(fs.readFileSync(configPath).toString());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.mjs","sources":["../../../src/generators/add-fullstack/generator.ts"],"sourcesContent":[null],"names":[],"mappings":"y3BAyBsB,SAAA,qBAAqB,CAAC,IAAU,EAAE,OAAoC,EAAA;;;AACxF,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"generator.mjs","sources":["../../../src/generators/add-fullstack/generator.ts"],"sourcesContent":[null],"names":[],"mappings":"y3BAyBsB,SAAA,qBAAqB,CAAC,IAAU,EAAE,OAAoC,EAAA;;;AACxF,QAAA,IAAI,WAAW,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;AACrC,QAAA,IAAI,WAAW,KAAK,EAAE,EAAE;AACpB,YAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;YAC/B,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;SACtD;QACD,MAAM,WAAW,GAAG,CAAA,EAAA,GAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,eAAe,CAAC;QAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;;;QAKxD,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;;QAGvD,MAAM,aAAa,GAAG,C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E;QACpB,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;KAC9D;AACL,CAAC,CAAA"}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"path": {
|
|
17
17
|
"type": "string",
|
|
18
18
|
"description": "The base path where the project will be created or updated",
|
|
19
|
-
"x-prompt": "Where do you want to create or update the project? (
|
|
19
|
+
"x-prompt": "Where do you want to create or update the project? (Please provide in absolute path, or leave empty for the current directory)"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"required": ["name"]
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
FROM node:20.16-alpine
|
|
2
2
|
|
|
3
3
|
COPY .npmrc package.json /tmp/
|
|
4
|
+
COPY common /tmp/common
|
|
4
5
|
|
|
5
6
|
RUN set -ex \
|
|
6
7
|
&& apk add --no-cache \
|
|
@@ -13,6 +14,7 @@ RUN set -ex \
|
|
|
13
14
|
&& rm -f /tmp/.npmrc \
|
|
14
15
|
&& mkdir -p /home/app \
|
|
15
16
|
&& cp -a /tmp/node_modules /home/app/ \
|
|
17
|
+
&& cp -a /tmp/common /home/app/common \
|
|
16
18
|
&& rm -Rf /tmp/*
|
|
17
19
|
|
|
18
20
|
WORKDIR /home/app
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"build:clean": "rimraf dist",
|
|
13
13
|
"build:dist": "rollup -c rollup.config.mjs",
|
|
14
14
|
"build:watch": "npm run build:dist -- --watch",
|
|
15
|
-
"
|
|
15
|
+
"copycommon": "cp -r ../../packages/common .",
|
|
16
|
+
"docker:build": "yarn copycommon && npm run build && docker build . -t $npm_package_name:$npm_package_version",
|
|
16
17
|
"docker:run": "docker run -it --env-file ../../config/staging/docker-staging.env $npm_package_name:$npm_package_version",
|
|
17
18
|
"jest": "./node_modules/.bin/jest",
|
|
18
19
|
"start": "cross-env NODE_ENV=production tsx dist/index.js",
|
|
@@ -24,12 +25,15 @@
|
|
|
24
25
|
"test:watch": "npm test -- --watch",
|
|
25
26
|
"watch": "npm run start:dev"
|
|
26
27
|
},
|
|
28
|
+
"resolutions": {
|
|
29
|
+
"common": "link:./common"
|
|
30
|
+
},
|
|
27
31
|
"dependencies": {
|
|
28
|
-
"@common-stack/client-core": "6.0.8-alpha.
|
|
29
|
-
"@common-stack/core": "6.0.8-alpha.
|
|
30
|
-
"@common-stack/server-core": "6.0.8-alpha.
|
|
31
|
-
"@common-stack/server-stack": "6.0.8-alpha.
|
|
32
|
-
"@common-stack/store-mongo": "6.0.8-alpha.
|
|
32
|
+
"@common-stack/client-core": "6.0.8-alpha.31",
|
|
33
|
+
"@common-stack/core": "6.0.8-alpha.31",
|
|
34
|
+
"@common-stack/server-core": "6.0.8-alpha.31",
|
|
35
|
+
"@common-stack/server-stack": "6.0.8-alpha.32",
|
|
36
|
+
"@common-stack/store-mongo": "6.0.8-alpha.31",
|
|
33
37
|
"@container-stack/mailing-api": "5.2.1-alpha.1",
|
|
34
38
|
"helmet": "^3.21.2",
|
|
35
39
|
"react": "18.2.0",
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import graphql from '@rollup/plugin-graphql';
|
|
2
2
|
import typescript from '@rollup/plugin-typescript';
|
|
3
3
|
import { string } from 'rollup-plugin-string';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { writeBackendModuleFile } from '@common-stack/rollup-vite-utils';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
// Write backend module file before bundling
|
|
12
|
+
try {
|
|
13
|
+
const packageConfig = await import('./config.json', { assert: { type: 'json' } });
|
|
14
|
+
await writeBackendModuleFile(path.join(__dirname, 'src/modules'), packageConfig.default);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.error('Error writing backend module file:', e);
|
|
17
|
+
}
|
|
4
18
|
|
|
5
19
|
const bundle = (config) => ({
|
|
6
20
|
...config,
|
|
7
21
|
input: 'src/index.ts',
|
|
8
|
-
// marking all node modules as external
|
|
9
22
|
external: (id) => !/^[./]/.test(id),
|
|
10
23
|
});
|
|
11
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/generate-plugin",
|
|
3
|
-
"version": "6.0.8-alpha.
|
|
3
|
+
"version": "6.0.8-alpha.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"watch": "yarn build:lib:watch"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@common-stack/rollup-vite-utils": "6.0.8-alpha.
|
|
20
|
+
"@common-stack/rollup-vite-utils": "6.0.8-alpha.48",
|
|
21
21
|
"tslib": "^2.3.0"
|
|
22
22
|
},
|
|
23
23
|
"publishConfig": {
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
},
|
|
26
26
|
"executors": "./executors.json",
|
|
27
27
|
"generators": "./generators.json",
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "84917a1ffbeda2933b7d5fa3f2781c70e1af4bb9"
|
|
29
29
|
}
|
package/rollup.config.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import image from '@rollup/plugin-image';
|
|
|
3
3
|
import typescript from '@rollup/plugin-typescript';
|
|
4
4
|
import { string } from 'rollup-plugin-string';
|
|
5
5
|
import copy from 'rollup-plugin-copy';
|
|
6
|
+
import json from '@rollup/plugin-json';
|
|
6
7
|
|
|
7
8
|
// Define a base configuration for reuse
|
|
8
9
|
const baseConfig = {
|
|
@@ -18,6 +19,7 @@ const baseConfig = {
|
|
|
18
19
|
include: '**/*.graphql',
|
|
19
20
|
exclude: ['src/generators'],
|
|
20
21
|
}),
|
|
22
|
+
json(),
|
|
21
23
|
typescript({
|
|
22
24
|
noEmitOnError: true,
|
|
23
25
|
exclude: ['src/generators'],
|
|
@@ -37,6 +39,7 @@ const baseConfig = {
|
|
|
37
39
|
{ src: 'src/generators/add-package/files/*', dest: 'lib/generators/add-package/files' },
|
|
38
40
|
{ src: 'src/executors/update-deploy-version/schema.json', dest: 'lib/executors/update-deploy-version' },
|
|
39
41
|
{ src: 'src/executors/sort-package-json/schema.json', dest: 'lib/executors/sort-package-json' },
|
|
42
|
+
{ src: 'src/common/package-releases/package.json', dest: 'lib/common/package-releases' },
|
|
40
43
|
],
|
|
41
44
|
verbose: false,
|
|
42
45
|
}),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sample-stack-frontend-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"resolutions": {
|
|
6
|
+
"common": "link:./common"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@admin-layout/ant-design-pro": "10.0.2-alpha.4",
|
|
10
|
+
"@ant-design/static-style-extract": "^1.0.3",
|
|
11
|
+
"@chakra-ui/react": "^2.8.0",
|
|
12
|
+
"@emotion/css": "^11.13.5",
|
|
13
|
+
"@emotion/react": "^11.14.0",
|
|
14
|
+
"@emotion/server": "^11.11.0",
|
|
15
|
+
"@emotion/styled": "^11.14.0",
|
|
16
|
+
"antd": "^5.23.4",
|
|
17
|
+
"autoprefixer": "^10.4.20",
|
|
18
|
+
"framer-motion": "^12.4.1",
|
|
19
|
+
"postcss": "^8.5.1",
|
|
20
|
+
"tailwindcss": "^4.0.4"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"body-parser": "*"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`addFrontendGenerator should add missing dependencies and update config.json for antui 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@admin-layout/ant-design-pro": "10.0.2-alpha.4",
|
|
7
|
+
"@ant-design/static-style-extract": "^1.0.3",
|
|
8
|
+
"@emotion/css": "^11.13.5",
|
|
9
|
+
"@emotion/react": "^11.14.0",
|
|
10
|
+
"@emotion/server": "^11.11.0",
|
|
11
|
+
"@emotion/styled": "^11.14.0",
|
|
12
|
+
"antd": "^5.23.4",
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {},
|
|
15
|
+
"name": "frontend-demo-server",
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
exports[`addFrontendGenerator should not override an already existing dependency version 1`] = `
|
|
20
|
+
{
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@admin-layout/ant-design-pro": "10.0.2-alpha.4",
|
|
23
|
+
"@ant-design/static-style-extract": "^1.0.3",
|
|
24
|
+
"@emotion/css": "^11.13.5",
|
|
25
|
+
"@emotion/react": "^11.14.0",
|
|
26
|
+
"@emotion/server": "^11.11.0",
|
|
27
|
+
"@emotion/styled": "^11.14.0",
|
|
28
|
+
"antd": "1.0.0",
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {},
|
|
31
|
+
"name": "frontend-demo-server",
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
@@ -13,8 +13,6 @@ import { ApolloProvider } from '@apollo/client/index.js';
|
|
|
13
13
|
import { SlotFillProvider, removeUniversalPortals } from '@common-stack/components-pro';
|
|
14
14
|
import { InversifyProvider } from '@common-stack/client-react';
|
|
15
15
|
import { Provider as ReduxProvider } from 'react-redux';
|
|
16
|
-
import { PersistGate } from 'redux-persist/integration/react';
|
|
17
|
-
import { persistStore } from 'redux-persist';
|
|
18
16
|
import { CacheProvider } from '@emotion/react';
|
|
19
17
|
import i18next from 'i18next';
|
|
20
18
|
import { I18nextProvider, initReactI18next } from 'react-i18next';
|
|
@@ -32,16 +30,22 @@ import clientModules from '@app/frontend-stack-react/modules.js';
|
|
|
32
30
|
import createEmotionCache from '@app/frontend-stack-react/entries/common/createEmotionCache.js';
|
|
33
31
|
// @ts-ignore
|
|
34
32
|
import config from '@app/cde-webconfig.json';
|
|
33
|
+
import { LocaleContext } from './context';
|
|
35
34
|
|
|
36
35
|
const { apolloClient: client, container, serviceFunc } = createClientContainer();
|
|
37
36
|
const { store } = createReduxStore(client, serviceFunc(), container);
|
|
38
|
-
const persistor = persistStore(store);
|
|
39
37
|
const antCache = createCache();
|
|
40
38
|
const cache = createEmotionCache();
|
|
41
39
|
|
|
42
40
|
(window as any).__remixStore = store;
|
|
43
41
|
removeUniversalPortals((window as any).__SLOT_FILLS__ || []);
|
|
44
42
|
|
|
43
|
+
function LocaleProvider({ children }: any) {
|
|
44
|
+
const locale = (window as any).__LOCALE__ || '';
|
|
45
|
+
|
|
46
|
+
return <LocaleContext.Provider value={locale}>{children}</LocaleContext.Provider>;
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
async function hydrate() {
|
|
46
50
|
if (!i18next.isInitialized && config.i18n.enabled) {
|
|
47
51
|
await i18next
|
|
@@ -66,25 +70,21 @@ async function hydrate() {
|
|
|
66
70
|
document,
|
|
67
71
|
(
|
|
68
72
|
<I18nextProvider i18n={i18next}>
|
|
69
|
-
<
|
|
73
|
+
<LocaleProvider>
|
|
70
74
|
<CacheProvider value={cache}>
|
|
71
75
|
<StyleProvider cache={antCache}>
|
|
72
76
|
<ReduxProvider store={store}>
|
|
73
77
|
<SlotFillProvider>
|
|
74
78
|
<InversifyProvider container={container} modules={clientModules}>
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<RemixBrowser />
|
|
79
|
-
</ApolloProvider>
|
|
80
|
-
)}
|
|
81
|
-
</PersistGate>
|
|
79
|
+
<ApolloProvider client={client}>
|
|
80
|
+
<RemixBrowser />
|
|
81
|
+
</ApolloProvider>
|
|
82
82
|
</InversifyProvider>
|
|
83
83
|
</SlotFillProvider>
|
|
84
84
|
</ReduxProvider>
|
|
85
85
|
</StyleProvider>
|
|
86
86
|
</CacheProvider>
|
|
87
|
-
</
|
|
87
|
+
</LocaleProvider>
|
|
88
88
|
</I18nextProvider>
|
|
89
89
|
) as any,
|
|
90
90
|
);
|
|
@@ -27,10 +27,14 @@ import Backend from 'i18next-fs-backend';
|
|
|
27
27
|
import { resolve } from 'node:path';
|
|
28
28
|
// @ts-ignore
|
|
29
29
|
import { i18nextInstance as i18next } from '@app/frontend-stack-react/i18n-localization/i18next.server.js';
|
|
30
|
+
// @ts-ignore
|
|
30
31
|
import config from '@app/cde-webconfig.json';
|
|
31
32
|
// @ts-ignore
|
|
32
33
|
import createEmotionCache from '@app/frontend-stack-react/entries/common/createEmotionCache';
|
|
33
34
|
import type { IAppLoadContext } from '@common-stack/client-core';
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
import publicEnv from '@src/config/public-config';
|
|
37
|
+
import { LocaleContext } from './context';
|
|
34
38
|
|
|
35
39
|
const ABORT_DELAY = 5_000;
|
|
36
40
|
const antdCache = createAntdCache();
|
|
@@ -41,18 +45,23 @@ class ConstantsTransform extends Transform {
|
|
|
41
45
|
_apolloState: any;
|
|
42
46
|
_reduxState: any;
|
|
43
47
|
_styleSheet: string;
|
|
48
|
+
_lng: string;
|
|
44
49
|
|
|
45
|
-
constructor(fills: string[], apolloState: any, reduxState: any, styleSheet: any) {
|
|
50
|
+
constructor(fills: string[], apolloState: any, reduxState: any, styleSheet: any, lng: string) {
|
|
46
51
|
super();
|
|
47
52
|
this._fills = fills;
|
|
48
53
|
this._apolloState = apolloState;
|
|
49
54
|
this._reduxState = reduxState;
|
|
50
55
|
this._styleSheet = styleSheet;
|
|
56
|
+
this._lng = lng;
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
_transform(chunk, encoding, callback) {
|
|
54
60
|
let transformedChunk = chunk.toString();
|
|
55
61
|
|
|
62
|
+
if (transformedChunk.includes('[__ENV__]')) {
|
|
63
|
+
transformedChunk = transformedChunk.replace('[__ENV__]', JSON.stringify(publicEnv));
|
|
64
|
+
}
|
|
56
65
|
if (transformedChunk.includes('[__APOLLO_STATE__]')) {
|
|
57
66
|
transformedChunk = transformedChunk.replace(
|
|
58
67
|
'[__APOLLO_STATE__]',
|
|
@@ -71,6 +80,9 @@ class ConstantsTransform extends Transform {
|
|
|
71
80
|
if (transformedChunk.includes('[__STYLESHEET__]')) {
|
|
72
81
|
transformedChunk = transformedChunk.replace('[__STYLESHEET__]', this._styleSheet);
|
|
73
82
|
}
|
|
83
|
+
if (transformedChunk.includes('[__LOCALE__]')) {
|
|
84
|
+
transformedChunk = transformedChunk.replace('[__LOCALE__]', `"${this._lng}"`);
|
|
85
|
+
}
|
|
74
86
|
|
|
75
87
|
callback(null, transformedChunk);
|
|
76
88
|
}
|
|
@@ -86,32 +98,9 @@ export default async function handleRequest(
|
|
|
86
98
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
87
99
|
loadContext: IAppLoadContext,
|
|
88
100
|
) {
|
|
89
|
-
const instance = createInstance();
|
|
90
|
-
const lng = await i18next.getLocale(request);
|
|
91
|
-
const ns = i18next.getRouteNamespaces(remixContext);
|
|
92
|
-
|
|
93
|
-
// First, we create a new instance of i18next so every request will have a
|
|
94
|
-
// completely unique instance and not share any state.
|
|
95
|
-
if (config.i18n.enabled) {
|
|
96
|
-
await instance
|
|
97
|
-
.use(initReactI18next) // Tell our instance to use react-i18next
|
|
98
|
-
.use(Backend) // Setup our backend.init({
|
|
99
|
-
.init({
|
|
100
|
-
fallbackLng: config.i18n.fallbackLng,
|
|
101
|
-
defaultNS: config.i18n.defaultNS,
|
|
102
|
-
react: config.i18n.react,
|
|
103
|
-
supportedLngs: config.i18n.supportedLngs,
|
|
104
|
-
lng, // The locale we detected above
|
|
105
|
-
ns, // The namespaces the routes about to render want to use
|
|
106
|
-
backend: {
|
|
107
|
-
loadPath: resolve(config.i18n.backend.loadServerPath),
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
101
|
return isbot(request.headers.get('user-agent') || '')
|
|
113
|
-
? handleBotRequest(request, responseStatusCode, responseHeaders, remixContext, loadContext
|
|
114
|
-
: handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext, loadContext
|
|
102
|
+
? handleBotRequest(request, responseStatusCode, responseHeaders, remixContext, loadContext)
|
|
103
|
+
: handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext, loadContext);
|
|
115
104
|
}
|
|
116
105
|
|
|
117
106
|
function handleBotRequest(
|
|
@@ -120,14 +109,11 @@ function handleBotRequest(
|
|
|
120
109
|
responseHeaders: Headers,
|
|
121
110
|
remixContext: EntryContext,
|
|
122
111
|
loadContext: IAppLoadContext,
|
|
123
|
-
i18nInstance: i18next,
|
|
124
112
|
) {
|
|
125
113
|
return new Promise((resolve, reject) => {
|
|
126
114
|
let shellRendered = false;
|
|
127
115
|
const { pipe, abort } = renderToPipeableStream(
|
|
128
|
-
<
|
|
129
|
-
<RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />
|
|
130
|
-
</I18nextProvider>,
|
|
116
|
+
<RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />,
|
|
131
117
|
{
|
|
132
118
|
onAllReady() {
|
|
133
119
|
shellRendered = true;
|
|
@@ -164,14 +150,36 @@ function handleBotRequest(
|
|
|
164
150
|
});
|
|
165
151
|
}
|
|
166
152
|
|
|
167
|
-
function handleBrowserRequest(
|
|
153
|
+
async function handleBrowserRequest(
|
|
168
154
|
request: Request,
|
|
169
155
|
responseStatusCode: number,
|
|
170
156
|
responseHeaders: Headers,
|
|
171
157
|
remixContext: EntryContext,
|
|
172
158
|
loadContext: IAppLoadContext,
|
|
173
|
-
i18nInstance: i18next,
|
|
174
159
|
) {
|
|
160
|
+
const instance = createInstance();
|
|
161
|
+
const lng = await i18next.getLocale(request);
|
|
162
|
+
const ns = i18next.getRouteNamespaces(remixContext);
|
|
163
|
+
|
|
164
|
+
// First, we create a new instance of i18next so every request will have a
|
|
165
|
+
// completely unique instance and not share any state.
|
|
166
|
+
if (config.i18n.enabled) {
|
|
167
|
+
await instance
|
|
168
|
+
.use(initReactI18next) // Tell our instance to use react-i18next
|
|
169
|
+
.use(Backend) // Setup our backend.init({
|
|
170
|
+
.init({
|
|
171
|
+
fallbackLng: config.i18n.fallbackLng,
|
|
172
|
+
defaultNS: config.i18n.defaultNS,
|
|
173
|
+
react: config.i18n.react,
|
|
174
|
+
supportedLngs: config.i18n.supportedLngs,
|
|
175
|
+
lng, // The locale we detected above
|
|
176
|
+
ns, // The namespaces the routes about to render want to use
|
|
177
|
+
backend: {
|
|
178
|
+
loadPath: resolve(config.i18n.backend.loadServerPath),
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
175
183
|
return new Promise((resolve, reject) => {
|
|
176
184
|
let shellRendered = false;
|
|
177
185
|
const slotFillContext = { fills: {} };
|
|
@@ -190,24 +198,26 @@ function handleBrowserRequest(
|
|
|
190
198
|
|
|
191
199
|
const { pipe, abort } = renderToPipeableStream(
|
|
192
200
|
(
|
|
193
|
-
<I18nextProvider i18n={
|
|
194
|
-
<
|
|
195
|
-
<
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
<
|
|
199
|
-
<
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
201
|
+
<I18nextProvider i18n={instance}>
|
|
202
|
+
<LocaleContext.Provider value={lng}>
|
|
203
|
+
<CacheProvider value={cache}>
|
|
204
|
+
<StyleProvider cache={antdCache}>
|
|
205
|
+
<ReduxProvider store={store}>
|
|
206
|
+
<SlotFillProvider context={slotFillContext}>
|
|
207
|
+
<InversifyProvider container={container} modules={clientModules as any}>
|
|
208
|
+
<ApolloProvider client={client}>
|
|
209
|
+
<RemixServer
|
|
210
|
+
context={remixContext}
|
|
211
|
+
url={request.url}
|
|
212
|
+
abortDelay={ABORT_DELAY}
|
|
213
|
+
/>
|
|
214
|
+
</ApolloProvider>
|
|
215
|
+
</InversifyProvider>
|
|
216
|
+
</SlotFillProvider>
|
|
217
|
+
</ReduxProvider>
|
|
218
|
+
</StyleProvider>
|
|
219
|
+
</CacheProvider>
|
|
220
|
+
</LocaleContext.Provider>
|
|
211
221
|
</I18nextProvider>
|
|
212
222
|
) as any,
|
|
213
223
|
{
|
|
@@ -220,7 +230,7 @@ function handleBrowserRequest(
|
|
|
220
230
|
const fills = Object.keys(slotFillContext.fills);
|
|
221
231
|
const styleSheet = extractStyle(antdCache);
|
|
222
232
|
|
|
223
|
-
const transform = new ConstantsTransform(fills, apolloState, reduxState, styleSheet);
|
|
233
|
+
const transform = new ConstantsTransform(fills, apolloState, reduxState, styleSheet, lng);
|
|
224
234
|
|
|
225
235
|
responseHeaders.set('Content-Type', 'text/html');
|
|
226
236
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData, useRouteError, json } from '@remix-run/react';
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
import publicEnv from '@src/config/public-config';
|
|
6
4
|
import { PluginArea } from '@common-stack/client-react';
|
|
7
5
|
import { subscribeReduxRouter } from '@common-stack/remix-router-redux';
|
|
8
6
|
import { ApplicationErrorHandler } from '@admin-layout/ant-ui';
|
|
@@ -13,17 +11,8 @@ import clientModules, { plugins } from '@app/frontend-stack-react/modules.js';
|
|
|
13
11
|
import { useChangeLanguage } from 'remix-i18next/react';
|
|
14
12
|
import { useTranslation } from 'react-i18next';
|
|
15
13
|
// @ts-ignore
|
|
16
|
-
import { i18nextInstance as i18next } from '@app/frontend-stack-react/i18n-localization/i18next.server.js';
|
|
17
|
-
// @ts-ignore
|
|
18
14
|
import { ErrorBoundary } from '@app/frontend-stack-react/entries/antui/components/ErrorBoundary';
|
|
19
|
-
|
|
20
|
-
export const loader = async ({ request }) => {
|
|
21
|
-
const locale = await i18next.getLocale(request);
|
|
22
|
-
return json({
|
|
23
|
-
__ENV__: publicEnv,
|
|
24
|
-
locale,
|
|
25
|
-
});
|
|
26
|
-
};
|
|
15
|
+
import { LocaleContext } from './context';
|
|
27
16
|
|
|
28
17
|
export const handle = {
|
|
29
18
|
i18n: 'common',
|
|
@@ -34,8 +23,8 @@ export function shouldRevalidate(params: any) {
|
|
|
34
23
|
}
|
|
35
24
|
|
|
36
25
|
export function Layout({ children }: { children: React.ReactNode }) {
|
|
37
|
-
const data = useRouteLoaderData<{ locale: any }>('root');
|
|
38
|
-
const locale =
|
|
26
|
+
// const data = useRouteLoaderData<{ locale: any }>('root');
|
|
27
|
+
const locale: any = React.useContext(LocaleContext);
|
|
39
28
|
|
|
40
29
|
const { i18n } = useTranslation();
|
|
41
30
|
|
|
@@ -49,9 +38,10 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
49
38
|
if (typeof window === 'undefined') {
|
|
50
39
|
return (
|
|
51
40
|
<>
|
|
41
|
+
<script>window.__ENV__=[__ENV__]</script>
|
|
52
42
|
<script
|
|
53
43
|
dangerouslySetInnerHTML={{
|
|
54
|
-
__html: `window.
|
|
44
|
+
__html: `window.process = {} `,
|
|
55
45
|
}}
|
|
56
46
|
/>
|
|
57
47
|
<script
|
|
@@ -68,6 +58,7 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
68
58
|
__html: `if (global === undefined) { var global = window; }`,
|
|
69
59
|
}}
|
|
70
60
|
/>
|
|
61
|
+
<script>window.__LOCALE__=[__LOCALE__]</script>
|
|
71
62
|
</>
|
|
72
63
|
);
|
|
73
64
|
}
|
|
@@ -18,3 +18,9 @@ export interface ClientStyleContextData {
|
|
|
18
18
|
export const ClientStyleContext = createContext<ClientStyleContextData | null>(
|
|
19
19
|
null,
|
|
20
20
|
);
|
|
21
|
+
|
|
22
|
+
export interface LocaleContextData {
|
|
23
|
+
locale: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const LocaleContext = createContext<LocaleContextData | null>(null);
|