@friggframework/core 2.0.0-next.13 → 2.0.0-next.15

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.
@@ -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,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/core",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0-next.13",
4
+ "version": "2.0.0-next.15",
5
5
  "dependencies": {
6
6
  "@hapi/boom": "^10.0.1",
7
7
  "aws-sdk": "^2.1200.0",
@@ -11,16 +11,18 @@
11
11
  "cors": "^2.8.5",
12
12
  "express": "^4.19.2",
13
13
  "express-async-handler": "^1.2.0",
14
+ "form-data": "^4.0.0",
15
+ "fs-extra": "^11.2.0",
14
16
  "lodash": "4.17.21",
15
- "lodash.get": "4.4.2",
16
17
  "mongoose": "6.11.6",
17
18
  "node-fetch": "^2.6.7",
18
- "serverless-http": "^2.7.0"
19
+ "serverless-http": "^2.7.0",
20
+ "uuid": "^9.0.1"
19
21
  },
20
22
  "devDependencies": {
21
- "@friggframework/eslint-config": "2.0.0-next.13",
22
- "@friggframework/prettier-config": "2.0.0-next.13",
23
- "@friggframework/test": "2.0.0-next.13",
23
+ "@friggframework/eslint-config": "2.0.0-next.15",
24
+ "@friggframework/prettier-config": "2.0.0-next.15",
25
+ "@friggframework/test": "2.0.0-next.15",
24
26
  "@types/lodash": "4.17.15",
25
27
  "@typescript-eslint/eslint-plugin": "^8.0.0",
26
28
  "chai": "^4.3.6",
@@ -29,9 +31,7 @@
29
31
  "eslint-plugin-n": "^17.10.2",
30
32
  "eslint-plugin-promise": "^7.0.0",
31
33
  "jest": "^29.7.0",
32
- "jest-runner-groups": "^2.2.0",
33
- "mongodb-memory-server": "^8.9.0",
34
- "prettier": "^2.8.5",
34
+ "prettier": "^2.7.1",
35
35
  "sinon": "^16.1.1",
36
36
  "typescript": "^5.0.2"
37
37
  },
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "homepage": "https://github.com/friggframework/frigg#readme",
53
53
  "description": "",
54
- "gitHead": "df31b43ef66894b8901cf2021ab510311d77d188"
54
+ "gitHead": "645328d6c66da7a82fa2588a4013d0025b59b564"
55
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
+ };
package/utils/index.js ADDED
@@ -0,0 +1,6 @@
1
+ const { findNearestBackendPackageJson, validateBackendPath } = require('./backend-path');
2
+
3
+ module.exports = {
4
+ findNearestBackendPackageJson,
5
+ validateBackendPath,
6
+ };