Skip to content

Commit

Permalink
Merge branch 'master' of github.com:adobe/aio-cli-plugin-app into aud…
Browse files Browse the repository at this point in the history
…it-log-support
  • Loading branch information
Amulya Kashyap committed Oct 3, 2024
2 parents 69fb6ce + 26e8172 commit 19d61a1
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 75 deletions.
74 changes: 40 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ DESCRIPTION
Create, run, test, and deploy Adobe I/O Apps
```

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

## `aio app add`

Expand All @@ -90,7 +90,7 @@ DESCRIPTION
Add a new component to an existing Adobe I/O App
```

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

## `aio app add action`

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

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

## `aio app add ci`

Expand All @@ -133,7 +133,7 @@ DESCRIPTION
Add CI files
```

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

## `aio app add event`

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

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

## `aio app add extension`

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

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

## `aio app add service`

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

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

## `aio app add web-assets`

Expand All @@ -229,7 +229,7 @@ DESCRIPTION
Add web assets support
```

_See code: [src/commands/app/add/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/12.2.4/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/13.0.0/src/commands/app/add/web-assets.js)_

## `aio app build`

Expand All @@ -247,18 +247,19 @@ FLAGS
-v, --verbose Verbose output
--[no-]actions [default: true] Build actions if any
--[no-]content-hash [default: true] Enable content hashing in browser code
--[no-]force-build [default: true] Force a build even if one already exists
--[no-]force-build [default: false] Force a build even if one already exists
--version Show version
--[no-]web-assets [default: true] Build web-assets if any
--web-optimize [default: false] Enable optimization (minification) of js/css/html
DESCRIPTION
Build an Adobe I/O App
This will always force a rebuild unless --no-force-build is set.
Build the actions and web assets for an Adobe I/O App. Build is optimized to only build what is necessary.
Use the --force-build flag to force a build even if one already exists.
```

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

## `aio app create [PATH]`

Expand All @@ -280,7 +281,7 @@ DESCRIPTION
Create a new Adobe I/O App with default parameters
```

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

## `aio app delete`

Expand All @@ -298,7 +299,7 @@ DESCRIPTION
Delete a component from an existing Adobe I/O App
```

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

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

Expand All @@ -324,7 +325,7 @@ ALIASES
$ aio app delete actions
```

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

## `aio app delete ci`

Expand All @@ -343,7 +344,7 @@ DESCRIPTION
Delete existing CI files
```

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

## `aio app delete extension`

Expand All @@ -369,7 +370,7 @@ ALIASES
$ aio app delete extensions
```

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

## `aio app delete service`

Expand All @@ -393,7 +394,7 @@ ALIASES
$ aio app delete services
```

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

## `aio app delete web-assets`

Expand All @@ -412,11 +413,11 @@ DESCRIPTION
Delete existing web assets
```

_See code: [src/commands/app/delete/web-assets.js](https://github.com/adobe/aio-cli-plugin-app/blob/12.2.4/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/13.0.0/src/commands/app/delete/web-assets.js)_

## `aio app deploy`

Build and deploy an Adobe I/O App
Deploy an Adobe I/O App

```
USAGE
Expand Down Expand Up @@ -448,12 +449,17 @@ FLAGS
--web-optimize [default: false] Enable optimization (minification) of web js/css/html
DESCRIPTION
Build and deploy an Adobe I/O App
Deploy an Adobe I/O App
This will always force a rebuild unless --no-force-build is set.
Deploys the actions and web assets for an Adobe I/O App.
This will also build any changed actions or web assets before deploying.
Use the --force-build flag to force a build even if one already exists.
Deploy is optimized to only deploy what is necessary. Be aware that deploying actions will overwrite any previous
deployments.
Use the --force-deploy flag to force deploy changes, regardless of production Workspace being published in Exchange.
```

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

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

Expand All @@ -476,7 +482,7 @@ DESCRIPTION
Get action URLs
```

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

## `aio app info`

Expand All @@ -498,7 +504,7 @@ DESCRIPTION
Display settings/configuration in use by an Adobe I/O App
```

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

## `aio app init [PATH]`

Expand Down Expand Up @@ -537,7 +543,7 @@ DESCRIPTION
Create a new Adobe I/O App
```

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

## `aio app install PATH`

Expand All @@ -560,7 +566,7 @@ DESCRIPTION
This command will support installing apps packaged by 'aio app pack'.
```

_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/12.2.4/src/commands/app/install.js)_
_See code: [src/commands/app/install.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.0.0/src/commands/app/install.js)_

## `aio app list`

Expand All @@ -578,7 +584,7 @@ DESCRIPTION
List components for Adobe I/O App
```

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

## `aio app list extension`

Expand All @@ -603,7 +609,7 @@ ALIASES
$ aio app list extensions
```

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

## `aio app logs`

Expand All @@ -627,7 +633,7 @@ DESCRIPTION
Fetch logs for an Adobe I/O App
```

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

## `aio app pack [PATH]`

Expand All @@ -649,7 +655,7 @@ DESCRIPTION
This command will support packaging apps for redistribution.
```

_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/12.2.4/src/commands/app/pack.js)_
_See code: [src/commands/app/pack.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.0.0/src/commands/app/pack.js)_

## `aio app run`

Expand All @@ -673,7 +679,7 @@ DESCRIPTION
Run an Adobe I/O App
```

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

## `aio app test`

Expand Down Expand Up @@ -701,7 +707,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/12.2.4/src/commands/app/test.js)_
_See code: [src/commands/app/test.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.0.0/src/commands/app/test.js)_

## `aio app undeploy`

Expand All @@ -726,7 +732,7 @@ DESCRIPTION
Undeploys an Adobe I/O App
```

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

## `aio app use [CONFIG_FILE_PATH]`

Expand Down Expand Up @@ -773,5 +779,5 @@ DESCRIPTION
page in https://developer.adobe.com/console/
```

_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/12.2.4/src/commands/app/use.js)_
_See code: [src/commands/app/use.js](https://github.com/adobe/aio-cli-plugin-app/blob/13.0.0/src/commands/app/use.js)_
<!-- commandsstop -->
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@adobe/aio-cli-plugin-app",
"description": "Create, Build and Deploy Adobe I/O Applications",
"version": "12.2.4",
"version": "13.0.0",
"author": "Adobe Inc.",
"bugs": "https://github.com/adobe/aio-cli-plugin-app/issues",
"dependencies": {
Expand All @@ -12,7 +12,7 @@
"@adobe/aio-lib-core-networking": "^5",
"@adobe/aio-lib-env": "^3",
"@adobe/aio-lib-ims": "^7",
"@adobe/aio-lib-runtime": "^6",
"@adobe/aio-lib-runtime": "^7.0.0",
"@adobe/aio-lib-templates": "^3",
"@adobe/aio-lib-web": "^7",
"@adobe/generator-aio-app": "^7",
Expand Down
20 changes: 12 additions & 8 deletions src/commands/app/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,24 @@ class Build extends BaseCommand {
}

if (flags.actions) {
if (config.app.hasBackend && (flags['force-build'] || !fs.existsSync(config.actions.dist))) {
// removed flags['force-build'] || as it is always forced at this point, we need to check to decide what to build
// if no backend, we skip the build
if (config.app.hasBackend) {
try {
let builtList = []
const script = await runInProcess(config.hooks['build-actions'], config)
aioLogger.debug(`run hook for 'build-actions' for actions in '${name}' returned ${script}`)
spinner.start(`Building actions for '${name}'`)
if (!script) {
builtList = await RuntimeLib.buildActions(config, filterActions, true)
builtList = await RuntimeLib.buildActions(config, filterActions, flags['force-build']) // skipCheck is false
}
if (builtList.length > 0) {
spinner.succeed(chalk.green(`Built ${builtList.length} action(s) for '${name}'`))
} else {
if (script) {
spinner.fail(chalk.green(`build-action skipped by hook '${name}'`))
} else {
spinner.fail(chalk.green(`No actions built for '${name}'`))
spinner.info(chalk.green(`No actions built for '${name}'`))
}
}
aioLogger.debug(`RuntimeLib.buildActions returned ${builtList}`)
Expand All @@ -94,7 +96,7 @@ class Build extends BaseCommand {
throw err
}
} else {
spinner.info(`no backend or a build already exists, skipping action build for '${name}'`)
spinner.info(`no backend, skipping action build for '${name}'`)
}
}
if (flags['web-assets']) {
Expand Down Expand Up @@ -127,7 +129,8 @@ class Build extends BaseCommand {
throw err
}
} else {
spinner.info(`no frontend or a build already exists, skipping frontend build for '${name}'`)
// TODO: specify which ... keep this useful
spinner.info(chalk.green(`No frontend or a build already exists, skipping frontend build for '${name}'`))
}
}
try {
Expand All @@ -140,7 +143,8 @@ class Build extends BaseCommand {

Build.description = `Build an Adobe I/O App
This will always force a rebuild unless --no-force-build is set.
Build the actions and web assets for an Adobe I/O App. Build is optimized to only build what is necessary.
Use the --force-build flag to force a build even if one already exists.
`

Build.flags = {
Expand All @@ -163,8 +167,8 @@ Build.flags = {
allowNo: true
}),
'force-build': Flags.boolean({
description: '[default: true] Force a build even if one already exists',
default: true,
description: '[default: false] Force a build even if one already exists',
default: false,
allowNo: true
}),
'content-hash': Flags.boolean({
Expand Down
Loading

0 comments on commit 19d61a1

Please sign in to comment.