-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
chore: migrate @web
to @playwright/web
#34013
Conversation
7615d87
to
84838d6
Compare
This comment has been minimized.
This comment has been minimized.
84838d6
to
fc1e986
Compare
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"4 flaky37292 passed, 650 skipped Merge workflow run. |
@web
to @playwright/web
@@ -1,6 +1,6 @@ | |||
[*] | |||
@playwright/experimental-ct-react | |||
@web/** | |||
@playwright/web/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@playwright/web/** | |
@playwright/web |
@@ -19,7 +19,7 @@ import './chip.css'; | |||
import './colors.css'; | |||
import './common.css'; | |||
import * as icons from './icons'; | |||
import { clsx } from '@web/uiUtils'; | |||
import { clsx } from '@playwright/web/src/uiUtils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In playwright
we import stuff from playwright-core
differently:
import { formatCallLog } from 'playwright-core/lib/utils';
Similarly, @playwright/experimental-ct-core
imports from @playwright/test
differently:
import { Watcher } from 'playwright/lib/fsWatcher';
Why is this one different?
if (packages.has(package)) | ||
importPath = packages.get(package) + tokens.slice(1).join('/'); | ||
if (packages.has(`@${tokens[0]}/${tokens[1]}`)) { | ||
// Namespaced package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "namespaced" mean here?
importPath = packages.get(package) + tokens.slice(1).join('/'); | ||
if (packages.has(`@${tokens[0]}/${tokens[1]}`)) { | ||
// Namespaced package. | ||
importPath = packages.get(`@${tokens[0]}/${tokens[1]}`) + tokens.slice(2).join('/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this different from other packages, e.g. playwright-core
? I'd leave importPath
undefined and go the line 162 old code instead.
@@ -192,8 +202,9 @@ async function innerCheckDeps(root) { | |||
} | |||
if (line === '***') | |||
group.push('***'); | |||
else if (line.startsWith('@')) | |||
group.push(line.replace(/@([\w-]+)\/(.*)/, (_, arg1, arg2) => packages.get(arg1) + arg2)); | |||
else if (line.startsWith('@')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I don't really get this change.
- styling is off 😄
@@ -14,7 +14,7 @@ | |||
* limitations under the License. | |||
*/ | |||
|
|||
import { ansi2html } from '@web/ansi2html'; | |||
import { ansi2html } from '../ansi2html'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great fixes in packages/web
!
This is the first iteration on an attempt to get rid of local tsconfig package aliases in order to simplify the imports. It uses the more common package name imports what NPM workspaces offer out of the box. This also helps us to adopt tsconfig package references (not decided yet) and makes the boundaries clearer between the packages.
The next iterations would be to do something similar for:
@html-reporter
-> rename to@playwright/html-reporter
@protocol
-> rename to@playwright/protocol
@recorder
-> rename to@playwright/recorder
@trace
-> rename to@playwright/trace