Skip to content

Commit 84c4f3c

Browse files
committed
feat: rename apps and libs
1 parent 2386132 commit 84c4f3c

Some content is hidden

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

47 files changed

+65
-69
lines changed
File renamed without changes.
File renamed without changes.

apps/msal-react-demo-e2e/project.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "msal-react-demo-e2e",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "apps/msal-react-demo-e2e/src",
5+
"tags": [],
6+
"implicitDependencies": ["msal-react-demo"],
7+
"// targets": "to see all targets run: nx show project msal-react-demo-e2e --web",
8+
"targets": {}
9+
}
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 numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* eslint-disable */
22
export default {
3-
displayName: 'my-app',
3+
displayName: 'msal-react-demo',
44
preset: '../../jest.preset.js',
55
transform: {
66
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',
77
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/next/babel'] }],
88
},
99
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
10-
coverageDirectory: '../../coverage/apps/my-app',
10+
coverageDirectory: '../../coverage/apps/msal-react-demo',
1111
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "msal-react",
2+
"name": "msal-react-demo",
33
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4-
"sourceRoot": "libs/msal-react/src",
5-
"projectType": "library",
4+
"sourceRoot": "apps/msal-react-demo",
5+
"projectType": "application",
66
"tags": [],
7-
"// targets": "to see all targets run: nx show project msal-react --web",
7+
"// targets": "to see all targets run: nx show project msal-react-demo --web",
88
"targets": {}
99
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AppProps } from 'next/app';
2-
import { MsalProviderComponent } from '@myorg/msal-react';
2+
import { MsalProviderComponent } from '@my-workspace/lib-msal-react';
33

44
function MyApp({ Component, pageProps }: AppProps) {
55
return (
@@ -9,4 +9,4 @@ function MyApp({ Component, pageProps }: AppProps) {
99
);
1010
}
1111

12-
export default MyApp;
12+
export default MyApp;

apps/my-app/src/app/auth/page.ts apps/msal-react-demo/src/app/auth/page.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
'use client'
1+
'use client';
22

3-
import { useEffect } from "react";
4-
import { useMsal } from "@azure/msal-react";
3+
import { useEffect } from 'react';
4+
import { useMsal } from '@azure/msal-react';
55

66
export default function AuthPage() {
77
const { instance } = useMsal();
@@ -14,4 +14,4 @@ export default function AuthPage() {
1414
}, [instance]);
1515

1616
return null;
17-
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
'use client'
1+
'use client';
22

33
import 'tailwindcss/tailwind.css';
4-
import { MsalProviderComponent } from '@myorg/msal-react';
5-
import { Metadata } from 'next'
6-
4+
import { MsalProviderComponent } from '@my-workspace/lib-msal-react';
5+
import { Metadata } from 'next';
6+
77
// export const metadata: Metadata = {
88
// title: 'Home',
99
// description: 'Welcome to Next.js',
@@ -18,12 +18,9 @@ export default function RootLayout({
1818
<html lang="en">
1919
<body>
2020
<MsalProviderComponent>
21-
<div id="layout-children">
22-
{children}
23-
</div>
21+
<div id="layout-children">{children}</div>
2422
</MsalProviderComponent>
2523
</body>
2624
</html>
27-
2825
);
29-
}
26+
}

apps/my-app/src/app/page.tsx apps/msal-react-demo/src/app/page.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
'use client'
1+
'use client';
22

33
import React from 'react';
4-
import { ButtonLogin, ButtonLogout } from '@myorg/msal-react';
5-
import { AuthenticatedTemplate, UnauthenticatedTemplate } from '@azure/msal-react';
4+
import { ButtonLogin, ButtonLogout } from '@my-workspace/lib-msal-react';
5+
import {
6+
AuthenticatedTemplate,
7+
UnauthenticatedTemplate,
8+
} from '@azure/msal-react';
69

710
export default function Page() {
811
return (

apps/my-app/tailwind.config.js apps/msal-react-demo/tailwind.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
content: [
77
join(
88
__dirname,
9-
'{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}'
9+
'{src,pages,components,app}/**/*!(*.stories|*.spec).{ts,tsx,html}',
1010
),
1111
...createGlobPatternsForDependencies(__dirname),
1212
],

apps/my-app/tsconfig.json apps/msal-react-demo/tsconfig.json

+2-10
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
"name": "next"
1717
}
1818
],
19-
"types": [
20-
"jest",
21-
"node"
22-
]
19+
"types": ["jest", "node"]
2320
},
2421
"include": [
2522
"**/*.ts",
@@ -31,10 +28,5 @@
3128
"next-env.d.ts",
3229
".next/types/**/*.ts"
3330
],
34-
"exclude": [
35-
"node_modules",
36-
"jest.config.ts",
37-
"**/*.spec.ts",
38-
"**/*.test.ts"
39-
]
31+
"exclude": ["node_modules", "jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]
4032
}
File renamed without changes.

apps/my-app-e2e/project.json

-9
This file was deleted.

apps/my-app/project.json

-9
This file was deleted.
File renamed without changes.
File renamed without changes.

libs/lib-msal-react/README.md

+7

libs/lib-msal-react/project.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "lib-msal-react",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/lib-msal-react/src",
5+
"projectType": "library",
6+
"tags": [],
7+
"// targets": "to see all targets run: nx show project lib-msal-react --web",
8+
"targets": {}
9+
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from './lib/msal-react';
22
export * from './lib/button-login/button-login';
3-
export * from './lib/button-logout/button-logout';
3+
export * from './lib/button-logout/button-logout';
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use client'
1+
'use client';
22

33
import React from 'react';
44
import { Configuration, PublicClientApplication } from '@azure/msal-browser';
@@ -7,24 +7,28 @@ import { MsalProvider } from '@azure/msal-react';
77
// Define your MSAL configuration
88
const msalConfig: Configuration = {
99
auth: {
10-
clientId: process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID || "",
10+
clientId: process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID || '',
1111
authority: `https://login.microsoftonline.com/${process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID}`,
1212
redirectUri: process.env.NEXT_PUBLIC_REDIRECT_URI,
1313
},
1414
cache: {
15-
cacheLocation: "sessionStorage",
16-
storeAuthStateInCookie: typeof window !== "undefined" && window.navigator.userAgent.indexOf("MSIE") > -1,
15+
cacheLocation: 'sessionStorage',
16+
storeAuthStateInCookie:
17+
typeof window !== 'undefined' &&
18+
window.navigator.userAgent.indexOf('MSIE') > -1,
1719
},
1820
};
1921

2022
// Initialize MSAL instance with your configuration
2123
const msalInstance = new PublicClientApplication(msalConfig);
2224

2325
// Create a component to provide MSAL functionalities
24-
export const MsalProviderComponent: React.FC<{ children: React.ReactNode }> = ({ children }) => {
26+
export const MsalProviderComponent: React.FC<{ children: React.ReactNode }> = ({
27+
children,
28+
}) => {
2529
return (
2630
<div id="msal-provider">
2731
<MsalProvider instance={msalInstance}>{children}</MsalProvider>;
2832
</div>
29-
)
33+
);
3034
};
File renamed without changes.
File renamed without changes.

libs/msal-react/README.md

-7
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"license": "MIT",
55
"scripts": {
6-
"start": "npx nx dev my-app"
6+
"start": "npx nx dev msal-react-demo"
77
},
88
"private": true,
99
"dependencies": {

tsconfig.base.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"skipDefaultLibCheck": true,
1616
"baseUrl": ".",
1717
"paths": {
18-
"@myorg/msal-react": ["libs/msal-react/src/index.ts"]
18+
"@my-workspace/lib-msal-react": ["libs/lib-msal-react/src/index.ts"]
1919
}
2020
},
2121
"exclude": ["node_modules", "tmp"]

0 commit comments

Comments
 (0)