Skip to content

Commit

Permalink
Move components into src/frame (#45759)
Browse files Browse the repository at this point in the history
Co-authored-by: Grace Park <gracepark@github.com>
  • Loading branch information
heiskr and gracepark authored Nov 13, 2023
1 parent 694d38e commit 5364189
Show file tree
Hide file tree
Showing 147 changed files with 182 additions and 184 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/azure-preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ jobs:
rsync -rptovR ./user-code/content/./**/*.md ./content
rsync -rptovR ./user-code/assets/./**/*.png ./assets
rsync -rptovR ./user-code/data/./**/*.{yml,md} ./data
rsync -rptovR ./user-code/components/./**/*.{scss,ts,tsx} ./components
rsync -rptovR ./user-code/src/./**/*.tsx ./src
rsync -rptovR ./user-code/src/./**/*.{scss,ts,tsx} ./src
- uses: ./.github/actions/warmup-remotejson-cache
with:
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ RUN npm prune --production
# ---------------
FROM all_deps as builder

COPY components ./components
COPY src ./src
# The star is because it's an optional directory
COPY .remotejson-cache* ./.remotejson-cache
Expand Down
2 changes: 1 addition & 1 deletion src/assets/scripts/find-orphaned-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function main(opts) {
}
}

const roots = ['tests', 'components', 'contributing', 'src', 'assets']
const roots = ['tests', 'contributing', 'src', 'assets']

for (const root of roots) {
sourceFiles.push(
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/components/GroupedEvents.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { slug } from 'github-slugger'

import { HeadingLink } from 'components/article/HeadingLink'
import { HeadingLink } from 'src/frame/components/article/HeadingLink'
import { useTranslation } from 'src/languages/components/useTranslation'

type AuditLogEventT = {
Expand Down
2 changes: 1 addition & 1 deletion src/audit-logs/pages/audit-log-events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getMainContext,
MainContext,
MainContextT,
} from 'components/context/MainContext'
} from 'src/frame/components/context/MainContext'
import {
getAutomatedPageContextFromRequest,
AutomatedPageContext,
Expand Down
18 changes: 9 additions & 9 deletions src/automated-pipelines/components/AutomatedPage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { DefaultLayout } from 'components/DefaultLayout'
import { ArticleTitle } from 'components/article/ArticleTitle'
import { MarkdownContent } from 'components/ui/MarkdownContent'
import { Lead } from 'components/ui/Lead'
import { PermissionsStatement } from 'components/ui/PermissionsStatement'
import { ArticleGridLayout } from '../../../components/article/ArticleGridLayout'
import { MiniTocs } from 'components/ui/MiniTocs'
import { DefaultLayout } from 'src/frame/components/DefaultLayout'
import { ArticleTitle } from 'src/frame/components/article/ArticleTitle'
import { MarkdownContent } from 'src/frame/components/ui/MarkdownContent'
import { Lead } from 'src/frame/components/ui/Lead'
import { PermissionsStatement } from 'src/frame/components/ui/PermissionsStatement'
import { ArticleGridLayout } from 'src/frame/components/article/ArticleGridLayout'
import { MiniTocs } from 'src/frame/components/ui/MiniTocs'
import { useAutomatedPageContext } from 'src/automated-pipelines/components/AutomatedPageContext'
import { ClientSideHighlight } from 'components/ClientSideHighlight'
import { Callout } from 'components/ui/Callout'
import { ClientSideHighlight } from 'src/frame/components/ClientSideHighlight'
import { Callout } from 'src/frame/components/ui/Callout'

type Props = {
children: React.ReactNode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext, useContext } from 'react'
import type { MiniTocItem } from 'components/context/ArticleContext'
import type { MiniTocItem } from 'src/frame/components/context/ArticleContext'

export type AutomatedPageContextT = {
title: string
Expand Down
2 changes: 1 addition & 1 deletion src/color-schemes/components/useTheme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react'
import Cookies from '../../../components/lib/cookies'
import Cookies from '../../frame/components/lib/cookies'

enum CssColorMode {
auto = 'auto',
Expand Down
2 changes: 1 addition & 1 deletion src/events/components/Survey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import cx from 'classnames'
import { useRouter } from 'next/router'
import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'
import { useTranslation } from 'src/languages/components/useTranslation'
import { Link } from 'components/Link'
import { Link } from 'src/frame/components/Link'
import { sendEvent, EventType } from 'src/events/components/events'

import styles from './Survey.module.scss'
Expand Down
2 changes: 1 addition & 1 deletion src/events/components/events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable camelcase */
import Cookies from 'components/lib/cookies'
import Cookies from 'src/frame/components/lib/cookies'
import { parseUserAgent } from './user-agent'

const COOKIE_NAME = '_docs-events'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import Head from 'next/head'
import { useRouter } from 'next/router'

import { SidebarNav } from 'components/sidebar/SidebarNav'
import { Header } from 'components/page-header/Header'
import { LegalFooter } from 'components/page-footer/LegalFooter'
import { ScrollButton } from 'components/ui/ScrollButton'
import { SupportSection } from 'components/page-footer/SupportSection'
import { SidebarNav } from 'src/frame/components/sidebar/SidebarNav'
import { Header } from 'src/frame/components/page-header/Header'
import { LegalFooter } from 'src/frame/components/page-footer/LegalFooter'
import { ScrollButton } from 'src/frame/components/ui/ScrollButton'
import { SupportSection } from 'src/frame/components/page-footer/SupportSection'
import { DeprecationBanner } from 'src/versions/components/DeprecationBanner'
import { RestBanner } from 'src/rest/components/RestBanner'
import { useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'src/frame/components/context/MainContext'
import { useTranslation } from 'src/languages/components/useTranslation'
import { Breadcrumbs } from 'components/page-header/Breadcrumbs'
import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
import { useLanguages } from 'src/languages/components/LanguagesContext'

const MINIMAL_RENDER = Boolean(JSON.parse(process.env.MINIMAL_RENDER || 'false'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link'
import { useRouter } from 'next/router'

import { MarkGithubIcon, CommentDiscussionIcon } from '@primer/octicons-react'
import { Lead } from 'components/ui/Lead'
import { Lead } from 'src/frame/components/ui/Lead'

export function GenericError() {
return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ import dynamic from 'next/dynamic'
import cx from 'classnames'
import { LinkExternalIcon } from '@primer/octicons-react'

import { Callout } from 'components/ui/Callout'
import { DefaultLayout } from 'components/DefaultLayout'
import { ArticleTitle } from 'components/article/ArticleTitle'
import { useArticleContext } from 'components/context/ArticleContext'
import { Callout } from 'src/frame/components/ui/Callout'
import { DefaultLayout } from 'src/frame/components/DefaultLayout'
import { ArticleTitle } from 'src/frame/components/article/ArticleTitle'
import { useArticleContext } from 'src/frame/components/context/ArticleContext'
import { LearningTrackNav } from 'src/learning-track/components/article/LearningTrackNav'
import { MarkdownContent } from 'components/ui/MarkdownContent'
import { Lead } from 'components/ui/Lead'
import { PermissionsStatement } from 'components/ui/PermissionsStatement'
import { MarkdownContent } from 'src/frame/components/ui/MarkdownContent'
import { Lead } from 'src/frame/components/ui/Lead'
import { PermissionsStatement } from 'src/frame/components/ui/PermissionsStatement'
import { ArticleGridLayout } from './ArticleGridLayout'
import { ArticleInlineLayout } from './ArticleInlineLayout'
import { PlatformPicker } from 'src/tools/components/PlatformPicker'
import { ToolPicker } from 'src/tools/components/ToolPicker'
import { MiniTocs } from 'components/ui/MiniTocs'
import { MiniTocs } from 'src/frame/components/ui/MiniTocs'
import { LearningTrackCard } from 'src/learning-track/components/article/LearningTrackCard'
import { RestRedirect } from 'src/rest/components/RestRedirect'
import { Breadcrumbs } from 'components/page-header/Breadcrumbs'
import { Link } from 'components/Link'
import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
import { Link } from 'src/frame/components/Link'
import { useTranslation } from 'src/languages/components/useTranslation'
import { LinkPreviewPopover } from 'src/links/components/LinkPreviewPopover'

const ClientSideRefresh = dynamic(() => import('components/ClientSideRefresh'), {
const ClientSideRefresh = dynamic(() => import('src/frame/components/ClientSideRefresh'), {
ssr: false,
})
const isDev = process.env.NODE_ENV === 'development'
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SupportPortalVaIframeProps } from 'components/article/SupportPortalVaIframe'
import { SupportPortalVaIframeProps } from 'src/frame/components/article/SupportPortalVaIframe'
import { createContext, useContext } from 'react'

export type LearningTrack = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createContext, useContext } from 'react'
import pick from 'lodash/pick'

import type { BreadcrumbT } from 'components/page-header/Breadcrumbs'
import type { FeatureFlags } from 'components/hooks/useFeatureFlags'
import type { BreadcrumbT } from 'src/frame/components/page-header/Breadcrumbs'
import type { FeatureFlags } from 'src/frame/components/hooks/useFeatureFlags'

export type ProductT = {
external: boolean
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'src/frame/components/context/MainContext'

export type FeatureFlags = {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from 'react'
import Cookies from 'components/lib/cookies'
import Cookies from 'src/frame/components/lib/cookies'

// Measure if the user has a github.com account and signed in during this session.
// The github.com sends the color_mode cookie every request when you sign in,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Cookies from 'components/lib/cookies'
import Cookies from 'src/frame/components/lib/cookies'
import { sendEvent, EventType } from 'src/events/components/events'

enum annotationMode {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GitPullRequestIcon } from '@primer/octicons-react'

import { useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'src/frame/components/context/MainContext'
import { useTranslation } from 'src/languages/components/useTranslation'

export const Contribution = () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PeopleIcon, CommentDiscussionIcon } from '@primer/octicons-react'

import { useTranslation } from 'src/languages/components/useTranslation'
import { useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'src/frame/components/context/MainContext'

export const Support = () => {
const { t } = useTranslation('support')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import cx from 'classnames'

import { Survey } from 'src/events/components/Survey'
import { Contribution } from 'components/page-footer/Contribution'
import { Support } from 'components/page-footer/Support'
import { useMainContext } from 'components/context/MainContext'
import { Contribution } from 'src/frame/components/page-footer/Contribution'
import { Support } from 'src/frame/components/page-footer/Support'
import { useMainContext } from 'src/frame/components/context/MainContext'
import { useVersion } from 'src/versions/components/useVersion'
import { useRouter } from 'next/router'
import { useTranslation } from 'src/languages/components/useTranslation'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cx from 'classnames'

import { useMainContext } from '../context/MainContext'
import { Link } from 'components/Link'
import { Link } from 'src/frame/components/Link'

import styles from './Breadcrumbs.module.scss'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ import {
} from '@primer/octicons-react'

import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion'
import { Link } from 'components/Link'
import { useMainContext } from 'components/context/MainContext'
import { useHasAccount } from 'components/hooks/useHasAccount'
import { Link } from 'src/frame/components/Link'
import { useMainContext } from 'src/frame/components/context/MainContext'
import { useHasAccount } from 'src/frame/components/hooks/useHasAccount'
import { LanguagePicker } from 'src/languages/components/LanguagePicker'
import { HeaderNotifications } from 'components/page-header/HeaderNotifications'
import { HeaderNotifications } from 'src/frame/components/page-header/HeaderNotifications'
import { ApiVersionPicker } from 'src/rest/components/ApiVersionPicker'
import { useTranslation } from 'src/languages/components/useTranslation'
import { Search } from 'src/search/components/Search'
import { Breadcrumbs } from 'components/page-header/Breadcrumbs'
import { Breadcrumbs } from 'src/frame/components/page-header/Breadcrumbs'
import { VersionPicker } from 'src/versions/components/VersionPicker'
import { SidebarNav } from 'components/sidebar/SidebarNav'
import { AllProductsLink } from 'components/sidebar/AllProductsLink'
import { SidebarNav } from 'src/frame/components/sidebar/SidebarNav'
import { AllProductsLink } from 'src/frame/components/sidebar/AllProductsLink'

import styles from './Header.module.scss'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import cx from 'classnames'
import { XIcon } from '@primer/octicons-react'

import { useLanguages } from 'src/languages/components/LanguagesContext'
import { useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'src/frame/components/context/MainContext'
import { useTranslation } from 'src/languages/components/useTranslation'
import { ExcludesNull } from 'components/lib/ExcludesNull'
import { ExcludesNull } from 'src/frame/components/lib/ExcludesNull'
import { useVersion } from 'src/versions/components/useVersion'
import { useUserLanguage } from 'src/languages/components/useUserLanguage'
import styles from './HeaderNotifications.module.scss'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRouter } from 'next/router'
import { ArrowLeftIcon } from '@primer/octicons-react'
import { DEFAULT_VERSION, useVersion } from 'src/versions/components/useVersion'
import { Link } from 'components/Link'
import { Link } from 'src/frame/components/Link'

export const AllProductsLink = () => {
const router = useRouter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import cx from 'classnames'
import { useRouter } from 'next/router'

import { useMainContext } from 'components/context/MainContext'
import { useMainContext } from 'src/frame/components/context/MainContext'
import { SidebarProduct } from 'src/landings/components/SidebarProduct'
import { AllProductsLink } from './AllProductsLink'
import { ApiVersionPicker } from 'src/rest/components/ApiVersionPicker'
import { Link } from 'components/Link'
import { Link } from 'src/frame/components/Link'

type Props = {
variant?: 'full' | 'overlay'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Heading, NavList } from '@primer/react'
import { useEffect, useState } from 'react'
import cx from 'classnames'

import type { MiniTocItem } from 'components/context/ArticleContext'
import type { MiniTocItem } from 'src/frame/components/context/ArticleContext'
import { useTranslation } from 'src/languages/components/useTranslation'

import styles from './Minitocs.module.scss'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/github-apps/components/EnabledList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Fragment } from 'react'
import { useRouter } from 'next/router'
import { slug as githubSlug } from 'github-slugger'

import { HeadingLink } from 'components/article/HeadingLink'
import { Link } from 'components/Link'
import { MainContext, MainContextT } from 'components/context/MainContext'
import { HeadingLink } from 'src/frame/components/article/HeadingLink'
import { Link } from 'src/frame/components/Link'
import { MainContext, MainContextT } from 'src/frame/components/context/MainContext'
import {
AutomatedPageContext,
AutomatedPageContextT,
Expand Down
6 changes: 3 additions & 3 deletions src/github-apps/components/PermissionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useRouter } from 'next/router'
import cx from 'classnames'
import { slug as githubSlug } from 'github-slugger'

import { HeadingLink } from 'components/article/HeadingLink'
import { HeadingLink } from 'src/frame/components/article/HeadingLink'
import { useTranslation } from 'src/languages/components/useTranslation'
import { Link } from 'components/Link'
import { MainContextT } from 'components/context/MainContext'
import { Link } from 'src/frame/components/Link'
import { MainContextT } from 'src/frame/components/context/MainContext'
import {
AutomatedPageContext,
AutomatedPageContextT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AutomatedPageContextT,
getAutomatedPageContextFromRequest,
} from 'src/automated-pipelines/components/AutomatedPageContext'
import { MainContextT, getMainContext } from 'components/context/MainContext'
import { MainContextT, getMainContext } from 'src/frame/components/context/MainContext'

import { EnabledList, EnabledListT } from 'src/github-apps/components/EnabledList'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AutomatedPageContextT,
getAutomatedPageContextFromRequest,
} from 'src/automated-pipelines/components/AutomatedPageContext'
import { MainContextT, getMainContext } from 'components/context/MainContext'
import { MainContextT, getMainContext } from 'src/frame/components/context/MainContext'

import { EnabledList, EnabledListT } from 'src/github-apps/components/EnabledList'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AutomatedPageContextT,
getAutomatedPageContextFromRequest,
} from 'src/automated-pipelines/components/AutomatedPageContext'
import { MainContextT, getMainContext } from 'components/context/MainContext'
import { MainContextT, getMainContext } from 'src/frame/components/context/MainContext'

import { EnabledList, EnabledListT } from 'src/github-apps/components/EnabledList'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
AutomatedPageContextT,
getAutomatedPageContextFromRequest,
} from 'src/automated-pipelines/components/AutomatedPageContext'
import { MainContext, MainContextT, getMainContext } from 'components/context/MainContext'
import { MainContext, MainContextT, getMainContext } from 'src/frame/components/context/MainContext'
import { PermissionsList, PermissionListT } from 'src/github-apps/components/PermissionsList'

type Props = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
AutomatedPageContextT,
getAutomatedPageContextFromRequest,
} from 'src/automated-pipelines/components/AutomatedPageContext'
import { MainContext, MainContextT, getMainContext } from 'components/context/MainContext'
import { MainContext, MainContextT, getMainContext } from 'src/frame/components/context/MainContext'
import { PermissionsList, PermissionListT } from 'src/github-apps/components/PermissionsList'

type Props = {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/components/BreakingChanges.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import cx from 'classnames'

import { HeadingLink } from 'components/article/HeadingLink'
import { HeadingLink } from 'src/frame/components/article/HeadingLink'
import { BreakingChangesT } from './types'
import styles from 'components/ui/MarkdownContent/MarkdownContent.module.scss'
import styles from 'src/frame/components/ui/MarkdownContent/MarkdownContent.module.scss'

export type HeadingT = {
title: string
Expand Down
Loading

0 comments on commit 5364189

Please sign in to comment.