-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: reproduce error with monorepo and ui library
- Loading branch information
Showing
9 changed files
with
152 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export function LibraryComponent(): JSX.Element; |
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,6 @@ | ||
'use client'; | ||
import { createElement } from 'react'; | ||
|
||
export function LibraryComponent() { | ||
return createElement('div', null, 'Library component'); | ||
} |
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,19 @@ | ||
{ | ||
"name": "ui-library", | ||
"version": "1.0.0", | ||
"description": "", | ||
"type": "module", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"peerDependencies": { | ||
"react": "19.0.0-canary-e3ebcd54b-20240405", | ||
"react-dom": "19.0.0-canary-e3ebcd54b-20240405" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "18.2.74", | ||
"@types/react-dom": "18.2.24" | ||
} | ||
} |
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 @@ | ||
# Example that uses a UI library in the same monorepo |
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,24 @@ | ||
{ | ||
"name": "ssr-target-bundle", | ||
"version": "0.1.0", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"dev": "waku dev", | ||
"build": "waku build", | ||
"start": "waku start" | ||
}, | ||
"dependencies": { | ||
"react": "19.0.0-canary-e3ebcd54b-20240405", | ||
"react-dom": "19.0.0-canary-e3ebcd54b-20240405", | ||
"react-server-dom-webpack": "19.0.0-canary-e3ebcd54b-20240405", | ||
"react-textarea-autosize": "8.5.3", | ||
"waku": "workspace:*", | ||
"ui-library": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "18.2.74", | ||
"@types/react-dom": "18.2.24", | ||
"typescript": "5.4.4" | ||
} | ||
} |
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 @@ | ||
import { LibraryComponent } from 'ui-library'; | ||
|
||
export default async function Test() { | ||
return <LibraryComponent />; | ||
} | ||
|
||
export async function getConfig() { | ||
return { | ||
render: 'static', | ||
}; | ||
} |
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 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"strict": true, | ||
"target": "esnext", | ||
"downlevelIteration": true, | ||
"esModuleInterop": true, | ||
"module": "nodenext", | ||
"skipLibCheck": true, | ||
"noUncheckedIndexedAccess": true, | ||
"exactOptionalPropertyTypes": true, | ||
"types": ["react/experimental"], | ||
"jsx": "react-jsx", | ||
"rootDir": "./src", | ||
"outDir": "./dist" | ||
} | ||
} |
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,25 @@ | ||
import { execSync } from 'node:child_process'; | ||
import { fileURLToPath } from 'node:url'; | ||
import { test } from './utils.js'; | ||
import { rm } from 'node:fs/promises'; | ||
|
||
const waku = fileURLToPath( | ||
new URL('../packages/waku/dist/cli.js', import.meta.url), | ||
); | ||
|
||
const cwd = fileURLToPath( | ||
new URL('./fixtures/use-ui-library', import.meta.url), | ||
); | ||
|
||
test.describe(`apps with external ui libraries`, () => { | ||
test.beforeAll('remove cache', async () => { | ||
await rm(`${cwd}/dist`, { | ||
recursive: true, | ||
force: true, | ||
}); | ||
}); | ||
|
||
test('build successfully', async ({ page }) => { | ||
execSync(`node ${waku} build`, { cwd }); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.