@fishawack/lab-env 4.39.0-beta.6 → 4.39.0-beta.8
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/.prettierignore +8 -0
- package/CHANGELOG.md +37 -0
- package/README.md +46 -0
- package/_Test/provision.js +16 -7
- package/_Test/s3.js +3 -1
- package/_Test/utilities.js +4 -0
- package/cli.js +4 -6
- package/commands/check.js +1 -0
- package/commands/clean.js +2 -2
- package/commands/content.js +2 -2
- package/commands/create/cmds/dekey.js +2 -3
- package/commands/create/cmds/deprovision.js +2 -2
- package/commands/create/cmds/diagnose.js +3 -2
- package/commands/create/cmds/key.js +2 -2
- package/commands/create/cmds/provision.js +3 -3
- package/commands/create/libs/aws-cloudfront-auth.js +11 -8
- package/commands/create/libs/aws-cloudfront-response.js +1 -0
- package/commands/create/libs/aws-cloudfront-simple.js +10 -7
- package/commands/create/libs/utilities.js +3 -0
- package/commands/create/libs/vars.js +24 -24
- package/commands/create/services/aws/cloudfront.js +1 -1
- package/commands/create/services/aws/iam.js +5 -3
- package/commands/create/services/aws/index.js +36 -12
- package/commands/create/services/aws/s3.js +1 -0
- package/commands/create/services/bitbucket.js +4 -4
- package/commands/create/services/egnyte.js +2 -2
- package/commands/create/services/gitlab.js +2 -2
- package/commands/create/services/guide.js +26 -19
- package/commands/create/services/test.js +13 -11
- package/commands/deploy.js +2 -2
- package/commands/docker/config.js +2 -2
- package/commands/docker/down.js +2 -2
- package/commands/docker/mocha.js +2 -4
- package/commands/docker/volumes.js +2 -2
- package/commands/lint.js +31 -7
- package/commands/nuke.js +5 -3
- package/commands/origin.js +3 -3
- package/commands/production.js +2 -2
- package/commands/regenerate.js +2 -2
- package/commands/reinstall.js +2 -2
- package/commands/setup.js +2 -2
- package/commands/test.js +2 -2
- package/commands/watch.js +2 -2
- package/commands/wp.js +0 -2
- package/eslint.config.js +79 -0
- package/globals.js +73 -50
- package/package.json +1 -1
- package/stylelint.config.js +40 -0
- package/commands/pretty.js +0 -14
package/.prettierignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.39.0-beta.8 (2025-05-23)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* added fix flag to lint command ([fc4e016](https://bitbucket.org/fishawackdigital/lab-env/commits/fc4e0162e1247b68b4e5558f5bb41ef55a7f4f72))
|
|
8
|
+
* added stylelint ([3780f92](https://bitbucket.org/fishawackdigital/lab-env/commits/3780f92cc693f92283e8cc70a92cc164c70d661c))
|
|
9
|
+
* copy stylintconfig into project root ([10039a0](https://bitbucket.org/fishawackdigital/lab-env/commits/10039a028106b1212f752bee4c5bbce211b474ae))
|
|
10
|
+
* disable id pattern in stylelint ([edd1f87](https://bitbucket.org/fishawackdigital/lab-env/commits/edd1f876a7877e660991b2c175dc11d06f4187ec))
|
|
11
|
+
* force flag can now be used to bypass diagnose ([78cf860](https://bitbucket.org/fishawackdigital/lab-env/commits/78cf8602e40879344e30e2bc0d06b310aec2e099))
|
|
12
|
+
* major version bump of fw diagnose ([989a0d1](https://bitbucket.org/fishawackdigital/lab-env/commits/989a0d1a04f3e8b40bb82a4c5ddb25f59935445c))
|
|
13
|
+
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* added more paths to ignored paths for linters ([a6097ec](https://bitbucket.org/fishawackdigital/lab-env/commits/a6097ec4665f8b0c738d264eb19fa24a638fb6e5))
|
|
17
|
+
* dont error when no matching files on eslint ([069422c](https://bitbucket.org/fishawackdigital/lab-env/commits/069422c86e906cdfa9719919fc441155b9bf0edc))
|
|
18
|
+
* ignore handlebars helpers as theyll be gone soon and add some global ignores ([e42e05e](https://bitbucket.org/fishawackdigital/lab-env/commits/e42e05e669549ef3087480d8c33fb837c96cc3bc))
|
|
19
|
+
* ignore variable pattern in stylelint ([7809024](https://bitbucket.org/fishawackdigital/lab-env/commits/78090249755c6871ef6f54b77cd55dcea7ca7d38))
|
|
20
|
+
* run style lint first so other linters dont explode with prettier fixes ([e7e16fc](https://bitbucket.org/fishawackdigital/lab-env/commits/e7e16fc4a9b28fc6613f44fdf10b334d3c08b730))
|
|
21
|
+
* stylelint now uses global path ([90d280e](https://bitbucket.org/fishawackdigital/lab-env/commits/90d280e6cea3f621ad49aab6e4b482a4f9e4c053))
|
|
22
|
+
* update stylint paths as it ignores files not directories ([d3e125b](https://bitbucket.org/fishawackdigital/lab-env/commits/d3e125ba9d6ba158d5d210bafc4928bbc22ad448))
|
|
23
|
+
* when running tests via CI/CD diagnose command will be ignored ([b9b9757](https://bitbucket.org/fishawackdigital/lab-env/commits/b9b97579376c87e3fa8a84eed14f4105da397589))
|
|
24
|
+
|
|
25
|
+
### 4.39.0-beta.7 (2025-05-21)
|
|
26
|
+
|
|
27
|
+
#### Features
|
|
28
|
+
|
|
29
|
+
* added eslint configuration and global deps ([2edd07a](https://bitbucket.org/fishawackdigital/lab-env/commits/2edd07a602c601dcb1ff7e668f002a1f5ec675e3))
|
|
30
|
+
* added positional flag to lint command ([a9d1090](https://bitbucket.org/fishawackdigital/lab-env/commits/a9d109079721765a462c7fbfefecd4ae7177a4dd))
|
|
31
|
+
* copy eslint.config.js to project repo ([900f2e7](https://bitbucket.org/fishawackdigital/lab-env/commits/900f2e765322633a1f6e82bc4389c2ea2e8ff635))
|
|
32
|
+
* show the installing npm module in guide ([d5b4113](https://bitbucket.org/fishawackdigital/lab-env/commits/d5b41136c15f7e5ce74e05240742b817fb999474))
|
|
33
|
+
|
|
34
|
+
#### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* remove airbnb dep as not needed ([494b6af](https://bitbucket.org/fishawackdigital/lab-env/commits/494b6afd2a635a0e817599cf5ae8ef1f0315d746))
|
|
37
|
+
* use global prettier instead of npx ([912e598](https://bitbucket.org/fishawackdigital/lab-env/commits/912e598703705586a5aeb923100b82ea19335a4f))
|
|
38
|
+
* use var as let not supported in cloudfront functions v5 ([6656ff3](https://bitbucket.org/fishawackdigital/lab-env/commits/6656ff319e812273c20b9b14425a90be194c4035))
|
|
39
|
+
|
|
3
40
|
### 4.39.0-beta.6 (2025-05-15)
|
|
4
41
|
|
|
5
42
|
#### Features
|
package/README.md
CHANGED
|
@@ -204,6 +204,52 @@ docker volume rm boilerplate_node_modules
|
|
|
204
204
|
|
|
205
205
|
## Migrating
|
|
206
206
|
|
|
207
|
+
### 5.0.0
|
|
208
|
+
|
|
209
|
+
Version 5 introduced linting and code styling to projects.
|
|
210
|
+
|
|
211
|
+
#### Re-diagnose
|
|
212
|
+
|
|
213
|
+
These linters are installed globally via the diagnose command which resulted in a major diagnose version being set forcing users to re-run the command.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
fw diagnose
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
#### New ignore paths
|
|
220
|
+
|
|
221
|
+
Add the following files to your existing projects `.gitignore` file
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
.husky
|
|
225
|
+
.commitlintrc.json
|
|
226
|
+
.prettierrc.js
|
|
227
|
+
.prettierignore
|
|
228
|
+
.editorconfig
|
|
229
|
+
eslint.config.js
|
|
230
|
+
stylelint.config.js
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### Disabling commithooks
|
|
234
|
+
|
|
235
|
+
For existing projects where fixing all the linting errors is unreasonable, the developers will need to adjust and commit a couple of files to skip the mandatory git hooks that fire on git push commands.
|
|
236
|
+
|
|
237
|
+
1. Remove `.husky` from the `.gitignore`
|
|
238
|
+
|
|
239
|
+
2. Edit the `.husky/pre-push` file
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Runs js css php style linters
|
|
243
|
+
fw lint
|
|
244
|
+
|
|
245
|
+
# Only runs the code style linter
|
|
246
|
+
fw lint style
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
3. Ensure the `.husky` folder is commited into version control.
|
|
250
|
+
|
|
251
|
+
> Disabling linters should be a temporary solution. It's important that all projects aim to re-enable all linters at some point in the future as the CI/CD will eventually fail builds for not adhereing to linting rules.
|
|
252
|
+
|
|
207
253
|
### 2.0.0
|
|
208
254
|
|
|
209
255
|
Wordpress repo's are now structured slightly differently to better match laravel, drupal and craftcms setups. Follow these steps to upgrade a wordpress build and get lab-env working again.
|
package/_Test/provision.js
CHANGED
|
@@ -9,15 +9,24 @@ describe("provision", () => {
|
|
|
9
9
|
let config;
|
|
10
10
|
let repo = "lab-env-test-suite";
|
|
11
11
|
let account = "fishawack";
|
|
12
|
+
let branch = "development";
|
|
13
|
+
let name = aws.slug(repo, account, branch);
|
|
12
14
|
|
|
13
15
|
describe("static", () => {
|
|
14
16
|
before(async () => {
|
|
15
17
|
fetch = (await import("node-fetch")).default;
|
|
16
18
|
|
|
17
|
-
config = await aws.static(
|
|
19
|
+
config = await aws.static(
|
|
20
|
+
name,
|
|
21
|
+
account,
|
|
22
|
+
undefined,
|
|
23
|
+
undefined,
|
|
24
|
+
repo,
|
|
25
|
+
branch,
|
|
26
|
+
);
|
|
18
27
|
|
|
19
28
|
await aws.s3.addFileToS3Bucket(
|
|
20
|
-
|
|
29
|
+
name,
|
|
21
30
|
account,
|
|
22
31
|
"index.html",
|
|
23
32
|
new TextEncoder().encode("test"),
|
|
@@ -29,13 +38,13 @@ describe("provision", () => {
|
|
|
29
38
|
});
|
|
30
39
|
|
|
31
40
|
after(async () => {
|
|
32
|
-
await aws.s3.removeFileToS3Bucket(
|
|
41
|
+
await aws.s3.removeFileToS3Bucket(name, account, "index.html");
|
|
33
42
|
|
|
34
43
|
await aws.staticTerminate(
|
|
35
|
-
|
|
44
|
+
name,
|
|
36
45
|
account,
|
|
37
46
|
repo,
|
|
38
|
-
|
|
47
|
+
branch,
|
|
39
48
|
config.cloudfront,
|
|
40
49
|
);
|
|
41
50
|
});
|
|
@@ -53,7 +62,7 @@ describe("provision", () => {
|
|
|
53
62
|
[],
|
|
54
63
|
[],
|
|
55
64
|
repo,
|
|
56
|
-
|
|
65
|
+
branch,
|
|
57
66
|
"wordpress",
|
|
58
67
|
);
|
|
59
68
|
});
|
|
@@ -65,7 +74,7 @@ describe("provision", () => {
|
|
|
65
74
|
});
|
|
66
75
|
|
|
67
76
|
after(async () => {
|
|
68
|
-
await aws.fullstackTerminate(repo, account, repo,
|
|
77
|
+
await aws.fullstackTerminate(repo, account, repo, branch);
|
|
69
78
|
|
|
70
79
|
execSync(`rm -rf .elasticbeanstalk`, {
|
|
71
80
|
encoding: "utf8",
|
package/_Test/s3.js
CHANGED
package/_Test/utilities.js
CHANGED
|
@@ -22,6 +22,7 @@ describe("utilities", async () => {
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it("Should convert _ to -", async () => {
|
|
25
|
+
// eslint-disable-next-line no-useless-escape
|
|
25
26
|
expect(s3Safe("___").match(/\_/g)).to.be.null;
|
|
26
27
|
});
|
|
27
28
|
|
|
@@ -40,6 +41,7 @@ describe("utilities", async () => {
|
|
|
40
41
|
it("Should remove any special chars", async () => {
|
|
41
42
|
expect(
|
|
42
43
|
s3Safe("!@#$%^&*()=_+;,./<>?~`|").match(
|
|
44
|
+
// eslint-disable-next-line no-useless-escape
|
|
43
45
|
/[\!\@\#\$\%\^\&\*\(\)\=\_\+\;\,\.\/\<\>\?\~\`\|]/g,
|
|
44
46
|
),
|
|
45
47
|
).to.be.null;
|
|
@@ -64,6 +66,7 @@ describe("utilities", async () => {
|
|
|
64
66
|
});
|
|
65
67
|
|
|
66
68
|
it("Should convert _ to -", async () => {
|
|
69
|
+
// eslint-disable-next-line no-useless-escape
|
|
67
70
|
expect(ebSafe("___").match(/\_/g)).to.be.null;
|
|
68
71
|
});
|
|
69
72
|
|
|
@@ -82,6 +85,7 @@ describe("utilities", async () => {
|
|
|
82
85
|
it("Should remove any special chars", async () => {
|
|
83
86
|
expect(
|
|
84
87
|
ebSafe("!@#$%^&*()=_+;,./<>?~`|").match(
|
|
88
|
+
// eslint-disable-next-line no-useless-escape
|
|
85
89
|
/[\!\@\#\$\%\^\&\*\(\)\=\_\+\;\,\.\/\<\>\?\~\`\|]/g,
|
|
86
90
|
),
|
|
87
91
|
).to.be.null;
|
package/cli.js
CHANGED
|
@@ -58,7 +58,6 @@ const args = hideBin(process.argv);
|
|
|
58
58
|
"connect",
|
|
59
59
|
"execute",
|
|
60
60
|
"lint",
|
|
61
|
-
"pretty",
|
|
62
61
|
);
|
|
63
62
|
|
|
64
63
|
if (_.config.preset === "permanent") {
|
|
@@ -144,9 +143,8 @@ const args = hideBin(process.argv);
|
|
|
144
143
|
// Remove network leftover by docker-compose run
|
|
145
144
|
function shutdown() {
|
|
146
145
|
try {
|
|
147
|
-
execSync(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} catch (e) {}
|
|
146
|
+
execSync(`docker network rm ${_.repoSafe}_default &>/dev/null`, _.opts);
|
|
147
|
+
} catch {
|
|
148
|
+
/* empty */
|
|
149
|
+
}
|
|
152
150
|
}
|
package/commands/check.js
CHANGED
|
@@ -25,6 +25,7 @@ module.exports = [
|
|
|
25
25
|
) {
|
|
26
26
|
_.command(
|
|
27
27
|
"php",
|
|
28
|
+
// eslint-disable-next-line no-useless-escape
|
|
28
29
|
`${argv.v ? `composer install --dry-run 2>&1 | grep '\\- Installing' | while read -r line; do echo \\$\{line/'Installing'\}; done && ` : ""}composer install --dry-run 2>&1 | grep -q 'Nothing to install, update or remove' && echo -e '\\033[0;32mComposer deps OK\\033[0m' || echo -e '\\033[0;31mComposer deps missing or outdated\\033[0m'`,
|
|
29
30
|
);
|
|
30
31
|
}
|
package/commands/clean.js
CHANGED
package/commands/content.js
CHANGED
|
@@ -17,8 +17,8 @@ module.exports = [
|
|
|
17
17
|
const stringify = JSON.stringify(
|
|
18
18
|
{
|
|
19
19
|
"aws-s3": "fishawack",
|
|
20
|
-
location: `fw-auto-content/${_.
|
|
21
|
-
key: `fw-s3-${_.
|
|
20
|
+
location: `fw-auto-content/${_.repoSafe}`,
|
|
21
|
+
key: `fw-s3-${_.repoSafe}`,
|
|
22
22
|
sync: true,
|
|
23
23
|
},
|
|
24
24
|
null,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
const _ = require("../../../globals.js");
|
|
2
|
-
const utilities = require("../libs/utilities");
|
|
3
2
|
const inquirer = require("inquirer");
|
|
4
3
|
const aws = require("../services/aws/index.js");
|
|
5
4
|
|
|
6
5
|
module.exports = [
|
|
7
6
|
"dekey",
|
|
8
7
|
false,
|
|
9
|
-
(
|
|
10
|
-
async (
|
|
8
|
+
() => {},
|
|
9
|
+
async () => {
|
|
11
10
|
let users = [];
|
|
12
11
|
let clients = [];
|
|
13
12
|
|
|
@@ -48,7 +48,7 @@ module.exports = [
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const slug = aws.slug(
|
|
51
|
-
_.
|
|
51
|
+
_.repoSafe,
|
|
52
52
|
answers.client,
|
|
53
53
|
branch,
|
|
54
54
|
answers.stack === "static" ? "s3" : "eb",
|
|
@@ -70,7 +70,7 @@ module.exports = [
|
|
|
70
70
|
await aws[`${answers.stack}Terminate`](
|
|
71
71
|
slug,
|
|
72
72
|
answers.client,
|
|
73
|
-
_.
|
|
73
|
+
_.repoSafe,
|
|
74
74
|
branch,
|
|
75
75
|
answers.id,
|
|
76
76
|
);
|
|
@@ -42,6 +42,7 @@ module.exports = [
|
|
|
42
42
|
let preset = await guide.preset(argv);
|
|
43
43
|
|
|
44
44
|
if (argv.l == null && preset === "permanent") {
|
|
45
|
+
// eslint-disable-next-line no-param-reassign
|
|
45
46
|
argv.legacy = argv.l = true;
|
|
46
47
|
}
|
|
47
48
|
|
|
@@ -73,8 +74,8 @@ module.exports = [
|
|
|
73
74
|
await guide.strict(argv);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
while (!(await test.
|
|
77
|
-
await guide.
|
|
77
|
+
while (!(await test.globalModules())) {
|
|
78
|
+
await guide.globalModules(argv);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
if (preset === "permanent" || preset === "freelancer") {
|
|
@@ -84,7 +84,7 @@ module.exports = [
|
|
|
84
84
|
type: "input",
|
|
85
85
|
name: "username",
|
|
86
86
|
message: "Username",
|
|
87
|
-
default: `${_.
|
|
87
|
+
default: `${_.repoSafe}User${credentials.length ? `-${credentials.length}` : ""}`,
|
|
88
88
|
validate: (input) => !!input.length,
|
|
89
89
|
},
|
|
90
90
|
{
|
|
@@ -115,7 +115,7 @@ module.exports = [
|
|
|
115
115
|
let config = {};
|
|
116
116
|
let infastructure;
|
|
117
117
|
const slug = aws.slug(
|
|
118
|
-
_.
|
|
118
|
+
_.repoSafe,
|
|
119
119
|
answers.client,
|
|
120
120
|
branch,
|
|
121
121
|
answers.stack === "static" ? "s3" : "eb",
|
|
@@ -131,7 +131,7 @@ module.exports = [
|
|
|
131
131
|
{ Key: "automated", Value: true },
|
|
132
132
|
],
|
|
133
133
|
credentials,
|
|
134
|
-
_.
|
|
134
|
+
_.repoSafe,
|
|
135
135
|
branch,
|
|
136
136
|
answers.framework,
|
|
137
137
|
answers.availability,
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
// eslint-disable-next-line no-unused-vars
|
|
1
2
|
function handler(event) {
|
|
3
|
+
var query, index, key, response;
|
|
4
|
+
|
|
2
5
|
// Redirect if www to non-www
|
|
3
6
|
if (event.request.headers.host.value.includes("www.")) {
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
query = "";
|
|
8
|
+
index = 0;
|
|
6
9
|
|
|
7
|
-
for (
|
|
10
|
+
for (key in event.request.querystring) {
|
|
8
11
|
query += `${index ? "&" : "?"}${key}=${event.request.querystring[key].value}`;
|
|
9
12
|
index++;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
response = {
|
|
13
16
|
statusCode: 301,
|
|
14
17
|
statusDescription: "Moved Permanently",
|
|
15
18
|
headers: {
|
|
@@ -27,10 +30,10 @@ function handler(event) {
|
|
|
27
30
|
|
|
28
31
|
// Redirect if no trailing slash
|
|
29
32
|
if (!event.request.uri.includes(".") && !event.request.uri.endsWith("/")) {
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
query = "";
|
|
34
|
+
index = 0;
|
|
32
35
|
|
|
33
|
-
for (
|
|
36
|
+
for (key in event.request.querystring) {
|
|
34
37
|
query += `${index ? "&" : "?"}${key}=${event.request.querystring[key].value}`;
|
|
35
38
|
index++;
|
|
36
39
|
}
|
|
@@ -70,7 +73,7 @@ function handler(event) {
|
|
|
70
73
|
// But if we get here, we must either be missing the auth header or the
|
|
71
74
|
// credentials failed to match what we expected.
|
|
72
75
|
// Request the browser present the Basic Auth dialog.
|
|
73
|
-
|
|
76
|
+
response = {
|
|
74
77
|
statusCode: 401,
|
|
75
78
|
statusDescription: "Unauthorized",
|
|
76
79
|
headers: {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
// eslint-disable-next-line no-unused-vars
|
|
1
2
|
function handler(event) {
|
|
3
|
+
var query, index, key, response;
|
|
4
|
+
|
|
2
5
|
// Redirect if www to non-www
|
|
3
6
|
if (event.request.headers.host.value.includes("www.")) {
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
query = "";
|
|
8
|
+
index = 0;
|
|
6
9
|
|
|
7
|
-
for (
|
|
10
|
+
for (key in event.request.querystring) {
|
|
8
11
|
query += `${index ? "&" : "?"}${key}=${event.request.querystring[key].value}`;
|
|
9
12
|
index++;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
response = {
|
|
13
16
|
statusCode: 301,
|
|
14
17
|
statusDescription: "Moved Permanently",
|
|
15
18
|
headers: {
|
|
@@ -27,10 +30,10 @@ function handler(event) {
|
|
|
27
30
|
|
|
28
31
|
// Redirect if no trailing slash
|
|
29
32
|
if (!event.request.uri.includes(".") && !event.request.uri.endsWith("/")) {
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
query = "";
|
|
34
|
+
index = 0;
|
|
32
35
|
|
|
33
|
-
for (
|
|
36
|
+
for (key in event.request.querystring) {
|
|
34
37
|
query += `${index ? "&" : "?"}${key}=${event.request.querystring[key].value}`;
|
|
35
38
|
index++;
|
|
36
39
|
}
|
|
@@ -47,6 +47,7 @@ module.exports.Spinner = class Spinner {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
action(message, action, success, failure) {
|
|
50
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
50
51
|
return new Promise(async (resolve, reject) => {
|
|
51
52
|
let instance = new this.constructor(message);
|
|
52
53
|
let res;
|
|
@@ -65,6 +66,7 @@ module.exports.Spinner = class Spinner {
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
simple(message, action) {
|
|
69
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
68
70
|
return new Promise(async (resolve, reject) => {
|
|
69
71
|
let instance = new this.constructor(message, true);
|
|
70
72
|
let res;
|
|
@@ -127,6 +129,7 @@ module.exports.nameSafe = (name, service = "s3") => {
|
|
|
127
129
|
safe = `${prefix}${safe}`;
|
|
128
130
|
safe = `${safe}${suffix}`;
|
|
129
131
|
safe = safe.replace(/\./g, "-");
|
|
132
|
+
// eslint-disable-next-line no-useless-escape
|
|
130
133
|
safe = safe.replace(/\_/g, "-");
|
|
131
134
|
|
|
132
135
|
return safe;
|
|
@@ -11,7 +11,7 @@ try {
|
|
|
11
11
|
miscFile = JSON.parse(
|
|
12
12
|
fs.readFileSync(path.join(os.homedir(), "targets", "misc.json")),
|
|
13
13
|
);
|
|
14
|
-
} catch
|
|
14
|
+
} catch {
|
|
15
15
|
miscFile = {
|
|
16
16
|
bitbucket: {},
|
|
17
17
|
gitlab: {},
|
|
@@ -29,7 +29,7 @@ try {
|
|
|
29
29
|
encoding: "utf8",
|
|
30
30
|
}),
|
|
31
31
|
);
|
|
32
|
-
} catch
|
|
32
|
+
} catch {
|
|
33
33
|
ftppassFile = {};
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -45,7 +45,7 @@ try {
|
|
|
45
45
|
{ encoding: "utf8" },
|
|
46
46
|
),
|
|
47
47
|
);
|
|
48
|
-
} catch
|
|
48
|
+
} catch {
|
|
49
49
|
creds.egnyte = {};
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -71,27 +71,27 @@ module.exports.headers = {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
// Required global node modules
|
|
74
|
-
module.exports.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
},
|
|
74
|
+
module.exports.globalModules = [
|
|
75
|
+
// HUSKY
|
|
76
|
+
{ package: "husky", version: "9" },
|
|
77
|
+
// COMMITLINT
|
|
78
|
+
{ package: "@commitlint/cli", version: "19" },
|
|
79
|
+
{ package: "@commitlint/config-conventional", version: "19" },
|
|
80
|
+
// PRETTIER
|
|
81
|
+
{ package: "prettier", version: "3" },
|
|
82
|
+
{ package: "@prettier/plugin-php", version: "0" },
|
|
83
|
+
// ESLINT
|
|
84
|
+
{ package: "@eslint/js", version: "9" },
|
|
85
|
+
{ package: "eslint-config-prettier", version: "10" },
|
|
86
|
+
{ package: "eslint-plugin-import", version: "2" },
|
|
87
|
+
{ package: "eslint-plugin-prettier", version: "5" },
|
|
88
|
+
{ package: "eslint-plugin-vue", version: "10" },
|
|
89
|
+
{ package: "eslint", version: "9" },
|
|
90
|
+
{ package: "globals", version: "16" },
|
|
91
|
+
// STYLELINT
|
|
92
|
+
{ package: "stylelint", version: "16" },
|
|
93
|
+
{ package: "stylelint-config-standard-scss", version: "15" },
|
|
94
|
+
{ package: "stylelint-prettier", version: "5" },
|
|
95
95
|
];
|
|
96
96
|
|
|
97
97
|
// User presets
|
|
@@ -36,7 +36,7 @@ module.exports.createIAMUser = async (UserName, account, tags = []) => {
|
|
|
36
36
|
);
|
|
37
37
|
},
|
|
38
38
|
);
|
|
39
|
-
} catch
|
|
39
|
+
} catch {
|
|
40
40
|
res = await Spinner.prototype.simple(
|
|
41
41
|
`Retrieving the already existing IAM user ${UserName}`,
|
|
42
42
|
() => {
|
|
@@ -81,7 +81,9 @@ module.exports.removeIAMUser = async (UserName, account) => {
|
|
|
81
81
|
return client.send(new DeleteUserCommand({ UserName }));
|
|
82
82
|
},
|
|
83
83
|
);
|
|
84
|
-
} catch
|
|
84
|
+
} catch {
|
|
85
|
+
/* empty */
|
|
86
|
+
}
|
|
85
87
|
|
|
86
88
|
return res;
|
|
87
89
|
};
|
|
@@ -347,7 +349,7 @@ module.exports.ensureEBInstanceProfileExists = async (account) => {
|
|
|
347
349
|
|
|
348
350
|
try {
|
|
349
351
|
await module.exports.getRole(role, account);
|
|
350
|
-
} catch
|
|
352
|
+
} catch {
|
|
351
353
|
await module.exports.createRole(
|
|
352
354
|
role,
|
|
353
355
|
account,
|