@fishawack/lab-env 4.42.0 → 4.43.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/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  ## Changelog
2
2
 
3
+ ### 4.43.0 (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.43.0-beta.1 (2025-08-10)
23
+
24
+ #### Features
25
+
26
+ * --up flag on exec to up all containers related to project ([b0dd56e](https://bitbucket.org/fishawackdigital/lab-env/commits/b0dd56e50d13ea57c75f866b3d105b97325d5ccc))
27
+ * browsers now auto detect based on config ([01ce9da](https://bitbucket.org/fishawackdigital/lab-env/commits/01ce9daf6d7f3c391d79188122c01c8c5a6b0ac6))
28
+ * chrome browser now default when core runs, firefox & edge can be abled through env flags ([b7b16f0](https://bitbucket.org/fishawackdigital/lab-env/commits/b7b16f07e2b42ac7aaefe4d11647255965b63eaf))
29
+ * **core@1:** bump to 1.8.0 ([1232342](https://bitbucket.org/fishawackdigital/lab-env/commits/12323424e0ea5223eca96703a0d60c969f2479b0))
30
+ * fwConfig now merged and available ([098098f](https://bitbucket.org/fishawackdigital/lab-env/commits/098098f3808d81407fd5989d6c3bfb8b8e08f65a))
31
+
32
+ #### Bug Fixes
33
+
34
+ * only read and write .ftppass in legacy mode ([76902ac](https://bitbucket.org/fishawackdigital/lab-env/commits/76902acfb33e7919b63b071005b6cd73f2557272))
35
+ * safe check browsers too ([dd7322a](https://bitbucket.org/fishawackdigital/lab-env/commits/dd7322a52dc444a4f08568c1ba587f2858db359b))
36
+
37
+ #### Build Updates
38
+
39
+ * added selenium browser docker compise files ([e7fbf3d](https://bitbucket.org/fishawackdigital/lab-env/commits/e7fbf3dd3c0f94375f0dd3a54fbbf7dbba2eddf9))
40
+
3
41
  ### 4.42.0 (2025-08-08)
4
42
 
5
43
  #### Features
@@ -0,0 +1,6 @@
1
+ services:
2
+ chrome:
3
+ image: selenium/standalone-chromium:138.0.7204.183
4
+ shm_size: 2gb
5
+ environment:
6
+ - SE_NODE_MAX_SESSIONS=10
@@ -0,0 +1,6 @@
1
+ services:
2
+ edge:
3
+ image: selenium/standalone-edge:131.0-20250727
4
+ shm_size: 2gb
5
+ environment:
6
+ - SE_NODE_MAX_SESSIONS=10
@@ -0,0 +1,6 @@
1
+ services:
2
+ firefox:
3
+ image: selenium/standalone-firefox:130.0-20250727
4
+ shm_size: 2gb
5
+ environment:
6
+ - SE_NODE_MAX_SESSIONS=10
@@ -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 = JSON.parse(
246
- readFileSync(`${homedir()}/targets/.ftppass`, { encoding: "utf8" }),
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
- writeFileSync(
255
- `${homedir()}/targets/.ftppass`,
256
- JSON.stringify(file, null, 4),
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),
@@ -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
- _.command(
38
- argv.container,
39
- `${argv.d ? "xvfb-run " : ""}${prep}${argv.command.join(" ")}`,
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
  ];
@@ -1,5 +1,17 @@
1
1
  ## Changelog
2
2
 
3
+ ### 1.8.0 (2025-08-10)
4
+
5
+ #### Features
6
+
7
+ * new env flag for remote browsers ([f313be6](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/f313be6cde14e05ac832b43127b6c5639fd62015))
8
+
9
+ ### 1.8.0-beta.1 (2025-08-10)
10
+
11
+ #### Features
12
+
13
+ * new env flag for remote browsers ([f313be6](https://bitbucket.org/fishawackdigital/lab-env-core-1/commits/f313be6cde14e05ac832b43127b6c5639fd62015))
14
+
3
15
  ### 1.7.2 (2025-05-15)
4
16
 
5
17
  #### Bug Fixes
@@ -27,10 +27,10 @@ pipelines:
27
27
  # Publish docker image
28
28
  - docker login $DOCKER_CREDENTIALS && docker buildx create --use && npm run image
29
29
  # Sync beta after publish
30
- - git fetch origin "+refs/heads/*:refs/remotes/origin/*" && git checkout beta && git merge master && git push origin beta
31
- # Commit and create pull request for new version on lab-env repo
32
30
  - git config --global user.email "digital@fishawack.com"
33
31
  - git config --global user.name "Digital Fishawack"
32
+ - git fetch origin "+refs/heads/*:refs/remotes/origin/*" && git checkout beta && git merge master && git push origin beta
33
+ # Commit and create pull request for new version on lab-env repo
34
34
  - git clone https://$GIT_CREDENTIALS@bitbucket.org/fishawackdigital/lab-env
35
35
  - cd lab-env
36
36
  - git checkout -b "$BITBUCKET_REPO_SLUG-$BITBUCKET_COMMIT" origin/beta
@@ -31,6 +31,7 @@ services:
31
31
  - FW_ROOT=${FW_ROOT:-}
32
32
  - BRANCH=${BRANCH:-}
33
33
  - CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME:-}
34
+ - REMOTE_BROWSERS=${REMOTE_BROWSERS:-chrome}
34
35
  volumes:
35
36
  node_modules:
36
37
  driver: "local"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "lab-env docker config for the @fishawack/core/1 npm module",
5
5
  "scripts": {
6
6
  "setup": "ln -sfn ../../.commitlintrc.json .commitlintrc.json && ln -sfn ../../.editorconfig .editorconfig && ln -sfn ../../.prettierignore .prettierignore && ln -sfn ../../.husky/ .husky && husky &>/dev/null || true",
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishawack/lab-env",
3
- "version": "4.42.0",
3
+ "version": "4.43.0",
4
4
  "description": "Docker manager for FW",
5
5
  "main": "cli.js",
6
6
  "scripts": {