-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: try to resolve styled-jsx from next context, not serverHandlerCo…
…ntext (#300) * test: add yarn3 monorepo with pnpm linker smoke test * fix: try to resolve styled-jsx from next context, not serverHandlerContext
- Loading branch information
Showing
13 changed files
with
469 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Page, expect } from '@playwright/test' | ||
import { test, Fixture } from '../utils/create-e2e-fixture.js' | ||
|
||
// those tests have different fixtures and can run in parallel | ||
test.describe.configure({ mode: 'parallel' }) | ||
|
||
async function smokeTest(page: Page, fixture: Fixture) { | ||
const response = await page.goto(fixture.url) | ||
|
||
expect(response?.status()).toBe(200) | ||
|
||
const smokeContent = await page.textContent('[data-testid="smoke"]') | ||
await expect(smokeContent).toBe('SSR: yes') | ||
} | ||
|
||
test('yarn@3 monorepo with pnpm linker', async ({ page, yarnMonorepoWithPnpmLinker }) => { | ||
await smokeTest(page, yarnMonorepoWithPnpmLinker) | ||
}) |
39 changes: 39 additions & 0 deletions
39
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# Dependencies | ||
node_modules | ||
.pnp | ||
.pnp.js | ||
.yarn | ||
|
||
# Local env files | ||
.env | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# Testing | ||
coverage | ||
|
||
# Turbo | ||
.turbo | ||
|
||
# Vercel | ||
.vercel | ||
|
||
# Build Outputs | ||
.next/ | ||
out/ | ||
build | ||
dist | ||
|
||
|
||
# Debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Misc | ||
.DS_Store | ||
*.pem |
1 change: 1 addition & 0 deletions
1
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/.yarnrc.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: pnpm |
10 changes: 10 additions & 0 deletions
10
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/apps/site/next.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
output: 'standalone', | ||
eslint: { | ||
ignoreDuringBuilds: true, | ||
}, | ||
transpilePackages: ['@repo/ui'], | ||
} | ||
|
||
module.exports = nextConfig |
15 changes: 15 additions & 0 deletions
15
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/apps/site/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "@apps/site", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build" | ||
}, | ||
"dependencies": { | ||
"@packages/ui": "*", | ||
"next": "^14.0.3", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/apps/site/pages/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { TestElement } from '@packages/ui/test.jsx' | ||
|
||
export default function Home({ ssr }) { | ||
return ( | ||
<main> | ||
<TestElement testid="smoke">SSR: {ssr ? 'yes' : 'no'}</TestElement> | ||
</main> | ||
) | ||
} | ||
|
||
export const getServerSideProps = async () => { | ||
return { | ||
props: { | ||
ssr: true, | ||
}, | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "yarn-monorepo-with-pnpm-linker", | ||
"private": true, | ||
"scripts": { | ||
"build": "yarn workspace @apps/site build" | ||
}, | ||
"engines": { | ||
"node": ">=18" | ||
}, | ||
"packageManager": "[email protected]", | ||
"workspaces": [ | ||
"apps/*", | ||
"packages/*" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/packages/ui/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@packages/ui", | ||
"version": "0.0.0", | ||
"private": true, | ||
"exports": { | ||
"./test.jsx": "./src/test.jsx" | ||
}, | ||
"devDependencies": { | ||
"react": "^18.2.0" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/smoke-fixtures/yarn-monorepo-with-pnpm-linker/packages/ui/src/test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use client' | ||
|
||
export const TestElement = ({ children, testid }) => { | ||
return <div data-testid={testid}>{children}</div> | ||
} |
Oops, something went wrong.