@oro-dxeco/playwright-aws-lambda 133.0.0-alpha.3 → 133.0.0-alpha.4

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.
@@ -12,7 +12,7 @@ const isHeadlessModeEnabled_1 = require("./util/isHeadlessModeEnabled");
12
12
  const fileExists_1 = require("./util/fileExists");
13
13
  const getEnvironmentVariables_1 = require("./util/getEnvironmentVariables");
14
14
  const isLambdaRuntimeEnvironmentNode20_1 = require("./util/isLambdaRuntimeEnvironmentNode20");
15
- const { inflate } = require('lambdafs');
15
+ const lambdafs_1 = require("@sparticuz/chromium/build/lambdafs");
16
16
  /**
17
17
  * Returns a list of recommended additional Chromium flags.
18
18
  */
@@ -80,14 +80,14 @@ async function getChromiumExecutablePath(headless) {
80
80
  }
81
81
  const input = path.join(__dirname, 'bin');
82
82
  const promises = [
83
- inflate(`${input}/chromium.br`),
84
- inflate(`${input}/swiftshader.tar.br`),
83
+ lambdafs_1.default.inflate(path.join(input, 'chromium.br')),
84
+ lambdafs_1.default.inflate(path.join(input, 'swiftshader.tar.br')),
85
85
  ];
86
86
  if (isLambdaRuntimeEnvironment_1.default()) {
87
- promises.push(inflate(`${input}/al2.tar.br`));
87
+ promises.push(lambdafs_1.default.inflate(path.join(input, 'al2.tar.br')));
88
88
  }
89
89
  if (isLambdaRuntimeEnvironmentNode20_1.default()) {
90
- promises.push(inflate(`${input}/al2023.tar.br`));
90
+ promises.push(lambdafs_1.default.inflate(path.join(input, 'al2023.tar.br')));
91
91
  }
92
92
  const result = await Promise.all(promises);
93
93
  return result.shift();
@@ -18,12 +18,12 @@ async function getEnvironmentVariables(baselibPath) {
18
18
  // alternatively set it to a non-existing directory.
19
19
  if (!process.env.FONTCONFIG_PATH && fs_1.existsSync(exports.AWS_FONT_DIR)) {
20
20
  env.FONTCONFIG_PATH = exports.AWS_FONT_DIR;
21
- await fs_1.promises.writeFile(path.join(exports.AWS_FONT_DIR, 'fonts.conf'), `<?xml version="1.0"?>
22
- <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
23
- <fontconfig>
24
- <dir>${exports.AWS_FONT_DIR}</dir>
25
- <cachedir>/tmp/fonts-cache/</cachedir>
26
- <config></config>
21
+ await fs_1.promises.writeFile(path.join(exports.AWS_FONT_DIR, 'fonts.conf'), `<?xml version="1.0"?>
22
+ <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
23
+ <fontconfig>
24
+ <dir>${exports.AWS_FONT_DIR}</dir>
25
+ <cachedir>/tmp/fonts-cache/</cachedir>
26
+ <config></config>
27
27
  </fontconfig>`);
28
28
  }
29
29
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oro-dxeco/playwright-aws-lambda",
3
- "version": "133.0.0-alpha.3",
3
+ "version": "133.0.0-alpha.4",
4
4
  "description": "Support for running Microsoft's Playwrite on AWS Lambda and Google Cloud functions",
5
5
  "repository": {
6
6
  "type": "git",