@adobe/aio-lib-web 5.1.0 → 6.0.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.
@@ -10,7 +10,7 @@ jobs:
10
10
  runs-on: ${{ matrix.os }}
11
11
  strategy:
12
12
  matrix:
13
- node: [14]
13
+ node: [16]
14
14
  os: [ubuntu-latest]
15
15
 
16
16
  steps:
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ${{ matrix.os }}
15
15
  strategy:
16
16
  matrix:
17
- node-version: [12.x, 14.x]
17
+ node-version: [14.x, 16.x]
18
18
  os: [ubuntu-latest, windows-latest]
19
19
 
20
20
  steps:
@@ -12,7 +12,7 @@ jobs:
12
12
  - uses: actions/checkout@v2
13
13
  - uses: actions/setup-node@v1
14
14
  with:
15
- node-version: 10
15
+ node-version: 16
16
16
  - run: npm install
17
17
  - run: npm test
18
18
  - uses: JS-DevTools/npm-publish@v1
@@ -0,0 +1,45 @@
1
+ name: publish-prerelease
2
+ on:
3
+ workflow_dispatch:
4
+ inputs:
5
+ pre-release-tag:
6
+ description: 'The pre-release tag use in the version'
7
+ required: false
8
+ default: 'pre'
9
+ dist-tag:
10
+ description: 'The dist-tag use'
11
+ required: false
12
+ default: 'next'
13
+ dependencies-to-update:
14
+ description: 'csv of dependencies to update with the dist-tag'
15
+ required: false
16
+ default: '@adobe/aio-lib-core-config,@adobe/aio-lib-core-logging,@adobe/aio-lib-core-tvm'
17
+
18
+ jobs:
19
+ checkout:
20
+ name: checkout
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - run: |
25
+ git config user.name github-actions
26
+ git config user.email github-actions@github.com
27
+ - uses: actions/setup-node@v1
28
+ with:
29
+ node-version: 16
30
+ - run: |
31
+ npm install
32
+ npm test
33
+ - name: Update your package.json with an npm pre-release version
34
+ id: pre-release-version
35
+ uses: adobe/update-prerelease-npm-version@v1.0.0
36
+ with:
37
+ pre-release-tag: ${{ github.event.inputs.pre-release-tag }}
38
+ dependencies-to-update: ${{ github.event.inputs.dependencies-to-update }}
39
+ dependencies-to-update-version-tag: ${{ github.event.inputs.dist-tag }}
40
+ - run: echo pre-release-version - ${{ steps.pre-release-version.outputs.pre-release-version }}
41
+ - uses: JS-DevTools/npm-publish@v1
42
+ with:
43
+ token: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
44
+ tag: ${{ github.event.inputs.dist-tag }}
45
+ access: 'public'
package/e2e/e2e.js CHANGED
@@ -14,6 +14,8 @@ const path = require('path')
14
14
  const fs = require('fs-extra')
15
15
  const fetch = require('node-fetch')
16
16
 
17
+ jest.setTimeout(30000)
18
+
17
19
  // load .env values in the e2e folder, if any
18
20
  require('dotenv').config({ path: path.join(__dirname, '.env') })
19
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/aio-lib-web",
3
- "version": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "description": "Utility tooling library to build and deploy Adobe I/O Project Firefly app static sites to CDN",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -10,7 +10,7 @@
10
10
  "author": "Adobe Inc.",
11
11
  "license": "Apache-2.0",
12
12
  "engines": {
13
- "node": ">=10.0.0"
13
+ "node": "^14.18 || ^16.13 || >=18"
14
14
  },
15
15
  "repository": "adobe/aio-lib-web",
16
16
  "homepage": "https://github.com/adobe/aio-lib-web",
@@ -29,9 +29,9 @@
29
29
  "e2e": "jest --config='./e2e/jest.config.js' --testRegex './e2e/e2e.js'"
30
30
  },
31
31
  "dependencies": {
32
- "@adobe/aio-lib-core-config": "^2.0.0",
33
- "@adobe/aio-lib-core-logging": "^1.1.0",
34
- "@adobe/aio-lib-core-tvm": "^2.2.1",
32
+ "@adobe/aio-lib-core-config": "^3.0.0",
33
+ "@adobe/aio-lib-core-logging": "^2.0.0",
34
+ "@adobe/aio-lib-core-tvm": "^3.0.0",
35
35
  "aws-sdk": "^2.600.0",
36
36
  "fs-extra": "^9.0.0",
37
37
  "joi": "^17.2.1",
@@ -39,7 +39,7 @@
39
39
  "klaw": "^3.0.0",
40
40
  "lodash.clonedeep": "^4.5.0",
41
41
  "mime-types": "^2.1.24",
42
- "parcel": "2.0.0-beta.3.1",
42
+ "parcel": "2.5.0",
43
43
  "regenerator-runtime": "^0.13.7"
44
44
  },
45
45
  "devDependencies": {
package/src/bundle.js CHANGED
@@ -12,7 +12,7 @@ governing permissions and limitations under the License.
12
12
 
13
13
  const Bundler = require('@parcel/core').default
14
14
  const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-lib-web:bundle', { provider: 'debug' })
15
- const fs = require('fs-extra')
15
+
16
16
  /**
17
17
  * @typedef {object} BundleWebObject
18
18
  * @property {object} the Parcel bundler object
@@ -31,17 +31,17 @@ const fs = require('fs-extra')
31
31
  /**
32
32
  * Bundles the web source via Parcel.
33
33
  *
34
- * @param {string} [entryFile] path to entry file to bundle
34
+ * @param {Array of string} [entries] one or more file paths or globs
35
35
  * @param {string} [dest] directory to build to
36
36
  * @param {BundleOptions} [options] the Parcel bundler options
37
37
  * @param {Function} [log] the app logger
38
38
  * @returns {BundleWebObject} the BundleWebObject
39
39
  */
40
- module.exports = async (entryFile, dest, options = { shouldOptimize: false }, log = () => {}) => {
40
+ module.exports = async (entries, dest, options = { shouldOptimize: false }, log = () => {}) => {
41
41
  aioLogger.debug(`bundle options: ${JSON.stringify(options, null, 2)}`)
42
42
 
43
- if (!entryFile || !fs.existsSync(entryFile)) {
44
- throw new Error('cannot build web, entyFile not specified, or does not exist')
43
+ if (!entries) {
44
+ throw new Error('cannot build web, entries not specified')
45
45
  }
46
46
  if (!dest) {
47
47
  throw new Error('cannot build web, missing destination')
@@ -49,7 +49,7 @@ module.exports = async (entryFile, dest, options = { shouldOptimize: false }, lo
49
49
 
50
50
  // set defaults, but allow override by passed in values
51
51
  const parcelBundleOptions = {
52
- entries: entryFile,
52
+ entries: entries,
53
53
  defaultConfig: require.resolve('@parcel/config-default'),
54
54
  shouldDisableCache: false,
55
55
  targets: {
@@ -69,7 +69,7 @@ module.exports = async (entryFile, dest, options = { shouldOptimize: false }, lo
69
69
  }
70
70
 
71
71
  aioLogger.debug(`bundle bundleOptions: ${JSON.stringify(parcelBundleOptions, null, 2)}`)
72
- log(`bundling ${entryFile}`)
72
+ log(`bundling ${entries}`)
73
73
  const bundler = new Bundler(parcelBundleOptions)
74
74
 
75
75
  return bundler