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

test: reproduce error with monorepo and ui library #684

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions e2e/fixtures/ui-library/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function LibraryComponent(): JSX.Element;
6 changes: 6 additions & 0 deletions e2e/fixtures/ui-library/index.js
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');
}
19 changes: 19 additions & 0 deletions e2e/fixtures/ui-library/package.json
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-rc-6ebfd5b0-20240818",
"react-dom": "19.0.0-rc-6ebfd5b0-20240818"
},
"devDependencies": {
"@types/react": "18.2.74",
"@types/react-dom": "18.2.24"
}
}
1 change: 1 addition & 0 deletions e2e/fixtures/use-ui-library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Example that uses a UI library in the same monorepo
24 changes: 24 additions & 0 deletions e2e/fixtures/use-ui-library/package.json
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-rc-6ebfd5b0-20240818",
"react-dom": "19.0.0-rc-6ebfd5b0-20240818",
"react-server-dom-webpack": "19.0.0-rc-6ebfd5b0-20240818",
"react-textarea-autosize": "8.5.3",
"waku": "workspace:*",
"ui-library": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.4"
}
}
11 changes: 11 additions & 0 deletions e2e/fixtures/use-ui-library/src/pages/index.tsx
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',
};
}
17 changes: 17 additions & 0 deletions e2e/fixtures/use-ui-library/tsconfig.json
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"
}
}
25 changes: 25 additions & 0 deletions e2e/use-ui-library.spec.ts
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 () => {
execSync(`node ${waku} build`, { cwd });
});
});
62 changes: 62 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading