@common-stack/generate-plugin 7.0.4-alpha.1 → 7.0.4-alpha.11
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 +40 -0
- package/lib/common/package-releases/package.json +1 -0
- package/lib/common/package-releases/package.json.cjs +1 -0
- package/lib/common/package-releases/package.json.cjs.map +1 -1
- package/lib/common/package-releases/package.json.mjs +1 -0
- package/lib/common/package-releases/package.json.mjs.map +1 -1
- package/lib/generators/add-backend/files/package.json +1 -1
- package/lib/generators/add-frontend/frameworks/antui/src/entry.client.tsx.template +7 -2
- package/lib/generators/add-frontend/frameworks/antui/src/root.tsx.template +2 -1
- package/lib/generators/add-frontend/generator.cjs +1 -1
- package/lib/generators/add-frontend/generator.cjs.map +1 -1
- package/lib/generators/add-frontend/generator.mjs +1 -1
- package/lib/generators/add-frontend/generator.mjs.map +1 -1
- package/lib/generators/add-frontend/templates/package.json +2 -2
- package/lib/generators/add-fullstack/files/_gitignore +3 -0
- package/lib/generators/add-fullstack/files/package.json +3 -3
- package/lib/generators/add-fullstack/files/rollup.config.base.mjs +45 -23
- package/lib/generators/add-fullstack/generator.cjs +7 -1
- package/lib/generators/add-fullstack/generator.cjs.map +1 -1
- package/lib/generators/add-fullstack/generator.mjs +7 -1
- package/lib/generators/add-fullstack/generator.mjs.map +1 -1
- package/lib/generators/add-fullstack/schema.d.ts +10 -0
- package/lib/generators/add-fullstack/updates/nxSetup.cjs +114 -58
- package/lib/generators/add-fullstack/updates/nxSetup.cjs.map +1 -1
- package/lib/generators/add-fullstack/updates/nxSetup.d.ts +1 -1
- package/lib/generators/add-fullstack/updates/nxSetup.mjs +114 -58
- package/lib/generators/add-fullstack/updates/nxSetup.mjs.map +1 -1
- package/lib/generators/add-moleculer/files/package.json +5 -5
- package/lib/generators/add-package/files/browser/package.json +1 -1
- package/lib/generators/add-package/files/browser/rollup.config.mjs +1 -1
- package/lib/generators/add-package/files/browser/tsconfig.json +15 -27
- package/lib/generators/add-package/files/client/rollup.config.mjs +30 -25
- package/lib/generators/add-package/files/client/tsconfig.json +13 -26
- package/lib/generators/add-package/files/core/rollup.config.mjs +33 -61
- package/lib/generators/add-package/files/core/tsconfig.json +12 -21
- package/lib/generators/add-package/files/server/package.json +3 -3
- package/lib/generators/add-package/files/server/rollup.config.mjs +31 -24
- package/lib/generators/add-package/files/server/tsconfig.json +15 -25
- package/lib/generators/add-package/generator.cjs +53 -11
- package/lib/generators/add-package/generator.cjs.map +1 -1
- package/lib/generators/add-package/generator.d.ts +4 -1
- package/lib/generators/add-package/generator.mjs +53 -11
- package/lib/generators/add-package/generator.mjs.map +1 -1
- package/package.json +3 -3
- package/src/common/package-releases/package.json +1 -0
- package/src/generators/add-backend/files/package.json +1 -1
- package/src/generators/add-frontend/frameworks/antui/src/entry.client.tsx.template +7 -2
- package/src/generators/add-frontend/frameworks/antui/src/root.tsx.template +2 -1
- package/src/generators/add-frontend/generator.ts +1 -1
- package/src/generators/add-frontend/templates/package.json +2 -2
- package/src/generators/add-fullstack/files/_gitignore +3 -0
- package/src/generators/add-fullstack/files/package.json +3 -3
- package/src/generators/add-fullstack/files/rollup.config.base.mjs +45 -23
- package/src/generators/add-fullstack/generator.ts +8 -2
- package/src/generators/add-fullstack/schema.ts +10 -0
- package/src/generators/add-fullstack/updates/nxSetup.ts +123 -73
- package/src/generators/add-moleculer/files/package.json +5 -5
- package/src/generators/add-package/files/browser/package.json +1 -1
- package/src/generators/add-package/files/browser/rollup.config.mjs +1 -1
- package/src/generators/add-package/files/browser/tsconfig.json +15 -27
- package/src/generators/add-package/files/client/rollup.config.mjs +30 -25
- package/src/generators/add-package/files/client/tsconfig.json +13 -26
- package/src/generators/add-package/files/core/rollup.config.mjs +33 -61
- package/src/generators/add-package/files/core/tsconfig.json +12 -21
- package/src/generators/add-package/files/server/package.json +3 -3
- package/src/generators/add-package/files/server/rollup.config.mjs +31 -24
- package/src/generators/add-package/files/server/tsconfig.json +15 -25
- package/src/generators/add-package/generator.ts +75 -17
- package/lib/generators/add-package/files/browser/webpack.config.js +0 -71
- package/lib/generators/add-package/files/client/webpack.config.js +0 -72
- package/lib/generators/add-package/files/core/webpack.config.js +0 -53
- package/src/generators/add-package/files/browser/webpack.config.js +0 -71
- package/src/generators/add-package/files/client/webpack.config.js +0 -72
- package/src/generators/add-package/files/core/webpack.config.js +0 -53
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"common": "link:./common"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@common-stack/frontend-stack-react": "7.0.4-alpha.
|
|
59
|
+
"@common-stack/frontend-stack-react": "7.0.4-alpha.9",
|
|
60
60
|
"@react-icons/all-files": "^4.1.0",
|
|
61
61
|
"classnames": "^2.2.6",
|
|
62
62
|
"compression": "^1.7.4",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@cdmbase/vite-plugin-i18next-loader": "^2.0.12",
|
|
84
|
-
"@common-stack/rollup-vite-utils": "7.0.4-alpha.
|
|
84
|
+
"@common-stack/rollup-vite-utils": "7.0.4-alpha.8",
|
|
85
85
|
"@remix-run/dev": "~2.10.1",
|
|
86
86
|
"@remix-run/serve": "~2.10.1",
|
|
87
87
|
"cross-env": "^7.0.3",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"devpublish:push": "yarn predevpublish && git push origin $PUBLISH_BRANCH && yarn postdevpublish",
|
|
53
53
|
"format": "yarn lint --fix",
|
|
54
54
|
"format:md": "yarn lint:md --fix",
|
|
55
|
-
"pregenerateGraphql": " node --experimental-modules tools/codegenGenerator.mjs",
|
|
56
55
|
"generateGraphql": "graphql-codegen-esm",
|
|
57
56
|
"postgenerateGraphql": "lerna run watch --scope=common",
|
|
58
57
|
"generateGraphql:watch": "yarn generateGraphql -- --watch",
|
|
@@ -77,6 +76,7 @@
|
|
|
77
76
|
"publish:forceManual": "yarn lernapublish --force-publish=*",
|
|
78
77
|
"publish:push": "yarn prelernapublish && git push origin publish && yarn postlernapublish",
|
|
79
78
|
"push-develop": "git push origin develop",
|
|
79
|
+
"regenerateGraphql": " node --experimental-modules tools/codegenGenerator.mjs",
|
|
80
80
|
"setBranchEnv": "cross-env REPOSITORY_BRANCH=${1:-$REPOSITORY_BRANCH} PUBLISH_BRANCH=${2:-$PUBLISH_BRANCH}",
|
|
81
81
|
"sort-packages": "node tools/sortPackageJson.mjs && prettier --write package.json **/**/*/package.json **/*/package.json",
|
|
82
82
|
"start": "cross-env NODE_ENV=development ENV_FILE=../../config/development/dev.env yarn startWeb",
|
|
@@ -145,8 +145,8 @@
|
|
|
145
145
|
"@babel/register": "^7.18.9",
|
|
146
146
|
"@babel/runtime": "^7.20.1",
|
|
147
147
|
"@common-stack/env-list-loader": "7.0.4-alpha.0",
|
|
148
|
-
"@common-stack/generate-plugin": "7.0.4-alpha.
|
|
149
|
-
"@common-stack/rollup-vite-utils": "7.0.4-alpha.
|
|
148
|
+
"@common-stack/generate-plugin": "7.0.4-alpha.10",
|
|
149
|
+
"@common-stack/rollup-vite-utils": "7.0.4-alpha.8",
|
|
150
150
|
"@emotion/babel-plugin": "^11.11.0",
|
|
151
151
|
"@graphql-codegen/add": "^5.0.3",
|
|
152
152
|
"@graphql-codegen/cli": "^5.0.4",
|
|
@@ -2,16 +2,22 @@
|
|
|
2
2
|
import graphql from '@rollup/plugin-graphql';
|
|
3
3
|
import image from '@rollup/plugin-image';
|
|
4
4
|
import typescript from '@rollup/plugin-typescript';
|
|
5
|
+
import esbuild from 'rollup-plugin-esbuild'
|
|
5
6
|
import { string } from 'rollup-plugin-string';
|
|
6
7
|
import svg from 'rollup-plugin-svg';
|
|
7
8
|
import { copy } from '@web/rollup-plugin-copy';
|
|
9
|
+
import json from '@rollup/plugin-json';
|
|
8
10
|
import modifyLibFilesPlugin from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginModifyLibFiles.js';
|
|
9
11
|
import generateJsonFromObject from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginGenerateJson.js';
|
|
10
12
|
import addJsExtensionToImportsPlugin from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginAddJsExtension.js';
|
|
11
13
|
import { ignoreCssUrlPlugin } from '@common-stack/rollup-vite-utils/lib/rollup/pluginIgnore.js';
|
|
12
14
|
// Define any additional plugins specific to this bundle
|
|
13
15
|
const additionalPlugins = [
|
|
14
|
-
copy({
|
|
16
|
+
copy({
|
|
17
|
+
patterns: ['**/cdm-locales/**/*', '**/*.gql', '**/**/*.graphql', '**/styles/**/*', '**/templates/**/*', '**/css/**/*'],
|
|
18
|
+
rootDir: './src',
|
|
19
|
+
}),
|
|
20
|
+
json(),
|
|
15
21
|
];
|
|
16
22
|
|
|
17
23
|
function deepMergeConfigs(baseConfig, specificConfig) {
|
|
@@ -35,39 +41,55 @@ const baseConfig = {
|
|
|
35
41
|
include: ['**/*.ejs', '**/*.graphql'],
|
|
36
42
|
}),
|
|
37
43
|
addJsExtensionToImportsPlugin({
|
|
38
|
-
packages: '
|
|
39
|
-
needToAddIndexJs: [],
|
|
44
|
+
packages: ['@react-icons/all-files', '@apollo/client', '@vscode-alt/monaco-editor'],
|
|
45
|
+
needToAddIndexJs: ['@apollo/client'],
|
|
40
46
|
excludeImports: ['@emotion/react/jsx-runtime'],
|
|
41
47
|
}),
|
|
42
|
-
typescript(), //
|
|
48
|
+
typescript(), // Initially include the TypeScript plugin
|
|
43
49
|
ignoreCssUrlPlugin(),
|
|
44
|
-
modifyLibFilesPlugin({
|
|
45
|
-
include: ['**/**/compute.js'], // Adjust to target specific files or patterns
|
|
46
|
-
outputDir: 'lib', // Ensure this matches your actual output directory
|
|
47
|
-
}),
|
|
48
|
-
generateJsonFromObject({}),
|
|
49
|
-
|
|
50
50
|
...additionalPlugins,
|
|
51
51
|
],
|
|
52
52
|
external: (id) => !/^[./]/.test(id),
|
|
53
53
|
globals: { react: 'React' },
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
// Updated createRollupConfig function to accept an options object as the second parameter.
|
|
57
|
+
// If useEsbuild is true, the TypeScript plugin is removed completely and replaced with the esbuild plugin.
|
|
58
|
+
function createRollupConfig(specificOverrides, options = {}) {
|
|
59
|
+
const { useEsbuild, isWatchMode, generateRoutesJSON } = options;
|
|
60
|
+
const config = deepMergeConfigs(baseConfig, specificOverrides);
|
|
59
61
|
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
// Conditionally add both modifyLibFilesPlugin and generateJsonFromObject plugins if generateRoutesJSON option is provided.
|
|
63
|
+
if (generateRoutesJSON) {
|
|
64
|
+
// Add modifyLibFilesPlugin with predetermined configuration.
|
|
65
|
+
config.plugins.push(modifyLibFilesPlugin({
|
|
66
|
+
include: ['**/**/compute.js'], // Adjust to target specific files or patterns
|
|
67
|
+
outputDir: 'lib', // Ensure this matches your actual output directory
|
|
68
|
+
}));
|
|
69
|
+
// Allow generateRoutesJSON to be an object with plugin configuration or simply a boolean.
|
|
70
|
+
const jsonConfig = typeof generateRoutesJSON === 'object' ? generateRoutesJSON : {};
|
|
71
|
+
config.plugins.push(generateJsonFromObject(jsonConfig));
|
|
72
|
+
}
|
|
70
73
|
|
|
74
|
+
if (useEsbuild) {
|
|
75
|
+
// Remove the TypeScript plugin completely.
|
|
76
|
+
config.plugins = config.plugins.filter((plugin) => plugin.name !== 'typescript');
|
|
77
|
+
// Add the esbuild plugin only. Note: The "watch" option is removed as it's not supported by esbuild.
|
|
78
|
+
config.plugins.push(esbuild({
|
|
79
|
+
target: 'es2017', // Adjust the target as needed
|
|
80
|
+
}));
|
|
81
|
+
} else {
|
|
82
|
+
// Retain the TypeScript plugin and adjust its options based on watch mode.
|
|
83
|
+
config.plugins = config.plugins.map((plugin) => {
|
|
84
|
+
if (plugin.name === 'typescript') {
|
|
85
|
+
return typescript({
|
|
86
|
+
...plugin.options,
|
|
87
|
+
noEmitOnError: !isWatchMode, // Adjust based on watch mode
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return plugin;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
71
93
|
return config;
|
|
72
94
|
}
|
|
73
95
|
|
|
@@ -24,13 +24,15 @@ import {
|
|
|
24
24
|
setupNpmAuth,
|
|
25
25
|
setupNxConfig,
|
|
26
26
|
} from './updates';
|
|
27
|
-
// import { generateBackend, generateFrontend } from '../../index';
|
|
28
27
|
import { addBackendGenerator as generateBackend } from '../add-backend/generator';
|
|
29
28
|
import { addFrontendGenerator as generateFrontend } from '../add-frontend/generator';
|
|
30
29
|
import { addMoleculerGenerator as generateMoleculer } from '../add-moleculer/generator';
|
|
31
30
|
import { addPackageGenerator as generatePackage } from '../add-package/generator';
|
|
32
31
|
|
|
33
32
|
export async function addFullstackGenerator(tree: Tree, options: AddFullstackGeneratorSchema) {
|
|
33
|
+
// Immediately set the environment variable to skip NX config
|
|
34
|
+
process.env.SKIP_NX_CONFIG = 'true';
|
|
35
|
+
|
|
34
36
|
let projectPath = options.path || '';
|
|
35
37
|
if (projectPath !== '') {
|
|
36
38
|
const basePath = process.cwd();
|
|
@@ -90,7 +92,11 @@ export async function addFullstackGenerator(tree: Tree, options: AddFullstackGen
|
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
|
|
93
|
-
//
|
|
95
|
+
// Setup Nx config with AWS credentials
|
|
96
|
+
// Allow skipping via environment variable
|
|
97
|
+
if (options.skipNxConfig) {
|
|
98
|
+
process.env.SKIP_NX_CONFIG = 'true';
|
|
99
|
+
}
|
|
94
100
|
await setupNxConfig(tree, projectRoot);
|
|
95
101
|
|
|
96
102
|
// Setup git and commit files
|
|
@@ -3,93 +3,143 @@ import * as path from 'path';
|
|
|
3
3
|
import * as readline from 'readline';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Sets up Nx configuration with optional AWS credentials
|
|
7
7
|
*/
|
|
8
8
|
export async function setupNxConfig(tree: Tree, projectRoot: string) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
9
|
+
console.log('\nAWS Configuration for Nx Cache');
|
|
10
|
+
console.log('=============================');
|
|
11
|
+
console.log('This project uses AWS S3 for remote caching with Nx.');
|
|
12
|
+
console.log('Please provide your AWS credentials or press Enter to skip for now.');
|
|
13
|
+
|
|
14
|
+
// Basic configuration without AWS credentials
|
|
15
|
+
const basicConfig = {
|
|
16
|
+
tasksRunnerOptions: {
|
|
17
|
+
default: {
|
|
18
|
+
runner: 'nx/tasks-runners/default',
|
|
19
|
+
options: {
|
|
20
|
+
cacheableOperations: ['build', 'test', 'lint'],
|
|
21
|
+
accessibleHosts: ['https://registry.npmjs.org'],
|
|
22
|
+
useDaemonProcess: false,
|
|
23
|
+
parallel: 3,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const nxJsonPath = path.join(projectRoot, 'nx.json');
|
|
30
|
+
|
|
31
|
+
// Safe prompt function with timeout that returns a string
|
|
32
|
+
const askWithTimeout = (rl: readline.Interface, question: string, timeoutMs = 10000): Promise<string> => {
|
|
33
|
+
return new Promise<string>((resolve) => {
|
|
34
|
+
let resolved = false;
|
|
35
|
+
|
|
36
|
+
const timeout = setTimeout(() => {
|
|
37
|
+
if (!resolved) {
|
|
38
|
+
resolved = true;
|
|
39
|
+
console.log(`\nTimeout waiting for input. Skipping.`);
|
|
40
|
+
resolve('');
|
|
41
|
+
}
|
|
42
|
+
}, timeoutMs);
|
|
43
|
+
|
|
44
|
+
rl.question(question, (answer: string) => {
|
|
45
|
+
if (!resolved) {
|
|
46
|
+
resolved = true;
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
resolve(answer);
|
|
49
|
+
}
|
|
42
50
|
});
|
|
43
51
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
let rl: readline.Interface | undefined;
|
|
55
|
+
try {
|
|
56
|
+
rl = readline.createInterface({
|
|
57
|
+
input: process.stdin,
|
|
58
|
+
output: process.stdout,
|
|
50
59
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const nxJsonPath = path.join(projectRoot, 'nx.json');
|
|
60
|
+
|
|
61
|
+
// Ask for AWS credentials with timeouts
|
|
62
|
+
const accessKeyId = await askWithTimeout(rl, 'AWS Access Key ID (press Enter to skip): ');
|
|
63
|
+
|
|
64
|
+
// If user skips, create basic config
|
|
65
|
+
if (!accessKeyId || accessKeyId === '') {
|
|
66
|
+
console.log('Skipping AWS configuration. Creating basic nx.json.');
|
|
67
|
+
// Check if nx.json exists and update or create
|
|
60
68
|
if (tree.exists(nxJsonPath)) {
|
|
61
69
|
updateJson(tree, nxJsonPath, (json) => {
|
|
62
|
-
// Preserve the existing configuration, just update the AWS credentials
|
|
63
70
|
if (!json.tasksRunnerOptions) {
|
|
64
|
-
json.tasksRunnerOptions =
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (!json.tasksRunnerOptions.default) {
|
|
68
|
-
json.tasksRunnerOptions.default = {
|
|
69
|
-
runner: '@nx-aws-plugin/nx-aws-cache',
|
|
70
|
-
options: {
|
|
71
|
-
runtimeCacheInputs: ['node --version']
|
|
72
|
-
}
|
|
73
|
-
};
|
|
71
|
+
json.tasksRunnerOptions = basicConfig.tasksRunnerOptions;
|
|
74
72
|
}
|
|
75
|
-
|
|
76
|
-
// Update only the AWS credentials
|
|
77
|
-
json.tasksRunnerOptions.default.options = {
|
|
78
|
-
...json.tasksRunnerOptions.default.options,
|
|
79
|
-
awsAccessKeyId,
|
|
80
|
-
awsSecretAccessKey,
|
|
81
|
-
awsRegion,
|
|
82
|
-
awsBucket
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
console.log('Updated nx.json with AWS configuration');
|
|
86
73
|
return json;
|
|
87
74
|
});
|
|
75
|
+
} else {
|
|
76
|
+
tree.write(nxJsonPath, JSON.stringify(basicConfig, null, 2));
|
|
88
77
|
}
|
|
89
78
|
} else {
|
|
90
|
-
|
|
79
|
+
// Get remaining AWS info
|
|
80
|
+
const secretAccessKey = await askWithTimeout(rl, 'AWS Secret Access Key: ');
|
|
81
|
+
const region = (await askWithTimeout(rl, 'AWS Region (default: us-east-1): ')) || 'us-east-1';
|
|
82
|
+
const bucketName = await askWithTimeout(rl, 'AWS S3 Bucket Name: ');
|
|
83
|
+
|
|
84
|
+
// Only add AWS config if all fields are provided
|
|
85
|
+
if (secretAccessKey && bucketName) {
|
|
86
|
+
// Use type assertion to avoid TypeScript errors
|
|
87
|
+
const awsConfig = { ...basicConfig };
|
|
88
|
+
// Use "as any" to bypass type checking
|
|
89
|
+
(awsConfig.tasksRunnerOptions.default.options as any) = {
|
|
90
|
+
...awsConfig.tasksRunnerOptions.default.options,
|
|
91
|
+
cacheDirectory: '.nx/cache',
|
|
92
|
+
remoteCache: {
|
|
93
|
+
s3: {
|
|
94
|
+
accessKeyId,
|
|
95
|
+
secretAccessKey,
|
|
96
|
+
region,
|
|
97
|
+
bucketName,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Update or create nx.json with AWS config
|
|
103
|
+
if (tree.exists(nxJsonPath)) {
|
|
104
|
+
updateJson(tree, nxJsonPath, () => awsConfig);
|
|
105
|
+
console.log('Updated nx.json with AWS configuration.');
|
|
106
|
+
} else {
|
|
107
|
+
tree.write(nxJsonPath, JSON.stringify(awsConfig, null, 2));
|
|
108
|
+
console.log('Created nx.json with AWS configuration.');
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
console.log('Incomplete AWS information. Creating basic nx.json.');
|
|
112
|
+
// Create basic config without AWS
|
|
113
|
+
if (tree.exists(nxJsonPath)) {
|
|
114
|
+
updateJson(tree, nxJsonPath, (json) => {
|
|
115
|
+
if (!json.tasksRunnerOptions) {
|
|
116
|
+
json.tasksRunnerOptions = basicConfig.tasksRunnerOptions;
|
|
117
|
+
}
|
|
118
|
+
return json;
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
tree.write(nxJsonPath, JSON.stringify(basicConfig, null, 2));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
91
124
|
}
|
|
92
125
|
} catch (error) {
|
|
93
126
|
console.error('Error setting up Nx configuration:', error);
|
|
127
|
+
// Fallback to basic config
|
|
128
|
+
if (tree.exists(nxJsonPath)) {
|
|
129
|
+
updateJson(tree, nxJsonPath, (json) => {
|
|
130
|
+
if (!json.tasksRunnerOptions) {
|
|
131
|
+
json.tasksRunnerOptions = basicConfig.tasksRunnerOptions;
|
|
132
|
+
}
|
|
133
|
+
return json;
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
tree.write(nxJsonPath, JSON.stringify(basicConfig, null, 2));
|
|
137
|
+
}
|
|
138
|
+
} finally {
|
|
139
|
+
// Ensure readline interface is closed
|
|
140
|
+
if (rl) {
|
|
141
|
+
rl.close();
|
|
142
|
+
}
|
|
143
|
+
console.log('Nx configuration setup complete.');
|
|
94
144
|
}
|
|
95
|
-
}
|
|
145
|
+
}
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"common": "link:./common"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@common-stack/client-core": "7.0.4-alpha.
|
|
33
|
-
"@common-stack/core": "7.0.4-alpha.
|
|
34
|
-
"@common-stack/server-core": "7.0.4-alpha.
|
|
35
|
-
"@common-stack/server-stack": "7.0.4-alpha.
|
|
36
|
-
"@common-stack/store-mongo": "7.0.4-alpha.
|
|
32
|
+
"@common-stack/client-core": "7.0.4-alpha.6",
|
|
33
|
+
"@common-stack/core": "7.0.4-alpha.6",
|
|
34
|
+
"@common-stack/server-core": "7.0.4-alpha.9",
|
|
35
|
+
"@common-stack/server-stack": "7.0.4-alpha.10",
|
|
36
|
+
"@common-stack/store-mongo": "7.0.4-alpha.10",
|
|
37
37
|
"@container-stack/mailing-api": "5.2.1-alpha.1",
|
|
38
38
|
"helmet": "^3.21.2",
|
|
39
39
|
"react": "18.2.0",
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
],
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"include": [
|
|
18
|
-
"src"
|
|
19
|
-
],
|
|
20
|
-
"exclude": [
|
|
21
|
-
"../../../node_modules",
|
|
22
|
-
"node_modules",
|
|
23
|
-
"lib",
|
|
24
|
-
"lib",
|
|
25
|
-
"webpack.config.js",
|
|
26
|
-
"rollup.config.mjs"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
2
|
+
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "lib",
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"noImplicitAny": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"lib": ["es6", "dom", "esnext", "es2015.core"],
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"jsx": "react"
|
|
13
|
+
},
|
|
14
|
+
"include": ["src"],
|
|
15
|
+
"exclude": ["node_modules", "lib"]
|
|
16
|
+
}
|
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
import { createRollupConfig } from '
|
|
1
|
+
import { createRollupConfig } from '<%= offsetFromRoot %>rollup.config.base.mjs';
|
|
2
2
|
|
|
3
3
|
// Define any additional plugins specific to this bundle
|
|
4
|
-
const additionalPlugins = [
|
|
5
|
-
];
|
|
4
|
+
const additionalPlugins = [];
|
|
6
5
|
|
|
7
6
|
// Use the createRollupConfig function to merge the base and specific configurations
|
|
8
|
-
export default
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]
|
|
7
|
+
export default (commandLineArgs) => {
|
|
8
|
+
const isWatchMode = commandLineArgs.watch;
|
|
9
|
+
return [
|
|
10
|
+
createRollupConfig({
|
|
11
|
+
input: ['src/index.ts'],
|
|
12
|
+
plugins: [
|
|
13
|
+
// Spread in additional plugins specific to this config
|
|
14
|
+
...additionalPlugins,
|
|
15
|
+
],
|
|
16
|
+
output: [
|
|
17
|
+
{
|
|
18
|
+
dir: 'lib',
|
|
19
|
+
format: 'es',
|
|
20
|
+
name: 'Accounts',
|
|
21
|
+
compact: true,
|
|
22
|
+
exports: 'named',
|
|
23
|
+
sourcemap: true,
|
|
24
|
+
preserveModules: true,
|
|
25
|
+
chunkFileNames: '[name]-[hash].[format].js',
|
|
26
|
+
globals: { react: 'React' },
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
}, {
|
|
30
|
+
isWatchMode,
|
|
31
|
+
generateRoutesJSON: false,
|
|
32
|
+
}),
|
|
33
|
+
];
|
|
34
|
+
};
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
]
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
"include": [
|
|
17
|
-
"src"
|
|
18
|
-
],
|
|
19
|
-
"exclude": [
|
|
20
|
-
"../../../node_modules",
|
|
21
|
-
"node_modules",
|
|
22
|
-
"lib",
|
|
23
|
-
"lib",
|
|
24
|
-
"webpack.config.js",
|
|
25
|
-
"rollup.config.mjs"
|
|
26
|
-
]
|
|
27
|
-
}
|
|
2
|
+
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react",
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"outDir": "lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationDir": "lib",
|
|
9
|
+
"types": ["@types/node", "@types/jest", "../../../typings"],
|
|
10
|
+
"skipLibCheck": true
|
|
11
|
+
},
|
|
12
|
+
"include": ["src"],
|
|
13
|
+
"exclude": ["../../../node_modules", "node_modules", "lib", "webpack.config.js", "rollup.config.mjs"]
|
|
14
|
+
}
|