1
0
mirror of synced 2025-12-19 18:10:59 -05:00

Create versions and archives src folders (#42802)

This commit is contained in:
Kevin Heis
2023-09-19 09:40:43 -07:00
committed by GitHub
parent 18c822e86e
commit 3f94bb2dcf
151 changed files with 234 additions and 326 deletions

View File

@@ -5,9 +5,9 @@ import core from '@actions/core'
import { getContents } from '../../script/helpers/git-utils.js'
import parse from '../../lib/read-frontmatter.js'
import getApplicableVersions from '../../lib/get-applicable-versions.js'
import nonEnterpriseDefaultVersion from '../../lib/non-enterprise-default-version.js'
import { allVersionShortnames } from '../../lib/all-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { allVersionShortnames } from '#src/versions/lib/all-versions.js'
import { waitUntilUrlIsHealthy } from './lib/wait-until-url-is-healthy.js'
const { GITHUB_TOKEN, APP_URL } = process.env

View File

@@ -40,13 +40,13 @@ jobs:
- name: Create an enterprise release issue
if: steps.existingIssue.outputs.releaseIssue == 'false'
run: |
.github/actions-scripts/create-enterprise-issue.js release
src/versions/scripts/create-enterprise-issue.js release
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}
- name: Create an enterprise deprecation issue
if: steps.existingIssue.outputs.deprecationIssue == 'false'
run: |
.github/actions-scripts/create-enterprise-issue.js deprecation
src/versions/scripts/create-enterprise-issue.js deprecation
env:
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_WRITEORG_PROJECT }}

View File

@@ -6,7 +6,7 @@ import { Header } from 'components/page-header/Header'
import { LegalFooter } from 'components/page-footer/LegalFooter'
import { ScrollButton } from 'components/ui/ScrollButton'
import { SupportSection } from 'components/page-footer/SupportSection'
import { DeprecationBanner } from 'components/page-header/DeprecationBanner'
import { DeprecationBanner } from 'src/versions/components/DeprecationBanner'
import { RestBanner } from 'src/rest/components/RestBanner'
import { useMainContext } from 'components/context/MainContext'
import { useTranslation } from 'src/languages/components/useTranslation'

View File

@@ -4,7 +4,7 @@ import { Survey } from 'src/events/components/Survey'
import { Contribution } from 'components/page-footer/Contribution'
import { Support } from 'components/page-footer/Support'
import { useMainContext } from 'components/context/MainContext'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
import { useRouter } from 'next/router'
import { useTranslation } from 'src/languages/components/useTranslation'

View File

@@ -11,7 +11,7 @@ import {
XIcon,
} from '@primer/octicons-react'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion'
import { Link } from 'components/Link'
import { useMainContext } from 'components/context/MainContext'
import { useHasAccount } from 'components/hooks/useHasAccount'
@@ -21,7 +21,7 @@ import { ApiVersionPicker } from 'src/rest/components/ApiVersionPicker'
import { useTranslation } from 'src/languages/components/useTranslation'
import { Search } from 'src/search/components/Search'
import { Breadcrumbs } from 'components/page-header/Breadcrumbs'
import { VersionPicker } from 'components/page-header/VersionPicker'
import { VersionPicker } from 'src/versions/components/VersionPicker'
import { SidebarNav } from 'components/sidebar/SidebarNav'
import { AllProductsLink } from 'components/sidebar/AllProductsLink'

View File

@@ -6,7 +6,7 @@ import { useLanguages } from 'src/languages/components/LanguagesContext'
import { useMainContext } from 'components/context/MainContext'
import { useTranslation } from 'src/languages/components/useTranslation'
import { ExcludesNull } from 'components/lib/ExcludesNull'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
import { useUserLanguage } from 'src/languages/components/useUserLanguage'
import styles from './HeaderNotifications.module.scss'

View File

@@ -1,6 +1,6 @@
import { useRouter } from 'next/router'
import { ArrowLeftIcon } from '@primer/octicons-react'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion'
import { Link } from 'components/Link'
export const AllProductsLink = () => {

View File

@@ -54,7 +54,7 @@ See [`lib/frontmatter.js`](../lib/frontmatter.js).
### `versions`
- Purpose: Indicates the [versions](../lib/all-versions.js) to which a page applies.
- Purpose: Indicates the [versions](#src/versions/lib/all-versions.js) to which a page applies.
See [Versioning](#versioning) for more info.
- Type: `Object`. Allowable keys map to product names and can be found in the `versions` object in [`lib/frontmatter.js`](../lib/frontmatter.js).
- This frontmatter value is currently **required** for all pages.

View File

@@ -1,8 +1,8 @@
import fs from 'fs/promises'
import path from 'path'
import frontmatter from './read-frontmatter.js'
import getApplicableVersions from './get-applicable-versions.js'
import removeFPTFromPath from './remove-fpt-from-path.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js'
import { ROOT } from './constants.js'
// Both internal and external products are specified in content/index.md

View File

@@ -1,5 +1,5 @@
import parse from './read-frontmatter.js'
import { allVersions } from './all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { allTools } from '#src/tools/lib/all-tools.js'
import { getDeepDataByLanguage } from './get-data.js'

View File

@@ -2,7 +2,7 @@ import path from 'path'
import { productMap, data } from './all-products.js'
import { renderContentWithFallback } from './render-with-fallback.js'
import removeFPTFromPath from './remove-fpt-from-path.js'
import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js'
async function getPage(id, lang, pageMap, context) {
const productId = id.split('/')[0]

View File

@@ -1,9 +1,9 @@
import path from 'path'
import languages from '#src/languages/lib/languages.js'
import { allVersions } from './all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import createTree from './create-tree.js'
import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import readFileContents from './read-file-contents.js'
import Page from './page.js'
import frontmatterSchema from './frontmatter.js'

View File

@@ -2,7 +2,7 @@ import assert from 'assert'
import path from 'path'
import cheerio from 'cheerio'
import patterns from './patterns.js'
import getApplicableVersions from './get-applicable-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import generateRedirectsForPermalinks from '#src/redirects/lib/permalinks.js'
import getEnglishHeadings from './get-english-headings.js'
import getTocItems from './get-toc-items.js'
@@ -19,7 +19,7 @@ import getDocumentType from '#src/events/lib/get-document-type.js'
import { union } from 'lodash-es'
import { allTools } from '#src/tools/lib/all-tools.js'
import { renderContentWithFallback } from './render-with-fallback.js'
import { deprecated, supported } from './enterprise-server-releases.js'
import { deprecated, supported } from '#src/versions/lib/enterprise-server-releases.js'
// We're going to check a lot of pages' "ID" (the first part of
// the relativePath) against `productMap` to make sure it's valid.

View File

@@ -1,10 +1,10 @@
import slash from 'slash'
import path from 'path'
import patterns from './patterns.js'
import { latest } from './enterprise-server-releases.js'
import { latest } from '#src/versions/lib/enterprise-server-releases.js'
import { productIds } from './all-products.js'
import { allVersions } from './all-versions.js'
import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
const supportedVersions = new Set(Object.keys(allVersions))
// Add the language to the given HREF

View File

@@ -1,7 +1,7 @@
import assert from 'assert'
import path from 'path'
import patterns from './patterns.js'
import removeFPTFromPath from './remove-fpt-from-path.js'
import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js'
/*
This class creates the "permalinks" that power a page's different versions,

View File

@@ -1,4 +1,4 @@
import enterpriseServerReleases from '../lib/enterprise-server-releases.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
const productNames = {
dotcom: 'GitHub.com',

View File

@@ -1,5 +1,5 @@
import { productMap } from '../lib/all-products.js'
import { deprecated } from '../lib/enterprise-server-releases.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
const pathRegExps = [
// Disallow indexing of WIP products

View File

@@ -1,6 +1,6 @@
import languages from '#src/languages/lib/languages.js'
import enterpriseServerReleases from '../lib/enterprise-server-releases.js'
import { allVersions } from '../lib/all-versions.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { productMap } from '../lib/all-products.js'
import {
getVersionStringFromPath,
@@ -12,7 +12,7 @@ import {
import productNames from '../lib/product-names.js'
import warmServer from '../lib/warm-server.js'
import searchVersions from '../src/search/lib/versions.js'
import nonEnterpriseDefaultVersion from '../lib/non-enterprise-default-version.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { getDataByLanguage, getUIDataMerged } from '../lib/get-data.js'
// This doesn't change just because the request changes, so compute it once.

View File

@@ -1,7 +1,7 @@
import path from 'path'
import { liquid } from '#src/content-render/index.js'
import findPageInSiteTree from '../../lib/find-page-in-site-tree.js'
import removeFPTFromPath from '../../lib/remove-fpt-from-path.js'
import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js'
import { executeWithFallback } from '../../lib/render-with-fallback.js'
// This module adds currentProductTree to the context object for use in layouts.

View File

@@ -1,7 +1,7 @@
import { getProductGroups } from '../../lib/get-product-groups.js'
import warmServer from '../../lib/warm-server.js'
import { languageKeys } from '#src/languages/lib/languages.js'
import { allVersionKeys } from '../../lib/all-versions.js'
import { allVersionKeys } from '#src/versions/lib/all-versions.js'
const isHomepage = (path) => {
const split = path.split('/')

View File

@@ -1,5 +1,5 @@
import { getChangelogItems } from '../../lib/changelog.js'
import getApplicableVersions from '../../lib/get-applicable-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
export default async function whatsNewChangelog(req, res, next) {
if (!req.context.page) return next()

View File

@@ -1,7 +1,7 @@
import helmet from 'helmet'
import { cloneDeep } from 'lodash-es'
import isArchivedVersion from '../lib/is-archived-version.js'
import versionSatisfiesRange from '../lib/version-satisfies-range.js'
import isArchivedVersion from '#src/archives/lib/is-archived-version.js'
import versionSatisfiesRange from '#src/versions/lib/version-satisfies-range.js'
const isDev = process.env.NODE_ENV === 'development'
const AZURE_STORAGE_URL = 'githubdocs.azureedge.net'

View File

@@ -20,19 +20,19 @@ import handleNextDataPath from './handle-next-data-path.js'
import detectLanguage from '#src/languages/middleware/detect-language.js'
import reloadTree from './reload-tree.js'
import context from './context.js'
import shortVersions from './contextualizers/short-versions.js'
import shortVersions from '#src/versions/middleware/short-versions.js'
import languageCodeRedirects from '#src/redirects/middleware/language-code-redirects.js'
import handleRedirects from '#src/redirects/middleware/handle-redirects.js'
import findPage from './find-page.js'
import blockRobots from './block-robots.js'
import archivedEnterpriseVersionsAssets from './archived-enterprise-versions-assets.js'
import archivedEnterpriseVersionsAssets from '#src/archives/middleware/archived-enterprise-versions-assets.js'
import api from './api/index.js'
import healthz from './healthz.js'
import productIcons from './product-icons.js'
import manifestJson from './manifest-json.js'
import remoteIP from './remote-ip.js'
import buildInfo from './build-info.js'
import archivedEnterpriseVersions from './archived-enterprise-versions.js'
import archivedEnterpriseVersions from '#src/archives/middleware/archived-enterprise-versions.js'
import robots from './robots.js'
import earlyAccessLinks from '#src/early-access/middleware/early-access-links.js'
import categoriesForSupport from './categories-for-support.js'
@@ -46,7 +46,7 @@ import currentProductTree from './contextualizers/current-product-tree.js'
import genericToc from './contextualizers/generic-toc.js'
import breadcrumbs from './contextualizers/breadcrumbs.js'
import glossaries from './contextualizers/glossaries.js'
import features from './contextualizers/features.js'
import features from '#src/versions/middleware/features.js'
import productExamples from './contextualizers/product-examples.js'
import productGroups from './contextualizers/product-groups.js'
import featuredLinks from '#src/landings/middleware/featured-links.js'
@@ -54,7 +54,7 @@ import learningTrack from '#src/learning-track/middleware/learning-track.js'
import next from './next.js'
import renderPage from './render-page.js'
import assetPreprocessing from '#src/assets/middleware/asset-preprocessing.js'
import archivedAssetRedirects from './archived-asset-redirects.js'
import archivedAssetRedirects from '#src/archives/middleware/archived-asset-redirects.js'
import favicons from './favicons.js'
import setStaticAssetCaching from '#src/assets/middleware/static-asset-caching.js'
import fastHead from './fast-head.js'

View File

@@ -6,7 +6,7 @@ import getMiniTocItems from '../lib/get-mini-toc-items.js'
import Page from '../lib/page.js'
import { pathLanguagePrefixed } from '#src/languages/lib/languages.js'
import statsd from '#src/observability/lib/statsd.js'
import { allVersions } from '../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { isConnectionDropped } from './halt-on-dropped-connection.js'
import { nextApp, nextHandleRequest } from './next.js'
import { defaultCacheControl } from './cache-control.js'

View File

@@ -1,90 +0,0 @@
#!/usr/bin/env node
// [start-readme]
//
// A one-time use script to add GHEC to the REST schema on github/github.
//
// [end-readme]
import { readFileSync, writeFileSync } from 'fs'
import { join } from 'path'
import walk from 'walk-sync'
import yaml from 'js-yaml'
import { program } from 'commander'
let fullDir
let fileCount = 0
const updatedFilesAll = []
const updatedFilesGHECOnly = []
const notUpdated = []
const logFile = process.cwd() + '/log.txt'
program
.description('One time script to add a GHEC property to the REST API schema on github/github.')
.argument('<schema-directory>', 'Path to the schema files to update from github/github.')
.action((schemaDirectory) => {
fullDir = join(process.cwd(), schemaDirectory)
})
program.parse()
// use the operations from github/github
walk
.entries(fullDir, {
ignore: ['.keep'],
directories: false,
})
// only work on yaml files
.filter((entry) => entry.relativePath.endsWith('yaml'))
.forEach((file) => {
fileCount++
const fullPath = join(file.basePath, file.relativePath)
let fileContent = readFileSync(fullPath, 'utf8')
const data = yaml.load(fileContent)
if (data['x-github-releases'] && data['x-github-releases'].includes('api.github.com')) {
// always:
// remove githubCloudOnly from x-github
// add ghec to x-github-releases
fileContent = fileContent.replace(/x-github-releases:\n/g, 'x-github-releases:\n - ghec\n')
fileContent = fileContent.replace(/\n\s{2}githubCloudOnly:.*\n/g, '\n')
updatedFilesAll.push(fullPath)
// if githubCloudOnly in x-github is true
// also remove api.github.com from x-github-releases
if (data['x-github'] && data['x-github'].githubCloudOnly) {
fileContent = fileContent.replace(/\n\s{2}- api.github.com\n/g, '\n')
updatedFilesGHECOnly.push(fullPath)
}
writeFileSync(fullPath, fileContent)
} else {
// doesn't have an api.github.com endpoint
// log it, ignore it
notUpdated.push(fullPath)
}
writeFileSync(
logFile,
`${fileCount} Total operations processed
${notUpdated.length} Operations not updated
${updatedFilesAll.length} Operations updated
${updatedFilesGHECOnly.length} Operations with api.github.com removed
---
Operations not updated:
${notUpdated.join('\r\n')}
All updated operations:
${updatedFilesAll.join('\r\n')}
Updated operations with api.github.com removed (GHEC only):
${updatedFilesGHECOnly.join('\r\n')}`,
)
})
console.log(
`${fileCount} Total operations processed
${notUpdated.length} Operations not updated
${updatedFilesAll.length} Operations updated
${updatedFilesGHECOnly.length} Operations with api.github.com removed (GHEC only)
Log file at ${logFile}`,
)

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env node
// [start-readme]
//
// Run this one-time script to convert `if <feature name>` Liquid tags
// to `ifversion <feature name>`.
//
// [end-readme]
import fs from 'fs'
import walkFiles from '../helpers/walk-files.js'
const allFiles = walkFiles('content', '.md')
.concat(walkFiles('data', ['.yml', '.md']))
// GraphQL content files have some non-FBV if statements that we don't want to change.
// Fortunately they do not include any FBV if statements, so we can just ignore the whole dir.
.filter((file) => !file.includes('/content/graphql/'))
allFiles.forEach((file) => {
const fileContents = fs.readFileSync(file, 'utf8')
const newContents = fileContents.replace(/({%-?\s+?)if\s/g, '$1ifversion ')
fs.writeFileSync(file, newContents)
})

View File

@@ -4,8 +4,8 @@ import fs from 'fs'
import path from 'path'
import { execSync } from 'child_process'
import { program } from 'commander'
import fpt from '../../lib/non-enterprise-default-version.js'
import { allVersionKeys } from '../../lib/all-versions.js'
import fpt from '#src/versions/lib/non-enterprise-default-version.js'
import { allVersionKeys } from '#src/versions/lib/all-versions.js'
import { liquid } from '#src/content-render/index.js'
import contextualize from '../../middleware/context.js'

View File

@@ -18,7 +18,7 @@ import { decode } from 'html-entities'
import frontmatter from '../lib/read-frontmatter.js'
import { renderContent } from '#src/content-render/index.js'
import { allVersions } from '../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { ROOT } from '../lib/constants.js'
const slugger = new GithubSlugger()

View File

@@ -26,7 +26,7 @@ import {
deprecated,
firstReleaseStoredInBlobStorage,
lastVersionWithoutArchivedRedirectsFile,
} from '../lib/enterprise-server-releases.js'
} from '#src/versions/lib/enterprise-server-releases.js'
program
.description(

5
src/archives/README.md Normal file
View File

@@ -0,0 +1,5 @@
# Archives
Product oriented code to handle archived versions of the Docs, such as archived Enterprise Server versions.
The directory `versions/` handles non-archived versions of the docs. `ghes-releases/` handles version releases and deprecations processes.

View File

@@ -1,5 +1,5 @@
import patterns from '../lib/patterns.js'
import { deprecated } from '../lib/enterprise-server-releases.js'
import patterns from '../../../lib/patterns.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
export default function isArchivedVersion(req) {
// if this is an assets path, use the referrer

View File

@@ -1,8 +1,8 @@
import path from 'path'
import { supported, latest } from './enterprise-server-releases.js'
import patterns from './patterns.js'
import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js'
import { allVersions } from './all-versions.js'
import { supported, latest } from '#src/versions/lib/enterprise-server-releases.js'
import patterns from '../../../lib/patterns.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
const latestNewVersion = `enterprise-server@${latest}`
const oldVersions = ['dotcom'].concat(supported)
const newVersions = Object.keys(allVersions)

View File

@@ -2,10 +2,13 @@ import path from 'path'
import got from 'got'
import patterns from '../lib/patterns.js'
import isArchivedVersion from '../lib/is-archived-version.js'
import { setFastlySurrogateKey, SURROGATE_ENUMS } from './set-fastly-surrogate-key.js'
import { archivedCacheControl } from './cache-control.js'
import patterns from '../../../lib/patterns.js'
import isArchivedVersion from '#src/archives/lib/is-archived-version.js'
import {
setFastlySurrogateKey,
SURROGATE_ENUMS,
} from '../../../middleware/set-fastly-surrogate-key.js'
import { archivedCacheControl } from '../../../middleware/cache-control.js'
// This module handles requests for the CSS and JS assets for
// deprecated GitHub Enterprise versions by routing them to static content in

View File

@@ -6,17 +6,20 @@ import {
lastVersionWithoutArchivedRedirectsFile,
deprecatedWithFunctionalRedirects,
firstReleaseStoredInBlobStorage,
} from '../lib/enterprise-server-releases.js'
import patterns from '../lib/patterns.js'
import versionSatisfiesRange from '../lib/version-satisfies-range.js'
import isArchivedVersion from '../lib/is-archived-version.js'
import { setFastlySurrogateKey, SURROGATE_ENUMS } from './set-fastly-surrogate-key.js'
} from '#src/versions/lib/enterprise-server-releases.js'
import patterns from '../../../lib/patterns.js'
import versionSatisfiesRange from '#src/versions/lib/version-satisfies-range.js'
import isArchivedVersion from '#src/archives/lib/is-archived-version.js'
import {
setFastlySurrogateKey,
SURROGATE_ENUMS,
} from '../../../middleware/set-fastly-surrogate-key.js'
import got from 'got'
import { readCompressedJsonFileFallbackLazily } from '../lib/read-json-file.js'
import { archivedCacheControl, languageCacheControl } from './cache-control.js'
import { readCompressedJsonFileFallbackLazily } from '../../../lib/read-json-file.js'
import { archivedCacheControl, languageCacheControl } from '../../../middleware/cache-control.js'
import { pathLanguagePrefixed, languagePrefixPathRegex } from '#src/languages/lib/languages.js'
import getRedirect, { splitPathByLanguage } from '../src/redirects/lib/get-redirect.js'
import getRemoteJSON from './get-remote-json.js'
import getRedirect, { splitPathByLanguage } from '#src/redirects/lib/get-redirect.js'
import getRemoteJSON from '../../../middleware/get-remote-json.js'
const REMOTE_ENTERPRISE_STORAGE_URL = 'https://githubdocs.azureedge.net/enterprise'

View File

@@ -1,8 +1,8 @@
import { describe, jest, test } from '@jest/globals'
import enterpriseServerReleases from '../../lib/enterprise-server-releases.js'
import { get, getDOM } from '../helpers/e2etest.js'
import { SURROGATE_ENUMS } from '../../middleware/set-fastly-surrogate-key.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
import { get, getDOM } from '../../../tests/helpers/e2etest.js'
import { SURROGATE_ENUMS } from '../../../middleware/set-fastly-surrogate-key.js'
jest.useFakeTimers({ legacyFakeTimers: true })

View File

@@ -3,7 +3,7 @@ import { expect, jest } from '@jest/globals'
import { checkCachingHeaders } from '../../../tests/helpers/caching-headers.js'
import { setDefaultFastlySurrogateKey } from '../../../middleware/set-fastly-surrogate-key.js'
import archivedEnterpriseVersionsAssets from '../../../middleware/archived-enterprise-versions-assets.js'
import archivedEnterpriseVersionsAssets from '#src/archives/middleware/archived-enterprise-versions-assets.js'
function mockRequest(path, { headers }) {
const _headers = Object.fromEntries(

View File

@@ -1,7 +1,7 @@
import path from 'path'
import { readCompressedJsonFileFallback } from '../../../lib/read-json-file.js'
import { getOpenApiVersion } from '../../../lib/all-versions.js'
import { getOpenApiVersion } from '#src/versions/lib/all-versions.js'
export const AUDIT_LOG_DATA_DIR = 'src/audit-logs/data'

View File

@@ -7,8 +7,8 @@ import { rimraf } from 'rimraf'
import { mkdirp } from 'mkdirp'
import { difference, isEqual } from 'lodash-es'
import { allVersions } from '../../../lib/all-versions.js'
import getApplicableVersions from '../../../lib/get-applicable-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
const ROOT_INDEX_FILE = 'content/index.md'
export const MARKDOWN_COMMENT = '\n<!-- Content after this section is automatically generated -->\n'

View File

@@ -1,7 +1,7 @@
import { describe, expect } from '@jest/globals'
import { supported } from '../../../lib/enterprise-server-releases.js'
import { allVersionKeys, allVersions } from '../../../lib/all-versions.js'
import { supported } from '#src/versions/lib/enterprise-server-releases.js'
import { allVersionKeys, allVersions } from '#src/versions/lib/all-versions.js'
import { convertVersionsToFrontmatter } from '../lib/update-markdown.js'
describe('frontmatter versions are generated correctly from automated data', () => {

View File

@@ -1,7 +1,7 @@
import { addError, forEachInlineChild } from 'markdownlint-rule-helpers'
import { liquid } from '#src/content-render/index.js'
import { allVersions } from '../../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { getRange } from '../helpers/utils.js'
export const incorrectAltTextLength = {

View File

@@ -8,9 +8,9 @@ import { decode } from 'html-entities'
import matter from '../../../lib/read-frontmatter.js'
import { renderContent } from '#src/content-render/index.js'
import getApplicableVersions from '../../../lib/get-applicable-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import contextualize from '../../../middleware/context.js'
import shortVersions from '../../../middleware/contextualizers/short-versions.js'
import shortVersions from '#src/versions/middleware/short-versions.js'
const __dirname = path.dirname(fileURLToPath(import.meta.url))

View File

@@ -4,8 +4,13 @@ import Ajv from 'ajv'
import addErrors from 'ajv-errors'
import semver from 'semver'
import { allVersions, allVersionShortnames } from '../../../lib/all-versions.js'
import { supported, next, nextNext, deprecated } from '../../../lib/enterprise-server-releases.js'
import { allVersions, allVersionShortnames } from '#src/versions/lib/all-versions.js'
import {
supported,
next,
nextNext,
deprecated,
} from '#src/versions/lib/enterprise-server-releases.js'
import { getLiquidConditionals } from '../../../script/helpers/get-liquid-conditionals.js'
import allowedVersionOperators from '#src/content-render/liquid/ifversion-supported-operators.js'
import featureVersionsSchema from '../lib/feature-versions-schema.js'

View File

@@ -1,5 +1,5 @@
import { Tag, isTruthy, Value, TokenizationError } from 'liquidjs'
import versionSatisfiesRange from '../../../lib/version-satisfies-range.js'
import versionSatisfiesRange from '#src/versions/lib/version-satisfies-range.js'
import supportedOperators from './ifversion-supported-operators.js'
const SyntaxHelp =

View File

@@ -2,7 +2,7 @@ import { afterAll, beforeAll, expect, describe, it } from '@jest/globals'
import Page from '../../../lib/page.js'
import languages from '#src/languages/lib/languages.js'
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { DataDirectory } from '../../../tests/helpers/data-directory.js'
describe('data tag', () => {

View File

@@ -1,10 +1,10 @@
import { jest } from '@jest/globals'
import { liquid } from '#src/content-render/index.js'
import shortVersionsMiddleware from '../../../middleware/contextualizers/short-versions.js'
import featureVersionsMiddleware from '../../../middleware/contextualizers/features.js'
import { allVersions } from '../../../lib/all-versions.js'
import enterpriseServerReleases from '../../../lib/enterprise-server-releases.js'
import shortVersionsMiddleware from '#src/versions/middleware/short-versions.js'
import featureVersionsMiddleware from '#src/versions/middleware/features.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
// Setup these variables so we don't need to manually update tests as GHES
// versions continually get deprecated. For example, if we deprecate GHES 3.0,

View File

@@ -2,12 +2,12 @@ import path from 'path'
import { visit } from 'unist-util-visit'
import { distance } from 'fastest-levenshtein'
import { getPathWithoutLanguage, getVersionStringFromPath } from '../../../lib/path-utils.js'
import { getNewVersionedPath } from '../../../lib/old-versions-utils.js'
import { getNewVersionedPath } from '#src/archives/lib/old-versions-utils.js'
import patterns from '../../../lib/patterns.js'
import { deprecated, latest } from '../../../lib/enterprise-server-releases.js'
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
import { allVersions } from '../../../lib/all-versions.js'
import removeFPTFromPath from '../../../lib/remove-fpt-from-path.js'
import { deprecated, latest } from '#src/versions/lib/enterprise-server-releases.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js'
import readJsonFile from '../../../lib/read-json-file.js'
import findPage from '../../../lib/find-page.js'

View File

@@ -1,5 +1,5 @@
import { languageKeys } from '#src/languages/lib/languages.js'
import { allVersionKeys } from '../../../lib/all-versions.js'
import { allVersionKeys } from '#src/versions/lib/all-versions.js'
import { productIds } from '../../../lib/all-products.js'
import { allTools } from '#src/tools/lib/all-tools.js'

View File

@@ -16,7 +16,7 @@ import { rimraf } from 'rimraf'
import http from 'http'
import createApp from '../../../lib/app.js'
import EnterpriseServerReleases from '../../../lib/enterprise-server-releases.js'
import EnterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
import loadRedirects from '#src/redirects/lib/precompile.js'
import { loadPageMap } from '../../../lib/page-data.js'
import { languageKeys } from '#src/languages/lib/languages.js'

View File

@@ -11,7 +11,7 @@ import path from 'path'
import { program } from 'commander'
import yaml from 'js-yaml'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
const releaseCandidateFile = 'data/variables/release_candidate.yml'
const releaseCandidateYaml = path.join(process.cwd(), releaseCandidateFile)

View File

@@ -2,7 +2,7 @@ import { Tokenizer } from 'liquidjs'
import { getLiquidConditionalsWithContent } from '../../../script/helpers/get-liquid-conditionals.js'
import getVersionBlocks from './get-version-blocks.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import supportedOperators from '#src/content-render/liquid/ifversion-supported-operators.js'
const supportedShortVersions = Object.values(allVersions).map((v) => v.shortName)

View File

@@ -12,8 +12,8 @@ import path from 'path'
import { rimraf } from 'rimraf'
import walk from 'walk-sync'
import { allVersions } from '../../../lib/all-versions.js'
import { deprecated } from '../../../lib/enterprise-server-releases.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
const graphqlDataDir = path.join(process.cwd(), 'data/graphql')
const webhooksStaticDir = path.join(process.cwd(), 'src/webhooks/data')

View File

@@ -13,7 +13,7 @@ import { program } from 'commander'
import frontmatter from '../../../lib/read-frontmatter.js'
import removeLiquidStatements from './remove-liquid-statements.js'
import removeDeprecatedFrontmatter from './remove-deprecated-frontmatter.js'
import { all, getNextReleaseNumber } from '../../../lib/enterprise-server-releases.js'
import { all, getNextReleaseNumber } from '#src/versions/lib/enterprise-server-releases.js'
import walkFiles from '../../../script/helpers/walk-files.js'
program

View File

@@ -17,7 +17,7 @@ import { rimraf } from 'rimraf'
import { difference, intersection } from 'lodash-es'
import { mkdirp } from 'mkdirp'
import { deprecated, supported } from '../../../lib/enterprise-server-releases.js'
import { deprecated, supported } from '#src/versions/lib/enterprise-server-releases.js'
const [currentReleaseNumber, previousReleaseNumber] = supported
const pipelines = JSON.parse(await readFile('src/automated-pipelines/lib/config.json'))[
@@ -29,7 +29,7 @@ await updateAutomatedConfigFiles(pipelines, deprecated)
// src/rest/lib/config.json file. We want to update 'api-versions'
// before the allVersions object is created so we need to import it
// after calling updateAutomatedConfigFiles.
const { allVersions } = await import('../../../lib/all-versions.js')
const { allVersions } = await import('#src/versions/lib/all-versions.js')
// Gets all of the base names (e.g., ghes-) in the allVersions object
// Currently, this is only ghes- but if we had more than one type of

View File

@@ -2,7 +2,7 @@ import path from 'path'
import { readFile } from 'fs/promises'
import { readCompressedJsonFileFallback } from '../../../lib/read-json-file.js'
import { getOpenApiVersion } from '../../../lib/all-versions.js'
import { getOpenApiVersion } from '#src/versions/lib/all-versions.js'
import { categoriesWithoutSubcategories } from '../../rest/lib/index.js'
const ENABLED_APPS_DIR = 'src/github-apps/data'

View File

@@ -1,6 +1,6 @@
import { jest, test } from '@jest/globals'
import { readFile } from 'fs/promises'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { get, getDOM } from '../../../tests/helpers/e2etest.js'
import { categoriesWithoutSubcategories } from '#src/rest/lib/index.js'

View File

@@ -4,7 +4,7 @@ import {
} from '../../../lib/read-json-file.js'
import { getAutomatedPageMiniTocItems } from '../../../lib/get-mini-toc-items.js'
import languages from '#src/languages/lib/languages.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
export const GRAPHQL_DATA_DIR = 'src/graphql/data'
/* ADD LANGUAGE KEY */

View File

@@ -5,7 +5,7 @@ import { mkdirp } from 'mkdirp'
import yaml from 'js-yaml'
import { execSync } from 'child_process'
import { getContents, listMatchingRefs } from '../../../script/helpers/git-utils.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import processPreviews from './utils/process-previews.js'
import processUpcomingChanges from './utils/process-upcoming-changes.js'
import processSchemas from './utils/process-schemas.js'

View File

@@ -1,7 +1,7 @@
import { describe } from '@jest/globals'
import { readFileSync } from 'fs'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import {
getGraphqlSchema,
getGraphqlChangelog,

View File

@@ -4,7 +4,7 @@ import Ajv from 'ajv'
import readJsonFile from '../../../lib/read-json-file.js'
import { schemaValidator, previewsValidator, upcomingChangesValidator } from '../lib/validator.js'
import { formatAjvErrors } from '../../../tests/helpers/schemas.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { GRAPHQL_DATA_DIR } from '../lib/index.js'
const allVersionValues = Object.values(allVersions)

View File

@@ -6,7 +6,7 @@ import { LinkExternalIcon, NoteIcon } from '@primer/octicons-react'
import { Link } from 'components/Link'
import { useProductLandingContext } from 'src/landings/components/ProductLandingContext'
import { useTranslation } from 'src/languages/components/useTranslation'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
import { Lead } from 'components/ui/Lead'
export const LandingHero = () => {

View File

@@ -11,7 +11,7 @@ import { LandingSection } from 'src/landings/components/LandingSection'
import { useTranslation } from 'src/languages/components/useTranslation'
import { ProductArticlesList } from 'src/landings/components/ProductArticlesList'
import { ProductReleases } from 'src/landings/components/ProductReleases'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
import { RestRedirect } from 'src/rest/components/RestRedirect'
export const ProductLanding = () => {

View File

@@ -1,7 +1,7 @@
import { jest } from '@jest/globals'
import { getDOM } from '../../../tests/helpers/e2etest.js'
import enterpriseServerReleases from '../../../lib/enterprise-server-releases.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
describe('featuredLinks', () => {
jest.setTimeout(60 * 1000)

View File

@@ -62,7 +62,7 @@ console.warn = console.error = (...args) => {
const { languageKeys } = await import('#src/languages/lib/languages.js')
const { loadPages, loadPageMap } = await import('../../../lib/page-data.js')
const { precompileRedirects } = await import('../../../src/redirects/lib/precompile.js')
const { allVersions, allVersionKeys } = await import('../../../lib/all-versions.js')
const { allVersions, allVersionKeys } = await import('#src/versions/lib/all-versions.js')
const { getProductStringFromPath } = await import('../../../lib/path-utils.js')
// Check that the language is valid

View File

@@ -14,7 +14,7 @@ import Bottleneck from 'bottleneck'
//
import { loadPages } from '../../../lib/page-data.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import languages from '#src/languages/lib/languages.js'
const port = 4002

View File

@@ -1,7 +1,7 @@
import path from 'path'
import findPage from '../../../lib/find-page.js'
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
import removeFPTFromPath from '../../../lib/remove-fpt-from-path.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js'
import { renderContent } from '#src/content-render/index.js'
// rawLinks is an array of paths: [ '/foo' ]

View File

@@ -1,6 +1,6 @@
import { renderContent } from '#src/content-render/index.js'
import getLinkData from './get-link-data.js'
import getApplicableVersions from '../../../lib/get-applicable-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import { getDataByLanguage } from '../../../lib/get-data.js'
import { executeWithFallback } from '../../../lib/render-with-fallback.js'

View File

@@ -17,8 +17,8 @@ import loadRedirects from '#src/redirects/lib/precompile.js'
import patterns from '../../../lib/patterns.js'
import { loadUnversionedTree, loadPages, loadPageMap } from '../../../lib/page-data.js'
import getRedirect, { splitPathByLanguage } from '#src/redirects/lib/get-redirect.js'
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
import { deprecated } from '../../../lib/enterprise-server-releases.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
function objectClone(obj) {
try {

View File

@@ -15,7 +15,7 @@ import {
getCoreInject,
getUploadArtifactInject,
} from '../../../script/helpers/action-injections.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import github from '../../../script/helpers/github.js'
const STATIC_PREFIXES = {

View File

@@ -9,13 +9,13 @@ import chalk from 'chalk'
import { Low } from 'lowdb'
import { JSONFile } from 'lowdb/node'
import shortVersions from '../../../middleware/contextualizers/short-versions.js'
import shortVersions from '#src/versions/middleware/short-versions.js'
import contextualize from '../../../middleware/context.js'
import features from '../../../middleware/contextualizers/features.js'
import features from '#src/versions/middleware/features.js'
import getRedirect from '#src/redirects/lib/get-redirect.js'
import warmServer from '../../../lib/warm-server.js'
import { liquid } from '#src/content-render/index.js'
import { deprecated } from '../../../lib/enterprise-server-releases.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
import excludedLinks from '#src/links/lib/excluded-links.js'
import { getEnvInputs, boolEnvVar } from '../../../.github/actions-scripts/lib/get-env-inputs.js'
import {

View File

@@ -6,7 +6,7 @@ import frontmatter from '../../../lib/read-frontmatter.js'
import { loadPages, loadPageMap } from '../../../lib/page-data.js'
import patterns from '../../../lib/patterns.js'
import loadRedirects from '#src/redirects/lib/precompile.js'
import { allVersionKeys } from '../../../lib/all-versions.js'
import { allVersionKeys } from '#src/versions/lib/all-versions.js'
// get all content and data files
const files = ['content', 'data']

View File

@@ -8,11 +8,11 @@ import {
setFastlySurrogateKey,
makeLanguageSurrogateKey,
} from '../../middleware/set-fastly-surrogate-key.js'
import shortVersions from '../../middleware/contextualizers/short-versions.js'
import shortVersions from '#src/versions/middleware/short-versions.js'
import contextualize from '../../middleware/context.js'
import features from '../../middleware/contextualizers/features.js'
import features from '#src/versions/middleware/features.js'
import getRedirect from '#src/redirects/lib/get-redirect.js'
import { isArchivedVersionByPath } from '../../lib/is-archived-version.js'
import { isArchivedVersionByPath } from '#src/archives/lib/is-archived-version.js'
const router = express.Router()

View File

@@ -2,7 +2,7 @@ import { beforeAll } from '@jest/globals'
import { get } from '../../../tests/helpers/e2etest.js'
import { SURROGATE_ENUMS } from '../../../middleware/set-fastly-surrogate-key.js'
import { latest } from '../../../lib/enterprise-server-releases.js'
import { latest } from '#src/versions/lib/enterprise-server-releases.js'
const makeURL = (pathname) => `/api/pageinfo/v1?${new URLSearchParams({ pathname })}`

View File

@@ -1,11 +1,11 @@
import { languageKeys } from '#src/languages/lib/languages.js'
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
import { allVersions } from '../../../lib/all-versions.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import {
latest,
supported,
deprecatedWithFunctionalRedirects,
} from '../../../lib/enterprise-server-releases.js'
} from '#src/versions/lib/enterprise-server-releases.js'
import { getPathWithLanguage } from '../../../lib/path-utils.js'
const languagePrefixRegex = new RegExp(`^/(${languageKeys.join('|')})/`)

View File

@@ -1,4 +1,4 @@
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js'
import { getPathWithoutVersion } from '../../../lib/path-utils.js'
export default function permalinkRedirects(permalinks, redirectFrom) {

View File

@@ -1,6 +1,6 @@
import { readCompressedJsonFileFallback } from '../../../lib/read-json-file.js'
import getExceptionRedirects from './exception-redirects.js'
import { latest } from '../../../lib/enterprise-server-releases.js'
import { latest } from '#src/versions/lib/enterprise-server-releases.js'
const EXCEPTIONS_FILE = './src/redirects/lib/static/redirect-exceptions.txt'

View File

@@ -1,7 +1,7 @@
import patterns from '../../../lib/patterns.js'
import { URL } from 'url'
import { pathLanguagePrefixed } from '#src/languages/lib/languages.js'
import { deprecatedWithFunctionalRedirects } from '../../../lib/enterprise-server-releases.js'
import { deprecatedWithFunctionalRedirects } from '#src/versions/lib/enterprise-server-releases.js'
import getRedirect from '../lib/get-redirect.js'
import { defaultCacheControl, languageCacheControl } from '../../../middleware/cache-control.js'

View File

@@ -1,6 +1,6 @@
import { jest } from '@jest/globals'
import path from 'path'
import enterpriseServerReleases from '../../../../lib/enterprise-server-releases.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
import { get } from '../../../../tests/helpers/e2etest.js'
import readJsonFile from '../../../../lib/read-json-file.js'

View File

@@ -4,7 +4,7 @@ import { jest } from '@jest/globals'
import { get } from '../../../../tests/helpers/e2etest.js'
import getExceptionRedirects from '../../lib/exception-redirects.js'
import { latest } from '../../../../lib/enterprise-server-releases.js'
import { latest } from '#src/versions/lib/enterprise-server-releases.js'
const __dirname = path.dirname(fileURLToPath(import.meta.url))

View File

@@ -2,7 +2,7 @@ import { jest } from '@jest/globals'
import { get } from '../../../../tests/helpers/e2etest.js'
import getExceptionRedirects from '../../lib/exception-redirects.js'
import { latest } from '../../../../lib/enterprise-server-releases.js'
import { latest } from '#src/versions/lib/enterprise-server-releases.js'
import path from 'path'
import { fileURLToPath } from 'url'

View File

@@ -1,7 +1,7 @@
import { describe, expect } from '@jest/globals'
import getRedirect from '../../lib/get-redirect.js'
import { latest, supported } from '../../../../lib/enterprise-server-releases.js'
import { latest, supported } from '#src/versions/lib/enterprise-server-releases.js'
const previousEnterpriserServerVersion = supported[1]
describe('getRedirect basics', () => {

View File

@@ -1,5 +1,5 @@
import { formatReleases, renderPatchNotes } from '#src/release-notes/lib/release-notes-utils.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { getReleaseNotes } from './get-release-notes.js'
export default async function ghaeReleaseNotesContext(req, res, next) {

View File

@@ -1,5 +1,5 @@
import { formatReleases, renderPatchNotes } from '#src/release-notes/lib/release-notes-utils.js'
import { all } from '../../../lib/enterprise-server-releases.js'
import { all } from '#src/versions/lib/enterprise-server-releases.js'
import { executeWithFallback } from '../../../lib/render-with-fallback.js'
import { getReleaseNotes } from './get-release-notes.js'

View File

@@ -2,7 +2,7 @@ import { jest } from '@jest/globals'
import nock from 'nock'
import { get, getDOM } from '../../../tests/helpers/e2etest.js'
import enterpriseServerReleases from '../../../lib/enterprise-server-releases.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
jest.useFakeTimers({ legacyFakeTimers: true })

View File

@@ -1,6 +1,6 @@
import { describe, jest } from '@jest/globals'
import enterpriseServerReleases from '../../../lib/enterprise-server-releases.js'
import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js'
import { get } from '../../../tests/helpers/e2etest.js'
import Page from '../../../lib/page.js'

View File

@@ -3,7 +3,7 @@ import Cookies from 'components/lib/cookies'
import { InfoIcon } from '@primer/octicons-react'
import { useMainContext } from 'components/context/MainContext'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion'
import { Picker } from 'src/tools/components/Picker'
import { useTranslation } from 'src/languages/components/useTranslation'
import { API_VERSION_COOKIE_NAME } from 'src/rest/components/RestRedirect'

View File

@@ -2,7 +2,7 @@ import React from 'react'
import { Flash } from '@primer/react'
import { useRouter } from 'next/router'
import { DEFAULT_VERSION, useVersion } from 'components/hooks/useVersion'
import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion'
import { Link } from 'components/Link'
import { useMainContext } from 'components/context/MainContext'
import { useTranslation } from 'src/languages/components/useTranslation'

View File

@@ -20,7 +20,7 @@ import styles from './RestCodeSamples.module.scss'
import { RestMethod } from './RestMethod'
import type { Operation, ExampleT } from './types'
import { ResponseKeys, CodeSampleKeys } from './types'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
type Props = {
slug: string

View File

@@ -2,7 +2,7 @@ import { useEffect } from 'react'
import { useRouter } from 'next/router'
import Cookies from 'components/lib/cookies'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
import { useMainContext } from 'components/context/MainContext'
export const API_VERSION_COOKIE_NAME = 'apiVersionPreferred'

View File

@@ -2,7 +2,7 @@ import { parseTemplate } from 'url-template'
import { stringify } from 'javascript-stringify'
import type { CodeSample, Operation } from 'src/rest/components/types'
import { useVersion } from 'components/hooks/useVersion'
import { useVersion } from 'src/versions/components/useVersion'
import { useMainContext } from 'components/context/MainContext'
type CodeExamples = Record<string, any>

View File

@@ -2,7 +2,7 @@
import chalk from 'chalk'
import { readFile } from 'fs/promises'
import { allVersions } from '../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
// Translate the docs versioning nomenclature back to the OpenAPI names
const invertedVersionMapping = JSON.parse(await readFile('src/rest/lib/config.json')).versionMapping

View File

@@ -3,7 +3,7 @@ import path from 'path'
import { readCompressedJsonFileFallback } from '../../../lib/read-json-file.js'
import { getAutomatedPageMiniTocItems } from '../../../lib/get-mini-toc-items.js'
import { allVersions, getOpenApiVersion } from '../../../lib/all-versions.js'
import { allVersions, getOpenApiVersion } from '#src/versions/lib/all-versions.js'
import languages from '#src/languages/lib/languages.js'
export const REST_DATA_DIR = 'src/rest/data'

View File

@@ -57,7 +57,7 @@ export default function Category({
export const getServerSideProps: GetServerSideProps<Props> = async (context) => {
const { default: getRest, getRestMiniTocItems } = await import('src/rest/lib/index.js')
const nonEnterpriseDefaultVersion = (await import(
'lib/non-enterprise-default-version.js'
'src/versions/lib/non-enterprise-default-version.js'
)) as unknown as string
const req = context.req as any

View File

@@ -10,10 +10,10 @@ import path from 'path'
import _ from 'lodash'
import frontmatter from '../../../lib/read-frontmatter.js'
import getApplicableVersions from '../../../lib/get-applicable-versions.js'
import { allVersions, getDocsVersion } from '../../../lib/all-versions.js'
import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js'
import { allVersions, getDocsVersion } from '#src/versions/lib/all-versions.js'
import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../lib/index.js'
import { deprecated } from '../../../lib/enterprise-server-releases.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
const contentFiles = []

View File

@@ -19,7 +19,7 @@ import { existsSync } from 'fs'
import { syncRestData, getOpenApiSchemaFiles } from './utils/sync.js'
import { validateVersionsOptions } from './utils/get-openapi-schemas.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { syncWebhookData } from '../../webhooks/scripts/sync.js'
import { syncGitHubAppsData } from '../../github-apps/scripts/sync.js'
import { syncRestRedirects } from './utils/get-redirects.js'

View File

@@ -2,7 +2,7 @@ import { readFile, readdir } from 'fs/promises'
import yaml from 'js-yaml'
import path from 'path'
import { allVersions } from '../../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
const OPEN_API_RELEASES_DIR = '../github/app/api/description/config/releases'
const configData = JSON.parse(await readFile('src/rest/lib/config.json', 'utf8'))

View File

@@ -4,7 +4,7 @@ import path from 'path'
import { mkdirp } from 'mkdirp'
import { updateRestFiles } from './update-markdown.js'
import { allVersions } from '../../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
import { createOperations, processOperations } from './get-operations.js'
import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../../lib/index.js'

View File

@@ -6,9 +6,9 @@ import {
updateContentDirectory,
convertVersionsToFrontmatter,
} from '../../../automated-pipelines/lib/update-markdown.js'
import { getDocsVersion } from '../../../../lib/all-versions.js'
import { getDocsVersion } from '#src/versions/lib/all-versions.js'
import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../../lib/index.js'
import { deprecated } from '../../../../lib/enterprise-server-releases.js'
import { deprecated } from '#src/versions/lib/enterprise-server-releases.js'
const { frontmatterDefaults, targetDirectory } = JSON.parse(
await readFile('src/rest/lib/config.json', 'utf-8'),

View File

@@ -1,7 +1,7 @@
import { describe, expect } from '@jest/globals'
import { getOpenApiSchemaFiles } from '../scripts/utils/sync.js'
import { allVersions } from '../../../lib/all-versions.js'
import { allVersions } from '#src/versions/lib/all-versions.js'
const supportedReleases = Object.keys(allVersions).map(
(version) => allVersions[version].openApiVersionName,

View File

@@ -5,7 +5,7 @@ import { describe } from '@jest/globals'
import walk from 'walk-sync'
import { isPlainObject, difference } from 'lodash-es'
import { isApiVersioned, allVersions } from '../../../lib/all-versions.js'
import { isApiVersioned, allVersions } from '#src/versions/lib/all-versions.js'
import getRest from '../lib/index.js'
const schemasPath = 'src/rest/data'

Some files were not shown because too many files have changed in this diff Show More