@adobe/helix-deploy 4.15.1 → 5.0.3

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2019 Adobe. All rights reserved.
2
+ * Copyright 2021 Adobe. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -9,15 +9,4 @@
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
-
13
- module.exports = {
14
- // modules that are provided by the runtime container
15
- externals: [
16
- // 'express',
17
- // 'body-parser',
18
- // 'cls-hooked',
19
- // 'request',
20
- // 'request-promise',
21
- /^openwhisk(\/.*)?$/,
22
- ],
23
- };
12
+ module.exports = require('../package.json');
@@ -9,9 +9,7 @@
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
- // eslint-disable-next-line no-underscore-dangle
13
- global.__rootdir = __dirname;
14
-
12
+ const { dirname } = require('path');
15
13
  const {
16
14
  openwhisk,
17
15
  aws,
@@ -19,6 +17,9 @@ const {
19
17
  azure,
20
18
  } = require('@adobe/helix-universal').adapter;
21
19
 
20
+ // eslint-disable-next-line no-underscore-dangle
21
+ global.__rootdir = dirname(__filename); // __dirname is transformed by webpack, __filename isn't
22
+
22
23
  module.exports = Object.assign(azure, {
23
24
  main: openwhisk,
24
25
  lambda: aws,
@@ -10,8 +10,8 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  /* eslint-env serviceworker */
13
- const fastly = require('./fastly-adapter');
14
- const cloudflare = require('./cloudflare-adapter');
13
+ const fastly = require('./fastly-adapter.js');
14
+ const cloudflare = require('./cloudflare-adapter.js');
15
15
 
16
16
  /* eslint-disable no-restricted-globals */
17
17
  if (typeof addEventListener === 'function') {
package/src/utils.js CHANGED
@@ -9,8 +9,12 @@
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
- const { fork } = require('child_process');
13
- const path = require('path');
12
+ import { fileURLToPath } from 'url';
13
+ import { fork } from 'child_process';
14
+ import path from 'path';
15
+
16
+ // eslint-disable-next-line no-underscore-dangle
17
+ const __dirname = path.resolve(fileURLToPath(import.meta.url), '..');
14
18
 
15
19
  /**
16
20
  * @typedef {object} VersionCoordinates
@@ -54,7 +58,7 @@ const path = require('path');
54
58
  * @param {VersionSpec} versionspec - which version is current
55
59
  * @returns {NamedAction[]} - a list of actions that can safely be deleted
56
60
  */
57
- function filterActions(fns, now, {
61
+ export function filterActions(fns, now, {
58
62
  ciAge, patchAge, minorAge, majorAge, ciNum, patchNum, minorNum, majorNum,
59
63
  } = {}, { patchVersion, minorVersion, majorVersion } = {}) {
60
64
  // sort by updated date
@@ -151,7 +155,7 @@ function filterActions(fns, now, {
151
155
  ...cleanmajorbyage, ...cleanmajorbycount];
152
156
  }
153
157
 
154
- async function validateBundle(bundlePath, invoke = false) {
158
+ export async function validateBundle(bundlePath, invoke = false) {
155
159
  try {
156
160
  const opts = {
157
161
  invoke,
@@ -175,8 +179,3 @@ async function validateBundle(bundlePath, invoke = false) {
175
179
  };
176
180
  }
177
181
  }
178
-
179
- module.exports = {
180
- filterActions,
181
- validateBundle,
182
- };