Skip to content

Commit

Permalink
feat: Rename package names from @ab to @alp (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz authored Oct 10, 2023
1 parent 41eafa7 commit 8ae8d01
Show file tree
Hide file tree
Showing 70 changed files with 123 additions and 100 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/app/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"importOrder": [
"^(path|dns|fs)/?",
"<THIRD_PARTY_MODULES>",
"@ab",
"@alp",
"@app",
"^(__generated__|__generated|@types|app|contexts|emails|fonts|images|mocks|modules|routes|shared|tests|theme|translations)/?",
"^[./]"
Expand Down
2 changes: 1 addition & 1 deletion apps/app/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
Expand Down
4 changes: 2 additions & 2 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion apps/app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"implicitDependencies": ["internal-tools"],
"targets": {
"setup": {
"executor": "@ab/internal-tools:setup",
"executor": "@alp/internal-tools:setup",
"options": {
"cwd": "apps/app"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/[id]/crudDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/[id]/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { GenericError } from '@ab/core/components';
import { GenericError } from '@alp/core/components';

export default function ErrorPage() {
return <GenericError />;
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/[id]/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/add/addCrudItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/add/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { GenericError } from '@ab/core/components';
import { GenericError } from '@alp/core/components';

export default function ErrorPage() {
return <GenericError />;
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/add/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/add/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
6 changes: 3 additions & 3 deletions apps/app/src/app/[lang]/app/crud/crudList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { GenericError } from '@ab/core/components';
import { GenericError } from '@alp/core/components';

export default function ErrorPage() {
return <GenericError />;
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/update/[id]/error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { GenericError } from '@ab/core/components';
import { GenericError } from '@alp/core/components';

export default function ErrorPage() {
return <GenericError />;
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/update/[id]/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/crud/update/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/profile/profile.graphql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { gql } from '@ab/api-client';
import { gql } from '@alp/api-client';

export const userProfileQuery = gql(/* GraphQL */ `
query UserProfile {
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/[lang]/app/profile/updateProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/app/api/graphql/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
4 changes: 2 additions & 2 deletions apps/app/src/components/crudItem/crudItem.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
5 changes: 2 additions & 3 deletions apps/app/src/components/crudItem/crudItem.stories.tsx
Original file line number Diff line number Diff line change
@@ -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<typeof CrudItem>;

Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/header/header.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/components/homepage/header/header.stories.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
8 changes: 4 additions & 4 deletions apps/app/src/config/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/graphql/crud.graphql.ts
Original file line number Diff line number Diff line change
@@ -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!) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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*'];

Expand Down
Loading

0 comments on commit 8ae8d01

Please sign in to comment.