diff --git a/.eslintrc.json b/.eslintrc.json
index ed65eed..fe00fd4 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,3 +1,6 @@
{
- "extends": ["@adobe/eslint-config-aio-lib-config"]
+ "extends": ["@adobe/eslint-config-aio-lib-config"],
+ "parserOptions": {
+ "ecmaVersion": 2020
+ }
}
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index d35ffa3..c63f592 100644
--- a/src/index.js
+++ b/src/index.js
@@ -158,7 +158,7 @@ function loadCommonConfig () {
ow: owConfig,
aio: aioConfig,
// soon not needed anymore (for old headless validator)
- imsOrgId: aioConfig && aioConfig.project && aioConfig.project.org && aioConfig.project.org.ims_org_id
+ imsOrgId: aioConfig.project?.org?.ims_org_id
}
}
@@ -289,7 +289,9 @@ function loadUserConfigLegacy (commonConfig) {
// todo: new value usingLegacyConfig
// this module should not console.log/warn ... or include chalk ...
if (commonConfig.aio.cna !== undefined || commonConfig.aio.app !== undefined) {
- aioLogger.warn('App config in \'.aio\' file is deprecated. Please move your \'.aio.app\' or \'.aio.cna\' to \'app.config.yaml\'.')
+ // this might have never have been seen in the wild as we don't know
+ // what log-level users have set
+ aioLogger.error('App config in \'.aio\' file is deprecated. Please move your \'.aio.app\' or \'.aio.cna\' to \'app.config.yaml\'.')
const appConfig = { ...commonConfig.aio.app, ...commonConfig.aio.cna }
Object.entries(appConfig).forEach(([k, v]) => {
legacyAppConfig[k] = v
@@ -344,7 +346,7 @@ function loadUserConfigLegacy (commonConfig) {
})
// todo: new val usingLegacyHooks:Boolean
if (Object.keys(hooks).length > 0) {
- aioLogger.warn('hooks in \'package.json\' are deprecated. Please move your hooks to \'app.config.yaml\' under the \'hooks\' key')
+ aioLogger.error('hooks in \'package.json\' are deprecated. Please move your hooks to \'app.config.yaml\' under the \'hooks\' key')
legacyAppConfig.hooks = hooks
// build index
includeIndex[`${defaults.APPLICATION_CONFIG_KEY}.hooks`] = { file: 'package.json', key: 'scripts' }
@@ -421,7 +423,10 @@ function buildExtConfigs (userConfig, commonConfig, includeIndex) {
/** @private */
function buildAppConfig (userConfig, commonConfig, includeIndex) {
- const fullAppConfig = buildSingleConfig(defaults.APPLICATION_CONFIG_KEY, userConfig[defaults.APPLICATION_CONFIG_KEY], commonConfig, includeIndex)
+ const fullAppConfig = buildSingleConfig(defaults.APPLICATION_CONFIG_KEY,
+ userConfig[defaults.APPLICATION_CONFIG_KEY],
+ commonConfig,
+ includeIndex)
if (!fullAppConfig.app.hasBackend && !fullAppConfig.app.hasFrontend) {
// only set application config if there is an actuall app, meaning either some backend or frontend
@@ -488,6 +493,13 @@ function buildSingleConfig (configName, singleUserConfig, commonConfig, includeI
config.app.hasFrontend = fs.existsSync(web)
config.app.dist = path.resolve(dist, dist === defaultDistPath ? subFolderName : '')
+ if (singleUserConfig.events) {
+ config.events = { ...singleUserConfig.events }
+ }
+ if (commonConfig?.aio?.project) {
+ config.project = commonConfig.aio.project
+ }
+
// actions
config.actions.src = path.resolve(actions) // needed for app add first action
if (config.app.hasBackend) {
diff --git a/test/__fixtures__/exc-with-events/app.config.yaml b/test/__fixtures__/exc-with-events/app.config.yaml
new file mode 100644
index 0000000..fa4da76
--- /dev/null
+++ b/test/__fixtures__/exc-with-events/app.config.yaml
@@ -0,0 +1,3 @@
+extensions:
+ 'dx/excshell/1':
+ $include: src/dx-excshell-1/ext.config.yaml
diff --git a/test/__fixtures__/exc-with-events/package.json b/test/__fixtures__/exc-with-events/package.json
new file mode 100644
index 0000000..57698ed
--- /dev/null
+++ b/test/__fixtures__/exc-with-events/package.json
@@ -0,0 +1,4 @@
+{
+ "version": "1.0.0",
+ "name": "exc"
+}
diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js
new file mode 100644
index 0000000..c491ed6
--- /dev/null
+++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/action.js
@@ -0,0 +1,17 @@
+/*
+Copyright 2019 Adobe. All rights reserved.
+This file is licensed to you under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License. You may obtain a copy
+of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software distributed under
+the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
+OF ANY KIND, either express or implied. See the License for the specific language
+governing permissions and limitations under the License.
+*/
+
+/** @private */
+function main (args) {
+ return 'hello'
+}
+exports.main = main
diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt
new file mode 100644
index 0000000..d9851e6
--- /dev/null
+++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/actions/somefile.txt
@@ -0,0 +1 @@
+include me !
\ No newline at end of file
diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml b/test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml
new file mode 100644
index 0000000..537a721
--- /dev/null
+++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/ext.config.yaml
@@ -0,0 +1,26 @@
+operations:
+ view:
+ - type: web
+ impl: index.html
+actions: ./actions
+web: ./web-src
+events:
+ registrations:
+runtimeManifest:
+ packages:
+ my-exc-package:
+ license: 'Apache-2.0'
+ actions:
+ action:
+ function: 'actions/action.js'
+ web: 'yes'
+ runtime: 'nodejs:14'
+ inputs:
+ LOG_LEVEL: 'debug'
+ annotations:
+ 'require-adobe-auth': true
+ final: true
+ include:
+ - [ 'actions/somefile.txt', 'file.txt' ]
+ limits:
+ concurrency: 189
diff --git a/test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html b/test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html
new file mode 100644
index 0000000..9bd20dd
--- /dev/null
+++ b/test/__fixtures__/exc-with-events/src/dx-excshell-1/web-src/index.html
@@ -0,0 +1,18 @@
+
+
+
+