@friggframework/devtools 2.0.0-next.10 → 2.0.0-next.12
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,8 +1,9 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { spawnSync } = require('child_process');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
|
|
4
4
|
function buildCommand(options) {
|
|
5
5
|
console.log('Building the serverless application...');
|
|
6
|
+
console.log('Hello from npm link world')
|
|
6
7
|
const backendPath = path.resolve(process.cwd());
|
|
7
8
|
const infrastructurePath = 'infrastructure.js';
|
|
8
9
|
const command = 'serverless';
|
|
@@ -14,20 +15,38 @@ function buildCommand(options) {
|
|
|
14
15
|
options.stage
|
|
15
16
|
];
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
// Add support for --verbose option
|
|
19
|
+
if (options.verbose) {
|
|
20
|
+
serverlessArgs.push('--verbose');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
console.log('Running command from ', backendPath);
|
|
24
|
+
console.log('Serverless Command:', command, serverlessArgs.join(' '));
|
|
25
|
+
|
|
26
|
+
const result = spawnSync(command, serverlessArgs, {
|
|
18
27
|
cwd: backendPath,
|
|
19
28
|
stdio: 'inherit',
|
|
29
|
+
shell: true,
|
|
30
|
+
env: {
|
|
31
|
+
...process.env,
|
|
32
|
+
NODE_PATH: path.resolve(backendPath, 'node_modules'),
|
|
33
|
+
}
|
|
20
34
|
});
|
|
21
35
|
|
|
22
|
-
|
|
23
|
-
console.error(`
|
|
24
|
-
|
|
36
|
+
if (result.status !== 0) {
|
|
37
|
+
console.error(`Serverless build failed with code ${result.status}`);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
25
40
|
|
|
26
|
-
childProcess.on('
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
// childProcess.on('error', (error) => {
|
|
42
|
+
// console.error(`Error executing command: ${error.message}`);
|
|
43
|
+
// });
|
|
44
|
+
|
|
45
|
+
// childProcess.on('close', (code) => {
|
|
46
|
+
// if (code !== 0) {
|
|
47
|
+
// console.log(`Child process exited with code ${code}`);
|
|
48
|
+
// }
|
|
49
|
+
// });
|
|
31
50
|
}
|
|
32
51
|
|
|
33
52
|
module.exports = { buildCommand };
|
package/frigg-cli/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const composeServerlessDefinition = (AppDefinition) => {
|
|
|
7
7
|
service: AppDefinition.name || 'create-frigg-app',
|
|
8
8
|
package: {
|
|
9
9
|
individually: true,
|
|
10
|
+
exclude: ["!**/node_modules/aws-sdk/**", "!**/node_modules/@aws-sdk/**", "!package.json"],
|
|
10
11
|
},
|
|
11
12
|
useDotenv: true,
|
|
12
13
|
provider: {
|
|
@@ -30,7 +31,7 @@ const composeServerlessDefinition = (AppDefinition) => {
|
|
|
30
31
|
],
|
|
31
32
|
},
|
|
32
33
|
plugins: [
|
|
33
|
-
|
|
34
|
+
'serverless-jetpack',
|
|
34
35
|
'serverless-dotenv-plugin',
|
|
35
36
|
'serverless-offline-sqs',
|
|
36
37
|
'serverless-offline',
|
|
@@ -51,13 +52,8 @@ const composeServerlessDefinition = (AppDefinition) => {
|
|
|
51
52
|
secretAccessKey: 'root',
|
|
52
53
|
skipCacheInvalidation: false,
|
|
53
54
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
includeModules: {
|
|
57
|
-
forceExclude: ['aws-sdk'],
|
|
58
|
-
},
|
|
59
|
-
packager: 'npm',
|
|
60
|
-
excludeFiles: ['src/**/*.test.js', 'test/'],
|
|
55
|
+
jetpack: {
|
|
56
|
+
base: '..',
|
|
61
57
|
},
|
|
62
58
|
},
|
|
63
59
|
functions: {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0-next.
|
|
4
|
+
"version": "2.0.0-next.12",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@babel/eslint-parser": "^7.18.9",
|
|
7
7
|
"@babel/parser": "^7.25.3",
|
|
8
8
|
"@babel/traverse": "^7.25.3",
|
|
9
|
-
"@friggframework/test": "2.0.0-next.
|
|
9
|
+
"@friggframework/test": "2.0.0-next.12",
|
|
10
10
|
"@hapi/boom": "^7.4.11",
|
|
11
11
|
"@inquirer/prompts": "^5.3.8",
|
|
12
12
|
"axios": "^1.7.2",
|
|
@@ -27,13 +27,14 @@
|
|
|
27
27
|
"serverless-http": "^2.7.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@friggframework/eslint-config": "2.0.0-next.
|
|
31
|
-
"@friggframework/prettier-config": "2.0.0-next.
|
|
30
|
+
"@friggframework/eslint-config": "2.0.0-next.12",
|
|
31
|
+
"@friggframework/prettier-config": "2.0.0-next.12",
|
|
32
32
|
"serverless": "3.39.0",
|
|
33
33
|
"serverless-dotenv-plugin": "^6.0.0",
|
|
34
|
+
"serverless-jetpack": "^0.11.2",
|
|
34
35
|
"serverless-offline": "^13.8.0",
|
|
35
36
|
"serverless-offline-sqs": "^8.0.0",
|
|
36
|
-
"serverless-
|
|
37
|
+
"serverless-plugin-monorepo": "^0.11.0"
|
|
37
38
|
},
|
|
38
39
|
"scripts": {
|
|
39
40
|
"lint:fix": "prettier --write --loglevel error . && eslint . --fix",
|
|
@@ -57,5 +58,5 @@
|
|
|
57
58
|
"publishConfig": {
|
|
58
59
|
"access": "public"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "1ce6d2162c192e525c55f07db8a25579b0de09c4"
|
|
61
62
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const slsw = require('serverless-webpack');
|
|
2
|
-
const webpack = require('webpack');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const CopyPlugin = require('copy-webpack-plugin');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
devtool: 'source-map',
|
|
9
|
-
entry: slsw.lib.entries,
|
|
10
|
-
mode: slsw.lib.webpack.isLocal ? 'development' : 'production',
|
|
11
|
-
target: 'node',
|
|
12
|
-
externals: ['mongoose', 'express', 'node-fetch'],
|
|
13
|
-
plugins: [
|
|
14
|
-
// This defines the window global (with value of `undefined`).
|
|
15
|
-
new webpack.ProvidePlugin({
|
|
16
|
-
window: path.resolve(path.join(__dirname, 'src/utils/webpackFakeWindow')),
|
|
17
|
-
}),
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
};
|