Skip to content
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
14 changes: 4 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ const ajvAddFormats = require('ajv-formats')
// eslint-disable-next-line node/no-unpublished-require
const schema = require('../schema/app.config.yaml.schema.json')

// give or take daylight savings, and leap seconds ...
const AboutAWeekInSeconds = '604800'
const defaults = {
defaultAppHostname: 'adobeio-static.net',
defaultTvmUrl: 'https://firefly-tvm.adobe.io',
defaultOwApihost: 'https://adobeioruntime.net',
defaultHTMLCacheDuration: '60',
defaultJSCacheDuration: AboutAWeekInSeconds,
defaultCSSCacheDuration: AboutAWeekInSeconds,
defaultImageCacheDuration: AboutAWeekInSeconds,
stageAppHostname: 'dev.runtime.adobe.io',
USER_CONFIG_FILE: 'app.config.yaml',
LEGACY_RUNTIME_MANIFEST: 'manifest.yml',
Expand Down Expand Up @@ -688,10 +682,10 @@ async function buildSingleConfig (configName, singleUserConfig, commonConfig, in

config.app.defaultHostname = getCliEnv() === STAGE_ENV ? defaults.stageAppHostname : defaults.defaultAppHostname
config.app.hostname = singleUserConfig.hostname || config.app.defaultHostname
config.app.htmlCacheDuration = singleUserConfig.htmlcacheduration || defaults.defaultHTMLCacheDuration
config.app.jsCacheDuration = singleUserConfig.jscacheduration || defaults.defaultJSCacheDuration
config.app.cssCacheDuration = singleUserConfig.csscacheduration || defaults.defaultCSSCacheDuration
config.app.imageCacheDuration = singleUserConfig.imagecacheduration || defaults.defaultImageCacheDuration
config.app.htmlCacheDuration = singleUserConfig.htmlcacheduration
config.app.jsCacheDuration = singleUserConfig.jscacheduration
config.app.cssCacheDuration = singleUserConfig.csscacheduration
config.app.imageCacheDuration = singleUserConfig.imagecacheduration
config.hooks = singleUserConfig.hooks || {}

config.imsOrgId = commonConfig.imsOrgId
Expand Down
32 changes: 16 additions & 16 deletions test/data-mocks/config-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ const excSingleConfig = {
dist: winCompat(`${root}dist/dx-excshell-1`),
defaultHostname: 'adobeio-static.net',
hostname: 'adobeio-static.net',
htmlCacheDuration: '60',
jsCacheDuration: '604800',
cssCacheDuration: '604800',
imageCacheDuration: '604800'
htmlCacheDuration: undefined,
jsCacheDuration: undefined,
cssCacheDuration: undefined,
imageCacheDuration: undefined
},
ow,
s3: {
Expand Down Expand Up @@ -197,10 +197,10 @@ const nuiSingleConfig = {
dist: winCompat(`${root}dist/dx-asset-compute-worker-1`),
defaultHostname: 'adobeio-static.net',
hostname: 'adobeio-static.net',
htmlCacheDuration: '60',
jsCacheDuration: '604800',
cssCacheDuration: '604800',
imageCacheDuration: '604800'
htmlCacheDuration: undefined,
jsCacheDuration: undefined,
cssCacheDuration: undefined,
imageCacheDuration: undefined
},
ow,
s3: {},
Expand Down Expand Up @@ -246,10 +246,10 @@ const applicationSingleConfig = {
dist: winCompat(`${root}dist/application`),
defaultHostname: 'adobeio-static.net',
hostname: 'adobeio-static.net',
htmlCacheDuration: '60',
jsCacheDuration: '604800',
cssCacheDuration: '604800',
imageCacheDuration: '604800'
htmlCacheDuration: undefined,
jsCacheDuration: undefined,
cssCacheDuration: undefined,
imageCacheDuration: undefined
},
ow,
s3: {
Expand Down Expand Up @@ -304,10 +304,10 @@ const applicationNoActionsSingleConfig = {
dist: winCompat(`${root}dist/application`),
defaultHostname: 'adobeio-static.net',
hostname: 'adobeio-static.net',
htmlCacheDuration: '60',
jsCacheDuration: '604800',
cssCacheDuration: '604800',
imageCacheDuration: '604800'
htmlCacheDuration: undefined,
jsCacheDuration: undefined,
cssCacheDuration: undefined,
imageCacheDuration: undefined
},
ow,
s3: {
Expand Down
Loading