@common-stack/generate-plugin 6.0.8-alpha.10 → 6.0.8-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 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
+ ## [6.0.8-alpha.11](https://github.com/cdmbase/common-stack/compare/v6.0.8-alpha.10...v6.0.8-alpha.11) (2024-12-29)
7
+
8
+ **Note:** Version bump only for package @common-stack/generate-plugin
9
+
6
10
  ## [6.0.8-alpha.10](https://github.com/cdmbase/common-stack/compare/v6.0.8-alpha.9...v6.0.8-alpha.10) (2024-12-20)
7
11
 
8
12
  **Note:** Version bump only for package @common-stack/generate-plugin
@@ -74,8 +74,8 @@
74
74
  "@common-stack/client-core": "6.0.8-alpha.7",
75
75
  "@common-stack/core": "6.0.8-alpha.7",
76
76
  "@common-stack/server-core": "6.0.8-alpha.9",
77
- "@common-stack/server-stack": "6.0.8-alpha.9",
78
- "@common-stack/store-mongo": "6.0.8-alpha.8",
77
+ "@common-stack/server-stack": "6.0.8-alpha.10",
78
+ "@common-stack/store-mongo": "6.0.8-alpha.10",
79
79
  "@graphql-tools/links": "~9.0.1",
80
80
  "@graphql-tools/schema": "~10.0.6",
81
81
  "@graphql-tools/stitch": "~9.2.10",
@@ -62,7 +62,7 @@
62
62
  "dependencies": {
63
63
  "@apollo/client": "^3.9.0",
64
64
  "@babel/runtime": "^7.20.1",
65
- "@common-stack/server-stack": "6.0.8-alpha.9",
65
+ "@common-stack/server-stack": "6.0.8-alpha.10",
66
66
  "@remix-run/node": "~2.10.1",
67
67
  "lodash": "^4.17.15",
68
68
  "react": "18.2.0"
@@ -1,4 +1,6 @@
1
- process.env.ENV_FILE !== null && require('dotenv').config({ path: process.env.ENV_FILE });
1
+ if (process.env.ENV_FILE) {
2
+ require('dotenv').config({ path: process.env.ENV_FILE });
3
+ }
2
4
  const webpack = require('webpack');
3
5
  const path = require('path');
4
6
  const { CleanWebpackPlugin } = require('clean-webpack-plugin');
@@ -147,7 +147,7 @@
147
147
  "@babel/register": "^7.18.9",
148
148
  "@babel/runtime": "^7.20.1",
149
149
  "@common-stack/env-list-loader": "6.0.8-alpha.7",
150
- "@common-stack/generate-plugin": "6.0.8-alpha.9",
150
+ "@common-stack/generate-plugin": "6.0.8-alpha.10",
151
151
  "@common-stack/rollup-vite-utils": "6.0.8-alpha.7",
152
152
  "@emotion/babel-plugin": "^11.11.0",
153
153
  "@graphql-codegen/add": "^5.0.2",
@@ -272,7 +272,7 @@
272
272
  "jest-raw-loader": "^1.0.1",
273
273
  "jest-transform-graphql": "^2.1.0",
274
274
  "jsdom": "^20.0.2",
275
- "lerna": "8",
275
+ "lerna": "8.1.8",
276
276
  "less": "^4.1.3",
277
277
  "less-loader": "^11.0.0",
278
278
  "lint-staged": "^15.2.7",
@@ -28,8 +28,8 @@
28
28
  "@common-stack/client-core": "6.0.8-alpha.7",
29
29
  "@common-stack/core": "6.0.8-alpha.7",
30
30
  "@common-stack/server-core": "6.0.8-alpha.9",
31
- "@common-stack/server-stack": "6.0.8-alpha.9",
32
- "@common-stack/store-mongo": "6.0.8-alpha.8",
31
+ "@common-stack/server-stack": "6.0.8-alpha.10",
32
+ "@common-stack/store-mongo": "6.0.8-alpha.10",
33
33
  "@container-stack/mailing-api": "5.2.1-alpha.1",
34
34
  "helmet": "^3.21.2",
35
35
  "react": "18.2.0",
@@ -1,11 +1,24 @@
1
1
  import graphql from '@rollup/plugin-graphql';
2
2
  import typescript from '@rollup/plugin-typescript';
3
3
  import { string } from 'rollup-plugin-string';
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import { writeBackendModuleFile } from '@common-stack/rollup-vite-utils';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ // Write backend module file before bundling
12
+ try {
13
+ const packageConfig = await import('./config.json', { assert: { type: 'json' } });
14
+ await writeBackendModuleFile(path.join(__dirname, 'src/modules'), packageConfig.default);
15
+ } catch (e) {
16
+ console.error('Error writing backend module file:', e);
17
+ }
4
18
 
5
19
  const bundle = (config) => ({
6
20
  ...config,
7
21
  input: 'src/index.ts',
8
- // marking all node modules as external
9
22
  external: (id) => !/^[./]/.test(id),
10
23
  });
11
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/generate-plugin",
3
- "version": "6.0.8-alpha.10",
3
+ "version": "6.0.8-alpha.11",
4
4
  "type": "module",
5
5
  "main": "./lib/index.mjs",
6
6
  "typings": "./lib/index.d.ts",
@@ -25,5 +25,5 @@
25
25
  },
26
26
  "executors": "./executors.json",
27
27
  "generators": "./generators.json",
28
- "gitHead": "41ea29cfe102fb2a7949942b9f409bd43c0d05b4"
28
+ "gitHead": "2f5c585fe2b4d81bb3c70ce248fe3a38c7a9f43b"
29
29
  }
@@ -147,7 +147,7 @@
147
147
  "@babel/register": "^7.18.9",
148
148
  "@babel/runtime": "^7.20.1",
149
149
  "@common-stack/env-list-loader": "6.0.8-alpha.7",
150
- "@common-stack/generate-plugin": "6.0.8-alpha.9",
150
+ "@common-stack/generate-plugin": "6.0.8-alpha.10",
151
151
  "@common-stack/rollup-vite-utils": "6.0.8-alpha.7",
152
152
  "@emotion/babel-plugin": "^11.11.0",
153
153
  "@graphql-codegen/add": "^5.0.2",
@@ -272,7 +272,7 @@
272
272
  "jest-raw-loader": "^1.0.1",
273
273
  "jest-transform-graphql": "^2.1.0",
274
274
  "jsdom": "^20.0.2",
275
- "lerna": "8",
275
+ "lerna": "8.1.8",
276
276
  "less": "^4.1.3",
277
277
  "less-loader": "^11.0.0",
278
278
  "lint-staged": "^15.2.7",
@@ -28,8 +28,8 @@
28
28
  "@common-stack/client-core": "6.0.8-alpha.7",
29
29
  "@common-stack/core": "6.0.8-alpha.7",
30
30
  "@common-stack/server-core": "6.0.8-alpha.9",
31
- "@common-stack/server-stack": "6.0.8-alpha.9",
32
- "@common-stack/store-mongo": "6.0.8-alpha.8",
31
+ "@common-stack/server-stack": "6.0.8-alpha.10",
32
+ "@common-stack/store-mongo": "6.0.8-alpha.10",
33
33
  "@container-stack/mailing-api": "5.2.1-alpha.1",
34
34
  "helmet": "^3.21.2",
35
35
  "react": "18.2.0",
@@ -1,11 +1,24 @@
1
1
  import graphql from '@rollup/plugin-graphql';
2
2
  import typescript from '@rollup/plugin-typescript';
3
3
  import { string } from 'rollup-plugin-string';
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import { writeBackendModuleFile } from '@common-stack/rollup-vite-utils';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+
11
+ // Write backend module file before bundling
12
+ try {
13
+ const packageConfig = await import('./config.json', { assert: { type: 'json' } });
14
+ await writeBackendModuleFile(path.join(__dirname, 'src/modules'), packageConfig.default);
15
+ } catch (e) {
16
+ console.error('Error writing backend module file:', e);
17
+ }
4
18
 
5
19
  const bundle = (config) => ({
6
20
  ...config,
7
21
  input: 'src/index.ts',
8
- // marking all node modules as external
9
22
  external: (id) => !/^[./]/.test(id),
10
23
  });
11
24
 
@@ -1,31 +0,0 @@
1
- import { ContainerModule, interfaces } from 'inversify';
2
- import { Feature } from '@common-stack/server-core';
3
- import { TaggedType } from '@common-stack/core';
4
- import { config } from '../config';
5
-
6
- const subTopic = config.CONNECTION_ID;
7
- export const settings: any = {
8
- connectionId: config.CONNECTION_ID,
9
- namespace: config.NAMESPACE,
10
- subTopic,
11
- logger: config.LOG_LEVEL,
12
- workspaceId: config.CONNECTION_ID || 'DEFAULT',
13
- configPath: process.env.CONFIG_PATH,
14
- adminApiNamespace: 'api-admin',
15
- apiNamespace: 'api-admin',
16
- };
17
-
18
- const defaultModule = () =>
19
- new ContainerModule((bind: interfaces.Bind) => {
20
- bind('Settings').toConstantValue(settings).whenTargetTagged('default', true);
21
- bind('Settings').toConstantValue(settings).whenTargetTagged('microservice', true);
22
- bind('Settings').toConstantValue(settings).whenTargetTagged(TaggedType.MICROSERVICE, true);
23
- bind('MongoOptions').toConstantValue({});
24
- });
25
-
26
- const DefaultFeature = new Feature({
27
- createContainerFunc: [defaultModule],
28
- createHemeraContainerFunc: [defaultModule],
29
- });
30
-
31
- export default new Feature<any>(DefaultFeature);
@@ -1,31 +0,0 @@
1
- import { ContainerModule, interfaces } from 'inversify';
2
- import { Feature } from '@common-stack/server-core';
3
- import { TaggedType } from '@common-stack/core';
4
- import { config } from '../config';
5
-
6
- const subTopic = config.CONNECTION_ID;
7
- export const settings: any = {
8
- connectionId: config.CONNECTION_ID,
9
- namespace: config.NAMESPACE,
10
- subTopic,
11
- logger: config.LOG_LEVEL,
12
- workspaceId: config.CONNECTION_ID || 'DEFAULT',
13
- configPath: process.env.CONFIG_PATH,
14
- adminApiNamespace: 'api-admin',
15
- apiNamespace: 'api-admin',
16
- };
17
-
18
- const defaultModule = () =>
19
- new ContainerModule((bind: interfaces.Bind) => {
20
- bind('Settings').toConstantValue(settings).whenTargetTagged('default', true);
21
- bind('Settings').toConstantValue(settings).whenTargetTagged('microservice', true);
22
- bind('Settings').toConstantValue(settings).whenTargetTagged(TaggedType.MICROSERVICE, true);
23
- bind('MongoOptions').toConstantValue({});
24
- });
25
-
26
- const DefaultFeature = new Feature({
27
- createContainerFunc: [defaultModule],
28
- createHemeraContainerFunc: [defaultModule],
29
- });
30
-
31
- export default new Feature<any>(DefaultFeature);