diff --git a/content/github/developing-online-with-codespaces/configuring-codespaces-for-your-project.md b/content/github/developing-online-with-codespaces/configuring-codespaces-for-your-project.md index 11cea58326ba..9b692c800fb6 100644 --- a/content/github/developing-online-with-codespaces/configuring-codespaces-for-your-project.md +++ b/content/github/developing-online-with-codespaces/configuring-codespaces-for-your-project.md @@ -21,7 +21,9 @@ If you don't define a configuration in your repository, {% data variables.produc You can create a default codespace configuration using a pre-built container configuration for your project type, or you can create a custom configuration specific to your project's needs. -{% data variables.product.prodname_codespaces %} uses settings contained in a file named `devcontainer.json` in the root of the repository or in a `.devcontainer` folder. You can use `devcontainer.json` to set default settings for the entire codespace environment, including the {% data variables.product.prodname_vscode %} editor, but you can also set editor-specific settings in a file named `.vscode/settings.json`. +{% data variables.product.prodname_codespaces %} uses settings contained in a configuration file named `devcontainer.json`. {% data reusables.codespaces.devcontainer-location %} + +You can use your `devcontainer.json` to set default settings for the entire codespace environment, including the {% data variables.product.prodname_vscode %} editor, but you can also set editor-specific settings in a file named `.vscode/settings.json`. Changes to a repository's codespace configuration apply only to every new codespace and do not affect any existing codespace. @@ -38,7 +40,9 @@ Each new codespace created from a branch which contains the `.devcontainer` fold ### Creating a custom codespace configuration -If none of the pre-built configurations meet your needs, you can create a custom configuration by adding a `devcontainer.json` file to the root of your repository or a `.devcontainer` folder. In the file, you can use supported configuration keys to specify aspects of the codespace's environment, like which {% data variables.product.prodname_vscode %} extensions will be installed. +If none of the pre-built configurations meet your needs, you can create a custom configuration by adding a `devcontainer.json` file. {% data reusables.codespaces.devcontainer-location %} + +In the file, you can use supported configuration keys to specify aspects of the codespace's environment, like which {% data variables.product.prodname_vscode %} extensions will be installed. {% data reusables.codespaces.vscode-settings-order %} diff --git a/data/reusables/codespaces/devcontainer-location.md b/data/reusables/codespaces/devcontainer-location.md new file mode 100644 index 000000000000..673f3b7e30e0 --- /dev/null +++ b/data/reusables/codespaces/devcontainer-location.md @@ -0,0 +1 @@ +This file can be located in the root of the repository or in a folder called `.devcontainer`. If the file is located in the root of the repository, the filename must begin with a period: `.devcontainer.json`. \ No newline at end of file diff --git a/lib/enterprise-server-releases.js b/lib/enterprise-server-releases.js index 45ad7769cb3c..4de93523713c 100644 --- a/lib/enterprise-server-releases.js +++ b/lib/enterprise-server-releases.js @@ -1,4 +1,4 @@ -const versionSatisifiesRange = require('./version-satisfies-range') +const versionSatisfiesRange = require('./version-satisfies-range') // GHES Release Lifecycle Dates: // https://github.com/github/enterprise-releases/blob/master/docs/supported-versions.md#release-lifecycle-dates @@ -36,7 +36,7 @@ const all = supported.concat(deprecated) const latest = supported[0] const oldestSupported = supported[supported.length - 1] const nextDeprecationDate = dates[oldestSupported].deprecationDate -const deprecatedOnNewSite = deprecated.filter(version => versionSatisifiesRange(version, '>=2.13')) +const deprecatedOnNewSite = deprecated.filter(version => versionSatisfiesRange(version, '>=2.13')) const firstVersionDeprecatedOnNewSite = '2.13' // starting from 2.18, we updated the archival script to create stubbed HTML redirect files const lastVersionWithoutStubbedRedirectFiles = '2.17' diff --git a/lib/get-applicable-versions.js b/lib/get-applicable-versions.js index 727834fcffda..5c733aeb2f68 100644 --- a/lib/get-applicable-versions.js +++ b/lib/get-applicable-versions.js @@ -1,5 +1,5 @@ const allVersions = require('./all-versions') -const versionSatisifiesRange = require('./version-satisfies-range') +const versionSatisfiesRange = require('./version-satisfies-range') // return an array of versions that an article's product versions encompasses function getApplicableVersions (frontmatterVersions, filepath) { @@ -33,7 +33,7 @@ function getApplicableVersions (frontmatterVersions, filepath) { relevantVersions.forEach(relevantVersion => { // special handling for versions with numbered releases if (relevantVersion.hasNumberedReleases) { - if (versionSatisifiesRange(relevantVersion.currentRelease, planValue)) { + if (versionSatisfiesRange(relevantVersion.currentRelease, planValue)) { applicableVersions.push(relevantVersion.version) } } else { diff --git a/lib/redirects/get-old-paths-from-permalink.js b/lib/redirects/get-old-paths-from-permalink.js index 70fcd706acab..8bf521c69105 100644 --- a/lib/redirects/get-old-paths-from-permalink.js +++ b/lib/redirects/get-old-paths-from-permalink.js @@ -1,7 +1,7 @@ const { latest, lastReleaseWithLegacyFormat } = require('../enterprise-server-releases') const { getPathWithoutLanguage, getPathWithLanguage } = require('../path-utils') const patterns = require('../patterns') -const versionSatisifiesRange = require('../version-satisfies-range') +const versionSatisfiesRange = require('../version-satisfies-range') const currentlySupportedVersions = Object.keys(require('../all-versions')) const nonEnterpriseDefaultVersion = require('../non-enterprise-default-version') @@ -32,7 +32,7 @@ module.exports = function getOldPathsFromPath (currentPath, languageCode, curren } // create old path /user from current path /user/github on 2.16+ only - if (currentlySupportedVersions.includes(currentVersion) || versionSatisifiesRange(currentVersion, '>2.15')) { + if (currentlySupportedVersions.includes(currentVersion) || versionSatisfiesRange(currentVersion, '>2.15')) { oldPaths.add(currentPath .replace('/user/github', '/user')) } @@ -55,7 +55,7 @@ module.exports = function getOldPathsFromPath (currentPath, languageCode, curren // ------ END LEGACY VERSION FORMAT REPLACEMENTS ------// // ------ BEGIN MODERN VERSION FORMAT REPLACEMENTS ------// - if (currentlySupportedVersions.includes(currentVersion) || versionSatisifiesRange(currentVersion, `>${lastReleaseWithLegacyFormat}`)) { + if (currentlySupportedVersions.includes(currentVersion) || versionSatisfiesRange(currentVersion, `>${lastReleaseWithLegacyFormat}`)) { oldPaths.forEach(oldPath => { // create old path /github from new path /free-pro-team@latest/github oldPaths.add(oldPath diff --git a/lib/version-satisfies-range.js b/lib/version-satisfies-range.js index 4ecc69663db9..d5e2c9be0a0f 100644 --- a/lib/version-satisfies-range.js +++ b/lib/version-satisfies-range.js @@ -2,7 +2,7 @@ const semver = require('semver') // workaround for Enterprise Server 11.10.340 because we can't use semver to // compare it to 2.x like we can with 2.0+ -module.exports = function versionSatisifiesRange (version, range) { +module.exports = function versionSatisfiesRange (version, range) { if (version === '11.10.340') return range.startsWith('<') return semver.satisfies(semver.coerce(version), range) diff --git a/middleware/archived-enterprise-versions-assets.js b/middleware/archived-enterprise-versions-assets.js index bdd4e5ac24c2..9236dba0709d 100644 --- a/middleware/archived-enterprise-versions-assets.js +++ b/middleware/archived-enterprise-versions-assets.js @@ -1,5 +1,5 @@ const path = require('path') -const versionSatisifiesRange = require('../lib/version-satisfies-range') +const versionSatisfiesRange = require('../lib/version-satisfies-range') const enterpriseServerReleases = require('../lib/enterprise-server-releases') const patterns = require('../lib/patterns') const firstVersionDeprecatedOnNewSite = '2.13' @@ -32,10 +32,10 @@ module.exports = async (req, res, next) => { // paths are slightly different depending on the enterprise version let proxyPath - if (versionSatisifiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`)) { + if (versionSatisfiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`)) { // routing for >=2.13 proxyPath = path.join('/', requestedVersion, assetPath) - } else if (versionSatisifiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) { + } else if (versionSatisfiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) { // routing for <2.13 proxyPath = path.join('/', requestedVersion, 'assets', assetPath) } diff --git a/middleware/archived-enterprise-versions.js b/middleware/archived-enterprise-versions.js index aa3b07e5ab54..9c0d7f68f650 100644 --- a/middleware/archived-enterprise-versions.js +++ b/middleware/archived-enterprise-versions.js @@ -1,7 +1,7 @@ const path = require('path') const { latest, deprecated, firstVersionDeprecatedOnNewSite, lastVersionWithoutStubbedRedirectFiles } = require('../lib/enterprise-server-releases') const patterns = require('../lib/patterns') -const versionSatisifiesRange = require('../lib/version-satisfies-range') +const versionSatisfiesRange = require('../lib/version-satisfies-range') const got = require('got') const findPage = require('../lib/find-page') @@ -26,14 +26,14 @@ module.exports = async (req, res, next) => { // redirect language-prefixed URLs like /en/enterprise/2.10 -> /enterprise/2.10 // (this only applies to versions <2.13) - if (req.path.startsWith('/en/') && versionSatisifiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) { + if (req.path.startsWith('/en/') && versionSatisfiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) { return res.redirect(301, req.baseUrl + req.path.replace(/^\/en/, '')) } // find redirects for versions between 2.13 and 2.17 // starting with 2.18, we updated the archival script to create stubbed HTML redirect files - if (versionSatisifiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`) && - versionSatisifiesRange(requestedVersion, `<=${lastVersionWithoutStubbedRedirectFiles}`)) { + if (versionSatisfiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`) && + versionSatisfiesRange(requestedVersion, `<=${lastVersionWithoutStubbedRedirectFiles}`)) { const redirect = req.context.redirects[req.path] if (redirect && redirect !== req.path) { return res.redirect(301, redirect) @@ -68,7 +68,7 @@ module.exports = async (req, res, next) => { // for >=2.13: /2.13/en/enterprise/2.13/user/articles/viewing-contributions-on-your-profile // for <2.13: /2.12/user/articles/viewing-contributions-on-your-profile function getProxyPath (reqPath, requestedVersion) { - const proxyPath = versionSatisifiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`) + const proxyPath = versionSatisfiesRange(requestedVersion, `>=${firstVersionDeprecatedOnNewSite}`) ? path.join('/', requestedVersion, reqPath) : reqPath.replace(/^\/enterprise/, '') @@ -78,8 +78,8 @@ function getProxyPath (reqPath, requestedVersion) { // from 2.13 to 2.17, we lost access to frontmatter redirects during the archival process // this workaround finds potentially relevant frontmatter redirects in currently supported pages function getFallbackRedirects (req, requestedVersion) { - if (versionSatisifiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) return - if (versionSatisifiesRange(requestedVersion, `>${lastVersionWithoutStubbedRedirectFiles}`)) return + if (versionSatisfiesRange(requestedVersion, `<${firstVersionDeprecatedOnNewSite}`)) return + if (versionSatisfiesRange(requestedVersion, `>${lastVersionWithoutStubbedRedirectFiles}`)) return const pathWithNewVersion = req.path.replace(requestedVersion, latest)