From 8ae8d01bfc17a79df3dda3df40657864609e46a9 Mon Sep 17 00:00:00 2001 From: mkleszcz Date: Tue, 10 Oct 2023 16:55:24 +0200 Subject: [PATCH] feat: Rename package names from @ab to @alp (#1) --- .eslintrc.json | 8 ++++---- apps/app/.prettierrc | 2 +- apps/app/next.config.js | 2 +- apps/app/package.json | 4 ++-- apps/app/project.json | 2 +- .../src/app/[lang]/app/crud/[id]/crudDetails.tsx | 2 +- apps/app/src/app/[lang]/app/crud/[id]/error.tsx | 2 +- .../app/src/app/[lang]/app/crud/[id]/loading.tsx | 2 +- apps/app/src/app/[lang]/app/crud/[id]/page.tsx | 2 +- .../[lang]/app/crud/__tests__/crudList.spec.tsx | 2 +- .../app/crud/add/__tests__/addCrudItem.spec.tsx | 2 +- .../src/app/[lang]/app/crud/add/addCrudItem.tsx | 2 +- apps/app/src/app/[lang]/app/crud/add/error.tsx | 2 +- apps/app/src/app/[lang]/app/crud/add/loading.tsx | 2 +- apps/app/src/app/[lang]/app/crud/add/page.tsx | 2 +- apps/app/src/app/[lang]/app/crud/crudList.tsx | 6 +++--- apps/app/src/app/[lang]/app/crud/error.tsx | 2 +- apps/app/src/app/[lang]/app/crud/loading.tsx | 2 +- apps/app/src/app/[lang]/app/crud/page.tsx | 2 +- .../[id]/__tests__/updateCrudItem.spec.tsx | 2 +- .../app/[lang]/app/crud/update/[id]/error.tsx | 2 +- .../app/[lang]/app/crud/update/[id]/loading.tsx | 2 +- .../src/app/[lang]/app/crud/update/[id]/page.tsx | 2 +- .../app/crud/update/[id]/updateCrudItem.tsx | 2 +- apps/app/src/app/[lang]/app/profile/page.tsx | 2 +- .../app/[lang]/app/profile/profile.graphql.ts | 2 +- .../src/app/[lang]/app/profile/updateProfile.tsx | 2 +- apps/app/src/app/[lang]/layout.tsx | 4 ++-- apps/app/src/app/api/auth/[...nextauth]/route.ts | 2 +- apps/app/src/app/api/graphql/route.ts | 4 ++-- .../components/crudItem/crudItem.component.tsx | 4 ++-- .../src/components/crudItem/crudItem.stories.tsx | 5 ++--- .../src/components/header/header.component.tsx | 2 +- .../homepage/header/__tests__/header.spec.tsx | 2 +- .../homepage/header/header.stories.tsx | 2 +- .../loginState/__tests__/loginStsate.spec.tsx | 2 +- .../homepage/loginState/loginState.component.tsx | 2 +- .../homepage/loginState/loginState.stories.tsx | 2 +- apps/app/src/config/auth.ts | 8 ++++---- apps/app/src/graphql/crud.graphql.ts | 2 +- .../useUserRole/__tests__/useUserRole.spec.tsx | 2 +- apps/app/src/middleware.ts | 2 +- .../appProviders/appProviders.component.tsx | 8 ++++---- apps/app/src/tests/factories/crudItem.ts | 4 ++-- .../tests/factories/sessionProviderFactory.ts | 4 ++-- apps/app/src/tests/setupTests.ts | 2 +- apps/app/src/tests/utils/rendering.tsx | 6 +++--- apps/app/src/types/next-auth.d.ts | 2 +- nx.json | 2 +- package.json | 4 ++-- packages/api-client/.prettierrc | 2 +- packages/api-client/package.json | 2 +- .../src/tests/utils/factoryCreators.ts | 2 +- .../api-client/src/tests/utils/rendering.tsx | 4 ++-- packages/core/.prettierrc | 2 +- packages/core/package.json | 2 +- packages/core/project.json | 8 ++++++++ .../intlProvider/intlProvider.component.tsx | 4 ++-- packages/emails/.prettierrc | 2 +- packages/emails/package.json | 2 +- packages/emails/project.json | 8 ++++++++ packages/graphql-api/.prettierrc | 2 +- packages/graphql-api/package.json | 2 +- packages/graphql-api/project.json | 8 ++++++++ packages/graphql-api/src/types/next-auth.d.ts | 2 +- packages/internal/internal-core/package.json | 2 +- packages/internal/internal-core/project.json | 2 +- packages/internal/internal-tools/package.json | 2 +- pnpm-lock.yaml | 6 +++--- tsconfig.base.json | 16 ++++++++-------- 70 files changed, 123 insertions(+), 100 deletions(-) create mode 100644 packages/core/project.json create mode 100644 packages/emails/project.json create mode 100644 packages/graphql-api/project.json diff --git a/.eslintrc.json b/.eslintrc.json index 97ce7f4..4d9cc2c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,10 +12,10 @@ "enforceBuildableLibDependency": true, "allow": [ "@app/**", - "@ab/core/**", - "@ab/api-client/**", - "@ab/graphql-api", - "@ab/graphql-api/**" + "@alp/core/**", + "@alp/api-client/**", + "@alp/graphql-api", + "@alp/graphql-api/**" ], "depConstraints": [ { diff --git a/apps/app/.prettierrc b/apps/app/.prettierrc index 600506f..1c946e4 100644 --- a/apps/app/.prettierrc +++ b/apps/app/.prettierrc @@ -6,7 +6,7 @@ "importOrder": [ "^(path|dns|fs)/?", "", - "@ab", + "@alp", "@app", "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", "^[./]" diff --git a/apps/app/next.config.js b/apps/app/next.config.js index 59062b5..6ef75a9 100644 --- a/apps/app/next.config.js +++ b/apps/app/next.config.js @@ -3,7 +3,7 @@ const webpack = require('webpack'); /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - transpilePackages: ['@ab/graphql-api', '@ab/api-client', '@ab/core', 'ramda'], + transpilePackages: ['@alp/graphql-api', '@alp/api-client', '@alp/core', 'ramda'], experimental: { serverComponentsExternalPackages: ['typeorm'], }, diff --git a/apps/app/package.json b/apps/app/package.json index af1b854..dc6e5a2 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -15,8 +15,8 @@ "db:migrate": "cd ../../packages/graphql-api && pnpm run db:migrate" }, "dependencies": { - "@ab/api-client": "*", - "@ab/core": "*", + "@alp/api-client": "*", + "@alp/core": "*", "@as-integrations/next": "^2.0.2", "@auth/typeorm-adapter": "^1.0.2", "@emotion/css": "^11.11.2", diff --git a/apps/app/project.json b/apps/app/project.json index 687f28a..25c2eae 100644 --- a/apps/app/project.json +++ b/apps/app/project.json @@ -6,7 +6,7 @@ "implicitDependencies": ["internal-tools"], "targets": { "setup": { - "executor": "@ab/internal-tools:setup", + "executor": "@alp/internal-tools:setup", "options": { "cwd": "apps/app" } diff --git a/apps/app/src/app/[lang]/app/crud/[id]/crudDetails.tsx b/apps/app/src/app/[lang]/app/crud/[id]/crudDetails.tsx index 62b152c..176380b 100644 --- a/apps/app/src/app/[lang]/app/crud/[id]/crudDetails.tsx +++ b/apps/app/src/app/[lang]/app/crud/[id]/crudDetails.tsx @@ -3,7 +3,7 @@ import { Box, Text } from '@mantine/core'; import { FormattedMessage } from 'react-intl'; -import { CrudItem as CrudItemType } from '@ab/api-client'; +import { CrudItem as CrudItemType } from '@alp/api-client'; export interface CrudDetailsProps { crudItem: CrudItemType; diff --git a/apps/app/src/app/[lang]/app/crud/[id]/error.tsx b/apps/app/src/app/[lang]/app/crud/[id]/error.tsx index cf99544..30b258c 100644 --- a/apps/app/src/app/[lang]/app/crud/[id]/error.tsx +++ b/apps/app/src/app/[lang]/app/crud/[id]/error.tsx @@ -1,6 +1,6 @@ 'use client'; -import { GenericError } from '@ab/core/components'; +import { GenericError } from '@alp/core/components'; export default function ErrorPage() { return ; diff --git a/apps/app/src/app/[lang]/app/crud/[id]/loading.tsx b/apps/app/src/app/[lang]/app/crud/[id]/loading.tsx index d83dab2..0bd9510 100644 --- a/apps/app/src/app/[lang]/app/crud/[id]/loading.tsx +++ b/apps/app/src/app/[lang]/app/crud/[id]/loading.tsx @@ -2,7 +2,7 @@ import { Flex, Skeleton, Space } from '@mantine/core'; -import { PageLayout } from '@ab/core/components'; +import { PageLayout } from '@alp/core/components'; export default function Loading() { return ( diff --git a/apps/app/src/app/[lang]/app/crud/[id]/page.tsx b/apps/app/src/app/[lang]/app/crud/[id]/page.tsx index f914892..c2c4031 100644 --- a/apps/app/src/app/[lang]/app/crud/[id]/page.tsx +++ b/apps/app/src/app/[lang]/app/crud/[id]/page.tsx @@ -3,7 +3,7 @@ import { useSuspenseQuery } from '@apollo/experimental-nextjs-app-support/ssr'; import { useIntl } from 'react-intl'; -import { PageHeadline, PageLayout } from '@ab/core/components'; +import { PageHeadline, PageLayout } from '@alp/core/components'; import { detailsCrudItemQuery } from '../../../../../graphql'; import { CrudDetails } from './crudDetails'; diff --git a/apps/app/src/app/[lang]/app/crud/__tests__/crudList.spec.tsx b/apps/app/src/app/[lang]/app/crud/__tests__/crudList.spec.tsx index daca4a0..f55701a 100644 --- a/apps/app/src/app/[lang]/app/crud/__tests__/crudList.spec.tsx +++ b/apps/app/src/app/[lang]/app/crud/__tests__/crudList.spec.tsx @@ -3,7 +3,7 @@ import { screen } from '@testing-library/react'; import { append, times } from 'ramda'; import { Suspense } from 'react'; -import { UserRole } from '@ab/graphql-api/types'; +import { UserRole } from '@alp/graphql-api/types'; import { crudItemFactory, fillCRUDListQuery } from '../../../../../tests/factories/crudItem'; import { sessionProviderFactory } from '../../../../../tests/factories/sessionProviderFactory'; diff --git a/apps/app/src/app/[lang]/app/crud/add/__tests__/addCrudItem.spec.tsx b/apps/app/src/app/[lang]/app/crud/add/__tests__/addCrudItem.spec.tsx index 7428e2b..8e1fb2a 100644 --- a/apps/app/src/app/[lang]/app/crud/add/__tests__/addCrudItem.spec.tsx +++ b/apps/app/src/app/[lang]/app/crud/add/__tests__/addCrudItem.spec.tsx @@ -4,7 +4,7 @@ import { userEvent } from '@testing-library/user-event'; import { append } from 'ramda'; import { Suspense } from 'react'; -import { AddCrudItemMutation } from '@ab/api-client'; +import { AddCrudItemMutation } from '@alp/api-client'; import { RoutesConfig } from '../../../../../../config/routes'; import { fillAddCRUDItemQuery } from '../../../../../../tests/factories/crudItem'; diff --git a/apps/app/src/app/[lang]/app/crud/add/addCrudItem.tsx b/apps/app/src/app/[lang]/app/crud/add/addCrudItem.tsx index 27e0562..b31ae7d 100644 --- a/apps/app/src/app/[lang]/app/crud/add/addCrudItem.tsx +++ b/apps/app/src/app/[lang]/app/crud/add/addCrudItem.tsx @@ -3,7 +3,7 @@ import { useMutation } from '@apollo/client'; import { useRouter } from 'next/navigation'; -import { CrudItem } from '@ab/api-client'; +import { CrudItem } from '@alp/api-client'; import { CrudItemForm, CrudItemFormFields } from '@app/components/crudItemForm/crudItemForm.component'; import { RoutesConfig } from '@app/config/routes'; diff --git a/apps/app/src/app/[lang]/app/crud/add/error.tsx b/apps/app/src/app/[lang]/app/crud/add/error.tsx index cf99544..30b258c 100644 --- a/apps/app/src/app/[lang]/app/crud/add/error.tsx +++ b/apps/app/src/app/[lang]/app/crud/add/error.tsx @@ -1,6 +1,6 @@ 'use client'; -import { GenericError } from '@ab/core/components'; +import { GenericError } from '@alp/core/components'; export default function ErrorPage() { return ; diff --git a/apps/app/src/app/[lang]/app/crud/add/loading.tsx b/apps/app/src/app/[lang]/app/crud/add/loading.tsx index f0e39f4..a1588fe 100644 --- a/apps/app/src/app/[lang]/app/crud/add/loading.tsx +++ b/apps/app/src/app/[lang]/app/crud/add/loading.tsx @@ -2,7 +2,7 @@ import { Flex, Skeleton, Space } from '@mantine/core'; -import { PageLayout } from '@ab/core/components'; +import { PageLayout } from '@alp/core/components'; export default function Loading() { return ( diff --git a/apps/app/src/app/[lang]/app/crud/add/page.tsx b/apps/app/src/app/[lang]/app/crud/add/page.tsx index 78c1f75..ceddf7d 100644 --- a/apps/app/src/app/[lang]/app/crud/add/page.tsx +++ b/apps/app/src/app/[lang]/app/crud/add/page.tsx @@ -2,7 +2,7 @@ import { useIntl } from 'react-intl'; -import { PageHeadline, PageLayout } from '@ab/core/components'; +import { PageHeadline, PageLayout } from '@alp/core/components'; import { AddCrudItem } from './addCrudItem'; diff --git a/apps/app/src/app/[lang]/app/crud/crudList.tsx b/apps/app/src/app/[lang]/app/crud/crudList.tsx index 571c9d4..a3c3d77 100644 --- a/apps/app/src/app/[lang]/app/crud/crudList.tsx +++ b/apps/app/src/app/[lang]/app/crud/crudList.tsx @@ -5,9 +5,9 @@ import { SimpleGrid } from '@mantine/core'; import { IconPlus } from '@tabler/icons-react'; import { FormattedMessage, useIntl } from 'react-intl'; -import { CrudItem as CrudItemType } from '@ab/api-client'; -import { Link, Tooltip } from '@ab/core/components'; -import { UserRole } from '@ab/graphql-api/types'; +import { CrudItem as CrudItemType } from '@alp/api-client'; +import { Link, Tooltip } from '@alp/core/components'; +import { UserRole } from '@alp/graphql-api/types'; import { CrudItem } from '@app/components/crudItem'; import { RoutesConfig } from '@app/config/routes'; diff --git a/apps/app/src/app/[lang]/app/crud/error.tsx b/apps/app/src/app/[lang]/app/crud/error.tsx index cf99544..30b258c 100644 --- a/apps/app/src/app/[lang]/app/crud/error.tsx +++ b/apps/app/src/app/[lang]/app/crud/error.tsx @@ -1,6 +1,6 @@ 'use client'; -import { GenericError } from '@ab/core/components'; +import { GenericError } from '@alp/core/components'; export default function ErrorPage() { return ; diff --git a/apps/app/src/app/[lang]/app/crud/loading.tsx b/apps/app/src/app/[lang]/app/crud/loading.tsx index bf08b0a..ea3e8e8 100644 --- a/apps/app/src/app/[lang]/app/crud/loading.tsx +++ b/apps/app/src/app/[lang]/app/crud/loading.tsx @@ -2,7 +2,7 @@ import { Flex, SimpleGrid, Skeleton, Space } from '@mantine/core'; -import { PageLayout } from '@ab/core/components'; +import { PageLayout } from '@alp/core/components'; export default function Loading() { return ( diff --git a/apps/app/src/app/[lang]/app/crud/page.tsx b/apps/app/src/app/[lang]/app/crud/page.tsx index 85c0545..584d922 100644 --- a/apps/app/src/app/[lang]/app/crud/page.tsx +++ b/apps/app/src/app/[lang]/app/crud/page.tsx @@ -2,7 +2,7 @@ import { useIntl } from 'react-intl'; -import { PageHeadline, PageLayout } from '@ab/core/components'; +import { PageHeadline, PageLayout } from '@alp/core/components'; import { CrudList } from './crudList'; diff --git a/apps/app/src/app/[lang]/app/crud/update/[id]/__tests__/updateCrudItem.spec.tsx b/apps/app/src/app/[lang]/app/crud/update/[id]/__tests__/updateCrudItem.spec.tsx index 4e63a0a..4b4db8b 100644 --- a/apps/app/src/app/[lang]/app/crud/update/[id]/__tests__/updateCrudItem.spec.tsx +++ b/apps/app/src/app/[lang]/app/crud/update/[id]/__tests__/updateCrudItem.spec.tsx @@ -4,7 +4,7 @@ import { userEvent } from '@testing-library/user-event'; import { append } from 'ramda'; import { Suspense } from 'react'; -import { CrudItem, UpdateCrudItemMutation } from '@ab/api-client'; +import { CrudItem, UpdateCrudItemMutation } from '@alp/api-client'; import { RoutesConfig } from '../../../../../../../config/routes'; import { fillUpdateCRUDItemQuery } from '../../../../../../../tests/factories/crudItem'; diff --git a/apps/app/src/app/[lang]/app/crud/update/[id]/error.tsx b/apps/app/src/app/[lang]/app/crud/update/[id]/error.tsx index cf99544..30b258c 100644 --- a/apps/app/src/app/[lang]/app/crud/update/[id]/error.tsx +++ b/apps/app/src/app/[lang]/app/crud/update/[id]/error.tsx @@ -1,6 +1,6 @@ 'use client'; -import { GenericError } from '@ab/core/components'; +import { GenericError } from '@alp/core/components'; export default function ErrorPage() { return ; diff --git a/apps/app/src/app/[lang]/app/crud/update/[id]/loading.tsx b/apps/app/src/app/[lang]/app/crud/update/[id]/loading.tsx index f0e39f4..a1588fe 100644 --- a/apps/app/src/app/[lang]/app/crud/update/[id]/loading.tsx +++ b/apps/app/src/app/[lang]/app/crud/update/[id]/loading.tsx @@ -2,7 +2,7 @@ import { Flex, Skeleton, Space } from '@mantine/core'; -import { PageLayout } from '@ab/core/components'; +import { PageLayout } from '@alp/core/components'; export default function Loading() { return ( diff --git a/apps/app/src/app/[lang]/app/crud/update/[id]/page.tsx b/apps/app/src/app/[lang]/app/crud/update/[id]/page.tsx index 4450fea..39f0970 100644 --- a/apps/app/src/app/[lang]/app/crud/update/[id]/page.tsx +++ b/apps/app/src/app/[lang]/app/crud/update/[id]/page.tsx @@ -3,7 +3,7 @@ import { useSuspenseQuery } from '@apollo/experimental-nextjs-app-support/ssr'; import { useIntl } from 'react-intl'; -import { PageHeadline, PageLayout } from '@ab/core/components'; +import { PageHeadline, PageLayout } from '@alp/core/components'; import { detailsCrudItemQuery } from '../../../../../../graphql'; import { UpdateCrudItem } from './updateCrudItem'; diff --git a/apps/app/src/app/[lang]/app/crud/update/[id]/updateCrudItem.tsx b/apps/app/src/app/[lang]/app/crud/update/[id]/updateCrudItem.tsx index 2b3779f..f1a6372 100644 --- a/apps/app/src/app/[lang]/app/crud/update/[id]/updateCrudItem.tsx +++ b/apps/app/src/app/[lang]/app/crud/update/[id]/updateCrudItem.tsx @@ -3,7 +3,7 @@ import { useMutation } from '@apollo/client'; import { useRouter } from 'next/navigation'; -import { CrudItem } from '@ab/api-client'; +import { CrudItem } from '@alp/api-client'; import { CrudItemForm, CrudItemFormFields } from '@app/components/crudItemForm/crudItemForm.component'; import { RoutesConfig } from '@app/config/routes'; diff --git a/apps/app/src/app/[lang]/app/profile/page.tsx b/apps/app/src/app/[lang]/app/profile/page.tsx index 0f23612..e7e802a 100644 --- a/apps/app/src/app/[lang]/app/profile/page.tsx +++ b/apps/app/src/app/[lang]/app/profile/page.tsx @@ -2,7 +2,7 @@ import { useSuspenseQuery } from '@apollo/experimental-nextjs-app-support/ssr'; -import { PageHeadline, PageLayout } from '@ab/core/components'; +import { PageHeadline, PageLayout } from '@alp/core/components'; import { userProfileQuery } from './profile.graphql'; import { UpdateProfile } from './updateProfile'; diff --git a/apps/app/src/app/[lang]/app/profile/profile.graphql.ts b/apps/app/src/app/[lang]/app/profile/profile.graphql.ts index aabdbb7..f2b01a0 100644 --- a/apps/app/src/app/[lang]/app/profile/profile.graphql.ts +++ b/apps/app/src/app/[lang]/app/profile/profile.graphql.ts @@ -1,4 +1,4 @@ -import { gql } from '@ab/api-client'; +import { gql } from '@alp/api-client'; export const userProfileQuery = gql(/* GraphQL */ ` query UserProfile { diff --git a/apps/app/src/app/[lang]/app/profile/updateProfile.tsx b/apps/app/src/app/[lang]/app/profile/updateProfile.tsx index 138fe66..05be2bb 100644 --- a/apps/app/src/app/[lang]/app/profile/updateProfile.tsx +++ b/apps/app/src/app/[lang]/app/profile/updateProfile.tsx @@ -3,7 +3,7 @@ import { useMutation } from '@apollo/client'; import { notifications } from '@mantine/notifications'; -import { UserEntity } from '@ab/graphql-api/entity'; +import { UserEntity } from '@alp/graphql-api/entity'; import { ProfileForm, ProfileFormFields } from '../../../../components/profileForm'; import { updateProfileMutation } from './profile.graphql'; diff --git a/apps/app/src/app/[lang]/layout.tsx b/apps/app/src/app/[lang]/layout.tsx index 0e367ee..8efa8d4 100644 --- a/apps/app/src/app/[lang]/layout.tsx +++ b/apps/app/src/app/[lang]/layout.tsx @@ -3,8 +3,8 @@ import { Metadata } from 'next'; import { getServerSession } from 'next-auth'; import { cookies, headers } from 'next/headers'; -import { Locale, i18n } from '@ab/core/config/i18n'; -import { COLOR_SCHEME_COOKIE_NAME } from '@ab/core/providers/mantineProvider/MantineProvider.const'; +import { Locale, i18n } from '@alp/core/config/i18n'; +import { COLOR_SCHEME_COOKIE_NAME } from '@alp/core/providers/mantineProvider/MantineProvider.const'; import { authOptions } from '@app/config/auth'; import { AppProviders } from '@app/providers/appProviders'; diff --git a/apps/app/src/app/api/auth/[...nextauth]/route.ts b/apps/app/src/app/api/auth/[...nextauth]/route.ts index f993731..ebf4cc5 100644 --- a/apps/app/src/app/api/auth/[...nextauth]/route.ts +++ b/apps/app/src/app/api/auth/[...nextauth]/route.ts @@ -1,6 +1,6 @@ import NextAuth from 'next-auth'; -import { initializeDataSource } from '@ab/graphql-api/data-source'; +import { initializeDataSource } from '@alp/graphql-api/data-source'; import { authOptions } from '@app/config/auth'; diff --git a/apps/app/src/app/api/graphql/route.ts b/apps/app/src/app/api/graphql/route.ts index 0acb11e..fbdbb09 100644 --- a/apps/app/src/app/api/graphql/route.ts +++ b/apps/app/src/app/api/graphql/route.ts @@ -3,8 +3,8 @@ import { startServerAndCreateNextHandler } from '@as-integrations/next'; import { getServerSession } from 'next-auth'; import { NextRequest } from 'next/server'; -import schema, { ApiContextType } from '@ab/graphql-api'; -import { formatError } from '@ab/graphql-api/utils/formatError'; +import schema, { ApiContextType } from '@alp/graphql-api'; +import { formatError } from '@alp/graphql-api/utils/formatError'; import { authOptions } from '@app/config/auth'; diff --git a/apps/app/src/components/crudItem/crudItem.component.tsx b/apps/app/src/components/crudItem/crudItem.component.tsx index 0906fa9..5d6aa6b 100644 --- a/apps/app/src/components/crudItem/crudItem.component.tsx +++ b/apps/app/src/components/crudItem/crudItem.component.tsx @@ -6,8 +6,8 @@ import { IconEdit, IconTrashX } from '@tabler/icons-react'; import { useRouter } from 'next/navigation'; import { MouseEvent } from 'react'; -import { CrudItem as CrudItemType } from '@ab/api-client'; -import { Link } from '@ab/core/components'; +import { CrudItem as CrudItemType } from '@alp/api-client'; +import { Link } from '@alp/core/components'; import { allCrudItemsQuery, deleteCrudItemMutation } from '@app/graphql'; diff --git a/apps/app/src/components/crudItem/crudItem.stories.tsx b/apps/app/src/components/crudItem/crudItem.stories.tsx index 858bfe3..e206bf6 100644 --- a/apps/app/src/components/crudItem/crudItem.stories.tsx +++ b/apps/app/src/components/crudItem/crudItem.stories.tsx @@ -1,11 +1,10 @@ import { Meta, StoryFn, StoryObj } from '@storybook/react'; -import { UserRole } from '@ab/graphql-api/types'; - +import { UserRole } from '@alp/graphql-api/types'; import { withAppProviders } from '../../../.storybook/decorators'; +import { sessionProviderFactory } from '../../tests/factories/sessionProviderFactory'; import { CrudItem, CrudItemProps } from './crudItem.component'; -import { sessionProviderFactory } from '@app/tests/factories/sessionProviderFactory'; type Story = StoryObj; diff --git a/apps/app/src/components/header/header.component.tsx b/apps/app/src/components/header/header.component.tsx index 997fd61..99a7ca5 100644 --- a/apps/app/src/components/header/header.component.tsx +++ b/apps/app/src/components/header/header.component.tsx @@ -9,7 +9,7 @@ import { } from '@mantine/core'; import Image from 'next/image'; -import { LanguageSwitch, ThemeToggler } from '@ab/core/components'; +import { LanguageSwitch, ThemeToggler } from '@alp/core/components'; import LogoDark from '../../../public/logo-dark.png'; import LogoLight from '../../../public/logo-light.png'; diff --git a/apps/app/src/components/homepage/header/__tests__/header.spec.tsx b/apps/app/src/components/homepage/header/__tests__/header.spec.tsx index e9e7053..a6848d1 100644 --- a/apps/app/src/components/homepage/header/__tests__/header.spec.tsx +++ b/apps/app/src/components/homepage/header/__tests__/header.spec.tsx @@ -1,7 +1,7 @@ import '@testing-library/jest-dom'; import { screen } from '@testing-library/react'; -import { UserRole } from '@ab/graphql-api/types'; +import { UserRole } from '@alp/graphql-api/types'; import { sessionProviderFactory } from '../../../../tests/factories/sessionProviderFactory'; import { render } from '../../../../tests/utils/rendering'; diff --git a/apps/app/src/components/homepage/header/header.stories.tsx b/apps/app/src/components/homepage/header/header.stories.tsx index e80f4a4..7629db8 100644 --- a/apps/app/src/components/homepage/header/header.stories.tsx +++ b/apps/app/src/components/homepage/header/header.stories.tsx @@ -1,6 +1,6 @@ import { Meta, StoryObj } from '@storybook/react'; -import { UserRole } from '@ab/graphql-api/types'; +import { UserRole } from '@alp/graphql-api/types'; import { withAppProviders } from '../../../../.storybook/decorators'; import { sessionProviderFactory } from '../../../tests/factories/sessionProviderFactory'; diff --git a/apps/app/src/components/homepage/loginState/__tests__/loginStsate.spec.tsx b/apps/app/src/components/homepage/loginState/__tests__/loginStsate.spec.tsx index eaef533..8d75a7c 100644 --- a/apps/app/src/components/homepage/loginState/__tests__/loginStsate.spec.tsx +++ b/apps/app/src/components/homepage/loginState/__tests__/loginStsate.spec.tsx @@ -1,7 +1,7 @@ import '@testing-library/jest-dom'; import { screen } from '@testing-library/react'; -import { UserRole } from '@ab/graphql-api/types'; +import { UserRole } from '@alp/graphql-api/types'; import { sessionProviderFactory } from '../../../../tests/factories/sessionProviderFactory'; import { render } from '../../../../tests/utils/rendering'; diff --git a/apps/app/src/components/homepage/loginState/loginState.component.tsx b/apps/app/src/components/homepage/loginState/loginState.component.tsx index 6aee5de..ea3a2d3 100644 --- a/apps/app/src/components/homepage/loginState/loginState.component.tsx +++ b/apps/app/src/components/homepage/loginState/loginState.component.tsx @@ -3,7 +3,7 @@ import { Avatar, Button, Flex, Skeleton } from '@mantine/core'; import { signIn, useSession } from 'next-auth/react'; -import { Link } from '@ab/core/components'; +import { Link } from '@alp/core/components'; export const LoginState = () => { const { data: session, status } = useSession(); diff --git a/apps/app/src/components/homepage/loginState/loginState.stories.tsx b/apps/app/src/components/homepage/loginState/loginState.stories.tsx index 6b1093f..8c88680 100644 --- a/apps/app/src/components/homepage/loginState/loginState.stories.tsx +++ b/apps/app/src/components/homepage/loginState/loginState.stories.tsx @@ -1,6 +1,6 @@ import { Meta, StoryObj } from '@storybook/react'; -import { UserRole } from '@ab/graphql-api/types'; +import { UserRole } from '@alp/graphql-api/types'; import { withAppProviders } from '../../../../.storybook/decorators'; import { sessionProviderFactory } from '../../../tests/factories/sessionProviderFactory'; diff --git a/apps/app/src/config/auth.ts b/apps/app/src/config/auth.ts index 001bc22..90388ca 100644 --- a/apps/app/src/config/auth.ts +++ b/apps/app/src/config/auth.ts @@ -2,10 +2,10 @@ import { TypeORMAdapter } from '@auth/typeorm-adapter'; import { NextAuthOptions } from 'next-auth'; import GoogleProvider from 'next-auth/providers/google'; -import { WelcomeEmail, sendEmail } from '@ab/emails'; -import { dataSourceOptions } from '@ab/graphql-api/data-source'; -import * as entities from '@ab/graphql-api/entity/auth'; -import { UserRole } from '@ab/graphql-api/types'; +import { WelcomeEmail, sendEmail } from '@alp/emails'; +import { dataSourceOptions } from '@alp/graphql-api/data-source'; +import * as entities from '@alp/graphql-api/entity/auth'; +import { UserRole } from '@alp/graphql-api/types'; export const authOptions: NextAuthOptions = { // @ts-ignore diff --git a/apps/app/src/graphql/crud.graphql.ts b/apps/app/src/graphql/crud.graphql.ts index 2c4c76e..e649866 100644 --- a/apps/app/src/graphql/crud.graphql.ts +++ b/apps/app/src/graphql/crud.graphql.ts @@ -1,4 +1,4 @@ -import { gql } from '@ab/api-client'; +import { gql } from '@alp/api-client'; export const addCRUDItemMutation = gql(/* GraphQL */ ` mutation AddCrudItem($newCrudItemData: AddCRUDItemInput!) { diff --git a/apps/app/src/hooks/useUserRole/__tests__/useUserRole.spec.tsx b/apps/app/src/hooks/useUserRole/__tests__/useUserRole.spec.tsx index 7167835..e8443bf 100644 --- a/apps/app/src/hooks/useUserRole/__tests__/useUserRole.spec.tsx +++ b/apps/app/src/hooks/useUserRole/__tests__/useUserRole.spec.tsx @@ -1,4 +1,4 @@ -import { UserRole } from '@ab/graphql-api/types'; +import { UserRole } from '@alp/graphql-api/types'; import { useUserRole } from '../'; import { sessionProviderFactory } from '../../../tests/factories/sessionProviderFactory'; diff --git a/apps/app/src/middleware.ts b/apps/app/src/middleware.ts index dd35957..734c3c7 100644 --- a/apps/app/src/middleware.ts +++ b/apps/app/src/middleware.ts @@ -2,7 +2,7 @@ import { withAuth } from 'next-auth/middleware'; import { NextResponse } from 'next/server'; import type { NextRequest } from 'next/server'; -import { i18n } from '@ab/core/config/i18n'; +import { i18n } from '@alp/core/config/i18n'; const privatePages = ['/app/:path*', '/admin/:path*']; diff --git a/apps/app/src/providers/appProviders/appProviders.component.tsx b/apps/app/src/providers/appProviders/appProviders.component.tsx index e6c9556..b83d6ea 100644 --- a/apps/app/src/providers/appProviders/appProviders.component.tsx +++ b/apps/app/src/providers/appProviders/appProviders.component.tsx @@ -6,10 +6,10 @@ import { Session } from 'next-auth'; import { SessionProvider } from 'next-auth/react'; import { ReactNode } from 'react'; -import { MakeClientOpts } from '@ab/api-client/client'; -import { ApolloProvider } from '@ab/api-client/providers'; -import { Locale } from '@ab/core/config/i18n'; -import { IntlProvider, LocalesProvider, MantineProvider } from '@ab/core/providers'; +import { MakeClientOpts } from '@alp/api-client/client'; +import { ApolloProvider } from '@alp/api-client/providers'; +import { Locale } from '@alp/core/config/i18n'; +import { IntlProvider, LocalesProvider, MantineProvider } from '@alp/core/providers'; interface AppProvidersProps { children: ReactNode; diff --git a/apps/app/src/tests/factories/crudItem.ts b/apps/app/src/tests/factories/crudItem.ts index 2e2e915..d91a397 100644 --- a/apps/app/src/tests/factories/crudItem.ts +++ b/apps/app/src/tests/factories/crudItem.ts @@ -1,12 +1,12 @@ import { times } from 'ramda'; -import { AddCrudItemMutation, CrudItem, UpdateCrudItemMutation } from '@ab/api-client'; +import { AddCrudItemMutation, CrudItem, UpdateCrudItemMutation } from '@alp/api-client'; import { composeMockedListQueryResult, composeMockedQueryResult, createDeepFactory, makeId, -} from '@ab/api-client/tests/utils'; +} from '@alp/api-client/tests/utils'; import { addCRUDItemMutation, allCrudItemsQuery, detailsCrudItemQuery, updateCRUDItemMutation } from '@app/graphql'; diff --git a/apps/app/src/tests/factories/sessionProviderFactory.ts b/apps/app/src/tests/factories/sessionProviderFactory.ts index 28640ce..cc4b522 100644 --- a/apps/app/src/tests/factories/sessionProviderFactory.ts +++ b/apps/app/src/tests/factories/sessionProviderFactory.ts @@ -1,5 +1,5 @@ -import { User, authSessionFactory } from '@ab/graphql-api/tests/factories/authSession.factory'; -import { UserRole } from '@ab/graphql-api/types'; +import { User, authSessionFactory } from '@alp/graphql-api/tests/factories/authSession.factory'; +import { UserRole } from '@alp/graphql-api/types'; import { AppTestProvidersProps } from '@app/tests/utils/rendering'; diff --git a/apps/app/src/tests/setupTests.ts b/apps/app/src/tests/setupTests.ts index ff4c051..d961ac6 100644 --- a/apps/app/src/tests/setupTests.ts +++ b/apps/app/src/tests/setupTests.ts @@ -1,3 +1,3 @@ import '@testing-library/jest-dom'; -import '@ab/api-client/tests/setupTests'; +import '@alp/api-client/tests/setupTests'; diff --git a/apps/app/src/tests/utils/rendering.tsx b/apps/app/src/tests/utils/rendering.tsx index b6bae82..272cc0f 100644 --- a/apps/app/src/tests/utils/rendering.tsx +++ b/apps/app/src/tests/utils/rendering.tsx @@ -5,12 +5,12 @@ import { SessionContext, SessionContextValue } from 'next-auth/react'; import { ComponentClass, ComponentType, FC, PropsWithChildren, ReactElement, ReactNode, Suspense } from 'react'; import { IntlProvider } from 'react-intl'; -import * as apiUtils from '@ab/api-client/tests/utils/rendering'; -import { DEFAULT_LOCALE, Locale, TranslationMessages, translationMessages } from '@ab/core/config/i18n'; +import * as apiUtils from '@alp/api-client/tests/utils/rendering'; +import { DEFAULT_LOCALE, Locale, TranslationMessages, translationMessages } from '@alp/core/config/i18n'; import { AppRouterContextProviderMock, AppRouterContextProviderMockProps } from '../providers'; -export { PLACEHOLDER_TEST_ID, PLACEHOLDER_CONTENT } from '@ab/core/tests/utils/rendering'; +export { PLACEHOLDER_TEST_ID, PLACEHOLDER_CONTENT } from '@alp/core/tests/utils/rendering'; export type AppTestProvidersProps = PropsWithChildren<{ sessionProviderProps?: Pick & { diff --git a/apps/app/src/types/next-auth.d.ts b/apps/app/src/types/next-auth.d.ts index 40271a4..dee9f13 100644 --- a/apps/app/src/types/next-auth.d.ts +++ b/apps/app/src/types/next-auth.d.ts @@ -1,6 +1,6 @@ import { DefaultSession } from 'next-auth'; -import { UserRole } from '@ab/graphql-api'; +import { UserRole } from '@alp/graphql-api'; declare module 'next-auth' { /** diff --git a/nx.json b/nx.json index 7377f73..3743083 100644 --- a/nx.json +++ b/nx.json @@ -3,7 +3,7 @@ "npmScope": "ab", "tasksRunnerOptions": { "default": { - "runner": "@ab/internal-core/custom-task-runner", + "runner": "@alp/internal-core/custom-task-runner", "options": { "cacheableOperations": ["setup", "lint", "test", "build-storybook"] } diff --git a/package.json b/package.json index 1d26d2e..7886ca1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "rnd-app-boilerplate", + "name": "alpack", "version": "0.1.0", "description": "", "main": "index.js", @@ -10,7 +10,7 @@ "author": "", "license": "ISC", "devDependencies": { - "@ab/internal-core": "*", + "@alp/internal-core": "*", "@faker-js/faker": "^8.0.2", "@nx/devkit": "^16.9.1", "@nx/eslint-plugin": "^16.9.1", diff --git a/packages/api-client/.prettierrc b/packages/api-client/.prettierrc index bff534f..768887e 100644 --- a/packages/api-client/.prettierrc +++ b/packages/api-client/.prettierrc @@ -6,7 +6,7 @@ "importOrder": [ "^(path|dns|fs)/?", "", - "@ab", + "@alp", "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", "^[./]" ], diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 2133264..81ad89c 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -1,5 +1,5 @@ { - "name": "@ab/api-client", + "name": "@alp/api-client", "type": "commonjs", "version": "0.1.0", "description": "", diff --git a/packages/api-client/src/tests/utils/factoryCreators.ts b/packages/api-client/src/tests/utils/factoryCreators.ts index f364b17..7d5be59 100644 --- a/packages/api-client/src/tests/utils/factoryCreators.ts +++ b/packages/api-client/src/tests/utils/factoryCreators.ts @@ -1,7 +1,7 @@ import { Faker, faker } from '@faker-js/faker'; import { mergeDeepRight } from 'ramda'; -import { DeepPartial } from '@ab/core/utils/types'; +import { DeepPartial } from '@alp/core/utils/types'; export const createFactory = (creator: () => T) => diff --git a/packages/api-client/src/tests/utils/rendering.tsx b/packages/api-client/src/tests/utils/rendering.tsx index 170f595..bfbd6d7 100644 --- a/packages/api-client/src/tests/utils/rendering.tsx +++ b/packages/api-client/src/tests/utils/rendering.tsx @@ -4,8 +4,8 @@ import { Queries, queries } from '@testing-library/dom'; import { RenderOptions, RenderResult, render, renderHook, waitFor } from '@testing-library/react'; import { ComponentClass, ComponentType, FC, PropsWithChildren, ReactElement } from 'react'; -import * as coreUtils from '@ab/core/tests/utils/rendering'; -import { CoreTestProviders, CoreTestProvidersProps } from '@ab/core/tests/utils/rendering'; +import * as coreUtils from '@alp/core/tests/utils/rendering'; +import { CoreTestProviders, CoreTestProvidersProps } from '@alp/core/tests/utils/rendering'; /** * A set of properties that will be passed to Apollo's diff --git a/packages/core/.prettierrc b/packages/core/.prettierrc index bff534f..768887e 100644 --- a/packages/core/.prettierrc +++ b/packages/core/.prettierrc @@ -6,7 +6,7 @@ "importOrder": [ "^(path|dns|fs)/?", "", - "@ab", + "@alp", "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", "^[./]" ], diff --git a/packages/core/package.json b/packages/core/package.json index 9f718a4..cd93f41 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "@ab/core", + "name": "@alp/core", "version": "0.1.0", "description": "", "scripts": { diff --git a/packages/core/project.json b/packages/core/project.json new file mode 100644 index 0000000..c83e0bd --- /dev/null +++ b/packages/core/project.json @@ -0,0 +1,8 @@ +{ + "name": "core", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/core/src", + "projectType": "library", + "targets": {}, + "tags": [] +} diff --git a/packages/core/src/providers/intlProvider/intlProvider.component.tsx b/packages/core/src/providers/intlProvider/intlProvider.component.tsx index 34f04f1..058ff2d 100644 --- a/packages/core/src/providers/intlProvider/intlProvider.component.tsx +++ b/packages/core/src/providers/intlProvider/intlProvider.component.tsx @@ -3,8 +3,8 @@ import { PropsWithChildren, useEffect } from 'react'; import { IntlProvider as Provider } from 'react-intl'; -import { Locale, translationMessages } from '@ab/core/config/i18n'; -import { useLocales } from '@ab/core/hooks'; +import { Locale, translationMessages } from '@alp/core/config/i18n'; +import { useLocales } from '@alp/core/hooks'; export interface IntlProviderProps { lang: Locale; diff --git a/packages/emails/.prettierrc b/packages/emails/.prettierrc index bff534f..768887e 100644 --- a/packages/emails/.prettierrc +++ b/packages/emails/.prettierrc @@ -6,7 +6,7 @@ "importOrder": [ "^(path|dns|fs)/?", "", - "@ab", + "@alp", "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", "^[./]" ], diff --git a/packages/emails/package.json b/packages/emails/package.json index b93fe2e..c496722 100644 --- a/packages/emails/package.json +++ b/packages/emails/package.json @@ -1,5 +1,5 @@ { - "name": "@ab/emails", + "name": "@alp/emails", "version": "0.1.0", "description": "", "scripts": { diff --git a/packages/emails/project.json b/packages/emails/project.json new file mode 100644 index 0000000..f8ef22e --- /dev/null +++ b/packages/emails/project.json @@ -0,0 +1,8 @@ +{ + "name": "emails", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/emails/src", + "projectType": "library", + "targets": {}, + "tags": [] +} diff --git a/packages/graphql-api/.prettierrc b/packages/graphql-api/.prettierrc index bff534f..768887e 100644 --- a/packages/graphql-api/.prettierrc +++ b/packages/graphql-api/.prettierrc @@ -6,7 +6,7 @@ "importOrder": [ "^(path|dns|fs)/?", "", - "@ab", + "@alp", "^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?", "^[./]" ], diff --git a/packages/graphql-api/package.json b/packages/graphql-api/package.json index 6193b5b..0ea3962 100644 --- a/packages/graphql-api/package.json +++ b/packages/graphql-api/package.json @@ -1,5 +1,5 @@ { - "name": "@ab/graphql-api", + "name": "@alp/graphql-api", "type": "commonjs", "version": "0.1.0", "description": "", diff --git a/packages/graphql-api/project.json b/packages/graphql-api/project.json new file mode 100644 index 0000000..e873ebd --- /dev/null +++ b/packages/graphql-api/project.json @@ -0,0 +1,8 @@ +{ + "name": "graphql-api", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/graphql-api/src", + "projectType": "library", + "targets": {}, + "tags": [] +} diff --git a/packages/graphql-api/src/types/next-auth.d.ts b/packages/graphql-api/src/types/next-auth.d.ts index 584cff7..06c7388 100644 --- a/packages/graphql-api/src/types/next-auth.d.ts +++ b/packages/graphql-api/src/types/next-auth.d.ts @@ -1,6 +1,6 @@ import { DefaultSession } from 'next-auth'; -import { UserRole } from '@ab/graphql-api'; +import { UserRole } from '@alp/graphql-api'; declare module 'next-auth' { /** diff --git a/packages/internal/internal-core/package.json b/packages/internal/internal-core/package.json index 2899dd8..2f32b6e 100644 --- a/packages/internal/internal-core/package.json +++ b/packages/internal/internal-core/package.json @@ -1,5 +1,5 @@ { - "name": "@ab/internal-core", + "name": "@alp/internal-core", "version": "0.1.0", "devDependencies": { "dotenv": "^16.3.1", diff --git a/packages/internal/internal-core/project.json b/packages/internal/internal-core/project.json index fe88adc..c5c2118 100644 --- a/packages/internal/internal-core/project.json +++ b/packages/internal/internal-core/project.json @@ -5,7 +5,7 @@ "projectType": "library", "targets": { "setup-env": { - "executor": "@ab/internal-tools:setup", + "executor": "@alp/internal-tools:setup", "options": { "cwd": "./" } diff --git a/packages/internal/internal-tools/package.json b/packages/internal/internal-tools/package.json index 7be39df..e9c8df8 100644 --- a/packages/internal/internal-tools/package.json +++ b/packages/internal/internal-tools/package.json @@ -1,5 +1,5 @@ { - "name": "@ab/internal-tools", + "name": "@alp/internal-tools", "version": "0.1.0", "main": "src/index.js", "executors": "./executors.json", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ae76f5..d7582a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,7 +63,7 @@ importers: specifier: ^3.21.4 version: 3.21.4 devDependencies: - '@ab/internal-core': + '@alp/internal-core': specifier: '*' version: link:packages/internal/internal-core '@faker-js/faker': @@ -231,10 +231,10 @@ importers: apps/app: dependencies: - '@ab/api-client': + '@alp/api-client': specifier: '*' version: link:../../packages/api-client - '@ab/core': + '@alp/core': specifier: '*' version: link:../../packages/core '@as-integrations/next': diff --git a/tsconfig.base.json b/tsconfig.base.json index 3863cec..24c4979 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -20,14 +20,14 @@ "noFallthroughCasesInSwitch": true, "baseUrl": "./", "paths": { - "@ab/api-client": ["packages/api-client/src/index.ts"], - "@ab/api-client/*": ["packages/api-client/src/*"], - "@ab/core/*": ["packages/core/src/*"], - "@ab/internal-tools": ["packages/internal/internal-tools/src/index.ts"], - "@ab/graphql-api": ["packages/graphql-api/src/index.ts"], - "@ab/graphql-api/*": ["packages/graphql-api/src/*"], - "@ab/emails": ["packages/emails/src/index.ts"], - "@ab/emails/*": ["packages/emails/src/*"], + "@alp/api-client": ["packages/api-client/src/index.ts"], + "@alp/api-client/*": ["packages/api-client/src/*"], + "@alp/core/*": ["packages/core/src/*"], + "@alp/internal-tools": ["packages/internal/internal-tools/src/index.ts"], + "@alp/graphql-api": ["packages/graphql-api/src/index.ts"], + "@alp/graphql-api/*": ["packages/graphql-api/src/*"], + "@alp/emails": ["packages/emails/src/index.ts"], + "@alp/emails/*": ["packages/emails/src/*"], "@app/*": ["apps/app/src/*"] } },