minimonolith 0.20.1 → 0.21.0
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/README.md
CHANGED
|
@@ -125,7 +125,7 @@ There are 4 possible environments: DEV=TRUE & PROD=FALSE, DEV=TRUE & PROD=TRUE,
|
|
|
125
125
|
To better understand their relevance:
|
|
126
126
|
1. The "new concept" DEV environments (DEV=TRUE) aim to make the api crash if an "important" error happens
|
|
127
127
|
- Its current only difference is it makes it crash on error at service registration phase
|
|
128
|
-
- Some may think QA should also fail on "important" errors They can use DEV=TRUE there But some do training activities on QA that
|
|
128
|
+
- Some may think QA should also fail on "important" errors They can use DEV=TRUE there But some do training activities on QA that must be minimally disrupted
|
|
129
129
|
2. The "new concept" QA environments (PROD=FALSE) aim at logging data about the system which on production environments would be forbiden personal information
|
|
130
130
|
1. This is relevant because replication of QA activities (even security QA activities) depend heavily on this
|
|
131
131
|
|
package/index.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { z } from './src/zod/index.js';
|
|
2
2
|
import { createAPI } from './src/api/index.js';
|
|
3
3
|
import { DB_VALIDATION } from './src/database/index.js';
|
|
4
|
+
import { createDevEnvironment, createTestEnvironment } from './src/development/index.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
return await import('./src/development/index.js');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { createDevEnvironment, createAPI, z, DB_VALIDATION };
|
|
6
|
+
export { createDevEnvironment, createTestEnvironment, createAPI, z, DB_VALIDATION };
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import runLambdaServer from './runLambdaServer.js';
|
|
2
|
+
|
|
3
|
+
const createDevEnvironment = async (ENV_FILE='.env', MODULE_FOLDER='node_modules/') => {
|
|
4
|
+
const { loadEnvFile } = await import('./loadEnvFile.js');
|
|
5
|
+
loadEnvFile(ENV_FILE, MODULE_FOLDER);
|
|
6
|
+
|
|
7
|
+
return runLambdaServer;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default createDevEnvironment;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const createTestEnvironment = async () => {
|
|
2
|
+
process.env.MM_API_DEV_ENV = 'TRUE';
|
|
3
|
+
process.env.MM_API_PROD_ENV = 'FALSE';
|
|
4
|
+
process.env.MM_API_TEST_ENV = 'TRUE';
|
|
5
|
+
process.env.MM_API_DB_DIALECT = 'sqlite';
|
|
6
|
+
process.env.MM_API_DB_STORAGE = ':memory:';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default createTestEnvironment;
|
package/src/development/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import createDevEnvironment from './createDevEnvironment.js';
|
|
2
|
+
import createTestEnvironment from './createTestEnvironment.js';
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export { createTestEnvironment, createDevEnvironment };
|
|
@@ -4,7 +4,7 @@ import dotenv from 'dotenv';
|
|
|
4
4
|
|
|
5
5
|
import { getProjectRoot } from '../path/index.js';
|
|
6
6
|
|
|
7
|
-
const loadEnvFile = (ENV_FILE
|
|
7
|
+
const loadEnvFile = (ENV_FILE, MODULE_FOLDER) => {
|
|
8
8
|
const projectRootFileUrl = getProjectRoot(import.meta.url, MODULE_FOLDER);
|
|
9
9
|
const projectRootPath = url.fileURLToPath(projectRootFileUrl+'/');
|
|
10
10
|
const envFilePath = path.resolve(projectRootPath, ENV_FILE)
|