@common-stack/generate-plugin 6.0.8-alpha.31 → 6.0.8-alpha.33

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 CHANGED
@@ -3,6 +3,14 @@
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
+ ## [6.0.8-alpha.33](https://github.com/cdmbase/common-stack/compare/v6.0.8-alpha.32...v6.0.8-alpha.33) (2025-01-31)
7
+
8
+ **Note:** Version bump only for package @common-stack/generate-plugin
9
+
10
+ ## [6.0.8-alpha.32](https://github.com/cdmbase/common-stack/compare/v6.0.8-alpha.31...v6.0.8-alpha.32) (2025-01-31)
11
+
12
+ **Note:** Version bump only for package @common-stack/generate-plugin
13
+
6
14
  ## [6.0.8-alpha.31](https://github.com/cdmbase/common-stack/compare/v6.0.8-alpha.30...v6.0.8-alpha.31) (2025-01-27)
7
15
 
8
16
  **Note:** Version bump only for package @common-stack/generate-plugin
@@ -70,12 +70,12 @@
70
70
  "@cdm-logger/client": "^9.0.3",
71
71
  "@cdm-logger/server": "^9.0.3",
72
72
  "@cdmbase/graphql-type-uri": "^4.0.0",
73
- "@common-stack/cache-api-server": "6.0.8-alpha.30",
74
- "@common-stack/client-core": "6.0.8-alpha.30",
75
- "@common-stack/core": "6.0.8-alpha.30",
76
- "@common-stack/server-core": "6.0.8-alpha.30",
77
- "@common-stack/server-stack": "6.0.8-alpha.30",
78
- "@common-stack/store-mongo": "6.0.8-alpha.30",
73
+ "@common-stack/cache-api-server": "6.0.8-alpha.31",
74
+ "@common-stack/client-core": "6.0.8-alpha.31",
75
+ "@common-stack/core": "6.0.8-alpha.31",
76
+ "@common-stack/server-core": "6.0.8-alpha.31",
77
+ "@common-stack/server-stack": "6.0.8-alpha.32",
78
+ "@common-stack/store-mongo": "6.0.8-alpha.31",
79
79
  "@graphql-tools/links": "~9.0.1",
80
80
  "@graphql-tools/schema": "~10.0.6",
81
81
  "@graphql-tools/stitch": "~9.2.10",
@@ -63,13 +63,13 @@
63
63
  "@apollo/client": "^3.9.0",
64
64
  "@cdm-logger/client": "^9.0.3",
65
65
  "@cdm-logger/server": "^9.0.3",
66
- "@common-stack/cache-api-server": "6.0.8-alpha.30",
67
- "@common-stack/client-core": "6.0.8-alpha.30",
68
- "@common-stack/client-react": "6.0.8-alpha.30",
69
- "@common-stack/components-pro": "6.0.8-alpha.30",
70
- "@common-stack/core": "6.0.8-alpha.30",
71
- "@common-stack/remix-router-redux": "6.0.8-alpha.30",
72
- "@common-stack/server-core": "6.0.8-alpha.30",
66
+ "@common-stack/cache-api-server": "6.0.8-alpha.31",
67
+ "@common-stack/client-core": "6.0.8-alpha.31",
68
+ "@common-stack/client-react": "6.0.8-alpha.31",
69
+ "@common-stack/components-pro": "6.0.8-alpha.31",
70
+ "@common-stack/core": "6.0.8-alpha.31",
71
+ "@common-stack/remix-router-redux": "6.0.8-alpha.31",
72
+ "@common-stack/server-core": "6.0.8-alpha.31",
73
73
  "@reduxjs/toolkit": "^2.2.6",
74
74
  "@remix-run/express": "~2.10.1",
75
75
  "@remix-run/node": "~2.10.1",
@@ -4,6 +4,7 @@ FROM node:20.16-bullseye
4
4
  ENV PYTHON=/usr/bin/python
5
5
 
6
6
  COPY .npmrc package.json /tmp/
7
+ COPY common /tmp/common
7
8
 
8
9
  RUN set -ex \
9
10
  && cd /tmp \
@@ -13,6 +14,7 @@ RUN set -ex \
13
14
  && rm -f /tmp/.npmrc \
14
15
  && mkdir -p /home/app \
15
16
  && cp -a /tmp/node_modules /home/app/ \
17
+ && cp -a /tmp/common /home/app/common \
16
18
  && rm -Rf /tmp/*
17
19
 
18
20
  WORKDIR /home/app
@@ -57,12 +57,13 @@
57
57
  "watch:test": "cross-env NODE_ENV=test ENV_FILE=../../config/test/test.env yarn build:test && yarn start:test"
58
58
  },
59
59
  "resolutions": {
60
+ "common": "link:./common",
60
61
  "html-to-text": "^8.0.0"
61
62
  },
62
63
  "dependencies": {
63
64
  "@apollo/client": "^3.9.0",
64
65
  "@babel/runtime": "^7.20.1",
65
- "@common-stack/server-stack": "6.0.8-alpha.30",
66
+ "@common-stack/server-stack": "6.0.8-alpha.32",
66
67
  "@remix-run/node": "~2.10.1",
67
68
  "lodash": "^4.17.15",
68
69
  "react": "18.2.0"
@@ -5,6 +5,9 @@ ENV PYTHON=/usr/bin/python
5
5
 
6
6
  COPY .npmrc package.json /tmp/
7
7
 
8
+ # Copy the common package to the temporary directory
9
+ COPY common /tmp/common
10
+
8
11
  RUN set -ex \
9
12
  && cd /tmp \
10
13
  && npm install -g node-gyp \
@@ -13,6 +16,7 @@ RUN set -ex \
13
16
  && rm -f /tmp/.npmrc \
14
17
  && mkdir -p /home/app \
15
18
  && cp -a /tmp/node_modules /home/app/ \
19
+ && cp -a /tmp/common /home/app/common \
16
20
  && rm -Rf /tmp/*
17
21
 
18
22
 
@@ -51,8 +51,11 @@
51
51
  "watch:staging": "cross-env ENV_FILE=../../config/staging/staging.env node ./server.js",
52
52
  "watch:test": "cross-env ENV_FILE=../../config/test/test.env node ./server.js"
53
53
  },
54
+ "resolutions": {
55
+ "common": "link:./common"
56
+ },
54
57
  "dependencies": {
55
- "@common-stack/frontend-stack-react": "6.0.8-alpha.30",
58
+ "@common-stack/frontend-stack-react": "6.0.8-alpha.31",
56
59
  "@react-icons/all-files": "^4.1.0",
57
60
  "classnames": "^2.2.6",
58
61
  "compression": "^1.7.4",
@@ -77,7 +80,7 @@
77
80
  },
78
81
  "devDependencies": {
79
82
  "@cdmbase/vite-plugin-i18next-loader": "^2.0.12",
80
- "@common-stack/rollup-vite-utils": "6.0.8-alpha.30",
83
+ "@common-stack/rollup-vite-utils": "6.0.8-alpha.31",
81
84
  "@remix-run/dev": "~2.10.1",
82
85
  "@remix-run/serve": "~2.10.1",
83
86
  "cross-env": "^7.0.3",
@@ -0,0 +1,109 @@
1
+ {
2
+ "servers": ["servers/frontend-server/config.json", "servers/backend-server/config.json"],
3
+ "codegen": {
4
+ "outputFile": "codegen.ts",
5
+ "rootSchema": "servers/backend-server/src/api/root-schema.graphqls",
6
+ "fullConfig": {
7
+ "overwrite": true,
8
+ "schema": ["$PRIMARY_SCHEMA_PLACEHOLDER$"],
9
+ "generates": {
10
+ "packages/common/src/generated/generated-models.ts": {
11
+ "schema": "%discoveredSchemas%",
12
+ "documents": "%discoveredDocuments%",
13
+ "config": {
14
+ "scalars": {
15
+ "URI": "URI",
16
+ "URIInput": "URI | UriComponents"
17
+ },
18
+ "enumValues": {
19
+ "ConfigurationScope": "@workbench-stack/core/lib/interfaces/configuration/configuration.js#ConfigurationScope",
20
+ "ConfigurationTarget": "../configuration#ConfigurationTarget"
21
+ },
22
+ "constEnums": false,
23
+ "contextType": "../apollo-context#MyContext",
24
+ "withHooks": true,
25
+ "typesPrefix": "I",
26
+ "noNamespaces": true,
27
+ "noGraphQLTag": true
28
+ },
29
+ "plugins": [
30
+ {
31
+ "add": {
32
+ "content": [
33
+ "import { URI, UriComponents } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';"
34
+ ]
35
+ }
36
+ },
37
+ "typescript",
38
+ "typescript-operations",
39
+ "typescript-resolvers"
40
+ ]
41
+ },
42
+ "packages/common/src/generated/generated.tsx": {
43
+ "schema": "%discoveredSchemas%",
44
+ "documents": "%discoveredDocuments%",
45
+ "config": {
46
+ "scalars": {
47
+ "URI": "URI",
48
+ "URIInput": "URI | UriComponents"
49
+ },
50
+ "withHooks": true,
51
+ "typesPrefix": "I",
52
+ "noNamespaces": true,
53
+ "noGraphQLTag": true
54
+ },
55
+ "preset": "import-types-preset",
56
+ "presetConfig": {
57
+ "typesPath": "./generated-models",
58
+ "importTypesNamespace": "SchemaTypes"
59
+ },
60
+ "plugins": [
61
+ {
62
+ "add": {
63
+ "content": [
64
+ "import { URI, UriComponents } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';"
65
+ ]
66
+ }
67
+ },
68
+ "typescript-react-apollo"
69
+ ]
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "updateDependencies": {
75
+ "packagesToCheck": [
76
+ "@common-stack/server-stack",
77
+ "@common-stack/frontend-stack-react",
78
+ "@common-stack/mobile-stack-react"
79
+ ],
80
+ "packagePaths": {
81
+ "backend": ["servers/backend-server/package.json"],
82
+ "frontend": ["servers/frontend-server/package.json"],
83
+ "mobile": ["portable-devices/mobile/package.json"]
84
+ }
85
+ },
86
+ "updateDependencyVersion": {
87
+ "roots": ["servers", "portable-devices", "packages", "packages-modules"],
88
+ "ignorePattern": "**/node_modules/**",
89
+ "jsonSpacing": 4,
90
+ "addEndNewLine": true,
91
+ "commitMessage": "Updated packages to use correct versions"
92
+ },
93
+ "sortPackageJson": {
94
+ "directories": [".", "packages", "packages-modules", "servers", "portable-devices"],
95
+ "skipNodeModules": true
96
+ },
97
+ "deployVersionUpdate": {
98
+ "lernaJsonPath": "lerna.json",
99
+ "jenkinsfilePath": "Jenkinsfile",
100
+ "valuesDevYamlPath": "values-dev.yaml",
101
+ "valuesProdYamlPath": "values-prod.yaml"
102
+ },
103
+ "projectPaths": {
104
+ "packages": "packages",
105
+ "packagesModules": "packages-modules",
106
+ "servers": "servers",
107
+ "portableDevices": "portable-devices"
108
+ }
109
+ }
@@ -52,7 +52,9 @@
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
- "generateGraphql": "graphql-codegen",
55
+ "pregenerateGraphql": " node --experimental-modules tools/codegenGenerator.mjs",
56
+ "generateGraphql": "graphql-codegen-esm",
57
+ "postgenerateGraphql": "lerna run watch --scope=common",
56
58
  "generateGraphql:watch": "yarn generateGraphql -- --watch",
57
59
  "git:pull": "git pull origin $(git rev-parse --abbrev-ref HEAD)",
58
60
  "git:push": "git push origin $(git rev-parse --abbrev-ref HEAD)",
@@ -105,9 +107,11 @@
105
107
  },
106
108
  "resolutions": {
107
109
  "@apollo/client": "^3.9.0",
108
- "@types/react": "^18.0.25",
109
- "@types/react-dom": "^18.0.8",
110
+ "@types/react": "^18.2.25",
111
+ "@types/react-dom": "^18.2.7",
112
+ "common": "link:packages/common",
110
113
  "html-to-text": "^8.0.0",
114
+ "lerna": "8.1.8",
111
115
  "react": "18.3.0-canary-c3048aab4-20240326",
112
116
  "react-dom": "18.3.0-canary-c3048aab4-20240326",
113
117
  "react-native": "0.72.10",
@@ -146,9 +150,9 @@
146
150
  "@babel/preset-typescript": "^7.18.6",
147
151
  "@babel/register": "^7.18.9",
148
152
  "@babel/runtime": "^7.20.1",
149
- "@common-stack/env-list-loader": "6.0.8-alpha.30",
150
- "@common-stack/generate-plugin": "6.0.8-alpha.30",
151
- "@common-stack/rollup-vite-utils": "6.0.8-alpha.30",
153
+ "@common-stack/env-list-loader": "6.0.8-alpha.31",
154
+ "@common-stack/generate-plugin": "6.0.8-alpha.32",
155
+ "@common-stack/rollup-vite-utils": "6.0.8-alpha.31",
152
156
  "@emotion/babel-plugin": "^11.11.0",
153
157
  "@graphql-codegen/add": "^5.0.2",
154
158
  "@graphql-codegen/cli": "^5.0.2",
@@ -332,6 +336,10 @@
332
336
  "typedoc": "^0.23.20",
333
337
  "typescript": "^5.5.4",
334
338
  "url-loader": "^4.1.1",
339
+ "vite": "^5.1.1",
340
+ "vite-plugin-babel-macros": "^1.0.6",
341
+ "vite-plugin-cjs-interop": "^2.0.6",
342
+ "vite-plugin-compression": "^0.5.1",
335
343
  "wait-on": "^6.0.1",
336
344
  "webpack": "^5.74.0",
337
345
  "webpack-bundle-analyzer": "^4.7.0",
@@ -3,15 +3,16 @@ import graphql from '@rollup/plugin-graphql';
3
3
  import image from '@rollup/plugin-image';
4
4
  import typescript from '@rollup/plugin-typescript';
5
5
  import { string } from 'rollup-plugin-string';
6
+ import svg from 'rollup-plugin-svg';
6
7
  import { copy } from '@web/rollup-plugin-copy';
7
8
  import modifyLibFilesPlugin from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginModifyLibFiles.js';
8
9
  import generateJsonFromObject from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginGenerateJson.js';
9
10
  import addJsExtensionToImportsPlugin from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginAddJsExtension.js';
10
11
  import { ignoreCssUrlPlugin } from '@common-stack/rollup-vite-utils/lib/rollup/pluginIgnore.js';
11
12
 
12
- // Define any additional plugins specific to this bundle
13
+ // Define any additional plugins specific to this bundle
13
14
  const additionalPlugins = [
14
- copy({ patterns: ['**/cdm-locales/**/*', '**/styles/**/*'], rootDir: './src' }),
15
+ copy({ patterns: ['**/cdm-locales/**/*', '**/*.gql', '**/**/*.graphql', '**/styles/**/*', '**/css/**/*'], rootDir: './src' }),
15
16
  ];
16
17
 
17
18
  function deepMergeConfigs(baseConfig, specificConfig) {
@@ -28,7 +29,8 @@ function deepMergeConfigs(baseConfig, specificConfig) {
28
29
  // Base configuration
29
30
  const baseConfig = {
30
31
  plugins: [
31
- image(),
32
+ image({ exclude: '**/*.svg' }),
33
+ svg({ include: '**/*.svg' }),
32
34
  graphql({ include: '**/*.gql' }),
33
35
  string({
34
36
  include: ['**/*.ejs', '**/*.graphql'],
@@ -0,0 +1,36 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ import { runCodegenTasks } from '@common-stack/rollup-vite-utils/lib/tools/codegen/index.js';
6
+
7
+ /**
8
+ * This main script orchestrates your codegen steps, using cdecode-config.json.
9
+ * Usage:
10
+ * node tools/mainScript.mjs
11
+ */
12
+
13
+ // ESM housekeeping
14
+ const __filename = fileURLToPath(import.meta.url);
15
+ const __dirname = path.dirname(__filename);
16
+
17
+ (async function main() {
18
+ try {
19
+ // 1) Locate and parse cdecode-config.json
20
+ const configPath = path.join(__dirname, '../cdecode-config.json');
21
+ if (!fs.existsSync(configPath)) {
22
+ console.error(`cdecode-config.json not found at: ${configPath}`);
23
+ process.exit(1);
24
+ }
25
+ const rawConfig = fs.readFileSync(configPath, 'utf-8');
26
+ const cdecodeConfig = JSON.parse(rawConfig);
27
+
28
+ // 2) Run the orchestrated tasks
29
+ await runCodegenTasks(cdecodeConfig);
30
+
31
+ console.log('mainScript completed successfully!');
32
+ } catch (err) {
33
+ console.error('Error running mainScript:', err);
34
+ process.exit(1);
35
+ }
36
+ })();
@@ -1,6 +1,7 @@
1
1
  FROM node:20.16-alpine
2
2
 
3
3
  COPY .npmrc package.json /tmp/
4
+ COPY common /tmp/common
4
5
 
5
6
  RUN set -ex \
6
7
  && apk add --no-cache \
@@ -13,6 +14,7 @@ RUN set -ex \
13
14
  && rm -f /tmp/.npmrc \
14
15
  && mkdir -p /home/app \
15
16
  && cp -a /tmp/node_modules /home/app/ \
17
+ && cp -a /tmp/common /home/app/common \
16
18
  && rm -Rf /tmp/*
17
19
 
18
20
  WORKDIR /home/app
@@ -24,12 +24,15 @@
24
24
  "test:watch": "npm test -- --watch",
25
25
  "watch": "npm run start:dev"
26
26
  },
27
+ "resolutions": {
28
+ "common": "link:./common"
29
+ },
27
30
  "dependencies": {
28
- "@common-stack/client-core": "6.0.8-alpha.30",
29
- "@common-stack/core": "6.0.8-alpha.30",
30
- "@common-stack/server-core": "6.0.8-alpha.30",
31
- "@common-stack/server-stack": "6.0.8-alpha.30",
32
- "@common-stack/store-mongo": "6.0.8-alpha.30",
31
+ "@common-stack/client-core": "6.0.8-alpha.31",
32
+ "@common-stack/core": "6.0.8-alpha.31",
33
+ "@common-stack/server-core": "6.0.8-alpha.31",
34
+ "@common-stack/server-stack": "6.0.8-alpha.32",
35
+ "@common-stack/store-mongo": "6.0.8-alpha.31",
33
36
  "@container-stack/mailing-api": "5.2.1-alpha.1",
34
37
  "helmet": "^3.21.2",
35
38
  "react": "18.2.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/generate-plugin",
3
- "version": "6.0.8-alpha.31",
3
+ "version": "6.0.8-alpha.33",
4
4
  "type": "module",
5
5
  "main": "./lib/index.mjs",
6
6
  "typings": "./lib/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "watch": "yarn build:lib:watch"
18
18
  },
19
19
  "dependencies": {
20
- "@common-stack/rollup-vite-utils": "6.0.8-alpha.31",
20
+ "@common-stack/rollup-vite-utils": "6.0.8-alpha.33",
21
21
  "tslib": "^2.3.0"
22
22
  },
23
23
  "publishConfig": {
@@ -25,5 +25,5 @@
25
25
  },
26
26
  "executors": "./executors.json",
27
27
  "generators": "./generators.json",
28
- "gitHead": "f615de2ffa877f041318af0b0e7991b7f4fb7f70"
28
+ "gitHead": "8d704d5bc21e73f395001c70179441f1f64a8451"
29
29
  }
@@ -0,0 +1,109 @@
1
+ {
2
+ "servers": ["servers/frontend-server/config.json", "servers/backend-server/config.json"],
3
+ "codegen": {
4
+ "outputFile": "codegen.ts",
5
+ "rootSchema": "servers/backend-server/src/api/root-schema.graphqls",
6
+ "fullConfig": {
7
+ "overwrite": true,
8
+ "schema": ["$PRIMARY_SCHEMA_PLACEHOLDER$"],
9
+ "generates": {
10
+ "packages/common/src/generated/generated-models.ts": {
11
+ "schema": "%discoveredSchemas%",
12
+ "documents": "%discoveredDocuments%",
13
+ "config": {
14
+ "scalars": {
15
+ "URI": "URI",
16
+ "URIInput": "URI | UriComponents"
17
+ },
18
+ "enumValues": {
19
+ "ConfigurationScope": "@workbench-stack/core/lib/interfaces/configuration/configuration.js#ConfigurationScope",
20
+ "ConfigurationTarget": "../configuration#ConfigurationTarget"
21
+ },
22
+ "constEnums": false,
23
+ "contextType": "../apollo-context#MyContext",
24
+ "withHooks": true,
25
+ "typesPrefix": "I",
26
+ "noNamespaces": true,
27
+ "noGraphQLTag": true
28
+ },
29
+ "plugins": [
30
+ {
31
+ "add": {
32
+ "content": [
33
+ "import { URI, UriComponents } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';"
34
+ ]
35
+ }
36
+ },
37
+ "typescript",
38
+ "typescript-operations",
39
+ "typescript-resolvers"
40
+ ]
41
+ },
42
+ "packages/common/src/generated/generated.tsx": {
43
+ "schema": "%discoveredSchemas%",
44
+ "documents": "%discoveredDocuments%",
45
+ "config": {
46
+ "scalars": {
47
+ "URI": "URI",
48
+ "URIInput": "URI | UriComponents"
49
+ },
50
+ "withHooks": true,
51
+ "typesPrefix": "I",
52
+ "noNamespaces": true,
53
+ "noGraphQLTag": true
54
+ },
55
+ "preset": "import-types-preset",
56
+ "presetConfig": {
57
+ "typesPath": "./generated-models",
58
+ "importTypesNamespace": "SchemaTypes"
59
+ },
60
+ "plugins": [
61
+ {
62
+ "add": {
63
+ "content": [
64
+ "import { URI, UriComponents } from '@vscode-alt/monaco-editor/esm/vs/base/common/uri.js';"
65
+ ]
66
+ }
67
+ },
68
+ "typescript-react-apollo"
69
+ ]
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "updateDependencies": {
75
+ "packagesToCheck": [
76
+ "@common-stack/server-stack",
77
+ "@common-stack/frontend-stack-react",
78
+ "@common-stack/mobile-stack-react"
79
+ ],
80
+ "packagePaths": {
81
+ "backend": ["servers/backend-server/package.json"],
82
+ "frontend": ["servers/frontend-server/package.json"],
83
+ "mobile": ["portable-devices/mobile/package.json"]
84
+ }
85
+ },
86
+ "updateDependencyVersion": {
87
+ "roots": ["servers", "portable-devices", "packages", "packages-modules"],
88
+ "ignorePattern": "**/node_modules/**",
89
+ "jsonSpacing": 4,
90
+ "addEndNewLine": true,
91
+ "commitMessage": "Updated packages to use correct versions"
92
+ },
93
+ "sortPackageJson": {
94
+ "directories": [".", "packages", "packages-modules", "servers", "portable-devices"],
95
+ "skipNodeModules": true
96
+ },
97
+ "deployVersionUpdate": {
98
+ "lernaJsonPath": "lerna.json",
99
+ "jenkinsfilePath": "Jenkinsfile",
100
+ "valuesDevYamlPath": "values-dev.yaml",
101
+ "valuesProdYamlPath": "values-prod.yaml"
102
+ },
103
+ "projectPaths": {
104
+ "packages": "packages",
105
+ "packagesModules": "packages-modules",
106
+ "servers": "servers",
107
+ "portableDevices": "portable-devices"
108
+ }
109
+ }
@@ -52,7 +52,9 @@
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
- "generateGraphql": "graphql-codegen",
55
+ "pregenerateGraphql": " node --experimental-modules tools/codegenGenerator.mjs",
56
+ "generateGraphql": "graphql-codegen-esm",
57
+ "postgenerateGraphql": "lerna run watch --scope=common",
56
58
  "generateGraphql:watch": "yarn generateGraphql -- --watch",
57
59
  "git:pull": "git pull origin $(git rev-parse --abbrev-ref HEAD)",
58
60
  "git:push": "git push origin $(git rev-parse --abbrev-ref HEAD)",
@@ -105,9 +107,11 @@
105
107
  },
106
108
  "resolutions": {
107
109
  "@apollo/client": "^3.9.0",
108
- "@types/react": "^18.0.25",
109
- "@types/react-dom": "^18.0.8",
110
+ "@types/react": "^18.2.25",
111
+ "@types/react-dom": "^18.2.7",
112
+ "common": "link:packages/common",
110
113
  "html-to-text": "^8.0.0",
114
+ "lerna": "8.1.8",
111
115
  "react": "18.3.0-canary-c3048aab4-20240326",
112
116
  "react-dom": "18.3.0-canary-c3048aab4-20240326",
113
117
  "react-native": "0.72.10",
@@ -146,9 +150,9 @@
146
150
  "@babel/preset-typescript": "^7.18.6",
147
151
  "@babel/register": "^7.18.9",
148
152
  "@babel/runtime": "^7.20.1",
149
- "@common-stack/env-list-loader": "6.0.8-alpha.30",
150
- "@common-stack/generate-plugin": "6.0.8-alpha.30",
151
- "@common-stack/rollup-vite-utils": "6.0.8-alpha.30",
153
+ "@common-stack/env-list-loader": "6.0.8-alpha.31",
154
+ "@common-stack/generate-plugin": "6.0.8-alpha.32",
155
+ "@common-stack/rollup-vite-utils": "6.0.8-alpha.31",
152
156
  "@emotion/babel-plugin": "^11.11.0",
153
157
  "@graphql-codegen/add": "^5.0.2",
154
158
  "@graphql-codegen/cli": "^5.0.2",
@@ -332,6 +336,10 @@
332
336
  "typedoc": "^0.23.20",
333
337
  "typescript": "^5.5.4",
334
338
  "url-loader": "^4.1.1",
339
+ "vite": "^5.1.1",
340
+ "vite-plugin-babel-macros": "^1.0.6",
341
+ "vite-plugin-cjs-interop": "^2.0.6",
342
+ "vite-plugin-compression": "^0.5.1",
335
343
  "wait-on": "^6.0.1",
336
344
  "webpack": "^5.74.0",
337
345
  "webpack-bundle-analyzer": "^4.7.0",
@@ -3,15 +3,16 @@ import graphql from '@rollup/plugin-graphql';
3
3
  import image from '@rollup/plugin-image';
4
4
  import typescript from '@rollup/plugin-typescript';
5
5
  import { string } from 'rollup-plugin-string';
6
+ import svg from 'rollup-plugin-svg';
6
7
  import { copy } from '@web/rollup-plugin-copy';
7
8
  import modifyLibFilesPlugin from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginModifyLibFiles.js';
8
9
  import generateJsonFromObject from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginGenerateJson.js';
9
10
  import addJsExtensionToImportsPlugin from '@common-stack/rollup-vite-utils/lib/rollup/rollupPluginAddJsExtension.js';
10
11
  import { ignoreCssUrlPlugin } from '@common-stack/rollup-vite-utils/lib/rollup/pluginIgnore.js';
11
12
 
12
- // Define any additional plugins specific to this bundle
13
+ // Define any additional plugins specific to this bundle
13
14
  const additionalPlugins = [
14
- copy({ patterns: ['**/cdm-locales/**/*', '**/styles/**/*'], rootDir: './src' }),
15
+ copy({ patterns: ['**/cdm-locales/**/*', '**/*.gql', '**/**/*.graphql', '**/styles/**/*', '**/css/**/*'], rootDir: './src' }),
15
16
  ];
16
17
 
17
18
  function deepMergeConfigs(baseConfig, specificConfig) {
@@ -28,7 +29,8 @@ function deepMergeConfigs(baseConfig, specificConfig) {
28
29
  // Base configuration
29
30
  const baseConfig = {
30
31
  plugins: [
31
- image(),
32
+ image({ exclude: '**/*.svg' }),
33
+ svg({ include: '**/*.svg' }),
32
34
  graphql({ include: '**/*.gql' }),
33
35
  string({
34
36
  include: ['**/*.ejs', '**/*.graphql'],
@@ -0,0 +1,36 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ import { runCodegenTasks } from '@common-stack/rollup-vite-utils/lib/tools/codegen/index.js';
6
+
7
+ /**
8
+ * This main script orchestrates your codegen steps, using cdecode-config.json.
9
+ * Usage:
10
+ * node tools/mainScript.mjs
11
+ */
12
+
13
+ // ESM housekeeping
14
+ const __filename = fileURLToPath(import.meta.url);
15
+ const __dirname = path.dirname(__filename);
16
+
17
+ (async function main() {
18
+ try {
19
+ // 1) Locate and parse cdecode-config.json
20
+ const configPath = path.join(__dirname, '../cdecode-config.json');
21
+ if (!fs.existsSync(configPath)) {
22
+ console.error(`cdecode-config.json not found at: ${configPath}`);
23
+ process.exit(1);
24
+ }
25
+ const rawConfig = fs.readFileSync(configPath, 'utf-8');
26
+ const cdecodeConfig = JSON.parse(rawConfig);
27
+
28
+ // 2) Run the orchestrated tasks
29
+ await runCodegenTasks(cdecodeConfig);
30
+
31
+ console.log('mainScript completed successfully!');
32
+ } catch (err) {
33
+ console.error('Error running mainScript:', err);
34
+ process.exit(1);
35
+ }
36
+ })();
@@ -2,4 +2,5 @@
2
2
  !dist/
3
3
  !*.js
4
4
  !*.json
5
- !.npmrc
5
+ !.npmrc
6
+ !common/
@@ -1,6 +1,7 @@
1
1
  FROM node:20.16-alpine
2
2
 
3
3
  COPY .npmrc package.json /tmp/
4
+ COPY common /tmp/common
4
5
 
5
6
  RUN set -ex \
6
7
  && apk add --no-cache \
@@ -13,6 +14,7 @@ RUN set -ex \
13
14
  && rm -f /tmp/.npmrc \
14
15
  && mkdir -p /home/app \
15
16
  && cp -a /tmp/node_modules /home/app/ \
17
+ && cp -a /tmp/common /home/app/common \
16
18
  && rm -Rf /tmp/*
17
19
 
18
20
  WORKDIR /home/app
@@ -24,12 +24,15 @@
24
24
  "test:watch": "npm test -- --watch",
25
25
  "watch": "npm run start:dev"
26
26
  },
27
+ "resolutions": {
28
+ "common": "link:./common"
29
+ },
27
30
  "dependencies": {
28
- "@common-stack/client-core": "6.0.8-alpha.30",
29
- "@common-stack/core": "6.0.8-alpha.30",
30
- "@common-stack/server-core": "6.0.8-alpha.30",
31
- "@common-stack/server-stack": "6.0.8-alpha.30",
32
- "@common-stack/store-mongo": "6.0.8-alpha.30",
31
+ "@common-stack/client-core": "6.0.8-alpha.31",
32
+ "@common-stack/core": "6.0.8-alpha.31",
33
+ "@common-stack/server-core": "6.0.8-alpha.31",
34
+ "@common-stack/server-stack": "6.0.8-alpha.32",
35
+ "@common-stack/store-mongo": "6.0.8-alpha.31",
33
36
  "@container-stack/mailing-api": "5.2.1-alpha.1",
34
37
  "helmet": "^3.21.2",
35
38
  "react": "18.2.0",