@common-stack/generate-plugin 6.0.6-alpha.5 → 6.0.6-alpha.53
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 +186 -0
- package/README.md +156 -210
- package/cde-config.json +43 -42
- package/generators.json +5 -0
- package/lib/{constants/index.cjs → common/constants.cjs} +1 -1
- package/lib/common/constants.cjs.map +1 -0
- package/lib/{constants/index.mjs → common/constants.mjs} +1 -1
- package/lib/common/constants.mjs.map +1 -0
- package/lib/generators/add-backend/files/package.json +5 -4
- package/lib/generators/add-backend/files/src/api/root-schema.graphqls +1 -7
- package/lib/generators/add-backend/generator.cjs +12 -3
- package/lib/generators/add-backend/generator.cjs.map +1 -1
- package/lib/generators/add-backend/generator.mjs +12 -3
- package/lib/generators/add-backend/generator.mjs.map +1 -1
- package/lib/generators/add-backend/schema.json +6 -1
- package/lib/generators/add-frontend/frameworks/antui/root.tsx.template +2 -2
- package/lib/generators/add-frontend/frameworks/chakraui/root.tsx.template +4 -3
- package/lib/generators/add-frontend/frameworks/tailwindui/root.tsx.template +2 -2
- package/lib/generators/add-frontend/generator.cjs +18 -14
- package/lib/generators/add-frontend/generator.cjs.map +1 -1
- package/lib/generators/add-frontend/generator.mjs +13 -9
- package/lib/generators/add-frontend/generator.mjs.map +1 -1
- package/lib/generators/add-frontend/schema.json +8 -3
- package/lib/generators/add-frontend/templates/package.json +6 -8
- package/lib/generators/add-frontend/templates/tools/checkQueryUsage.mjs +192 -0
- package/lib/generators/add-frontend/templates/tools/mergeConfig.js +3 -0
- package/lib/generators/add-frontend/templates/vite.config.ts.template +53 -32
- package/lib/generators/add-fullstack/files/Jenkinsfile +7 -7
- package/lib/generators/add-fullstack/files/package.json +16 -13
- package/lib/generators/add-fullstack/files/tools/html-plugin-template.ejs +28 -0
- package/lib/generators/add-fullstack/files/tools/update-dependencies.mjs +95 -63
- package/lib/generators/add-fullstack/generator.cjs +39 -30
- package/lib/generators/add-fullstack/generator.cjs.map +1 -1
- package/lib/generators/add-fullstack/generator.mjs +39 -30
- package/lib/generators/add-fullstack/generator.mjs.map +1 -1
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.cjs +8 -0
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.d.ts +2 -0
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.mjs +8 -0
- package/lib/generators/add-fullstack/updates/htmlPluginUpdate.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/ignoreUpdate.cjs +19 -0
- package/lib/generators/add-fullstack/updates/ignoreUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/ignoreUpdate.d.ts +3 -0
- package/lib/generators/add-fullstack/updates/ignoreUpdate.mjs +19 -0
- package/lib/generators/add-fullstack/updates/ignoreUpdate.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/index.d.ts +4 -0
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.cjs +5 -4
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.cjs.map +1 -1
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.d.ts +2 -1
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.mjs +5 -4
- package/lib/generators/add-fullstack/updates/jenkinsfileUpdate.mjs.map +1 -1
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.cjs +45 -0
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.d.ts +3 -0
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.mjs +45 -0
- package/lib/generators/add-fullstack/updates/lernaJsonUpdate.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/licenseUpdate.cjs +19 -0
- package/lib/generators/add-fullstack/updates/licenseUpdate.cjs.map +1 -0
- package/lib/generators/add-fullstack/updates/licenseUpdate.d.ts +2 -0
- package/lib/generators/add-fullstack/updates/licenseUpdate.mjs +19 -0
- package/lib/generators/add-fullstack/updates/licenseUpdate.mjs.map +1 -0
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.cjs +38 -4
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.cjs.map +1 -1
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.d.ts +2 -1
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.mjs +38 -4
- package/lib/generators/add-fullstack/updates/packageJsonUpdate.mjs.map +1 -1
- package/lib/generators/add-moleculer/files/charts/chart/Chart.yaml +1 -1
- package/lib/generators/add-moleculer/files/package.json +5 -5
- package/lib/generators/add-moleculer/generator.cjs +7 -4
- package/lib/generators/add-moleculer/generator.cjs.map +1 -1
- package/lib/generators/add-moleculer/generator.mjs +7 -4
- package/lib/generators/add-moleculer/generator.mjs.map +1 -1
- package/lib/generators/add-moleculer/schema.json +9 -4
- package/lib/generators/add-package/generator.cjs +50 -0
- package/lib/generators/add-package/generator.cjs.map +1 -0
- package/lib/generators/add-package/generator.d.ts +5 -0
- package/lib/generators/add-package/generator.mjs +50 -0
- package/lib/generators/add-package/generator.mjs.map +1 -0
- package/lib/generators/add-package/schema.json +29 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -4
- package/lib/index.mjs +1 -1
- package/lib/utils/filesConfig.cjs +76 -0
- package/lib/utils/filesConfig.cjs.map +1 -0
- package/lib/utils/filesConfig.d.ts +2 -0
- package/lib/utils/filesConfig.mjs +76 -0
- package/lib/utils/filesConfig.mjs.map +1 -0
- package/lib/utils/index.cjs +28 -2
- package/lib/utils/index.cjs.map +1 -1
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.mjs +28 -2
- package/lib/utils/index.mjs.map +1 -1
- package/lib/utils/syncConfig.cjs +116 -0
- package/lib/utils/syncConfig.cjs.map +1 -0
- package/lib/utils/syncConfig.d.ts +9 -0
- package/lib/utils/syncConfig.mjs +116 -0
- package/lib/utils/syncConfig.mjs.map +1 -0
- package/package.json +3 -4
- package/rollup.config.mjs +2 -8
- package/src/generators/add-backend/generator.ts +14 -3
- package/src/generators/add-backend/schema.d.ts +1 -0
- package/src/generators/add-backend/schema.json +6 -1
- package/src/generators/add-frontend/frameworks/antui/root.tsx.template +2 -2
- package/src/generators/add-frontend/frameworks/chakraui/root.tsx.template +4 -3
- package/src/generators/add-frontend/frameworks/tailwindui/root.tsx.template +2 -2
- package/src/generators/add-frontend/generator.ts +14 -9
- package/src/generators/add-frontend/schema.d.ts +1 -0
- package/src/generators/add-frontend/schema.json +8 -3
- package/src/generators/add-fullstack/files/Jenkinsfile +7 -7
- package/src/generators/add-fullstack/files/LICENSE-IST +39 -0
- package/src/generators/add-fullstack/files/package.json +16 -13
- package/src/generators/add-fullstack/files/tools/html-plugin-template.ejs +28 -0
- package/src/generators/add-fullstack/files/tools/update-dependencies.mjs +95 -63
- package/src/generators/add-fullstack/generator.ts +64 -38
- package/src/generators/add-fullstack/updates/htmlPluginUpdate.ts +11 -0
- package/src/generators/add-fullstack/updates/ignoreUpdate.ts +23 -0
- package/src/generators/add-fullstack/updates/index.ts +4 -0
- package/src/generators/add-fullstack/updates/jenkinsfileUpdate.ts +6 -4
- package/src/generators/add-fullstack/updates/lernaJsonUpdate.ts +53 -0
- package/src/generators/add-fullstack/updates/licenseUpdate.ts +23 -0
- package/src/generators/add-fullstack/updates/packageJsonUpdate.ts +45 -4
- package/src/generators/add-moleculer/files/charts/chart/Chart.yaml +1 -1
- package/src/generators/add-moleculer/files/package.json +5 -5
- package/src/generators/add-moleculer/generator.spec.ts +1 -1
- package/src/generators/add-moleculer/generator.ts +8 -3
- package/src/generators/add-moleculer/schema.d.ts +2 -1
- package/src/generators/add-moleculer/schema.json +9 -4
- package/src/generators/{add-core-package → add-package}/generator.spec.ts +5 -5
- package/src/generators/add-package/generator.ts +62 -0
- package/src/generators/add-package/schema.d.ts +6 -0
- package/src/generators/add-package/schema.json +29 -0
- package/src/index.ts +1 -4
- package/src/utils/filesConfig.ts +84 -0
- package/src/utils/index.ts +31 -0
- package/src/utils/syncConfig.ts +128 -0
- package/lib/constants/index.cjs.map +0 -1
- package/lib/constants/index.mjs.map +0 -1
- package/lib/generators/add-browser-package/files/jest.config.js +0 -8
- package/lib/generators/add-browser-package/files/package.json +0 -49
- package/lib/generators/add-browser-package/files/rollup.config.mjs +0 -29
- package/lib/generators/add-browser-package/files/src/index.ts.template +0 -4
- package/lib/generators/add-browser-package/files/src/interfaces/index.ts.template +0 -1
- package/lib/generators/add-browser-package/files/src/interfaces/interfaces.ts.template +0 -1
- package/lib/generators/add-browser-package/files/src/module.tsx.template +0 -7
- package/lib/generators/add-browser-package/files/tsconfig.json +0 -28
- package/lib/generators/add-browser-package/files/webpack.config.js +0 -71
- package/lib/generators/add-browser-package/generator.cjs +0 -17
- package/lib/generators/add-browser-package/generator.cjs.map +0 -1
- package/lib/generators/add-browser-package/generator.d.ts +0 -5
- package/lib/generators/add-browser-package/generator.mjs +0 -17
- package/lib/generators/add-browser-package/generator.mjs.map +0 -1
- package/lib/generators/add-browser-package/schema.json +0 -19
- package/lib/generators/add-client-package/files/CHANGELOG.md +0 -807
- package/lib/generators/add-client-package/files/jest.config.js +0 -13
- package/lib/generators/add-client-package/files/package.json +0 -30
- package/lib/generators/add-client-package/files/rollup.config.mjs +0 -29
- package/lib/generators/add-client-package/files/src/components/index.tsx.template +0 -1
- package/lib/generators/add-client-package/files/src/index.ts.template +0 -1
- package/lib/generators/add-client-package/files/tsconfig.json +0 -27
- package/lib/generators/add-client-package/files/webpack.config.js +0 -72
- package/lib/generators/add-client-package/generator.cjs +0 -17
- package/lib/generators/add-client-package/generator.cjs.map +0 -1
- package/lib/generators/add-client-package/generator.d.ts +0 -5
- package/lib/generators/add-client-package/generator.mjs +0 -17
- package/lib/generators/add-client-package/generator.mjs.map +0 -1
- package/lib/generators/add-client-package/generator.spec.d.ts +0 -1
- package/lib/generators/add-client-package/schema.json +0 -19
- package/lib/generators/add-core-package/files/jest.config.js +0 -3
- package/lib/generators/add-core-package/files/package.json +0 -30
- package/lib/generators/add-core-package/files/rollup.config.mjs +0 -65
- package/lib/generators/add-core-package/files/src/constants/index.ts.template +0 -1
- package/lib/generators/add-core-package/files/src/constants/types.ts.template +0 -3
- package/lib/generators/add-core-package/files/src/index.ts.template +0 -2
- package/lib/generators/add-core-package/files/src/types/index.ts.template +0 -1
- package/lib/generators/add-core-package/files/src/types/types.ts.template +0 -17
- package/lib/generators/add-core-package/files/tsconfig.json +0 -22
- package/lib/generators/add-core-package/files/webpack.config.js +0 -53
- package/lib/generators/add-core-package/generator.cjs +0 -17
- package/lib/generators/add-core-package/generator.cjs.map +0 -1
- package/lib/generators/add-core-package/generator.d.ts +0 -5
- package/lib/generators/add-core-package/generator.mjs +0 -17
- package/lib/generators/add-core-package/generator.mjs.map +0 -1
- package/lib/generators/add-core-package/generator.spec.d.ts +0 -1
- package/lib/generators/add-core-package/schema.json +0 -19
- package/lib/generators/add-fullstack/files/CHANGELOG.md +0 -20
- package/lib/generators/add-fullstack/files/docs/Moleculer.md +0 -10
- package/lib/generators/add-fullstack/files/docs/References.md +0 -13
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Adding_New_Modules.md +0 -84
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Desktop_Setup.md +0 -12
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/DoAndDont.md +0 -35
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/GitHooks.md +0 -3
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/HowToContribute.md +0 -14
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/How_to_Run_Various_Options.md +0 -95
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Known_Issues.md +0 -19
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Lint_And_Formatter.md +0 -9
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Project_Setup.md +0 -159
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Dynamically_Render_Components.md +0 -57
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/HOC_With_Render_Props.md +0 -87
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Mongoose_Connection.md +0 -45
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/React_Componet_Extensions.md +0 -11
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/RxJS_notes.md +0 -3
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Styles_With_Type.md +0 -52
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Tutorials.md +0 -12
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/faq.md +0 -17
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/installation_issues.md +0 -9
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/lerna-build-tools.md +0 -504
- package/lib/generators/add-fullstack/files/docs/development/CodeContribution/lerna-yarn-workspaces.md +0 -82
- package/lib/generators/add-fullstack/files/docs/development/Database/mongodb-test.md +0 -6
- package/lib/generators/add-fullstack/files/docs/development/Deployment/How_To_Setup_Jenkins.md +0 -60
- package/lib/generators/add-fullstack/files/docs/development/Deployment/JenkinsDeployment.md +0 -16
- package/lib/generators/add-fullstack/files/docs/development/Expo/expo-commands.md +0 -5
- package/lib/generators/add-fullstack/files/docs/development/Mobile/How_To_Make_Expo_Wrok_With_Monorepos.md +0 -9
- package/lib/generators/add-fullstack/files/docs/development/Mobile/React-Native-FAQ.md +0 -4
- package/lib/generators/add-fullstack/files/docs/development/Mobile/Run_mobile.md +0 -9
- package/lib/generators/add-server-package/files/CHANGELOG.md +0 -2599
- package/lib/generators/add-server-package/files/LICENSE +0 -674
- package/lib/generators/add-server-package/files/jest.config.js +0 -32
- package/lib/generators/add-server-package/files/package.json +0 -78
- package/lib/generators/add-server-package/files/rollup.config.mjs +0 -30
- package/lib/generators/add-server-package/files/src/constants/constants.ts.template +0 -62
- package/lib/generators/add-server-package/files/src/constants/index.ts.template +0 -1
- package/lib/generators/add-server-package/files/src/constants/types.ts.template +0 -21
- package/lib/generators/add-server-package/files/src/index.ts.template +0 -6
- package/lib/generators/add-server-package/files/src/module.ts.template +0 -6
- package/lib/generators/add-server-package/files/tsconfig.json +0 -27
- package/lib/generators/add-server-package/generator.cjs +0 -17
- package/lib/generators/add-server-package/generator.cjs.map +0 -1
- package/lib/generators/add-server-package/generator.d.ts +0 -5
- package/lib/generators/add-server-package/generator.mjs +0 -17
- package/lib/generators/add-server-package/generator.mjs.map +0 -1
- package/lib/generators/add-server-package/generator.spec.d.ts +0 -1
- package/lib/generators/add-server-package/schema.json +0 -19
- package/src/generators/add-browser-package/generator.spec.ts +0 -20
- package/src/generators/add-browser-package/generator.ts +0 -24
- package/src/generators/add-browser-package/schema.d.ts +0 -4
- package/src/generators/add-browser-package/schema.json +0 -19
- package/src/generators/add-client-package/generator.spec.ts +0 -20
- package/src/generators/add-client-package/generator.ts +0 -24
- package/src/generators/add-client-package/schema.d.ts +0 -4
- package/src/generators/add-client-package/schema.json +0 -19
- package/src/generators/add-core-package/generator.ts +0 -24
- package/src/generators/add-core-package/schema.d.ts +0 -4
- package/src/generators/add-core-package/schema.json +0 -19
- package/src/generators/add-fullstack/files/CHANGELOG.md +0 -28
- package/src/generators/add-fullstack/files/docs/Moleculer.md +0 -10
- package/src/generators/add-fullstack/files/docs/References.md +0 -13
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/Adding_New_Modules.md +0 -84
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/Desktop_Setup.md +0 -12
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/DoAndDont.md +0 -35
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/GitHooks.md +0 -3
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/HowToContribute.md +0 -14
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/How_to_Run_Various_Options.md +0 -95
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/Known_Issues.md +0 -19
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/Lint_And_Formatter.md +0 -9
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/Project_Setup.md +0 -159
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Dynamically_Render_Components.md +0 -57
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/HOC_With_Render_Props.md +0 -87
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Mongoose_Connection.md +0 -45
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/React_Componet_Extensions.md +0 -11
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/RxJS_notes.md +0 -3
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Styles_With_Type.md +0 -52
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/Tutorials.md +0 -12
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/faq.md +0 -17
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/installation_issues.md +0 -9
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/lerna-build-tools.md +0 -504
- package/src/generators/add-fullstack/files/docs/development/CodeContribution/lerna-yarn-workspaces.md +0 -82
- package/src/generators/add-fullstack/files/docs/development/Database/mongodb-test.md +0 -6
- package/src/generators/add-fullstack/files/docs/development/Deployment/How_To_Setup_Jenkins.md +0 -60
- package/src/generators/add-fullstack/files/docs/development/Deployment/JenkinsDeployment.md +0 -16
- package/src/generators/add-fullstack/files/docs/development/Expo/expo-commands.md +0 -5
- package/src/generators/add-fullstack/files/docs/development/Mobile/How_To_Make_Expo_Wrok_With_Monorepos.md +0 -9
- package/src/generators/add-fullstack/files/docs/development/Mobile/React-Native-FAQ.md +0 -4
- package/src/generators/add-fullstack/files/docs/development/Mobile/Run_mobile.md +0 -9
- package/src/generators/add-server-package/generator.spec.ts +0 -20
- package/src/generators/add-server-package/generator.ts +0 -24
- package/src/generators/add-server-package/schema.d.ts +0 -4
- package/src/generators/add-server-package/schema.json +0 -19
- /package/lib/{constants/index.d.ts → common/constants.d.ts} +0 -0
- /package/lib/generators/{add-browser-package/files/LICENSE → add-fullstack/files/LICENSE-GNU} +0 -0
- /package/lib/generators/{add-core-package/files/LICENSE → add-fullstack/files/LICENSE-IST} +0 -0
- /package/lib/generators/add-fullstack/files/{LICENSE → LICENSE-MIT} +0 -0
- /package/lib/generators/{add-browser-package → add-package}/generator.spec.d.ts +0 -0
- /package/src/{constants/index.ts → common/constants.ts} +0 -0
- /package/{lib/generators/add-client-package/files/LICENSE → src/generators/add-fullstack/files/LICENSE-GNU} +0 -0
- /package/src/generators/add-fullstack/files/{LICENSE → LICENSE-MIT} +0 -0
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { addProjectConfiguration, formatFiles, generateFiles, Tree, updateJson } from '@nx/devkit';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import { deepMerge } from '@common-stack/rollup-vite-utils/lib/utils/setupConfig.cjs';
|
|
3
4
|
import { AddBackendGeneratorSchema } from './schema';
|
|
4
5
|
import { isValid, getValid } from '../../utils';
|
|
5
6
|
|
|
7
|
+
const DEFAULT_SERVER_NAME = 'backend-server';
|
|
8
|
+
|
|
6
9
|
export async function addBackendGenerator(tree: Tree, options: AddBackendGeneratorSchema) {
|
|
7
|
-
const projectName = isValid(options.
|
|
10
|
+
const projectName = isValid(options.name) ? `backend-${getValid(options.name)}-server` : DEFAULT_SERVER_NAME;
|
|
8
11
|
const configs: any = {...options, name: projectName};
|
|
9
12
|
|
|
10
13
|
return await generateBackend(tree, configs);
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
export const generateBackend = async (tree: Tree, options: any) => {
|
|
14
|
-
|
|
17
|
+
let projectName = getValid(options.name) ?? DEFAULT_SERVER_NAME;
|
|
15
18
|
const projectRoot = isValid(options.directory) ? `${getValid(options.directory)}/${projectName}` : projectName;
|
|
19
|
+
projectName = isValid(options.ns) ? `${getValid(options.ns)}-${projectName}` : projectName;
|
|
16
20
|
// resetProject(`${basePath}/${projectRoot}`);
|
|
17
21
|
|
|
18
22
|
// addProjectConfiguration(tree, framework, {
|
|
@@ -27,7 +31,14 @@ export const generateBackend = async (tree: Tree, options: any) => {
|
|
|
27
31
|
packageJson['name'] = projectName;
|
|
28
32
|
return packageJson;
|
|
29
33
|
});
|
|
30
|
-
|
|
34
|
+
if (options['config.json']) {
|
|
35
|
+
updateJson(tree, `${projectRoot}/config.json`, (configJson) => {
|
|
36
|
+
const addtionalConfigs = options['config.json'];
|
|
37
|
+
configJson = deepMerge(configJson, addtionalConfigs);
|
|
38
|
+
|
|
39
|
+
return configJson;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
31
42
|
await formatFiles(tree);
|
|
32
43
|
}
|
|
33
44
|
|
|
@@ -7,12 +7,17 @@
|
|
|
7
7
|
"ns": {
|
|
8
8
|
"type": "string",
|
|
9
9
|
"description": "The project namespace",
|
|
10
|
-
"x-prompt": "What
|
|
10
|
+
"x-prompt": "What namespace would you like to use?"
|
|
11
11
|
},
|
|
12
12
|
"directory": {
|
|
13
13
|
"type": "string",
|
|
14
14
|
"description": "",
|
|
15
15
|
"x-prompt": "What directory would you like to create in?"
|
|
16
|
+
},
|
|
17
|
+
"name": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The module name(optional)",
|
|
20
|
+
"x-prompt": "What name would you like to use for this backend server module?(optional)"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"required": ["ns", "directory"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Links, Meta, Outlet, Scripts, ScrollRestoration,
|
|
3
|
+
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData, useRouteError, json } from '@remix-run/react';
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
import publicEnv from '@src/config/public-config';
|
|
6
6
|
import { PluginArea } from '@common-stack/client-react';
|
|
@@ -34,7 +34,7 @@ export function shouldRevalidate(params: any) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export function Layout({ children }: { children: React.ReactNode }) {
|
|
37
|
-
const data =
|
|
37
|
+
const data = useRouteLoaderData<{ locale: any }>('root');
|
|
38
38
|
const locale = data?.locale;
|
|
39
39
|
|
|
40
40
|
const { i18n } = useTranslation();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { Links, Meta, Outlet, Scripts, ScrollRestoration,
|
|
4
|
+
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData } from '@remix-run/react';
|
|
5
5
|
import { json } from '@remix-run/node';
|
|
6
6
|
import { PluginArea } from '@common-stack/client-react';
|
|
7
7
|
import { subscribeReduxRouter } from '@common-stack/remix-router-redux';
|
|
@@ -79,8 +79,9 @@ export function shouldRevalidate(params: any) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
export default function App() {
|
|
82
|
-
|
|
83
|
-
const locale =
|
|
82
|
+
const data = useRouteLoaderData<{ locale: any }>('root');
|
|
83
|
+
const locale = data?.locale;
|
|
84
|
+
|
|
84
85
|
useChangeLanguage(locale);
|
|
85
86
|
|
|
86
87
|
React.useEffect(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { Links, Meta, Outlet, Scripts, ScrollRestoration,
|
|
3
|
+
import { Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteLoaderData, useRouteError, json } from '@remix-run/react';
|
|
4
4
|
import type { LinksFunction } from "@remix-run/node";
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import publicEnv from '@src/config/public-config';
|
|
@@ -36,7 +36,7 @@ export function shouldRevalidate(params: any) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export function Layout({ children }: { children: React.ReactNode }) {
|
|
39
|
-
const data =
|
|
39
|
+
const data = useRouteLoaderData<{ locale: any }>('root');
|
|
40
40
|
const locale = data?.locale;
|
|
41
41
|
|
|
42
42
|
const { i18n } = useTranslation();
|
|
@@ -4,20 +4,22 @@ import * as fs from 'node:fs';
|
|
|
4
4
|
import { deepMerge } from '@common-stack/rollup-vite-utils/lib/utils/setupConfig.cjs';
|
|
5
5
|
import { AddFrontendGeneratorSchema } from './schema';
|
|
6
6
|
import { isValid, getValid } from '../../utils';
|
|
7
|
-
import { FRAMEWORK_ANTUI, FRAMEWORK_CHAKRAUI, FRAMEWORK_TAILWINDUI } from '../../constants';
|
|
7
|
+
import { FRAMEWORK_ANTUI, FRAMEWORK_CHAKRAUI, FRAMEWORK_TAILWINDUI } from '../../common/constants';
|
|
8
8
|
|
|
9
9
|
const DEFAULT_FRAMEWORK = FRAMEWORK_ANTUI;
|
|
10
|
+
const DEFAULT_SERVER_NAME = 'frontend-server';
|
|
10
11
|
|
|
11
12
|
export async function addFrontendGenerator(tree: Tree, options: AddFrontendGeneratorSchema) {
|
|
12
|
-
const projectName = isValid(options.
|
|
13
|
+
const projectName = isValid(options.name) ? `frontend-${getValid(options.name)}-server` : DEFAULT_SERVER_NAME;
|
|
13
14
|
const configs: any = {...options, name: projectName};
|
|
14
15
|
|
|
15
16
|
return await generateFrontend(tree, configs);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export const generateFrontend = async (tree: Tree, options: any) => {
|
|
19
|
-
|
|
20
|
+
let projectName = getValid(options.name) ?? DEFAULT_SERVER_NAME;
|
|
20
21
|
const projectRoot = isValid(options.directory) ? `${getValid(options.directory)}/${projectName}` : projectName;
|
|
22
|
+
projectName = isValid(options.ns) ? `${getValid(options.ns)}-${projectName}` : projectName;
|
|
21
23
|
const projectSrc = `${projectRoot}/src`;
|
|
22
24
|
|
|
23
25
|
const framework = getValid(options.framework) ?? DEFAULT_FRAMEWORK;
|
|
@@ -38,17 +40,20 @@ export const generateFrontend = async (tree: Tree, options: any) => {
|
|
|
38
40
|
packageJson['name'] = projectName;
|
|
39
41
|
if (framework === FRAMEWORK_ANTUI) {
|
|
40
42
|
packageJson['dependencies']["@admin-layout/ant-design-pro"] = "latest";
|
|
41
|
-
packageJson['dependencies']["@admin-layout/ant-ui"] = "latest";
|
|
42
|
-
packageJson['dependencies']["@adminide-stack/user-auth0-browser-ant"] = "latest";
|
|
43
|
-
packageJson['dependencies']["@ant-design/pro-layout"] = "^7.6.1";
|
|
44
43
|
packageJson['dependencies']["@ant-design/static-style-extract"] = "^1.0.2";
|
|
44
|
+
packageJson['dependencies']["@emotion/react"] = "^11.10.0";
|
|
45
|
+
packageJson['dependencies']["@emotion/server"] = "^11.10.0";
|
|
46
|
+
packageJson['dependencies']["@emotion/css"] = "^11.10.0";
|
|
47
|
+
packageJson['dependencies']["@emotion/styled"] = "^11.10.4";
|
|
45
48
|
packageJson['dependencies']["antd"] = "^5.14.0";
|
|
46
49
|
} else if (framework === FRAMEWORK_CHAKRAUI) {
|
|
47
|
-
packageJson['dependencies']["@
|
|
48
|
-
packageJson['dependencies']["
|
|
49
|
-
packageJson['dependencies']["@
|
|
50
|
+
packageJson['dependencies']["@chakra-ui/react"] = "^2.8.2";
|
|
51
|
+
packageJson['dependencies']["framer-motion"] = "^11.5.4";
|
|
52
|
+
packageJson['dependencies']["@emotion/react"] = "^11.10.0";
|
|
53
|
+
packageJson['dependencies']["@emotion/server"] = "^11.10.0";
|
|
50
54
|
packageJson['dependencies']["@emotion/css"] = "^11.10.0";
|
|
51
55
|
packageJson['dependencies']["@emotion/styled"] = "^11.10.4";
|
|
56
|
+
|
|
52
57
|
} else if (framework === FRAMEWORK_TAILWINDUI) {
|
|
53
58
|
packageJson['devDependencies']["tailwindcss"] = "^3.4.10";
|
|
54
59
|
packageJson['devDependencies']["postcss"] = "^8.4.41";
|
|
@@ -7,18 +7,23 @@
|
|
|
7
7
|
"ns": {
|
|
8
8
|
"type": "string",
|
|
9
9
|
"description": "The project namespace",
|
|
10
|
-
"x-prompt": "What
|
|
10
|
+
"x-prompt": "What namespace would you like to use?"
|
|
11
11
|
},
|
|
12
12
|
"directory": {
|
|
13
13
|
"type": "string",
|
|
14
14
|
"description": "",
|
|
15
15
|
"x-prompt": "What directory would you like to create in?"
|
|
16
16
|
},
|
|
17
|
+
"name": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The module name(optional)",
|
|
20
|
+
"x-prompt": "What name would you like to use for this frontend server module?(optional)"
|
|
21
|
+
},
|
|
17
22
|
"framework": {
|
|
18
23
|
"type": "string",
|
|
19
24
|
"description": "",
|
|
20
|
-
"x-prompt": "What UI framework would you like to use in [antui, chakraui, tailwindui]?"
|
|
25
|
+
"x-prompt": "What UI framework would you like to use in [antui, chakraui, tailwindui]?(default: antui)"
|
|
21
26
|
}
|
|
22
27
|
},
|
|
23
|
-
"required": ["ns", "directory"
|
|
28
|
+
"required": ["ns", "directory"]
|
|
24
29
|
}
|
|
@@ -13,23 +13,23 @@ pipeline {
|
|
|
13
13
|
string(name: 'CONNECTION_ID', defaultValue: 'test', description: 'connection id', trim: true)
|
|
14
14
|
string(name: 'WORKSPACE_ID', defaultValue: 'fullstack-pro', description: 'workspace id', trim: true)
|
|
15
15
|
string(name: 'UNIQUE_NAME', defaultValue: 'default', description: 'chart name', trim: true)
|
|
16
|
-
string(name: 'VERSION', defaultValue: '
|
|
16
|
+
string(name: 'VERSION', defaultValue: 'v1', description: 'version of the deployment', trim: true)
|
|
17
17
|
string(name: 'HEMERA_LOG_LEVEL', defaultValue: 'info', description: 'log level for hemera')
|
|
18
18
|
string(name: 'LOG_LEVEL', defaultValue: 'info', description: 'log level')
|
|
19
19
|
string(name: 'DEPLOYMENT_PATH', defaultValue: '/servers', description: 'folder path to load helm charts')
|
|
20
|
-
string(name: 'PUBLISH_BRANCH', defaultValue: '
|
|
20
|
+
string(name: 'PUBLISH_BRANCH', defaultValue: 'devpublish', description: 'the publish branch for packages release')
|
|
21
21
|
string(name: 'EXCLUDE_SETTING_NAMESPACE_FILTER', defaultValue: 'brigade', description: 'exclude setting namespace that matches search string')
|
|
22
22
|
string(name: 'GIT_CREDENTIAL_ID', defaultValue: 'fullstack-pro-github-deploy-key', description: 'jenkins credential id of git deploy secret')
|
|
23
23
|
string(name: 'BUILD_MODULE_TO_INCLUDE', defaultValue: '@sample-stack*', description: 'build env')
|
|
24
24
|
string(name: 'REPOSITORY_SSH_URL', defaultValue: 'git@github.com:CDEBase/fullstack-pro.git', description: 'ssh url of the git repository')
|
|
25
|
-
string(name: 'REPOSITORY_BRANCH', defaultValue: '
|
|
26
|
-
string(name: 'DEVELOP_BRANCH', defaultValue: '
|
|
25
|
+
string(name: 'REPOSITORY_BRANCH', defaultValue: 'develop', description: 'the branch with changes')
|
|
26
|
+
string(name: 'DEVELOP_BRANCH', defaultValue: 'develop', description: 'the branch for the development')
|
|
27
27
|
string(name: 'MASTER_BRANCH', defaultValue: 'master', description: 'Master branch as default branch for production.')
|
|
28
28
|
|
|
29
29
|
// by default first value of the choice will be choosen
|
|
30
30
|
choice choices: ['auto', 'force'], description: 'Choose merge strategy', name: 'NPM_PUBLISH_STRATEGY'
|
|
31
31
|
choice choices: ['yarn', 'npm'], description: 'Choose build strategy', name: 'BUILD_STRATEGY'
|
|
32
|
-
choice choices: ['0.7.
|
|
32
|
+
choice choices: ['0.7.11','0.7.9', '0.6.0'], description: 'Choose Idestack chart version', name: 'IDESTACK_CHART_VERSION'
|
|
33
33
|
choice choices: ['nodejs20', 'nodejs18', 'nodejs22'], description: 'Choose NodeJS version', name: 'NODEJS_TOOL_VERSION'
|
|
34
34
|
choice choices: ['buildOnly', 'buildAndTest', 'buildAndPublish', 'mobileBuild', 'mobilePreview', 'mobilePreviewLocal', 'mobilePreviewSubmit', 'mobileProd', 'mobileProdSubmit', 'devDeployOnly', 'stageDeploy', 'stageDeployOnly', 'prodDeploy', 'prodDeployOnly', 'allenv'], description: 'Where to deploy micro services?', name: 'ENV_CHOICE'
|
|
35
35
|
choice choices: ['all', 'ios', 'android' ], description: 'Mobile type if it is mobile build?', name: 'MOBILE_CHOICE'
|
|
@@ -100,9 +100,9 @@ pipeline {
|
|
|
100
100
|
rm .npmrc
|
|
101
101
|
npx lerna exec --scope=*mobile-device ${params.BUILD_STRATEGY} ${env.BUILD_COMMAND}
|
|
102
102
|
git checkout -- .npmrc
|
|
103
|
+
yarn git:pull
|
|
103
104
|
yarn gitcommit
|
|
104
|
-
git
|
|
105
|
-
git push origin ${params.REPOSITORY_BRANCH}
|
|
105
|
+
yarn git:push
|
|
106
106
|
"""
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
The CDEBase Enterprise license (the “Enterprise License”)
|
|
2
|
+
Copyright (c) 2018 cdebase LLC.
|
|
3
|
+
|
|
4
|
+
With regard to the CDEBase Software:
|
|
5
|
+
|
|
6
|
+
This software and associated documentation files (the "Software") may only be
|
|
7
|
+
used in production, if you (and any entity that you represent) have agreed to,
|
|
8
|
+
and are in compliance with, the CDEBase Terms of Service, available
|
|
9
|
+
at https://about.cdebase.com/terms (the “Enterprise Terms”), or other
|
|
10
|
+
agreement governing the use of the Software, as agreed by you and CDEBase,
|
|
11
|
+
and otherwise have a valid CDEBase Enterprise subscription for the
|
|
12
|
+
correct number of user seats. Subject to the foregoing sentence, you are free to
|
|
13
|
+
modify this Software and publish patches to the Software. You agree that CDEBase
|
|
14
|
+
and/or its licensors (as applicable) retain all right, title and interest in and
|
|
15
|
+
to all such modifications and/or patches, and all such modifications and/or
|
|
16
|
+
patches may only be used, copied, modified, displayed, distributed, or otherwise
|
|
17
|
+
exploited with a valid CDEBase Enterprise subscription for the correct
|
|
18
|
+
number of user seats. Notwithstanding the foregoing, you may copy and modify
|
|
19
|
+
the Software for development and testing purposes, without requiring a
|
|
20
|
+
subscription. You agree that CDEBase and/or its licensors (as applicable) retain
|
|
21
|
+
all right, title and interest in and to all such modifications. You are not
|
|
22
|
+
granted any other rights beyond what is expressly stated herein. Subject to the
|
|
23
|
+
foregoing, it is forbidden to copy, merge, publish, distribute, sublicense,
|
|
24
|
+
and/or sell the Software.
|
|
25
|
+
|
|
26
|
+
The full text of this Enterprise License shall be included in all copies or
|
|
27
|
+
substantial portions of the Software.
|
|
28
|
+
|
|
29
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
+
SOFTWARE.
|
|
36
|
+
|
|
37
|
+
For all third party components incorporated into the CDEBase Software, those
|
|
38
|
+
components are licensed under the original license provided by the owner of the
|
|
39
|
+
applicable component.
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"jest": "./node_modules/.bin/jest",
|
|
62
62
|
"lerna": "lerna bootstrap",
|
|
63
63
|
"prelernapublish": "git checkout publish && git pull origin publish && git merge -s recursive -X theirs master -m 'merge from master' && yarn gitcommit && node tools/update-dependency-version.js && yarn gitcommit",
|
|
64
|
-
"lernapublish": "lerna publish --ignore-scripts
|
|
65
|
-
"postlernapublish": "git checkout master",
|
|
66
|
-
"lint": "eslint --ext js --ext ts --ext md",
|
|
64
|
+
"lernapublish": "lerna publish patch --ignore-scripts",
|
|
65
|
+
"postlernapublish": "yarn update-lerna-on-develop && git checkout master",
|
|
66
|
+
"lint": "eslint --ext js --ext ts --ext tsx --ext md",
|
|
67
67
|
"lint:ci": "yarn lint . --format junit",
|
|
68
68
|
"lint:fix": "yarn lint -- --fix",
|
|
69
69
|
"lint:md": "markdownlint",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"publish:force": "yarn publish:forceManual --yes",
|
|
76
76
|
"publish:forceManual": "yarn lernapublish --force-publish=*",
|
|
77
77
|
"publish:push": "yarn prelernapublish && git push origin publish && yarn postlernapublish",
|
|
78
|
+
"push-develop": "git push origin develop",
|
|
78
79
|
"setBranchEnv": "cross-env REPOSITORY_BRANCH=${1:-$REPOSITORY_BRANCH} PUBLISH_BRANCH=${2:-$PUBLISH_BRANCH}",
|
|
79
80
|
"sort-packages": "node tools/sortPackageJson.mjs && prettier --write package.json **/**/*/package.json **/*/package.json",
|
|
80
81
|
"start": "cross-env NODE_ENV=development ENV_FILE=../../config/development/dev.env yarn startWeb",
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
"pretravis": "yarn compile",
|
|
89
90
|
"travis": "istanbul cover -x \"*.test.js\" _mocha -- --timeout 5000 --full-trace ./test/tests.js",
|
|
90
91
|
"posttravis": "yarn lint",
|
|
91
|
-
"update-lerna-on-develop": "git checkout publish && git pull && cp lerna.json ../lerna-temp.json && git checkout develop && mv ../lerna-temp.json lerna.json && git commit -am 'Update lerna.json' &&
|
|
92
|
+
"update-lerna-on-develop": "git checkout publish && git pull origin publish && cp lerna.json ../lerna-temp.json && git checkout develop && mv ../lerna-temp.json lerna.json && git commit -am 'Update lerna.json' && yarn push-develop",
|
|
92
93
|
"watch": "lerna exec --no-sort --ignore *server --ignore *device --ignore *browser-extension --stream --parallel -- webpack --watch",
|
|
93
94
|
"watch-packages": "lerna exec --no-sort --scope @sample-stack/platform* --scope @sample-stack/react-shared-components --scope @sample-stack/core --stream --parallel 'webpack --watch'",
|
|
94
95
|
"zen:build": "cross-env NODE_ENV=production zen build",
|
|
@@ -145,8 +146,8 @@
|
|
|
145
146
|
"@babel/preset-typescript": "^7.18.6",
|
|
146
147
|
"@babel/register": "^7.18.9",
|
|
147
148
|
"@babel/runtime": "^7.20.1",
|
|
148
|
-
"@common-stack/env-list-loader": "
|
|
149
|
-
"@common-stack/generate-plugin": "6.0.6-alpha.
|
|
149
|
+
"@common-stack/env-list-loader": "6.0.6-alpha.5",
|
|
150
|
+
"@common-stack/generate-plugin": "6.0.6-alpha.48",
|
|
150
151
|
"@emotion/babel-plugin": "^11.11.0",
|
|
151
152
|
"@graphql-codegen/add": "^5.0.2",
|
|
152
153
|
"@graphql-codegen/cli": "^5.0.2",
|
|
@@ -165,15 +166,16 @@
|
|
|
165
166
|
"@redux-devtools/core": "^3.13.1",
|
|
166
167
|
"@redux-devtools/dock-monitor": "^3.0.1",
|
|
167
168
|
"@redux-devtools/log-monitor": "^4.0.1",
|
|
168
|
-
"@
|
|
169
|
-
"@
|
|
169
|
+
"@rollup/plugin-alias": "^5.1.0",
|
|
170
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
170
171
|
"@rollup/plugin-graphql": "2.0.2",
|
|
171
172
|
"@rollup/plugin-image": "^3.0.1",
|
|
172
|
-
"@rollup/plugin-json": "^
|
|
173
|
-
"@rollup/plugin-
|
|
173
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
174
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
175
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
174
176
|
"@shelf/jest-mongodb": "^4.1.3",
|
|
175
177
|
"@svgr/webpack": "^6.5.1",
|
|
176
|
-
"@testing-library/react": "^
|
|
178
|
+
"@testing-library/react": "^16.0.1",
|
|
177
179
|
"@testing-library/react-hooks": "^8.0.1",
|
|
178
180
|
"@types/async": "^3.2.15",
|
|
179
181
|
"@types/body-parser": "1.19.2",
|
|
@@ -192,7 +194,6 @@
|
|
|
192
194
|
"@types/react": "^18.2.20",
|
|
193
195
|
"@types/react-dom": "^18.2.7",
|
|
194
196
|
"@types/react-helmet": "^6.1.5",
|
|
195
|
-
"@types/react-redux": "^7.1.24",
|
|
196
197
|
"@types/react-test-renderer": "^18.0.0",
|
|
197
198
|
"@types/redux-logger": "^3.0.9",
|
|
198
199
|
"@types/semver": "^7.3.13",
|
|
@@ -204,6 +205,7 @@
|
|
|
204
205
|
"@typescript-eslint/parser": "^6.7.4",
|
|
205
206
|
"@web/rollup-plugin-copy": "^0.5.1",
|
|
206
207
|
"@webpack-cli/serve": "^1.7.0",
|
|
208
|
+
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
207
209
|
"autoprefixer": "^10.4.13",
|
|
208
210
|
"babel-core": "^7.0.0-bridge.0",
|
|
209
211
|
"babel-eslint": "^10.1.0",
|
|
@@ -265,6 +267,7 @@
|
|
|
265
267
|
"jest-dom": "^4.0.0",
|
|
266
268
|
"jest-junit": "^14.0.1",
|
|
267
269
|
"jest-matcher-utils": "^29.2.2",
|
|
270
|
+
"jest-raw-loader": "^1.0.1",
|
|
268
271
|
"jest-transform-graphql": "^2.1.0",
|
|
269
272
|
"jsdom": "^20.0.2",
|
|
270
273
|
"lerna": "8",
|
|
@@ -325,7 +328,7 @@
|
|
|
325
328
|
"ts-node": "^10.9.1",
|
|
326
329
|
"tslib": "^2.4.1",
|
|
327
330
|
"typedoc": "^0.23.20",
|
|
328
|
-
"typescript": "^5.
|
|
331
|
+
"typescript": "^5.5.4",
|
|
329
332
|
"url-loader": "^4.1.1",
|
|
330
333
|
"wait-on": "^6.0.1",
|
|
331
334
|
"webpack": "^5.74.0",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<base href="/">
|
|
6
|
+
<meta charset="utf-8">
|
|
7
|
+
<title>
|
|
8
|
+
<@= htmlWebpackPlugin.options.title @>
|
|
9
|
+
</title>
|
|
10
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
11
|
+
</head>
|
|
12
|
+
|
|
13
|
+
<body>
|
|
14
|
+
<div class="demo">
|
|
15
|
+
<div id="root">
|
|
16
|
+
Try building the demo:
|
|
17
|
+
<pre>
|
|
18
|
+
</pre> ...and refreshing this page!
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<footer class="dark">
|
|
22
|
+
<section class="container copyright">
|
|
23
|
+
CDMBase LLC
|
|
24
|
+
</section>
|
|
25
|
+
</footer>
|
|
26
|
+
</body>
|
|
27
|
+
|
|
28
|
+
</html>
|
|
@@ -10,86 +10,118 @@ const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
|
10
10
|
const JSON_SPACING = 4;
|
|
11
11
|
const ADD_END_NEWLINE = true; // Set to true to add a newline at the end of the file
|
|
12
12
|
|
|
13
|
-
// Paths to package.json files
|
|
14
|
-
const
|
|
15
|
-
|
|
13
|
+
// Paths to package.json files (now using arrays to handle multiple paths for backend, frontend, and mobile)
|
|
14
|
+
const packagePaths = {
|
|
15
|
+
backend: [
|
|
16
|
+
resolve(__dirname, '../servers/backend-server/package.json'),
|
|
17
|
+
],
|
|
18
|
+
frontend: [
|
|
19
|
+
resolve(__dirname, '../servers/frontend-server/package.json'),
|
|
20
|
+
],
|
|
21
|
+
mobile: [
|
|
22
|
+
resolve(__dirname, '../portable-devices/mobile/package.json'),
|
|
23
|
+
]
|
|
24
|
+
};
|
|
16
25
|
|
|
17
26
|
// Packages to check
|
|
18
27
|
const packagesToCheck = [
|
|
19
28
|
'@common-stack/server-stack',
|
|
20
|
-
'@common-stack/frontend-stack-react'
|
|
29
|
+
'@common-stack/frontend-stack-react',
|
|
30
|
+
'@common-stack/mobile-stack-react'
|
|
21
31
|
];
|
|
22
32
|
|
|
33
|
+
// Utility function to wrap `exec` in a promise for sequential execution
|
|
34
|
+
const execCommand = (command, cwd) => {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
exec(command, { cwd }, (err, stdout, stderr) => {
|
|
37
|
+
if (err) {
|
|
38
|
+
console.error(`Error executing command: ${command}\n${stderr}`);
|
|
39
|
+
return reject(err);
|
|
40
|
+
}
|
|
41
|
+
console.log(stdout);
|
|
42
|
+
resolve();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
23
47
|
// Function to update dependencies
|
|
24
48
|
const updateDependencies = async (targetPackagePath, sourcePackagePath) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Write the formatted JSON back to disk
|
|
48
|
-
await writeFile(targetPackagePath, jsonString, 'utf-8');
|
|
49
|
+
const targetPackageJson = JSON.parse(await readFile(targetPackagePath, 'utf-8'));
|
|
50
|
+
const sourcePackageJson = JSON.parse(await readFile(sourcePackagePath, 'utf-8'));
|
|
51
|
+
|
|
52
|
+
const mergeDependencies = (targetDeps = {}, sourceDeps = {}) => ({
|
|
53
|
+
...targetDeps,
|
|
54
|
+
...sourceDeps
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Merge dependencies only
|
|
58
|
+
targetPackageJson.dependencies = mergeDependencies(targetPackageJson.dependencies, sourcePackageJson.dependencies);
|
|
59
|
+
|
|
60
|
+
// Format the JSON string with the specified spacing
|
|
61
|
+
let jsonString = JSON.stringify(targetPackageJson, null, JSON_SPACING);
|
|
62
|
+
|
|
63
|
+
// Optionally add a newline at the end
|
|
64
|
+
if (ADD_END_NEWLINE) {
|
|
65
|
+
jsonString += '\n';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Write the formatted JSON back to disk
|
|
69
|
+
await writeFile(targetPackagePath, jsonString, 'utf-8');
|
|
49
70
|
};
|
|
50
71
|
|
|
51
|
-
// Function to run `ncu`, update dependencies, and then run linting
|
|
72
|
+
// Function to run `ncu`, `yarn` from the root, update dependencies, and then run linting
|
|
52
73
|
export const runUpdateDependencies = async () => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
console.log(stdout);
|
|
61
|
-
resolve();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
74
|
+
// Step 1: Run `ncu` to update the dependencies from the root level
|
|
75
|
+
console.log('Updating dependencies using `ncu`...');
|
|
76
|
+
await execCommand(
|
|
77
|
+
'ncu -u -t minor "@common-stack*" && lerna exec "ncu -u -t minor /@common-stack*/"',
|
|
78
|
+
resolve(__dirname, '..')
|
|
79
|
+
);
|
|
64
80
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
packagePath
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
// Step 2: Run `yarn` to install updated packages from the root
|
|
82
|
+
console.log('Running yarn install...');
|
|
83
|
+
await execCommand('yarn', resolve(__dirname, '..'));
|
|
84
|
+
|
|
85
|
+
// Step 3: Update dependencies for each package
|
|
86
|
+
for (const packageName of packagesToCheck) {
|
|
87
|
+
const packagePath = resolve(__dirname, `../node_modules/${packageName}/package.json`);
|
|
88
|
+
let targetPaths;
|
|
89
|
+
|
|
90
|
+
// Determine the target package.json paths (array of paths)
|
|
91
|
+
if (packageName.includes('server-stack')) {
|
|
92
|
+
targetPaths = packagePaths.backend;
|
|
93
|
+
} else if (packageName.includes('mobile-stack-react')) {
|
|
94
|
+
targetPaths = packagePaths.mobile;
|
|
95
|
+
} else {
|
|
96
|
+
targetPaths = packagePaths.frontend;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Iterate over all target paths in the corresponding array
|
|
100
|
+
for (const targetPackagePath of targetPaths) {
|
|
101
|
+
try {
|
|
102
|
+
await updateDependencies(targetPackagePath, packagePath);
|
|
103
|
+
console.log(`Updated dependencies for ${packageName} in ${targetPackagePath}`);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.warn(`Package ${packageName} not found or failed to update in ${targetPackagePath}:`, error);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
75
108
|
}
|
|
76
|
-
}
|
|
77
109
|
|
|
78
|
-
|
|
110
|
+
console.log('Dependencies from @common-stack packages have been updated.');
|
|
79
111
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
112
|
+
// Step 4: Run linting to apply Prettier
|
|
113
|
+
try {
|
|
114
|
+
await runLintStaged();
|
|
115
|
+
console.log('Prettier formatting applied.');
|
|
116
|
+
} catch (err) {
|
|
117
|
+
console.error('Failed to run Prettier:', err);
|
|
118
|
+
}
|
|
87
119
|
};
|
|
88
120
|
|
|
89
121
|
// Execute the function if this file is run directly
|
|
90
122
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
123
|
+
runUpdateDependencies().catch((err) => {
|
|
124
|
+
console.error('Failed to update dependencies:', err);
|
|
125
|
+
process.exit(1);
|
|
126
|
+
});
|
|
95
127
|
}
|