@netlify/config
Advanced tools
Comparing version 20.8.0-rc.0 to 20.8.0
@@ -6,3 +6,3 @@ import { resolvePath } from './files.js'; | ||
export const getInitialBase = function ({ repositoryRoot, | ||
// @ts-expect-error TODO: enhance later | ||
// @ts-expect-error TODO: enhance the types later on, just moved the file to .ts | ||
defaultConfig: { build: { base: defaultBase } = {} }, inlineConfig: { build: { base: initialBase = defaultBase } = {} }, }) { | ||
@@ -9,0 +9,0 @@ return resolveBase(repositoryRoot, initialBase); |
@@ -30,3 +30,2 @@ import { existsSync } from 'fs'; | ||
config: options.config, | ||
packagePath: options.packagePath, | ||
propNames: FILE_PATH_CONFIG_PROPS, | ||
@@ -43,6 +42,6 @@ baseRel, | ||
}; | ||
const resolvePaths = function ({ config, propNames, baseRel, packagePath, repositoryRoot, }) { | ||
return propNames.reduce((configA, propName) => resolvePathProp(configA, propName, baseRel, repositoryRoot, packagePath), config); | ||
const resolvePaths = function ({ config, propNames, baseRel, repositoryRoot, }) { | ||
return propNames.reduce((configA, propName) => resolvePathProp(configA, propName, baseRel, repositoryRoot), config); | ||
}; | ||
const resolvePathProp = function (config, propName, baseRel, repositoryRoot, packagePath) { | ||
const resolvePathProp = function (config, propName, baseRel, repositoryRoot) { | ||
const path = getProperty(config, propName); | ||
@@ -53,8 +52,5 @@ if (!isTruthy(path)) { | ||
} | ||
return setProperty(config, propName, resolvePath(repositoryRoot, baseRel, path, propName, packagePath)); | ||
return setProperty(config, propName, resolvePath(repositoryRoot, baseRel, path, propName)); | ||
}; | ||
export const resolvePath = (repositoryRoot, baseRel, originalPath, propName, | ||
// @ts-expect-error depends on the survey outcome see comment below | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
packagePath) => { | ||
export const resolvePath = (repositoryRoot, baseRel, originalPath, propName) => { | ||
if (!isTruthy(originalPath)) { | ||
@@ -64,5 +60,2 @@ return; | ||
const path = originalPath.replace(LEADING_SLASH_REGEXP, ''); | ||
// TODO: Based on survey outcome: https://netlify.slack.com/archives/C05556LEX28/p1691423437855069 | ||
// If we like option B then: | ||
// const pathA = resolve(baseRel, packagePath || '', path) | ||
const pathA = resolve(baseRel, path); | ||
@@ -69,0 +62,0 @@ validateInsideRoot(originalPath, pathA, repositoryRoot, propName); |
@@ -36,3 +36,4 @@ import { existsSync } from 'fs'; | ||
} | ||
return searchConfigFile(join(base ? base : repoRoot, packagePath || '')); | ||
const cwd = join(base ? base : repoRoot, packagePath || ''); | ||
return searchConfigFile(cwd); | ||
}; | ||
@@ -39,0 +40,0 @@ /** |
{ | ||
"name": "@netlify/config", | ||
"version": "20.8.0-rc.0", | ||
"version": "20.8.0", | ||
"description": "Netlify config module", | ||
@@ -75,4 +75,4 @@ "type": "module", | ||
"netlify-headers-parser": "^7.1.2", | ||
"netlify-redirect-parser": "^14.2.0", | ||
"node-fetch": "^3.3.1", | ||
"netlify-redirect-parser": "^14.1.3", | ||
"omit.js": "^2.0.2", | ||
@@ -97,3 +97,4 @@ "p-locate": "^6.0.0", | ||
"node": "^14.16.0 || >=16.0.0" | ||
} | ||
}, | ||
"gitHead": "0c6f5c014958f692559ea720c38415a0e63b7522" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
63
0
130373
2867