@fishawack/lab-env 4.42.0-beta.1 → 4.43.0-beta.1
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/CHANGELOG.md +30 -0
- package/browsers/chrome/docker-compose.yml +6 -0
- package/browsers/edge/docker-compose.yml +6 -0
- package/browsers/firefox/docker-compose.yml +6 -0
- package/commands/create/services/guide.js +15 -8
- package/commands/execute.js +14 -4
- package/globals.js +94 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
### 4.43.0-beta.1 (2025-08-10)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* --up flag on exec to up all containers related to project ([b0dd56e](https://bitbucket.org/fishawackdigital/lab-env/commits/b0dd56e50d13ea57c75f866b3d105b97325d5ccc))
|
|
8
|
+
* browsers now auto detect based on config ([01ce9da](https://bitbucket.org/fishawackdigital/lab-env/commits/01ce9daf6d7f3c391d79188122c01c8c5a6b0ac6))
|
|
9
|
+
* chrome browser now default when core runs, firefox & edge can be abled through env flags ([b7b16f0](https://bitbucket.org/fishawackdigital/lab-env/commits/b7b16f07e2b42ac7aaefe4d11647255965b63eaf))
|
|
10
|
+
* **core@1:** bump to 1.8.0 ([1232342](https://bitbucket.org/fishawackdigital/lab-env/commits/12323424e0ea5223eca96703a0d60c969f2479b0))
|
|
11
|
+
* fwConfig now merged and available ([098098f](https://bitbucket.org/fishawackdigital/lab-env/commits/098098f3808d81407fd5989d6c3bfb8b8e08f65a))
|
|
12
|
+
|
|
13
|
+
#### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* only read and write .ftppass in legacy mode ([76902ac](https://bitbucket.org/fishawackdigital/lab-env/commits/76902acfb33e7919b63b071005b6cd73f2557272))
|
|
16
|
+
* safe check browsers too ([dd7322a](https://bitbucket.org/fishawackdigital/lab-env/commits/dd7322a52dc444a4f08568c1ba587f2858db359b))
|
|
17
|
+
|
|
18
|
+
#### Build Updates
|
|
19
|
+
|
|
20
|
+
* added selenium browser docker compise files ([e7fbf3d](https://bitbucket.org/fishawackdigital/lab-env/commits/e7fbf3dd3c0f94375f0dd3a54fbbf7dbba2eddf9))
|
|
21
|
+
|
|
22
|
+
### 4.42.0 (2025-08-08)
|
|
23
|
+
|
|
24
|
+
#### Features
|
|
25
|
+
|
|
26
|
+
* handle core@9 ([3be2c58](https://bitbucket.org/fishawackdigital/lab-env/commits/3be2c581ab7fde3882f245ea4b68b911abca49b7))
|
|
27
|
+
* support runnin the core as a local git repo ([93b167a](https://bitbucket.org/fishawackdigital/lab-env/commits/93b167a08da11e445bfc6d0549bf8b192400bb84))
|
|
28
|
+
|
|
29
|
+
#### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* update to latest patch of mysql now the version we were using is deprecated ([3e6be12](https://bitbucket.org/fishawackdigital/lab-env/commits/3e6be12dc9841f6d141315820d12f1e59abdd9b8))
|
|
32
|
+
|
|
3
33
|
### 4.42.0-beta.1 (2025-08-08)
|
|
4
34
|
|
|
5
35
|
#### Features
|
|
@@ -189,7 +189,7 @@ module.exports.ftppass = async ({ confirm }) => {
|
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
module.exports.egnyte = async ({ confirm }) => {
|
|
192
|
+
module.exports.egnyte = async ({ confirm, legacy }) => {
|
|
193
193
|
let inputs = confirm
|
|
194
194
|
? { confirm }
|
|
195
195
|
: await inquirer.prompt([
|
|
@@ -242,19 +242,26 @@ module.exports.egnyte = async ({ confirm }) => {
|
|
|
242
242
|
},
|
|
243
243
|
]);
|
|
244
244
|
|
|
245
|
-
let file =
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
let file = legacy
|
|
246
|
+
? JSON.parse(
|
|
247
|
+
readFileSync(`${homedir()}/targets/.ftppass`, {
|
|
248
|
+
encoding: "utf8",
|
|
249
|
+
}),
|
|
250
|
+
)
|
|
251
|
+
: "";
|
|
248
252
|
|
|
249
253
|
creds.egnyte =
|
|
250
254
|
credsFtppass["ftp-fishawack.egnyte.com"] =
|
|
251
255
|
file["ftp-fishawack.egnyte.com"] =
|
|
252
256
|
{ ...inputs };
|
|
253
257
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
+
if (legacy) {
|
|
259
|
+
writeFileSync(
|
|
260
|
+
`${homedir()}/targets/.ftppass`,
|
|
261
|
+
JSON.stringify(file, null, 4),
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
258
265
|
writeFileSync(
|
|
259
266
|
`${homedir()}/targets/${creds.egnyte.host}.json`,
|
|
260
267
|
JSON.stringify({ ...creds.egnyte, passphrase: "" }, null, 4),
|
package/commands/execute.js
CHANGED
|
@@ -28,15 +28,25 @@ module.exports = [
|
|
|
28
28
|
describe: "container to connect to",
|
|
29
29
|
default: "core",
|
|
30
30
|
});
|
|
31
|
+
|
|
32
|
+
yargs.option("up", {
|
|
33
|
+
alias: "u",
|
|
34
|
+
type: "boolean",
|
|
35
|
+
default: false,
|
|
36
|
+
describe: "up all containers",
|
|
37
|
+
});
|
|
31
38
|
},
|
|
32
39
|
(argv) => {
|
|
33
40
|
const prep = argv.g
|
|
34
41
|
? "npx grunt --gruntfile node_modules/@fishawack/core/Gruntfile.js "
|
|
35
42
|
: " ";
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
const command = `${argv.d ? "xvfb-run " : ""}${prep}${argv.command.join(" ")}`;
|
|
45
|
+
|
|
46
|
+
if (argv.up) {
|
|
47
|
+
_.up(() => _.command(argv.container, command));
|
|
48
|
+
} else {
|
|
49
|
+
_.command(argv.container, command);
|
|
50
|
+
}
|
|
41
51
|
},
|
|
42
52
|
];
|
package/globals.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const execSync = require("child_process").execSync;
|
|
2
2
|
const path = require("path");
|
|
3
|
+
const glob = require("glob");
|
|
4
|
+
const _ = require("lodash");
|
|
3
5
|
const {
|
|
4
6
|
lstatSync,
|
|
5
7
|
readdirSync,
|
|
@@ -35,6 +37,81 @@ const getDirectories = (source) =>
|
|
|
35
37
|
.map((name) => path.join(source, name))
|
|
36
38
|
.filter(isDirectory);
|
|
37
39
|
|
|
40
|
+
const getCoreMergedConfigs = () => {
|
|
41
|
+
const globPatterns = [
|
|
42
|
+
"./fw.json",
|
|
43
|
+
"./fw.*.json",
|
|
44
|
+
"./content.json",
|
|
45
|
+
"./level-*.json",
|
|
46
|
+
"_Build/config/*.json",
|
|
47
|
+
"_Build/*.json",
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
let json = {};
|
|
51
|
+
let loaded = [];
|
|
52
|
+
|
|
53
|
+
globPatterns.forEach((pattern) => {
|
|
54
|
+
try {
|
|
55
|
+
const files = glob.sync(pattern, { cwd });
|
|
56
|
+
|
|
57
|
+
files.forEach((file) => {
|
|
58
|
+
// Only load config types once, lower configs override higher ones
|
|
59
|
+
if (loaded.indexOf(path.basename(file)) === -1) {
|
|
60
|
+
try {
|
|
61
|
+
const filePath = path.resolve(cwd, file);
|
|
62
|
+
if (existsSync(filePath)) {
|
|
63
|
+
const fileContent = readFileSync(filePath, {
|
|
64
|
+
encoding: "utf8",
|
|
65
|
+
});
|
|
66
|
+
const jsonData = JSON.parse(fileContent);
|
|
67
|
+
|
|
68
|
+
loaded.push(path.basename(file));
|
|
69
|
+
|
|
70
|
+
// Deep merge with array concatenation (matching core behavior)
|
|
71
|
+
_.mergeWith(json, jsonData, function (obj, src) {
|
|
72
|
+
if (_.isArray(obj)) {
|
|
73
|
+
return obj.concat(src);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
} catch (error) {
|
|
78
|
+
if (args.find((d) => d === "--debug")) {
|
|
79
|
+
console.log(
|
|
80
|
+
utilities.colorize(
|
|
81
|
+
`Failed to parse ${file}: ${error.message}`,
|
|
82
|
+
"warning",
|
|
83
|
+
),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (args.find((d) => d === "--debug")) {
|
|
91
|
+
console.log(
|
|
92
|
+
utilities.colorize(
|
|
93
|
+
`Glob pattern failed ${pattern}: ${error.message}`,
|
|
94
|
+
"warning",
|
|
95
|
+
),
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Merge branch-specific targets (matching core behavior)
|
|
102
|
+
_.mergeWith(
|
|
103
|
+
json.attributes,
|
|
104
|
+
json?.attributes?.targets?.[branch] || {},
|
|
105
|
+
function (obj, src) {
|
|
106
|
+
if (_.isArray(obj)) {
|
|
107
|
+
return obj.concat(src);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
return json;
|
|
113
|
+
};
|
|
114
|
+
|
|
38
115
|
var config;
|
|
39
116
|
var repo;
|
|
40
117
|
var platform;
|
|
@@ -70,6 +147,8 @@ try {
|
|
|
70
147
|
branch = "unknown";
|
|
71
148
|
}
|
|
72
149
|
|
|
150
|
+
const coreConfig = getCoreMergedConfigs();
|
|
151
|
+
|
|
73
152
|
try {
|
|
74
153
|
repo =
|
|
75
154
|
execSync('basename "$(git rev-parse --show-toplevel)"', {
|
|
@@ -286,6 +365,21 @@ process.env.FW_ADONIS_0_NODE_IMAGE = process.env.FW_ADONIS_0_NODE_IMAGE || ``;
|
|
|
286
365
|
|
|
287
366
|
var core = `-f ${__dirname}/core/${process.env.VERSION}/docker-compose.yml`;
|
|
288
367
|
|
|
368
|
+
// Append chrome container as required in core image as of v9
|
|
369
|
+
core += ` -f ${__dirname}/browsers/chrome/docker-compose.yml`;
|
|
370
|
+
|
|
371
|
+
process.env.REMOTE_BROWSERS =
|
|
372
|
+
process.env.REMOTE_BROWSERS ||
|
|
373
|
+
coreConfig?.attributes?.capture?.browsers?.join(",");
|
|
374
|
+
|
|
375
|
+
if (process.env.REMOTE_BROWSERS?.includes("firefox")) {
|
|
376
|
+
core += ` -f ${__dirname}/browsers/firefox/docker-compose.yml`;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (process.env.REMOTE_BROWSERS?.includes("edge")) {
|
|
380
|
+
core += ` -f ${__dirname}/browsers/edge/docker-compose.yml`;
|
|
381
|
+
}
|
|
382
|
+
|
|
289
383
|
// Map versions of images
|
|
290
384
|
process.env.FW_CORE_0_VERSION =
|
|
291
385
|
process.env.FW_CORE_0_VERSION || require("./core/0/package.json").version;
|