@adobe/helix-deploy 9.3.19 → 9.3.20

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,3 +1,14 @@
1
+ ## [9.3.20](https://github.com/adobe/helix-deploy/compare/v9.3.19...v9.3.20) (2023-11-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **fastly:** do not access empty config ([6e745d6](https://github.com/adobe/helix-deploy/commit/6e745d621476490f61f6f486792b0b725d1af486))
7
+ * **fastly:** do not fork the process, instead use fastly's own CLI backend ([4287706](https://github.com/adobe/helix-deploy/commit/4287706395dd659285438149d9864c69722963be))
8
+ * **fastly:** import correct module ([223c893](https://github.com/adobe/helix-deploy/commit/223c89353cefe00bd97e708b759431d7aa6933fe))
9
+ * **fastly:** use correct log function ([d231db8](https://github.com/adobe/helix-deploy/commit/d231db85edb7ba21e6bfec0885e4a6e3f605091c))
10
+ * **fastly:** use fastly's arg parser ([ce7b376](https://github.com/adobe/helix-deploy/commit/ce7b376bfa32fe1862de619febf48de2e4efca68))
11
+
1
12
  ## [9.3.19](https://github.com/adobe/helix-deploy/compare/v9.3.18...v9.3.19) (2023-11-25)
2
13
 
3
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-deploy",
3
- "version": "9.3.19",
3
+ "version": "9.3.20",
4
4
  "description": "Library and Commandline Tools to build and deploy OpenWhisk Actions",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/adobe/helix-deploy#readme",
@@ -9,19 +9,16 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- import { fork } from 'child_process';
13
12
  import chalk from 'chalk-template';
14
- import { fileURLToPath } from 'url';
15
13
  import path from 'path';
16
14
  import fs from 'fs/promises';
17
15
  import tar from 'tar';
18
16
  import Fastly from '@adobe/fastly-native-promises';
17
+ import { compileApplicationToWasm } from '@fastly/js-compute/src/compileApplicationToWasm.js';
18
+ import { parseInputs } from '@fastly/js-compute/src/parseInputs.js';
19
19
  import BaseDeployer from './BaseDeployer.js';
20
20
  import ComputeAtEdgeConfig from './ComputeAtEdgeConfig.js';
21
21
 
22
- // eslint-disable-next-line no-underscore-dangle
23
- const __dirname = path.resolve(fileURLToPath(import.meta.url), '..');
24
-
25
22
  /**
26
23
  * The class ComputeAtEdgeDeployer deploys to Fastly's Compute(at)Edge (WASM) runtime.
27
24
  * It should be seen as a functional equivalent to the CloudflareDeployer
@@ -79,29 +76,16 @@ name = "${this.cfg.packageName}"
79
76
  service_id = ""
80
77
  `);
81
78
 
79
+ const {
80
+ input,
81
+ output,
82
+ wasmEngine,
83
+ } = await parseInputs([this.cfg.edgeBundle, path.resolve(bundleDir, 'bin', 'main.wasm')]);
84
+
82
85
  return new Promise((resolve, reject) => {
83
- const child = fork(
84
- path.resolve(
85
- __dirname,
86
- '..',
87
- '..',
88
- 'node_modules',
89
- '@fastly',
90
- 'js-compute',
91
- 'js-compute-runtime-cli.js',
92
- ),
93
- [this.cfg.edgeBundle, 'bin/main.wasm'],
94
- {
95
- cwd: bundleDir,
96
- },
97
- );
98
- child.on('data', (data) => resolve(data));
99
- child.on('error', (err) => reject(err));
100
- child.on('close', async (err) => {
101
- if (err) {
102
- // non-zero status code
103
- reject(err);
104
- } else {
86
+ this.log.debug('--: creating WASM bundle of script and interpreter');
87
+ compileApplicationToWasm(input, output, wasmEngine, false, false)
88
+ .then(async () => {
105
89
  const file = path.resolve(bundleDir, 'fastly-bundle.tar.gz');
106
90
  this.log.debug(chalk`{green ok:} created WASM bundle of script and interpreter in ${bundleDir}/bin/main.wasm`);
107
91
  await tar.c({
@@ -113,8 +97,11 @@ service_id = ""
113
97
  }, ['bin/main.wasm', 'fastly.toml']);
114
98
  this.log.debug(chalk`{green ok:} created tar file in ${bundleDir}/fastly-bundle.tar.gz`);
115
99
  resolve(fs.readFile(file));
116
- }
117
- });
100
+ })
101
+ // c8 ignore next 3
102
+ .catch((err) => {
103
+ reject(err);
104
+ });
118
105
  });
119
106
  }
120
107