Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add proxy support #480

Merged
merged 19 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/index.js)_
_See code: [src/commands/app/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/index.js)_

## `aio app:add`

Expand All @@ -88,7 +88,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/index.js)_
_See code: [src/commands/app/add/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/index.js)_

## `aio app:add:action`

Expand All @@ -112,7 +112,7 @@ ALIASES
$ aio app:add:actions
```

_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/action.js)_
_See code: [src/commands/app/add/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/action.js)_

## `aio app:add:ci`

Expand All @@ -130,7 +130,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/ci.js)_
_See code: [src/commands/app/add/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/ci.js)_

## `aio app:add:event`

Expand All @@ -154,7 +154,7 @@ ALIASES
$ aio app:add:events
```

_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/event.js)_
_See code: [src/commands/app/add/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/event.js)_

## `aio app:add:extension`

Expand All @@ -179,7 +179,7 @@ ALIASES
$ aio app:add:extensions
```

_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/extension.js)_
_See code: [src/commands/app/add/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/extension.js)_

## `aio app:add:service`

Expand All @@ -200,7 +200,7 @@ ALIASES
$ aio app:add:services
```

_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/service.js)_
_See code: [src/commands/app/add/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/service.js)_

## `aio app:add:web-assets`

Expand All @@ -221,7 +221,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/add/web-assets.js)_
_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/add/web-assets.js)_

## `aio app:build`

Expand Down Expand Up @@ -260,11 +260,13 @@ OPTIONS

--[no-]web-assets [default: true] Build web-assets if any

--web-optimize [default: false] Enable optimization (minification) of js/css/html

DESCRIPTION
This will always force a rebuild unless --no-force-build is set.
```

_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/build.js)_
_See code: [src/commands/app/build.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/build.js)_

## `aio app:create [PATH]`

Expand All @@ -286,7 +288,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/create.js)_
_See code: [src/commands/app/create.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/create.js)_

## `aio app:delete`

Expand All @@ -303,7 +305,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/index.js)_
_See code: [src/commands/app/delete/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/index.js)_

## `aio app:delete:action [ACTION-NAME]`

Expand All @@ -328,7 +330,7 @@ ALIASES
$ aio app:delete:actions
```

_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/action.js)_
_See code: [src/commands/app/delete/action.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/action.js)_

## `aio app:delete:ci`

Expand All @@ -347,7 +349,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/ci.js)_
_See code: [src/commands/app/delete/ci.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/ci.js)_

## `aio app:delete:event [EVENT-ACTION-NAME]`

Expand All @@ -372,7 +374,7 @@ ALIASES
$ aio app:delete:events
```

_See code: [src/commands/app/delete/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/event.js)_
_See code: [src/commands/app/delete/event.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/event.js)_

## `aio app:delete:extension`

Expand All @@ -397,7 +399,7 @@ ALIASES
$ aio app:delete:extensions
```

_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/extension.js)_
_See code: [src/commands/app/delete/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/extension.js)_

## `aio app:delete:service`

Expand All @@ -418,7 +420,7 @@ ALIASES
$ aio app:delete:services
```

_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/service.js)_
_See code: [src/commands/app/delete/service.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/service.js)_

## `aio app:delete:web-assets`

Expand All @@ -437,7 +439,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/delete/web-assets.js)_
_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/delete/web-assets.js)_

## `aio app:deploy`

Expand Down Expand Up @@ -489,11 +491,13 @@ OPTIONS

--[no-]web-assets [default: true] Deploy web-assets if any

--web-optimize [default: false] Enable optimization (minification) of web js/css/html

DESCRIPTION
This will always force a rebuild unless --no-force-build is set.
```

_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/deploy.js)_
_See code: [src/commands/app/deploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/deploy.js)_

## `aio app:get-url [ACTION]`

Expand All @@ -514,7 +518,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/get-url.js)_
_See code: [src/commands/app/get-url.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/get-url.js)_

## `aio app:info`

Expand All @@ -536,7 +540,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/info.js)_
_See code: [src/commands/app/info.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/info.js)_

## `aio app:init [PATH]`

Expand Down Expand Up @@ -570,7 +574,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/init.js)_
_See code: [src/commands/app/init.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/init.js)_

## `aio app:list`

Expand All @@ -587,7 +591,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/list/index.js)_
_See code: [src/commands/app/list/index.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/list/index.js)_

## `aio app:list:extension`

Expand All @@ -611,7 +615,7 @@ ALIASES
$ aio app:list:extensions
```

_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/list/extension.js)_
_See code: [src/commands/app/list/extension.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/list/extension.js)_

## `aio app:list:extension-points`

Expand All @@ -635,7 +639,7 @@ ALIASES
$ aio app:list:extension-points
```

_See code: [src/commands/app/list/extension-points.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/list/extension-points.js)_
_See code: [src/commands/app/list/extension-points.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/list/extension-points.js)_

## `aio app:logs`

Expand All @@ -659,7 +663,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/logs.js)_
_See code: [src/commands/app/logs.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/logs.js)_

## `aio app:run`

Expand All @@ -682,7 +686,7 @@ OPTIONS
--version Show version
```

_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/run.js)_
_See code: [src/commands/app/run.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/run.js)_

## `aio app:test`

Expand Down Expand Up @@ -716,7 +720,7 @@ DESCRIPTION
If the extension has a hook called 'test' in its 'ext.config.yaml', the script specified will be run instead.
```

_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/test.js)_
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/test.js)_

## `aio app:undeploy`

Expand All @@ -742,7 +746,7 @@ OPTIONS
--[no-]web-assets [default: true] Undeploy web-assets if any
```

_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/undeploy.js)_
_See code: [src/commands/app/undeploy.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/undeploy.js)_

## `aio app:use [CONFIG_FILE_PATH]`

Expand Down Expand Up @@ -802,5 +806,5 @@ DESCRIPTION
page in https://console.adobe.io
```

_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.0/src/commands/app/use.js)_
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/8.1.1-next.2/src/commands/app/use.js)_
<!-- commandsstop -->
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
"dependencies": {
"@adobe/aio-cli-lib-app-config": "^0.2.1",
"@adobe/aio-cli-lib-console": "^3.0.0",
"@adobe/aio-lib-core-config": "^2.0.0",
"@adobe/aio-lib-core-logging": "^1.1.0",
"@adobe/aio-lib-core-networking": "^2.0.0",
"@adobe/aio-lib-env": "^1.1.0",
"@adobe/aio-lib-ims": "^4.1.0",
"@adobe/aio-lib-runtime": "^3.0.1",
"@adobe/aio-lib-ims": "^5.0.0",
"@adobe/aio-lib-runtime": "^3.1.0",
"@adobe/aio-lib-web": "^5.0.0",
"@adobe/generator-aio-app": "^3.0.0",
"@adobe/generator-aio-console": "^2.2.1",
"@oclif/command": "^1.5.11",
"@oclif/config": "^1.12.9",
"@oclif/plugin-help": "^2.2.3",
Expand Down Expand Up @@ -42,6 +43,7 @@
"yeoman-environment": "^3.2.0"
},
"devDependencies": {
"@adobe/aio-lib-test-proxy": "^1.0.0",
"@adobe/eslint-config-aio-lib-config": "^1.3.0",
"@oclif/dev-cli": "^1.21.3",
"@types/jest": "^26.0.10",
Expand Down
2 changes: 1 addition & 1 deletion src/BaseCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const loadConfig = require('@adobe/aio-cli-lib-app-config')
const inquirer = require('inquirer')
const { CONSOLE_API_KEYS, APPLICATION_CONFIG_KEY, EXTENSIONS_CONFIG_KEY } = require('./lib/defaults')
const { getCliInfo } = require('./lib/app-helper')
const LibConsoleCLI = require('@adobe/generator-aio-console/lib/console-cli')
const LibConsoleCLI = require('@adobe/aio-cli-lib-console')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app', { provider: 'debug' })

const {
Expand Down
4 changes: 3 additions & 1 deletion src/lib/app-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const which = require('which')
const aioLogger = require('@adobe/aio-lib-core-logging')('@adobe/aio-cli-plugin-app:lib-app-helper', { provider: 'debug' })
const { getToken, context } = require('@adobe/aio-lib-ims')
const { CLI } = require('@adobe/aio-lib-ims/src/context')
const fetch = require('node-fetch')
const { createFetch } = require('@adobe/aio-lib-core-networking')
const chalk = require('chalk')
const aioConfig = require('@adobe/aio-lib-core-config')
const { AIO_CONFIG_WORKSPACE_SERVICES, AIO_CONFIG_ORG_SERVICES } = require('./defaults')
Expand Down Expand Up @@ -255,6 +255,7 @@ async function downloadOWJar (url, outFile) {
aioLogger.debug(`downloadOWJar - url: ${url} outFile: ${outFile}`)
let response
try {
const fetch = createFetch()
response = await fetch(url)
} catch (e) {
aioLogger.debug(`connection error while downloading '${url}'`, e)
Expand Down Expand Up @@ -284,6 +285,7 @@ async function waitForOpenWhiskReadiness (host, endTime, period, timeout, waitFu
let ok

try {
const fetch = createFetch()
const response = await fetch(host + '/api/v1')
ok = response.ok
} catch (e) {
Expand Down
4 changes: 2 additions & 2 deletions test/BaseCommand.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jest.mock('@adobe/aio-lib-env')
jest.mock('@adobe/aio-lib-ims')
const { getToken } = require('@adobe/aio-lib-ims')

jest.mock('@adobe/generator-aio-console/lib/console-cli.js')
const LibConsoleCLI = require('@adobe/generator-aio-console/lib/console-cli.js')
jest.mock('@adobe/aio-cli-lib-console')
const LibConsoleCLI = require('@adobe/aio-cli-lib-console')
LibConsoleCLI.init.mockResolvedValue({})

const TheCommand = require('../src/BaseCommand')
Expand Down
6 changes: 3 additions & 3 deletions test/commands/app/add/service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
const consoleDataMocks = require('@adobe/generator-aio-console/test/data-mocks')
const consoleDataMocks = require('@adobe/aio-cli-lib-console/test/data-mocks')

jest.mock('@adobe/generator-aio-console/lib/console-cli.js')
const LibConsoleCLI = require('@adobe/generator-aio-console/lib/console-cli.js')
jest.mock('@adobe/aio-cli-lib-console')
const LibConsoleCLI = require('@adobe/aio-cli-lib-console')
const mockConsoleCLIInstance = {
getWorkspaces: jest.fn(),
promptForSelectWorkspace: jest.fn(),
Expand Down
6 changes: 3 additions & 3 deletions test/commands/app/delete/service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/
const consoleDataMocks = require('@adobe/generator-aio-console/test/data-mocks')
const consoleDataMocks = require('@adobe/aio-cli-lib-console/test/data-mocks')

jest.mock('@adobe/generator-aio-console/lib/console-cli.js')
const LibConsoleCLI = require('@adobe/generator-aio-console/lib/console-cli.js')
jest.mock('@adobe/aio-cli-lib-console')
const LibConsoleCLI = require('@adobe/aio-cli-lib-console')
const mockConsoleCLIInstance = {
getEnabledServicesForOrg: jest.fn(),
promptForRemoveServiceSubscriptions: jest.fn(),
Expand Down
4 changes: 2 additions & 2 deletions test/commands/app/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ yeoman.createEnv.mockReturnValue({
jest.mock('@adobe/aio-lib-ims')

// mock console calls
jest.mock('@adobe/generator-aio-console/lib/console-cli.js')
const LibConsoleCLI = require('@adobe/generator-aio-console/lib/console-cli.js')
jest.mock('@adobe/aio-cli-lib-console')
const LibConsoleCLI = require('@adobe/aio-cli-lib-console')
const mockConsoleCLIInstance = {
getEnabledServicesForOrg: jest.fn(),
promptForSelectOrganization: jest.fn(),
Expand Down
4 changes: 2 additions & 2 deletions test/commands/app/list/extension-points.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const BaseCommand = require('../../../../src/BaseCommand')
const yaml = require('js-yaml')
const dataMocks = require('../../../data-mocks/config-loader')

jest.mock('@adobe/generator-aio-console/lib/console-cli.js')
const LibConsoleCLI = require('@adobe/generator-aio-console/lib/console-cli.js')
jest.mock('@adobe/aio-cli-lib-console')
const LibConsoleCLI = require('@adobe/aio-cli-lib-console')
const mockConsoleCLIInstance = {}
LibConsoleCLI.init.mockResolvedValue(mockConsoleCLIInstance)

Expand Down
Loading