Commit 2bf6477
authored
feat: add support for npm/pnpm workspaces [SIM-130] (#1153)
* feat: add supporting code for workspace detection
* feat: add workspace support
* refactor: remove weird walkUp helper in favor of the lineage helper
* fix: make TypeScript happy
* fix: use basePath relative paths in the generated PW bundle
Otherwise workspace packages/files get included with the wrong path.
* fix: pnpm workspace detection used the wrong command, which did not always work
* fix: make sure PW script paths are resolved to absolute paths
Did not seem to outright breaking anything, but it was wrong and caused
confusion in file lists.
* refactor: make configDefaultGetter more generic so that it can work with other objects
* feat: tie it all together
* feat: make it optionally possible to skip bundle cleanup (allows inspection)
Also introduces some debug logs so that you can know what the path is.
* feat: add debug logging to jiti and ts-node loaders
* feat: enable tsx in the jiti loader
* feat: allow dependency collection from JSX files
* fix: jsx must only be enabled when the extension matches
Otherwise type brackets can cause errors.
* chore: fix most unit tests by using fixtures in isolation
* chore: add a workspace fixture to help debug pnpm related issues
* fix: generate a placeholder package.json for unused deps needed during installation
* feat: use the new workingDir for playwright checks
* feat: add a new internal command that outputs the project structure
This is meant to be used in tests which currently suffer from huge import
resolution conflicts. Instead of letting fixtures and test code attempt to
import the same files (and failing to do so), we should just pack the CLI
and let it output the project structure. This makes it possible to test
project parsing in real world scenarios, since even the devdeps of the CLI
will not be resolvable (which so far has prevented things like proper
testing for the file loaders).
In order to make project parsing work without authentication, the PW code
bundle upload was separated into a different bundle. Both the deploy and test
commands were updated to support this. As a result they are now able to report
more accurate status since the upload is separate from bundling, and the
new project parsing command doesn't need authentication.
TODO: Local code bundles are no longer getting cleaned up (deleted) after
they have been uploaded. This needs fixing.
* fix: resolve a circular dependency between util and api which suddenly became an issue
The proxy utility is now in a separate file which gets rid of the circular dep.
There may be more but for now this fixes the issue.
* fix: workspace package file search must be limited to workspace root
Files above the workspace root are not bundleable.
* fix: if we find a workspace but we don't belong to it, discard it
It's not relevant and it messes up paths.
* chore: improve debug message
* fix(tests): redo most test suites so that they run the CLI in isolation
Instead of relying on memory and dependencies being shared between the CLI and
test fixtures, which leads to various issues, we add new debug commands to the
CLI that allow us to inspect the state of a fixture or file. We inspect
the output of the command instead of relying on shared memory.
Various changes were required to make this work.
* chore: use more recent pnpm in workspace fixture, no reason other than to keep it fresh
* fix(tests): forgot to increase timeouts for some tests
* fix: pw-test must also store pw check bundles (mistakenly only added to deploy, test)
* fix(tests): slightly refactor the fixture sandbox in a way that makes pw-test e2e tests work
* fix(tests): only run e2e tests once, don't watch since it needs the packed archive
* fix(tests): update deploy e2e tests
* fix(tests): fix test command e2e tests
* fix(tests): only try to destroy fixture if we managed to create it
* fix(tests): add huge timeouts to anything involving fixture installation
* chore(workflows): attempt to make windows tests actually finish by using a larger runner
* chore(tests): substantially increase timeouts for things that may run npm install
* chore(tests): adjust timeouts
* fix(tests): wrong fixture folder name
* fix(tests): fix paths for windows
* fix(tests): attempt to fix windows tests
* fix(tests): properly isolate pw-test --create-check tests
* fix(tests): increase trigger test timeout1 parent 6804373 commit 2bf6477
241 files changed
Lines changed: 9359 additions & 2113 deletions
File tree
- .github/workflows
- packages/cli
- assets/runtimes/snapshots/20260130
- e2e/__tests__
- fixtures
- deploy-esm-project
- deploy-project
- empty-project
- esm-module
- retry-project
- snapshot-project-missing-snapshots
- snapshot-project
- test-duplicated-groups
- test-only-project
- test-parse-error
- test-project
- test-pwt-native
- workspace-basic-pnpm
- packages
- a
- tests
- b
- c
- src
- auth
- commands
- debug
- import
- constructs
- __tests__
- fixtures
- api-check
- test-cases
- test-check-defaults
- test-group-mapping
- test-groupId-mapping
- test-invalid-runtime
- test-retryStrategy-onlyOn
- test-runtime
- test-script-dependencies
- browser-check
- test-cases
- test-browser-check-defaults-playwright-config
- test-browser-check-defaults
- test-check-defaults-playwright-config
- test-check-defaults
- test-code-dependencies
- test-group-mapping
- test-groupId-mapping
- test-invalid-runtime
- test-runtime
- playwright-check-webserver
- playwright-check
- test-cases
- test-bundling
- fixtures
- tests
- test-doubleCheck-default-ignored
- test-doubleCheck-not-allowed
- test-group-mapping
- test-groupId-mapping
- test-groupName-mapping
- test-groupName-not-found
- test-groupName-with-group-conflict
- test-groupName-with-groupId-conflict
- test-headless-false-in-project-not-allowed
- test-headless-false-not-allowed
- test-headless-true-allowed
- test-headless-unset-allowed
- test-installCommand-allowed
- test-installCommand-unnecessary-playwright-install-warn
- test-retryStrategy-default-ignored
- test-retryStrategy-not-allowed
- test-testCommand-allowed
- test-testCommand-unnecessary-playwright-install-warn
- test-webServer
- internal/codegen
- loader
- rest
- runtimes
- services
- __tests__
- fixtures/playwright-bundle-test
- node_modules/@internal/test-helpers
- check-parser
- __tests__
- check-parser-fixtures
- playwright-project-snapshots
- playwright-project
- workspace-example
- packages
- bar
- src
- __checks__/api-check-1
- lib
- baz
- src
- lib
- foo
- src
- lib
- package-files
- testing
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments