@friggframework/core 2.0.0--canary.378.e85bec1.0 → 2.0.0--canary.381.335a2a0.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/core/create-handler.js +2 -1
- package/handlers/backend-utils.js +1 -3
- package/index.js +4 -0
- package/package.json +10 -7
- package/utils/backend-path.js +26 -0
- package/utils/index.js +6 -0
package/core/create-handler.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// This line should be at the top of the webpacked output, so be sure to require createHandler first in any handlers. "Soon" sourcemaps will be built into Node... after that, this package won't be needed.
|
|
2
|
-
|
|
2
|
+
// REMOVING FOR NOW UNTIL WE ADD WEBPACK BACK IN
|
|
3
|
+
// require('source-map-support').install();
|
|
3
4
|
|
|
4
5
|
const { connectToDatabase } = require('../database/mongo');
|
|
5
6
|
const { initDebugLog, flushDebugLog } = require('../logs');
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
const { createFriggBackend, Worker } = require('@friggframework/core');
|
|
2
|
-
const {
|
|
3
|
-
findNearestBackendPackageJson,
|
|
4
|
-
} = require('../../devtools/frigg-cli/utils/backend-path');
|
|
2
|
+
const { findNearestBackendPackageJson } = require('@friggframework/core/utils');
|
|
5
3
|
const path = require('node:path');
|
|
6
4
|
const fs = require('fs-extra');
|
|
7
5
|
|
package/index.js
CHANGED
|
@@ -59,6 +59,7 @@ const {
|
|
|
59
59
|
ModuleFactory,
|
|
60
60
|
Auther,
|
|
61
61
|
} = require('./module-plugin/index');
|
|
62
|
+
const utils = require('./utils');
|
|
62
63
|
|
|
63
64
|
// const {Sync } = require('./syncs/model');
|
|
64
65
|
|
|
@@ -137,4 +138,7 @@ module.exports = {
|
|
|
137
138
|
|
|
138
139
|
// queues
|
|
139
140
|
QueuerUtil,
|
|
141
|
+
|
|
142
|
+
// utils
|
|
143
|
+
...utils,
|
|
140
144
|
};
|
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.
|
|
4
|
+
"version": "2.0.0--canary.381.335a2a0.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hapi/boom": "^10.0.1",
|
|
7
7
|
"aws-sdk": "^2.1200.0",
|
|
8
8
|
"bcryptjs": "^2.4.3",
|
|
9
|
+
"body-parser": "^1.20.2",
|
|
9
10
|
"common-tags": "^1.8.2",
|
|
10
|
-
"
|
|
11
|
+
"cors": "^2.8.5",
|
|
12
|
+
"express": "^4.19.2",
|
|
11
13
|
"express-async-handler": "^1.2.0",
|
|
12
14
|
"lodash": "4.17.21",
|
|
13
15
|
"lodash.get": "4.4.2",
|
|
14
16
|
"mongoose": "6.11.6",
|
|
15
|
-
"node-fetch": "^2.6.7"
|
|
17
|
+
"node-fetch": "^2.6.7",
|
|
18
|
+
"serverless-http": "^2.7.0"
|
|
16
19
|
},
|
|
17
20
|
"devDependencies": {
|
|
18
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
19
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
20
|
-
"@friggframework/test": "2.0.0--canary.
|
|
21
|
+
"@friggframework/eslint-config": "2.0.0--canary.381.335a2a0.0",
|
|
22
|
+
"@friggframework/prettier-config": "2.0.0--canary.381.335a2a0.0",
|
|
23
|
+
"@friggframework/test": "2.0.0--canary.381.335a2a0.0",
|
|
21
24
|
"@types/lodash": "4.17.15",
|
|
22
25
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
23
26
|
"chai": "^4.3.6",
|
|
@@ -48,5 +51,5 @@
|
|
|
48
51
|
},
|
|
49
52
|
"homepage": "https://github.com/friggframework/frigg#readme",
|
|
50
53
|
"description": "",
|
|
51
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "335a2a0360c0b3d6c868975b120b738be0d6e9d3"
|
|
52
55
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const PACKAGE_JSON = 'package.json';
|
|
4
|
+
|
|
5
|
+
function findNearestBackendPackageJson() {
|
|
6
|
+
let currentDir = process.cwd();
|
|
7
|
+
while (currentDir !== path.parse(currentDir).root) {
|
|
8
|
+
const packageJsonPath = path.join(currentDir, 'backend', PACKAGE_JSON);
|
|
9
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
10
|
+
return packageJsonPath;
|
|
11
|
+
}
|
|
12
|
+
currentDir = path.dirname(currentDir);
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function validateBackendPath(backendPath) {
|
|
18
|
+
if (!backendPath) {
|
|
19
|
+
throw new Error('Could not find a backend package.json file.');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
findNearestBackendPackageJson,
|
|
25
|
+
validateBackendPath,
|
|
26
|
+
};
|