diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a9a6126f8a9b..f33676be1f15 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,4 +1,44 @@ -This documentation repository consists mainly of content written in Markdown format. These files are converted into HTML for displaying on a website. Most Markdown files become a single article on the documentation site. Other files contain reusable content which is inserted into multiple articles. The repository also contains YAML files (e.g. for variable text), image files, JavaScript/TypeScript files, etc. +This repository contains code to run the GitHub Docs site on docs.github.com, as well as the content that is displayed on the site. The code is written in JavaScript and TypeScript, and the content is primarily written in Markdown. + +Changes to files in `src/*` or files with `.ts` or `.js` extensions are likely code-related changes. Please follow the engineering guidelines below when making changes to these files. + +Changes to files in `content/*` and `data/*` are likely content-related changes. Content changes include updates to articles, reusable content, and data files that define variables used in articles. Please follow the content guidelines below when making changes to these files. + +## Engineering guidelines + +### Scripts + +All scripts can be found in `package.json`. + +To validate any code changes: + - `npm run tsc` + - `npm run build` + - `npm run prettier` + - `npm run lint`: you can include `-- --fix` + +To validate specific changes, + - `npm run test`: For all unit tests + - You can pass specific paths, e.g. `npm run test -- src/search/tests/ai-search-proxy` + - You can add `--silent=false` to include `console.log` debugging. + - `npm run build && npm run playwright-test -- playwright-rendering`: You need to build for changes outside of the test to be picked up. We use playwright for all rendering and end-to-end tests + - You can add `--ui` to keep open `localhost:4000` which can be viewed in a simple browser for debugging UI state. + - `npm run dev` to start the development server on `localhost:4000`. + +### Imports + +We use absolute imports, relative to the `src` directory, using the `@` symbol. + +For example, `getRedirect` which lives inn `src/redirects/lib/get-redirect.js` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`. + +The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'` + +### Testing changes + +We use `vitest` to write unit tests. Tests live in their own files in the `tests` subdirectory of a source (src) directory, e.g. `src/search/tests/api-ai-search.ts`. + +For integration tests, we can use the mock server in `src/tests/mocks/start-mock-server.ts` to mock exteneral requests. + +For UI rendering tests, we use `playwright` and write tests in `src/fixtures/tests/playwright-rendering.spec.ts` ## Content guidelines @@ -90,9 +130,7 @@ Then, within a collapsed section, quote the original prompt from Copilot Chat: This helps reviewers understand the context and intent behind the automated changes. -## Development and testing guidelines - -### Content changes +### Testing Content changes Before committing content changes, always: @@ -100,21 +138,3 @@ Before committing content changes, always: 2. **Check for proper variable usage** in your content 3. **Verify [AUTOTITLE] links** point to existing articles 4. **Run tests** on changed content: `npm run test -- src/content-render/tests/render-changed-and-deleted-files.js` - -### Script and code changes - -For TypeScript, JavaScript, and SCSS files: - -1. **Run Prettier** to check formatting: `npm run prettier-check` -2. **Run the linter**: `npm run lint` -3. **Run TypeScript checks**: `npm run tsc` -4. **Run relevant tests**: `npm test` - -### Environment setup - -When testing changes in your development environment: - -1. Install dependencies: `npm ci` -2. For content changes, ensure the content linter runs successfully -3. For script changes, ensure all formatting and linting checks pass -4. Always verify your changes don't break existing functionality diff --git a/Dockerfile b/Dockerfile index a03d02bcdf91..d721a58d3e73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ # --------------------------------------------------------------- # To update the sha: # https://github.com/github/gh-base-image/pkgs/container/gh-base-image%2Fgh-base-noble -FROM ghcr.io/github/gh-base-image/gh-base-noble:20250707-185623-g8becf904e AS base +FROM ghcr.io/github/gh-base-image/gh-base-noble:20250709-201453-g6a417ef5f AS base # Install curl for Node install and determining the early access branch # Install git for cloning docs-early-access & translations repos diff --git a/content/actions/concepts/overview/about-continuous-integration-with-github-actions.md b/content/actions/concepts/overview/continuous-integration.md similarity index 86% rename from content/actions/concepts/overview/about-continuous-integration-with-github-actions.md rename to content/actions/concepts/overview/continuous-integration.md index b5ede84a203d..a145eaa50e78 100644 --- a/content/actions/concepts/overview/about-continuous-integration-with-github-actions.md +++ b/content/actions/concepts/overview/continuous-integration.md @@ -1,5 +1,5 @@ --- -title: About continuous integration with GitHub Actions +title: Continuous integration intro: 'You can create custom continuous integration (CI) workflows directly in your {% data variables.product.prodname_dotcom %} repository with {% data variables.product.prodname_actions %}.' redirect_from: - /articles/about-continuous-integration @@ -10,6 +10,7 @@ redirect_from: - /actions/automating-builds-and-tests/about-continuous-integration - /actions/about-github-actions/about-continuous-integration - /actions/about-github-actions/about-continuous-integration-with-github-actions + - /actions/concepts/overview/about-continuous-integration-with-github-actions versions: fpt: '*' ghes: '*' @@ -44,13 +45,6 @@ In addition to helping you set up CI workflows for your project, you can use {% For a definition of common terms, see [AUTOTITLE](/actions/learn-github-actions/understanding-github-actions). -## Workflow templates +## Next steps -{% data variables.product.github %} offers CI workflow templates for a variety of languages and frameworks. - -Browse the complete list of CI workflow templates offered by {% data variables.product.company_short %} in the {% ifversion fpt or ghec %}[actions/starter-workflows](https://github.com/actions/starter-workflows/tree/main/ci) repository{% else %} `actions/starter-workflows` repository on {% data variables.product.prodname_dotcom_the_website %}{% endif %}. - -## Further reading - -* [AUTOTITLE](/actions/use-cases-and-examples/building-and-testing){% ifversion fpt or ghec %} -* [AUTOTITLE](/billing/managing-billing-for-github-actions){% endif %} +{% data variables.product.github %} offers CI workflow templates for a variety of languages and frameworks. For tutorials on setting up continuous integration with these templates, see [AUTOTITLE](/actions/use-cases-and-examples/building-and-testing). diff --git a/content/actions/concepts/overview/index.md b/content/actions/concepts/overview/index.md index 1af3dce9b536..f7199394e24f 100644 --- a/content/actions/concepts/overview/index.md +++ b/content/actions/concepts/overview/index.md @@ -8,6 +8,6 @@ versions: ghec: '*' children: - /about-continuous-deployment-with-github-actions - - /about-continuous-integration-with-github-actions + - /continuous-integration - /usage-limits-billing-and-administration --- diff --git a/content/actions/index.md b/content/actions/index.md index 4d5015b95801..2530757dc02a 100644 --- a/content/actions/index.md +++ b/content/actions/index.md @@ -9,7 +9,7 @@ featuredLinks: startHere: - /actions/how-tos/writing-workflows - /actions/how-tos/use-cases-and-examples - - /actions/concepts/overview/about-continuous-integration-with-github-actions + - /actions/concepts/overview/continuous-integration - /actions/concepts/use-cases/deploying-with-github-actions - /actions/concepts/use-cases/about-packaging-with-github-actions - /actions/how-tos/monitoring-and-troubleshooting-workflows @@ -42,4 +42,3 @@ children: - /reference - /tutorials --- - diff --git a/data/reusables/repositories/repo-name.md b/data/reusables/repositories/repo-name.md index 7b5cd8a13106..35dcdb76aeed 100644 --- a/data/reusables/repositories/repo-name.md +++ b/data/reusables/repositories/repo-name.md @@ -1,3 +1,3 @@ -1. Type a name for your repository, and an optional description. +1. Type a name for your repository (maximum 100 characters), and an optional description. ![Screenshot of a the first step in creating a repository. The "Repository name" field contains the text "hello-world" and is outlined in orange.](/assets/images/help/repository/create-repository-name.png) diff --git a/next.config.js b/next.config.js index 2972b2fcd1af..7a67a9177b2a 100644 --- a/next.config.js +++ b/next.config.js @@ -2,7 +2,8 @@ import fs from 'fs' import path from 'path' import frontmatter from 'gray-matter' -import { ROOT } from '#src/frame/lib/constants.js' +// Replace imports with hardcoded values +const ROOT = process.env.ROOT || '.' // Hard-coded language keys to avoid TypeScript import in config file const languageKeys = ['en', 'es', 'ja', 'pt', 'zh', 'ru', 'fr', 'ko', 'de'] diff --git a/src/archives/lib/is-archived-version.ts b/src/archives/lib/is-archived-version.ts index 801905b03d8f..8b08bacd856c 100644 --- a/src/archives/lib/is-archived-version.ts +++ b/src/archives/lib/is-archived-version.ts @@ -1,5 +1,5 @@ -import patterns from '@/frame/lib/patterns.js' -import { deprecated } from '@/versions/lib/enterprise-server-releases.js' +import patterns from '@/frame/lib/patterns' +import { deprecated } from '@/versions/lib/enterprise-server-releases' import type { ExtendedRequest } from '@/types' type IsArchivedInfo = { diff --git a/src/archives/lib/old-versions-utils.ts b/src/archives/lib/old-versions-utils.ts index 75d6c2749d13..055583ef31e6 100644 --- a/src/archives/lib/old-versions-utils.ts +++ b/src/archives/lib/old-versions-utils.ts @@ -1,7 +1,7 @@ import path from 'path' -import { supported, latest } from '@/versions/lib/enterprise-server-releases.js' -import patterns from '@/frame/lib/patterns.js' -import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' +import { supported, latest } from '@/versions/lib/enterprise-server-releases' +import patterns from '@/frame/lib/patterns' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' import { allVersions } from '@/versions/lib/all-versions' const latestNewVersion = `enterprise-server@${latest}` const oldVersions = ['dotcom'].concat(supported) diff --git a/src/archives/middleware/archived-enterprise-versions-assets.ts b/src/archives/middleware/archived-enterprise-versions-assets.ts index 3d15ad2f16f9..750dd0499a28 100644 --- a/src/archives/middleware/archived-enterprise-versions-assets.ts +++ b/src/archives/middleware/archived-enterprise-versions-assets.ts @@ -1,13 +1,10 @@ import got from 'got' import type { Response, NextFunction } from 'express' -import patterns from '@/frame/lib/patterns.js' +import patterns from '@/frame/lib/patterns' import { isArchivedVersion } from '@/archives/lib/is-archived-version' -import { - setFastlySurrogateKey, - SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' -import { archivedCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control.js' +import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { archivedCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control' import type { ExtendedRequest } from '@/types' // This module handles requests for the CSS and JS assets for diff --git a/src/archives/middleware/archived-enterprise-versions.ts b/src/archives/middleware/archived-enterprise-versions.ts index 452a48d8d2a5..ee0d27f912b0 100644 --- a/src/archives/middleware/archived-enterprise-versions.ts +++ b/src/archives/middleware/archived-enterprise-versions.ts @@ -1,25 +1,22 @@ import type { Response, NextFunction } from 'express' import got from 'got' -import statsd from '@/observability/lib/statsd.js' +import statsd from '@/observability/lib/statsd' import { firstVersionDeprecatedOnNewSite, lastVersionWithoutArchivedRedirectsFile, deprecatedWithFunctionalRedirects, firstReleaseStoredInBlobStorage, -} from '@/versions/lib/enterprise-server-releases.js' -import patterns from '@/frame/lib/patterns.js' -import versionSatisfiesRange from '@/versions/lib/version-satisfies-range.js' +} from '@/versions/lib/enterprise-server-releases' +import patterns from '@/frame/lib/patterns' +import versionSatisfiesRange from '@/versions/lib/version-satisfies-range' import { isArchivedVersion } from '@/archives/lib/is-archived-version' -import { - setFastlySurrogateKey, - SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' -import { readCompressedJsonFileFallbackLazily } from '@/frame/lib/read-json-file.js' -import { archivedCacheControl, languageCacheControl } from '@/frame/middleware/cache-control.js' +import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { readCompressedJsonFileFallbackLazily } from '@/frame/lib/read-json-file' +import { archivedCacheControl, languageCacheControl } from '@/frame/middleware/cache-control' import { pathLanguagePrefixed, languagePrefixPathRegex } from '@/languages/lib/languages' -import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect.js' -import getRemoteJSON from '@/frame/lib/get-remote-json.js' +import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect' +import getRemoteJSON from '@/frame/lib/get-remote-json' import { ExtendedRequest } from '@/types' const OLD_PUBLIC_AZURE_BLOB_URL = 'https://githubdocs.azureedge.net' @@ -75,7 +72,7 @@ const cacheAggressively = (res: Response) => { // 3. ~4000ms // // ...if the limit we set is 3. -// Our own timeout, in #src/frame/middleware/timeout.js defaults to 10 seconds. +// Our own timeout, in @/frame/middleware/timeout.js defaults to 10 seconds. // So there's no point in trying more attempts than 3 because it would // just timeout on the 10s. (i.e. 1000 + 2000 + 4000 + 8000 > 10,000) const retryConfiguration = { limit: 3 } diff --git a/src/archives/scripts/warmup-remotejson.ts b/src/archives/scripts/warmup-remotejson.ts index 13d800e52851..978bcdd4cdfd 100755 --- a/src/archives/scripts/warmup-remotejson.ts +++ b/src/archives/scripts/warmup-remotejson.ts @@ -19,11 +19,11 @@ import { program } from 'commander' import semver, { SemVer } from 'semver' -import getRemoteJSON from '@/frame/lib/get-remote-json.js' +import getRemoteJSON from '@/frame/lib/get-remote-json' import { deprecated, lastVersionWithoutArchivedRedirectsFile, -} from '@/versions/lib/enterprise-server-releases.js' +} from '@/versions/lib/enterprise-server-releases' program .description( diff --git a/src/archives/tests/deprecated-enterprise-versions.ts b/src/archives/tests/deprecated-enterprise-versions.ts index d5baff1c4188..541e6cf6b5c0 100644 --- a/src/archives/tests/deprecated-enterprise-versions.ts +++ b/src/archives/tests/deprecated-enterprise-versions.ts @@ -1,8 +1,8 @@ import { describe, expect, test, vi } from 'vitest' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' import { get, getDOM } from '@/tests/helpers/e2etest-ts' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' describe('enterprise deprecation', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/article-api/middleware/article-body.ts b/src/article-api/middleware/article-body.ts index e82ef7602173..8a6d42a32545 100644 --- a/src/article-api/middleware/article-body.ts +++ b/src/article-api/middleware/article-body.ts @@ -1,8 +1,8 @@ import type { Response } from 'express' -import { Context } from '@/types.js' +import { Context } from '@/types' import { ExtendedRequestWithPageInfo } from '../types' -import contextualize from '@/frame/middleware/context/context.js' +import contextualize from '@/frame/middleware/context/context' export async function getArticleBody(req: ExtendedRequestWithPageInfo) { // req.pageinfo is set from pageValidationMiddleware and pathValidationMiddleware diff --git a/src/article-api/middleware/article-pageinfo.ts b/src/article-api/middleware/article-pageinfo.ts index 690dda37f9e9..b9d45d80bd59 100644 --- a/src/article-api/middleware/article-pageinfo.ts +++ b/src/article-api/middleware/article-pageinfo.ts @@ -2,12 +2,12 @@ import type { Response } from 'express' import type { ExtendedRequestWithPageInfo } from '../types' import type { ExtendedRequest, Page, Context, Permalink } from '@/types' -import shortVersions from '@/versions/middleware/short-versions.js' +import shortVersions from '@/versions/middleware/short-versions' import contextualize from '@/frame/middleware/context/context' -import features from '@/versions/middleware/features.js' -import breadcrumbs from '@/frame/middleware/context/breadcrumbs.js' -import currentProductTree from '@/frame/middleware/context/current-product-tree.js' -import { readCompressedJsonFile } from '@/frame/lib/read-json-file.js' +import features from '@/versions/middleware/features' +import breadcrumbs from '@/frame/middleware/context/breadcrumbs' +import currentProductTree from '@/frame/middleware/context/current-product-tree' +import { readCompressedJsonFile } from '@/frame/lib/read-json-file' // If you have pre-computed page info into a JSON file on disk, this is // where it would be expected to be found. diff --git a/src/article-api/middleware/article.ts b/src/article-api/middleware/article.ts index e37b7dd84ee8..eca1e0a97f68 100644 --- a/src/article-api/middleware/article.ts +++ b/src/article-api/middleware/article.ts @@ -1,8 +1,8 @@ import type { RequestHandler, Response } from 'express' import express from 'express' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' -import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js' +import { defaultCacheControl } from '@/frame/middleware/cache-control' +import catchMiddlewareError from '@/observability/middleware/catch-middleware-error' import { ExtendedRequestWithPageInfo } from '../types' import { pageValidationMiddleware, pathValidationMiddleware } from './validation' import { getArticleBody } from './article-body' @@ -11,8 +11,8 @@ import { makeLanguageSurrogateKey, setFastlySurrogateKey, SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' -import statsd from '@/observability/lib/statsd.js' +} from '@/frame/middleware/set-fastly-surrogate-key' +import statsd from '@/observability/lib/statsd' const router = express.Router() diff --git a/src/article-api/middleware/pagelist.ts b/src/article-api/middleware/pagelist.ts index 6d1623754cbc..3b69a032b5f7 100644 --- a/src/article-api/middleware/pagelist.ts +++ b/src/article-api/middleware/pagelist.ts @@ -2,12 +2,12 @@ import express from 'express' import type { Response, RequestHandler } from 'express' import type { ExtendedRequest } from '@/types' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' -import { getProductStringFromPath, getVersionStringFromPath } from '@/frame/lib/path-utils.js' -import { getLanguageCodeFromPath } from '@/languages/middleware/detect-language.js' +import { defaultCacheControl } from '@/frame/middleware/cache-control' +import { getProductStringFromPath, getVersionStringFromPath } from '@/frame/lib/path-utils' +import { getLanguageCodeFromPath } from '@/languages/middleware/detect-language' import { pagelistValidationMiddleware } from './validation' -import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js' -import statsd from '@/observability/lib/statsd.js' +import catchMiddlewareError from '@/observability/middleware/catch-middleware-error' +import statsd from '@/observability/lib/statsd' const router = express.Router() diff --git a/src/article-api/middleware/validation.ts b/src/article-api/middleware/validation.ts index 6e358ac47b68..b2cd10920e7a 100644 --- a/src/article-api/middleware/validation.ts +++ b/src/article-api/middleware/validation.ts @@ -1,11 +1,11 @@ import { ExtendedRequestWithPageInfo } from '../types' import type { NextFunction, Response } from 'express' -import { ExtendedRequest, Page } from '@/types.js' +import { ExtendedRequest, Page } from '@/types' import { isArchivedVersionByPath } from '@/archives/lib/is-archived-version' -import getRedirect from '@/redirects/lib/get-redirect.js' -import { getVersionStringFromPath, getLangFromPath } from '@/frame/lib/path-utils.js' -import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' +import getRedirect from '@/redirects/lib/get-redirect' +import { getVersionStringFromPath, getLangFromPath } from '@/frame/lib/path-utils' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' // validates the path for pagelist endpoint // specifically, defaults to `/en/free-pro-team@latest` when those values are missing diff --git a/src/article-api/scripts/precompute-pageinfo.ts b/src/article-api/scripts/precompute-pageinfo.ts index de546cb2a912..655e96c22ccc 100644 --- a/src/article-api/scripts/precompute-pageinfo.ts +++ b/src/article-api/scripts/precompute-pageinfo.ts @@ -31,7 +31,7 @@ import chalk from 'chalk' import { program, Option } from 'commander' import { languageKeys } from '@/languages/lib/languages' -import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data.js' +import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data' import { CACHE_FILE_PATH, getPageInfo } from '../middleware/article-pageinfo' program diff --git a/src/article-api/tests/pageinfo.ts b/src/article-api/tests/pageinfo.ts index 5eac6bf50162..7fe9a63c6b17 100644 --- a/src/article-api/tests/pageinfo.ts +++ b/src/article-api/tests/pageinfo.ts @@ -1,8 +1,8 @@ import { beforeAll, describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' -import { latest } from '@/versions/lib/enterprise-server-releases.js' +import { get } from '@/tests/helpers/e2etest' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { latest } from '@/versions/lib/enterprise-server-releases' const makeURL = (pathname: string): string => `/api/article/meta?${new URLSearchParams({ pathname })}` diff --git a/src/article-api/tests/pagelist.ts b/src/article-api/tests/pagelist.ts index 97c33f0bff3b..4d8bff302843 100644 --- a/src/article-api/tests/pagelist.ts +++ b/src/article-api/tests/pagelist.ts @@ -1,9 +1,9 @@ import { beforeAll, describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' import { allVersionKeys } from '@/versions/lib/all-versions' -import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' describe.each(allVersionKeys)('pagelist api for %s', async (versionKey) => { beforeAll(() => { diff --git a/src/assets/middleware/dynamic-assets.ts b/src/assets/middleware/dynamic-assets.ts index 65c8febe3924..662989110317 100644 --- a/src/assets/middleware/dynamic-assets.ts +++ b/src/assets/middleware/dynamic-assets.ts @@ -4,11 +4,8 @@ import type { Response, NextFunction } from 'express' import sharp from 'sharp' import type { ExtendedRequest } from '@/types' -import { assetCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control.js' -import { - setFastlySurrogateKey, - SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' +import { assetCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control' +import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' /** * This is the indicator that is a virtual part of the URL. diff --git a/src/assets/middleware/static-asset-caching.ts b/src/assets/middleware/static-asset-caching.ts index 69359451ea30..250aa2b85d00 100644 --- a/src/assets/middleware/static-asset-caching.ts +++ b/src/assets/middleware/static-asset-caching.ts @@ -1,10 +1,7 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest } from '@/types' -import { - setFastlySurrogateKey, - SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' +import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' export default function setStaticAssetCaching( req: ExtendedRequest, diff --git a/src/assets/tests/dynamic-assets.ts b/src/assets/tests/dynamic-assets.ts index b658147b9298..b889735b0067 100644 --- a/src/assets/tests/dynamic-assets.ts +++ b/src/assets/tests/dynamic-assets.ts @@ -3,8 +3,8 @@ import { describe, expect, test, vi } from 'vitest' import sharp from 'sharp' import { fileTypeFromBuffer } from 'file-type' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' -import { get, head } from '@/tests/helpers/e2etest.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { get, head } from '@/tests/helpers/e2etest' describe('dynamic assets', () => { vi.setConfig({ testTimeout: 3 * 60 * 1000 }) diff --git a/src/assets/tests/static-assets.ts b/src/assets/tests/static-assets.ts index 1371345c0cc8..ec76eb9256eb 100644 --- a/src/assets/tests/static-assets.ts +++ b/src/assets/tests/static-assets.ts @@ -4,10 +4,10 @@ import path from 'path' import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest' import nock from 'nock' -import { get } from '@/tests/helpers/e2etest.js' -import { checkCachingHeaders } from '@/tests/helpers/caching-headers.js' -import { setDefaultFastlySurrogateKey } from '@/frame/middleware/set-fastly-surrogate-key.js' -import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets.js' +import { get } from '@/tests/helpers/e2etest' +import { checkCachingHeaders } from '@/tests/helpers/caching-headers' +import { setDefaultFastlySurrogateKey } from '@/frame/middleware/set-fastly-surrogate-key' +import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets' function getNextStaticAsset(directory: string) { const root = path.join('.next', 'static', directory) diff --git a/src/audit-logs/lib/index.ts b/src/audit-logs/lib/index.ts index 7f0cb1d6b108..d5e7c590ef4c 100644 --- a/src/audit-logs/lib/index.ts +++ b/src/audit-logs/lib/index.ts @@ -1,6 +1,6 @@ import path from 'path' -import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file.js' +import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file' import { getOpenApiVersion } from '@/versions/lib/all-versions' import type { AuditLogEventT, diff --git a/src/audit-logs/scripts/sync.ts b/src/audit-logs/scripts/sync.ts index b26dd3c5d15c..4d3aa40a78ad 100755 --- a/src/audit-logs/scripts/sync.ts +++ b/src/audit-logs/scripts/sync.ts @@ -12,13 +12,9 @@ import { readFile, writeFile } from 'fs/promises' import { mkdirp } from 'mkdirp' import path from 'path' -import { filterByAllowlistValues, filterAndUpdateGhesDataByAllowlistValues } from '../lib/index.js' -import { getContents, getCommitSha } from '@/workflows/git-utils.js' -import { - latest, - latestStable, - releaseCandidate, -} from '@/versions/lib/enterprise-server-releases.js' +import { filterByAllowlistValues, filterAndUpdateGhesDataByAllowlistValues } from '../lib/index' +import { getContents, getCommitSha } from '@/workflows/git-utils' +import { latest, latestStable, releaseCandidate } from '@/versions/lib/enterprise-server-releases' import type { AuditLogEventT, VersionedAuditLogData } from '../types' if (!process.env.GITHUB_TOKEN) { diff --git a/src/audit-logs/tests/rendering.ts b/src/audit-logs/tests/rendering.ts index cd63d3efc17c..b67cfc312c1b 100644 --- a/src/audit-logs/tests/rendering.ts +++ b/src/audit-logs/tests/rendering.ts @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { getDOM } from '@/tests/helpers/e2etest.js' +import { getDOM } from '@/tests/helpers/e2etest' import { allVersions } from '@/versions/lib/all-versions' import { getCategorizedAuditLogEvents } from '../lib' diff --git a/src/automated-pipelines/lib/update-markdown.ts b/src/automated-pipelines/lib/update-markdown.ts index a02dddc6dfe8..6375c99adcdb 100644 --- a/src/automated-pipelines/lib/update-markdown.ts +++ b/src/automated-pipelines/lib/update-markdown.ts @@ -8,7 +8,7 @@ import { mkdirp } from 'mkdirp' import { difference, isEqual } from 'lodash-es' import { allVersions } from '@/versions/lib/all-versions' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' import type { MarkdownFrontmatter } from '@/types' // Type definitions - extending existing type to add missing fields and make most fields optional diff --git a/src/automated-pipelines/tests/frontmatter-versions.ts b/src/automated-pipelines/tests/frontmatter-versions.ts index 10fc07f1a399..aeeb27527fda 100644 --- a/src/automated-pipelines/tests/frontmatter-versions.ts +++ b/src/automated-pipelines/tests/frontmatter-versions.ts @@ -1,8 +1,8 @@ import { describe, expect, test } from 'vitest' -import { supported } from '@/versions/lib/enterprise-server-releases.js' +import { supported } from '@/versions/lib/enterprise-server-releases' import { allVersionKeys, allVersions } from '@/versions/lib/all-versions' -import { convertVersionsToFrontmatter } from '../lib/update-markdown.js' +import { convertVersionsToFrontmatter } from '../lib/update-markdown' describe('frontmatter versions are generated correctly from automated data', () => { test('non-continuous enterprise server versions', async () => { diff --git a/src/automated-pipelines/tests/rendering.ts b/src/automated-pipelines/tests/rendering.ts index f89823749321..e9b23febc452 100644 --- a/src/automated-pipelines/tests/rendering.ts +++ b/src/automated-pipelines/tests/rendering.ts @@ -3,8 +3,8 @@ import { readFileSync } from 'fs' import cheerio from 'cheerio' import { describe, expect, test, vi } from 'vitest' -import { loadPages } from '@/frame/lib/page-data.js' -import { get } from '@/tests/helpers/e2etest.js' +import { loadPages } from '@/frame/lib/page-data' +import { get } from '@/tests/helpers/e2etest' // Type definitions for page objects type Page = { diff --git a/src/automated-pipelines/tests/update-markdown.ts b/src/automated-pipelines/tests/update-markdown.ts index c710f447aac1..6bd3205248a9 100644 --- a/src/automated-pipelines/tests/update-markdown.ts +++ b/src/automated-pipelines/tests/update-markdown.ts @@ -6,9 +6,9 @@ import path from 'path' import { afterAll, beforeAll, describe, expect, test } from 'vitest' import { mkdirp } from 'mkdirp' import matter from 'gray-matter' -import type { FrontmatterVersions } from '@/types.js' +import type { FrontmatterVersions } from '@/types' -import { updateContentDirectory } from '../lib/update-markdown.js' +import { updateContentDirectory } from '../lib/update-markdown' // Type definitions type ContentItem = { diff --git a/src/code-scanning/scripts/generate-code-scanning-query-list.ts b/src/code-scanning/scripts/generate-code-scanning-query-list.ts index 9a1c284d2a2d..d02e6e311439 100644 --- a/src/code-scanning/scripts/generate-code-scanning-query-list.ts +++ b/src/code-scanning/scripts/generate-code-scanning-query-list.ts @@ -53,7 +53,7 @@ import chalk from 'chalk' import { program } from 'commander' // We don't want to introduce a global dependency on @github/cocofix, so we install it by hand // as described above and suppress the import warning. -import { getSupportedQueries } from '@github/cocofix/dist/querySuites.js' /* eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved */ +import { getSupportedQueries } from '@github/cocofix/dist/querySuites' /* eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved */ import type { Language } from 'codeql-ts' program diff --git a/src/codeql-cli/scripts/convert-markdown-for-docs.js b/src/codeql-cli/scripts/convert-markdown-for-docs.js index 0513b547d0b0..3aba699d8230 100644 --- a/src/codeql-cli/scripts/convert-markdown-for-docs.js +++ b/src/codeql-cli/scripts/convert-markdown-for-docs.js @@ -7,8 +7,8 @@ import { visitParents } from 'unist-util-visit-parents' import { visit, SKIP } from 'unist-util-visit' import { remove } from 'unist-util-remove' -import { languageKeys } from '#src/languages/lib/languages.ts' -import { MARKDOWN_OPTIONS } from '../../content-linter/lib/helpers/unified-formatter-options.js' +import { languageKeys } from '@/languages/lib/languages' +import { MARKDOWN_OPTIONS } from '../../content-linter/lib/helpers/unified-formatter-options' const { targetDirectory, removeKeywords } = JSON.parse( await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'), diff --git a/src/codeql-cli/scripts/sync.js b/src/codeql-cli/scripts/sync.js index 85cd61fa1e43..33a955233729 100755 --- a/src/codeql-cli/scripts/sync.js +++ b/src/codeql-cli/scripts/sync.js @@ -7,8 +7,8 @@ import path from 'path' import matter from 'gray-matter' import { rimraf } from 'rimraf' -import { updateContentDirectory } from '../../automated-pipelines/lib/update-markdown.js' -import { convertContentToDocs } from './convert-markdown-for-docs.js' +import { updateContentDirectory } from '../../automated-pipelines/lib/update-markdown' +import { convertContentToDocs } from './convert-markdown-for-docs' const { targetDirectory, sourceDirectory, frontmatterDefaults, markdownPrefix } = JSON.parse( await readFile(path.join('src/codeql-cli/lib/config.json'), 'utf-8'), diff --git a/src/content-linter/lib/helpers/get-lintable-yml.js b/src/content-linter/lib/helpers/get-lintable-yml.js index c9f71de9d0a0..1a53648df11c 100755 --- a/src/content-linter/lib/helpers/get-lintable-yml.js +++ b/src/content-linter/lib/helpers/get-lintable-yml.js @@ -1,8 +1,8 @@ import yaml from 'js-yaml' import fs from 'fs/promises' -import dataSchemas from '#src/data-directory/lib/data-schemas/index.ts' -import ajv from '#src/tests/lib/validate-json-schema.ts' +import dataSchemas from '@/data-directory/lib/data-schemas/index' +import ajv from '@/tests/lib/validate-json-schema' // AJV already has a built-in way to extract out properties // with a specific keyword using a custom validator function. diff --git a/src/content-linter/lib/helpers/get-rules.d.ts b/src/content-linter/lib/helpers/get-rules.d.ts index 524cc84f5b00..694e3ec21464 100644 --- a/src/content-linter/lib/helpers/get-rules.d.ts +++ b/src/content-linter/lib/helpers/get-rules.d.ts @@ -1,7 +1,7 @@ // get-rules.d.ts // This is a declaration file for get-rules.js -import type { Rule, RuleConfig } from '../../types.ts' +import type { Rule, RuleConfig } from '../../types' export const customRules: Rule[] export const allRules: Rule[] diff --git a/src/content-linter/lib/helpers/get-rules.js b/src/content-linter/lib/helpers/get-rules.js index 06d8df855148..efa98024f5ad 100644 --- a/src/content-linter/lib/helpers/get-rules.js +++ b/src/content-linter/lib/helpers/get-rules.js @@ -1,7 +1,7 @@ -import rules from '../../../../node_modules/markdownlint/lib/rules.js' -import { gitHubDocsMarkdownlint } from '../linting-rules/index.js' -import { baseConfig } from '../../style/base.js' -import { customConfig } from '../../style/github-docs.js' +import rules from '../../../../node_modules/markdownlint/lib/rules' +import { gitHubDocsMarkdownlint } from '../linting-rules/index' +import { baseConfig } from '../../style/base' +import { customConfig } from '../../style/github-docs' export const customRules = gitHubDocsMarkdownlint.rules export const allRules = [...rules, ...gitHubDocsMarkdownlint.rules] diff --git a/src/content-linter/lib/helpers/liquid-utils.js b/src/content-linter/lib/helpers/liquid-utils.js index bfcac2891302..127f62bb6219 100644 --- a/src/content-linter/lib/helpers/liquid-utils.js +++ b/src/content-linter/lib/helpers/liquid-utils.js @@ -1,6 +1,6 @@ import { Tokenizer, TokenKind } from 'liquidjs' -import { deprecated } from '#src/versions/lib/enterprise-server-releases.js' +import { deprecated } from '@/versions/lib/enterprise-server-releases' const liquidTokenCache = new Map() diff --git a/src/content-linter/lib/init-test.js b/src/content-linter/lib/init-test.js index 91d637b05cf0..9e7aaf970021 100644 --- a/src/content-linter/lib/init-test.js +++ b/src/content-linter/lib/init-test.js @@ -1,6 +1,6 @@ import markdownlint from 'markdownlint' -import { defaultConfig } from './default-markdownlint-options.js' +import { defaultConfig } from './default-markdownlint-options' export async function runRule(module, { strings, files, ruleConfig, markdownlintOptions = {} }) { if ((!strings && !files) || (strings && files)) diff --git a/src/content-linter/lib/linting-rules/british-english-quotes.js b/src/content-linter/lib/linting-rules/british-english-quotes.js index 77eb0dec05e5..3154659ed348 100644 --- a/src/content-linter/lib/linting-rules/british-english-quotes.js +++ b/src/content-linter/lib/linting-rules/british-english-quotes.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import { getRange } from '../helpers/utils' +import frontmatter from '@/frame/lib/read-frontmatter' export const britishEnglishQuotes = { names: ['GHD048', 'british-english-quotes'], diff --git a/src/content-linter/lib/linting-rules/code-annotations.js b/src/content-linter/lib/linting-rules/code-annotations.js index ee45d51b3a7b..b06a0703ddd6 100644 --- a/src/content-linter/lib/linting-rules/code-annotations.js +++ b/src/content-linter/lib/linting-rules/code-annotations.js @@ -1,6 +1,6 @@ import { addError, filterTokens } from 'markdownlint-rule-helpers' -import { getFrontmatter } from '../helpers/utils.js' +import { getFrontmatter } from '../helpers/utils' export const codeAnnotations = { names: ['GHD007', 'code-annotations'], diff --git a/src/content-linter/lib/linting-rules/early-access-references.js b/src/content-linter/lib/linting-rules/early-access-references.js index 67839f9e1dc1..c9e6f1ca8b54 100644 --- a/src/content-linter/lib/linting-rules/early-access-references.js +++ b/src/content-linter/lib/linting-rules/early-access-references.js @@ -1,7 +1,7 @@ import { addError } from 'markdownlint-rule-helpers' import yaml from 'js-yaml' -import { getRange, getFrontmatter } from '../helpers/utils.js' +import { getRange, getFrontmatter } from '../helpers/utils' const ERROR_MESSAGE = 'An early access reference appears to be used in a non-early access doc. Remove early access references or disable this rule.' diff --git a/src/content-linter/lib/linting-rules/frontmatter-hidden-docs.js b/src/content-linter/lib/linting-rules/frontmatter-hidden-docs.js index 004ff1e1c6e0..73f07184ed99 100644 --- a/src/content-linter/lib/linting-rules/frontmatter-hidden-docs.js +++ b/src/content-linter/lib/linting-rules/frontmatter-hidden-docs.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { getFrontmatter } from '../helpers/utils.js' +import { getFrontmatter } from '../helpers/utils' export const frontmatterHiddenDocs = { names: ['GHD010', 'frontmatter-hidden-docs'], diff --git a/src/content-linter/lib/linting-rules/frontmatter-schema.js b/src/content-linter/lib/linting-rules/frontmatter-schema.js index 0ff82915421e..aa8c331e5bb7 100644 --- a/src/content-linter/lib/linting-rules/frontmatter-schema.js +++ b/src/content-linter/lib/linting-rules/frontmatter-schema.js @@ -1,10 +1,10 @@ import { addError } from 'markdownlint-rule-helpers' import { intersection } from 'lodash-es' -import { getFrontmatter } from '../helpers/utils.js' -import { formatAjvErrors } from '../helpers/schema-utils.js' -import { frontmatter, deprecatedProperties } from '#src/frame/lib/frontmatter.js' -import readFrontmatter from '#src/frame/lib/read-frontmatter.js' +import { getFrontmatter } from '../helpers/utils' +import { formatAjvErrors } from '../helpers/schema-utils' +import { frontmatter, deprecatedProperties } from '@/frame/lib/frontmatter' +import readFrontmatter from '@/frame/lib/read-frontmatter' export const frontmatterSchema = { names: ['GHD012', 'frontmatter-schema'], diff --git a/src/content-linter/lib/linting-rules/frontmatter-video-transcripts.js b/src/content-linter/lib/linting-rules/frontmatter-video-transcripts.js index c03ba2aad057..ed736a54cdfe 100644 --- a/src/content-linter/lib/linting-rules/frontmatter-video-transcripts.js +++ b/src/content-linter/lib/linting-rules/frontmatter-video-transcripts.js @@ -1,7 +1,7 @@ import { addError } from 'markdownlint-rule-helpers' import path from 'path' -import { getFrontmatter } from '../helpers/utils.js' +import { getFrontmatter } from '../helpers/utils' export const frontmatterVideoTranscripts = { names: ['GHD011', 'frontmatter-video-transcripts'], diff --git a/src/content-linter/lib/linting-rules/github-owned-action-references.js b/src/content-linter/lib/linting-rules/github-owned-action-references.js index 16f2f8e5c7ed..204bf2237153 100644 --- a/src/content-linter/lib/linting-rules/github-owned-action-references.js +++ b/src/content-linter/lib/linting-rules/github-owned-action-references.js @@ -1,6 +1,6 @@ import { addError, ellipsify } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' +import { getRange } from '../helpers/utils' /* This rule currently only checks for one hardcoded string but can be generalized in the future to check for strings that diff --git a/src/content-linter/lib/linting-rules/hardcoded-data-variable.js b/src/content-linter/lib/linting-rules/hardcoded-data-variable.js index 80ca7f48d0ec..08b72c20ddea 100644 --- a/src/content-linter/lib/linting-rules/hardcoded-data-variable.js +++ b/src/content-linter/lib/linting-rules/hardcoded-data-variable.js @@ -1,7 +1,7 @@ import { addError, ellipsify } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import { getRange } from '../helpers/utils' +import frontmatter from '@/frame/lib/read-frontmatter' /* This rule currently only checks for one hardcoded string but diff --git a/src/content-linter/lib/linting-rules/image-alt-text-end-punctuation.js b/src/content-linter/lib/linting-rules/image-alt-text-end-punctuation.js index 21db0a0949eb..829374722ef2 100644 --- a/src/content-linter/lib/linting-rules/image-alt-text-end-punctuation.js +++ b/src/content-linter/lib/linting-rules/image-alt-text-end-punctuation.js @@ -4,7 +4,7 @@ import { getRange, isStringQuoted, isStringPunctuated, -} from '../helpers/utils.js' +} from '../helpers/utils' export const imageAltTextEndPunctuation = { names: ['GHD032', 'image-alt-text-end-punctuation'], diff --git a/src/content-linter/lib/linting-rules/image-alt-text-exclude-start-words.js b/src/content-linter/lib/linting-rules/image-alt-text-exclude-start-words.js index 38af7daabcde..9e2bc4358829 100644 --- a/src/content-linter/lib/linting-rules/image-alt-text-exclude-start-words.js +++ b/src/content-linter/lib/linting-rules/image-alt-text-exclude-start-words.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { forEachInlineChild, getRange } from '../helpers/utils.js' +import { forEachInlineChild, getRange } from '../helpers/utils' const excludeStartWords = ['image', 'graphic'] diff --git a/src/content-linter/lib/linting-rules/image-alt-text-length.js b/src/content-linter/lib/linting-rules/image-alt-text-length.js index df149f21434c..80d2a04a5a99 100644 --- a/src/content-linter/lib/linting-rules/image-alt-text-length.js +++ b/src/content-linter/lib/linting-rules/image-alt-text-length.js @@ -1,8 +1,8 @@ import { addError } from 'markdownlint-rule-helpers' -import { liquid } from '#src/content-render/index.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { forEachInlineChild, getRange } from '../helpers/utils.js' +import { liquid } from '@/content-render/index' +import { allVersions } from '@/versions/lib/all-versions' +import { forEachInlineChild, getRange } from '../helpers/utils' export const incorrectAltTextLength = { names: ['GHD033', 'incorrect-alt-text-length'], diff --git a/src/content-linter/lib/linting-rules/image-file-kebab-case.js b/src/content-linter/lib/linting-rules/image-file-kebab-case.js index d0997ac6faf3..f7ce14a63af7 100644 --- a/src/content-linter/lib/linting-rules/image-file-kebab-case.js +++ b/src/content-linter/lib/linting-rules/image-file-kebab-case.js @@ -1,4 +1,4 @@ -import { addFixErrorDetail, forEachInlineChild } from '../helpers/utils.js' +import { addFixErrorDetail, forEachInlineChild } from '../helpers/utils' export const imageFileKebabCase = { names: ['GHD004', 'image-file-kebab-case'], diff --git a/src/content-linter/lib/linting-rules/image-no-gif.js b/src/content-linter/lib/linting-rules/image-no-gif.js index 70e3f2954d1b..bdd0a8a7fbdb 100644 --- a/src/content-linter/lib/linting-rules/image-no-gif.js +++ b/src/content-linter/lib/linting-rules/image-no-gif.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { forEachInlineChild } from '../helpers/utils.js' +import { forEachInlineChild } from '../helpers/utils' export const imageNoGif = { names: ['GHD036', 'image-no-gif'], diff --git a/src/content-linter/lib/linting-rules/index.js b/src/content-linter/lib/linting-rules/index.js index b3b7de2f0e49..dc47e77a4b61 100644 --- a/src/content-linter/lib/linting-rules/index.js +++ b/src/content-linter/lib/linting-rules/index.js @@ -1,45 +1,42 @@ import searchReplace from 'markdownlint-rule-search-replace' import markdownlintGitHub from '@github/markdownlint-github' -import { codeFenceLineLength } from './code-fence-line-length.js' -import { imageAltTextEndPunctuation } from './image-alt-text-end-punctuation.js' -import { imageFileKebabCase } from './image-file-kebab-case.js' -import { incorrectAltTextLength } from './image-alt-text-length.js' -import { internalLinksNoLang } from './internal-links-no-lang.js' -import { internalLinksSlash } from './internal-links-slash.js' -import { imageAltTextExcludeStartWords } from './image-alt-text-exclude-start-words.js' -import { listFirstWordCapitalization } from './list-first-word-capitalization.js' -import { linkPunctuation } from './link-punctuation.js' -import { - earlyAccessReferences, - frontmatterEarlyAccessReferences, -} from './early-access-references.js' -import { frontmatterHiddenDocs } from './frontmatter-hidden-docs.js' -import { frontmatterVideoTranscripts } from './frontmatter-video-transcripts.js' -import { yamlScheduledJobs } from './yaml-scheduled-jobs.js' -import { internalLinksOldVersion } from './internal-links-old-version.js' -import { hardcodedDataVariable } from './hardcoded-data-variable.js' -import { githubOwnedActionReferences } from './github-owned-action-references.js' -import { liquidQuotedConditionalArg } from './liquid-quoted-conditional-arg.js' -import { liquidDataReferencesDefined, liquidDataTagFormat } from './liquid-data-tags.js' -import { frontmatterSchema } from './frontmatter-schema.js' -import { codeAnnotations } from './code-annotations.js' -import { codeAnnotationCommentSpacing } from './code-annotation-comment-spacing.js' -import { frontmatterLiquidSyntax, liquidSyntax } from './liquid-syntax.js' -import { liquidIfTags, liquidIfVersionTags } from './liquid-versioning.js' -import { raiReusableUsage } from './rai-reusable-usage.js' -import { imageNoGif } from './image-no-gif.js' -import { expiredContent, expiringSoon } from './expired-content.js' -import { tableLiquidVersioning } from './table-liquid-versioning.js' -import { tableColumnIntegrity } from './table-column-integrity.js' -import { thirdPartyActionPinning } from './third-party-action-pinning.js' -import { liquidTagWhitespace } from './liquid-tag-whitespace.js' -import { linkQuotation } from './link-quotation.js' -import { octiconAriaLabels } from './octicon-aria-labels.js' -import { liquidIfversionVersions } from './liquid-ifversion-versions.js' -import { britishEnglishQuotes } from './british-english-quotes.js' -import { multipleEmphasisPatterns } from './multiple-emphasis-patterns.js' -import { noteWarningFormatting } from './note-warning-formatting.js' +import { codeFenceLineLength } from './code-fence-line-length' +import { imageAltTextEndPunctuation } from './image-alt-text-end-punctuation' +import { imageFileKebabCase } from './image-file-kebab-case' +import { incorrectAltTextLength } from './image-alt-text-length' +import { internalLinksNoLang } from './internal-links-no-lang' +import { internalLinksSlash } from './internal-links-slash' +import { imageAltTextExcludeStartWords } from './image-alt-text-exclude-start-words' +import { listFirstWordCapitalization } from './list-first-word-capitalization' +import { linkPunctuation } from './link-punctuation' +import { earlyAccessReferences, frontmatterEarlyAccessReferences } from './early-access-references' +import { frontmatterHiddenDocs } from './frontmatter-hidden-docs' +import { frontmatterVideoTranscripts } from './frontmatter-video-transcripts' +import { yamlScheduledJobs } from './yaml-scheduled-jobs' +import { internalLinksOldVersion } from './internal-links-old-version' +import { hardcodedDataVariable } from './hardcoded-data-variable' +import { githubOwnedActionReferences } from './github-owned-action-references' +import { liquidQuotedConditionalArg } from './liquid-quoted-conditional-arg' +import { liquidDataReferencesDefined, liquidDataTagFormat } from './liquid-data-tags' +import { frontmatterSchema } from './frontmatter-schema' +import { codeAnnotations } from './code-annotations' +import { codeAnnotationCommentSpacing } from './code-annotation-comment-spacing' +import { frontmatterLiquidSyntax, liquidSyntax } from './liquid-syntax' +import { liquidIfTags, liquidIfVersionTags } from './liquid-versioning' +import { raiReusableUsage } from './rai-reusable-usage' +import { imageNoGif } from './image-no-gif' +import { expiredContent, expiringSoon } from './expired-content' +import { tableLiquidVersioning } from './table-liquid-versioning' +import { tableColumnIntegrity } from './table-column-integrity' +import { thirdPartyActionPinning } from './third-party-action-pinning' +import { liquidTagWhitespace } from './liquid-tag-whitespace' +import { linkQuotation } from './link-quotation' +import { octiconAriaLabels } from './octicon-aria-labels' +import { liquidIfversionVersions } from './liquid-ifversion-versions' +import { britishEnglishQuotes } from './british-english-quotes' +import { multipleEmphasisPatterns } from './multiple-emphasis-patterns' +import { noteWarningFormatting } from './note-warning-formatting' const noDefaultAltText = markdownlintGitHub.find((elem) => elem.names.includes('no-default-alt-text'), diff --git a/src/content-linter/lib/linting-rules/internal-links-no-lang.js b/src/content-linter/lib/linting-rules/internal-links-no-lang.js index 338e654fb11a..e6746eb8c99d 100644 --- a/src/content-linter/lib/linting-rules/internal-links-no-lang.js +++ b/src/content-linter/lib/linting-rules/internal-links-no-lang.js @@ -1,7 +1,7 @@ import { filterTokens } from 'markdownlint-rule-helpers' -import { addFixErrorDetail, getRange } from '../helpers/utils.js' -import { allLanguageKeys } from '#src/languages/lib/languages.ts' +import { addFixErrorDetail, getRange } from '../helpers/utils' +import { allLanguageKeys } from '@/languages/lib/languages' export const internalLinksNoLang = { names: ['GHD002', 'internal-links-no-lang'], diff --git a/src/content-linter/lib/linting-rules/internal-links-old-version.js b/src/content-linter/lib/linting-rules/internal-links-old-version.js index d789734555ba..f9e90f8c0c9c 100644 --- a/src/content-linter/lib/linting-rules/internal-links-old-version.js +++ b/src/content-linter/lib/linting-rules/internal-links-old-version.js @@ -1,6 +1,6 @@ import { addError, filterTokens } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' +import { getRange } from '../helpers/utils' export const internalLinksOldVersion = { names: ['GHD006', 'internal-links-old-version'], diff --git a/src/content-linter/lib/linting-rules/internal-links-slash.js b/src/content-linter/lib/linting-rules/internal-links-slash.js index 48eaaabf646a..57fe0748e910 100644 --- a/src/content-linter/lib/linting-rules/internal-links-slash.js +++ b/src/content-linter/lib/linting-rules/internal-links-slash.js @@ -1,6 +1,6 @@ import { filterTokens } from 'markdownlint-rule-helpers' -import { addFixErrorDetail, getRange } from '../helpers/utils.js' +import { addFixErrorDetail, getRange } from '../helpers/utils' export const internalLinksSlash = { names: ['GHD003', 'internal-links-slash'], diff --git a/src/content-linter/lib/linting-rules/link-punctuation.js b/src/content-linter/lib/linting-rules/link-punctuation.js index 3a4fe6ccb403..669f34944807 100644 --- a/src/content-linter/lib/linting-rules/link-punctuation.js +++ b/src/content-linter/lib/linting-rules/link-punctuation.js @@ -1,6 +1,6 @@ import { addError, filterTokens } from 'markdownlint-rule-helpers' -import { doesStringEndWithPeriod, getRange, isStringQuoted } from '../helpers/utils.js' +import { doesStringEndWithPeriod, getRange, isStringQuoted } from '../helpers/utils' export const linkPunctuation = { names: ['GHD001', 'link-punctuation'], diff --git a/src/content-linter/lib/linting-rules/link-quotation.js b/src/content-linter/lib/linting-rules/link-quotation.js index 6d6db6bcf8cd..4fd2ce623d37 100644 --- a/src/content-linter/lib/linting-rules/link-quotation.js +++ b/src/content-linter/lib/linting-rules/link-quotation.js @@ -1,5 +1,5 @@ import { addError, filterTokens } from 'markdownlint-rule-helpers' -import { getRange, quotePrecedesLinkOpen } from '../helpers/utils.js' +import { getRange, quotePrecedesLinkOpen } from '../helpers/utils' import { escapeRegExp } from 'lodash-es' export const linkQuotation = { diff --git a/src/content-linter/lib/linting-rules/liquid-data-tags.js b/src/content-linter/lib/linting-rules/liquid-data-tags.js index 3a29c4b2e0b7..66ef3b17550b 100644 --- a/src/content-linter/lib/linting-rules/liquid-data-tags.js +++ b/src/content-linter/lib/linting-rules/liquid-data-tags.js @@ -1,13 +1,13 @@ import { TokenKind } from 'liquidjs' import { addError } from 'markdownlint-rule-helpers' -import { getDataByLanguage } from '#src/data-directory/lib/get-data.js' +import { getDataByLanguage } from '@/data-directory/lib/get-data' import { getLiquidTokens, getPositionData, OUTPUT_OPEN, OUTPUT_CLOSE, -} from '../helpers/liquid-utils.js' +} from '../helpers/liquid-utils' /* Checks for instances where a Liquid data or indented_data_reference diff --git a/src/content-linter/lib/linting-rules/liquid-ifversion-versions.js b/src/content-linter/lib/linting-rules/liquid-ifversion-versions.js index 8f6359b74f9a..2280983f76ca 100644 --- a/src/content-linter/lib/linting-rules/liquid-ifversion-versions.js +++ b/src/content-linter/lib/linting-rules/liquid-ifversion-versions.js @@ -5,18 +5,18 @@ import { getPositionData, getContentDeleteData, getSimplifiedSemverRange, -} from '../helpers/liquid-utils.js' -import { getFrontmatter, getFrontmatterLines } from '../helpers/utils.js' -import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' +} from '../helpers/liquid-utils' +import { getFrontmatter, getFrontmatterLines } from '../helpers/utils' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import { allVersions } from '@/versions/lib/all-versions' import { difference } from 'lodash-es' -import { convertVersionsToFrontmatter } from '#src/automated-pipelines/lib/update-markdown.js' +import { convertVersionsToFrontmatter } from '@/automated-pipelines/lib/update-markdown' import { isAllVersions, getFeatureVersionsObject, isInAllGhes, -} from '#src/ghes-releases/scripts/version-utils.js' -import { deprecated, oldestSupported } from '#src/versions/lib/enterprise-server-releases.js' +} from '@/ghes-releases/scripts/version-utils' +import { deprecated, oldestSupported } from '@/versions/lib/enterprise-server-releases' export const liquidIfversionVersions = { names: ['GHD022', 'liquid-ifversion-versions'], diff --git a/src/content-linter/lib/linting-rules/liquid-quoted-conditional-arg.js b/src/content-linter/lib/linting-rules/liquid-quoted-conditional-arg.js index b9484b922277..bb47dda2bbc9 100644 --- a/src/content-linter/lib/linting-rules/liquid-quoted-conditional-arg.js +++ b/src/content-linter/lib/linting-rules/liquid-quoted-conditional-arg.js @@ -1,8 +1,8 @@ import { TokenKind } from 'liquidjs' import { addError } from 'markdownlint-rule-helpers' -import { getLiquidTokens, conditionalTags, getPositionData } from '../helpers/liquid-utils.js' -import { isStringQuoted } from '../helpers/utils.js' +import { getLiquidTokens, conditionalTags, getPositionData } from '../helpers/liquid-utils' +import { isStringQuoted } from '../helpers/utils' /* Checks for instances where a Liquid conditional tag's argument is diff --git a/src/content-linter/lib/linting-rules/liquid-syntax.js b/src/content-linter/lib/linting-rules/liquid-syntax.js index 58f90172c60d..d84e4d62bdf6 100644 --- a/src/content-linter/lib/linting-rules/liquid-syntax.js +++ b/src/content-linter/lib/linting-rules/liquid-syntax.js @@ -1,8 +1,8 @@ import { addError } from 'markdownlint-rule-helpers' -import { getFrontmatter } from '../helpers/utils.js' -import { liquid } from '#src/content-render/index.js' -import { isLiquidError } from '#src/languages/lib/render-with-fallback.js' +import { getFrontmatter } from '../helpers/utils' +import { liquid } from '@/content-render/index' +import { isLiquidError } from '@/languages/lib/render-with-fallback' /* Attempts to parse all liquid in the frontmatter of a file diff --git a/src/content-linter/lib/linting-rules/liquid-tag-whitespace.js b/src/content-linter/lib/linting-rules/liquid-tag-whitespace.js index 9abaa94913c7..62b5d90df622 100644 --- a/src/content-linter/lib/linting-rules/liquid-tag-whitespace.js +++ b/src/content-linter/lib/linting-rules/liquid-tag-whitespace.js @@ -1,7 +1,7 @@ import { TokenKind } from 'liquidjs' -import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js' -import { addFixErrorDetail } from '../helpers/utils.js' +import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils' +import { addFixErrorDetail } from '../helpers/utils' /* Liquid tags should start and end with one whitespace. For example: diff --git a/src/content-linter/lib/linting-rules/liquid-versioning.js b/src/content-linter/lib/linting-rules/liquid-versioning.js index 249ff4e29bb4..86563f5d7a67 100644 --- a/src/content-linter/lib/linting-rules/liquid-versioning.js +++ b/src/content-linter/lib/linting-rules/liquid-versioning.js @@ -2,18 +2,13 @@ import semver from 'semver' import { TokenKind } from 'liquidjs' import { addError } from 'markdownlint-rule-helpers' -import { getRange, addFixErrorDetail } from '../helpers/utils.js' -import { allVersions, allVersionShortnames } from '#src/versions/lib/all-versions.ts' -import { - supported, - next, - nextNext, - deprecated, -} from '#src/versions/lib/enterprise-server-releases.js' -import allowedVersionOperators from '#src/content-render/liquid/ifversion-supported-operators.js' -import { getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js' -import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js' -import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js' +import { getRange, addFixErrorDetail } from '../helpers/utils' +import { allVersions, allVersionShortnames } from '@/versions/lib/all-versions' +import { supported, next, nextNext, deprecated } from '@/versions/lib/enterprise-server-releases' +import allowedVersionOperators from '@/content-render/liquid/ifversion-supported-operators' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils' const allShortnames = Object.keys(allVersionShortnames) const getAllPossibleVersionNames = memoize(() => { diff --git a/src/content-linter/lib/linting-rules/list-first-word-capitalization.js b/src/content-linter/lib/linting-rules/list-first-word-capitalization.js index 43c8b16ee91f..8d79bd12c9bd 100644 --- a/src/content-linter/lib/linting-rules/list-first-word-capitalization.js +++ b/src/content-linter/lib/linting-rules/list-first-word-capitalization.js @@ -1,4 +1,4 @@ -import { addFixErrorDetail, getRange, filterTokensByOrder } from '../helpers/utils.js' +import { addFixErrorDetail, getRange, filterTokensByOrder } from '../helpers/utils' export const listFirstWordCapitalization = { names: ['GHD034', 'list-first-word-capitalization'], diff --git a/src/content-linter/lib/linting-rules/multiple-emphasis-patterns.js b/src/content-linter/lib/linting-rules/multiple-emphasis-patterns.js index b02839ff91f2..5e02edd74b1e 100644 --- a/src/content-linter/lib/linting-rules/multiple-emphasis-patterns.js +++ b/src/content-linter/lib/linting-rules/multiple-emphasis-patterns.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import { getRange } from '../helpers/utils' +import frontmatter from '@/frame/lib/read-frontmatter' export const multipleEmphasisPatterns = { names: ['GHD050', 'multiple-emphasis-patterns'], diff --git a/src/content-linter/lib/linting-rules/note-warning-formatting.js b/src/content-linter/lib/linting-rules/note-warning-formatting.js index 37abecd8205e..3c54f24c62e5 100644 --- a/src/content-linter/lib/linting-rules/note-warning-formatting.js +++ b/src/content-linter/lib/linting-rules/note-warning-formatting.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import { getRange } from '../helpers/utils' +import frontmatter from '@/frame/lib/read-frontmatter' export const noteWarningFormatting = { names: ['GHD049', 'note-warning-formatting'], diff --git a/src/content-linter/lib/linting-rules/octicon-aria-labels.js b/src/content-linter/lib/linting-rules/octicon-aria-labels.js index 29eeed87c07e..243167e9cde2 100644 --- a/src/content-linter/lib/linting-rules/octicon-aria-labels.js +++ b/src/content-linter/lib/linting-rules/octicon-aria-labels.js @@ -1,6 +1,6 @@ import { TokenKind } from 'liquidjs' -import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js' -import { addFixErrorDetail } from '../helpers/utils.js' +import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils' +import { addFixErrorDetail } from '../helpers/utils' /* Octicons should always have an aria-label attribute even if aria hidden. For example: diff --git a/src/content-linter/lib/linting-rules/rai-reusable-usage.js b/src/content-linter/lib/linting-rules/rai-reusable-usage.js index dcaf30dfab01..0eb6156bd9c6 100644 --- a/src/content-linter/lib/linting-rules/rai-reusable-usage.js +++ b/src/content-linter/lib/linting-rules/rai-reusable-usage.js @@ -2,8 +2,8 @@ import { addError } from 'markdownlint-rule-helpers' import { TokenKind } from 'liquidjs' import path from 'path' -import { getFrontmatter } from '../helpers/utils.js' -import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils.js' +import { getFrontmatter } from '../helpers/utils' +import { getLiquidTokens, getPositionData } from '../helpers/liquid-utils' export const raiReusableUsage = { names: ['GHD035', 'rai-reusable-usage'], diff --git a/src/content-linter/lib/linting-rules/table-column-integrity.js b/src/content-linter/lib/linting-rules/table-column-integrity.js index ca437b8557a3..8456f2aec38e 100644 --- a/src/content-linter/lib/linting-rules/table-column-integrity.js +++ b/src/content-linter/lib/linting-rules/table-column-integrity.js @@ -1,6 +1,6 @@ import { addError } from 'markdownlint-rule-helpers' -import { getRange } from '../helpers/utils.js' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import { getRange } from '../helpers/utils' +import frontmatter from '@/frame/lib/read-frontmatter' // Regex to detect table rows (must start with |, contain at least one more |, and end with optional whitespace) const TABLE_ROW_REGEX = /^\s*\|.*\|\s*$/ diff --git a/src/content-linter/lib/linting-rules/third-party-action-pinning.js b/src/content-linter/lib/linting-rules/third-party-action-pinning.js index bc56d73a48dc..78cffe7165ea 100644 --- a/src/content-linter/lib/linting-rules/third-party-action-pinning.js +++ b/src/content-linter/lib/linting-rules/third-party-action-pinning.js @@ -1,8 +1,8 @@ import yaml from 'js-yaml' import { addError, filterTokens } from 'markdownlint-rule-helpers' -import { liquid } from '#src/content-render/index.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { liquid } from '@/content-render/index' +import { allVersions } from '@/versions/lib/all-versions' // Detects third-party actions in the format `owner/repo@ref` const actionRegex = /[\w-]+\/[\w-]+@[\w-]+/ diff --git a/src/content-linter/lib/linting-rules/yaml-scheduled-jobs.js b/src/content-linter/lib/linting-rules/yaml-scheduled-jobs.js index 640b503552d4..3013d25e4b9c 100644 --- a/src/content-linter/lib/linting-rules/yaml-scheduled-jobs.js +++ b/src/content-linter/lib/linting-rules/yaml-scheduled-jobs.js @@ -1,8 +1,8 @@ import yaml from 'js-yaml' import { addError, filterTokens } from 'markdownlint-rule-helpers' -import { liquid } from '#src/content-render/index.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { liquid } from '@/content-render/index' +import { allVersions } from '@/versions/lib/all-versions' const scheduledYamlJobs = [] diff --git a/src/content-linter/scripts/find-unsed-variables.ts b/src/content-linter/scripts/find-unsed-variables.ts index 0e78e03d1ffc..2e6a5560b8fc 100644 --- a/src/content-linter/scripts/find-unsed-variables.ts +++ b/src/content-linter/scripts/find-unsed-variables.ts @@ -19,12 +19,12 @@ import yaml from 'js-yaml' import { program } from 'commander' -import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data.js' +import { loadPages, loadUnversionedTree } from '@/frame/lib/page-data' import { TokenizationError } from 'liquidjs' -import readFrontmatter from '@/frame/lib/read-frontmatter.js' -import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' -import walkFiles from '@/workflows/walk-files.js' +import readFrontmatter from '@/frame/lib/read-frontmatter' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils' +import walkFiles from '@/workflows/walk-files' program .description('Finds unused variables in frontmatter, content, and reusables') diff --git a/src/content-linter/scripts/generate-docs.ts b/src/content-linter/scripts/generate-docs.ts index 4c25adef8db9..ca306bcae69b 100644 --- a/src/content-linter/scripts/generate-docs.ts +++ b/src/content-linter/scripts/generate-docs.ts @@ -1,6 +1,6 @@ import { writeFileSync } from 'fs' -import type { Rule, Config } from '../types.ts' -import { allRules, allConfig } from '../lib/helpers/get-rules.js' +import type { Rule, Config } from '../types' +import { allRules, allConfig } from '../lib/helpers/get-rules' main() diff --git a/src/content-linter/scripts/lint-content.js b/src/content-linter/scripts/lint-content.js index b25c87fdc531..ac9365ff6152 100755 --- a/src/content-linter/scripts/lint-content.js +++ b/src/content-linter/scripts/lint-content.js @@ -7,14 +7,14 @@ import { applyFixes } from 'markdownlint-rule-helpers' import boxen from 'boxen' import ora from 'ora' -import walkFiles from '#src/workflows/walk-files.ts' -import { allConfig, allRules, customRules } from '../lib/helpers/get-rules.js' -import { customConfig, githubDocsFrontmatterConfig } from '../style/github-docs.js' -import { defaultConfig } from '../lib/default-markdownlint-options.js' -import { prettyPrintResults } from './pretty-print-results.js' -import { getLintableYml } from '#src/content-linter/lib/helpers/get-lintable-yml.js' -import { printAnnotationResults } from '../lib/helpers/print-annotations.js' -import languages from '#src/languages/lib/languages.ts' +import walkFiles from '@/workflows/walk-files' +import { allConfig, allRules, customRules } from '../lib/helpers/get-rules' +import { customConfig, githubDocsFrontmatterConfig } from '../style/github-docs' +import { defaultConfig } from '../lib/default-markdownlint-options' +import { prettyPrintResults } from './pretty-print-results' +import { getLintableYml } from '@/content-linter/lib/helpers/get-lintable-yml' +import { printAnnotationResults } from '../lib/helpers/print-annotations' +import languages from '@/languages/lib/languages' program .description('Run GitHub Docs Markdownlint rules.') diff --git a/src/content-linter/scripts/lint-report.js b/src/content-linter/scripts/lint-report.js index 24961cdb7014..306db8bec2ce 100644 --- a/src/content-linter/scripts/lint-report.js +++ b/src/content-linter/scripts/lint-report.js @@ -2,10 +2,10 @@ import { program } from 'commander' import fs from 'fs' import coreLib from '@actions/core' -import github from '#src/workflows/github.ts' -import { getEnvInputs } from '#src/workflows/get-env-inputs.ts' -import { createReportIssue, linkReports } from '#src/workflows/issue-report.js' -import { reportingConfig } from '#src/content-linter/style/github-docs.js' +import github from '@/workflows/github' +import { getEnvInputs } from '@/workflows/get-env-inputs' +import { createReportIssue, linkReports } from '@/workflows/issue-report' +import { reportingConfig } from '@/content-linter/style/github-docs' // GitHub issue body size limit is ~65k characters, so we'll use 60k as a safe limit const MAX_ISSUE_BODY_SIZE = 60000 diff --git a/src/content-linter/tests/category-pages.ts b/src/content-linter/tests/category-pages.ts index fb25caf74868..dc3773960cb0 100644 --- a/src/content-linter/tests/category-pages.ts +++ b/src/content-linter/tests/category-pages.ts @@ -8,12 +8,12 @@ import GithubSlugger from 'github-slugger' import { decode } from 'html-entities' import { beforeAll, describe, expect, test } from 'vitest' -import matter from '@/frame/lib/read-frontmatter.js' -import { renderContent } from '@/content-render/index.js' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' +import matter from '@/frame/lib/read-frontmatter' +import { renderContent } from '@/content-render/index' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' import contextualize from '@/frame/middleware/context/context' -import shortVersions from '@/versions/middleware/short-versions.js' -import { ROOT } from '@/frame/lib/constants.js' +import shortVersions from '@/versions/middleware/short-versions' +import { ROOT } from '@/frame/lib/constants' import type { Context, ExtendedRequest, MarkdownFrontmatter } from '@/types' const slugger = new GithubSlugger() diff --git a/src/content-linter/tests/learning-track-liquid.js b/src/content-linter/tests/learning-track-liquid.js index efdfc27b6ee1..b71a4b997a88 100644 --- a/src/content-linter/tests/learning-track-liquid.js +++ b/src/content-linter/tests/learning-track-liquid.js @@ -4,7 +4,7 @@ import { readFile } from 'fs/promises' import walk from 'walk-sync' import { beforeAll, describe, expect, test } from 'vitest' -import { liquid } from '#src/content-render/index.js' +import { liquid } from '@/content-render/index' const learningTrackRootPath = 'data/learning-tracks' const yamlWalkOptions = { diff --git a/src/content-linter/tests/lint-files.js b/src/content-linter/tests/lint-files.js index ae5daec88d73..6d517e7f00b4 100755 --- a/src/content-linter/tests/lint-files.js +++ b/src/content-linter/tests/lint-files.js @@ -8,8 +8,8 @@ import walk from 'walk-sync' import { zip } from 'lodash-es' import { beforeAll, describe, expect, test } from 'vitest' -import languages from '#src/languages/lib/languages.ts' -import { getDiffFiles } from '../lib/diff-files.js' +import languages from '@/languages/lib/languages' +import { getDiffFiles } from '../lib/diff-files' const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/src/content-linter/tests/lint-frontmatter-links.js b/src/content-linter/tests/lint-frontmatter-links.js index 39f7daa74c83..265da6670570 100644 --- a/src/content-linter/tests/lint-frontmatter-links.js +++ b/src/content-linter/tests/lint-frontmatter-links.js @@ -1,8 +1,8 @@ import { describe, expect, test } from 'vitest' -import { loadPages, loadPageMap } from '#src/frame/lib/page-data.js' -import loadRedirects from '#src/redirects/lib/precompile.js' -import { checkURL } from '#src/tests/helpers/check-url.js' +import { loadPages, loadPageMap } from '@/frame/lib/page-data' +import loadRedirects from '@/redirects/lib/precompile' +import { checkURL } from '@/tests/helpers/check-url' const pageList = await loadPages(undefined, ['en']) const pages = await loadPageMap(pageList) diff --git a/src/content-linter/tests/site-data-references.js b/src/content-linter/tests/site-data-references.js index 8e040b094064..4cca081f5179 100644 --- a/src/content-linter/tests/site-data-references.js +++ b/src/content-linter/tests/site-data-references.js @@ -2,8 +2,8 @@ import path from 'path' import { isEqual, uniqWith } from 'lodash-es' import { describe, expect, test, vi } from 'vitest' -import patterns from '#src/frame/lib/patterns.js' -import { getDataByLanguage, getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js' +import patterns from '@/frame/lib/patterns' +import { getDataByLanguage, getDeepDataByLanguage } from '@/data-directory/lib/get-data' // Given syntax like {% data foo.bar %} or {% indented_data_reference foo.bar spaces=3 %}, // the following regex returns just the dotted path: foo.bar diff --git a/src/content-linter/tests/unit/british-english-quotes.js b/src/content-linter/tests/unit/british-english-quotes.js index 2c1404591e32..6e338c578b4d 100644 --- a/src/content-linter/tests/unit/british-english-quotes.js +++ b/src/content-linter/tests/unit/british-english-quotes.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { britishEnglishQuotes } from '../../lib/linting-rules/british-english-quotes.js' +import { runRule } from '../../lib/init-test' +import { britishEnglishQuotes } from '../../lib/linting-rules/british-english-quotes' describe(britishEnglishQuotes.names.join(' - '), () => { test('Correct American English punctuation passes', async () => { diff --git a/src/content-linter/tests/unit/code-annotation-comment-spacing.js b/src/content-linter/tests/unit/code-annotation-comment-spacing.js index bcf08fa011d5..b042715498c9 100644 --- a/src/content-linter/tests/unit/code-annotation-comment-spacing.js +++ b/src/content-linter/tests/unit/code-annotation-comment-spacing.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { codeAnnotationCommentSpacing } from '../../lib/linting-rules/code-annotation-comment-spacing.js' +import { runRule } from '../../lib/init-test' +import { codeAnnotationCommentSpacing } from '../../lib/linting-rules/code-annotation-comment-spacing' describe(codeAnnotationCommentSpacing.names.join(' - '), () => { test('correctly formatted comments pass', async () => { diff --git a/src/content-linter/tests/unit/code-annotations.js b/src/content-linter/tests/unit/code-annotations.js index 44bca5ca14a6..d05fc26b4d05 100644 --- a/src/content-linter/tests/unit/code-annotations.js +++ b/src/content-linter/tests/unit/code-annotations.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { codeAnnotations } from '../../lib/linting-rules/code-annotations.js' +import { runRule } from '../../lib/init-test' +import { codeAnnotations } from '../../lib/linting-rules/code-annotations' describe(codeAnnotations.names.join(' - '), () => { test('No layout property fails', async () => { diff --git a/src/content-linter/tests/unit/code-fence-line-length.js b/src/content-linter/tests/unit/code-fence-line-length.js index 4790d49a5792..26961b8dea81 100644 --- a/src/content-linter/tests/unit/code-fence-line-length.js +++ b/src/content-linter/tests/unit/code-fence-line-length.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { codeFenceLineLength } from '../../lib/linting-rules/code-fence-line-length.js' +import { runRule } from '../../lib/init-test' +import { codeFenceLineLength } from '../../lib/linting-rules/code-fence-line-length' describe(codeFenceLineLength.names.join(' - '), () => { test('line length of max + 1 fails', async () => { diff --git a/src/content-linter/tests/unit/early-access-references.js b/src/content-linter/tests/unit/early-access-references.js index 437b03fbeb87..00a8bf6bcc5b 100644 --- a/src/content-linter/tests/unit/early-access-references.js +++ b/src/content-linter/tests/unit/early-access-references.js @@ -1,10 +1,10 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' +import { runRule } from '../../lib/init-test' import { earlyAccessReferences, frontmatterEarlyAccessReferences, -} from '../../lib/linting-rules/early-access-references.js' +} from '../../lib/linting-rules/early-access-references' const FIXTURE_FILEPATH_NON_EA = 'src/content-linter/tests/fixtures/not-secret.md' const FIXTURE_FILEPATH_EA = 'src/content-linter/tests/fixtures/early-access/secret.md' diff --git a/src/content-linter/tests/unit/expired-content.js b/src/content-linter/tests/unit/expired-content.js index 72808f375938..cb46c9f304a2 100644 --- a/src/content-linter/tests/unit/expired-content.js +++ b/src/content-linter/tests/unit/expired-content.js @@ -1,11 +1,11 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' +import { runRule } from '../../lib/init-test' import { expiredContent, expiringSoon, DAYS_TO_WARN_BEFORE_EXPIRED, -} from '../../lib/linting-rules/expired-content.js' +} from '../../lib/linting-rules/expired-content' describe(expiredContent.names.join(' - '), () => { test('Date in the past triggers error', async () => { diff --git a/src/content-linter/tests/unit/frontmatter-hidden-docs.js b/src/content-linter/tests/unit/frontmatter-hidden-docs.js index 659f13c12ea7..df74a358cbf5 100644 --- a/src/content-linter/tests/unit/frontmatter-hidden-docs.js +++ b/src/content-linter/tests/unit/frontmatter-hidden-docs.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { frontmatterHiddenDocs } from '../../lib/linting-rules/frontmatter-hidden-docs.js' +import { runRule } from '../../lib/init-test' +import { frontmatterHiddenDocs } from '../../lib/linting-rules/frontmatter-hidden-docs' const ACTIONS_FIXTURE = 'src/content-linter/tests/fixtures/actions/hidden.md' const EARLY_ACCESS_FIXTURE = 'src/fixtures/fixtures/content/early-access/secrets/early-days.md' diff --git a/src/content-linter/tests/unit/frontmatter-schema.js b/src/content-linter/tests/unit/frontmatter-schema.js index f909ae8950f7..55b62cfafe04 100644 --- a/src/content-linter/tests/unit/frontmatter-schema.js +++ b/src/content-linter/tests/unit/frontmatter-schema.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { frontmatterSchema } from '../../lib/linting-rules/frontmatter-schema.js' +import { runRule } from '../../lib/init-test' +import { frontmatterSchema } from '../../lib/linting-rules/frontmatter-schema' // Configure the test figure to not split frontmatter and content const fmOptions = { markdownlintOptions: { frontMatter: null } } diff --git a/src/content-linter/tests/unit/frontmatter-video-transcripts.js b/src/content-linter/tests/unit/frontmatter-video-transcripts.js index 5b22da896873..914730a3d335 100644 --- a/src/content-linter/tests/unit/frontmatter-video-transcripts.js +++ b/src/content-linter/tests/unit/frontmatter-video-transcripts.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { frontmatterVideoTranscripts } from '../../lib/linting-rules/frontmatter-video-transcripts.js' +import { runRule } from '../../lib/init-test' +import { frontmatterVideoTranscripts } from '../../lib/linting-rules/frontmatter-video-transcripts' const GOOD_FIXTURE_LANDING = 'src/content-linter/tests/fixtures/actions/index.md' const BAD_FIXTURE_LANDING = 'src/content-linter/tests/fixtures/early-access/index.md' diff --git a/src/content-linter/tests/unit/github-owned-action-references.js b/src/content-linter/tests/unit/github-owned-action-references.js index 44680913f6c9..c502cb87ec9f 100644 --- a/src/content-linter/tests/unit/github-owned-action-references.js +++ b/src/content-linter/tests/unit/github-owned-action-references.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { githubOwnedActionReferences } from '../../lib/linting-rules/github-owned-action-references.js' +import { runRule } from '../../lib/init-test' +import { githubOwnedActionReferences } from '../../lib/linting-rules/github-owned-action-references' describe(githubOwnedActionReferences.names.join(' - '), () => { test('Using hardcoded GitHub-owned actions causes error', async () => { diff --git a/src/content-linter/tests/unit/hardcoded-data-variable.js b/src/content-linter/tests/unit/hardcoded-data-variable.js index 7703ae3974b3..9ecce111241f 100644 --- a/src/content-linter/tests/unit/hardcoded-data-variable.js +++ b/src/content-linter/tests/unit/hardcoded-data-variable.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { hardcodedDataVariable } from '../../lib/linting-rules/hardcoded-data-variable.js' +import { runRule } from '../../lib/init-test' +import { hardcodedDataVariable } from '../../lib/linting-rules/hardcoded-data-variable' describe(hardcodedDataVariable.names.join(' - '), () => { test('Using hardcoded personal access token string causes error', async () => { diff --git a/src/content-linter/tests/unit/image-alt-text-end-punctuation.js b/src/content-linter/tests/unit/image-alt-text-end-punctuation.js index 04a50f614a4e..c4e05da23279 100644 --- a/src/content-linter/tests/unit/image-alt-text-end-punctuation.js +++ b/src/content-linter/tests/unit/image-alt-text-end-punctuation.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { imageAltTextEndPunctuation } from '../../lib/linting-rules/image-alt-text-end-punctuation.js' +import { runRule } from '../../lib/init-test' +import { imageAltTextEndPunctuation } from '../../lib/linting-rules/image-alt-text-end-punctuation' describe(imageAltTextEndPunctuation.names.join(' - '), () => { test('image alt text without end punctuation errors', async () => { diff --git a/src/content-linter/tests/unit/image-alt-text-exclude-start-words.js b/src/content-linter/tests/unit/image-alt-text-exclude-start-words.js index 819290f98194..7b2bdac0f7b1 100644 --- a/src/content-linter/tests/unit/image-alt-text-exclude-start-words.js +++ b/src/content-linter/tests/unit/image-alt-text-exclude-start-words.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { imageAltTextExcludeStartWords } from '../../lib/linting-rules/image-alt-text-exclude-start-words.js' +import { runRule } from '../../lib/init-test' +import { imageAltTextExcludeStartWords } from '../../lib/linting-rules/image-alt-text-exclude-start-words' describe(imageAltTextExcludeStartWords.names.join(' - '), () => { test('image alt text that starts with exclude words fails', async () => { diff --git a/src/content-linter/tests/unit/image-alt-text-length.js b/src/content-linter/tests/unit/image-alt-text-length.js index 6e2c010a65de..1e186bca150d 100644 --- a/src/content-linter/tests/unit/image-alt-text-length.js +++ b/src/content-linter/tests/unit/image-alt-text-length.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { incorrectAltTextLength } from '../../lib/linting-rules/image-alt-text-length.js' +import { runRule } from '../../lib/init-test' +import { incorrectAltTextLength } from '../../lib/linting-rules/image-alt-text-length' describe(incorrectAltTextLength.names.join(' - '), () => { test('image with incorrect alt text length fails', async () => { diff --git a/src/content-linter/tests/unit/image-file-kebab-case.js b/src/content-linter/tests/unit/image-file-kebab-case.js index d724925a1935..2a2521daf741 100644 --- a/src/content-linter/tests/unit/image-file-kebab-case.js +++ b/src/content-linter/tests/unit/image-file-kebab-case.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { imageFileKebabCase } from '../../lib/linting-rules/image-file-kebab-case.js' +import { runRule } from '../../lib/init-test' +import { imageFileKebabCase } from '../../lib/linting-rules/image-file-kebab-case' describe(imageFileKebabCase.names.join(' - '), () => { test('image file not using lowercase kebab case fails', async () => { diff --git a/src/content-linter/tests/unit/image-no-gif.js b/src/content-linter/tests/unit/image-no-gif.js index 90d23a281443..4c4e1e7b6202 100644 --- a/src/content-linter/tests/unit/image-no-gif.js +++ b/src/content-linter/tests/unit/image-no-gif.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { imageNoGif } from '../../lib/linting-rules/image-no-gif.js' +import { runRule } from '../../lib/init-test' +import { imageNoGif } from '../../lib/linting-rules/image-no-gif' describe(imageNoGif.names.join(' - '), () => { test('image with gifs', async () => { diff --git a/src/content-linter/tests/unit/internal-links-no-lang.js b/src/content-linter/tests/unit/internal-links-no-lang.js index 5553ed68ca9f..206a5e7755f5 100644 --- a/src/content-linter/tests/unit/internal-links-no-lang.js +++ b/src/content-linter/tests/unit/internal-links-no-lang.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { internalLinksNoLang } from '../../lib/linting-rules/internal-links-no-lang.js' +import { runRule } from '../../lib/init-test' +import { internalLinksNoLang } from '../../lib/linting-rules/internal-links-no-lang' describe(internalLinksNoLang.names.join(' - '), () => { test('internal links with hardcoded language codes fail', async () => { diff --git a/src/content-linter/tests/unit/internal-links-old-version.js b/src/content-linter/tests/unit/internal-links-old-version.js index bbbb3177870e..b40909e66474 100644 --- a/src/content-linter/tests/unit/internal-links-old-version.js +++ b/src/content-linter/tests/unit/internal-links-old-version.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { internalLinksOldVersion } from '../../lib/linting-rules/internal-links-old-version.js' +import { runRule } from '../../lib/init-test' +import { internalLinksOldVersion } from '../../lib/linting-rules/internal-links-old-version' describe(internalLinksOldVersion.names.join(' - '), () => { test('links with old hardcoded versioning fail', async () => { diff --git a/src/content-linter/tests/unit/internal-links-slash.js b/src/content-linter/tests/unit/internal-links-slash.js index c96c15283684..14350e4851fc 100755 --- a/src/content-linter/tests/unit/internal-links-slash.js +++ b/src/content-linter/tests/unit/internal-links-slash.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { internalLinksSlash } from '../../lib/linting-rules/internal-links-slash.js' +import { runRule } from '../../lib/init-test' +import { internalLinksSlash } from '../../lib/linting-rules/internal-links-slash' describe(internalLinksSlash.names.join(' - '), () => { test('relative links that do not start with / fail', async () => { diff --git a/src/content-linter/tests/unit/link-punctuation.js b/src/content-linter/tests/unit/link-punctuation.js index 676124ba886b..c12ebdaa3fce 100644 --- a/src/content-linter/tests/unit/link-punctuation.js +++ b/src/content-linter/tests/unit/link-punctuation.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { linkPunctuation } from '../../lib/linting-rules/link-punctuation.js' +import { runRule } from '../../lib/init-test' +import { linkPunctuation } from '../../lib/linting-rules/link-punctuation' describe(linkPunctuation.names.join(' - '), () => { test('inline links without quotes or a period should not error', async () => { diff --git a/src/content-linter/tests/unit/link-quotation.js b/src/content-linter/tests/unit/link-quotation.js index d76ef0266d34..52d57ab19f32 100644 --- a/src/content-linter/tests/unit/link-quotation.js +++ b/src/content-linter/tests/unit/link-quotation.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { linkQuotation } from '../../lib/linting-rules/link-quotation.js' +import { runRule } from '../../lib/init-test' +import { linkQuotation } from '../../lib/linting-rules/link-quotation' describe(linkQuotation.names.join(' - '), () => { test('links that are formatted correctly should not generate an error', async () => { diff --git a/src/content-linter/tests/unit/liquid-data-tags.js b/src/content-linter/tests/unit/liquid-data-tags.js index 68dceab5af1e..21a029aeaad3 100644 --- a/src/content-linter/tests/unit/liquid-data-tags.js +++ b/src/content-linter/tests/unit/liquid-data-tags.js @@ -2,11 +2,11 @@ import path from 'path' import { afterAll, beforeAll, describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' +import { runRule } from '../../lib/init-test' import { liquidDataReferencesDefined, liquidDataTagFormat, -} from '../../lib/linting-rules/liquid-data-tags.js' +} from '../../lib/linting-rules/liquid-data-tags' describe(liquidDataReferencesDefined.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT diff --git a/src/content-linter/tests/unit/liquid-ifversion-versions.js b/src/content-linter/tests/unit/liquid-ifversion-versions.js index d0f3210927cd..712850c42241 100644 --- a/src/content-linter/tests/unit/liquid-ifversion-versions.js +++ b/src/content-linter/tests/unit/liquid-ifversion-versions.js @@ -1,9 +1,9 @@ import { afterAll, beforeAll, describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { validateIfversionConditionalsVersions } from '../../lib/linting-rules/liquid-versioning.js' -import { liquidIfversionVersions } from '../../lib/linting-rules/liquid-ifversion-versions.js' -import { supported } from '#src/versions/lib/enterprise-server-releases.js' +import { runRule } from '../../lib/init-test' +import { validateIfversionConditionalsVersions } from '../../lib/linting-rules/liquid-versioning' +import { liquidIfversionVersions } from '../../lib/linting-rules/liquid-ifversion-versions' +import { supported } from '@/versions/lib/enterprise-server-releases' describe(liquidIfversionVersions.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT diff --git a/src/content-linter/tests/unit/liquid-quoted-conditional-args.js b/src/content-linter/tests/unit/liquid-quoted-conditional-args.js index f265accdc947..1c42c4ad3f11 100644 --- a/src/content-linter/tests/unit/liquid-quoted-conditional-args.js +++ b/src/content-linter/tests/unit/liquid-quoted-conditional-args.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { liquidQuotedConditionalArg } from '../../lib/linting-rules/liquid-quoted-conditional-arg.js' +import { runRule } from '../../lib/init-test' +import { liquidQuotedConditionalArg } from '../../lib/linting-rules/liquid-quoted-conditional-arg' describe(liquidQuotedConditionalArg.names.join(' - '), () => { test('if conditional with quote args fails', async () => { diff --git a/src/content-linter/tests/unit/liquid-syntax.js b/src/content-linter/tests/unit/liquid-syntax.js index eb054f2d7a99..2cc769ce9bbd 100644 --- a/src/content-linter/tests/unit/liquid-syntax.js +++ b/src/content-linter/tests/unit/liquid-syntax.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { frontmatterLiquidSyntax, liquidSyntax } from '../../lib/linting-rules/liquid-syntax.js' +import { runRule } from '../../lib/init-test' +import { frontmatterLiquidSyntax, liquidSyntax } from '../../lib/linting-rules/liquid-syntax' // Configure the test figure to not split frontmatter and content const fmOptions = { markdownlintOptions: { frontMatter: null } } diff --git a/src/content-linter/tests/unit/liquid-tag-whitespace.js b/src/content-linter/tests/unit/liquid-tag-whitespace.js index b942c1573253..79f70d10a4eb 100644 --- a/src/content-linter/tests/unit/liquid-tag-whitespace.js +++ b/src/content-linter/tests/unit/liquid-tag-whitespace.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { liquidTagWhitespace } from '../../lib/linting-rules/liquid-tag-whitespace.js' +import { runRule } from '../../lib/init-test' +import { liquidTagWhitespace } from '../../lib/linting-rules/liquid-tag-whitespace' describe(liquidTagWhitespace.names.join(' - '), () => { test('liquid tags with correct whitespace pass', async () => { diff --git a/src/content-linter/tests/unit/liquid-versioning.js b/src/content-linter/tests/unit/liquid-versioning.js index 890209c783b8..22f1a7aad588 100644 --- a/src/content-linter/tests/unit/liquid-versioning.js +++ b/src/content-linter/tests/unit/liquid-versioning.js @@ -2,9 +2,9 @@ import path from 'path' import { afterAll, beforeAll, describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { liquidIfTags, liquidIfVersionTags } from '../../lib/linting-rules/liquid-versioning.js' -import { nextNext } from '#src/versions/lib/enterprise-server-releases.js' +import { runRule } from '../../lib/init-test' +import { liquidIfTags, liquidIfVersionTags } from '../../lib/linting-rules/liquid-versioning' +import { nextNext } from '@/versions/lib/enterprise-server-releases' describe(liquidIfTags.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT diff --git a/src/content-linter/tests/unit/list-first-word-captitalization.js b/src/content-linter/tests/unit/list-first-word-captitalization.js index b00b39fe880b..b3804634ed32 100644 --- a/src/content-linter/tests/unit/list-first-word-captitalization.js +++ b/src/content-linter/tests/unit/list-first-word-captitalization.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { listFirstWordCapitalization } from '../../lib/linting-rules/list-first-word-capitalization.js' +import { runRule } from '../../lib/init-test' +import { listFirstWordCapitalization } from '../../lib/linting-rules/list-first-word-capitalization' describe(listFirstWordCapitalization.names.join(' - '), () => { test('ensure multi-level lists catch incorrect capitalization errors', async () => { diff --git a/src/content-linter/tests/unit/multiple-emphasis-patterns.js b/src/content-linter/tests/unit/multiple-emphasis-patterns.js index 0efc7e28bc93..b8d642339f08 100644 --- a/src/content-linter/tests/unit/multiple-emphasis-patterns.js +++ b/src/content-linter/tests/unit/multiple-emphasis-patterns.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { multipleEmphasisPatterns } from '../../lib/linting-rules/multiple-emphasis-patterns.js' +import { runRule } from '../../lib/init-test' +import { multipleEmphasisPatterns } from '../../lib/linting-rules/multiple-emphasis-patterns' describe(multipleEmphasisPatterns.names.join(' - '), () => { test('Single emphasis types pass', async () => { diff --git a/src/content-linter/tests/unit/note-warning-formatting.js b/src/content-linter/tests/unit/note-warning-formatting.js index 791abd68e159..7804dfeb98c6 100644 --- a/src/content-linter/tests/unit/note-warning-formatting.js +++ b/src/content-linter/tests/unit/note-warning-formatting.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { noteWarningFormatting } from '../../lib/linting-rules/note-warning-formatting.js' +import { runRule } from '../../lib/init-test' +import { noteWarningFormatting } from '../../lib/linting-rules/note-warning-formatting' describe(noteWarningFormatting.names.join(' - '), () => { test('Correctly formatted legacy notes pass', async () => { diff --git a/src/content-linter/tests/unit/octicon-aria-labels.js b/src/content-linter/tests/unit/octicon-aria-labels.js index c677c38ff05b..778964313692 100644 --- a/src/content-linter/tests/unit/octicon-aria-labels.js +++ b/src/content-linter/tests/unit/octicon-aria-labels.js @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { octiconAriaLabels } from '../../lib/linting-rules/octicon-aria-labels.js' +import { octiconAriaLabels } from '../../lib/linting-rules/octicon-aria-labels' describe('octicon-aria-labels', () => { const rule = octiconAriaLabels diff --git a/src/content-linter/tests/unit/rai-resuable-usage.js b/src/content-linter/tests/unit/rai-resuable-usage.js index 7668cb4f74e8..db465de6fe47 100644 --- a/src/content-linter/tests/unit/rai-resuable-usage.js +++ b/src/content-linter/tests/unit/rai-resuable-usage.js @@ -1,7 +1,7 @@ import { afterAll, beforeAll, describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { raiReusableUsage } from '../../lib/linting-rules/rai-reusable-usage.js' +import { runRule } from '../../lib/init-test' +import { raiReusableUsage } from '../../lib/linting-rules/rai-reusable-usage' describe(raiReusableUsage.names.join(' - '), () => { const envVarValueBefore = process.env.ROOT diff --git a/src/content-linter/tests/unit/search-replace.js b/src/content-linter/tests/unit/search-replace.js index 177a233ea025..af1317325f78 100644 --- a/src/content-linter/tests/unit/search-replace.js +++ b/src/content-linter/tests/unit/search-replace.js @@ -1,8 +1,8 @@ import { describe, expect, test } from 'vitest' import searchReplace from 'markdownlint-rule-search-replace' -import { runRule } from '../../lib/init-test.js' -import { searchReplaceConfig } from '../../style/github-docs.js' +import { runRule } from '../../lib/init-test' +import { searchReplaceConfig } from '../../style/github-docs' describe(searchReplace.names.join(' - '), () => { test('TODOCS placeholder occurrences cause errors', async () => { diff --git a/src/content-linter/tests/unit/table-column-integrity-simple.js b/src/content-linter/tests/unit/table-column-integrity-simple.js index a86940de739e..6d45e01a3f07 100644 --- a/src/content-linter/tests/unit/table-column-integrity-simple.js +++ b/src/content-linter/tests/unit/table-column-integrity-simple.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { tableColumnIntegrity } from '../../lib/linting-rules/table-column-integrity.js' +import { runRule } from '../../lib/init-test' +import { tableColumnIntegrity } from '../../lib/linting-rules/table-column-integrity' describe(tableColumnIntegrity.names.join(' - '), () => { test('Valid table with consistent columns passes', async () => { diff --git a/src/content-linter/tests/unit/table-liquid-versioning.js b/src/content-linter/tests/unit/table-liquid-versioning.js index 6a56534ef9d8..1527ba3f212f 100644 --- a/src/content-linter/tests/unit/table-liquid-versioning.js +++ b/src/content-linter/tests/unit/table-liquid-versioning.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { tableLiquidVersioning } from '../../lib/linting-rules/table-liquid-versioning.js' +import { runRule } from '../../lib/init-test' +import { tableLiquidVersioning } from '../../lib/linting-rules/table-liquid-versioning' const FIXTURE_FILEPATH = 'src/content-linter/tests/fixtures/tables.md' diff --git a/src/content-linter/tests/unit/third-party-action-pinning.js b/src/content-linter/tests/unit/third-party-action-pinning.js index 49da357395c6..03ae98198590 100644 --- a/src/content-linter/tests/unit/third-party-action-pinning.js +++ b/src/content-linter/tests/unit/third-party-action-pinning.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { thirdPartyActionPinning } from '../../lib/linting-rules/third-party-action-pinning.js' +import { runRule } from '../../lib/init-test' +import { thirdPartyActionPinning } from '../../lib/linting-rules/third-party-action-pinning' describe(thirdPartyActionPinning.names.join(' - '), () => { test('should not report an error for first-party actions', async () => { diff --git a/src/content-linter/tests/unit/yaml-scheduled-jobs.js b/src/content-linter/tests/unit/yaml-scheduled-jobs.js index 97dde53fc4b1..cac559cec331 100644 --- a/src/content-linter/tests/unit/yaml-scheduled-jobs.js +++ b/src/content-linter/tests/unit/yaml-scheduled-jobs.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { runRule } from '../../lib/init-test.js' -import { yamlScheduledJobs } from '../../lib/linting-rules/yaml-scheduled-jobs.js' +import { runRule } from '../../lib/init-test' +import { yamlScheduledJobs } from '../../lib/linting-rules/yaml-scheduled-jobs' describe(yamlScheduledJobs.names.join(' - '), () => { test('yaml scheduled jobs in markdown do not start on the hour', async () => { diff --git a/src/content-render/index.js b/src/content-render/index.js index 3f3d1eb85ed5..40f279e35721 100644 --- a/src/content-render/index.js +++ b/src/content-render/index.js @@ -1,6 +1,6 @@ -import { renderLiquid } from './liquid/index.js' -import { renderMarkdown, renderUnified } from './unified/index.js' -import { engine } from './liquid/engine.js' +import { renderLiquid } from './liquid/index' +import { renderMarkdown, renderUnified } from './unified/index' +import { engine } from './liquid/engine' const globalCache = new Map() diff --git a/src/content-render/liquid/data.js b/src/content-render/liquid/data.js index afeb9ec5c0dc..732dbc8eaaf8 100644 --- a/src/content-render/liquid/data.js +++ b/src/content-render/liquid/data.js @@ -1,7 +1,7 @@ import { TokenizationError } from 'liquidjs' -import { THROW_ON_EMPTY, DataReferenceError } from './error-handling.js' -import { getDataByLanguage } from '#src/data-directory/lib/get-data.js' +import { THROW_ON_EMPTY, DataReferenceError } from './error-handling' +import { getDataByLanguage } from '@/data-directory/lib/get-data' const Syntax = /([a-z0-9/\\_.\-[\]]+)/i const SyntaxHelp = "Syntax Error in 'data' - Valid syntax: data [path]" diff --git a/src/content-render/liquid/engine.js b/src/content-render/liquid/engine.js index ae9e2f467231..50a03f701ae6 100644 --- a/src/content-render/liquid/engine.js +++ b/src/content-render/liquid/engine.js @@ -1,11 +1,11 @@ import { Liquid } from 'liquidjs' import GithubSlugger from 'github-slugger' -import IndentedDataReference from './indented-data-reference.js' -import Data from './data.js' -import Octicon from './octicon.js' -import Ifversion from './ifversion.js' -import { Tool, tags as toolTags } from './tool.js' -import { Spotlight, tags as spotlightTags } from './spotlight.js' +import IndentedDataReference from './indented-data-reference' +import Data from './data' +import Octicon from './octicon' +import Ifversion from './ifversion' +import { Tool, tags as toolTags } from './tool' +import { Spotlight, tags as spotlightTags } from './spotlight' export const engine = new Liquid({ extname: '.html', diff --git a/src/content-render/liquid/ifversion.js b/src/content-render/liquid/ifversion.js index 10c9830c11d9..1305fe9b981c 100644 --- a/src/content-render/liquid/ifversion.js +++ b/src/content-render/liquid/ifversion.js @@ -1,6 +1,6 @@ import { Tag, isTruthy, Value, TokenizationError } from 'liquidjs' -import versionSatisfiesRange from '#src/versions/lib/version-satisfies-range.js' -import supportedOperators from './ifversion-supported-operators.js' +import versionSatisfiesRange from '@/versions/lib/version-satisfies-range' +import supportedOperators from './ifversion-supported-operators' const SyntaxHelp = "Syntax Error in 'ifversion' with range - Valid syntax: ifversion [plan] [operator] [releaseNumber]" diff --git a/src/content-render/liquid/indented-data-reference.js b/src/content-render/liquid/indented-data-reference.js index 4a20339095fc..aa229f8aafc5 100644 --- a/src/content-render/liquid/indented-data-reference.js +++ b/src/content-render/liquid/indented-data-reference.js @@ -1,7 +1,7 @@ import assert from 'assert' -import { THROW_ON_EMPTY, IndentedDataReferenceError } from './error-handling.js' -import { getDataByLanguage } from '#src/data-directory/lib/get-data.js' +import { THROW_ON_EMPTY, IndentedDataReferenceError } from './error-handling' +import { getDataByLanguage } from '@/data-directory/lib/get-data' // This class supports a tag that expects two parameters, a data reference and `spaces=NUMBER`: // diff --git a/src/content-render/liquid/index.js b/src/content-render/liquid/index.js index b95bb1bdace7..412d11b75c23 100644 --- a/src/content-render/liquid/index.js +++ b/src/content-render/liquid/index.js @@ -1,5 +1,5 @@ -import { processLiquidPost } from './post.js' -import { engine } from './engine.js' +import { processLiquidPost } from './post' +import { engine } from './engine' export async function renderLiquid(template, context) { template = await engine.parseAndRender(template, context) diff --git a/src/content-render/liquid/tool.js b/src/content-render/liquid/tool.js index 8851fb07e5ea..c7731299b1bd 100644 --- a/src/content-render/liquid/tool.js +++ b/src/content-render/liquid/tool.js @@ -1,5 +1,5 @@ -import { allTools } from '#src/tools/lib/all-tools.ts' -import { allPlatforms } from '#src/tools/lib/all-platforms.ts' +import { allTools } from '@/tools/lib/all-tools' +import { allPlatforms } from '@/tools/lib/all-platforms' export const tags = Object.keys(allTools).concat(allPlatforms).concat(['rowheaders']) diff --git a/src/content-render/scripts/all-documents/lib.ts b/src/content-render/scripts/all-documents/lib.ts index c6553fe52c05..4f2e393180e8 100644 --- a/src/content-render/scripts/all-documents/lib.ts +++ b/src/content-render/scripts/all-documents/lib.ts @@ -3,7 +3,7 @@ import type { Response } from 'express' import type { ExtendedRequest, Page } from '@/types' import contextualize from '@/frame/middleware/context/context' import features from '@/versions/middleware/features' -import shortVersions from '@/versions/middleware/short-versions.js' +import shortVersions from '@/versions/middleware/short-versions' import warmServer from '@/frame/lib/warm-server' diff --git a/src/content-render/scripts/move-content.js b/src/content-render/scripts/move-content.js index d29c9b8061d1..ed9a0adb6f4f 100755 --- a/src/content-render/scripts/move-content.js +++ b/src/content-render/scripts/move-content.js @@ -27,8 +27,8 @@ import walk from 'walk-sync' import yaml from 'js-yaml' import escapeStringRegexp from 'escape-string-regexp' -import fm from '#src/frame/lib/frontmatter.js' -import readFrontmatter from '#src/frame/lib/read-frontmatter.js' +import fm from '@/frame/lib/frontmatter' +import readFrontmatter from '@/frame/lib/read-frontmatter' // This is so you can optionally run it again the test fixtures root. const ROOT = process.env.ROOT || '.' diff --git a/src/content-render/scripts/reconcile-category-dirs-with-ids.js b/src/content-render/scripts/reconcile-category-dirs-with-ids.js index 487a79ba6849..244ce53770b2 100755 --- a/src/content-render/scripts/reconcile-category-dirs-with-ids.js +++ b/src/content-render/scripts/reconcile-category-dirs-with-ids.js @@ -14,10 +14,10 @@ import chalk from 'chalk' import GithubSlugger from 'github-slugger' import { decode } from 'html-entities' -import frontmatter from '#src/frame/lib/read-frontmatter.js' -import { renderContent } from '#src/content-render/index.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { ROOT } from '#src/frame/lib/constants.js' +import frontmatter from '@/frame/lib/read-frontmatter' +import { renderContent } from '@/content-render/index' +import { allVersions } from '@/versions/lib/all-versions' +import { ROOT } from '@/frame/lib/constants' const slugger = new GithubSlugger() diff --git a/src/content-render/scripts/reconcile-filenames-with-ids.js b/src/content-render/scripts/reconcile-filenames-with-ids.js index 5eea73420447..f64d186b6250 100755 --- a/src/content-render/scripts/reconcile-filenames-with-ids.js +++ b/src/content-render/scripts/reconcile-filenames-with-ids.js @@ -12,9 +12,9 @@ import path from 'path' import walk from 'walk-sync' import GithubSlugger from 'github-slugger' import { decode } from 'html-entities' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import frontmatter from '@/frame/lib/read-frontmatter' import { execFileSync } from 'child_process' -import addRedirectToFrontmatter from '#src/redirects/scripts/helpers/add-redirect-to-frontmatter.js' +import addRedirectToFrontmatter from '@/redirects/scripts/helpers/add-redirect-to-frontmatter' const slugger = new GithubSlugger() diff --git a/src/content-render/scripts/render-content-markdown.js b/src/content-render/scripts/render-content-markdown.js index ea3c06f8fdca..748445ef6786 100755 --- a/src/content-render/scripts/render-content-markdown.js +++ b/src/content-render/scripts/render-content-markdown.js @@ -2,11 +2,11 @@ import fs from 'fs' import path from 'path' import { execSync } from 'child_process' -import { renderLiquid } from '#src/content-render/liquid/index.js' -import shortVersionsMiddleware from '#src/versions/middleware/short-versions.js' +import { renderLiquid } from '@/content-render/liquid/index' +import shortVersionsMiddleware from '@/versions/middleware/short-versions' -const { loadPages } = await import('#src/frame/lib/page-data.js') -const { allVersions } = await import('#src/versions/lib/all-versions.js') +const { loadPages } = await import('@/frame/lib/page-data.js') +const { allVersions } = await import('@/versions/lib/all-versions.js') const contentCopilotDir = path.join(process.cwd(), 'content-copilot') diff --git a/src/content-render/scripts/reusables-cli/find/unused.ts b/src/content-render/scripts/reusables-cli/find/unused.ts index 70e6d54574e2..e3d0e893d706 100644 --- a/src/content-render/scripts/reusables-cli/find/unused.ts +++ b/src/content-render/scripts/reusables-cli/find/unused.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils' import { getAllContentFilePaths, getAllReusablesFilePaths, diff --git a/src/content-render/scripts/reusables-cli/find/used.ts b/src/content-render/scripts/reusables-cli/find/used.ts index 9669eb0bc5a3..c6815cf501d3 100644 --- a/src/content-render/scripts/reusables-cli/find/used.ts +++ b/src/content-render/scripts/reusables-cli/find/used.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils' import { FilesWithLineNumbers, getAllContentFilePaths, diff --git a/src/content-render/scripts/test-moved-content.ts b/src/content-render/scripts/test-moved-content.ts index c885f4ca1d02..3916b9158de4 100644 --- a/src/content-render/scripts/test-moved-content.ts +++ b/src/content-render/scripts/test-moved-content.ts @@ -4,7 +4,7 @@ import path from 'path' import { program } from 'commander' -import readFrontmatter from '@/frame/lib/read-frontmatter.js' +import readFrontmatter from '@/frame/lib/read-frontmatter' const ROOT = process.env.ROOT || '.' const CONTENT_ROOT = path.resolve(path.join(ROOT, 'content')) diff --git a/src/content-render/tests/annotate.js b/src/content-render/tests/annotate.js index 67c5e1a709b9..b1fd79020e6e 100644 --- a/src/content-render/tests/annotate.js +++ b/src/content-render/tests/annotate.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' import cheerio from 'cheerio' -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' const example = ` \`\`\`yaml annotate diff --git a/src/content-render/tests/data.js b/src/content-render/tests/data.js index 6563c8e2db07..6cc104d4d2e8 100644 --- a/src/content-render/tests/data.js +++ b/src/content-render/tests/data.js @@ -1,9 +1,9 @@ import { afterAll, beforeAll, describe, expect, test } from 'vitest' -import Page from '#src/frame/lib/page.js' -import languages from '#src/languages/lib/languages.ts' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { DataDirectory } from '#src/tests/helpers/data-directory.js' +import Page from '@/frame/lib/page' +import languages from '@/languages/lib/languages' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { DataDirectory } from '@/tests/helpers/data-directory' describe('data tag', () => { let dd diff --git a/src/content-render/tests/link-error-line-numbers.js b/src/content-render/tests/link-error-line-numbers.js index 2afb5a6a491b..8c5e78cdcc7b 100644 --- a/src/content-render/tests/link-error-line-numbers.js +++ b/src/content-render/tests/link-error-line-numbers.js @@ -1,6 +1,6 @@ import { describe, expect, test, beforeEach, afterEach } from 'vitest' -import { renderContent } from '#src/content-render/index.js' -import { TitleFromAutotitleError } from '#src/content-render/unified/rewrite-local-links.js' +import { renderContent } from '@/content-render/index' +import { TitleFromAutotitleError } from '@/content-render/unified/rewrite-local-links' describe('link error line numbers', () => { let fs diff --git a/src/content-render/tests/liquid-helpers.js b/src/content-render/tests/liquid-helpers.js index 0da692d3b6e7..ee4bdce298a6 100644 --- a/src/content-render/tests/liquid-helpers.js +++ b/src/content-render/tests/liquid-helpers.js @@ -1,8 +1,8 @@ import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest' -import { liquid } from '#src/content-render/index.js' -import languages from '#src/languages/lib/languages.ts' -import { DataDirectory } from '#src/tests/helpers/data-directory.js' +import { liquid } from '@/content-render/index' +import languages from '@/languages/lib/languages' +import { DataDirectory } from '@/tests/helpers/data-directory' describe('liquid helper tags', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/content-render/tests/liquid.ts b/src/content-render/tests/liquid.ts index 1cb8a9be426e..e38b32f68ba7 100644 --- a/src/content-render/tests/liquid.ts +++ b/src/content-render/tests/liquid.ts @@ -1,11 +1,11 @@ import { describe, expect, test, vi } from 'vitest' import type { Response } from 'express' -import { liquid } from '@/content-render/index.js' -import shortVersionsMiddleware from '@/versions/middleware/short-versions.js' +import { liquid } from '@/content-render/index' +import shortVersionsMiddleware from '@/versions/middleware/short-versions' import featureVersionsMiddleware from '@/versions/middleware/features' import { allVersions } from '@/versions/lib/all-versions' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' import type { Context, ExtendedRequest, Page } from '@/types' // Setup these variables so we don't need to manually update tests as GHES diff --git a/src/content-render/tests/octicon.js b/src/content-render/tests/octicon.js index 35ab7e1b0070..e17b1088df78 100644 --- a/src/content-render/tests/octicon.js +++ b/src/content-render/tests/octicon.js @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' describe('octicon tag', () => { test('renders the expected octicon', async () => { diff --git a/src/content-render/tests/render-changed-and-deleted-files.js b/src/content-render/tests/render-changed-and-deleted-files.js index 73e4029270cd..ce875fc5ac72 100644 --- a/src/content-render/tests/render-changed-and-deleted-files.js +++ b/src/content-render/tests/render-changed-and-deleted-files.js @@ -33,8 +33,8 @@ import path from 'path' import { describe, expect, test, vi } from 'vitest' -import { head, get } from '#src/tests/helpers/e2etest.js' -import { loadPages } from '#src/frame/lib/page-data.js' +import { head, get } from '@/tests/helpers/e2etest' +import { loadPages } from '@/frame/lib/page-data' const EMPTY = Symbol('EMPTY') diff --git a/src/content-render/tests/render-content.js b/src/content-render/tests/render-content.js index 4c86dbe82231..3afa0d4d6977 100644 --- a/src/content-render/tests/render-content.js +++ b/src/content-render/tests/render-content.js @@ -1,7 +1,7 @@ import cheerio from 'cheerio' import { describe, expect, test } from 'vitest' -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' import { EOL } from 'os' // Use platform-specific line endings for realistic tests when templates have diff --git a/src/content-render/unified/annotate.js b/src/content-render/unified/annotate.js index 4d2db6a49640..f687edd5fa6e 100644 --- a/src/content-render/unified/annotate.js +++ b/src/content-render/unified/annotate.js @@ -35,8 +35,8 @@ import { visit } from 'unist-util-visit' import { h } from 'hastscript' import { fromMarkdown } from 'mdast-util-from-markdown' import { toHast } from 'mdast-util-to-hast' -import { header } from './code-header.js' -import findPage from '#src/frame/lib/find-page.js' +import { header } from './code-header' +import findPage from '@/frame/lib/find-page' const languages = yaml.load(fs.readFileSync('./data/code-languages.yml', 'utf8')) diff --git a/src/content-render/unified/index.js b/src/content-render/unified/index.js index 0895497c0492..d7244485daa9 100644 --- a/src/content-render/unified/index.js +++ b/src/content-render/unified/index.js @@ -1,5 +1,5 @@ -import { fastTextOnly } from './text-only.js' -import { createProcessor, createMarkdownOnlyProcessor } from './processor.js' +import { fastTextOnly } from './text-only' +import { createProcessor, createMarkdownOnlyProcessor } from './processor' export async function renderUnified(template, context, options) { const processor = createProcessor(context) diff --git a/src/content-render/unified/processor.js b/src/content-render/unified/processor.js index 383e061fc435..248e0767fdf9 100644 --- a/src/content-render/unified/processor.js +++ b/src/content-render/unified/processor.js @@ -14,19 +14,19 @@ import erb from 'highlight.js/lib/languages/erb' import powershell from 'highlight.js/lib/languages/powershell' import graphql from 'highlight.js/lib/languages/graphql' import html from 'rehype-stringify' -import codeHeader from './code-header.js' -import rewriteLocalLinks from './rewrite-local-links.js' -import rewriteImgSources from './rewrite-asset-urls.js' -import rewriteAssetImgTags from './rewrite-asset-img-tags.js' -import useEnglishHeadings from './use-english-headings.js' -import headingLinks from './heading-links.js' -import rewriteTheadThScope from './rewrite-thead-th-scope.js' -import rewriteEmptyTableRows from './rewrite-empty-table-rows.js' -import rewriteForRowheaders from './rewrite-for-rowheaders.js' -import wrapProceduralImages from './wrap-procedural-images.js' -import parseInfoString from './parse-info-string.js' -import annotate from './annotate.js' -import alerts from './alerts.js' +import codeHeader from './code-header' +import rewriteLocalLinks from './rewrite-local-links' +import rewriteImgSources from './rewrite-asset-urls' +import rewriteAssetImgTags from './rewrite-asset-img-tags' +import useEnglishHeadings from './use-english-headings' +import headingLinks from './heading-links' +import rewriteTheadThScope from './rewrite-thead-th-scope' +import rewriteEmptyTableRows from './rewrite-empty-table-rows' +import rewriteForRowheaders from './rewrite-for-rowheaders' +import wrapProceduralImages from './wrap-procedural-images' +import parseInfoString from './parse-info-string' +import annotate from './annotate' +import alerts from './alerts' import removeHtmlComments from 'remark-remove-comments' import remarkStringify from 'remark-stringify' diff --git a/src/content-render/unified/rewrite-asset-img-tags.js b/src/content-render/unified/rewrite-asset-img-tags.js index 23fd0fed9149..c049ffbb9a6e 100644 --- a/src/content-render/unified/rewrite-asset-img-tags.js +++ b/src/content-render/unified/rewrite-asset-img-tags.js @@ -1,5 +1,5 @@ import { visit, SKIP } from 'unist-util-visit' -import { IMAGE_DENSITY } from '../../assets/lib/image-density.ts' +import { IMAGE_DENSITY } from '../../assets/lib/image-density' // This number must match a width we're willing to accept in a dynamic // asset URL. diff --git a/src/content-render/unified/rewrite-local-links.js b/src/content-render/unified/rewrite-local-links.js index 1bfc47c65666..ee297d85db05 100644 --- a/src/content-render/unified/rewrite-local-links.js +++ b/src/content-render/unified/rewrite-local-links.js @@ -3,15 +3,15 @@ import path from 'path' import stripAnsi from 'strip-ansi' import { visit } from 'unist-util-visit' import { distance } from 'fastest-levenshtein' -import { getPathWithoutLanguage, getVersionStringFromPath } from '#src/frame/lib/path-utils.js' -import { getNewVersionedPath } from '#src/archives/lib/old-versions-utils.ts' -import patterns from '#src/frame/lib/patterns.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.ts' -import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js' -import readJsonFile from '#src/frame/lib/read-json-file.js' -import findPage from '#src/frame/lib/find-page.js' +import { getPathWithoutLanguage, getVersionStringFromPath } from '@/frame/lib/path-utils' +import { getNewVersionedPath } from '@/archives/lib/old-versions-utils' +import patterns from '@/frame/lib/patterns' +import { deprecated, latest } from '@/versions/lib/enterprise-server-releases' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { allVersions } from '@/versions/lib/all-versions' +import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path' +import readJsonFile from '@/frame/lib/read-json-file' +import findPage from '@/frame/lib/find-page' const isProd = process.env.NODE_ENV === 'production' diff --git a/src/data-directory/lib/data-schemas/features.js b/src/data-directory/lib/data-schemas/features.js index 7f1b6c1ca92c..d75bc2a7ec52 100644 --- a/src/data-directory/lib/data-schemas/features.js +++ b/src/data-directory/lib/data-schemas/features.js @@ -1,4 +1,4 @@ -import { schema } from '#src/frame/lib/frontmatter.js' +import { schema } from '@/frame/lib/frontmatter' // Copy the properties from the frontmatter schema. const featureVersions = { diff --git a/src/data-directory/lib/data-schemas/glossaries-external.js b/src/data-directory/lib/data-schemas/glossaries-external.js index ab2fa9aa127d..d37102e20d86 100644 --- a/src/data-directory/lib/data-schemas/glossaries-external.js +++ b/src/data-directory/lib/data-schemas/glossaries-external.js @@ -1,4 +1,4 @@ -import { term } from './glossaries-candidates.js' +import { term } from './glossaries-candidates' export default { type: 'array', diff --git a/src/data-directory/lib/data-schemas/index.ts b/src/data-directory/lib/data-schemas/index.ts index 6b60269fcecc..e8d58ceb5ed4 100644 --- a/src/data-directory/lib/data-schemas/index.ts +++ b/src/data-directory/lib/data-schemas/index.ts @@ -3,13 +3,13 @@ interface DataSchemas { } const dataSchemas: DataSchemas = { - 'data/features': '#src/data-directory/lib/data-schemas/features.js', - 'data/variables': '#src/data-directory/lib/data-schemas/variables.js', - 'data/learning-tracks': '#src/data-directory/lib/data-schemas/learning-tracks.js', - 'data/release-notes': '#src/data-directory/lib/data-schemas/release-notes.js', - 'data/code-languages.yml': '#src/data-directory/lib/data-schemas/code-languages.js', - 'data/glossaries/candidates.yml': '#src/data-directory/lib/data-schemas/glossaries-candidates.js', - 'data/glossaries/external.yml': '#src/data-directory/lib/data-schemas/glossaries-external.js', + 'data/features': '@/data-directory/lib/data-schemas/features.js', + 'data/variables': '@/data-directory/lib/data-schemas/variables.js', + 'data/learning-tracks': '@/data-directory/lib/data-schemas/learning-tracks.js', + 'data/release-notes': '@/data-directory/lib/data-schemas/release-notes.js', + 'data/code-languages.yml': '@/data-directory/lib/data-schemas/code-languages.js', + 'data/glossaries/candidates.yml': '@/data-directory/lib/data-schemas/glossaries-candidates.js', + 'data/glossaries/external.yml': '@/data-directory/lib/data-schemas/glossaries-external.js', } export default dataSchemas diff --git a/src/data-directory/lib/data-schemas/learning-tracks.js b/src/data-directory/lib/data-schemas/learning-tracks.js index aeac9ae5d117..dcab4841cc74 100644 --- a/src/data-directory/lib/data-schemas/learning-tracks.js +++ b/src/data-directory/lib/data-schemas/learning-tracks.js @@ -1,4 +1,4 @@ -import { schema } from '#src/frame/lib/frontmatter.js' +import { schema } from '@/frame/lib/frontmatter' // Some learning tracks have `versions` blocks that match `versions` frontmatter, // so we can import that part of the FM schema. diff --git a/src/data-directory/lib/get-data.js b/src/data-directory/lib/get-data.js index 564013432c9e..aa3246de0306 100644 --- a/src/data-directory/lib/get-data.js +++ b/src/data-directory/lib/get-data.js @@ -5,8 +5,8 @@ import yaml from 'js-yaml' import matter from 'gray-matter' import { merge, get } from 'lodash-es' -import languages from '#src/languages/lib/languages.ts' -import { correctTranslatedContentStrings } from '#src/languages/lib/correct-translation-content.js' +import languages from '@/languages/lib/languages' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content' // If you run `export DEBUG_JIT_DATA_READS=true` in your terminal, // next time it will mention every file it reads from disk. diff --git a/src/data-directory/scripts/find-orphaned-features/find.ts b/src/data-directory/scripts/find-orphaned-features/find.ts index 9aa5a3d5fec0..91164d42fd4a 100644 --- a/src/data-directory/scripts/find-orphaned-features/find.ts +++ b/src/data-directory/scripts/find-orphaned-features/find.ts @@ -36,10 +36,10 @@ import { TokenizationError } from 'liquidjs' import type { Page } from '@/types' import warmServer from '@/frame/lib/warm-server' -import { getDeepDataByLanguage } from '@/data-directory/lib/get-data.js' -import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils' import languages from '@/languages/lib/languages' -import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content.js' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content' const EXCEPTIONS = new Set([ // From data/features/placeholder.yml. Used by tests. diff --git a/src/data-directory/tests/data-schemas.js b/src/data-directory/tests/data-schemas.js index 91e454ddb985..e7a3ae2bb00a 100644 --- a/src/data-directory/tests/data-schemas.js +++ b/src/data-directory/tests/data-schemas.js @@ -5,9 +5,9 @@ import { extname, basename } from 'path' import walk from 'walk-sync' import { beforeAll, describe, expect, test } from 'vitest' -import { getJsonValidator, validateJson } from '#src/tests/lib/validate-json-schema.ts' -import { formatAjvErrors } from '#src/tests/helpers/schemas.ts' -import dataSchemas from '#src/data-directory/lib/data-schemas/index.ts' +import { getJsonValidator, validateJson } from '@/tests/lib/validate-json-schema' +import { formatAjvErrors } from '@/tests/helpers/schemas' +import dataSchemas from '@/data-directory/lib/data-schemas/index' const schemaPaths = Object.keys(dataSchemas) const singleFilesSchemas = schemaPaths.filter((schemaPath) => extname(schemaPath)) diff --git a/src/data-directory/tests/filename-to-key.js b/src/data-directory/tests/filename-to-key.js index 3141140d0680..88b47ae37cc0 100644 --- a/src/data-directory/tests/filename-to-key.js +++ b/src/data-directory/tests/filename-to-key.js @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import filenameToKey from '#src/data-directory/lib/filename-to-key.ts' +import filenameToKey from '@/data-directory/lib/filename-to-key' describe('filename-to-key', () => { test('converts filenames to object keys', () => { diff --git a/src/data-directory/tests/get-data.js b/src/data-directory/tests/get-data.js index 673f4395ed70..f3bde821ca10 100644 --- a/src/data-directory/tests/get-data.js +++ b/src/data-directory/tests/get-data.js @@ -3,13 +3,13 @@ import path from 'path' import { afterAll, beforeAll, describe, expect, test } from 'vitest' -import languages from '#src/languages/lib/languages.ts' +import languages from '@/languages/lib/languages' import { getDataByLanguage, getDeepDataByLanguage, getUIDataMerged, -} from '#src/data-directory/lib/get-data.js' -import { DataDirectory } from '#src/tests/helpers/data-directory.js' +} from '@/data-directory/lib/get-data' +import { DataDirectory } from '@/tests/helpers/data-directory' describe('get-data', () => { let dd diff --git a/src/data-directory/tests/index.js b/src/data-directory/tests/index.js index 80961b5f299b..f33ca9b5cbfd 100644 --- a/src/data-directory/tests/index.js +++ b/src/data-directory/tests/index.js @@ -3,7 +3,7 @@ import path from 'path' import { describe, expect, test } from 'vitest' -import dataDirectory from '#src/data-directory/lib/data-directory.ts' +import dataDirectory from '@/data-directory/lib/data-directory' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const fixturesDir = path.join(__dirname, 'fixtures') diff --git a/src/data-directory/tests/orphaned-features.js b/src/data-directory/tests/orphaned-features.js index b3c30bdf80ca..6bb15c35704c 100644 --- a/src/data-directory/tests/orphaned-features.js +++ b/src/data-directory/tests/orphaned-features.js @@ -9,7 +9,7 @@ const fixturesDir = path.join(__dirname, 'orphaned-features', 'fixtures') // Import the actual helper functions from the orphaned features script const { getVariableFiles, getReusableFiles } = await import( - '#src/data-directory/scripts/find-orphaned-features/find.js' + '@/data-directory/scripts/find-orphaned-features/find.js' ) describe('orphaned features detection', () => { diff --git a/src/dev-toc/generate.ts b/src/dev-toc/generate.ts index fae9d7341c13..c53b9cc51cb0 100644 --- a/src/dev-toc/generate.ts +++ b/src/dev-toc/generate.ts @@ -4,10 +4,10 @@ import { execSync } from 'child_process' import { program } from 'commander' import type { NextFunction, Response } from 'express' import type { ExtendedRequest } from '@/types' -import fpt from '@/versions/lib/non-enterprise-default-version.js' +import fpt from '@/versions/lib/non-enterprise-default-version' import { allVersionKeys } from '@/versions/lib/all-versions' -import { liquid } from '@/content-render/index.js' -import contextualize from '@/frame/middleware/context/context.js' +import { liquid } from '@/content-render/index' +import contextualize from '@/frame/middleware/context/context' interface CommandOptions { openSections?: string | string[] diff --git a/src/early-access/scripts/migrate-early-access-product.ts b/src/early-access/scripts/migrate-early-access-product.ts index 1e5cef9a28af..a242feeab1fd 100644 --- a/src/early-access/scripts/migrate-early-access-product.ts +++ b/src/early-access/scripts/migrate-early-access-product.ts @@ -10,8 +10,8 @@ import yaml from 'js-yaml' import { last } from 'lodash-es' import { program } from 'commander' import { execFileSync } from 'child_process' -import frontmatter from '@/frame/lib/read-frontmatter.js' -import patterns from '@/frame/lib/patterns.js' +import frontmatter from '@/frame/lib/read-frontmatter' +import patterns from '@/frame/lib/patterns' import addRedirectToFrontmatter from '@/redirects/scripts/helpers/add-redirect-to-frontmatter' import walkFiles from '@/workflows/walk-files' diff --git a/src/early-access/scripts/update-data-and-image-paths.ts b/src/early-access/scripts/update-data-and-image-paths.ts index c54deeeb4ca4..18674ae209ee 100644 --- a/src/early-access/scripts/update-data-and-image-paths.ts +++ b/src/early-access/scripts/update-data-and-image-paths.ts @@ -10,7 +10,7 @@ import path from 'path' import { program } from 'commander' import walkFiles from '@/workflows/walk-files' import { escapeRegExp } from 'lodash-es' -import patterns from '@/frame/lib/patterns.js' +import patterns from '@/frame/lib/patterns' interface ProgramOptions { add?: boolean diff --git a/src/early-access/tests/early-access-rendering.ts b/src/early-access/tests/early-access-rendering.ts index ed62dc7cb68c..85e48d460279 100644 --- a/src/early-access/tests/early-access-rendering.ts +++ b/src/early-access/tests/early-access-rendering.ts @@ -4,7 +4,7 @@ import path from 'path' import { describe, expect } from 'vitest' import { testViaActionsOnly } from '@/tests/helpers/conditional-runs' -import { get, getDOM } from '@/tests/helpers/e2etest.js' +import { get, getDOM } from '@/tests/helpers/e2etest' describe('cloning early-access', () => { testViaActionsOnly('the content directory exists', async () => { diff --git a/src/early-access/tests/early-access-unit.ts b/src/early-access/tests/early-access-unit.ts index ee88e5201b82..3f6fc95257b9 100644 --- a/src/early-access/tests/early-access-unit.ts +++ b/src/early-access/tests/early-access-unit.ts @@ -1,5 +1,5 @@ import { expect, test, vi } from 'vitest' -import { get, getDOM } from '@/tests/helpers/e2etest.js' +import { get, getDOM } from '@/tests/helpers/e2etest' import { describeIfDocsEarlyAccess } from '@/tests/helpers/conditional-runs' import languages from '@/languages/lib/languages' diff --git a/src/events/lib/hydro.ts b/src/events/lib/hydro.ts index 65b5df04156a..7a061ab2c4e5 100644 --- a/src/events/lib/hydro.ts +++ b/src/events/lib/hydro.ts @@ -2,9 +2,9 @@ import { createHmac } from 'crypto' import { Agent } from 'node:https' import got from 'got' import { isNil } from 'lodash-es' -import statsd from '@/observability/lib/statsd.js' -import { report } from '@/observability/lib/failbot.js' -import { MAX_REQUEST_TIMEOUT } from '@/frame/lib/constants.js' +import statsd from '@/observability/lib/statsd' +import { report } from '@/observability/lib/failbot' +import { MAX_REQUEST_TIMEOUT } from '@/frame/lib/constants' const TIME_OUT_TEXT = 'ms has passed since batch creation' const SERVER_DISCONNECT_TEXT = 'The server disconnected before a response was received' diff --git a/src/events/lib/schema.ts b/src/events/lib/schema.ts index 29c90c46fbf8..f08badf231bc 100644 --- a/src/events/lib/schema.ts +++ b/src/events/lib/schema.ts @@ -1,7 +1,7 @@ import { languageKeys } from '@/languages/lib/languages' import { allVersionKeys } from '@/versions/lib/all-versions' import { productIds } from '@/products/lib/all-products' -import { allTools } from '@/tools/lib/all-tools.js' +import { allTools } from '@/tools/lib/all-tools' const versionPattern = '^\\d+(\\.\\d+)?(\\.\\d+)?$' // eslint-disable-line diff --git a/src/events/middleware.ts b/src/events/middleware.ts index 609da356f90f..64e4c73cf0e0 100644 --- a/src/events/middleware.ts +++ b/src/events/middleware.ts @@ -6,13 +6,13 @@ import { ErrorObject } from 'ajv' import type { ExtendedRequest } from '@/types' import type { Response } from 'express' -import { schemas, hydroNames } from './lib/schema.js' +import { schemas, hydroNames } from './lib/schema' import catchMiddlewareError from '@/observability/middleware/catch-middleware-error' import { noCacheControl } from '@/frame/middleware/cache-control' import { getJsonValidator } from '@/tests/lib/validate-json-schema' -import { formatErrors } from './lib/middleware-errors.js' -import { publish as _publish } from './lib/hydro.js' -import { analyzeComment, getGuessedLanguage } from './lib/analyze-comment.js' +import { formatErrors } from './lib/middleware-errors' +import { publish as _publish } from './lib/hydro' +import { analyzeComment, getGuessedLanguage } from './lib/analyze-comment' import { EventType, EventProps, EventPropsByType } from './types' const router = express.Router() diff --git a/src/events/tests/analyze-comments.ts b/src/events/tests/analyze-comments.ts index c4d9cb848239..a917435a9a16 100644 --- a/src/events/tests/analyze-comments.ts +++ b/src/events/tests/analyze-comments.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { analyzeComment, getGuessedLanguage } from '../lib/analyze-comment.js' +import { analyzeComment, getGuessedLanguage } from '../lib/analyze-comment' describe('analyzeComment', () => { test('email only', async () => { diff --git a/src/events/tests/hydro.ts b/src/events/tests/hydro.ts index 761d80384f1c..639afd91ee58 100644 --- a/src/events/tests/hydro.ts +++ b/src/events/tests/hydro.ts @@ -1,7 +1,7 @@ import { afterEach, describe, expect, test } from 'vitest' import nock from 'nock' -import { publish } from '../lib/hydro.js' +import { publish } from '../lib/hydro' describe('Hydro', () => { const secret = '3BD22A91' diff --git a/src/events/tests/middleware-errors.ts b/src/events/tests/middleware-errors.ts index 1349c8cdb4e7..8da3ed798b06 100644 --- a/src/events/tests/middleware-errors.ts +++ b/src/events/tests/middleware-errors.ts @@ -1,8 +1,8 @@ import { describe, test } from 'vitest' import { validateJson } from '@/tests/lib/validate-json-schema' -import { formatErrors } from '../lib/middleware-errors.js' -import { schemas } from '../lib/schema.js' +import { formatErrors } from '../lib/middleware-errors' +import { schemas } from '../lib/schema' describe('formatErrors', () => { test('should produce objects that match the validation spec', () => { diff --git a/src/events/tests/middleware.ts b/src/events/tests/middleware.ts index 367123b704da..40e0ce8af7bb 100644 --- a/src/events/tests/middleware.ts +++ b/src/events/tests/middleware.ts @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { post } from '@/tests/helpers/e2etest.js' +import { post } from '@/tests/helpers/e2etest' describe('POST /events', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/fixtures/tests/api-article-body.ts b/src/fixtures/tests/api-article-body.ts index ad2af1c66859..49528febd64b 100644 --- a/src/fixtures/tests/api-article-body.ts +++ b/src/fixtures/tests/api-article-body.ts @@ -1,6 +1,6 @@ import { beforeAll, describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' const makeURL = (pathname: string) => `/api/article/body?${new URLSearchParams({ pathname })}` diff --git a/src/fixtures/tests/breadcrumbs.ts b/src/fixtures/tests/breadcrumbs.ts index 4a69e64c139b..66eb05784a80 100644 --- a/src/fixtures/tests/breadcrumbs.ts +++ b/src/fixtures/tests/breadcrumbs.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { getDOM } from '@/tests/helpers/e2etest.js' +import { getDOM } from '@/tests/helpers/e2etest' describe('breadcrumbs', () => { test('links always prefixed with language', async () => { diff --git a/src/frame/components/ClientSideLanguageRedirect.ts b/src/frame/components/ClientSideLanguageRedirect.ts index a80b9b63226c..1f34b937f925 100644 --- a/src/frame/components/ClientSideLanguageRedirect.ts +++ b/src/frame/components/ClientSideLanguageRedirect.ts @@ -3,7 +3,7 @@ import { useRouter } from 'next/router' import { useLanguages } from '@/languages/components/LanguagesContext' import Cookies from '@/frame/components/lib/cookies' -import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants.js' +import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants' export function ClientSideLanguageRedirect() { const { locale, asPath, replace } = useRouter() diff --git a/src/frame/lib/create-tree.js b/src/frame/lib/create-tree.js index 2af6fbeca062..f90c778e03c5 100644 --- a/src/frame/lib/create-tree.js +++ b/src/frame/lib/create-tree.js @@ -1,7 +1,7 @@ import path from 'path' import fs from 'fs/promises' -import Page from './page.js' +import Page from './page' export default async function createTree(originalPath, rootPath, previousTree) { const basePath = rootPath || originalPath diff --git a/src/frame/lib/find-page-in-site-tree.ts b/src/frame/lib/find-page-in-site-tree.ts index 2662d0353fb1..f97565ae52c2 100644 --- a/src/frame/lib/find-page-in-site-tree.ts +++ b/src/frame/lib/find-page-in-site-tree.ts @@ -1,5 +1,5 @@ import type { Tree } from '@/types' -import { getLanguageCode } from './patterns.js' +import { getLanguageCode } from './patterns' // This module recursively searches a given part of the site tree by iterating through child // pages and finding a path that matches the original path provided. diff --git a/src/frame/lib/find-page.js b/src/frame/lib/find-page.js index 78c2216ff4d6..2657f26db383 100644 --- a/src/frame/lib/find-page.js +++ b/src/frame/lib/find-page.js @@ -1,5 +1,5 @@ -import { getLanguageCode } from './patterns.js' -import getRedirect from '#src/redirects/lib/get-redirect.ts' +import { getLanguageCode } from './patterns' +import getRedirect from '@/redirects/lib/get-redirect' export default function findPage(href, pages, redirects) { if (Array.isArray(pages)) throw new Error("'pages' is not supposed to be an array") diff --git a/src/frame/lib/frontmatter.js b/src/frame/lib/frontmatter.js index 9c9403679b58..bb8dddd9ce61 100644 --- a/src/frame/lib/frontmatter.js +++ b/src/frame/lib/frontmatter.js @@ -1,7 +1,7 @@ -import parse from './read-frontmatter.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { allTools } from '#src/tools/lib/all-tools.ts' -import { getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js' +import parse from './read-frontmatter' +import { allVersions } from '@/versions/lib/all-versions' +import { allTools } from '@/tools/lib/all-tools' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' const layoutNames = [ 'default', diff --git a/src/frame/lib/get-mini-toc-items.js b/src/frame/lib/get-mini-toc-items.js index a5240ff55a9f..a247a22bef05 100644 --- a/src/frame/lib/get-mini-toc-items.js +++ b/src/frame/lib/get-mini-toc-items.js @@ -1,7 +1,7 @@ import cheerio from 'cheerio' import { range } from 'lodash-es' -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' // Keep maxHeadingLevel=2 for accessibility reasons, see docs-engineering#2701 for more info export default function getMiniTocItems(html, maxHeadingLevel = 2, headingScope = '') { diff --git a/src/frame/lib/get-remote-json.js b/src/frame/lib/get-remote-json.js index f1c3e0f13f82..227a75c58927 100644 --- a/src/frame/lib/get-remote-json.js +++ b/src/frame/lib/get-remote-json.js @@ -3,7 +3,7 @@ import fs from 'fs' import crypto from 'crypto' import got from 'got' -import statsd from '#src/observability/lib/statsd.js' +import statsd from '@/observability/lib/statsd' // The only reason this is exported is for the sake of the unit tests' // ability to test in-memory miss after purging this with a mutation diff --git a/src/frame/lib/get-toc-items.js b/src/frame/lib/get-toc-items.js index 6d000be55419..fb0e6964e418 100644 --- a/src/frame/lib/get-toc-items.js +++ b/src/frame/lib/get-toc-items.js @@ -1,4 +1,4 @@ -import { productMap } from '#src/products/lib/all-products.ts' +import { productMap } from '@/products/lib/all-products' const productTOCs = Object.values(productMap) .filter((product) => !product.external) .map((product) => product.toc.replace('content/', '')) diff --git a/src/frame/lib/page-data.js b/src/frame/lib/page-data.js index 92105fea8ba9..9566bfd179fc 100644 --- a/src/frame/lib/page-data.js +++ b/src/frame/lib/page-data.js @@ -1,14 +1,14 @@ import path from 'path' -import languages from '#src/languages/lib/languages.ts' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import createTree from './create-tree.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 Permalink from './permalink.js' -import frontmatterSchema from './frontmatter.js' -import { correctTranslatedContentStrings } from '#src/languages/lib/correct-translation-content.js' +import languages from '@/languages/lib/languages' +import { allVersions } from '@/versions/lib/all-versions' +import createTree from './create-tree' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import readFileContents from './read-file-contents' +import Page from './page' +import Permalink from './permalink' +import frontmatterSchema from './frontmatter' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content' // If you run `export DEBUG_TRANSLATION_FALLBACKS=true` in your terminal, // every time a translation file fails to initialize we fall back to English diff --git a/src/frame/lib/page.js b/src/frame/lib/page.js index e890cef11d00..58c3a1532da6 100644 --- a/src/frame/lib/page.js +++ b/src/frame/lib/page.js @@ -1,23 +1,23 @@ import assert from 'assert' import path from 'path' import cheerio from 'cheerio' -import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js' -import generateRedirectsForPermalinks from '#src/redirects/lib/permalinks.js' -import getEnglishHeadings from '#src/languages/lib/get-english-headings.js' -import { getAlertTitles } from '#src/languages/lib/get-alert-titles.ts' -import getTocItems from './get-toc-items.js' -import Permalink from './permalink.js' -import { renderContent } from '#src/content-render/index.js' -import processLearningTracks from '#src/learning-track/lib/process-learning-tracks' -import { productMap } from '#src/products/lib/all-products.ts' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import generateRedirectsForPermalinks from '@/redirects/lib/permalinks' +import getEnglishHeadings from '@/languages/lib/get-english-headings' +import { getAlertTitles } from '@/languages/lib/get-alert-titles' +import getTocItems from './get-toc-items' +import Permalink from './permalink' +import { renderContent } from '@/content-render/index' +import processLearningTracks from '@/learning-track/lib/process-learning-tracks' +import { productMap } from '@/products/lib/all-products' import slash from 'slash' -import readFileContents from './read-file-contents.js' -import getLinkData from '#src/learning-track/lib/get-link-data' -import getDocumentType from '#src/events/lib/get-document-type.ts' -import { allTools } from '#src/tools/lib/all-tools.ts' -import { renderContentWithFallback } from '#src/languages/lib/render-with-fallback.js' -import { deprecated, supported } from '#src/versions/lib/enterprise-server-releases.js' -import { allPlatforms } from '#src/tools/lib/all-platforms.ts' +import readFileContents from './read-file-contents' +import getLinkData from '@/learning-track/lib/get-link-data' +import getDocumentType from '@/events/lib/get-document-type' +import { allTools } from '@/tools/lib/all-tools' +import { renderContentWithFallback } from '@/languages/lib/render-with-fallback' +import { deprecated, supported } from '@/versions/lib/enterprise-server-releases' +import { allPlatforms } from '@/tools/lib/all-platforms' // We're going to check a lot of pages' "ID" (the first part of // the relativePath) against `productMap` to make sure it's valid. diff --git a/src/frame/lib/path-utils.js b/src/frame/lib/path-utils.js index 2fc8d43f8abf..724cedb159c3 100644 --- a/src/frame/lib/path-utils.js +++ b/src/frame/lib/path-utils.js @@ -1,10 +1,10 @@ import slash from 'slash' import path from 'path' -import patterns from './patterns.js' -import { latest } from '#src/versions/lib/enterprise-server-releases.js' -import { productIds } from '#src/products/lib/all-products.ts' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' +import patterns from './patterns' +import { latest } from '@/versions/lib/enterprise-server-releases' +import { productIds } from '@/products/lib/all-products' +import { allVersions } from '@/versions/lib/all-versions' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' const supportedVersions = new Set(Object.keys(allVersions)) // Extracts the language code from the path diff --git a/src/frame/lib/permalink.js b/src/frame/lib/permalink.js index ff2448b63ec3..34b34d30f504 100644 --- a/src/frame/lib/permalink.js +++ b/src/frame/lib/permalink.js @@ -1,7 +1,7 @@ import assert from 'assert' import path from 'path' -import patterns from './patterns.js' -import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js' +import patterns from './patterns' +import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path' /* This class creates the "permalinks" that power a page's different versions, diff --git a/src/frame/lib/read-file-contents.js b/src/frame/lib/read-file-contents.js index 5b929dcd0c0a..9b3aefc698c0 100644 --- a/src/frame/lib/read-file-contents.js +++ b/src/frame/lib/read-file-contents.js @@ -1,7 +1,7 @@ import fs from 'fs/promises' -import encodeBracketedParentheses from './encode-bracketed-parentheses.js' -import fm from './frontmatter.js' +import encodeBracketedParentheses from './encode-bracketed-parentheses' +import fm from './frontmatter' /** * Read only the frontmatter from file diff --git a/src/frame/lib/read-frontmatter.js b/src/frame/lib/read-frontmatter.js index 2c6431015619..25a153d17843 100644 --- a/src/frame/lib/read-frontmatter.js +++ b/src/frame/lib/read-frontmatter.js @@ -1,6 +1,6 @@ import matter from 'gray-matter' -import { validateJson } from '#src/tests/lib/validate-json-schema.ts' +import { validateJson } from '@/tests/lib/validate-json-schema' function readFrontmatter(markdown, opts = {}) { const schema = opts.schema || { type: 'object', properties: {} } diff --git a/src/frame/lib/warm-server.ts b/src/frame/lib/warm-server.ts index 1130ed45e940..e725f9e2ae7b 100644 --- a/src/frame/lib/warm-server.ts +++ b/src/frame/lib/warm-server.ts @@ -1,6 +1,6 @@ -import statsd from '@/observability/lib/statsd.js' -import { loadUnversionedTree, loadSiteTree, loadPages, loadPageMap } from './page-data.js' -import loadRedirects from '@/redirects/lib/precompile.js' +import statsd from '@/observability/lib/statsd' +import { loadUnversionedTree, loadSiteTree, loadPages, loadPageMap } from './page-data' +import loadRedirects from '@/redirects/lib/precompile' // Instrument these functions so that // it's wrapped in a timer that reports to Datadog diff --git a/src/frame/middleware/abort.ts b/src/frame/middleware/abort.ts index 4875e55207f0..c90ca8e5aa85 100644 --- a/src/frame/middleware/abort.ts +++ b/src/frame/middleware/abort.ts @@ -1,6 +1,6 @@ import type { NextFunction, Response } from 'express' -import statsd from '@/observability/lib/statsd.js' +import statsd from '@/observability/lib/statsd' import { ExtendedRequest } from '@/types' class AbortError extends Error { diff --git a/src/frame/middleware/api.ts b/src/frame/middleware/api.ts index 4d2ec8394f14..706bf88cf42c 100644 --- a/src/frame/middleware/api.ts +++ b/src/frame/middleware/api.ts @@ -1,14 +1,14 @@ import express from 'express' import { createProxyMiddleware } from 'http-proxy-middleware' -import events from '@/events/middleware.js' -import anchorRedirect from '@/rest/api/anchor-redirect.js' +import events from '@/events/middleware' +import anchorRedirect from '@/rest/api/anchor-redirect' import aiSearch from '@/search/middleware/ai-search' import aiSearchLocalProxy from '@/search/middleware/ai-search-local-proxy' -import search from '@/search/middleware/search-routes.js' +import search from '@/search/middleware/search-routes' import pageList from '@/article-api/middleware/pagelist' import article from '@/article-api/middleware/article' -import webhooks from '@/webhooks/middleware/webhooks.js' +import webhooks from '@/webhooks/middleware/webhooks' import { ExtendedRequest } from '@/types' import { noCacheControl } from './cache-control' diff --git a/src/frame/middleware/block-robots.ts b/src/frame/middleware/block-robots.ts index f07118409420..0a9b1013f54e 100644 --- a/src/frame/middleware/block-robots.ts +++ b/src/frame/middleware/block-robots.ts @@ -1,7 +1,7 @@ import type { Request, Response, NextFunction } from 'express' -import { productMap } from '@/products/lib/all-products.js' -import { deprecated } from '@/versions/lib/enterprise-server-releases.js' +import { productMap } from '@/products/lib/all-products' +import { deprecated } from '@/versions/lib/enterprise-server-releases' const pathRegExps: RegExp[] = [ // Disallow indexing of WIP products diff --git a/src/frame/middleware/build-info.ts b/src/frame/middleware/build-info.ts index 5f4f8e68434e..c5426c220a02 100644 --- a/src/frame/middleware/build-info.ts +++ b/src/frame/middleware/build-info.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { noCacheControl } from './cache-control.js' +import { noCacheControl } from './cache-control' const BUILD_SHA = process.env.BUILD_SHA diff --git a/src/frame/middleware/categories-for-support.ts b/src/frame/middleware/categories-for-support.ts index e7cba4c70525..72e12e190a48 100644 --- a/src/frame/middleware/categories-for-support.ts +++ b/src/frame/middleware/categories-for-support.ts @@ -1,6 +1,6 @@ import type { Response } from 'express' -import { defaultCacheControl } from './cache-control.js' +import { defaultCacheControl } from './cache-control' import type { Context, ExtendedRequest, Tree } from '@/types' const renderOpts = { textOnly: true } diff --git a/src/frame/middleware/context/context.ts b/src/frame/middleware/context/context.ts index 6c2129d20148..413eb166a023 100644 --- a/src/frame/middleware/context/context.ts +++ b/src/frame/middleware/context/context.ts @@ -3,20 +3,20 @@ import type { NextFunction, Response } from 'express' import type { ExtendedRequest, Context } from '@/types' import languages from '@/languages/lib/languages' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' import { allVersions } from '@/versions/lib/all-versions' -import { productMap } from '@/products/lib/all-products.js' +import { productMap } from '@/products/lib/all-products' import { getVersionStringFromPath, getProductStringFromPath, getCategoryStringFromPath, getPathWithoutLanguage, getPathWithoutVersion, -} from '@/frame/lib/path-utils.js' -import productNames from '@/products/lib/product-names.js' +} from '@/frame/lib/path-utils' +import productNames from '@/products/lib/product-names' import warmServer from '@/frame/lib/warm-server' -import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' -import { getDataByLanguage, getUIDataMerged } from '@/data-directory/lib/get-data.js' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { getDataByLanguage, getUIDataMerged } from '@/data-directory/lib/get-data' // This doesn't change just because the request changes, so compute it once. const enterpriseServerVersions = Object.keys(allVersions).filter((version) => diff --git a/src/frame/middleware/context/current-product-tree.ts b/src/frame/middleware/context/current-product-tree.ts index 440c2f6ed7a1..db26035a826a 100644 --- a/src/frame/middleware/context/current-product-tree.ts +++ b/src/frame/middleware/context/current-product-tree.ts @@ -3,10 +3,10 @@ import path from 'path' import type { Response, NextFunction } from 'express' import type { ExtendedRequest, TitlesTree, Tree, Context } from '@/types' -import { liquid } from '@/content-render/index.js' +import { liquid } from '@/content-render/index' import findPageInSiteTree from '@/frame/lib/find-page-in-site-tree' -import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path.js' -import { executeWithFallback } from '@/languages/lib/render-with-fallback.js' +import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path' +import { executeWithFallback } from '@/languages/lib/render-with-fallback' // This module adds currentProductTree to the context object for use in layouts. export default async function currentProductTree( diff --git a/src/frame/middleware/context/generic-toc.ts b/src/frame/middleware/context/generic-toc.ts index f9e09ede8dea..c15a74eaa146 100644 --- a/src/frame/middleware/context/generic-toc.ts +++ b/src/frame/middleware/context/generic-toc.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest, Context, Tree, ToC } from '@/types' -import findPageInSiteTree from '@/frame/lib/find-page-in-site-tree.js' +import findPageInSiteTree from '@/frame/lib/find-page-in-site-tree' // This module adds either flatTocItems or nestedTocItems to the context object for // product, category, and subcategory TOCs that don't have other layouts specified. diff --git a/src/frame/middleware/context/glossaries.ts b/src/frame/middleware/context/glossaries.ts index 66c84ea78ee8..461156fe80c2 100644 --- a/src/frame/middleware/context/glossaries.ts +++ b/src/frame/middleware/context/glossaries.ts @@ -1,10 +1,10 @@ import type { Response, NextFunction } from 'express' import type { Context, ExtendedRequest, Glossary } from '@/types' -import { getDataByLanguage } from '@/data-directory/lib/get-data.js' -import { liquid } from '@/content-render/index.js' -import { executeWithFallback } from '@/languages/lib/render-with-fallback.js' -import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content.js' +import { getDataByLanguage } from '@/data-directory/lib/get-data' +import { liquid } from '@/content-render/index' +import { executeWithFallback } from '@/languages/lib/render-with-fallback' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content' export default async function glossaries(req: ExtendedRequest, res: Response, next: NextFunction) { if (!req.pagePath) throw new Error('request is not contextualized') diff --git a/src/frame/middleware/context/product-examples.ts b/src/frame/middleware/context/product-examples.ts index 5c74a94008ff..a40b0a4390f2 100644 --- a/src/frame/middleware/context/product-examples.ts +++ b/src/frame/middleware/context/product-examples.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest, ProductExample } from '@/types' -import { getDataByLanguage } from '@/data-directory/lib/get-data.js' +import { getDataByLanguage } from '@/data-directory/lib/get-data' function getProductExampleData( product: string, diff --git a/src/frame/middleware/context/render-product-name.ts b/src/frame/middleware/context/render-product-name.ts index 786c3b614e86..151afab5cc68 100644 --- a/src/frame/middleware/context/render-product-name.ts +++ b/src/frame/middleware/context/render-product-name.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest } from '@/types' -import { renderContent } from '@/content-render/index.js' +import { renderContent } from '@/content-render/index' export default async function renderProductName( req: ExtendedRequest, diff --git a/src/frame/middleware/context/whats-new-changelog.ts b/src/frame/middleware/context/whats-new-changelog.ts index 3772b7b12989..b0ec238d10c0 100644 --- a/src/frame/middleware/context/whats-new-changelog.ts +++ b/src/frame/middleware/context/whats-new-changelog.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' -import { getChangelogItems } from '@/changelogs/lib/changelog.js' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' +import { getChangelogItems } from '@/changelogs/lib/changelog' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' import type { ExtendedRequest } from '@/types' export default async function whatsNewChangelog( diff --git a/src/frame/middleware/fast-head.ts b/src/frame/middleware/fast-head.ts index d64f9c5f2e74..2930aeda248f 100644 --- a/src/frame/middleware/fast-head.ts +++ b/src/frame/middleware/fast-head.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest } from '@/types' -import { defaultCacheControl } from './cache-control.js' +import { defaultCacheControl } from './cache-control' export default function fastHead(req: ExtendedRequest, res: Response, next: NextFunction) { if (!req.context) throw new Error('request is not contextualized') diff --git a/src/frame/middleware/favicons.ts b/src/frame/middleware/favicons.ts index c3fafea883a7..44993db15454 100644 --- a/src/frame/middleware/favicons.ts +++ b/src/frame/middleware/favicons.ts @@ -8,8 +8,8 @@ import fs from 'fs' import type { Response, NextFunction } from 'express' import type { ExtendedRequest } from '@/types' -import { SURROGATE_ENUMS, setFastlySurrogateKey } from './set-fastly-surrogate-key.js' -import { assetCacheControl } from './cache-control.js' +import { SURROGATE_ENUMS, setFastlySurrogateKey } from './set-fastly-surrogate-key' +import { assetCacheControl } from './cache-control' type IconConfig = { contentType: string diff --git a/src/frame/middleware/find-page.js b/src/frame/middleware/find-page.js index b4726c32eb21..d0305c489299 100644 --- a/src/frame/middleware/find-page.js +++ b/src/frame/middleware/find-page.js @@ -1,9 +1,9 @@ import path from 'path' import { existsSync } from 'fs' -import { ROOT } from '#src/frame/lib/constants.js' -import Page from '#src/frame/lib/page.js' -import { languagePrefixPathRegex } from '#src/languages/lib/languages.ts' +import { ROOT } from '@/frame/lib/constants' +import Page from '@/frame/lib/page' +import { languagePrefixPathRegex } from '@/languages/lib/languages' const englishPrefixRegex = /^\/en(\/|$)/ const CONTENT_ROOT = path.join(ROOT, 'content') diff --git a/src/frame/middleware/handle-next-data-path.ts b/src/frame/middleware/handle-next-data-path.ts index 7c3aa87713d1..8aff87bbdabf 100644 --- a/src/frame/middleware/handle-next-data-path.ts +++ b/src/frame/middleware/handle-next-data-path.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' -import statsd from '@/observability/lib/statsd.js' +import statsd from '@/observability/lib/statsd' -import type { ExtendedRequest } from '@/types.js' +import type { ExtendedRequest } from '@/types' const STATSD_KEY = 'middleware.handle_next_data_path' diff --git a/src/frame/middleware/healthcheck.ts b/src/frame/middleware/healthcheck.ts index da828963cee0..a230878b6381 100644 --- a/src/frame/middleware/healthcheck.ts +++ b/src/frame/middleware/healthcheck.ts @@ -1,5 +1,5 @@ import express from 'express' -import { noCacheControl } from './cache-control.js' +import { noCacheControl } from './cache-control' const router = express.Router() diff --git a/src/frame/middleware/helmet.ts b/src/frame/middleware/helmet.ts index 7f8d4e2ba679..10a44572d919 100644 --- a/src/frame/middleware/helmet.ts +++ b/src/frame/middleware/helmet.ts @@ -1,7 +1,7 @@ import type { NextFunction, Request, Response } from 'express' import helmet from 'helmet' import { isArchivedVersion } from '@/archives/lib/is-archived-version' -import versionSatisfiesRange from '@/versions/lib/version-satisfies-range.js' +import versionSatisfiesRange from '@/versions/lib/version-satisfies-range' import { languagePrefixPathRegex } from '@/languages/lib/languages' const isDev = process.env.NODE_ENV === 'development' diff --git a/src/frame/middleware/index.ts b/src/frame/middleware/index.ts index c4ffb245fd0a..a2bbd4c317b8 100644 --- a/src/frame/middleware/index.ts +++ b/src/frame/middleware/index.ts @@ -13,16 +13,16 @@ import cookieParser from './cookie-parser' import { setDefaultFastlySurrogateKey, setLanguageFastlySurrogateKey, -} from './set-fastly-surrogate-key.js' +} from './set-fastly-surrogate-key' import handleErrors from '@/observability/middleware/handle-errors' import handleNextDataPath from './handle-next-data-path' import detectLanguage from '@/languages/middleware/detect-language' import reloadTree from './reload-tree' import context from './context/context' -import shortVersions from '@/versions/middleware/short-versions.js' +import shortVersions from '@/versions/middleware/short-versions' import languageCodeRedirects from '@/redirects/middleware/language-code-redirects' import handleRedirects from '@/redirects/middleware/handle-redirects' -import findPage from './find-page.js' +import findPage from './find-page' import blockRobots from './block-robots' import archivedEnterpriseVersionsAssets from '@/archives/middleware/archived-enterprise-versions-assets' import api from './api' @@ -63,7 +63,7 @@ import mockVaPortal from './mock-va-portal' import dynamicAssets from '@/assets/middleware/dynamic-assets' import generalSearchMiddleware from '@/search/middleware/general-search-middleware' import shielding from '@/shielding/middleware' -import { MAX_REQUEST_TIMEOUT } from '@/frame/lib/constants.js' +import { MAX_REQUEST_TIMEOUT } from '@/frame/lib/constants' const { NODE_ENV } = process.env const isTest = NODE_ENV === 'test' || process.env.GITHUB_ACTIONS === 'true' diff --git a/src/frame/middleware/llms-txt.ts b/src/frame/middleware/llms-txt.ts index 38b095bc740d..975162fde4cd 100644 --- a/src/frame/middleware/llms-txt.ts +++ b/src/frame/middleware/llms-txt.ts @@ -2,9 +2,9 @@ import type { Response } from 'express' import express from 'express' import type { ExtendedRequest } from '@/types' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' -import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js' -import statsd from '@/observability/lib/statsd.js' +import { defaultCacheControl } from '@/frame/middleware/cache-control' +import catchMiddlewareError from '@/observability/middleware/catch-middleware-error' +import statsd from '@/observability/lib/statsd' import languages from '@/languages/lib/languages' import { allVersions } from '@/versions/lib/all-versions' diff --git a/src/frame/middleware/manifest-json.ts b/src/frame/middleware/manifest-json.ts index 83b3395ad1bb..df951553b5d1 100644 --- a/src/frame/middleware/manifest-json.ts +++ b/src/frame/middleware/manifest-json.ts @@ -2,7 +2,7 @@ import type { NextFunction, Request, Response } from 'express' import fs from 'fs' import path from 'path' -import { defaultCacheControl } from './cache-control.js' +import { defaultCacheControl } from './cache-control' const ICONS = [ './assets/images/site/apple-touch-icon-57x57.png', diff --git a/src/frame/middleware/reload-tree.ts b/src/frame/middleware/reload-tree.ts index abb7f36147e7..6f9b4fd25a1b 100644 --- a/src/frame/middleware/reload-tree.ts +++ b/src/frame/middleware/reload-tree.ts @@ -20,10 +20,10 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest, UnversionedTree, SiteTree } from '@/types' import languages, { languageKeys } from '@/languages/lib/languages' -import createTree from '@/frame/lib/create-tree.js' +import createTree from '@/frame/lib/create-tree' import warmServer from '@/frame/lib/warm-server' -import { loadSiteTree, loadPages, loadPageMap } from '@/frame/lib/page-data.js' -import loadRedirects from '@/redirects/lib/precompile.js' +import { loadSiteTree, loadPages, loadPageMap } from '@/frame/lib/page-data' +import loadRedirects from '@/redirects/lib/precompile' const languagePrefixRegex = new RegExp(`^/(${languageKeys.join('|')})(/|$)`) const englishPrefixRegex = /^\/en(\/|$)/ diff --git a/src/frame/middleware/render-page.ts b/src/frame/middleware/render-page.ts index 25226e9f5ca0..50fe0b330d7f 100644 --- a/src/frame/middleware/render-page.ts +++ b/src/frame/middleware/render-page.ts @@ -5,16 +5,16 @@ import type { Response } from 'express' import type { Failbot } from '@github/failbot' import type { ExtendedRequest } from '@/types' -import FailBot from '@/observability/lib/failbot.js' -import patterns from '@/frame/lib/patterns.js' -import getMiniTocItems from '@/frame/lib/get-mini-toc-items.js' +import FailBot from '@/observability/lib/failbot' +import patterns from '@/frame/lib/patterns' +import getMiniTocItems from '@/frame/lib/get-mini-toc-items' import { pathLanguagePrefixed } from '@/languages/lib/languages' -import statsd from '@/observability/lib/statsd.js' +import statsd from '@/observability/lib/statsd' import { allVersions } from '@/versions/lib/all-versions' import { isConnectionDropped } from './halt-on-dropped-connection' -import { nextHandleRequest } from './next.js' -import { defaultCacheControl } from './cache-control.js' -import { minimumNotFoundHtml } from '../lib/constants.js' +import { nextHandleRequest } from './next' +import { defaultCacheControl } from './cache-control' +import { minimumNotFoundHtml } from '../lib/constants' const STATSD_KEY_RENDER = 'middleware.render_page' const STATSD_KEY_404 = 'middleware.render_404' diff --git a/src/frame/middleware/req-headers.ts b/src/frame/middleware/req-headers.ts index 1beb0acabbc6..8a048a08f4cf 100644 --- a/src/frame/middleware/req-headers.ts +++ b/src/frame/middleware/req-headers.ts @@ -1,6 +1,6 @@ import type { Request, Response } from 'express' -import { noCacheControl } from './cache-control.js' +import { noCacheControl } from './cache-control' export default function reqHeaders(req: Request, res: Response) { noCacheControl(res) diff --git a/src/frame/middleware/robots.ts b/src/frame/middleware/robots.ts index b669ee603684..852454b6e671 100644 --- a/src/frame/middleware/robots.ts +++ b/src/frame/middleware/robots.ts @@ -1,6 +1,6 @@ import type { NextFunction, Response } from 'express' -import { defaultCacheControl } from './cache-control.js' +import { defaultCacheControl } from './cache-control' import type { ExtendedRequest } from '@/types' const defaultResponse = 'User-agent: *' diff --git a/src/frame/middleware/trailing-slashes.ts b/src/frame/middleware/trailing-slashes.ts index 70647c23f776..572cb5678692 100644 --- a/src/frame/middleware/trailing-slashes.ts +++ b/src/frame/middleware/trailing-slashes.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest } from '@/types' -import { defaultCacheControl } from './cache-control.js' +import { defaultCacheControl } from './cache-control' export default function trailingSlashes(req: ExtendedRequest, res: Response, next: NextFunction) { if (req.method === 'GET' || req.method === 'HEAD' || req.method === 'OPTIONS') { diff --git a/src/frame/tests/api.js b/src/frame/tests/api.js index 2b1e04825a59..a7b26676de4b 100644 --- a/src/frame/tests/api.js +++ b/src/frame/tests/api.js @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { get } from '#src/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' describe('general /api pages', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/frame/tests/block-robots.ts b/src/frame/tests/block-robots.ts index a8fa3d175f9f..66f858c93cb2 100644 --- a/src/frame/tests/block-robots.ts +++ b/src/frame/tests/block-robots.ts @@ -1,8 +1,8 @@ import { describe, expect, test } from 'vitest' import { blockIndex } from '@/frame/middleware/block-robots' -import { productMap } from '@/products/lib/all-products.js' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' +import { productMap } from '@/products/lib/all-products' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' function allowIndex(path: string) { return !blockIndex(path) diff --git a/src/frame/tests/content.js b/src/frame/tests/content.js index f3f7992cc840..543c7dd6a1f7 100644 --- a/src/frame/tests/content.js +++ b/src/frame/tests/content.js @@ -3,7 +3,7 @@ import path from 'path' import { describe, expect, test } from 'vitest' import walk from 'walk-sync' -import createTree from '#src/frame/lib/create-tree.js' +import createTree from '@/frame/lib/create-tree' describe('content files', () => { test.each(['content', 'src/fixtures/fixtures/content'])( diff --git a/src/frame/tests/favicons.ts b/src/frame/tests/favicons.ts index 28b873047233..a67da1ed0e04 100644 --- a/src/frame/tests/favicons.ts +++ b/src/frame/tests/favicons.ts @@ -1,7 +1,7 @@ import { describe, expect, test, vi } from 'vitest' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' -import { get } from '@/tests/helpers/e2etest.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { get } from '@/tests/helpers/e2etest' describe('favicon assets', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/frame/tests/find-page-middleware.js b/src/frame/tests/find-page-middleware.js index 16c798c22bdc..6ce357da7ac8 100644 --- a/src/frame/tests/find-page-middleware.js +++ b/src/frame/tests/find-page-middleware.js @@ -4,8 +4,8 @@ import http from 'http' import { describe, expect, test } from 'vitest' -import Page from '#src/frame/lib/page.js' -import findPage from '#src/frame/middleware/find-page.js' +import Page from '@/frame/lib/page' +import findPage from '@/frame/middleware/find-page' const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/src/frame/tests/find-page.js b/src/frame/tests/find-page.js index 2b07cecfe5e4..160fc438d51d 100644 --- a/src/frame/tests/find-page.js +++ b/src/frame/tests/find-page.js @@ -3,8 +3,8 @@ import path from 'path' import { describe, expect, test, vi } from 'vitest' -import Page from '#src/frame/lib/page.js' -import findPage from '#src/frame/lib/find-page.js' +import Page from '@/frame/lib/page' +import findPage from '@/frame/lib/find-page' const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/src/frame/tests/get-remote-json.js b/src/frame/tests/get-remote-json.js index 318bd1319b19..950e56637d18 100644 --- a/src/frame/tests/get-remote-json.js +++ b/src/frame/tests/get-remote-json.js @@ -6,7 +6,7 @@ import { rimraf } from 'rimraf' import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest' import nock from 'nock' -import getRemoteJSON, { cache } from '#src/frame/lib/get-remote-json.js' +import getRemoteJSON, { cache } from '@/frame/lib/get-remote-json' /** * diff --git a/src/frame/tests/llms-txt.ts b/src/frame/tests/llms-txt.ts index 91f48ec3abef..be882f2f4e41 100644 --- a/src/frame/tests/llms-txt.ts +++ b/src/frame/tests/llms-txt.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' describe('llms.txt endpoint', () => { test('returns 200 OK', async () => { diff --git a/src/frame/tests/manifest.ts b/src/frame/tests/manifest.ts index c1ba9e00fc58..aff2fd9f7906 100644 --- a/src/frame/tests/manifest.ts +++ b/src/frame/tests/manifest.ts @@ -1,8 +1,8 @@ import { describe, expect, test } from 'vitest' import sharp from 'sharp' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' -import { get, getDOM } from '@/tests/helpers/e2etest.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { get, getDOM } from '@/tests/helpers/e2etest' type Manifest = { name: string diff --git a/src/frame/tests/mini-toc-items.js b/src/frame/tests/mini-toc-items.js index 443c4e399602..12f1efb4562f 100644 --- a/src/frame/tests/mini-toc-items.js +++ b/src/frame/tests/mini-toc-items.js @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import getMiniTocItems from '#src/frame/lib/get-mini-toc-items' +import getMiniTocItems from '@/frame/lib/get-mini-toc-items' function generateHeading(h) { return (slug) => `<${h} id="${slug}"> diff --git a/src/frame/tests/next.ts b/src/frame/tests/next.ts index d18c82fdbad9..36a5b43694ce 100644 --- a/src/frame/tests/next.ts +++ b/src/frame/tests/next.ts @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' describe('bad requests', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/frame/tests/page.js b/src/frame/tests/page.js index b623a8bcf844..8c93b709d62b 100644 --- a/src/frame/tests/page.js +++ b/src/frame/tests/page.js @@ -4,10 +4,10 @@ import path from 'path' import cheerio from 'cheerio' import { beforeAll, beforeEach, describe, expect, test } from 'vitest' -import Page, { FrontmatterErrorsError } from '#src/frame/lib/page.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import enterpriseServerReleases, { latest } from '#src/versions/lib/enterprise-server-releases.js' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' +import Page, { FrontmatterErrorsError } from '@/frame/lib/page' +import { allVersions } from '@/versions/lib/all-versions' +import enterpriseServerReleases, { latest } from '@/versions/lib/enterprise-server-releases' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const enterpriseServerVersions = Object.keys(allVersions).filter((v) => diff --git a/src/frame/tests/pages.js b/src/frame/tests/pages.js index d346f1c7c513..5deda9849e68 100644 --- a/src/frame/tests/pages.js +++ b/src/frame/tests/pages.js @@ -5,11 +5,11 @@ import GithubSlugger from 'github-slugger' import { decode } from 'html-entities' import { chain, pick } from 'lodash-es' -import { loadPages } from '#src/frame/lib/page-data.js' -import libLanguages from '#src/languages/lib/languages.ts' -import { liquid } from '#src/content-render/index.js' -import patterns from '#src/frame/lib/patterns.js' -import removeFPTFromPath from '#src/versions/lib/remove-fpt-from-path.js' +import { loadPages } from '@/frame/lib/page-data' +import libLanguages from '@/languages/lib/languages' +import { liquid } from '@/content-render/index' +import patterns from '@/frame/lib/patterns' +import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path' const languageCodes = Object.keys(libLanguages) const slugger = new GithubSlugger() diff --git a/src/frame/tests/permalink.js b/src/frame/tests/permalink.js index d87a01928cb0..136ed12fe80d 100644 --- a/src/frame/tests/permalink.js +++ b/src/frame/tests/permalink.js @@ -1,9 +1,9 @@ import { describe, expect, test } from 'vitest' -import Permalink from '#src/frame/lib/permalink.js' -import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js' +import Permalink from '@/frame/lib/permalink' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' // Permalink constructor requires: languageCode, pageVersion, relativePath, title // Permalink.derive requires: languageCode, relativePath, title, versions (<- FM prop) diff --git a/src/frame/tests/read-frontmatter.js b/src/frame/tests/read-frontmatter.js index 0b6c1b09706d..a4d3a03d312d 100644 --- a/src/frame/tests/read-frontmatter.js +++ b/src/frame/tests/read-frontmatter.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import parse from '#src/frame/lib/read-frontmatter.js' -import { schema as frontmatterSchema } from '#src/frame/lib/frontmatter.js' +import parse from '@/frame/lib/read-frontmatter' +import { schema as frontmatterSchema } from '@/frame/lib/frontmatter' const filepath = 'path/to/file.md' const fixture1 = `--- diff --git a/src/frame/tests/robots-txt.ts b/src/frame/tests/robots-txt.ts index f785d4b1ab8b..fd62e42c2e85 100644 --- a/src/frame/tests/robots-txt.ts +++ b/src/frame/tests/robots-txt.ts @@ -5,8 +5,8 @@ import robotsParser, { type Robot } from 'robots-parser' import { SURROGATE_ENUMS, makeLanguageSurrogateKey, -} from '@/frame/middleware/set-fastly-surrogate-key.js' -import { get } from '@/tests/helpers/e2etest.js' +} from '@/frame/middleware/set-fastly-surrogate-key' +import { get } from '@/tests/helpers/e2etest' describe('robots.txt', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/frame/tests/server.js b/src/frame/tests/server.js index ee0526eca03d..74102c741e50 100644 --- a/src/frame/tests/server.js +++ b/src/frame/tests/server.js @@ -1,14 +1,14 @@ import CspParse from 'csp-parse' import { beforeAll, describe, expect, test, vi } from 'vitest' -import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { get, getDOM, head, post } from '#src/tests/helpers/e2etest.js' -import { describeViaActionsOnly } from '#src/tests/helpers/conditional-runs.ts' -import { loadPages } from '#src/frame/lib/page-data.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' +import { get, getDOM, head, post } from '@/tests/helpers/e2etest' +import { describeViaActionsOnly } from '@/tests/helpers/conditional-runs' +import { loadPages } from '@/frame/lib/page-data' import { SURROGATE_ENUMS, makeLanguageSurrogateKey, -} from '#src/frame/middleware/set-fastly-surrogate-key.js' +} from '@/frame/middleware/set-fastly-surrogate-key' describe('server', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/frame/tests/site-tree.js b/src/frame/tests/site-tree.js index 149416bce068..2e15fdf46957 100644 --- a/src/frame/tests/site-tree.js +++ b/src/frame/tests/site-tree.js @@ -1,11 +1,11 @@ import { beforeAll, describe, expect, test, vi } from 'vitest' -import { getJsonValidator } from '#src/tests/lib/validate-json-schema.ts' -import schema from '#src/tests/helpers/schemas/site-tree-schema.js' -import EnterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { loadSiteTree } from '#src/frame/lib/page-data.js' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { formatAjvErrors } from '#src/tests/helpers/schemas.ts' +import { getJsonValidator } from '@/tests/lib/validate-json-schema' +import schema from '@/tests/helpers/schemas/site-tree-schema' +import EnterpriseServerReleases from '@/versions/lib/enterprise-server-releases' +import { loadSiteTree } from '@/frame/lib/page-data' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { formatAjvErrors } from '@/tests/helpers/schemas' const latestEnterpriseRelease = EnterpriseServerReleases.latest diff --git a/src/frame/tests/toc-links.js b/src/frame/tests/toc-links.js index 713a985d1d65..73a7f1776a32 100644 --- a/src/frame/tests/toc-links.js +++ b/src/frame/tests/toc-links.js @@ -1,8 +1,8 @@ import { describe, expect, test, vi } from 'vitest' -import { loadPageMap, loadPages } from '#src/frame/lib/page-data.js' -import { renderContent } from '#src/content-render/index.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { loadPageMap, loadPages } from '@/frame/lib/page-data' +import { renderContent } from '@/content-render/index' +import { allVersions } from '@/versions/lib/all-versions' describe('toc links', () => { vi.setConfig({ testTimeout: 3 * 60 * 1000 }) diff --git a/src/ghes-releases/scripts/create-enterprise-issue.ts b/src/ghes-releases/scripts/create-enterprise-issue.ts index 6fa7a763670a..19663a370b2a 100644 --- a/src/ghes-releases/scripts/create-enterprise-issue.ts +++ b/src/ghes-releases/scripts/create-enterprise-issue.ts @@ -4,7 +4,7 @@ import { Liquid } from 'liquidjs' import walk from 'walk-sync' import matter from 'gray-matter' -import { latest, oldestSupported } from '@/versions/lib/enterprise-server-releases.js' +import { latest, oldestSupported } from '@/versions/lib/enterprise-server-releases' import { getContents } from '@/workflows/git-utils' import github from '@/workflows/github' diff --git a/src/ghes-releases/scripts/deprecate/archive-version.ts b/src/ghes-releases/scripts/deprecate/archive-version.ts index cf756816afa3..f1cd5aed0885 100755 --- a/src/ghes-releases/scripts/deprecate/archive-version.ts +++ b/src/ghes-releases/scripts/deprecate/archive-version.ts @@ -14,9 +14,9 @@ import { rimraf } from 'rimraf' import http from 'http' import createApp from '@/frame/lib/app' -import EnterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' -import loadRedirects from '@/redirects/lib/precompile.js' -import { loadPageMap, loadPages } from '@/frame/lib/page-data.js' +import EnterpriseServerReleases from '@/versions/lib/enterprise-server-releases' +import loadRedirects from '@/redirects/lib/precompile' +import { loadPageMap, loadPages } from '@/frame/lib/page-data' import { languageKeys } from '@/languages/lib/languages' import { RewriteAssetPathsPlugin } from '@/ghes-releases/scripts/deprecate/rewrite-asset-paths' diff --git a/src/ghes-releases/scripts/deprecate/update-automated-pipelines.ts b/src/ghes-releases/scripts/deprecate/update-automated-pipelines.ts index 44ae286acdc9..1401f969c581 100755 --- a/src/ghes-releases/scripts/deprecate/update-automated-pipelines.ts +++ b/src/ghes-releases/scripts/deprecate/update-automated-pipelines.ts @@ -15,7 +15,7 @@ import { rimrafSync } from 'rimraf' import { difference, intersection } from 'lodash-es' import { mkdirp } from 'mkdirp' -import { deprecated, supported } from '@/versions/lib/enterprise-server-releases.js' +import { deprecated, supported } from '@/versions/lib/enterprise-server-releases' const [currentReleaseNumber, previousReleaseNumber] = supported const pipelines = JSON.parse(await readFile('src/automated-pipelines/lib/config.json', 'utf-8'))[ diff --git a/src/ghes-releases/scripts/deprecate/update-content.ts b/src/ghes-releases/scripts/deprecate/update-content.ts index 30741f66efa9..8e6369fcd44b 100644 --- a/src/ghes-releases/scripts/deprecate/update-content.ts +++ b/src/ghes-releases/scripts/deprecate/update-content.ts @@ -3,10 +3,10 @@ import path from 'path' import yaml from 'js-yaml' import walkFiles from 'walk-sync' -import frontmatter from '@/frame/lib/read-frontmatter.js' -import { supported, deprecated } from '@/versions/lib/enterprise-server-releases.js' +import frontmatter from '@/frame/lib/read-frontmatter' +import { supported, deprecated } from '@/versions/lib/enterprise-server-releases' import { isInAllGhes } from '../version-utils' -import { Versions } from '@/types.js' +import { Versions } from '@/types' type featureDataType = Versions | undefined diff --git a/src/ghes-releases/scripts/deprecate/update-data.ts b/src/ghes-releases/scripts/deprecate/update-data.ts index 46d451220640..37719824d7d8 100644 --- a/src/ghes-releases/scripts/deprecate/update-data.ts +++ b/src/ghes-releases/scripts/deprecate/update-data.ts @@ -4,7 +4,7 @@ import walkFiles from 'walk-sync' import yaml from 'js-yaml' import { isInAllGhes, isFeatureDeprecated } from '../version-utils' -import type { MarkdownFrontmatter } from '@/types.ts' +import type { MarkdownFrontmatter } from '@/types' const contentFiles = walkFiles('content', { includeBasePath: true, diff --git a/src/ghes-releases/scripts/version-utils.ts b/src/ghes-releases/scripts/version-utils.ts index 202aa48b88a6..9e71b1d7cd63 100644 --- a/src/ghes-releases/scripts/version-utils.ts +++ b/src/ghes-releases/scripts/version-utils.ts @@ -1,8 +1,8 @@ import semver from 'semver' -import { supported } from '@/versions/lib/enterprise-server-releases.js' +import { supported } from '@/versions/lib/enterprise-server-releases' import getDataDirectory from '@/data-directory/lib/data-directory' -import { FeatureData, FrontmatterVersions } from '@/types.js' +import { FeatureData, FrontmatterVersions } from '@/types' // Return true if lowestSupportedVersion > semVerRange export function isGhesReleaseDeprecated(lowestSupportedVersion: string, semVerRange: string) { diff --git a/src/github-apps/lib/index.js b/src/github-apps/lib/index.js index 1975e4d21426..8af55e21d21d 100644 --- a/src/github-apps/lib/index.js +++ b/src/github-apps/lib/index.js @@ -1,9 +1,9 @@ import path from 'path' import { readFile } from 'fs/promises' -import { readCompressedJsonFileFallback } from '#src/frame/lib/read-json-file.js' -import { getOpenApiVersion } from '#src/versions/lib/all-versions.ts' -import { categoriesWithoutSubcategories } from '../../rest/lib/index.js' +import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file' +import { getOpenApiVersion } from '@/versions/lib/all-versions' +import { categoriesWithoutSubcategories } from '../../rest/lib/index' const ENABLED_APPS_DIR = 'src/github-apps/data' const githubAppsData = new Map() @@ -31,9 +31,9 @@ export async function getAppsData(pageType, docsVersion, apiVersion) { } export async function getAppsServerSideProps(context, pageType, { useDisplayTitle = false }) { - const { getAutomatedPageMiniTocItems } = await import('#src/frame/lib/get-mini-toc-items') + const { getAutomatedPageMiniTocItems } = await import('@/frame/lib/get-mini-toc-items') const { getAutomatedPageContextFromRequest } = await import( - '#src/automated-pipelines/components/AutomatedPageContext' + '@/automated-pipelines/components/AutomatedPageContext' ) const currentVersion = context.query.versionId const allVersions = context.req.context.allVersions diff --git a/src/github-apps/scripts/sync.js b/src/github-apps/scripts/sync.js index 89b338b584d9..0687025e7d7a 100755 --- a/src/github-apps/scripts/sync.js +++ b/src/github-apps/scripts/sync.js @@ -6,10 +6,10 @@ import { slug } from 'github-slugger' import yaml from 'js-yaml' import walk from 'walk-sync' -import { getContents, getDirectoryContents } from '#src/workflows/git-utils.ts' -import permissionSchema from './permission-list-schema.js' -import enabledSchema from './enabled-list-schema.js' -import { validateJson } from '#src/tests/lib/validate-json-schema.ts' +import { getContents, getDirectoryContents } from '@/workflows/git-utils' +import permissionSchema from './permission-list-schema' +import enabledSchema from './enabled-list-schema' +import { validateJson } from '@/tests/lib/validate-json-schema' const ENABLED_APPS_DIR = 'src/github-apps/data' const CONFIG_FILE = 'src/github-apps/lib/config.json' diff --git a/src/github-apps/tests/rendering.js b/src/github-apps/tests/rendering.js index 9dda42f8c44d..0db35c2c4d2e 100644 --- a/src/github-apps/tests/rendering.js +++ b/src/github-apps/tests/rendering.js @@ -2,10 +2,10 @@ import { readFile } from 'fs/promises' import { describe, expect, test, vi } from 'vitest' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { get, getDOM } from '#src/tests/helpers/e2etest.js' -import { categoriesWithoutSubcategories } from '#src/rest/lib/index.js' -import { getAppsData } from '#src/github-apps/lib/index.js' +import { allVersions } from '@/versions/lib/all-versions' +import { get, getDOM } from '@/tests/helpers/e2etest' +import { categoriesWithoutSubcategories } from '@/rest/lib/index' +import { getAppsData } from '@/github-apps/lib/index' const configContent = JSON.parse(await readFile('src/github-apps/lib/config.json', 'utf8')) const pageTypes = Object.keys(configContent.pages) diff --git a/src/graphql/lib/index.js b/src/graphql/lib/index.js index c1fcb22c9db6..b13f17bd6536 100644 --- a/src/graphql/lib/index.js +++ b/src/graphql/lib/index.js @@ -1,10 +1,10 @@ import { readCompressedJsonFileFallbackLazily, readCompressedJsonFileFallback, -} from '#src/frame/lib/read-json-file.js' -import { getAutomatedPageMiniTocItems } from '#src/frame/lib/get-mini-toc-items.js' -import languages from '#src/languages/lib/languages.ts' -import { allVersions } from '#src/versions/lib/all-versions.ts' +} from '@/frame/lib/read-json-file' +import { getAutomatedPageMiniTocItems } from '@/frame/lib/get-mini-toc-items' +import languages from '@/languages/lib/languages' +import { allVersions } from '@/versions/lib/all-versions' export const GRAPHQL_DATA_DIR = 'src/graphql/data' /* ADD LANGUAGE KEY */ diff --git a/src/graphql/scripts/build-changelog.js b/src/graphql/scripts/build-changelog.js index 2681394f59c3..2673bdb6aff9 100644 --- a/src/graphql/scripts/build-changelog.js +++ b/src/graphql/scripts/build-changelog.js @@ -1,7 +1,7 @@ import { diff, ChangeType } from '@graphql-inspector/core' import { loadSchema } from '@graphql-tools/load' import fs from 'fs' -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' /** * Tag `changelogEntry` with `date: YYYY-mm-dd`, then prepend it to the JSON diff --git a/src/graphql/scripts/sync.js b/src/graphql/scripts/sync.js index e84e66c4a216..d646a5bef102 100755 --- a/src/graphql/scripts/sync.js +++ b/src/graphql/scripts/sync.js @@ -3,12 +3,12 @@ import path from 'path' import { mkdirp } from 'mkdirp' import yaml from 'js-yaml' import { execSync } from 'child_process' -import { getContents, hasMatchingRef } from '#src/workflows/git-utils.ts' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import processPreviews from './utils/process-previews.js' -import processUpcomingChanges from './utils/process-upcoming-changes.js' -import processSchemas from './utils/process-schemas.js' -import { prependDatedEntry, createChangelogEntry } from './build-changelog.js' +import { getContents, hasMatchingRef } from '@/workflows/git-utils' +import { allVersions } from '@/versions/lib/all-versions' +import processPreviews from './utils/process-previews' +import processUpcomingChanges from './utils/process-upcoming-changes' +import processSchemas from './utils/process-schemas' +import { prependDatedEntry, createChangelogEntry } from './build-changelog' const graphqlStaticDir = 'src/graphql/data' const dataFilenames = JSON.parse(await fs.readFile('src/graphql/scripts/utils/data-filenames.json')) diff --git a/src/graphql/scripts/utils/process-schemas.js b/src/graphql/scripts/utils/process-schemas.js index 4363c159a664..ac0b0e11e24b 100755 --- a/src/graphql/scripts/utils/process-schemas.js +++ b/src/graphql/scripts/utils/process-schemas.js @@ -1,6 +1,6 @@ import { sortBy } from 'lodash-es' import { parse, buildASTSchema } from 'graphql' -import helpers from './schema-helpers.js' +import helpers from './schema-helpers' import fs from 'fs/promises' import path from 'path' diff --git a/src/graphql/scripts/utils/process-upcoming-changes.js b/src/graphql/scripts/utils/process-upcoming-changes.js index 3566a21cd36c..c7fb0b9b5aaa 100644 --- a/src/graphql/scripts/utils/process-upcoming-changes.js +++ b/src/graphql/scripts/utils/process-upcoming-changes.js @@ -1,6 +1,6 @@ import yaml from 'js-yaml' import { groupBy } from 'lodash-es' -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' export default async function processUpcomingChanges(upcomingChangesYml) { const upcomingChanges = yaml.load(upcomingChangesYml).upcoming_changes diff --git a/src/graphql/scripts/utils/schema-helpers.js b/src/graphql/scripts/utils/schema-helpers.js index 61b72635ac63..cd4bd1e026bd 100644 --- a/src/graphql/scripts/utils/schema-helpers.js +++ b/src/graphql/scripts/utils/schema-helpers.js @@ -1,4 +1,4 @@ -import { renderContent } from '#src/content-render/index.js' +import { renderContent } from '@/content-render/index' import fs from 'fs/promises' import { isScalarType, diff --git a/src/graphql/tests/build-changelog.js b/src/graphql/tests/build-changelog.js index 929379334873..2fe32ea5239b 100644 --- a/src/graphql/tests/build-changelog.js +++ b/src/graphql/tests/build-changelog.js @@ -9,8 +9,8 @@ import { cleanPreviewTitle, previewAnchor, prependDatedEntry, -} from '../scripts/build-changelog.js' -import readJsonFile from '#src/frame/lib/read-json-file.js' +} from '../scripts/build-changelog' +import readJsonFile from '@/frame/lib/read-json-file' const expectedChangelogEntry = readJsonFile('src/graphql/tests/fixtures/changelog-entry.json') const expectedUpdatedChangelogFile = readJsonFile( diff --git a/src/graphql/tests/get-schema-files.js b/src/graphql/tests/get-schema-files.js index c27902c3803f..d3479a5b1dc5 100644 --- a/src/graphql/tests/get-schema-files.js +++ b/src/graphql/tests/get-schema-files.js @@ -2,13 +2,13 @@ import { readFileSync } from 'fs' import { describe, expect, test } from 'vitest' -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { allVersions } from '@/versions/lib/all-versions' import { getGraphqlSchema, getGraphqlChangelog, getGraphqlBreakingChanges, getPreviews, -} from '../lib/index.js' +} from '../lib/index' describe('graphql schema', () => { const graphqlTypes = JSON.parse(readFileSync('src/graphql/lib/types.json')).map( diff --git a/src/graphql/tests/server-rendering.js b/src/graphql/tests/server-rendering.js index cd0eccd99118..f79e388cab31 100644 --- a/src/graphql/tests/server-rendering.js +++ b/src/graphql/tests/server-rendering.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { getDOM } from '#src/tests/helpers/e2etest.js' -import { loadPages } from '#src/frame/lib/page-data.js' +import { getDOM } from '@/tests/helpers/e2etest' +import { loadPages } from '@/frame/lib/page-data' const pageList = await loadPages(undefined, ['en']) diff --git a/src/graphql/tests/validate-schema.js b/src/graphql/tests/validate-schema.js index 4ac4ecc90999..7c192adb4f62 100644 --- a/src/graphql/tests/validate-schema.js +++ b/src/graphql/tests/validate-schema.js @@ -1,11 +1,11 @@ import { describe, expect, test, vi } from 'vitest' -import { getJsonValidator, validateJson } from '#src/tests/lib/validate-json-schema.ts' -import readJsonFile from '#src/frame/lib/read-json-file.js' -import { schemaValidator, previewsValidator, upcomingChangesValidator } from '../lib/validator.ts' -import { formatAjvErrors } from '#src/tests/helpers/schemas.ts' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { GRAPHQL_DATA_DIR } from '../lib/index.js' +import { getJsonValidator, validateJson } from '@/tests/lib/validate-json-schema' +import readJsonFile from '@/frame/lib/read-json-file' +import { schemaValidator, previewsValidator, upcomingChangesValidator } from '../lib/validator' +import { formatAjvErrors } from '@/tests/helpers/schemas' +import { allVersions } from '@/versions/lib/all-versions' +import { GRAPHQL_DATA_DIR } from '../lib/index' const allVersionValues = Object.values(allVersions) const graphqlVersions = allVersionValues.map((v) => v.openApiVersionName) diff --git a/src/landings/components/SidebarProduct.tsx b/src/landings/components/SidebarProduct.tsx index bf0312ba3a21..755abff32c5e 100644 --- a/src/landings/components/SidebarProduct.tsx +++ b/src/landings/components/SidebarProduct.tsx @@ -5,7 +5,7 @@ import { NavList } from '@primer/react' import { ProductTreeNode, useMainContext } from '@/frame/components/context/MainContext' import { useAutomatedPageContext } from '@/automated-pipelines/components/AutomatedPageContext' -import { nonAutomatedRestPaths } from '../../rest/lib/config.js' +import { nonAutomatedRestPaths } from '../../rest/lib/config' export const SidebarProduct = () => { const router = useRouter() diff --git a/src/landings/tests/curated-homepage-links.ts b/src/landings/tests/curated-homepage-links.ts index 7e966f384ed8..f0fdd5f2f508 100644 --- a/src/landings/tests/curated-homepage-links.ts +++ b/src/landings/tests/curated-homepage-links.ts @@ -1,7 +1,7 @@ import { describe, expect, test, vi } from 'vitest' import cheerio from 'cheerio' -import { getDOM } from '@/tests/helpers/e2etest.js' +import { getDOM } from '@/tests/helpers/e2etest' describe('curated homepage links', () => { vi.setConfig({ testTimeout: 3 * 60 * 1000 }) diff --git a/src/landings/tests/featured-links.ts b/src/landings/tests/featured-links.ts index 3b4048147c0e..3af70fe777f8 100644 --- a/src/landings/tests/featured-links.ts +++ b/src/landings/tests/featured-links.ts @@ -1,7 +1,7 @@ import { describe, expect, test, vi } from 'vitest' -import { getDOM } from '@/tests/helpers/e2etest.js' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' +import { getDOM } from '@/tests/helpers/e2etest' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' describe('featuredLinks', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/landings/tests/homepage.ts b/src/landings/tests/homepage.ts index 33f9f3e83878..a296fe2431db 100644 --- a/src/landings/tests/homepage.ts +++ b/src/landings/tests/homepage.ts @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { getDOM } from '@/tests/helpers/e2etest.js' +import { getDOM } from '@/tests/helpers/e2etest' describe('rendering the home page(s)', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/languages/components/useUserLanguage.ts b/src/languages/components/useUserLanguage.ts index d1c75997508e..1f8eb48aba7d 100644 --- a/src/languages/components/useUserLanguage.ts +++ b/src/languages/components/useUserLanguage.ts @@ -3,7 +3,7 @@ import Cookies from '@/frame/components/lib/cookies' import { useRouter } from 'next/router' import { useLanguages } from '@/languages/components/LanguagesContext' -import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants.js' +import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants' export function useUserLanguage() { const { locale } = useRouter() diff --git a/src/languages/lib/get-english-headings.js b/src/languages/lib/get-english-headings.js index 0c036ebceb6e..fc313f0a21d3 100644 --- a/src/languages/lib/get-english-headings.js +++ b/src/languages/lib/get-english-headings.js @@ -2,8 +2,8 @@ import { fromMarkdown } from 'mdast-util-from-markdown' import { toString } from 'mdast-util-to-string' import { visit } from 'unist-util-visit' -import findPage from '#src/frame/lib/find-page.js' -import { getDataByLanguage } from '#src/data-directory/lib/get-data.js' +import findPage from '@/frame/lib/find-page' +import { getDataByLanguage } from '@/data-directory/lib/get-data' // for any translated page, first get corresponding English markdown // then get the headings on both the translated and English pageMap diff --git a/src/languages/lib/render-with-fallback.js b/src/languages/lib/render-with-fallback.js index 0dbaf13d2ea3..39f797c14c4c 100644 --- a/src/languages/lib/render-with-fallback.js +++ b/src/languages/lib/render-with-fallback.js @@ -1,6 +1,6 @@ -import { renderContent } from '#src/content-render/index.js' -import Page from '#src/frame/lib/page.js' -import { TitleFromAutotitleError } from '#src/content-render/unified/rewrite-local-links.js' +import { renderContent } from '@/content-render/index' +import Page from '@/frame/lib/page' +import { TitleFromAutotitleError } from '@/content-render/unified/rewrite-local-links' export class EmptyTitleError extends Error {} diff --git a/src/languages/middleware/detect-language.ts b/src/languages/middleware/detect-language.ts index 5efa03ca504a..9b42794c4539 100644 --- a/src/languages/middleware/detect-language.ts +++ b/src/languages/middleware/detect-language.ts @@ -3,7 +3,7 @@ import parser from 'accept-language-parser' import type { Language as parserLanguage } from 'accept-language-parser' import languages, { languageKeys } from '@/languages/lib/languages' -import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants.js' +import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants' import type { ExtendedRequest, Languages } from '@/types' const chineseRegions = [ diff --git a/src/languages/scripts/count-translation-corruptions.ts b/src/languages/scripts/count-translation-corruptions.ts index 9029e7d6ffc8..4315db629f81 100644 --- a/src/languages/scripts/count-translation-corruptions.ts +++ b/src/languages/scripts/count-translation-corruptions.ts @@ -6,11 +6,11 @@ import chalk from 'chalk' import { TokenizationError } from 'liquidjs' import walk from 'walk-sync' -import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils' import languages from '@/languages/lib/languages' import warmServer from '@/frame/lib/warm-server' import type { Site } from '@/types' -import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content.js' +import { correctTranslatedContentStrings } from '@/languages/lib/correct-translation-content' program .description('Tally the number of liquid corruptions in a translation') diff --git a/src/languages/scripts/purge-fastly-edge-cache-per-language.js b/src/languages/scripts/purge-fastly-edge-cache-per-language.js index 0ca40f617856..96f23698bb4c 100755 --- a/src/languages/scripts/purge-fastly-edge-cache-per-language.js +++ b/src/languages/scripts/purge-fastly-edge-cache-per-language.js @@ -1,7 +1,7 @@ -import { languageKeys } from '#src/languages/lib/languages.ts' +import { languageKeys } from '@/languages/lib/languages' -import { makeLanguageSurrogateKey } from '#src/frame/middleware/set-fastly-surrogate-key.js' -import purgeEdgeCache from '#src/workflows/purge-edge-cache.ts' +import { makeLanguageSurrogateKey } from '@/frame/middleware/set-fastly-surrogate-key' +import purgeEdgeCache from '@/workflows/purge-edge-cache' /** * In simple terms, this script sends purge commands for... diff --git a/src/languages/tests/api-search.js b/src/languages/tests/api-search.js index 214a9c3b2308..ed5adb37e15d 100644 --- a/src/languages/tests/api-search.js +++ b/src/languages/tests/api-search.js @@ -1,7 +1,7 @@ import { expect, test, vi } from 'vitest' -import { describeIfElasticsearchURL } from '#src/tests/helpers/conditional-runs.ts' -import { get } from '#src/tests/helpers/e2etest.js' +import { describeIfElasticsearchURL } from '@/tests/helpers/conditional-runs' +import { get } from '@/tests/helpers/e2etest' // This suite only runs if $ELASTICSEARCH_URL is set. describeIfElasticsearchURL('search v1 middleware in non-English', () => { diff --git a/src/languages/tests/files.js b/src/languages/tests/files.js index a9daf351b654..b0508c436f4e 100644 --- a/src/languages/tests/files.js +++ b/src/languages/tests/files.js @@ -1,4 +1,4 @@ -import languages from '#src/languages/lib/languages.ts' +import languages from '@/languages/lib/languages' import { describe, expect, test, vi } from 'vitest' describe('files', () => { diff --git a/src/languages/tests/frame.ts b/src/languages/tests/frame.ts index 9244ba1c8f52..4140d36c1940 100644 --- a/src/languages/tests/frame.ts +++ b/src/languages/tests/frame.ts @@ -2,8 +2,8 @@ import { describe, expect, test, vi } from 'vitest' import { languageKeys } from '@/languages/lib/languages' import { blockIndex } from '@/frame/middleware/block-robots' -import { get, getDOMCached as getDOM } from '@/tests/helpers/e2etest.js' -import Page from '@/frame/lib/page.js' +import { get, getDOMCached as getDOM } from '@/tests/helpers/e2etest' +import Page from '@/frame/lib/page' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/glossary.ts b/src/languages/tests/glossary.ts index 9a23826ccf3c..5b3e58b3ad51 100644 --- a/src/languages/tests/glossary.ts +++ b/src/languages/tests/glossary.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' import { languageKeys } from '@/languages/lib/languages' -import { getDOM } from '@/tests/helpers/e2etest.js' +import { getDOM } from '@/tests/helpers/e2etest' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/llms-txt-translations.ts b/src/languages/tests/llms-txt-translations.ts index f9f0484694d7..1b4011f57694 100644 --- a/src/languages/tests/llms-txt-translations.ts +++ b/src/languages/tests/llms-txt-translations.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' import { languageKeys } from '@/languages/lib/languages' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/redirects.js b/src/languages/tests/redirects.js index 865792736b89..f718ee74138d 100644 --- a/src/languages/tests/redirects.js +++ b/src/languages/tests/redirects.js @@ -1,8 +1,8 @@ import { describe, expect, test } from 'vitest' -import { languageKeys } from '#src/languages/lib/languages.ts' -import { get } from '#src/tests/helpers/e2etest.js' -import { USER_LANGUAGE_COOKIE_NAME } from '#src/frame/lib/constants.js' +import { languageKeys } from '@/languages/lib/languages' +import { get } from '@/tests/helpers/e2etest' +import { USER_LANGUAGE_COOKIE_NAME } from '@/frame/lib/constants' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/search.js b/src/languages/tests/search.js index ee0bedb6998d..403cb5df0bc0 100644 --- a/src/languages/tests/search.js +++ b/src/languages/tests/search.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { languageKeys } from '#src/languages/lib/languages.ts' -import { get } from '#src/tests/helpers/e2etest.js' +import { languageKeys } from '@/languages/lib/languages' +import { get } from '@/tests/helpers/e2etest' const langs = languageKeys.filter((lang) => lang !== 'en') diff --git a/src/languages/tests/translation-error-comments.js b/src/languages/tests/translation-error-comments.js index 1217e656e267..15c2563335a7 100644 --- a/src/languages/tests/translation-error-comments.js +++ b/src/languages/tests/translation-error-comments.js @@ -4,9 +4,9 @@ import { EmptyTitleError, renderContentWithFallback, executeWithFallback, -} from '../lib/render-with-fallback.js' -import { TitleFromAutotitleError } from '#src/content-render/unified/rewrite-local-links.js' -import Page from '#src/frame/lib/page.js' +} from '../lib/render-with-fallback' +import { TitleFromAutotitleError } from '@/content-render/unified/rewrite-local-links' +import Page from '@/frame/lib/page' describe('Translation Error Comments', () => { // Mock renderContent for integration tests diff --git a/src/learning-track/middleware/learning-track.ts b/src/learning-track/middleware/learning-track.ts index 6eb260427fa0..827f796567c1 100644 --- a/src/learning-track/middleware/learning-track.ts +++ b/src/learning-track/middleware/learning-track.ts @@ -2,11 +2,11 @@ import type { Response, NextFunction } from 'express' import type { ExtendedRequest, LearningTracks } from '@/types' import type { Context, CurrentLearningTrack, TrackGuide } from '../lib/types' -import { getPathWithoutLanguage, getPathWithoutVersion } from '@/frame/lib/path-utils.js' +import { getPathWithoutLanguage, getPathWithoutVersion } from '@/frame/lib/path-utils' import getLinkData from '../lib/get-link-data' -import { renderContent } from '@/content-render/index.js' -import { executeWithFallback } from '@/languages/lib/render-with-fallback.js' -import { getDeepDataByLanguage } from '@/data-directory/lib/get-data.js' +import { renderContent } from '@/content-render/index' +import { executeWithFallback } from '@/languages/lib/render-with-fallback' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' export default async function learningTrack( req: ExtendedRequest & { context: Context }, diff --git a/src/learning-track/tests/lint-data.ts b/src/learning-track/tests/lint-data.ts index 3e1e3cafb128..37b7d3ba37cc 100644 --- a/src/learning-track/tests/lint-data.ts +++ b/src/learning-track/tests/lint-data.ts @@ -1,10 +1,10 @@ import { describe, expect, test } from 'vitest' import type { LearningTracks } from '@/types' -import { loadPages, loadPageMap } from '@/frame/lib/page-data.js' -import loadRedirects from '@/redirects/lib/precompile.js' -import { getDeepDataByLanguage } from '@/data-directory/lib/get-data.js' -import { checkURL } from '@/tests/helpers/check-url.js' +import { loadPages, loadPageMap } from '@/frame/lib/page-data' +import loadRedirects from '@/redirects/lib/precompile' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' +import { checkURL } from '@/tests/helpers/check-url' const pageList = await loadPages(undefined, ['en']) const pages = await loadPageMap(pageList) diff --git a/src/links/lib/update-internal-links.ts b/src/links/lib/update-internal-links.ts index 5f6d1d281ec6..abf4179f816f 100644 --- a/src/links/lib/update-internal-links.ts +++ b/src/links/lib/update-internal-links.ts @@ -9,19 +9,19 @@ import yaml from 'js-yaml' // eslint-disable-next-line import/no-unresolved import { type Node, type Nodes, type Definition, type Link } from 'mdast' -import frontmatter from '@/frame/lib/read-frontmatter.js' +import frontmatter from '@/frame/lib/read-frontmatter' import { getPathWithLanguage, getPathWithoutLanguage, getPathWithoutVersion, getVersionStringFromPath, -} from '@/frame/lib/path-utils.js' -import loadRedirects from '@/redirects/lib/precompile.js' -import patterns from '@/frame/lib/patterns.js' -import { loadUnversionedTree, loadPages, loadPageMap } from '@/frame/lib/page-data.js' -import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect.js' -import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' -import { deprecated } from '@/versions/lib/enterprise-server-releases.js' +} from '@/frame/lib/path-utils' +import loadRedirects from '@/redirects/lib/precompile' +import patterns from '@/frame/lib/patterns' +import { loadUnversionedTree, loadPages, loadPageMap } from '@/frame/lib/page-data' +import getRedirect, { splitPathByLanguage } from '@/redirects/lib/get-redirect' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { deprecated } from '@/versions/lib/enterprise-server-releases' // That magical string that can be turned into the actual title when // we, at runtime, render out the links diff --git a/src/links/lib/validate-docs-urls.ts b/src/links/lib/validate-docs-urls.ts index be24baee720e..e080187533d6 100644 --- a/src/links/lib/validate-docs-urls.ts +++ b/src/links/lib/validate-docs-urls.ts @@ -2,13 +2,13 @@ import type { Response } from 'express' import cheerio from 'cheerio' import warmServer from '@/frame/lib/warm-server' -import { liquid } from '@/content-render/index.js' -import shortVersions from '@/versions/middleware/short-versions.js' +import { liquid } from '@/content-render/index' +import shortVersions from '@/versions/middleware/short-versions' import contextualize from '@/frame/middleware/context/context' -import features from '@/versions/middleware/features.js' -import findPage from '@/frame/middleware/find-page.js' -import { createMinimalProcessor } from '@/content-render/unified/processor.js' -import getRedirect from '@/redirects/lib/get-redirect.js' +import features from '@/versions/middleware/features' +import findPage from '@/frame/middleware/find-page' +import { createMinimalProcessor } from '@/content-render/unified/processor' +import getRedirect from '@/redirects/lib/get-redirect' import type { ExtendedRequest, Page } from '@/types' export type DocsUrls = { diff --git a/src/links/scripts/action-injections.ts b/src/links/scripts/action-injections.ts index f6f150cdda19..c7a0cfcd1d57 100644 --- a/src/links/scripts/action-injections.ts +++ b/src/links/scripts/action-injections.ts @@ -7,7 +7,7 @@ import fs from 'fs' import path from 'path' import chalk from 'chalk' -import github from '@/workflows/github.js' +import github from '@/workflows/github' export type CoreInject = { info: (message: string) => void diff --git a/src/links/scripts/check-github-github-links.ts b/src/links/scripts/check-github-github-links.ts index a8ff08e7effb..5da868d0a1b2 100755 --- a/src/links/scripts/check-github-github-links.ts +++ b/src/links/scripts/check-github-github-links.ts @@ -45,7 +45,7 @@ main(program.opts(), program.args) // 3. ~4000ms // // ...if the limit we set is 3. -// Our own timeout, in #src/frame/middleware/timeout.js defaults to 10 seconds. +// Our own timeout, in @/frame/middleware/timeout.js defaults to 10 seconds. // So there's no point in trying more attempts than 3 because it would // just timeout on the 10s. (i.e. 1000 + 2000 + 4000 + 8000 > 10,000) const retryConfiguration = { diff --git a/src/links/scripts/rendered-content-link-checker-cli.ts b/src/links/scripts/rendered-content-link-checker-cli.ts index f7f2792f6c5a..7e559b8458ef 100755 --- a/src/links/scripts/rendered-content-link-checker-cli.ts +++ b/src/links/scripts/rendered-content-link-checker-cli.ts @@ -9,9 +9,9 @@ import fs from 'fs' import path from 'path' import { program, Option, InvalidArgumentError } from 'commander' import renderedContentLinkChecker from './rendered-content-link-checker' -import { getCoreInject, getUploadArtifactInject } from '@/links/scripts/action-injections.js' +import { getCoreInject, getUploadArtifactInject } from '@/links/scripts/action-injections' import { allVersions } from '@/versions/lib/all-versions' -import github from '@/workflows/github.js' +import github from '@/workflows/github' const STATIC_PREFIXES = { assets: path.resolve('assets'), diff --git a/src/links/scripts/rendered-content-link-checker.ts b/src/links/scripts/rendered-content-link-checker.ts index 9ac32cfec96c..83937dd3e971 100755 --- a/src/links/scripts/rendered-content-link-checker.ts +++ b/src/links/scripts/rendered-content-link-checker.ts @@ -12,22 +12,22 @@ import { type Octokit } from '@octokit/rest' import type { Response } from 'express' import type { ExtendedRequest, Page, Permalink, Context } from '@/types' -import shortVersions from '@/versions/middleware/short-versions.js' +import shortVersions from '@/versions/middleware/short-versions' import contextualize from '@/frame/middleware/context/context' -import features from '@/versions/middleware/features.js' -import getRedirect from '@/redirects/lib/get-redirect.js' +import features from '@/versions/middleware/features' +import getRedirect from '@/redirects/lib/get-redirect' import warmServer from '@/frame/lib/warm-server' -import { liquid } from '@/content-render/index.js' -import { deprecated } from '@/versions/lib/enterprise-server-releases.js' -import excludedLinks from '@/links/lib/excluded-links.js' -import { getEnvInputs, boolEnvVar } from '@/workflows/get-env-inputs.js' -import { debugTimeEnd, debugTimeStart } from './debug-time-taken.js' -import { uploadArtifact as uploadArtifactLib } from './upload-artifact.js' -import github from '@/workflows/github.js' -import { getActionContext } from '@/workflows/action-context.js' -import { createMinimalProcessor } from '@/content-render/unified/processor.js' -import { createReportIssue, linkReports } from '@/workflows/issue-report.js' -import { type CoreInject } from '@/links/scripts/action-injections.js' +import { liquid } from '@/content-render/index' +import { deprecated } from '@/versions/lib/enterprise-server-releases' +import excludedLinks from '@/links/lib/excluded-links' +import { getEnvInputs, boolEnvVar } from '@/workflows/get-env-inputs' +import { debugTimeEnd, debugTimeStart } from './debug-time-taken' +import { uploadArtifact as uploadArtifactLib } from './upload-artifact' +import github from '@/workflows/github' +import { getActionContext } from '@/workflows/action-context' +import { createMinimalProcessor } from '@/content-render/unified/processor' +import { createReportIssue, linkReports } from '@/workflows/issue-report' +import { type CoreInject } from '@/links/scripts/action-injections' type Flaw = { WARNING?: string @@ -1152,7 +1152,7 @@ async function innerFetch( // 3. ~4000ms // // ...if the limit we set is 3. - // Our own timeout, in #src/frame/middleware/timeout.js defaults to 10 seconds. + // Our own timeout, in @/frame/middleware/timeout.js defaults to 10 seconds. // So there's no point in trying more attempts than 3 because it would // just timeout on the 10s. (i.e. 1000 + 2000 + 4000 + 8000 > 10,000) const retry = { diff --git a/src/links/scripts/update-internal-links.ts b/src/links/scripts/update-internal-links.ts index e7b76a451327..ebc200e77ed0 100755 --- a/src/links/scripts/update-internal-links.ts +++ b/src/links/scripts/update-internal-links.ts @@ -14,8 +14,8 @@ import { program } from 'commander' import chalk from 'chalk' import yaml from 'js-yaml' -import { updateInternalLinks } from '@/links/lib/update-internal-links.js' -import frontmatter from '@/frame/lib/read-frontmatter.js' +import { updateInternalLinks } from '@/links/lib/update-internal-links' +import frontmatter from '@/frame/lib/read-frontmatter' import walkFiles from '@/workflows/walk-files' program diff --git a/src/metrics/scripts/docsaudit.ts b/src/metrics/scripts/docsaudit.ts index 011998939751..e053c746d75d 100644 --- a/src/metrics/scripts/docsaudit.ts +++ b/src/metrics/scripts/docsaudit.ts @@ -5,7 +5,7 @@ import path from 'path' import { fileURLToPath } from 'url' import { Command } from 'commander' import walkFiles from '@/workflows/walk-files' -import readFrontmatter from '@/frame/lib/read-frontmatter.js' +import readFrontmatter from '@/frame/lib/read-frontmatter' import { getKustoClient } from '@/metrics/lib/kusto-client' import { getDates, type DateRange } from '@/metrics/lib/dates' import { getViews } from '@/metrics/queries/views' diff --git a/src/metrics/scripts/docstat.ts b/src/metrics/scripts/docstat.ts index 3fbc8b79a63d..bc1850e09e1c 100644 --- a/src/metrics/scripts/docstat.ts +++ b/src/metrics/scripts/docstat.ts @@ -5,7 +5,7 @@ import path from 'path' import { Command } from 'commander' import chalk from 'chalk' import ora from 'ora' -import frontmatter from '@/frame/lib/read-frontmatter.js' +import frontmatter from '@/frame/lib/read-frontmatter' import { getKustoClient } from '@/metrics/lib/kusto-client' import { getDates, type DateRange } from '@/metrics/lib/dates' import { getViews } from '@/metrics/queries/views' diff --git a/src/observability/lib/failbot.js b/src/observability/lib/failbot.js index 26486ef7e089..74d1961cd529 100644 --- a/src/observability/lib/failbot.js +++ b/src/observability/lib/failbot.js @@ -55,7 +55,7 @@ export function report(error, metadata) { // Kept for legacy so you can continue to do: // -// import FailBot from './lib/failbot.js' +// import FailBot from './lib/failbot' // ... // FailBot.report(myError) // diff --git a/src/observability/lib/handle-exceptions.js b/src/observability/lib/handle-exceptions.js index 3843815188aa..80cb3c3110b2 100644 --- a/src/observability/lib/handle-exceptions.js +++ b/src/observability/lib/handle-exceptions.js @@ -1,4 +1,4 @@ -import FailBot from './failbot.js' +import FailBot from './failbot' process.on('uncaughtException', async (err) => { if (err.code === 'MODULE_NOT_FOUND') { diff --git a/src/observability/middleware/handle-errors.ts b/src/observability/middleware/handle-errors.ts index 5ff060986f57..393f204f7b73 100644 --- a/src/observability/middleware/handle-errors.ts +++ b/src/observability/middleware/handle-errors.ts @@ -1,14 +1,11 @@ import type { NextFunction, Response, ErrorRequestHandler } from 'express' -import FailBot from '../lib/failbot.js' -import { nextApp } from '@/frame/middleware/next.js' -import { - setFastlySurrogateKey, - SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' -import { errorCacheControl } from '@/frame/middleware/cache-control.js' -import statsd from '@/observability/lib/statsd.js' -import { ExtendedRequest } from '@/types.js' +import FailBot from '../lib/failbot' +import { nextApp } from '@/frame/middleware/next' +import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { errorCacheControl } from '@/frame/middleware/cache-control' +import statsd from '@/observability/lib/statsd' +import { ExtendedRequest } from '@/types' const DEBUG_MIDDLEWARE_TESTS = Boolean(JSON.parse(process.env.DEBUG_MIDDLEWARE_TESTS || 'false')) diff --git a/src/observability/tests/failbot.js b/src/observability/tests/failbot.js index 86f7b7e35dc0..da44bf84238f 100644 --- a/src/observability/tests/failbot.js +++ b/src/observability/tests/failbot.js @@ -1,7 +1,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'vitest' import nock from 'nock' -import FailBot from '../lib/failbot.js' +import FailBot from '../lib/failbot' describe('FailBot', () => { const requestBodiesSent = [] diff --git a/src/products/lib/all-products.ts b/src/products/lib/all-products.ts index 2219aab47b75..a851e20cada4 100644 --- a/src/products/lib/all-products.ts +++ b/src/products/lib/all-products.ts @@ -1,9 +1,9 @@ import fs from 'fs/promises' import path from 'path' -import frontmatter from '@/frame/lib/read-frontmatter.js' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' -import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path.js' -import { ROOT } from '@/frame/lib/constants.js' +import frontmatter from '@/frame/lib/read-frontmatter' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path' +import { ROOT } from '@/frame/lib/constants' /** * Represents a product in the documentation diff --git a/src/products/lib/get-product-groups.ts b/src/products/lib/get-product-groups.ts index e7b785ec74c3..4ad817335631 100644 --- a/src/products/lib/get-product-groups.ts +++ b/src/products/lib/get-product-groups.ts @@ -1,9 +1,9 @@ import path from 'path' import type { Page, ProductGroup, ProductGroupChild, Context } from '@/types' -import { productMap, data } from './all-products.js' -import { renderContentWithFallback } from '@/languages/lib/render-with-fallback.js' -import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path.js' +import { productMap, data } from './all-products' +import { renderContentWithFallback } from '@/languages/lib/render-with-fallback' +import removeFPTFromPath from '@/versions/lib/remove-fpt-from-path' type PageMap = Record diff --git a/src/products/lib/product-names.ts b/src/products/lib/product-names.ts index a9001e235e3e..3ff4034cb53b 100644 --- a/src/products/lib/product-names.ts +++ b/src/products/lib/product-names.ts @@ -1,5 +1,5 @@ import type { ProductNames } from '@/types' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' const productNames: ProductNames = { dotcom: 'GitHub.com', diff --git a/src/products/tests/products.ts b/src/products/tests/products.ts index 46032073bee1..2fca22daf9ff 100644 --- a/src/products/tests/products.ts +++ b/src/products/tests/products.ts @@ -4,7 +4,7 @@ import { getJsonValidator } from '@/tests/lib/validate-json-schema' import { productMap } from '@/products/lib/all-products' import { formatAjvErrors } from '@/tests/helpers/schemas' // @ts-ignore - Products schema doesn't have TypeScript types yet -import schema from '@/tests/helpers/schemas/products-schema.js' +import schema from '@/tests/helpers/schemas/products-schema' const validate = getJsonValidator(schema) diff --git a/src/redirects/lib/get-redirect.ts b/src/redirects/lib/get-redirect.ts index f09e2345055c..b73780caab77 100644 --- a/src/redirects/lib/get-redirect.ts +++ b/src/redirects/lib/get-redirect.ts @@ -1,15 +1,15 @@ import { languageKeys } from '@/languages/lib/languages' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' import { allVersions } from '@/versions/lib/all-versions' import { latest, latestStable, supported, deprecatedWithFunctionalRedirects, -} from '#src/versions/lib/enterprise-server-releases.js' -import { getPathWithLanguage, getVersionStringFromPath } from '#src/frame/lib/path-utils.js' +} from '@/versions/lib/enterprise-server-releases' +import { getPathWithLanguage, getVersionStringFromPath } from '@/frame/lib/path-utils' -import type { Context } from '@/types.js' +import type { Context } from '@/types' const languagePrefixRegex = new RegExp(`^/(${languageKeys.join('|')})/`) const nonEnterpriseDefaultVersionPrefix = `/${nonEnterpriseDefaultVersion}` diff --git a/src/redirects/lib/permalinks.js b/src/redirects/lib/permalinks.js index 716bc58a3059..d29e009e54b9 100644 --- a/src/redirects/lib/permalinks.js +++ b/src/redirects/lib/permalinks.js @@ -1,5 +1,5 @@ -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { getPathWithoutVersion } from '#src/frame/lib/path-utils.js' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { getPathWithoutVersion } from '@/frame/lib/path-utils' export default function permalinkRedirects(permalinks, redirectFrom) { const redirects = {} diff --git a/src/redirects/lib/precompile.js b/src/redirects/lib/precompile.js index 6abd81141efa..a295dd79c5a1 100755 --- a/src/redirects/lib/precompile.js +++ b/src/redirects/lib/precompile.js @@ -1,6 +1,6 @@ -import { readCompressedJsonFileFallback } from '#src/frame/lib/read-json-file.js' -import getExceptionRedirects from './exception-redirects.js' -import { latest } from '#src/versions/lib/enterprise-server-releases.js' +import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file' +import getExceptionRedirects from './exception-redirects' +import { latest } from '@/versions/lib/enterprise-server-releases' const EXCEPTIONS_FILE = './src/redirects/lib/static/redirect-exceptions.txt' diff --git a/src/redirects/middleware/handle-redirects.ts b/src/redirects/middleware/handle-redirects.ts index d6109112ba71..14438657ddf4 100644 --- a/src/redirects/middleware/handle-redirects.ts +++ b/src/redirects/middleware/handle-redirects.ts @@ -1,10 +1,10 @@ import type { NextFunction, Response } from 'express' -import patterns from '@/frame/lib/patterns.js' +import patterns from '@/frame/lib/patterns' import { pathLanguagePrefixed } from '@/languages/lib/languages' -import { deprecatedWithFunctionalRedirects } from '@/versions/lib/enterprise-server-releases.js' -import getRedirect from '../lib/get-redirect.js' -import { defaultCacheControl, languageCacheControl } from '@/frame/middleware/cache-control.js' +import { deprecatedWithFunctionalRedirects } from '@/versions/lib/enterprise-server-releases' +import getRedirect from '../lib/get-redirect' +import { defaultCacheControl, languageCacheControl } from '@/frame/middleware/cache-control' import { ExtendedRequest, URLSearchParamsTypes } from '@/types' export default function handleRedirects(req: ExtendedRequest, res: Response, next: NextFunction) { diff --git a/src/redirects/middleware/language-code-redirects.ts b/src/redirects/middleware/language-code-redirects.ts index 793f8288a094..1ce32056d31d 100644 --- a/src/redirects/middleware/language-code-redirects.ts +++ b/src/redirects/middleware/language-code-redirects.ts @@ -1,7 +1,7 @@ import type { NextFunction, Response } from 'express' import languages from '@/languages/lib/languages' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' +import { defaultCacheControl } from '@/frame/middleware/cache-control' import { ExtendedRequest } from '@/types' const redirectPatterns = Object.values(languages) diff --git a/src/redirects/tests/content/redirect-orphans.js b/src/redirects/tests/content/redirect-orphans.js index 6989af810232..385aa498faf9 100644 --- a/src/redirects/tests/content/redirect-orphans.js +++ b/src/redirects/tests/content/redirect-orphans.js @@ -2,8 +2,8 @@ import path from 'path' import { describe, expect, test, vi } from 'vitest' -import { loadPages } from '#src/frame/lib/page-data.js' -import Permalink from '#src/frame/lib/permalink.js' +import { loadPages } from '@/frame/lib/page-data' +import Permalink from '@/frame/lib/permalink' describe('redirect orphans', () => { // Because calling `loadPages` will trigger a warmup, this can potentially diff --git a/src/redirects/tests/ghae.js b/src/redirects/tests/ghae.js index 9ae4d0cd232b..02a04f75fe47 100644 --- a/src/redirects/tests/ghae.js +++ b/src/redirects/tests/ghae.js @@ -12,7 +12,7 @@ import { describe, expect, test } from 'vitest' -import { head } from '#src/tests/helpers/e2etest.js' +import { head } from '@/tests/helpers/e2etest' describe('ghae redirects', () => { test('ghae home page', async () => { diff --git a/src/redirects/tests/redirects.js b/src/redirects/tests/redirects.js index 788b627041c8..12ee9e3403aa 100644 --- a/src/redirects/tests/redirects.js +++ b/src/redirects/tests/redirects.js @@ -6,10 +6,10 @@ import { beforeAll, describe, expect, test, vi } from 'vitest' import enterpriseServerReleases, { deprecatedWithFunctionalRedirects, -} from '#src/versions/lib/enterprise-server-releases.js' -import Page from '#src/frame/lib/page.js' -import { get, head } from '#src/tests/helpers/e2etest.js' -import versionSatisfiesRange from '#src/versions/lib/version-satisfies-range.js' +} from '@/versions/lib/enterprise-server-releases' +import Page from '@/frame/lib/page' +import { get, head } from '@/tests/helpers/e2etest' +import versionSatisfiesRange from '@/versions/lib/version-satisfies-range' const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/src/redirects/tests/routing/developer-site-redirects.js b/src/redirects/tests/routing/developer-site-redirects.js index 9cd5573ea473..f14e2d69b3e6 100644 --- a/src/redirects/tests/routing/developer-site-redirects.js +++ b/src/redirects/tests/routing/developer-site-redirects.js @@ -2,9 +2,9 @@ import path from 'path' import { beforeAll, describe, expect, test, vi } from 'vitest' -import enterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' -import { get } from '#src/tests/helpers/e2etest.js' -import readJsonFile from '#src/frame/lib/read-json-file.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' +import { get } from '@/tests/helpers/e2etest' +import readJsonFile from '@/frame/lib/read-json-file' describe('developer redirects', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/redirects/tests/routing/redirect-exceptions.js b/src/redirects/tests/routing/redirect-exceptions.js index bce1f7a3d8d3..9618b296aa24 100644 --- a/src/redirects/tests/routing/redirect-exceptions.js +++ b/src/redirects/tests/routing/redirect-exceptions.js @@ -3,9 +3,9 @@ import path from 'path' import { describe, expect, test, vi } from 'vitest' -import { get } from '#src/tests/helpers/e2etest.js' -import getExceptionRedirects from '../../lib/exception-redirects.js' -import { latest } from '#src/versions/lib/enterprise-server-releases.js' +import { get } from '@/tests/helpers/e2etest' +import getExceptionRedirects from '../../lib/exception-redirects' +import { latest } from '@/versions/lib/enterprise-server-releases' const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/src/redirects/tests/routing/top-developer-site-path-redirects.js b/src/redirects/tests/routing/top-developer-site-path-redirects.js index eb11c946d17b..776de4a3f996 100644 --- a/src/redirects/tests/routing/top-developer-site-path-redirects.js +++ b/src/redirects/tests/routing/top-developer-site-path-redirects.js @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { head } from '#src/tests/helpers/e2etest.js' +import { head } from '@/tests/helpers/e2etest' describe('developer.github.com redirects', () => { vi.setConfig({ testTimeout: 60 * 1000 }) diff --git a/src/redirects/tests/routing/versionless-redirects.js b/src/redirects/tests/routing/versionless-redirects.js index 96785b990377..6d0187cee55f 100644 --- a/src/redirects/tests/routing/versionless-redirects.js +++ b/src/redirects/tests/routing/versionless-redirects.js @@ -1,7 +1,7 @@ import { describe, expect, test, vi } from 'vitest' -import getExceptionRedirects from '../../lib/exception-redirects.js' -import { latest } from '#src/versions/lib/enterprise-server-releases.js' +import getExceptionRedirects from '../../lib/exception-redirects' +import { latest } from '@/versions/lib/enterprise-server-releases' import path from 'path' import { fileURLToPath } from 'url' diff --git a/src/redirects/tests/unit/get-redirect.js b/src/redirects/tests/unit/get-redirect.js index b89d8233200e..ce9d8b23aecc 100644 --- a/src/redirects/tests/unit/get-redirect.js +++ b/src/redirects/tests/unit/get-redirect.js @@ -1,12 +1,12 @@ import { describe, expect, test } from 'vitest' -import getRedirect from '../../lib/get-redirect.ts' +import getRedirect from '../../lib/get-redirect' import { latest, latestStable, supported, oldestSupported, -} from '#src/versions/lib/enterprise-server-releases.js' +} from '@/versions/lib/enterprise-server-releases' const previousEnterpriserServerVersion = supported[1] diff --git a/src/release-notes/lib/release-notes-utils.ts b/src/release-notes/lib/release-notes-utils.ts index 3bb94aed01c9..89c0a38a1acc 100644 --- a/src/release-notes/lib/release-notes-utils.ts +++ b/src/release-notes/lib/release-notes-utils.ts @@ -1,6 +1,6 @@ import semver from 'semver' -import { supported, latestStable, latest } from '@/versions/lib/enterprise-server-releases.js' -import { renderContent } from '@/content-render/index.js' +import { supported, latestStable, latest } from '@/versions/lib/enterprise-server-releases' +import { renderContent } from '@/content-render/index' import type { Context, GHESReleasePatch, ReleaseNotes } from '@/types' /** diff --git a/src/release-notes/middleware/get-release-notes.ts b/src/release-notes/middleware/get-release-notes.ts index e32931d0dfbc..8a90693be17d 100644 --- a/src/release-notes/middleware/get-release-notes.ts +++ b/src/release-notes/middleware/get-release-notes.ts @@ -1,4 +1,4 @@ -import { getDataByLanguage, getDeepDataByLanguage } from '@/data-directory/lib/get-data.js' +import { getDataByLanguage, getDeepDataByLanguage } from '@/data-directory/lib/get-data' import type { ReleaseNotes } from '@/types' // If we one day support release-notes for other products, add it here. diff --git a/src/release-notes/middleware/ghes-release-notes.ts b/src/release-notes/middleware/ghes-release-notes.ts index f949ebd9f698..0e3540ffa05d 100644 --- a/src/release-notes/middleware/ghes-release-notes.ts +++ b/src/release-notes/middleware/ghes-release-notes.ts @@ -1,8 +1,8 @@ import type { NextFunction, Response } from 'express' import { formatReleases, renderPatchNotes } from '@/release-notes/lib/release-notes-utils' -import { all, latestStable } from '@/versions/lib/enterprise-server-releases.js' -import { executeWithFallback } from '@/languages/lib/render-with-fallback.js' +import { all, latestStable } from '@/versions/lib/enterprise-server-releases' +import { executeWithFallback } from '@/languages/lib/render-with-fallback' import { getReleaseNotes } from './get-release-notes' import type { Context, ExtendedRequest } from '@/types' diff --git a/src/release-notes/tests/release-notes.ts b/src/release-notes/tests/release-notes.ts index 73fb46043d0e..8d93b082341a 100644 --- a/src/release-notes/tests/release-notes.ts +++ b/src/release-notes/tests/release-notes.ts @@ -1,9 +1,9 @@ import { afterAll, beforeAll, describe, expect, test, vi } from 'vitest' import nock from 'nock' -import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.js' -import { get, getDOM } from '@/tests/helpers/e2etest.js' -import Page from '@/frame/lib/page.js' +import enterpriseServerReleases from '@/versions/lib/enterprise-server-releases' +import { get, getDOM } from '@/tests/helpers/e2etest' +import Page from '@/frame/lib/page' // The English content page's `versions:` frontmatter is the source // of (convenient) truth about which versions of this page is available. diff --git a/src/release-notes/tests/yaml.ts b/src/release-notes/tests/yaml.ts index 177aebad3b1f..27ef3ddf0eca 100644 --- a/src/release-notes/tests/yaml.ts +++ b/src/release-notes/tests/yaml.ts @@ -5,8 +5,8 @@ import path from 'path' import { beforeAll, describe, expect, test } from 'vitest' import yaml from 'js-yaml' -import { liquid } from '@/content-render/index.js' -import { getDataByLanguage } from '@/data-directory/lib/get-data.js' +import { liquid } from '@/content-render/index' +import { getDataByLanguage } from '@/data-directory/lib/get-data' import { allVersions } from '@/versions/lib/all-versions' interface ReleaseNoteContent { diff --git a/src/rest/api/anchor-redirect.js b/src/rest/api/anchor-redirect.js index bf56754ab8fe..6eb0c3b122cb 100644 --- a/src/rest/api/anchor-redirect.js +++ b/src/rest/api/anchor-redirect.js @@ -1,9 +1,9 @@ import express from 'express' import path from 'path' -import { readCompressedJsonFileFallbackLazily } from '#src/frame/lib/read-json-file.js' -import { defaultCacheControl } from '#src/frame/middleware/cache-control.js' -import { REST_DATA_DIR } from '../lib/index.js' +import { readCompressedJsonFileFallbackLazily } from '@/frame/lib/read-json-file' +import { defaultCacheControl } from '@/frame/middleware/cache-control' +import { REST_DATA_DIR } from '../lib/index' const clientSideRestAPIRedirects = readCompressedJsonFileFallbackLazily( path.join(REST_DATA_DIR, 'client-side-rest-api-redirects.json'), diff --git a/src/rest/components/ApiVersionPicker.tsx b/src/rest/components/ApiVersionPicker.tsx index 38880d22e41a..43d2b4ea285b 100644 --- a/src/rest/components/ApiVersionPicker.tsx +++ b/src/rest/components/ApiVersionPicker.tsx @@ -7,7 +7,7 @@ import { DEFAULT_VERSION, useVersion } from '@/versions/components/useVersion' import { Picker } from '@/tools/components/Picker' import { useTranslation } from '@/languages/components/useTranslation' import { API_VERSION_COOKIE_NAME } from '@/rest/components/RestRedirect' -import { apiVersionPath } from '@/rest/lib/config.js' +import { apiVersionPath } from '@/rest/lib/config' const API_VERSION_SUFFIX = ' (latest)' diff --git a/src/rest/data/ghec-2022-11-28/schema.json b/src/rest/data/ghec-2022-11-28/schema.json index ff41e428b1e0..169358bf434a 100644 --- a/src/rest/data/ghec-2022-11-28/schema.json +++ b/src/rest/data/ghec-2022-11-28/schema.json @@ -4662,13 +4662,13 @@ } ], "previews": [], - "descriptionHTML": "

Creates a GitHub-hosted runner for an organization.\nOAuth tokens and personal access tokens (classic) need the manage_runners:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ] + ], + "descriptionHTML": "

Creates a GitHub-hosted runner for an organization.\nOAuth tokens and personal access tokens (classic) need the manage_runners:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -4918,13 +4918,13 @@ } ], "previews": [], - "descriptionHTML": "

Get the list of partner images available for GitHub-hosted runners for an organization.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get the list of partner images available for GitHub-hosted runners for an organization.

" }, { "serverUrl": "https://api.github.com", @@ -5129,13 +5129,13 @@ } ], "previews": [], - "descriptionHTML": "

Get the list of machine specs available for GitHub-hosted runners for an organization.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get the list of machine specs available for GitHub-hosted runners for an organization.

" }, { "serverUrl": "https://api.github.com", @@ -5209,13 +5209,13 @@ } ], "previews": [], - "descriptionHTML": "

Get the list of platforms available for GitHub-hosted runners for an organization.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get the list of platforms available for GitHub-hosted runners for an organization.

" }, { "serverUrl": "https://api.github.com", @@ -6138,13 +6138,13 @@ } ], "previews": [], - "descriptionHTML": "

Deletes a GitHub-hosted runner for an organization.

", "statusCodes": [ { "httpStatusCode": "202", "description": "

Accepted

" } - ] + ], + "descriptionHTML": "

Deletes a GitHub-hosted runner for an organization.

" } ], "oidc": [ @@ -6670,13 +6670,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets the GitHub Actions permissions policy for organizations and allowed actions and reusable workflows in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -7016,13 +7016,13 @@ } ], "previews": [], - "descriptionHTML": "

Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see \"Set GitHub Actions permissions for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see \"Set GitHub Actions permissions for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -7215,13 +7215,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets the selected actions and reusable workflows that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets the selected actions and reusable workflows that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -7535,13 +7535,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization.

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -7618,13 +7618,13 @@ } ], "previews": [], - "descriptionHTML": "

Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

\n

If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions to selected actions, then you cannot override them for the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

\n

If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions to selected actions, then you cannot override them for the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -12989,13 +12989,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets a single environment secret without revealing its encrypted value.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets a single environment secret without revealing its encrypted value.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -13937,13 +13937,13 @@ } ], "previews": [], - "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -13997,13 +13997,13 @@ } ], "previews": [], - "descriptionHTML": "

Deletes a self-hosted runner group for an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Deletes a self-hosted runner group for an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -15658,13 +15658,13 @@ } ], "previews": [], - "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -16080,13 +16080,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists the GitHub-hosted runners in an organization group.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists the GitHub-hosted runners in an organization group.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -18341,13 +18341,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists binaries for the runner application that you can download and run.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists binaries for the runner application that you can download and run.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -21882,13 +21882,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists all self-hosted runners configured in an organization.

\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists all self-hosted runners configured in an organization.

\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.

" }, { "serverUrl": "https://api.github.com", @@ -24370,13 +24370,13 @@ } ], "previews": [], - "descriptionHTML": "

Returns a token that you can pass to the config script to remove a self-hosted runner from an organization. The token expires after one hour.

\n

For example, you can replace TOKEN in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

\n
./config.sh remove --token TOKEN\n
\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ] + ], + "descriptionHTML": "

Returns a token that you can pass to the config script to remove a self-hosted runner from an organization. The token expires after one hour.

\n

For example, you can replace TOKEN in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:

\n
./config.sh remove --token TOKEN\n
\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -29442,13 +29442,13 @@ } ], "previews": [], - "descriptionHTML": "

Creates an organization variable that you can reference in a GitHub Actions workflow.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Response when creating a variable

" } - ] + ], + "descriptionHTML": "

Creates an organization variable that you can reference in a GitHub Actions workflow.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -48649,13 +48649,13 @@ } ], "previews": [], - "descriptionHTML": "

List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

\n

Anyone with read access to the repository can use this endpoint

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

\n

This endpoint will return up to 1,000 results for each search when using the following parameters: actor, branch, check_suite_id, created, event, head_sha, status.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

\n

Anyone with read access to the repository can use this endpoint

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

\n

This endpoint will return up to 1,000 results for each search when using the following parameters: actor, branch, check_suite_id, created, event, head_sha, status.

" } ], "workflows": [ @@ -96669,13 +96669,13 @@ } ], "previews": [], - "descriptionHTML": "

Removes the announcement banner currently set for the enterprise.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Removes the announcement banner currently set for the enterprise.

" } ], "organizations": [ @@ -97445,13 +97445,13 @@ } ], "previews": [], - "descriptionHTML": "

Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the installations_count in the response. For more details about your app's installations, see the \"List installations for the authenticated app\" endpoint.

\n

You must use a JWT to access this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the installations_count in the response. For more details about your app's installations, see the \"List installations for the authenticated app\" endpoint.

\n

You must use a JWT to access this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -138617,13 +138617,13 @@ } ], "previews": [], - "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

" }, { "serverUrl": "https://api.github.com", @@ -139516,7 +139516,6 @@ } ], "previews": [], - "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

\n

Lists who has access to this protected branch.

\n

Note

\n

\nUsers, apps, and teams restrictions are only available for organization-owned repositories.

\n
", "statusCodes": [ { "httpStatusCode": "200", @@ -139526,7 +139525,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

\n

Lists who has access to this protected branch.

\n

Note

\n

\nUsers, apps, and teams restrictions are only available for organization-owned repositories.

\n
" }, { "serverUrl": "https://api.github.com", @@ -143583,7 +143583,6 @@ } ], "previews": [], - "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

\n

Grants the specified people push access for this branch.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
TypeDescription
arrayUsernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items.
", "statusCodes": [ { "httpStatusCode": "200", @@ -143593,7 +143592,8 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ] + ], + "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

\n

Grants the specified people push access for this branch.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
TypeDescription
arrayUsernames for people who can have push access. Note: The list of users, apps, and teams in total is limited to 100 items.
" }, { "serverUrl": "https://api.github.com", @@ -153016,13 +153016,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists annotations for a check run using the annotation id.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists annotations for a check run using the annotation id.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

" }, { "serverUrl": "https://api.github.com", @@ -267190,7 +267190,6 @@ } ], "previews": [], - "descriptionHTML": "

Creates or updates an organization secret with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", @@ -267200,7 +267199,8 @@ "httpStatusCode": "204", "description": "

Response when updating a secret

" } - ] + ], + "descriptionHTML": "

Creates or updates an organization secret with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -270552,13 +270552,13 @@ } ], "previews": [], - "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Deploy keys are immutable. If you need to update a key, remove the key and create a new one instead.

" } ] }, @@ -283909,13 +283909,13 @@ } ], "previews": [], - "descriptionHTML": "

Deletes an existing audit log stream configuration for an enterprise.

\n

When using this endpoint, you must encrypt the credentials following the same encryption steps as outlined in the guide on encrypting secrets. See \"Encrypting secrets for the REST API.\"

", "statusCodes": [ { "httpStatusCode": "204", "description": "

The audit log stream configuration was deleted successfully.

" } - ] + ], + "descriptionHTML": "

Deletes an existing audit log stream configuration for an enterprise.

\n

When using this endpoint, you must encrypt the credentials following the same encryption steps as outlined in the guide on encrypting secrets. See \"Encrypting secrets for the REST API.\"

" } ], "billing": [ @@ -288170,13 +288170,13 @@ } ], "previews": [], - "descriptionHTML": "

Creates a hosted compute network configuration for an enterprise.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ] + ], + "descriptionHTML": "

Creates a hosted compute network configuration for an enterprise.

" }, { "serverUrl": "https://api.github.com", @@ -288455,13 +288455,13 @@ } ], "previews": [], - "descriptionHTML": "

Updates a hosted compute network configuration for an enterprise.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Updates a hosted compute network configuration for an enterprise.

" }, { "serverUrl": "https://api.github.com", @@ -288631,13 +288631,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets a hosted compute network settings resource configured for an enterprise.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets a hosted compute network settings resource configured for an enterprise.

" } ], "organization-installations": [ @@ -288749,13 +288749,13 @@ } ], "previews": [], - "descriptionHTML": "

List the organizations owned by the enterprise, intended for use by GitHub Apps that are managing applications across the enterprise.

\n

This API can only be called by a GitHub App installed on the enterprise that owns the organization.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

A list of organizations owned by the enterprise on which the authenticated GitHub App is installed.

" } - ] + ], + "descriptionHTML": "

List the organizations owned by the enterprise, intended for use by GitHub Apps that are managing applications across the enterprise.

\n

This API can only be called by a GitHub App installed on the enterprise that owns the organization.

" }, { "serverUrl": "https://api.github.com", @@ -290576,7 +290576,6 @@ } ], "previews": [], - "descriptionHTML": "

Installs any valid GitHub App on the specified organization owned by the enterprise. If the app is already installed on the organization, and is suspended, it will be unsuspended.\nIf the app has a pending installation request, they will all be approved.

\n

If the app is already installed and has a pending update request, it will be updated to the latest version. If the app is now requesting repository permissions, it will be given access to the repositories listed in the request or fail if no repository_selection is provided.

\n

This API can only be called by a GitHub App installed on the enterprise that owns the organization.

", "statusCodes": [ { "httpStatusCode": "200", @@ -290586,7 +290585,8 @@ "httpStatusCode": "201", "description": "

A GitHub App installation.

" } - ] + ], + "descriptionHTML": "

Installs any valid GitHub App on the specified organization owned by the enterprise. If the app is already installed on the organization, and is suspended, it will be unsuspended.\nIf the app has a pending installation request, they will all be approved.

\n

If the app is already installed and has a pending update request, it will be updated to the latest version. If the app is now requesting repository permissions, it will be given access to the repositories listed in the request or fail if no repository_selection is provided.

\n

This API can only be called by a GitHub App installed on the enterprise that owns the organization.

" }, { "serverUrl": "https://api.github.com", @@ -411264,7 +411264,6 @@ } ], "previews": [], - "descriptionHTML": "

You must send Markdown as plain text (using a Content-Type header of text/plain or text/x-markdown) to this endpoint, rather than using JSON format. In raw mode, GitHub Flavored Markdown is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.

", "statusCodes": [ { "httpStatusCode": "200", @@ -411274,7 +411273,8 @@ "httpStatusCode": "304", "description": "

Not modified

" } - ] + ], + "descriptionHTML": "

You must send Markdown as plain text (using a Content-Type header of text/plain or text/x-markdown) to this endpoint, rather than using JSON format. In raw mode, GitHub Flavored Markdown is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less.

" } ] }, @@ -427545,7 +427545,6 @@ } ], "previews": [], - "descriptionHTML": "

Lists all organizations, in the order that they were created.

\n

Note

\n

\nPagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of organizations.

\n
", "statusCodes": [ { "httpStatusCode": "200", @@ -427555,7 +427554,8 @@ "httpStatusCode": "304", "description": "

Not modified

" } - ] + ], + "descriptionHTML": "

Lists all organizations, in the order that they were created.

\n

Note

\n

\nPagination is powered exclusively by the since parameter. Use the Link header to get the URL for the next page of organizations.

\n
" }, { "serverUrl": "https://api.github.com", @@ -430020,13 +430020,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets the audit log for an organization. For more information, see \"Reviewing the audit log for your organization.\"

\n

By default, the response includes up to 30 events from the past three months. Use the phrase parameter to filter results and retrieve older events. For example, use the phrase parameter with the created qualifier to filter events based on when the events occurred. For more information, see \"Reviewing the audit log for your organization.\"

\n

Use pagination to retrieve fewer or more than 30 events. For more information, see \"Using pagination in the REST API.\"

\n

This endpoint has a rate limit of 1,750 queries per hour per user and IP address. If your integration receives a rate limit error (typically a 403 or 429 response), it should wait before making another request to the GitHub API. For more information, see \"Rate limits for the REST API\" and \"Best practices for integrators.\"

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the read:audit_log scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets the audit log for an organization. For more information, see \"Reviewing the audit log for your organization.\"

\n

By default, the response includes up to 30 events from the past three months. Use the phrase parameter to filter results and retrieve older events. For example, use the phrase parameter with the created qualifier to filter events based on when the events occurred. For more information, see \"Reviewing the audit log for your organization.\"

\n

Use pagination to retrieve fewer or more than 30 events. For more information, see \"Using pagination in the REST API.\"

\n

This endpoint has a rate limit of 1,750 queries per hour per user and IP address. If your integration receives a rate limit error (typically a 403 or 429 response), it should wait before making another request to the GitHub API. For more information, see \"Rate limits for the REST API\" and \"Best practices for integrators.\"

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the read:audit_log scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -431441,13 +431441,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists all GitHub Apps in an organization. The installation count includes\nall GitHub Apps installed on repositories in the organization.

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:read scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists all GitHub Apps in an organization. The installation count includes\nall GitHub Apps installed on repositories in the organization.

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:read scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -432313,13 +432313,13 @@ } ], "previews": [], - "descriptionHTML": "

Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get API request statistics for all subjects within an organization within a specified time frame. Subjects can be users or GitHub Apps.

" }, { "serverUrl": "https://api.github.com", @@ -432767,13 +432767,13 @@ } ], "previews": [], - "descriptionHTML": "

Get the number of API requests and rate-limited requests made within an organization over a specified time period.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get the number of API requests and rate-limited requests made within an organization over a specified time period.

" }, { "serverUrl": "https://api.github.com", @@ -432912,13 +432912,13 @@ } ], "previews": [], - "descriptionHTML": "

Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get the number of API requests and rate-limited requests made within an organization by a specific user over a specified time period.

" }, { "serverUrl": "https://api.github.com", @@ -433911,7 +433911,6 @@ } ], "previews": [], - "descriptionHTML": "

Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.

", "statusCodes": [ { "httpStatusCode": "204", @@ -433921,7 +433920,8 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ] + ], + "descriptionHTML": "

Blocks the given user on behalf of the specified organization and returns a 204. If the organization cannot block the given user a 422 is returned.

" }, { "serverUrl": "https://api.github.com", @@ -434614,7 +434614,6 @@ } ], "previews": [], - "descriptionHTML": "

Gets all custom properties defined for an organization.\nOrganization members can read these properties.

", "statusCodes": [ { "httpStatusCode": "200", @@ -434628,7 +434627,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Gets all custom properties defined for an organization.\nOrganization members can read these properties.

" }, { "serverUrl": "https://api.github.com", @@ -438949,7 +438949,6 @@ } ], "previews": [], - "descriptionHTML": "

Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -438959,7 +438958,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Lists all issue types for an organization. OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -442810,13 +442810,13 @@ } ], "previews": [], - "descriptionHTML": "

Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default.

" }, { "serverUrl": "https://api.github.com", @@ -445502,7 +445502,6 @@ } ], "previews": [], - "descriptionHTML": "

Lists the organization roles available in this organization. For more information on organization roles, see \"Using organization roles.\"

\n

To use this endpoint, the authenticated user must be one of:

\n\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -445516,7 +445515,8 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ] + ], + "descriptionHTML": "

Lists the organization roles available in this organization. For more information on organization roles, see \"Using organization roles.\"

\n

To use this endpoint, the authenticated user must be one of:

\n\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -447147,13 +447147,13 @@ } ], "previews": [], - "descriptionHTML": "

Deletes a custom organization role. For more information on custom organization roles, see \"Managing people's access to your organization with roles.\"

\n

To use this endpoint, the authenticated user must be one of:

\n\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Deletes a custom organization role. For more information on custom organization roles, see \"Managing people's access to your organization with roles.\"

\n

To use this endpoint, the authenticated user must be one of:

\n\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -480475,7 +480475,6 @@ } ], "previews": [], - "descriptionHTML": "

Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -480485,7 +480484,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Gets the org public key, which is needed to encrypt private registry secrets. You need to encrypt a secret before you can create or update secrets.

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" }, { "serverUrl": "https://api.github.com", @@ -510710,13 +510710,13 @@ } ], "previews": [], - "descriptionHTML": "

Edits the content of a specified review comment.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Edits the content of a specified review comment.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n" }, { "serverUrl": "https://api.github.com", @@ -580457,13 +580457,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets a redirect URL to download a tar archive for a repository. If you omit :ref, the repository’s default branch (usually\nmain) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use\nthe Location header to make a second GET request.

\n

Note

\n

\nFor private repositories, these links are temporary and expire after five minutes.

\n
", "statusCodes": [ { "httpStatusCode": "302", "description": "

Found

" } - ] + ], + "descriptionHTML": "

Gets a redirect URL to download a tar archive for a repository. If you omit :ref, the repository’s default branch (usually\nmain) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to use\nthe Location header to make a second GET request.

\n

Note

\n

\nFor private repositories, these links are temporary and expire after five minutes.

\n
" }, { "serverUrl": "https://api.github.com", @@ -609124,7 +609124,6 @@ } ], "previews": [], - "descriptionHTML": "

Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results per page. See \"Searching topics\" for a detailed list of qualifiers.

\n

When searching for topics, you can get text match metadata for the topic's short_description, description, name, or display_name field when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

\n

For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:

\n

q=ruby+is:featured

\n

This query searches for topics with the keyword ruby and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.

", "statusCodes": [ { "httpStatusCode": "200", @@ -609134,7 +609133,8 @@ "httpStatusCode": "304", "description": "

Not modified

" } - ] + ], + "descriptionHTML": "

Find topics via various criteria. Results are sorted by best match. This method returns up to 100 results per page. See \"Searching topics\" for a detailed list of qualifiers.

\n

When searching for topics, you can get text match metadata for the topic's short_description, description, name, or display_name field when you pass the text-match media type. For more details about how to receive highlighted search results, see Text match metadata.

\n

For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:

\n

q=ruby+is:featured

\n

This query searches for topics with the keyword ruby and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results.

" }, { "serverUrl": "https://api.github.com", @@ -674426,13 +674426,13 @@ } ], "previews": [], - "descriptionHTML": "

List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user.

\n

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the attestations:read permission is required.

\n

Please note: in order to offer meaningful security benefits, an attestation's signature and timestamps must be cryptographically verified, and the identity of the attestation signer must be validated. Attestations can be verified using the GitHub CLI attestation verify command. For more information, see our guide on how to use artifact attestations to establish a build's provenance.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

List a collection of artifact attestations associated with any entry in a list of subject digests owned by a user.

\n

The collection of attestations returned by this endpoint is filtered according to the authenticated user's permissions; if the authenticated user cannot read a repository, the attestations associated with that repository will not be included in the response. In addition, when using a fine-grained access token the attestations:read permission is required.

\n

Please note: in order to offer meaningful security benefits, an attestation's signature and timestamps must be cryptographically verified, and the identity of the attestation signer must be validated. Attestations can be verified using the GitHub CLI attestation verify command. For more information, see our guide on how to use artifact attestations to establish a build's provenance.

" }, { "serverUrl": "https://api.github.com", diff --git a/src/rest/data/ghes-3.14-2022-11-28/schema.json b/src/rest/data/ghes-3.14-2022-11-28/schema.json index 375a581bdf88..de7633002909 100644 --- a/src/rest/data/ghes-3.14-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.14-2022-11-28/schema.json @@ -264,13 +264,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all artifacts for a repository.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all artifacts for a repository.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -1630,13 +1630,13 @@ } ], "previews": [], + "descriptionHTML": "

Sets GitHub Actions cache usage policy for a repository.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Sets GitHub Actions cache usage policy for a repository.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -2088,13 +2088,13 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a GitHub Actions cache for a repository, using a cache ID.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Deletes a GitHub Actions cache for a repository, using a cache ID.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] } ], "oidc": [ @@ -2634,13 +2634,13 @@ } ], "previews": [], + "descriptionHTML": "

Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -2961,13 +2961,13 @@ } ], "previews": [], + "descriptionHTML": "

Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see \"Set GitHub Actions permissions for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for enabled_organizations must be configured to selected. For more information, see \"Set GitHub Actions permissions for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -3503,13 +3503,13 @@ } ], "previews": [], + "descriptionHTML": "

Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

\n

If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions to selected actions, then you cannot override them for the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.

\n

If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as allowed_actions to selected actions, then you cannot override them for the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -4737,13 +4737,13 @@ } ], "previews": [], + "descriptionHTML": "

Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -4802,13 +4802,13 @@ } ], "previews": [], + "descriptionHTML": "

Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -5032,13 +5032,13 @@ } ], "previews": [], + "descriptionHTML": "

Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

If the organization belongs to an enterprise that has selected actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.

\n

To use the patterns_allowed setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories in the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

If the organization belongs to an enterprise that has selected actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.

\n

To use the patterns_allowed setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the patterns_allowed setting only applies to public repositories in the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -5287,13 +5287,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.

\n

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.

\n

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -5636,13 +5636,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for a repository.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for a repository.\"

\n

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -7859,13 +7859,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all organization secrets shared with a repository without revealing their encrypted\nvalues.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all organization secrets shared with a repository without revealing their encrypted\nvalues.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -8348,6 +8348,7 @@ } ], "previews": [], + "descriptionHTML": "

Creates or updates a repository secret with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", @@ -8357,8 +8358,7 @@ "httpStatusCode": "204", "description": "

Response when updating a secret

" } - ], - "descriptionHTML": "

Creates or updates a repository secret with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -8576,13 +8576,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all secrets available in an environment without revealing their\nencrypted values.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all secrets available in an environment without revealing their\nencrypted values.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -9723,13 +9723,13 @@ } ], "previews": [], + "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -10140,13 +10140,13 @@ } ], "previews": [], + "descriptionHTML": "

Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -10210,13 +10210,13 @@ } ], "previews": [], + "descriptionHTML": "

Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an enterprise.\"

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -11398,13 +11398,13 @@ } ], "previews": [], + "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Updates the name and visibility of a self-hosted runner group in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -12772,13 +12772,13 @@ } ], "previews": [], + "descriptionHTML": "

Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -13169,13 +13169,13 @@ } ], "previews": [], + "descriptionHTML": "

Replaces the list of self-hosted runners that are part of an organization runner group.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Replaces the list of self-hosted runners that are part of an organization runner group.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -13552,13 +13552,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all self-hosted runners configured for an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all self-hosted runners configured for an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -16034,13 +16034,13 @@ } ], "previews": [], + "descriptionHTML": "

Returns a token that you can pass to the config script to remove a self-hosted runner from an enterprise. The token expires after one hour.

\n

Example using remove token:

\n

To remove your self-hosted runner from an enterprise, replace TOKEN with the remove token provided by this\nendpoint.

\n
./config.sh remove --token TOKEN\n
\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ], - "descriptionHTML": "

Returns a token that you can pass to the config script to remove a self-hosted runner from an enterprise. The token expires after one hour.

\n

Example using remove token:

\n

To remove your self-hosted runner from an enterprise, replace TOKEN with the remove token provided by this\nendpoint.

\n
./config.sh remove --token TOKEN\n
\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -26487,13 +26487,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all organization variables shared with a repository.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all organization variables shared with a repository.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -27615,13 +27615,13 @@ } ], "previews": [], + "descriptionHTML": "

Deletes an environment variable using the variable name.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Deletes an environment variable using the variable name.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] } ], "workflow-jobs": [ @@ -28180,13 +28180,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look\nfor Location: in the response header to find the URL for the download.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "302", "description": "

Found

" } - ], - "descriptionHTML": "

Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look\nfor Location: in the response header to find the URL for the download.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -28716,6 +28716,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information\nabout using parameters, see Parameters.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", @@ -28725,8 +28726,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information\nabout using parameters, see Parameters.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -38250,13 +38250,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after\n1 minute. Look for Location: in the response header to find the URL for the download.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "302", "description": "

Found

" } - ], - "descriptionHTML": "

Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after\n1 minute. Look for Location: in the response header to find the URL for the download.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -38579,13 +38579,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for\nLocation: in the response header to find the URL for the download.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "302", "description": "

Found

" } - ], - "descriptionHTML": "

Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for\nLocation: in the response header to find the URL for the download.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -43415,13 +43415,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists the workflows in a repository.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists the workflows in a repository.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -43605,13 +43605,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a specific workflow. You can replace workflow_id with the workflow\nfile name. For example, you could use main.yaml.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a specific workflow. You can replace workflow_id with the workflow\nfile name. For example, you could use main.yaml.

\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -90519,13 +90519,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the announcement banner currently set for the organization. Only returns the announcement banner set at the\norganization level. Organization members may also see an enterprise-level announcement banner. To get an\nannouncement banner displayed at the enterprise level, use the enterprise-level endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the announcement banner currently set for the organization. Only returns the announcement banner set at the\norganization level. Organization members may also see an enterprise-level announcement banner. To get an\nannouncement banner displayed at the enterprise level, use the enterprise-level endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -108908,13 +108908,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the GitHub Advanced Security active committers for an organization per repository.

\n

Each distinct user login across all repositories is counted as a single Advanced Security seat, so the total_advanced_security_committers is not the sum of advanced_security_committers for each repository.

\n

If this organization defers to an enterprise for billing, the total_advanced_security_committers returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.

\n

The total number of repositories with committer information is tracked by the total_count field.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

Success

" } - ], - "descriptionHTML": "

Gets the GitHub Advanced Security active committers for an organization per repository.

\n

Each distinct user login across all repositories is counted as a single Advanced Security seat, so the total_advanced_security_committers is not the sum of advanced_security_committers for each repository.

\n

If this organization defers to an enterprise for billing, the total_advanced_security_committers returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.

\n

The total number of repositories with committer information is tracked by the total_count field.

" + ] } ] }, @@ -123622,13 +123622,13 @@ } ], "previews": [], + "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -125614,13 +125614,13 @@ } ], "previews": [], + "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -128738,6 +128738,7 @@ } ], "previews": [], + "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

", "statusCodes": [ { "httpStatusCode": "200", @@ -128751,8 +128752,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -139765,13 +139765,13 @@ } ], "previews": [], + "descriptionHTML": "

Updates a check run for a specific commit in a repository.

\n

Note

\n

\nThe endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

\n
\n

OAuth apps and personal access tokens (classic) cannot use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Updates a check run for a specific commit in a repository.

\n

Note

\n

\nThe endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

\n
\n

OAuth apps and personal access tokens (classic) cannot use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -142965,13 +142965,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.

\n

Note

\n

\nThe endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

\n
\n

If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the List check suites for a Git reference endpoint and provide the check_suite_id parameter to the List check runs in a check suite endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.

\n

Note

\n

\nThe endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

\n
\n

If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the List check suites for a Git reference endpoint and provide the check_suite_id parameter to the List check runs in a check suite endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

" + ] } ], "suites": [ @@ -147969,13 +147969,13 @@ } ], "previews": [], + "descriptionHTML": "

Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually Create a check suite.\nYou must have admin permissions in the repository to set preferences for check suites.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually Create a check suite.\nYou must have admin permissions in the repository to set preferences for check suites.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -149988,13 +149988,13 @@ } ], "previews": [], + "descriptionHTML": "

Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the check_suite webhook event with the action rerequested. When a check suite is rerequested, its status is reset to queued and the conclusion is cleared.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ], - "descriptionHTML": "

Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the check_suite webhook event with the action rerequested. When a check suite is rerequested, its status is reset to queued and the conclusion is cleared.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -151860,13 +151860,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists check suites for a commit ref. The ref can be a SHA, branch name, or a tag name.

\n

Note

\n

\nThe endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

\n
\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists check suites for a commit ref. The ref can be a SHA, branch name, or a tag name.

\n

Note

\n

\nThe endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

\n
\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint on a private repository.

" + ] } ] }, @@ -163257,13 +163257,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -174758,13 +174758,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists the commit comments for a specified repository. Comments are ordered by ascending ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists the commit comments for a specified repository. Comments are ordered by ascending ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -175694,6 +175694,7 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "204", @@ -175703,8 +175704,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -185605,13 +185605,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets your public key, which you need to encrypt secrets. You need to\nencrypt a secret before you can create or update secrets.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets your public key, which you need to encrypt secrets. You need to\nencrypt a secret before you can create or update secrets.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -187144,6 +187144,7 @@ } ], "previews": [], + "descriptionHTML": "

Removes a repository from an organization secret when the visibility\nfor repository access is set to selected. The visibility is set when you Create\nor update an organization secret.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", @@ -187153,8 +187154,7 @@ "httpStatusCode": "409", "description": "

Conflict when visibility type not set to selected

" } - ], - "descriptionHTML": "

Removes a repository from an organization secret when the visibility\nfor repository access is set to selected. The visibility is set when you Create\nor update an organization secret.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -187489,13 +187489,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a single repository secret without revealing its encrypted value.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a single repository secret without revealing its encrypted value.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -188769,13 +188769,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -192641,13 +192641,13 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a deployment branch or tag policy for an environment.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Deletes a deployment branch or tag policy for an environment.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] } ], "environments": [ @@ -195282,13 +195282,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"Using environments for deployment.\"

\n

For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

List of deployment protection rules

" } - ], - "descriptionHTML": "

Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"Using environments for deployment.\"

\n

For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -195454,13 +195454,13 @@ } ], "previews": [], + "descriptionHTML": "

Enable a custom deployment protection rule for an environment.

\n

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

\n

For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint, as well as the guide to creating custom deployment protection rules.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

The enabled custom deployment protection rule

" } - ], - "descriptionHTML": "

Enable a custom deployment protection rule for an environment.

\n

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

\n

For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint, as well as the guide to creating custom deployment protection rules.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -195796,13 +195796,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"Using environments for deployment.\"

\n

For more information about the app that is providing this custom deployment rule, see GET /apps/{app_slug}.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"Using environments for deployment.\"

\n

For more information about the app that is providing this custom deployment rule, see GET /apps/{app_slug}.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -201009,13 +201009,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -201077,13 +201077,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -201382,13 +201382,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the statistics about security products for a GitHub Enterprise Server instance.

\n

To use this endpoint, you must be a site admin.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the statistics about security products for a GitHub Enterprise Server instance.

\n

To use this endpoint, you must be a site admin.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -202759,13 +202759,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -202933,13 +202933,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -206307,6 +206307,7 @@ } ], "previews": [], + "descriptionHTML": "

Gets the status and details of maintenance mode on all available nodes. For more information, see \"Enabling and scheduling maintenance mode.\"

", "statusCodes": [ { "httpStatusCode": "200", @@ -206324,8 +206325,7 @@ "httpStatusCode": "500", "description": "

Internal error

" } - ], - "descriptionHTML": "

Gets the status and details of maintenance mode on all available nodes. For more information, see \"Enabling and scheduling maintenance mode.\"

" + ] }, { "serverUrl": "http(s)://HOSTNAME", @@ -210530,13 +210530,13 @@ } ], "previews": [], + "descriptionHTML": "

List all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

List all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -210742,13 +210742,13 @@ } ], "previews": [], + "descriptionHTML": "

For pre-receive hooks which are allowed to be configured at the repo level, you can set enforcement

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

For pre-receive hooks which are allowed to be configured at the repo level, you can set enforcement

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -220806,6 +220806,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:

", "statusCodes": [ { "httpStatusCode": "200", @@ -220819,8 +220820,7 @@ "httpStatusCode": "403", "description": "

Forbidden

" } - ], - "descriptionHTML": "

Lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists:

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -237525,6 +237525,7 @@ } ], "previews": [], + "descriptionHTML": "

Returns a single tree using the SHA1 value or ref name for that tree.

\n

If truncated is true in the response then the number of items in the tree array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.

\n

Note

\n

\nThe limit for the tree array is 100,000 entries with a maximum size of 7 MB when using the recursive parameter.

\n
", "statusCodes": [ { "httpStatusCode": "200", @@ -237542,8 +237543,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Returns a single tree using the SHA1 value or ref name for that tree.

\n

If truncated is true in the response then the number of items in the tree array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.

\n

Note

\n

\nThe limit for the tree array is 100,000 entries with a maximum size of 7 MB when using the recursive parameter.

\n
" + ] } ] }, @@ -270674,6 +270674,7 @@ } ], "previews": [], + "descriptionHTML": "

You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

\n

This endpoint triggers notifications.\nCreating content too quickly using this endpoint may result in secondary rate limiting.\nFor more information, see \"Rate limits for the API\"\nand \"Best practices for using the REST API.\"

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n", "statusCodes": [ { "httpStatusCode": "201", @@ -270695,8 +270696,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

\n

This endpoint triggers notifications.\nCreating content too quickly using this endpoint may result in secondary rate limiting.\nFor more information, see \"Rate limits for the API\"\nand \"Best practices for using the REST API.\"

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n" + ] } ], "events": [ @@ -293405,13 +293405,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists labels for issues in a milestone.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists labels for issues in a milestone.

" + ] } ], "milestones": [ @@ -313683,13 +313683,13 @@ } ], "previews": [], + "descriptionHTML": "

Get a random sentence from the Zen of GitHub

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Get a random sentence from the Zen of GitHub

" + ] } ] }, @@ -319143,6 +319143,7 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a previous migration archive. Migration archives are automatically deleted after seven days.

", "statusCodes": [ { "httpStatusCode": "204", @@ -319152,8 +319153,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Deletes a previous migration archive. Migration archives are automatically deleted after seven days.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -324598,6 +324598,7 @@ } ], "previews": [], + "descriptionHTML": "

Warning

\n

\nClosing down notice: GitHub Enterprise Server will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November 13, 2020. For more information, including scheduled brownouts, see the blog post.

\n
\n

You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes returned are the union of scopes authorized for the application. For example, if an application has one token with repo scope and another token with user scope, the grant will return [\"repo\", \"user\"].

", "statusCodes": [ { "httpStatusCode": "200", @@ -324619,8 +324620,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Warning

\n

\nClosing down notice: GitHub Enterprise Server will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November 13, 2020. For more information, including scheduled brownouts, see the blog post.

\n
\n

You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes returned are the union of scopes authorized for the application. For example, if an application has one token with repo scope and another token with user scope, the grant will return [\"repo\", \"user\"].

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -336400,13 +336400,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all GitHub Apps in an organization. The installation count includes\nall GitHub Apps installed on repositories in the organization.

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:read scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all GitHub Apps in an organization. The installation count includes\nall GitHub Apps installed on repositories in the organization.

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:read scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -338501,13 +338501,13 @@ } ], "previews": [], + "descriptionHTML": "

Warning

\n

\nClosing down notice: This operation is closing down and will be removed in the future. Use the \"List custom repository roles\" endpoint instead.

\n
\n

List the custom repository roles available in this organization. For more information on custom repository roles, see \"About custom repository roles.\"

\n

The authenticated user must be administrator of the organization or of a repository of the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

Response - list of custom role names

" } - ], - "descriptionHTML": "

Warning

\n

\nClosing down notice: This operation is closing down and will be removed in the future. Use the \"List custom repository roles\" endpoint instead.

\n
\n

List the custom repository roles available in this organization. For more information on custom repository roles, see \"About custom repository roles.\"

\n

The authenticated user must be administrator of the organization or of a repository of the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -339973,13 +339973,13 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a custom role from an organization. Once the custom role has been deleted, any\nuser, team, or invitation with the deleted custom role will be reassigned the inherited role. For more information about custom repository roles, see \"About custom repository roles.\"

\n

The authenticated user must be an administrator for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Deletes a custom role from an organization. Once the custom role has been deleted, any\nuser, team, or invitation with the deleted custom role will be reassigned the inherited role. For more information about custom repository roles, see \"About custom repository roles.\"

\n

The authenticated user must be an administrator for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -340505,6 +340505,7 @@ } ], "previews": [], + "descriptionHTML": "

Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.

\n

Note

\n

\nIf a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.

\n
", "statusCodes": [ { "httpStatusCode": "204", @@ -340514,8 +340515,7 @@ "httpStatusCode": "403", "description": "

Forbidden

" } - ], - "descriptionHTML": "

Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.

\n

Note

\n

\nIf a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.

\n
" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -341764,13 +341764,13 @@ } ], "previews": [], + "descriptionHTML": "

Members of an organization can choose to have their membership publicized or not.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Members of an organization can choose to have their membership publicized or not.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -357500,13 +357500,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists teams that are security managers for an organization. For more information, see \"Managing security managers in your organization.\"

\n

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists teams that are security managers for an organization. For more information, see \"Managing security managers in your organization.\"

\n

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the read:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -358110,6 +358110,7 @@ } ], "previews": [], + "descriptionHTML": "

Create a hook that posts payloads in JSON format.

\n

You must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or\nedit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

", "statusCodes": [ { "httpStatusCode": "201", @@ -358123,8 +358124,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Create a hook that posts payloads in JSON format.

\n

You must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or\nedit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -358766,13 +358766,13 @@ } ], "previews": [], + "descriptionHTML": "

Returns the webhook configuration for an organization. To get more information about the webhook, including the active state and events, use \"Get an organization webhook .\"

\n

You must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit\nwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Returns the webhook configuration for an organization. To get more information about the webhook, including the active state and events, use \"Get an organization webhook .\"

\n

You must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit\nwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -363981,13 +363981,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a specific package version in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a specific package version in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -381153,6 +381153,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project admin to list collaborators.

", "statusCodes": [ { "httpStatusCode": "200", @@ -381178,8 +381179,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project admin to list collaborators.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -382312,6 +382312,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists the project columns in a project.

", "statusCodes": [ { "httpStatusCode": "200", @@ -382329,8 +382330,7 @@ "httpStatusCode": "403", "description": "

Forbidden

" } - ], - "descriptionHTML": "

Lists the project columns in a project.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -425222,13 +425222,13 @@ } ], "previews": [], + "descriptionHTML": "

Note

\n

\nYou can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

\n
\n

Delete a reaction to a commit comment.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Note

\n

\nYou can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id.

\n
\n

Delete a reaction to a commit comment.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -433381,13 +433381,13 @@ } ], "previews": [], + "descriptionHTML": "

View the latest published full release for the repository.

\n

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

View the latest published full release for the repository.

\n

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -443263,6 +443263,7 @@ } ], "previews": [], + "descriptionHTML": "

Creates a new repository in the specified organization. The authenticated user must be a member of the organization.

\n

OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.

", "statusCodes": [ { "httpStatusCode": "201", @@ -443276,8 +443277,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Creates a new repository in the specified organization. The authenticated user must be a member of the organization.

\n

OAuth app tokens and personal access tokens (classic) need the public_repo or repo scope to create a public repository, and repo scope to create a private repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -454748,6 +454748,7 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", @@ -454757,8 +454758,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -455998,13 +455998,13 @@ } ], "previews": [], + "descriptionHTML": "

A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original owner, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see about repository transfers.

", "statusCodes": [ { "httpStatusCode": "202", "description": "

Accepted

" } - ], - "descriptionHTML": "

A transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original owner, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see about repository transfers.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -492761,6 +492761,7 @@ } ], "previews": [], + "descriptionHTML": "

Find commits via various criteria on the default branch (usually main). This method returns up to 100 results per page.

\n

When searching for commits, you can get text match metadata for the message field when you provide the text-match media type. For more details about how to receive highlighted search results, see Text match\nmetadata.

\n

For example, if you want to find commits related to CSS in the octocat/Spoon-Knife repository. Your query would look something like this:

\n

q=repo:octocat/Spoon-Knife+css

", "statusCodes": [ { "httpStatusCode": "200", @@ -492770,8 +492771,7 @@ "httpStatusCode": "304", "description": "

Not modified

" } - ], - "descriptionHTML": "

Find commits via various criteria on the default branch (usually main). This method returns up to 100 results per page.

\n

When searching for commits, you can get text match metadata for the message field when you provide the text-match media type. For more details about how to receive highlighted search results, see Text match\nmetadata.

\n

For example, if you want to find commits related to CSS in the octocat/Spoon-Knife repository. Your query would look something like this:

\n

q=repo:octocat/Spoon-Knife+css

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -519463,13 +519463,13 @@ } ], "previews": [], + "descriptionHTML": "

Get a specific comment on a team discussion.

\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

\n
\n

OAuth app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Get a specific comment on a team discussion.

\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

\n
\n

OAuth app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -519989,13 +519989,13 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a comment on a team discussion.

\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

\n
\n

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Deletes a comment on a team discussion.

\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}.

\n
\n

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -523782,13 +523782,13 @@ } ], "previews": [], + "descriptionHTML": "

Edits the title and body text of a discussion post. Only the parameters you provide are updated.

\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

\n
\n

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Edits the title and body text of a discussion post. Only the parameters you provide are updated.

\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}.

\n
\n

OAuth app tokens and personal access tokens (classic) need the write:discussion scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -526574,13 +526574,13 @@ } ], "previews": [], + "descriptionHTML": "

Creates a connection between a team and an external group. Only one external group can be linked to a team.

\n

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see \"GitHub's products\" in the GitHub Help documentation.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Creates a connection between a team and an external group. Only one external group can be linked to a team.

\n

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see \"GitHub's products\" in the GitHub Help documentation.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -527225,6 +527225,7 @@ } ], "previews": [], + "descriptionHTML": "

To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.

\n

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.

\n

Note

\n

\nWhen you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"Synchronizing teams between your identity provider and GitHub Enterprise Server.\"

\n
\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}.

\n
", "statusCodes": [ { "httpStatusCode": "204", @@ -527234,8 +527235,7 @@ "httpStatusCode": "403", "description": "

Forbidden if team synchronization is set up

" } - ], - "descriptionHTML": "

To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.

\n

Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see GitHub's products in the GitHub Help documentation.

\n

Note

\n

\nWhen you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see \"Synchronizing teams between your identity provider and GitHub Enterprise Server.\"

\n
\n

Note

\n

\nYou can also specify a team by org_id and team_id using the route DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}.

\n
" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -536994,13 +536994,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists social media accounts for a user. This endpoint is accessible by anyone.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists social media accounts for a user. This endpoint is accessible by anyone.

" + ] } ], "ssh-signing-keys": [ diff --git a/src/rest/data/ghes-3.15-2022-11-28/schema.json b/src/rest/data/ghes-3.15-2022-11-28/schema.json index 22dccb8da671..e76a3fc28f5a 100644 --- a/src/rest/data/ghes-3.15-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.15-2022-11-28/schema.json @@ -5287,13 +5287,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.

\n

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.

\n

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the administration repository permission to use this API.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -5818,13 +5818,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository,\nas well as if GitHub Actions can submit approving pull request reviews.\nFor more information, see \"Setting the permissions of the GITHUB_TOKEN for your repository.\"

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository,\nas well as if GitHub Actions can submit approving pull request reviews.\nFor more information, see \"Setting the permissions of the GITHUB_TOKEN for your repository.\"

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -8360,6 +8360,7 @@ } ], "previews": [], + "descriptionHTML": "

Creates or updates a repository secret with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", @@ -8369,8 +8370,7 @@ "httpStatusCode": "204", "description": "

Response when updating a secret

" } - ], - "descriptionHTML": "

Creates or updates a repository secret with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -10461,13 +10461,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists the self-hosted runners that are in a specific enterprise group.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists the self-hosted runners that are in a specific enterprise group.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -12871,13 +12871,13 @@ } ], "previews": [], + "descriptionHTML": "

Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -23692,13 +23692,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a specific self-hosted runner configured in a repository.

\n

Authenticated users must have admin access to the repository to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a specific self-hosted runner configured in a repository.

\n

Authenticated users must have admin access to the repository to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -26896,13 +26896,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a specific variable in a repository.

\n

The authenticated user must have collaborator access to the repository to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a specific variable in a repository.

\n

The authenticated user must have collaborator access to the repository to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -28141,13 +28141,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a specific job in a workflow run.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a specific job in a workflow run.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -40258,13 +40258,13 @@ } ], "previews": [], + "descriptionHTML": "

Approve or reject pending deployments that are waiting on approval by a required reviewer.

\n

Required reviewers with read access to the repository contents and deployments can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Approve or reject pending deployments that are waiting on approval by a required reviewer.

\n

Required reviewers with read access to the repository contents and deployments can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -88351,13 +88351,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists the people watching the specified repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists the people watching the specified repository.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -103635,13 +103635,13 @@ } ], "previews": [], + "descriptionHTML": "

Revokes the installation token you're using to authenticate as an installation and access this endpoint.

\n

Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the \"Create an installation access token for an app\" endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Revokes the installation token you're using to authenticate as an installation and access this endpoint.

\n

Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the \"Create an installation access token for an app\" endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -192956,13 +192956,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -199259,13 +199259,13 @@ } ], "previews": [], + "descriptionHTML": "

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

Default response

" } - ], - "descriptionHTML": "

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] } ], "protection-rules": [ @@ -205605,13 +205605,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the statistics about security products for a GitHub Enterprise Server instance.

\n

To use this endpoint, you must be a site admin.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the statistics about security products for a GitHub Enterprise Server instance.

\n

To use this endpoint, you must be a site admin.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -206998,13 +206998,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -207172,13 +207172,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -207515,13 +207515,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -208363,13 +208363,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "" + ] } ], "manage-ghes": [ @@ -212259,6 +212259,7 @@ } ], "previews": [], + "descriptionHTML": "

If you attempt to delete an environment that cannot be deleted, you will receive a 422 Unprocessable Entity response.

\n

The possible error messages are:

\n", "statusCodes": [ { "httpStatusCode": "204", @@ -212268,8 +212269,7 @@ "httpStatusCode": "422", "description": "

Client Errors

" } - ], - "descriptionHTML": "

If you attempt to delete an environment that cannot be deleted, you will receive a 422 Unprocessable Entity response.

\n

The possible error messages are:

\n" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -213639,13 +213639,13 @@ } ], "previews": [], + "descriptionHTML": "

For pre-receive hooks which are allowed to be configured at the repo level, you can set enforcement

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

For pre-receive hooks which are allowed to be configured at the repo level, you can set enforcement

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -222920,13 +222920,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -223081,13 +223081,13 @@ } ], "previews": [], + "descriptionHTML": "

If your GitHub instance uses LDAP Sync with Active Directory LDAP servers, Active Directory LDAP-authenticated users cannot be suspended through this API. If you attempt to suspend an Active Directory LDAP-authenticated user through this API, it will return a 403 response.

\n

You can suspend any user account except your own.

\n

Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see \"HTTP method.\"

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

If your GitHub instance uses LDAP Sync with Active Directory LDAP servers, Active Directory LDAP-authenticated users cannot be suspended through this API. If you attempt to suspend an Active Directory LDAP-authenticated user through this API, it will return a 403 response.

\n

You can suspend any user account except your own.

\n

Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see \"HTTP method.\"

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -296258,13 +296258,13 @@ } ], "previews": [], + "descriptionHTML": "

Updates a label using the given label name.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Updates a label using the given label name.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -316623,13 +316623,13 @@ } ], "previews": [], + "descriptionHTML": "

Get Hypermedia links to resources accessible in GitHub's REST API

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Get Hypermedia links to resources accessible in GitHub's REST API

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -316866,13 +316866,13 @@ } ], "previews": [], + "descriptionHTML": "

Get the octocat as ASCII art

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Get the octocat as ASCII art

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -339729,13 +339729,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all GitHub Apps in an organization. The installation count includes\nall GitHub Apps installed on repositories in the organization.

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:read scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all GitHub Apps in an organization. The installation count includes\nall GitHub Apps installed on repositories in the organization.

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:read scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -347802,13 +347802,13 @@ } ], "previews": [], + "descriptionHTML": "

Removes an organization role from a team. For more information on organization roles, see \"Using organization roles.\"

\n

The authenticated user must be an administrator for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Removes an organization role from a team. For more information on organization roles, see \"Using organization roles.\"

\n

The authenticated user must be an administrator for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -348022,13 +348022,13 @@ } ], "previews": [], + "descriptionHTML": "

Remove an organization role from a user. For more information on organization roles, see \"Using organization roles.\"

\n

The authenticated user must be an administrator for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Remove an organization role from a user. For more information on organization roles, see \"Using organization roles.\"

\n

The authenticated user must be an administrator for the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -410221,13 +410221,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all review comments for a specified pull request. By default, review comments\nare in ascending order by ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all review comments for a specified pull request. By default, review comments\nare in ascending order by ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -530930,13 +530930,13 @@ } ], "previews": [], + "descriptionHTML": "

Displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.

\n

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see \"GitHub's products\" in the GitHub Help documentation.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.

\n

You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see \"GitHub's products\" in the GitHub Help documentation.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -539218,13 +539218,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists the people following the specified user.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists the people following the specified user.

" + ] }, { "serverUrl": "http(s)://HOSTNAME/api/v3", diff --git a/src/rest/docs.js b/src/rest/docs.js index de00a9f20e6c..b67023c8cb52 100755 --- a/src/rest/docs.js +++ b/src/rest/docs.js @@ -1,6 +1,6 @@ import chalk from 'chalk' import { readFile } from 'fs/promises' -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { allVersions } from '@/versions/lib/all-versions' // Translate the docs versioning nomenclature back to the OpenAPI names const invertedVersionMapping = JSON.parse(await readFile('src/rest/lib/config.json')).versionMapping diff --git a/src/rest/lib/index.js b/src/rest/lib/index.js index adb4216c0223..748d7d1920b5 100644 --- a/src/rest/lib/index.js +++ b/src/rest/lib/index.js @@ -1,10 +1,10 @@ import fs from 'fs' import path from 'path' -import { readCompressedJsonFileFallback } from '#src/frame/lib/read-json-file.js' -import { getAutomatedPageMiniTocItems } from '#src/frame/lib/get-mini-toc-items.js' -import { allVersions, getOpenApiVersion } from '#src/versions/lib/all-versions.ts' -import languages from '#src/languages/lib/languages.ts' +import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file' +import { getAutomatedPageMiniTocItems } from '@/frame/lib/get-mini-toc-items' +import { allVersions, getOpenApiVersion } from '@/versions/lib/all-versions' +import languages from '@/languages/lib/languages' export const REST_DATA_DIR = 'src/rest/data' export const REST_SCHEMA_FILENAME = 'schema.json' diff --git a/src/rest/scripts/openapi-check.js b/src/rest/scripts/openapi-check.js index c1f182641c9b..adc9414b4ea7 100755 --- a/src/rest/scripts/openapi-check.js +++ b/src/rest/scripts/openapi-check.js @@ -8,7 +8,7 @@ import fs from 'fs' import path from 'path' import { globSync } from 'glob' import { program } from 'commander' -import { createOperations, processOperations } from './utils/get-operations.js' +import { createOperations, processOperations } from './utils/get-operations' program .description('Generate dereferenced OpenAPI and decorated schema files.') diff --git a/src/rest/scripts/test-open-api-schema.js b/src/rest/scripts/test-open-api-schema.js index 5c5295a98dce..5a3e05d13279 100755 --- a/src/rest/scripts/test-open-api-schema.js +++ b/src/rest/scripts/test-open-api-schema.js @@ -7,13 +7,13 @@ import fs from 'fs' import path from 'path' import _ from 'lodash' -import frontmatter from '#src/frame/lib/read-frontmatter.js' -import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js' -import { allVersions, getDocsVersion } from '#src/versions/lib/all-versions.ts' -import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../lib/index.js' -import { nonAutomatedRestPaths } from '../lib/config.js' -import { deprecated } from '#src/versions/lib/enterprise-server-releases.js' -import walkFiles from '#src/workflows/walk-files.ts' +import frontmatter from '@/frame/lib/read-frontmatter' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import { allVersions, getDocsVersion } from '@/versions/lib/all-versions' +import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../lib/index' +import { nonAutomatedRestPaths } from '../lib/config' +import { deprecated } from '@/versions/lib/enterprise-server-releases' +import walkFiles from '@/workflows/walk-files' export async function getDiffOpenAPIContentRest() { const contentFiles = getAutomatedMarkdownFiles('content/rest') diff --git a/src/rest/scripts/utils/get-openapi-schemas.js b/src/rest/scripts/utils/get-openapi-schemas.js index 261aa661b724..eab4b23ec725 100644 --- a/src/rest/scripts/utils/get-openapi-schemas.js +++ b/src/rest/scripts/utils/get-openapi-schemas.js @@ -2,7 +2,7 @@ import { readFile, readdir } from 'fs/promises' import yaml from 'js-yaml' import path from 'path' -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { allVersions } from '@/versions/lib/all-versions' const OPEN_API_RELEASES_DIR = '../github/app/api/description/config/releases' const configData = JSON.parse(await readFile('src/rest/lib/config.json', 'utf8')) diff --git a/src/rest/scripts/utils/get-operations.js b/src/rest/scripts/utils/get-operations.js index e3d6ae92000d..916a9450fab6 100644 --- a/src/rest/scripts/utils/get-operations.js +++ b/src/rest/scripts/utils/get-operations.js @@ -1,4 +1,4 @@ -import Operation from './operation.js' +import Operation from './operation' // The module accepts a JSON schema object as input // and returns an array of its operation objects with their diff --git a/src/rest/scripts/utils/operation.js b/src/rest/scripts/utils/operation.js index 201e6fd05981..1f493b5001ee 100644 --- a/src/rest/scripts/utils/operation.js +++ b/src/rest/scripts/utils/operation.js @@ -4,9 +4,9 @@ import { parseTemplate } from 'url-template' import mergeAllOf from 'json-schema-merge-allof' import { renderContent } from './render-content' -import getCodeSamples from './create-rest-examples.js' -import operationSchema from './operation-schema.js' -import { validateJson } from '#src/tests/lib/validate-json-schema.ts' +import getCodeSamples from './create-rest-examples' +import operationSchema from './operation-schema' +import { validateJson } from '@/tests/lib/validate-json-schema' import { getBodyParams } from './get-body-params' export default class Operation { diff --git a/src/rest/scripts/utils/update-markdown.js b/src/rest/scripts/utils/update-markdown.js index ac8d55ae390a..f0ec8d459136 100644 --- a/src/rest/scripts/utils/update-markdown.js +++ b/src/rest/scripts/utils/update-markdown.js @@ -5,10 +5,10 @@ import { readFile } from 'fs/promises' import { updateContentDirectory, convertVersionsToFrontmatter, -} from '../../../automated-pipelines/lib/update-markdown.js' -import { getDocsVersion } from '#src/versions/lib/all-versions.ts' -import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../../lib/index.js' -import { deprecated } from '#src/versions/lib/enterprise-server-releases.js' +} from '../../../automated-pipelines/lib/update-markdown' +import { getDocsVersion } from '@/versions/lib/all-versions' +import { REST_DATA_DIR, REST_SCHEMA_FILENAME } from '../../lib/index' +import { deprecated } from '@/versions/lib/enterprise-server-releases' const { frontmatterDefaults, targetDirectory, indexOrder } = JSON.parse( await readFile('src/rest/lib/config.json', 'utf-8'), diff --git a/src/rest/tests/api.js b/src/rest/tests/api.js index 2d62edb96e81..837301d0f0e3 100644 --- a/src/rest/tests/api.js +++ b/src/rest/tests/api.js @@ -2,11 +2,11 @@ import fs from 'fs' import { describe, expect, test } from 'vitest' -import { get } from '#src/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' import { SURROGATE_ENUMS, makeLanguageSurrogateKey, -} from '#src/frame/middleware/set-fastly-surrogate-key.js' +} from '@/frame/middleware/set-fastly-surrogate-key' describe('anchor-redirect api', () => { const clientSideRedirects = JSON.parse( diff --git a/src/rest/tests/cli-examples.js b/src/rest/tests/cli-examples.js index 79309c695373..94336f564af9 100644 --- a/src/rest/tests/cli-examples.js +++ b/src/rest/tests/cli-examples.js @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { getGHExample, getShellExample } from '../components/get-rest-code-samples.ts' +import { getGHExample, getShellExample } from '../components/get-rest-code-samples' describe('CLI examples generation', () => { const mockOperation = { diff --git a/src/rest/tests/create-rest-examples.js b/src/rest/tests/create-rest-examples.js index ea91de6d004f..20006210de9a 100644 --- a/src/rest/tests/create-rest-examples.js +++ b/src/rest/tests/create-rest-examples.js @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import getCodeSamples, { mergeExamples } from '../scripts/utils/create-rest-examples.js' +import getCodeSamples, { mergeExamples } from '../scripts/utils/create-rest-examples' import { operation, noContent, @@ -8,7 +8,7 @@ import { noResponse, oneToOne, matchingTags, -} from '../fixtures/create-rest-examples.js' +} from '../fixtures/create-rest-examples' describe('rest example requests and responses', () => { // If there is a request with no request body parameters and all of diff --git a/src/rest/tests/openapi-schema.js b/src/rest/tests/openapi-schema.js index 2aff779c6fa0..c0bee320c3b3 100644 --- a/src/rest/tests/openapi-schema.js +++ b/src/rest/tests/openapi-schema.js @@ -5,13 +5,13 @@ import { beforeAll, describe, expect, test } from 'vitest' import walk from 'walk-sync' import { isPlainObject, difference } from 'lodash-es' -import { isApiVersioned, allVersions } from '#src/versions/lib/all-versions.ts' -import getRest from '../lib/index.js' -import readFrontmatter from '#src/frame/lib/read-frontmatter.js' -import frontmatter from '#src/frame/lib/frontmatter.js' -import getApplicableVersions from '../../versions/lib/get-applicable-versions.js' -import { getAutomatedMarkdownFiles } from '../scripts/test-open-api-schema.js' -import { nonAutomatedRestPaths } from '../lib/config.js' +import { isApiVersioned, allVersions } from '@/versions/lib/all-versions' +import getRest from '../lib/index' +import readFrontmatter from '@/frame/lib/read-frontmatter' +import frontmatter from '@/frame/lib/frontmatter' +import getApplicableVersions from '../../versions/lib/get-applicable-versions' +import { getAutomatedMarkdownFiles } from '../scripts/test-open-api-schema' +import { nonAutomatedRestPaths } from '../lib/config' const schemasPath = 'src/rest/data' diff --git a/src/rest/tests/rendering.js b/src/rest/tests/rendering.js index 537dd66cf8f2..d22774fb9c91 100644 --- a/src/rest/tests/rendering.js +++ b/src/rest/tests/rendering.js @@ -1,10 +1,10 @@ import { describe, expect, test, vi } from 'vitest' import { slug } from 'github-slugger' -import { get, getDOM } from '#src/tests/helpers/e2etest.js' -import { isApiVersioned, allVersions } from '#src/versions/lib/all-versions.ts' -import { getDiffOpenAPIContentRest } from '../scripts/test-open-api-schema.js' -import getRest from '#src/rest/lib/index.js' +import { get, getDOM } from '@/tests/helpers/e2etest' +import { isApiVersioned, allVersions } from '@/versions/lib/all-versions' +import { getDiffOpenAPIContentRest } from '../scripts/test-open-api-schema' +import getRest from '@/rest/lib/index' describe('REST references docs', () => { vi.setConfig({ testTimeout: 3 * 60 * 1000 }) diff --git a/src/rest/tests/update-markdown.js b/src/rest/tests/update-markdown.js index 8d63729ddb01..a172cd875d98 100644 --- a/src/rest/tests/update-markdown.js +++ b/src/rest/tests/update-markdown.js @@ -1,5 +1,5 @@ import { describe, expect, test } from 'vitest' -import { getGHESVersionFromFilepath } from '../scripts/utils/update-markdown.js' +import { getGHESVersionFromFilepath } from '../scripts/utils/update-markdown' describe('GHES version extraction for update-markdown', () => { test('extracts GHES version from file path with date suffix', () => { diff --git a/src/search/middleware/ai-search.ts b/src/search/middleware/ai-search.ts index 639e5f6c8f3f..71b32e29c4f2 100644 --- a/src/search/middleware/ai-search.ts +++ b/src/search/middleware/ai-search.ts @@ -1,8 +1,8 @@ import express, { Request, Response } from 'express' -import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js' +import catchMiddlewareError from '@/observability/middleware/catch-middleware-error' import { aiSearchProxy } from '../lib/ai-search-proxy' -import { noCacheControl } from '@/frame/middleware/cache-control.js' +import { noCacheControl } from '@/frame/middleware/cache-control' const router = express.Router() diff --git a/src/search/middleware/general-search-middleware.ts b/src/search/middleware/general-search-middleware.ts index 5613d2bb7ef4..1b6f9ce80f17 100644 --- a/src/search/middleware/general-search-middleware.ts +++ b/src/search/middleware/general-search-middleware.ts @@ -9,7 +9,7 @@ When a user directly hits our API e.g. /api/search/v1?query=foo, they will hit t import got from 'got' import { Request, Response, NextFunction } from 'express' import { errors } from '@elastic/elasticsearch' -import statsd from '@/observability/lib/statsd.js' +import statsd from '@/observability/lib/statsd' import { getPathWithoutVersion, getPathWithoutLanguage } from '@/frame/lib/path-utils' import { getGeneralSearchResults } from '@/search/lib/get-elasticsearch-results/general-search' @@ -21,7 +21,7 @@ import type { SearchOnReqObject, SearchTypes, SearchValidationErrorEntry, -} from '@/search/types.js' +} from '@/search/types' interface Context { currentVersion: string diff --git a/src/search/middleware/search-routes.ts b/src/search/middleware/search-routes.ts index 278ef9d0a2c7..1138f569e432 100644 --- a/src/search/middleware/search-routes.ts +++ b/src/search/middleware/search-routes.ts @@ -6,13 +6,10 @@ // TODO: Move the routes implementations in this files to lib/routes so you can at-a-glance see all of the routes without the implementation logic import express, { Request, Response } from 'express' -import FailBot from '@/observability/lib/failbot.js' -import { searchCacheControl } from '@/frame/middleware/cache-control.js' -import catchMiddlewareError from '@/observability/middleware/catch-middleware-error.js' -import { - setFastlySurrogateKey, - SURROGATE_ENUMS, -} from '@/frame/middleware/set-fastly-surrogate-key.js' +import FailBot from '@/observability/lib/failbot' +import { searchCacheControl } from '@/frame/middleware/cache-control' +import catchMiddlewareError from '@/observability/middleware/catch-middleware-error' +import { setFastlySurrogateKey, SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' import { getAISearchAutocompleteResults } from '@/search/lib/get-elasticsearch-results/ai-search-autocomplete' import { getSearchFromRequestParams } from '@/search/lib/search-request-params/get-search-from-request-params' import { getGeneralSearchResults } from '@/search/lib/get-elasticsearch-results/general-search' diff --git a/src/search/scripts/scrape/lib/find-indexable-pages.ts b/src/search/scripts/scrape/lib/find-indexable-pages.ts index ed37cd196c2b..2938d3393a4e 100644 --- a/src/search/scripts/scrape/lib/find-indexable-pages.ts +++ b/src/search/scripts/scrape/lib/find-indexable-pages.ts @@ -1,4 +1,4 @@ -import { loadPages } from '@/frame/lib/page-data.js' +import { loadPages } from '@/frame/lib/page-data' import type { Page } from '@/search/scripts/scrape/types' diff --git a/src/search/scripts/scrape/lib/popular-pages.ts b/src/search/scripts/scrape/lib/popular-pages.ts index a6e42053441b..72dbc71dd134 100644 --- a/src/search/scripts/scrape/lib/popular-pages.ts +++ b/src/search/scripts/scrape/lib/popular-pages.ts @@ -2,7 +2,7 @@ import { join } from 'path' import { existsSync } from 'fs' import fs from 'fs/promises' -import { getPlanVersionFromIndexVersion } from '@/search/lib/elasticsearch-versions.js' +import { getPlanVersionFromIndexVersion } from '@/search/lib/elasticsearch-versions' import type { Redirects, PopularPages } from '@/search/scripts/scrape/types' diff --git a/src/search/tests/api-ai-search.ts b/src/search/tests/api-ai-search.ts index 8a0d3c04272b..7512ca23550c 100644 --- a/src/search/tests/api-ai-search.ts +++ b/src/search/tests/api-ai-search.ts @@ -1,6 +1,6 @@ import { expect, test, describe, beforeAll, afterAll } from 'vitest' -import { post } from '@/tests/helpers/e2etest.js' +import { post } from '@/tests/helpers/e2etest' import { startMockServer, stopMockServer } from '@/tests/mocks/start-mock-server' describe('AI Search Routes', () => { diff --git a/src/search/tests/rendering.ts b/src/search/tests/rendering.ts index 7c3d8ee0035b..711301a47dfc 100644 --- a/src/search/tests/rendering.ts +++ b/src/search/tests/rendering.ts @@ -15,7 +15,7 @@ import { expect, test, vi } from 'vitest' import { describeIfElasticsearchURL } from '@/tests/helpers/conditional-runs' import { get, getDOM } from '@/tests/helpers/e2etest-ts' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' if (!process.env.ELASTICSEARCH_URL) { console.warn( diff --git a/src/secret-scanning/data/public-docs-schema.ts b/src/secret-scanning/data/public-docs-schema.ts index 9919f28fcda2..ff079694e865 100644 --- a/src/secret-scanning/data/public-docs-schema.ts +++ b/src/secret-scanning/data/public-docs-schema.ts @@ -1,4 +1,4 @@ -import { schema } from '@/frame/lib/frontmatter.js' +import { schema } from '@/frame/lib/frontmatter' // Secret scanning entries have `versions` blocks that match `versions` frontmatter, // so we can import that part of the FM schema. diff --git a/src/secret-scanning/middleware/secret-scanning.ts b/src/secret-scanning/middleware/secret-scanning.ts index 20b139194d21..5d68d398a322 100644 --- a/src/secret-scanning/middleware/secret-scanning.ts +++ b/src/secret-scanning/middleware/secret-scanning.ts @@ -3,8 +3,8 @@ import fs from 'fs' import yaml from 'js-yaml' import type { NextFunction, Response } from 'express' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' -import { liquid } from '@/content-render/index.js' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import { liquid } from '@/content-render/index' import { ExtendedRequest, SecretScanningData } from '@/types' const secretScanningPath = 'src/secret-scanning/data/public-docs.yml' diff --git a/src/secret-scanning/scripts/sync.ts b/src/secret-scanning/scripts/sync.ts index 5f61f60e77d2..99edc4f824a9 100755 --- a/src/secret-scanning/scripts/sync.ts +++ b/src/secret-scanning/scripts/sync.ts @@ -11,7 +11,7 @@ import { readFile, writeFile } from 'fs/promises' import core from '@actions/core' import yaml from 'js-yaml' -import { getContentAndData, getCommitSha } from '@/workflows/git-utils.js' +import { getContentAndData, getCommitSha } from '@/workflows/git-utils' import schema from '@/secret-scanning/data/public-docs-schema' // This is temporarily being imported until the subsequent modules // have been converted to TypeScript. diff --git a/src/secret-scanning/tests/rendering.ts b/src/secret-scanning/tests/rendering.ts index cd37b48f959f..769d84473e47 100644 --- a/src/secret-scanning/tests/rendering.ts +++ b/src/secret-scanning/tests/rendering.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' import { readFileSync } from 'fs' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' interface ConfigFile { targetFilename: string diff --git a/src/shielding/middleware/handle-invalid-nextjs-paths.ts b/src/shielding/middleware/handle-invalid-nextjs-paths.ts index 231bf2b09cc8..f2ef1f5c8de2 100644 --- a/src/shielding/middleware/handle-invalid-nextjs-paths.ts +++ b/src/shielding/middleware/handle-invalid-nextjs-paths.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' -import statsd from '@/observability/lib/statsd.js' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' +import statsd from '@/observability/lib/statsd' +import { defaultCacheControl } from '@/frame/middleware/cache-control' import { ExtendedRequest } from '@/types' const STATSD_KEY = 'middleware.handle_invalid_nextjs_paths' diff --git a/src/shielding/middleware/handle-invalid-paths.ts b/src/shielding/middleware/handle-invalid-paths.ts index 2fab37fc6d7b..6f53e9b51f2a 100644 --- a/src/shielding/middleware/handle-invalid-paths.ts +++ b/src/shielding/middleware/handle-invalid-paths.ts @@ -1,6 +1,6 @@ import type { Response, NextFunction } from 'express' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' +import { defaultCacheControl } from '@/frame/middleware/cache-control' import { ExtendedRequest } from '@/types' // We'll check if the current request path is one of these, or ends with diff --git a/src/shielding/middleware/handle-invalid-query-string-values.ts b/src/shielding/middleware/handle-invalid-query-string-values.ts index 9969524f2b9c..b0a660dfc2cd 100644 --- a/src/shielding/middleware/handle-invalid-query-string-values.ts +++ b/src/shielding/middleware/handle-invalid-query-string-values.ts @@ -1,10 +1,10 @@ import type { Response, NextFunction } from 'express' import { ExtendedRequest } from '@/types' -import statsd from '@/observability/lib/statsd.js' -import { allTools } from '@/tools/lib/all-tools.js' -import { allPlatforms } from '@/tools/lib/all-platforms.js' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' +import statsd from '@/observability/lib/statsd' +import { allTools } from '@/tools/lib/all-tools' +import { allPlatforms } from '@/tools/lib/all-platforms' +import { defaultCacheControl } from '@/frame/middleware/cache-control' const STATSD_KEY = 'middleware.handle_invalid_querystring_values' diff --git a/src/shielding/middleware/handle-invalid-query-strings.ts b/src/shielding/middleware/handle-invalid-query-strings.ts index 6d244bd647a5..34c40fe55588 100644 --- a/src/shielding/middleware/handle-invalid-query-strings.ts +++ b/src/shielding/middleware/handle-invalid-query-strings.ts @@ -1,7 +1,7 @@ import type { Response, NextFunction } from 'express' -import statsd from '@/observability/lib/statsd.js' -import { noCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control.js' +import statsd from '@/observability/lib/statsd' +import { noCacheControl, defaultCacheControl } from '@/frame/middleware/cache-control' import { ExtendedRequest } from '@/types' const STATSD_KEY = 'middleware.handle_invalid_querystrings' diff --git a/src/shielding/middleware/handle-old-next-data-paths.ts b/src/shielding/middleware/handle-old-next-data-paths.ts index 877e3c1765d7..33417340f742 100644 --- a/src/shielding/middleware/handle-old-next-data-paths.ts +++ b/src/shielding/middleware/handle-old-next-data-paths.ts @@ -25,7 +25,7 @@ import fs from 'fs' import type { Response, NextFunction } from 'express' import { ExtendedRequest } from '@/types' -import { errorCacheControl } from '@/frame/middleware/cache-control.js' +import { errorCacheControl } from '@/frame/middleware/cache-control' export default function handleOldNextDataPaths( req: ExtendedRequest, diff --git a/src/shielding/tests/invalid-headers.ts b/src/shielding/tests/invalid-headers.ts index ed0926a04b8b..18c165e8acd7 100644 --- a/src/shielding/tests/invalid-headers.ts +++ b/src/shielding/tests/invalid-headers.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' describe('invalid headers', () => { test('400 if containing x-invoke-status (instead of redirecting)', async () => { diff --git a/src/shielding/tests/invalid-querystring-values.ts b/src/shielding/tests/invalid-querystring-values.ts index da85b19045e1..985c6993f546 100644 --- a/src/shielding/tests/invalid-querystring-values.ts +++ b/src/shielding/tests/invalid-querystring-values.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' describe('invalid query string values', () => { test.each(['platform', 'tool'])('%a key', async (key) => { diff --git a/src/shielding/tests/invalid-querystrings.ts b/src/shielding/tests/invalid-querystrings.ts index 6920b2f05b1b..992d805c389c 100644 --- a/src/shielding/tests/invalid-querystrings.ts +++ b/src/shielding/tests/invalid-querystrings.ts @@ -1,11 +1,11 @@ import { describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' import { MAX_UNFAMILIAR_KEYS_BAD_REQUEST, MAX_UNFAMILIAR_KEYS_REDIRECT, -} from '@/shielding/middleware/handle-invalid-query-strings.js' +} from '@/shielding/middleware/handle-invalid-query-strings' const alpha = Array.from(Array(26)).map((e, i) => i + 65) const alphabet = alpha.map((x) => String.fromCharCode(x)) diff --git a/src/shielding/tests/shielding.ts b/src/shielding/tests/shielding.ts index a68bfca4043d..7e5f01f03988 100644 --- a/src/shielding/tests/shielding.ts +++ b/src/shielding/tests/shielding.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key.js' -import { get } from '@/tests/helpers/e2etest.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' +import { get } from '@/tests/helpers/e2etest' describe('honeypotting', () => { test('any GET with survey-vote and survey-token query strings is 400', async () => { diff --git a/src/tests/helpers/caching-headers.js b/src/tests/helpers/caching-headers.js index f590d72c5daa..c36e5b63ed09 100644 --- a/src/tests/helpers/caching-headers.js +++ b/src/tests/helpers/caching-headers.js @@ -1,6 +1,6 @@ import { expect } from 'vitest' -import { SURROGATE_ENUMS } from '#src/frame/middleware/set-fastly-surrogate-key.js' +import { SURROGATE_ENUMS } from '@/frame/middleware/set-fastly-surrogate-key' export function checkCachingHeaders(res, defaultSurrogateKey = false, minMaxAge = 60 * 60) { expect(res.headers['set-cookie']).toBeUndefined() diff --git a/src/tests/helpers/check-url.js b/src/tests/helpers/check-url.js index 9d340346fb04..ef8766094760 100644 --- a/src/tests/helpers/check-url.js +++ b/src/tests/helpers/check-url.js @@ -1,5 +1,5 @@ -import getRedirect from '#src/redirects/lib/get-redirect.ts' -import { getPathWithoutLanguage, getPathWithoutVersion } from '#src/frame/lib/path-utils.js' +import getRedirect from '@/redirects/lib/get-redirect' +import { getPathWithoutLanguage, getPathWithoutVersion } from '@/frame/lib/path-utils' const liquidStartRex = /^{%-?\s*ifversion .+?\s*%}/ const liquidEndRex = /{%-?\s*endif\s*-?%}$/ diff --git a/src/types.ts b/src/types.ts index a75bf5fa03d0..23d60c353dfb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,7 @@ import type { Request } from 'express' import type { Failbot } from '@github/failbot' -import type enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.d.ts' +import type enterpriseServerReleases from '@/versions/lib/enterprise-server-releases.d' import type { ValidOcticon } from '@/landings/types' // Throughout our codebase we "extend" the Request object by attaching diff --git a/src/versions/lib/all-versions.ts b/src/versions/lib/all-versions.ts index 08fd68acda0c..7d7c4de3c608 100644 --- a/src/versions/lib/all-versions.ts +++ b/src/versions/lib/all-versions.ts @@ -1,6 +1,6 @@ import fs from 'fs' import type { AllVersions, Version } from '@/types' -import enterpriseServerReleases from './enterprise-server-releases.js' +import enterpriseServerReleases from './enterprise-server-releases' // version = "plan"@"release" // example: enterprise-server@2.21 diff --git a/src/versions/lib/enterprise-server-releases.js b/src/versions/lib/enterprise-server-releases.js index 82ee7930fd00..6c8be7b599ab 100644 --- a/src/versions/lib/enterprise-server-releases.js +++ b/src/versions/lib/enterprise-server-releases.js @@ -1,7 +1,7 @@ import fs from 'fs/promises' import semver from 'semver' -import versionSatisfiesRange from './version-satisfies-range.js' +import versionSatisfiesRange from './version-satisfies-range' export const dates = JSON.parse(await fs.readFile('src/ghes-releases/lib/enterprise-dates.json')) diff --git a/src/versions/lib/get-applicable-versions.js b/src/versions/lib/get-applicable-versions.js index 0163ab82b023..381b32bb4598 100644 --- a/src/versions/lib/get-applicable-versions.js +++ b/src/versions/lib/get-applicable-versions.js @@ -1,8 +1,8 @@ import { reduce, sortBy } from 'lodash-es' -import { allVersions } from './all-versions.ts' -import versionSatisfiesRange from './version-satisfies-range.js' -import { next, nextNext } from './enterprise-server-releases.js' -import { getDeepDataByLanguage } from '#src/data-directory/lib/get-data.js' +import { allVersions } from './all-versions' +import versionSatisfiesRange from './version-satisfies-range' +import { next, nextNext } from './enterprise-server-releases' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' let featureData = null diff --git a/src/versions/lib/non-enterprise-default-version.js b/src/versions/lib/non-enterprise-default-version.js index 571be4e9656f..5a438f0bf61d 100644 --- a/src/versions/lib/non-enterprise-default-version.js +++ b/src/versions/lib/non-enterprise-default-version.js @@ -1,4 +1,4 @@ -import { allVersions } from '#src/versions/lib/all-versions.ts' +import { allVersions } from '@/versions/lib/all-versions' const nonEnterpriseDefaultVersion = Object.values(allVersions).find( (version) => version.nonEnterpriseDefault, ).version diff --git a/src/versions/lib/remove-fpt-from-path.js b/src/versions/lib/remove-fpt-from-path.js index 292b852674c7..d93a9a29a1d7 100644 --- a/src/versions/lib/remove-fpt-from-path.js +++ b/src/versions/lib/remove-fpt-from-path.js @@ -1,5 +1,5 @@ import slash from 'slash' -import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js' +import nonEnterpriseDefaultVersion from './non-enterprise-default-version' // This is a convenience function to remove free-pro-team@latest from all // **user-facing** aspects of the site (particularly URLs) while continuing to support diff --git a/src/versions/middleware/features.ts b/src/versions/middleware/features.ts index 3d3c1bc9018d..45aa77eb21ab 100644 --- a/src/versions/middleware/features.ts +++ b/src/versions/middleware/features.ts @@ -2,9 +2,9 @@ import path from 'path' import type { Response, NextFunction } from 'express' import type { ExtendedRequest, FrontmatterVersions } from '@/types' -import { ROOT } from '@/frame/lib/constants.js' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' -import { getDeepDataByLanguage } from '@/data-directory/lib/get-data.js' +import { ROOT } from '@/frame/lib/constants' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import { getDeepDataByLanguage } from '@/data-directory/lib/get-data' export default function features(req: ExtendedRequest, res: Response, next: NextFunction) { if (!req.context) throw new Error('request is not contextualized') diff --git a/src/versions/middleware/short-versions.ts b/src/versions/middleware/short-versions.ts index 565b486538a4..34eaac3f1d4b 100644 --- a/src/versions/middleware/short-versions.ts +++ b/src/versions/middleware/short-versions.ts @@ -6,7 +6,7 @@ // {% if ghes %} // // For the custom operator handling in statements like {% if ghes > 3.0 %}, see `lib/liquid-tags/if-ver.js`. -import type { ExtendedRequest } from '@/types.js' +import type { ExtendedRequest } from '@/types' import type { Response, NextFunction } from 'express' export default async function shortVersions( diff --git a/src/versions/scripts/update-versioning-in-files.js b/src/versions/scripts/update-versioning-in-files.js index 2d904ec73324..89c797773565 100755 --- a/src/versions/scripts/update-versioning-in-files.js +++ b/src/versions/scripts/update-versioning-in-files.js @@ -1,7 +1,7 @@ import fs from 'fs' import path from 'path' import walk from 'walk-sync' -import frontmatter from '#src/frame/lib/read-frontmatter.js' +import frontmatter from '@/frame/lib/read-frontmatter' const contentPath = path.join(process.cwd(), 'content') const dataPath = path.join(process.cwd(), 'data') diff --git a/src/versions/scripts/use-short-versions.js b/src/versions/scripts/use-short-versions.js index 92a0a19db88a..967f9d883d2b 100755 --- a/src/versions/scripts/use-short-versions.js +++ b/src/versions/scripts/use-short-versions.js @@ -3,9 +3,9 @@ import walk from 'walk-sync' import path from 'path' import { escapeRegExp } from 'lodash-es' import { Tokenizer } from 'liquidjs' -import frontmatter from '#src/frame/lib/read-frontmatter.js' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { deprecated, oldestSupported } from '#src/versions/lib/enterprise-server-releases.js' +import frontmatter from '@/frame/lib/read-frontmatter' +import { allVersions } from '@/versions/lib/all-versions' +import { deprecated, oldestSupported } from '@/versions/lib/enterprise-server-releases' const allVersionKeys = Object.values(allVersions) const dryRun = ['-d', '--dry-run'].includes(process.argv[2]) diff --git a/src/versions/tests/enterprise-versions.js b/src/versions/tests/enterprise-versions.js index 4efd33a3aaa8..9a3e6cbc3a2b 100644 --- a/src/versions/tests/enterprise-versions.js +++ b/src/versions/tests/enterprise-versions.js @@ -1,7 +1,7 @@ import { describe, expect, test } from 'vitest' -import patterns from '#src/frame/lib/patterns.js' -import EnterpriseServerReleases from '#src/versions/lib/enterprise-server-releases.js' +import patterns from '@/frame/lib/patterns' +import EnterpriseServerReleases from '@/versions/lib/enterprise-server-releases' const { supported, deprecated, all, latest, oldestSupported, nextDeprecationDate } = EnterpriseServerReleases diff --git a/src/versions/tests/get-applicable-versions.js b/src/versions/tests/get-applicable-versions.js index 1741fb650957..5b4c11a460ec 100644 --- a/src/versions/tests/get-applicable-versions.js +++ b/src/versions/tests/get-applicable-versions.js @@ -3,9 +3,9 @@ import path from 'path' import { describe, expect, test } from 'vitest' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import getApplicableVersions from '#src/versions/lib/get-applicable-versions.js' -import { latest } from '#src/versions/lib/enterprise-server-releases.js' +import { allVersions } from '@/versions/lib/all-versions' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import { latest } from '@/versions/lib/enterprise-server-releases' describe('Versions frontmatter', () => { test('wildcard', async () => { diff --git a/src/versions/tests/ghes-versioning.js b/src/versions/tests/ghes-versioning.js index 2d737f77e6a8..5ffacb9d63c5 100644 --- a/src/versions/tests/ghes-versioning.js +++ b/src/versions/tests/ghes-versioning.js @@ -1,9 +1,9 @@ import { beforeAll, describe, expect, test } from 'vitest' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { liquid } from '#src/content-render/index.js' -import { supported } from '#src/versions/lib/enterprise-server-releases.js' -import shortVersionsMiddleware from '#src/versions/middleware/short-versions' +import { allVersions } from '@/versions/lib/all-versions' +import { liquid } from '@/content-render/index' +import { supported } from '@/versions/lib/enterprise-server-releases' +import shortVersionsMiddleware from '@/versions/middleware/short-versions' const contextualize = (req) => { req.context.currentVersionObj = req.context.allVersions[req.context.currentVersion] diff --git a/src/versions/tests/versions.js b/src/versions/tests/versions.js index dca2addcd665..51fac5285997 100644 --- a/src/versions/tests/versions.js +++ b/src/versions/tests/versions.js @@ -1,11 +1,11 @@ import { describe, expect, test } from 'vitest' -import { getJsonValidator } from '#src/tests/lib/validate-json-schema.ts' -import { allVersions } from '#src/versions/lib/all-versions.ts' -import { latest } from '#src/versions/lib/enterprise-server-releases.js' -import schema from '#src/tests/helpers/schemas/versions-schema.js' -import nonEnterpriseDefaultVersion from '#src/versions/lib/non-enterprise-default-version.js' -import { formatAjvErrors } from '#src/tests/helpers/schemas.ts' +import { getJsonValidator } from '@/tests/lib/validate-json-schema' +import { allVersions } from '@/versions/lib/all-versions' +import { latest } from '@/versions/lib/enterprise-server-releases' +import schema from '@/tests/helpers/schemas/versions-schema' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' +import { formatAjvErrors } from '@/tests/helpers/schemas' const validate = getJsonValidator(schema) diff --git a/src/webhooks/lib/index.ts b/src/webhooks/lib/index.ts index a77f1f4b22ef..4c113b3514f4 100644 --- a/src/webhooks/lib/index.ts +++ b/src/webhooks/lib/index.ts @@ -1,7 +1,7 @@ import path from 'path' import { getOpenApiVersion } from '@/versions/lib/all-versions' -import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file.js' +import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file' export const WEBHOOK_DATA_DIR = 'src/webhooks/data' export const WEBHOOK_SCHEMA_FILENAME = 'schema.json' diff --git a/src/webhooks/middleware/webhooks.ts b/src/webhooks/middleware/webhooks.ts index 49924089d38c..86063188feda 100644 --- a/src/webhooks/middleware/webhooks.ts +++ b/src/webhooks/middleware/webhooks.ts @@ -1,7 +1,7 @@ import express from 'express' -import { getWebhook } from '../lib/index.js' +import { getWebhook } from '../lib/index' import { allVersions } from '@/versions/lib/all-versions' -import { defaultCacheControl } from '@/frame/middleware/cache-control.js' +import { defaultCacheControl } from '@/frame/middleware/cache-control' const router = express.Router() diff --git a/src/webhooks/tests/api.ts b/src/webhooks/tests/api.ts index 41a977cedeeb..102738e413ef 100644 --- a/src/webhooks/tests/api.ts +++ b/src/webhooks/tests/api.ts @@ -1,10 +1,10 @@ import { describe, expect, test } from 'vitest' -import { get } from '@/tests/helpers/e2etest.js' +import { get } from '@/tests/helpers/e2etest' import { SURROGATE_ENUMS, makeLanguageSurrogateKey, -} from '@/frame/middleware/set-fastly-surrogate-key.js' +} from '@/frame/middleware/set-fastly-surrogate-key' describe('webhooks v1 middleware', () => { test('basic get webhook', async () => { diff --git a/src/webhooks/tests/rendering.ts b/src/webhooks/tests/rendering.ts index 5cdafc5164cb..cec11e66dd28 100644 --- a/src/webhooks/tests/rendering.ts +++ b/src/webhooks/tests/rendering.ts @@ -1,8 +1,8 @@ import { describe, expect, test, vi } from 'vitest' -import { getDOM } from '@/tests/helpers/e2etest.js' +import { getDOM } from '@/tests/helpers/e2etest' import { allVersions } from '@/versions/lib/all-versions' -import { getWebhooks } from '../lib/index.js' +import { getWebhooks } from '../lib/index' describe('webhooks events and payloads', () => { vi.setConfig({ testTimeout: 3 * 60 * 1000 }) diff --git a/src/workflows/content-changes-table-comment.ts b/src/workflows/content-changes-table-comment.ts index 03d27562c514..1bd6949653ee 100755 --- a/src/workflows/content-changes-table-comment.ts +++ b/src/workflows/content-changes-table-comment.ts @@ -17,11 +17,11 @@ import walk from 'walk-sync' import { Octokit } from '@octokit/rest' import { retry } from '@octokit/plugin-retry' -import { getContents } from './git-utils.js' -import getApplicableVersions from '@/versions/lib/get-applicable-versions.js' -import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version.js' +import { getContents } from './git-utils' +import getApplicableVersions from '@/versions/lib/get-applicable-versions' +import nonEnterpriseDefaultVersion from '@/versions/lib/non-enterprise-default-version' import { allVersionShortnames } from '@/versions/lib/all-versions' -import readFrontmatter from '@/frame/lib/read-frontmatter.js' +import readFrontmatter from '@/frame/lib/read-frontmatter' import { inLiquid } from './lib/in-liquid' const { GITHUB_TOKEN, APP_URL, BASE_SHA, HEAD_SHA } = process.env diff --git a/src/workflows/delete-orphan-translation-files.ts b/src/workflows/delete-orphan-translation-files.ts index 7e6c2643c4aa..c15497f251c1 100644 --- a/src/workflows/delete-orphan-translation-files.ts +++ b/src/workflows/delete-orphan-translation-files.ts @@ -23,7 +23,7 @@ import path from 'path' import { program } from 'commander' import walkFiles from '@/workflows/walk-files' -import { ROOT } from '@/frame/lib/constants.js' +import { ROOT } from '@/frame/lib/constants' program .description('Delete orphan translation files') diff --git a/src/workflows/find-past-built-pr.ts b/src/workflows/find-past-built-pr.ts index b0a0f4758145..9f3beb0c00da 100644 --- a/src/workflows/find-past-built-pr.ts +++ b/src/workflows/find-past-built-pr.ts @@ -2,8 +2,8 @@ import got from 'got' import { setOutput } from '@actions/core' -import github from './github.js' -import { getActionContext } from './action-context.js' +import github from './github' +import { getActionContext } from './action-context' import { octoSecondaryRatelimitRetry } from './secondary-ratelimit-retry' async function main() { diff --git a/src/workflows/fr-add-docs-reviewers-requests.ts b/src/workflows/fr-add-docs-reviewers-requests.ts index 5775e5a6ebf3..01d20dff9bad 100644 --- a/src/workflows/fr-add-docs-reviewers-requests.ts +++ b/src/workflows/fr-add-docs-reviewers-requests.ts @@ -7,7 +7,7 @@ import { findFieldID, findSingleSelectID, generateUpdateProjectV2ItemFieldMutation, -} from './projects.js' +} from './projects' async function getAllOpenPRs() { let prsRemaining = true diff --git a/src/workflows/git-utils.ts b/src/workflows/git-utils.ts index 00b988c5de30..fef5e873ea53 100644 --- a/src/workflows/git-utils.ts +++ b/src/workflows/git-utils.ts @@ -3,7 +3,7 @@ import fs from 'fs/promises' import { RequestError } from '@octokit/request-error' -import { retryingGithub } from './github.js' +import { retryingGithub } from './github' const github = retryingGithub() // https://docs.github.com/rest/reference/git#get-a-reference diff --git a/src/workflows/labeler.ts b/src/workflows/labeler.ts index 727423d65b2e..46f96ded6c4b 100755 --- a/src/workflows/labeler.ts +++ b/src/workflows/labeler.ts @@ -5,9 +5,9 @@ // [end-readme] import { program } from 'commander' -import label from '../../.github/actions/labeler/labeler.js' +import label from '../../.github/actions/labeler/labeler' import { getCoreInject } from '@/links/scripts/action-injections' -import github from '@/workflows/github.js' +import github from '@/workflows/github' program .description('Add labels to an issue or PR.') diff --git a/src/workflows/lib/in-liquid.ts b/src/workflows/lib/in-liquid.ts index 7e3e69277819..d8350a0f75c2 100644 --- a/src/workflows/lib/in-liquid.ts +++ b/src/workflows/lib/in-liquid.ts @@ -1,4 +1,4 @@ -import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils.js' +import { getLiquidTokens } from '@/content-linter/lib/helpers/liquid-utils' type Token = { name?: string diff --git a/src/workflows/ready-for-docs-review.ts b/src/workflows/ready-for-docs-review.ts index e1b7f1216566..eee739f24a22 100644 --- a/src/workflows/ready-for-docs-review.ts +++ b/src/workflows/ready-for-docs-review.ts @@ -10,7 +10,7 @@ import { generateUpdateProjectV2ItemFieldMutation, getFeature, getSize, -} from './projects.js' +} from './projects' /** * Determines if a PR is authored by Copilot and extracts the human assignee