Skip to content

Commit 0ef156d

Browse files
authored
Create links src directory (github#41733)
1 parent 5b01cc9 commit 0ef156d

File tree

12 files changed

+63
-38
lines changed

12 files changed

+63
-38
lines changed

.github/workflows/link-check-daily.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
5353
with:
5454
path: external-link-checker-db.json
55-
key: external-link-checker-${{ hashFiles('.github/actions/rendered-content-link-checker.js') }}
55+
key: external-link-checker-${{ hashFiles('src/links/scripts/rendered-content-link-checker.js') }}
5656

5757
- name: Run link checker
5858
env:
@@ -76,7 +76,7 @@ jobs:
7676
# treat it as a warning and not as a broken link.
7777
EXTERNAL_SERVER_ERRORS_AS_WARNINGS: true
7878
timeout-minutes: 30
79-
run: node .github/actions-scripts/rendered-content-link-checker.js
79+
run: node src/links/scripts/rendered-content-link-checker.js
8080

8181
- name: Upload artifact(s)
8282
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8

.github/workflows/link-check-on-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
# we're filtering on anyway once the list of all pages has
5050
# been loaded.
5151
ENABLED_LANGUAGES: en
52-
run: node .github/actions-scripts/rendered-content-link-checker.js
52+
run: node src/links/scripts/rendered-content-link-checker.js
5353

5454
- name: Upload artifact(s)
5555
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ jobs:
109109
run: |
110110
# If either of these fail, it means our fixture content's internal
111111
# links can and should be updated.
112-
./script/update-internal-links.js --dry-run --check --strict \
112+
./src/links/scripts/update-internal-links.js --dry-run --check --strict \
113113
tests/fixtures/content \
114114
--exclude tests/fixtures/content/get-started/foo/typo-autotitling.md \
115115
--exclude tests/fixtures/content/get-started/foo/anchor-autotitling.md
116-
./script/update-internal-links.js --dry-run --check --strict \
116+
./src/links/scripts/update-internal-links.js --dry-run --check --strict \
117117
tests/fixtures/data
118118
119119
- name: Clone all translations

components/article/ArticlePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { RestRedirect } from 'src/rest/components/RestRedirect'
2121
import { Breadcrumbs } from 'components/page-header/Breadcrumbs'
2222
import { Link } from 'components/Link'
2323
import { useTranslation } from 'src/languages/components/useTranslation'
24-
import { LinkPreviewPopover } from 'components/LinkPreviewPopover'
24+
import { LinkPreviewPopover } from 'src/links/components/LinkPreviewPopover'
2525

2626
const ClientSideRefresh = dynamic(() => import('components/ClientSideRefresh'), {
2727
ssr: false,

src/links/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# LINKS
2+
3+
TBD what is LINKS
4+
5+
## What LINKS does
6+
7+
TBD why is LINKS on the docs
8+
9+
## How LINKS works
10+
11+
TBD step-by-step instructions to work on LINKS
12+
13+
## How to work on LINKS
14+
15+
TBD step-by-step instructions on how to work on LINKS
16+
17+
## How to get help for LINKS
18+
19+
TBD reference material
File renamed without changes.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import { fromMarkdown } from 'mdast-util-from-markdown'
66
import { toMarkdown } from 'mdast-util-to-markdown'
77
import yaml from 'js-yaml'
88

9-
import frontmatter from './read-frontmatter.js'
9+
import frontmatter from '../../../lib/read-frontmatter.js'
1010
import {
1111
getPathWithLanguage,
1212
getPathWithoutLanguage,
1313
getPathWithoutVersion,
1414
getVersionStringFromPath,
15-
} from './path-utils.js'
15+
} from '../../../lib/path-utils.js'
1616
import loadRedirects from '#src/redirects/lib/precompile.js'
17-
import patterns from './patterns.js'
18-
import { loadUnversionedTree, loadPages, loadPageMap } from './page-data.js'
17+
import patterns from '../../../lib/patterns.js'
18+
import { loadUnversionedTree, loadPages, loadPageMap } from '../../../lib/page-data.js'
1919
import getRedirect, { splitPathByLanguage } from '#src/redirects/lib/get-redirect.js'
20-
import nonEnterpriseDefaultVersion from './non-enterprise-default-version.js'
21-
import { deprecated } from './enterprise-server-releases.js'
20+
import nonEnterpriseDefaultVersion from '../../../lib/non-enterprise-default-version.js'
21+
import { deprecated } from '../../../lib/enterprise-server-releases.js'
2222

2323
function objectClone(obj) {
2424
try {

script/rendered-content-link-checker.js renamed to src/links/scripts/rendered-content-link-checker-1.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
import fs from 'fs'
1111
import path from 'path'
1212
import { program, Option, InvalidArgumentError } from 'commander'
13-
import renderedContentLinkChecker from '../.github/actions-scripts/rendered-content-link-checker.js'
14-
import { getCoreInject, getUploadArtifactInject } from './helpers/action-injections.js'
15-
import { allVersions } from '../lib/all-versions.js'
16-
import github from './helpers/github.js'
13+
import renderedContentLinkChecker from '#src/links/scripts/rendered-content-link-checker.js'
14+
import {
15+
getCoreInject,
16+
getUploadArtifactInject,
17+
} from '../../../script/helpers/action-injections.js'
18+
import { allVersions } from '../../../lib/all-versions.js'
19+
import github from '../../../script/helpers/github.js'
1720

1821
const STATIC_PREFIXES = {
1922
assets: path.resolve('assets'),

.github/actions-scripts/rendered-content-link-checker.js renamed to src/links/scripts/rendered-content-link-checker.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,23 @@ import chalk from 'chalk'
99
import { Low } from 'lowdb'
1010
import { JSONFile } from 'lowdb/node'
1111

12-
import shortVersions from '../../middleware/contextualizers/short-versions.js'
13-
import contextualize from '../../middleware/context.js'
14-
import features from '../../middleware/contextualizers/features.js'
15-
import getRedirect from '../../src/redirects/lib/get-redirect.js'
16-
import warmServer from '../../lib/warm-server.js'
17-
import { liquid } from '../../src/content-render/index.js'
18-
import { deprecated } from '../../lib/enterprise-server-releases.js'
19-
import excludedLinks from '../../lib/excluded-links.js'
20-
import { getEnvInputs, boolEnvVar } from './lib/get-env-inputs.js'
21-
import { debugTimeEnd, debugTimeStart } from './lib/debug-time-taken.js'
22-
import { uploadArtifact as uploadArtifactLib } from './lib/upload-artifact.js'
23-
import github from '../../script/helpers/github.js'
24-
import { getActionContext } from './lib/action-context.js'
25-
import { createMinimalProcessor } from '../../src/content-render/unified/processor.js'
12+
import shortVersions from '../../../middleware/contextualizers/short-versions.js'
13+
import contextualize from '../../../middleware/context.js'
14+
import features from '../../../middleware/contextualizers/features.js'
15+
import getRedirect from '#src/redirects/lib/get-redirect.js'
16+
import warmServer from '../../../lib/warm-server.js'
17+
import { liquid } from '#src/content-render/index.js'
18+
import { deprecated } from '../../../lib/enterprise-server-releases.js'
19+
import excludedLinks from '#src/links/lib/excluded-links.js'
20+
import { getEnvInputs, boolEnvVar } from '../../../.github/actions-scripts/lib/get-env-inputs.js'
21+
import {
22+
debugTimeEnd,
23+
debugTimeStart,
24+
} from '../../../.github/actions-scripts/lib/debug-time-taken.js'
25+
import { uploadArtifact as uploadArtifactLib } from '../../../.github/actions-scripts/lib/upload-artifact.js'
26+
import github from '../../../script/helpers/github.js'
27+
import { getActionContext } from '../../../.github/actions-scripts/lib/action-context.js'
28+
import { createMinimalProcessor } from '#src/content-render/unified/processor.js'
2629

2730
const STATIC_PREFIXES = {
2831
assets: path.resolve('assets'),

0 commit comments

Comments
 (0)