@common-stack/generate-plugin 5.0.5-alpha.7 → 5.0.5-alpha.9
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 +4 -0
- package/lib/constants/index.cjs +2 -0
- package/lib/constants/index.cjs.map +1 -0
- package/lib/constants/index.d.ts +2 -0
- package/lib/constants/index.mjs +2 -0
- package/lib/constants/index.mjs.map +1 -0
- package/lib/generators/add-backend/files/config.json +11 -0
- package/lib/generators/add-backend/files/package.json +1 -1
- package/lib/generators/add-backend/files/webpack.config.js +8 -0
- package/lib/generators/add-frontend/generator.cjs +17 -1
- package/lib/generators/add-frontend/generator.cjs.map +1 -1
- package/lib/generators/add-frontend/generator.mjs +17 -1
- package/lib/generators/add-frontend/generator.mjs.map +1 -1
- package/lib/generators/add-frontend/templates/config.json +45 -53
- package/lib/generators/add-frontend/templates/package.json +2 -4
- package/lib/generators/add-frontend/templates/vite.config.ts.template +17 -10
- package/package.json +2 -2
- package/src/constants/index.ts +2 -0
- package/src/generators/add-frontend/generator.ts +18 -1
- package/lib/generators/add-backend/files/src/modules/module.ts.template +0 -78
- package/lib/generators/add-frontend/templates/src/common/AntStyles.tsx.template +0 -8
- package/lib/generators/add-frontend/templates/src/common/createEmotionCache.ts.template +0 -7
- package/lib/generators/add-frontend/templates/src/common/index.ts.template +0 -3
- package/lib/generators/add-frontend/templates/src/common/utils.ts.template +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [5.0.5-alpha.9](https://github.com/cdmbase/common-stack/compare/v5.0.5-alpha.8...v5.0.5-alpha.9) (2024-08-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @common-stack/generate-plugin
|
|
9
|
+
|
|
6
10
|
## [5.0.5-alpha.7](https://github.com/cdmbase/common-stack/compare/v5.0.5-alpha.6...v5.0.5-alpha.7) (2024-08-12)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @common-stack/generate-plugin
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/constants/index.ts"],"sourcesContent":[null],"names":[],"mappings":"aAAO,MAAM,eAAe,GAAG,QAAQ;AAChC,MAAM,kBAAkB,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/constants/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAO,MAAM,eAAe,GAAG,QAAQ;AAChC,MAAM,kBAAkB,GAAG"}
|
|
@@ -6,6 +6,8 @@ const nodeExternals = require('webpack-node-externals');
|
|
|
6
6
|
const NodemonPlugin = require('nodemon-webpack-plugin'); // Ding
|
|
7
7
|
const EnvListPlugin = require('@common-stack/env-list-loader');
|
|
8
8
|
const buildConfig = require('./build.config');
|
|
9
|
+
const { writeBackendModuleFile } = require('@common-stack/rollup-vite-utils/lib/utils/utils.cjs');
|
|
10
|
+
const packageConfig = require('./config.json');
|
|
9
11
|
|
|
10
12
|
const modulenameExtra = process.env.BUILD_MODULE_TO_INCLUDE ? `${process.env.BUILD_MODULE_TO_INCLUDE}|` : '';
|
|
11
13
|
let modulenameRegex;
|
|
@@ -25,6 +27,12 @@ if (process.env.BUILD_MODULE_TO_INCLUDE) {
|
|
|
25
27
|
console.log('BUILD_MODULE_TO_INCLUDE is not set.');
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
try {
|
|
31
|
+
writeBackendModuleFile(path.join(__dirname, 'src/modules'), packageConfig);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error(e);
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
const config = {
|
|
29
37
|
entry: {
|
|
30
38
|
index: (process.env.NODE_ENV !== 'production' ? ['webpack/hot/poll?200'] : []).concat([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),devkit=require('@nx/devkit'),path=require('path'),index=require('../../utils/index.cjs');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var path__namespace=/*#__PURE__*/_interopNamespaceDefault(path);const DEFAULT_FRAMEWORK =
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var tslib=require('tslib'),devkit=require('@nx/devkit'),path=require('path'),index=require('../../utils/index.cjs'),index$1=require('../../constants/index.cjs');function _interopNamespaceDefault(e){var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var path__namespace=/*#__PURE__*/_interopNamespaceDefault(path);const DEFAULT_FRAMEWORK = index$1.FRAMEWORK_ANTUI;
|
|
2
2
|
function addFrontendGenerator(tree, options) {
|
|
3
3
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
4
4
|
const basePath = process.cwd();
|
|
@@ -18,10 +18,26 @@ function addFrontendGenerator(tree, options) {
|
|
|
18
18
|
devkit.generateFiles(tree, path__namespace.join(__dirname, 'frameworks', framework), projectSrc, options);
|
|
19
19
|
devkit.updateJson(tree, `${projectRoot}/package.json`, (packageJson) => {
|
|
20
20
|
packageJson['name'] = projectName;
|
|
21
|
+
if (framework === index$1.FRAMEWORK_ANTUI) {
|
|
22
|
+
packageJson['dependencies']["@admin-layout/ant-design-pro"] = "latest";
|
|
23
|
+
packageJson['dependencies']["@admin-layout/ant-ui"] = "latest";
|
|
24
|
+
packageJson['dependencies']["@adminide-stack/user-auth0-browser-ant"] = "latest";
|
|
25
|
+
}
|
|
26
|
+
else if (framework === index$1.FRAMEWORK_CHAKRAUI) {
|
|
27
|
+
packageJson['dependencies']["@admin-layout/chakra-design-pro"] = "latest";
|
|
28
|
+
packageJson['dependencies']["@admin-layout/chakra-ui"] = "latest";
|
|
29
|
+
packageJson['dependencies']["@adminide-stack/user-auth0-browser-chakra"] = "latest";
|
|
30
|
+
}
|
|
21
31
|
return packageJson;
|
|
22
32
|
});
|
|
23
33
|
devkit.updateJson(tree, `${projectRoot}/config.json`, (configJson) => {
|
|
24
34
|
configJson['uiFramework'] = framework;
|
|
35
|
+
if (framework === index$1.FRAMEWORK_ANTUI) {
|
|
36
|
+
configJson['modules'].push("@admin-layout/ant-design-pro");
|
|
37
|
+
}
|
|
38
|
+
else if (framework === index$1.FRAMEWORK_CHAKRAUI) {
|
|
39
|
+
configJson['modules'].push("@admin-layout/chakra-design-pro");
|
|
40
|
+
}
|
|
25
41
|
return configJson;
|
|
26
42
|
});
|
|
27
43
|
yield devkit.formatFiles(tree);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.cjs","sources":["../../../src/generators/add-frontend/generator.ts"],"sourcesContent":[null],"names":["resetProject","generateFiles","path","updateJson","formatFiles"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.cjs","sources":["../../../src/generators/add-frontend/generator.ts"],"sourcesContent":[null],"names":["FRAMEWORK_ANTUI","resetProject","generateFiles","path","updateJson","FRAMEWORK_CHAKRAUI","formatFiles"],"mappings":"qkBAMA,MAAM,iBAAiB,GAAGA,uBAAe,CAAC;AAEpB,SAAA,oBAAoB,CAAC,IAAU,EAAE,OAAmC,EAAA;;AACtF,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC/B,QAAA,MAAM,WAAW,GAAG,OAAO,CAAC,EAAE,GAAG,CAAY,SAAA,EAAA,OAAO,CAAC,EAAE,CAAA,OAAA,CAAS,GAAG,iBAAiB,CAAC;AACrF,QAAA,MAAM,WAAW,GAAG,OAAO,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gBAClE,WAAW,CAAC,cAAc,CAAC,CAAC,2CAA2C,CAAC,GAAG,QAAQ,CAAC;aACvF;AAED,YAAA,OAAO,WAAW,CAAC;AACvB,SAAC,CAAC,CAAC;QACHD,iBAAU,CAAC,IAAI,EAAE,CAAG,EAAA,WAAW,cAAc,EAAE,CAAC,UAAU,KAAI;AAC1D,YAAA,UAAU,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;AACtC,YAAA,IAAI,SAAS,KAAKJ,uBAAe,EAAE;gBAC/B,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;aAC9D;AAAM,iBAAA,IAAI,SAAS,KAAKK,0BAAkB,EAAE;gBACzC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;aACjE;AAED,YAAA,OAAO,UAAU,CAAC;AACtB,SAAC,CAAC,CAAC;AAEH,QAAA,MAAMC,kBAAW,CAAC,IAAI,CAAC,CAAC;KAC3B,CAAA,CAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {__awaiter}from'tslib';import {generateFiles,updateJson,formatFiles}from'@nx/devkit';import*as path from'path';import {resetProject}from'../../utils/index.mjs';const DEFAULT_FRAMEWORK =
|
|
1
|
+
import {__awaiter}from'tslib';import {generateFiles,updateJson,formatFiles}from'@nx/devkit';import*as path from'path';import {resetProject}from'../../utils/index.mjs';import {FRAMEWORK_ANTUI,FRAMEWORK_CHAKRAUI}from'../../constants/index.mjs';const DEFAULT_FRAMEWORK = FRAMEWORK_ANTUI;
|
|
2
2
|
function addFrontendGenerator(tree, options) {
|
|
3
3
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4
4
|
const basePath = process.cwd();
|
|
@@ -18,10 +18,26 @@ function addFrontendGenerator(tree, options) {
|
|
|
18
18
|
generateFiles(tree, path.join(__dirname, 'frameworks', framework), projectSrc, options);
|
|
19
19
|
updateJson(tree, `${projectRoot}/package.json`, (packageJson) => {
|
|
20
20
|
packageJson['name'] = projectName;
|
|
21
|
+
if (framework === FRAMEWORK_ANTUI) {
|
|
22
|
+
packageJson['dependencies']["@admin-layout/ant-design-pro"] = "latest";
|
|
23
|
+
packageJson['dependencies']["@admin-layout/ant-ui"] = "latest";
|
|
24
|
+
packageJson['dependencies']["@adminide-stack/user-auth0-browser-ant"] = "latest";
|
|
25
|
+
}
|
|
26
|
+
else if (framework === FRAMEWORK_CHAKRAUI) {
|
|
27
|
+
packageJson['dependencies']["@admin-layout/chakra-design-pro"] = "latest";
|
|
28
|
+
packageJson['dependencies']["@admin-layout/chakra-ui"] = "latest";
|
|
29
|
+
packageJson['dependencies']["@adminide-stack/user-auth0-browser-chakra"] = "latest";
|
|
30
|
+
}
|
|
21
31
|
return packageJson;
|
|
22
32
|
});
|
|
23
33
|
updateJson(tree, `${projectRoot}/config.json`, (configJson) => {
|
|
24
34
|
configJson['uiFramework'] = framework;
|
|
35
|
+
if (framework === FRAMEWORK_ANTUI) {
|
|
36
|
+
configJson['modules'].push("@admin-layout/ant-design-pro");
|
|
37
|
+
}
|
|
38
|
+
else if (framework === FRAMEWORK_CHAKRAUI) {
|
|
39
|
+
configJson['modules'].push("@admin-layout/chakra-design-pro");
|
|
40
|
+
}
|
|
25
41
|
return configJson;
|
|
26
42
|
});
|
|
27
43
|
yield formatFiles(tree);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.mjs","sources":["../../../src/generators/add-frontend/generator.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.mjs","sources":["../../../src/generators/add-frontend/generator.ts"],"sourcesContent":[null],"names":[],"mappings":"kPAMA,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEpB,SAAA,oBAAoB,CAAC,IAAU,EAAE,OAAmC,EAAA;;AACtF,QAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC/B,QAAA,MAAM,WAAW,GAAG,OAAO,C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AAC,iCAAiC,CAAC,GAAG,QAAQ,CAAC;gBAC1E,WAAW,CAAC,cAAc,CAAC,CAAC,yBAAyB,CAAC,GAAG,QAAQ,CAAC;gBAClE,WAAW,CAAC,cAAc,CAAC,CAAC,2CAA2C,CAAC,GAAG,QAAQ,CAAC;aACvF;AAED,YAAA,OAAO,WAAW,CAAC;AACvB,SAAC,CAAC,CAAC;QACH,UAAU,CAAC,IAAI,EAAE,CAAG,EAAA,WAAW,cAAc,EAAE,CAAC,UAAU,KAAI;AAC1D,YAAA,UAAU,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;AACtC,YAAA,IAAI,SAAS,KAAK,eAAe,EAAE;gBAC/B,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;aAC9D;AAAM,iBAAA,IAAI,SAAS,KAAK,kBAAkB,EAAE;gBACzC,UAAU,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;aACjE;AAED,YAAA,OAAO,UAAU,CAAC;AACtB,SAAC,CAAC,CAAC;AAEH,QAAA,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;KAC3B,CAAA,CAAA;AAAA"}
|
|
@@ -1,58 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
2
|
+
"commonPaths": {
|
|
3
|
+
"appPath": "app",
|
|
4
|
+
"frontendStackPath": "frontend-stack-react"
|
|
5
|
+
},
|
|
6
|
+
"copyOperations": [
|
|
7
|
+
{
|
|
8
|
+
"packageName": "@common-stack/frontend-stack-react",
|
|
9
|
+
"destPath": "$.commonPaths.frontendStackPath",
|
|
10
|
+
"generateModule": true
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"i18n": {
|
|
14
|
+
"enabled": true,
|
|
15
|
+
"fallbackLng": "en",
|
|
16
|
+
"supportedLngs": [
|
|
17
|
+
"en",
|
|
18
|
+
"de",
|
|
19
|
+
"es"
|
|
5
20
|
],
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"supportedLngs": [
|
|
10
|
-
"en",
|
|
11
|
-
"de",
|
|
12
|
-
"es"
|
|
13
|
-
],
|
|
14
|
-
"defaultNS": "common",
|
|
15
|
-
"react": {
|
|
16
|
-
"useSuspense": false
|
|
17
|
-
},
|
|
18
|
-
"backend": {
|
|
19
|
-
"loadPath": "/cdm-locales/{{lng}}/{{ns}}.json",
|
|
20
|
-
"loadServerPath": "./public/cdm-locales/{{lng}}/{{ns}}.json"
|
|
21
|
-
},
|
|
22
|
-
"packages": [
|
|
23
|
-
]
|
|
21
|
+
"defaultNS": "common",
|
|
22
|
+
"react": {
|
|
23
|
+
"useSuspense": false
|
|
24
24
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"@adminide-stack/extension-module-browser",
|
|
29
|
-
"@adminide-stack/user-auth0-browser",
|
|
30
|
-
"@adminide-stack/user-auth0-browser-ant",
|
|
31
|
-
"@adminide-stack/billing-api-browser",
|
|
32
|
-
"@adminide-stack/registry-api-browser",
|
|
33
|
-
"@adminide-stack/git-api-browser",
|
|
34
|
-
"@adminide-stack/project-mgmt-browser",
|
|
35
|
-
"@adminide-stack/integration-api-client",
|
|
36
|
-
"@adminide-stack/marketplace-module-browser"
|
|
37
|
-
],
|
|
38
|
-
"paths": {
|
|
39
|
-
"lifecycleMiddleware": "@adminide-stack/platform-client/lib/middleware/lifecycleMiddleware.js"
|
|
25
|
+
"backend": {
|
|
26
|
+
"loadPath": "/cdm-locales/{{lng}}/{{ns}}.json",
|
|
27
|
+
"loadServerPath": "./public/cdm-locales/{{lng}}/{{ns}}.json"
|
|
40
28
|
},
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
"packages": [
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"modules": [
|
|
33
|
+
],
|
|
34
|
+
"buildConfig": {
|
|
35
|
+
"__CLIENT__": false,
|
|
36
|
+
"__SERVER__": true,
|
|
37
|
+
"__DEV__": false,
|
|
38
|
+
"__TEST__": false,
|
|
39
|
+
"__CDN_URL__": "",
|
|
40
|
+
"__GRAPHQL_URL__": "http://localhost:8080/graphql",
|
|
41
|
+
"__DEBUGGING__": false,
|
|
42
|
+
"__SSR__": true,
|
|
43
|
+
"__API_URL__": "/graphql",
|
|
44
|
+
"__FRONTEND_BUILD_DIR__": "./dist/client",
|
|
45
|
+
"__WEB_DEV_SERVER_PORT__": 3000,
|
|
46
|
+
"__GRAPHQL_ENDPOINT__": "/graphql",
|
|
47
|
+
"__LOCAL_SERVER_HOST__": "localhost",
|
|
48
|
+
"__BACKEND_URL__": "http://localhost:3000"
|
|
57
49
|
}
|
|
58
|
-
|
|
50
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"version": "
|
|
2
|
+
"name": "sample-stack-frontend-server",
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Sample Client server",
|
|
6
6
|
"homepage": "https://github.com/cdmbase/fullstack-pro#readme",
|
|
@@ -52,8 +52,6 @@
|
|
|
52
52
|
"watch:test": "cross-env ENV_FILE=../../config/test/test.env node ./server.js"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@admin-layout/ant-design-pro": "7.3.8-alpha.29",
|
|
56
|
-
"@admin-layout/ant-ui": "7.3.8-alpha.28",
|
|
57
55
|
"@admin-layout/assets": "7.3.8-alpha.0",
|
|
58
56
|
"@admin-layout/icons": "7.3.8-alpha.0",
|
|
59
57
|
"@adminide-stack/account-api-browser": "7.3.8-alpha.0",
|
|
@@ -9,7 +9,8 @@ import { i18nInternationalizationPlugin } from '@common-stack/rollup-vite-utils/
|
|
|
9
9
|
import { performCopyOperations } from '@common-stack/rollup-vite-utils/lib/preStartup/configLoader/configLoader.js';
|
|
10
10
|
import { loadEnvConfig } from '@common-stack/rollup-vite-utils/lib/preStartup/configLoader/envLoader.js';
|
|
11
11
|
import { cjsInterop } from 'vite-plugin-cjs-interop';
|
|
12
|
-
import
|
|
12
|
+
import { merge } from 'lodash-es';
|
|
13
|
+
import config from './app/cde-webconfig.json' assert { type: 'json' };
|
|
13
14
|
|
|
14
15
|
// This installs globals such as "fetch", "Response", "Request" and "Headers".
|
|
15
16
|
installGlobals();
|
|
@@ -20,7 +21,7 @@ export default defineConfig(({ isSsrBuild }) => {
|
|
|
20
21
|
|
|
21
22
|
const dotEnvResult = loadEnvConfig(directoryName);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
const viteConfig = {
|
|
24
25
|
define: {
|
|
25
26
|
__ENV__: JSON.stringify(dotEnvResult?.parsed),
|
|
26
27
|
...Object.assign(
|
|
@@ -38,7 +39,7 @@ export default defineConfig(({ isSsrBuild }) => {
|
|
|
38
39
|
namespaceResolution: 'basename',
|
|
39
40
|
}),
|
|
40
41
|
cjsInterop({
|
|
41
|
-
dependencies:[
|
|
42
|
+
dependencies: ['@apollo/client'],
|
|
42
43
|
}),
|
|
43
44
|
remix({
|
|
44
45
|
appDirectory: 'src',
|
|
@@ -48,23 +49,29 @@ export default defineConfig(({ isSsrBuild }) => {
|
|
|
48
49
|
}
|
|
49
50
|
const metaJson = await import('./app/sync-meta.json').catch(() => null);
|
|
50
51
|
return defineRoutes((routeFn) => {
|
|
51
|
-
defineRoutesConfig(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
defineRoutesConfig(
|
|
53
|
+
routeFn,
|
|
54
|
+
{
|
|
55
|
+
routesFileName: 'routes.json',
|
|
56
|
+
packages: config.modules,
|
|
57
|
+
paths: config.paths,
|
|
58
|
+
rootPath: resolve(directoryName, '../..'),
|
|
59
|
+
},
|
|
60
|
+
metaJson,
|
|
61
|
+
);
|
|
57
62
|
});
|
|
58
63
|
},
|
|
59
64
|
}),
|
|
60
65
|
tsconfigPaths({ ignoreConfigErrors: true }),
|
|
61
66
|
],
|
|
62
67
|
resolve: {
|
|
63
|
-
// preserveSymlinks: true,
|
|
64
68
|
alias: {
|
|
65
69
|
'@app': resolve(__dirname, 'app'),
|
|
66
70
|
'@src': resolve(__dirname, 'src'),
|
|
67
71
|
},
|
|
68
72
|
},
|
|
69
73
|
};
|
|
74
|
+
|
|
75
|
+
// Deep merge custom Vite config from config.json
|
|
76
|
+
return merge(viteConfig, config.viteConfig);
|
|
70
77
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@common-stack/generate-plugin",
|
|
3
|
-
"version": "5.0.5-alpha.
|
|
3
|
+
"version": "5.0.5-alpha.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"generators": "./generators.json",
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "d7d4bad490dc8927f3a740c24d3532fef22d31fc"
|
|
28
28
|
}
|
|
@@ -2,8 +2,9 @@ import { addProjectConfiguration, formatFiles, generateFiles, Tree, updateJson }
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { AddFrontendGeneratorSchema } from './schema';
|
|
4
4
|
import { resetProject } from '../../utils';
|
|
5
|
+
import { FRAMEWORK_ANTUI, FRAMEWORK_CHAKRAUI } from '../../constants';
|
|
5
6
|
|
|
6
|
-
const DEFAULT_FRAMEWORK =
|
|
7
|
+
const DEFAULT_FRAMEWORK = FRAMEWORK_ANTUI;
|
|
7
8
|
|
|
8
9
|
export async function addFrontendGenerator(tree: Tree, options: AddFrontendGeneratorSchema) {
|
|
9
10
|
const basePath = process.cwd();
|
|
@@ -27,10 +28,26 @@ export async function addFrontendGenerator(tree: Tree, options: AddFrontendGener
|
|
|
27
28
|
generateFiles(tree, path.join(__dirname, 'frameworks', framework), projectSrc, options);
|
|
28
29
|
updateJson(tree, `${projectRoot}/package.json`, (packageJson) => {
|
|
29
30
|
packageJson['name'] = projectName;
|
|
31
|
+
if (framework === FRAMEWORK_ANTUI) {
|
|
32
|
+
packageJson['dependencies']["@admin-layout/ant-design-pro"] = "latest";
|
|
33
|
+
packageJson['dependencies']["@admin-layout/ant-ui"] = "latest";
|
|
34
|
+
packageJson['dependencies']["@adminide-stack/user-auth0-browser-ant"] = "latest";
|
|
35
|
+
} else if (framework === FRAMEWORK_CHAKRAUI) {
|
|
36
|
+
packageJson['dependencies']["@admin-layout/chakra-design-pro"] = "latest";
|
|
37
|
+
packageJson['dependencies']["@admin-layout/chakra-ui"] = "latest";
|
|
38
|
+
packageJson['dependencies']["@adminide-stack/user-auth0-browser-chakra"] = "latest";
|
|
39
|
+
}
|
|
40
|
+
|
|
30
41
|
return packageJson;
|
|
31
42
|
});
|
|
32
43
|
updateJson(tree, `${projectRoot}/config.json`, (configJson) => {
|
|
33
44
|
configJson['uiFramework'] = framework;
|
|
45
|
+
if (framework === FRAMEWORK_ANTUI) {
|
|
46
|
+
configJson['modules'].push("@admin-layout/ant-design-pro");
|
|
47
|
+
} else if (framework === FRAMEWORK_CHAKRAUI) {
|
|
48
|
+
configJson['modules'].push("@admin-layout/chakra-design-pro");
|
|
49
|
+
}
|
|
50
|
+
|
|
34
51
|
return configJson;
|
|
35
52
|
});
|
|
36
53
|
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { ContainerModule, interfaces } from 'inversify';
|
|
2
|
-
import { TaggedType } from '@common-stack/core';
|
|
3
|
-
import { Feature } from '@common-stack/server-core';
|
|
4
|
-
import GitModule from '@adminide-stack/git-api-server';
|
|
5
|
-
import AuthModule from '@adminide-stack/user-auth0-server';
|
|
6
|
-
import OrganizationModule, { AccountPlanModule } from '@adminide-stack/account-api-server';
|
|
7
|
-
import BillingModule from '@adminide-stack/billing-api-server';
|
|
8
|
-
import MarketspaceModule from '@adminide-stack/marketplace-module-server';
|
|
9
|
-
import RegistryModule from '@adminide-stack/registry-api-server';
|
|
10
|
-
import PlatformModule from '@adminide-stack/platform-server/lib/module.js';
|
|
11
|
-
import IntegrationModule from '@adminide-stack/integration-api-server';
|
|
12
|
-
import { EnvironmentService } from '@adminide-stack/platform-server';
|
|
13
|
-
import ExtensionModule from '@adminide-stack/extension-module-server';
|
|
14
|
-
import { IAdminIdeSettings } from '@adminide-stack/core';
|
|
15
|
-
import ProjectMgmtModule from '@adminide-stack/project-mgmt-server';
|
|
16
|
-
import CountryModule from '@container-stack/territory';
|
|
17
|
-
import NotificationModule from '@container-stack/notification-api-server';
|
|
18
|
-
import { config } from '../config';
|
|
19
|
-
const environmentService = new EnvironmentService(null, null);
|
|
20
|
-
|
|
21
|
-
export const settings: IAdminIdeSettings & any = {
|
|
22
|
-
// mongoConnection: generateMongo(config.MONGO_URL),
|
|
23
|
-
subTopic: config.CONNECTION_ID, // usually versioning
|
|
24
|
-
brigadeNamespace: 'brigade',
|
|
25
|
-
brigadeVersion: 'v1',
|
|
26
|
-
environmentService,
|
|
27
|
-
environment: {
|
|
28
|
-
args: ['--builtin-extensions-dir', '', '--disable-extensions', ''],
|
|
29
|
-
},
|
|
30
|
-
adminApiNamespace: config.ADMIN_API_NAMESPACE,
|
|
31
|
-
apiNamespace: config.API_NAMESPACE,
|
|
32
|
-
sshNamespace: config.API_NAMESPACE,
|
|
33
|
-
apiVersion: 'v1',
|
|
34
|
-
activityNamespace: config.ACTIVITY_NAMESPACE,
|
|
35
|
-
activityVersion: '',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const defaultModule = () =>
|
|
39
|
-
new ContainerModule((bind: interfaces.Bind) => {
|
|
40
|
-
bind('Settings').toConstantValue(settings).whenTargetTagged('default', true);
|
|
41
|
-
bind('Settings').toConstantValue(settings).whenTargetTagged('microservice', true);
|
|
42
|
-
bind('Settings').toConstantValue(settings).whenTargetTagged(TaggedType.MICROSERVICE, true);
|
|
43
|
-
bind('IMongoDBSettings').toConstantValue(settings);
|
|
44
|
-
bind('IMongoDBSettings').toConstantValue(settings);
|
|
45
|
-
bind('MongoOptions').toConstantValue({});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const DefaultFeature = new Feature({
|
|
49
|
-
createContainerFunc: [defaultModule],
|
|
50
|
-
createHemeraContainerFunc: [defaultModule],
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
export const ExternalModules = new Feature(CountryModule);
|
|
54
|
-
|
|
55
|
-
let DevModules = new Feature({});
|
|
56
|
-
|
|
57
|
-
if (config.isDev) {
|
|
58
|
-
const MailingModule = require('@container-stack/mailing-api-server');
|
|
59
|
-
DevModules = MailingModule.default;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default new Feature<any>(
|
|
63
|
-
DefaultFeature,
|
|
64
|
-
PlatformModule,
|
|
65
|
-
BillingModule,
|
|
66
|
-
AuthModule,
|
|
67
|
-
IntegrationModule,
|
|
68
|
-
AccountPlanModule,
|
|
69
|
-
GitModule,
|
|
70
|
-
NotificationModule,
|
|
71
|
-
ProjectMgmtModule,
|
|
72
|
-
OrganizationModule,
|
|
73
|
-
ExternalModules,
|
|
74
|
-
ExtensionModule,
|
|
75
|
-
MarketspaceModule,
|
|
76
|
-
DevModules,
|
|
77
|
-
RegistryModule
|
|
78
|
-
);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { createCache as createAntdCache, extractStyle, StyleProvider } from '@ant-design/cssinjs';
|
|
3
|
-
|
|
4
|
-
const antdCache = createAntdCache();
|
|
5
|
-
export const styleSheet = extractStyle(antdCache);
|
|
6
|
-
export const AntSytles = ({ children }: { children: React.ReactNode }) => (
|
|
7
|
-
<StyleProvider cache={antdCache}>{children}</StyleProvider>
|
|
8
|
-
);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { isEmpty } from 'lodash-es';
|
|
2
|
-
|
|
3
|
-
export function jsonToString(json) {
|
|
4
|
-
if (isEmpty(json)) {
|
|
5
|
-
return '';
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (Array.isArray(json)) {
|
|
9
|
-
let arr = json.map((a) => jsonToString(a));
|
|
10
|
-
return arr.join(' ');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const str = JSON.stringify(json);
|
|
14
|
-
const arr = str.split(',');
|
|
15
|
-
return Array.isArray(arr) ? arr.join(' ') : str;
|
|
16
|
-
}
|