Skip to content

Commit bf334d9

Browse files
authored
chore: use subpath imports instead of path aliases (#7735)
* chore: use subpath imports instead of path aliases * fixup! chore: use subpath imports instead of path aliases * #ui and #site
1 parent 16beaa7 commit bf334d9

File tree

226 files changed

+573
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

226 files changed

+573
-549
lines changed

COLLABORATOR_GUIDE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ To add a new download installation method, follow these steps:
356356
}
357357
```
358358

359-
3. **Update `InstallationMethodLabel` and `InstallationMethod` in `@/types/release.ts`:**
359+
3. **Update `InstallationMethodLabel` and `InstallationMethod` in `apps/site/types/release.ts`:**
360360

361361
- Add the new method to the `InstallationMethodLabel` and `InstallationMethod` types.
362362

apps/site/app/[locale]/[...path]/page.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
* dynamic params, which will lead on static export errors and other sort of issues.
88
*/
99

10-
import * as basePage from '@/app/[locale]/page';
10+
import * as basePage from '#site/app/[locale]/page';
1111
import {
1212
ENABLE_STATIC_EXPORT_LOCALE,
1313
ENABLE_STATIC_EXPORT,
14-
} from '@/next.constants.mjs';
15-
import { dynamicRouter } from '@/next.dynamic.mjs';
16-
import { availableLocaleCodes, defaultLocale } from '@/next.locales.mjs';
14+
} from '#site/next.constants.mjs';
15+
import { dynamicRouter } from '#site/next.dynamic.mjs';
16+
import { availableLocaleCodes, defaultLocale } from '#site/next.locales.mjs';
1717

1818
// This is the default Viewport Metadata
1919
// @see https://nextjs.org/docs/app/api-reference/functions/generate-viewport#generateviewport-function

apps/site/app/[locale]/error.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { ArrowRightIcon } from '@heroicons/react/24/solid';
44
import { useTranslations } from 'next-intl';
55
import type { FC } from 'react';
66

7-
import Button from '@/components/Common/Button';
8-
import GlowingBackdropLayout from '@/layouts/GlowingBackdrop';
7+
import Button from '#site/components/Common/Button';
8+
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
99

1010
const ErrorPage: FC<{ error: Error }> = () => {
1111
const t = useTranslations();

apps/site/app/[locale]/feed/[feed]/route.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { NextResponse } from 'next/server';
22

3-
import provideWebsiteFeeds from '@/next-data/providers/websiteFeeds';
4-
import { siteConfig } from '@/next.json.mjs';
5-
import { defaultLocale } from '@/next.locales.mjs';
3+
import provideWebsiteFeeds from '#site/next-data/providers/websiteFeeds';
4+
import { siteConfig } from '#site/next.json.mjs';
5+
import { defaultLocale } from '#site/next.locales.mjs';
66

77
type DynamicStaticPaths = { locale: string; feed: string };
88
type StaticParams = { params: Promise<DynamicStaticPaths> };

apps/site/app/[locale]/layout.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import classNames from 'classnames';
44
import { NextIntlClientProvider } from 'next-intl';
55
import type { FC, PropsWithChildren } from 'react';
66

7-
import BaseLayout from '@/layouts/Base';
8-
import { VERCEL_ENV } from '@/next.constants.mjs';
9-
import { IBM_PLEX_MONO, OPEN_SANS } from '@/next.fonts';
10-
import { availableLocalesMap, defaultLocale } from '@/next.locales.mjs';
11-
import { ThemeProvider } from '@/providers/themeProvider';
7+
import BaseLayout from '#site/layouts/Base';
8+
import { VERCEL_ENV } from '#site/next.constants.mjs';
9+
import { IBM_PLEX_MONO, OPEN_SANS } from '#site/next.fonts';
10+
import { availableLocalesMap, defaultLocale } from '#site/next.locales.mjs';
11+
import { ThemeProvider } from '#site/providers/themeProvider';
1212

13-
import '@/styles/index.css';
13+
import '#site/styles/index.css';
1414

1515
const fontClasses = classNames(IBM_PLEX_MONO.variable, OPEN_SANS.variable);
1616

apps/site/app/[locale]/next-data/api-data/route.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { deflateSync } from 'node:zlib';
22

3-
import provideReleaseData from '@/next-data/providers/releaseData';
4-
import { GITHUB_API_KEY } from '@/next.constants.mjs';
5-
import { defaultLocale } from '@/next.locales.mjs';
6-
import type { GitHubApiFile } from '@/types';
7-
import { getGitHubApiDocsUrl } from '@/util/gitHubUtils';
8-
import { parseRichTextIntoPlainText } from '@/util/stringUtils';
3+
import provideReleaseData from '#site/next-data/providers/releaseData';
4+
import { GITHUB_API_KEY } from '#site/next.constants.mjs';
5+
import { defaultLocale } from '#site/next.locales.mjs';
6+
import type { GitHubApiFile } from '#site/types';
7+
import { getGitHubApiDocsUrl } from '#site/util/gitHubUtils';
8+
import { parseRichTextIntoPlainText } from '#site/util/stringUtils';
99

1010
// Defines if we should use the GitHub API Key for the request
1111
// based on the environment variable `GITHUB_API_KEY`

apps/site/app/[locale]/next-data/blog-data/[category]/[page]/route.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
provideBlogPosts,
33
providePaginatedBlogPosts,
4-
} from '@/next-data/providers/blogData';
5-
import { defaultLocale } from '@/next.locales.mjs';
6-
import type { BlogCategory } from '@/types';
4+
} from '#site/next-data/providers/blogData';
5+
import { defaultLocale } from '#site/next.locales.mjs';
6+
import type { BlogCategory } from '#site/types';
77

88
type DynamicStaticPaths = {
99
locale: string;

apps/site/app/[locale]/next-data/download-snippets/route.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import provideDownloadSnippets from '@/next-data/providers/downloadSnippets';
2-
import { defaultLocale } from '@/next.locales.mjs';
1+
import provideDownloadSnippets from '#site/next-data/providers/downloadSnippets';
2+
import { defaultLocale } from '#site/next.locales.mjs';
33

44
type DynamicStaticPaths = { locale: string };
55
type StaticParams = { params: Promise<DynamicStaticPaths> };

apps/site/app/[locale]/next-data/og/[category]/[title]/route.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import HexagonGrid from '@node-core/ui-components/Icons/HexagonGrid';
22
import JsWhiteIcon from '@node-core/ui-components/Icons/Logos/JsWhite';
33
import { ImageResponse } from 'next/og';
44

5-
import { DEFAULT_CATEGORY_OG_TYPE } from '@/next.constants.mjs';
6-
import { defaultLocale } from '@/next.locales.mjs';
7-
import { hexToRGBA } from '@/util/hexToRGBA';
5+
import { DEFAULT_CATEGORY_OG_TYPE } from '#site/next.constants.mjs';
6+
import { defaultLocale } from '#site/next.locales.mjs';
7+
import { hexToRGBA } from '#site/util/hexToRGBA';
88

99
// TODO: use CSS variables instead of absolute values
1010
const CATEGORY_TO_THEME_COLOUR_MAP = {

apps/site/app/[locale]/next-data/page-data/route.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { deflateSync } from 'node:zlib';
22

33
import matter from 'gray-matter';
44

5-
import { dynamicRouter } from '@/next.dynamic.mjs';
6-
import { defaultLocale } from '@/next.locales.mjs';
7-
import { parseRichTextIntoPlainText } from '@/util/stringUtils';
5+
import { dynamicRouter } from '#site/next.dynamic.mjs';
6+
import { defaultLocale } from '#site/next.locales.mjs';
7+
import { parseRichTextIntoPlainText } from '#site/util/stringUtils';
88

99
// This is the Route Handler for the `GET` method which handles the request
1010
// for a digest and metadata of all existing pages on Node.js Website

apps/site/app/[locale]/next-data/release-data/route.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import provideReleaseData from '@/next-data/providers/releaseData';
2-
import { defaultLocale } from '@/next.locales.mjs';
1+
import provideReleaseData from '#site/next-data/providers/releaseData';
2+
import { defaultLocale } from '#site/next.locales.mjs';
33

44
// This is the Route Handler for the `GET` method which handles the request
55
// for generating static data related to the Node.js Release Data

apps/site/app/[locale]/not-found.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import Image from 'next/image';
55
import { useTranslations } from 'next-intl';
66
import type { FC } from 'react';
77

8-
import Button from '@/components/Common/Button';
9-
import GlowingBackdropLayout from '@/layouts/GlowingBackdrop';
8+
import Button from '#site/components/Common/Button';
9+
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
1010

1111
const NotFoundPage: FC = () => {
1212
const t = useTranslations();

apps/site/app/[locale]/page.tsx

+11-8
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ import { notFound, redirect } from 'next/navigation';
1111
import { setRequestLocale } from 'next-intl/server';
1212
import type { FC } from 'react';
1313

14-
import { setClientContext } from '@/client-context';
15-
import WithLayout from '@/components/withLayout';
14+
import { setClientContext } from '#site/client-context';
15+
import WithLayout from '#site/components/withLayout';
1616
import {
1717
ENABLE_STATIC_EXPORT_LOCALE,
1818
ENABLE_STATIC_EXPORT,
19-
} from '@/next.constants.mjs';
20-
import { PAGE_VIEWPORT, DYNAMIC_ROUTES } from '@/next.dynamic.constants.mjs';
21-
import { dynamicRouter } from '@/next.dynamic.mjs';
22-
import { allLocaleCodes, availableLocaleCodes } from '@/next.locales.mjs';
23-
import { defaultLocale } from '@/next.locales.mjs';
24-
import { MatterProvider } from '@/providers/matterProvider';
19+
} from '#site/next.constants.mjs';
20+
import {
21+
PAGE_VIEWPORT,
22+
DYNAMIC_ROUTES,
23+
} from '#site/next.dynamic.constants.mjs';
24+
import { dynamicRouter } from '#site/next.dynamic.mjs';
25+
import { allLocaleCodes, availableLocaleCodes } from '#site/next.locales.mjs';
26+
import { defaultLocale } from '#site/next.locales.mjs';
27+
import { MatterProvider } from '#site/providers/matterProvider';
2528

2629
type DynamicStaticPaths = { path: Array<string>; locale: string };
2730
type DynamicParams = { params: Promise<DynamicStaticPaths> };

apps/site/app/global-error.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import { ArrowRightIcon } from '@heroicons/react/24/solid';
44
import type { FC } from 'react';
55

6-
import Button from '@/components/Common/Button';
7-
import BaseLayout from '@/layouts/Base';
8-
import GlowingBackdropLayout from '@/layouts/GlowingBackdrop';
6+
import Button from '#site/components/Common/Button';
7+
import BaseLayout from '#site/layouts/Base';
8+
import GlowingBackdropLayout from '#site/layouts/GlowingBackdrop';
99

1010
const GlobalErrorPage: FC<{ error: Error }> = () => (
1111
<html>

apps/site/app/sitemap.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
BASE_PATH,
55
BASE_URL,
66
EXTERNAL_LINKS_SITEMAP,
7-
} from '@/next.constants.mjs';
8-
import { dynamicRouter } from '@/next.dynamic.mjs';
9-
import { availableLocaleCodes, defaultLocale } from '@/next.locales.mjs';
7+
} from '#site/next.constants.mjs';
8+
import { dynamicRouter } from '#site/next.dynamic.mjs';
9+
import { availableLocaleCodes, defaultLocale } from '#site/next.locales.mjs';
1010

1111
// This is the combination of the Application Base URL and Base PATH
1212
const baseUrlAndPath = `${BASE_URL}${BASE_PATH}`;

apps/site/client-context.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { cache } from 'react';
22

3-
import type { ClientSharedServerContext } from '@/types';
4-
import { assignClientContext } from '@/util/assignClientContext';
3+
import type { ClientSharedServerContext } from '#site/types';
4+
import { assignClientContext } from '#site/util/assignClientContext';
55

66
// This allows us to have Server-Side Context's of the shared "contextual" data
77
// which includes the frontmatter, the current pathname from the dynamic segments

apps/site/components/Blog/BlogHeader/__tests__/index.test.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
33

44
import { render, screen } from '@testing-library/react';
55

6-
import BlogHeader from '@/components/Blog/BlogHeader';
6+
import BlogHeader from '#site/components/Blog/BlogHeader';
77

88
describe('BlogHeader', () => {
99
it('should have correct href when category is all', () => {

apps/site/components/Blog/BlogHeader/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { RssIcon } from '@heroicons/react/24/solid';
22
import { useTranslations } from 'next-intl';
33
import type { FC } from 'react';
44

5-
import Link from '@/components/Link';
6-
import { siteConfig } from '@/next.json.mjs';
5+
import Link from '#site/components/Link';
6+
import { siteConfig } from '#site/next.json.mjs';
77

88
import styles from './index.module.css';
99

apps/site/components/Blog/BlogPostCard/__tests__/index.test.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { render, screen } from '@testing-library/react';
55

66
import { isVisible } from '../../../../../../tests/utilities.mjs';
77

8-
import BlogPostCard from '@/components/Blog/BlogPostCard';
8+
import BlogPostCard from '#site/components/Blog/BlogPostCard';
99

1010
function renderBlogPostCard({
1111
title = 'Blog post title',

apps/site/components/Blog/BlogPostCard/index.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Preview from '@node-core/ui-components/Common/Preview';
22
import { useTranslations } from 'next-intl';
33
import type { FC } from 'react';
44

5-
import FormattedTime from '@/components/Common/FormattedTime';
6-
import Link from '@/components/Link';
7-
import WithAvatarGroup from '@/components/withAvatarGroup';
8-
import type { BlogCategory } from '@/types';
9-
import { mapBlogCategoryToPreviewType } from '@/util/blogUtils';
5+
import FormattedTime from '#site/components/Common/FormattedTime';
6+
import Link from '#site/components/Link';
7+
import WithAvatarGroup from '#site/components/withAvatarGroup';
8+
import type { BlogCategory } from '#site/types';
9+
import { mapBlogCategoryToPreviewType } from '#site/util/blogUtils';
1010

1111
import styles from './index.module.css';
1212

apps/site/components/Common/Button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import BaseButton, {
33
} from '@node-core/ui-components/Common/BaseButton';
44
import type { FC, ComponentProps } from 'react';
55

6-
import Link from '@/components/Link';
6+
import Link from '#site/components/Link';
77

88
const Button: FC<
99
Omit<ButtonProps, 'as'> & Omit<ComponentProps<typeof Link>, 'as' | 'size'>

apps/site/components/Common/CodeBox.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import BaseCodeBox from '@node-core/ui-components/Common/BaseCodeBox';
44
import { useTranslations } from 'next-intl';
55
import type { FC, PropsWithChildren, ReactNode } from 'react';
66

7-
import Link from '@/components/Link';
8-
import { useCopyToClipboard, useNotification } from '@/hooks';
7+
import Link from '#site/components/Link';
8+
import { useCopyToClipboard, useNotification } from '#site/hooks';
99

1010
type CodeBoxProps = {
1111
language: string;

apps/site/components/Common/CrossLink.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { CrossLinkProps } from '@node-core/ui-components/Common/BaseCrossLi
33
import { useTranslations } from 'next-intl';
44
import type { FC } from 'react';
55

6-
import Link from '@/components/Link';
6+
import Link from '#site/components/Link';
77

88
const CrossLink: FC<Omit<CrossLinkProps, 'as' | 'label'>> = props => {
99
const t = useTranslations();

apps/site/components/Common/FormattedTime.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { DateTimeFormatOptions } from 'next-intl';
22
import { useFormatter } from 'next-intl';
33
import type { FC } from 'react';
44

5-
import { DEFAULT_DATE_FORMAT } from '@/next.calendar.constants.mjs';
5+
import { DEFAULT_DATE_FORMAT } from '#site/next.calendar.constants.mjs';
66

77
type FormattedTimeProps = {
88
date: string | Date;

apps/site/components/Common/LinkTabs.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import BaseLinkTabs from '@node-core/ui-components/Common/BaseLinkTabs';
44
import type { LinkTabsProps } from '@node-core/ui-components/Common/BaseLinkTabs';
55
import type { FC } from 'react';
66

7-
import Link from '@/components/Link';
8-
import { useRouter } from '@/navigation.mjs';
7+
import Link from '#site/components/Link';
8+
import { useRouter } from '#site/navigation.mjs';
99

1010
const LinkTabs: FC<Omit<LinkTabsProps, 'as' | 'onSelect'>> = props => {
1111
const { push } = useRouter();

apps/site/components/Common/Pagination.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { PaginationProps } from '@node-core/ui-components/Common/BasePagina
33
import { useTranslations } from 'next-intl';
44
import type { FC } from 'react';
55

6-
import Link from '@/components/Link';
6+
import Link from '#site/components/Link';
77

88
const Pagination: FC<
99
Omit<PaginationProps, 'as' | 'labels' | 'getPageLabel'>

apps/site/components/Common/Search/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { useTranslations, useLocale } from 'next-intl';
55
import { useTheme } from 'next-themes';
66
import type { FC } from 'react';
77

8-
import { useRouter } from '@/navigation.mjs';
8+
import { useRouter } from '#site/navigation.mjs';
99
import {
1010
ORAMA_CLOUD_ENDPOINT,
1111
ORAMA_CLOUD_API_KEY,
1212
DEFAULT_ORAMA_QUERY_PARAMS,
1313
DEFAULT_ORAMA_SUGGESTIONS,
1414
BASE_URL,
15-
} from '@/next.constants.mjs';
15+
} from '#site/next.constants.mjs';
1616

1717
type ResultMapDescription = {
1818
path: string;

apps/site/components/Downloads/DownloadButton/index.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { CloudArrowDownIcon } from '@heroicons/react/24/outline';
44
import classNames from 'classnames';
55
import type { FC, PropsWithChildren } from 'react';
66

7-
import Button from '@/components/Common/Button';
8-
import { useClientContext } from '@/hooks';
9-
import type { NodeRelease } from '@/types';
10-
import { getNodeDownloadUrl } from '@/util/getNodeDownloadUrl';
11-
import { getUserPlatform } from '@/util/getUserPlatform';
7+
import Button from '#site/components/Common/Button';
8+
import { useClientContext } from '#site/hooks';
9+
import type { NodeRelease } from '#site/types';
10+
import { getNodeDownloadUrl } from '#site/util/getNodeDownloadUrl';
11+
import { getUserPlatform } from '#site/util/getUserPlatform';
1212

1313
import styles from './index.module.css';
1414

apps/site/components/Downloads/DownloadLink.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import type { FC, PropsWithChildren } from 'react';
44

5-
import LinkWithArrow from '@/components/LinkWithArrow';
6-
import { useClientContext } from '@/hooks';
7-
import type { NodeRelease } from '@/types';
8-
import type { DownloadKind } from '@/util/getNodeDownloadUrl';
9-
import { getNodeDownloadUrl } from '@/util/getNodeDownloadUrl';
10-
import { getUserPlatform } from '@/util/getUserPlatform';
5+
import LinkWithArrow from '#site/components/LinkWithArrow';
6+
import { useClientContext } from '#site/hooks';
7+
import type { NodeRelease } from '#site/types';
8+
import type { DownloadKind } from '#site/util/getNodeDownloadUrl';
9+
import { getNodeDownloadUrl } from '#site/util/getNodeDownloadUrl';
10+
import { getUserPlatform } from '#site/util/getUserPlatform';
1111

1212
type DownloadLinkProps = { release: NodeRelease; kind?: DownloadKind };
1313

apps/site/components/Downloads/DownloadReleasesTable/DetailsButton.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { useTranslations } from 'next-intl';
44
import type { FC } from 'react';
55
import { use } from 'react';
66

7-
import LinkWithArrow from '@/components/LinkWithArrow';
8-
import { ReleaseModalContext } from '@/providers/releaseModalProvider';
9-
import type { NodeRelease } from '@/types';
7+
import LinkWithArrow from '#site/components/LinkWithArrow';
8+
import { ReleaseModalContext } from '#site/providers/releaseModalProvider';
9+
import type { NodeRelease } from '#site/types';
1010

1111
type DetailsButtonProps = {
1212
versionData: NodeRelease;

0 commit comments

Comments
 (0)