Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate test app to app/ directory #1154

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions e2e/browser/test-app/app/layout.tsx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root layout file is required.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default function TestAppLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>
<main>{children}</main>
</body>
</html>
)
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use client';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pages are server components by default. We want this to be a client component because we rely on window.


import React, { useState, useEffect } from "react";
import {
login,
logout,
handleIncomingRedirect,
ISessionInfo,
} from "@inrupt/solid-client-authn-browser";
import Notifications from "../notifications";
import Notifications from "../components/notifications";

const REDIRECT_URL = window.location.href;
const APP_NAME = "Notifications browser-based tests app";
const DEFAULT_ISSUER = "https://login.inrupt.com/";

Expand Down Expand Up @@ -36,7 +37,7 @@ export default function AppContainer() {
// Login will redirect the user away so that they can log in the OIDC issuer,
// and back to the provided redirect URL (which should be controlled by your app).
await login({
redirectUrl: REDIRECT_URL,
redirectUrl: "http://localhost:3001",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a dynamic redirect URL was bad practice.

oidcIssuer: issuer,
clientName: APP_NAME,
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/browser/test-app/next-env.d.ts
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change managed by NextJS

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
195 changes: 103 additions & 92 deletions e2e/browser/test-app/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/browser/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@inrupt/solid-client": "^2.0.0",
"@inrupt/solid-client-authn-browser": "^2.3.0",
"@inrupt/solid-client-notifications": "file:../../../",
"next": "^15.0.4",
"next": "^15.1.1",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
Expand Down
7 changes: 0 additions & 7 deletions e2e/browser/test-app/pages/_app.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions e2e/browser/test-app/pages/index.tsx

This file was deleted.

24 changes: 20 additions & 4 deletions e2e/browser/test-app/tsconfig.json
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes managed by NextJS

Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es2017",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -13,8 +17,20 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"**/*.ts",
"**/*.tsx",
"next-env.d.ts",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Loading