31 Commits

Author SHA1 Message Date
Colum Ferry
320d9f223f
fix(testing): application generators should accurately configure e2e projects (#27453)
- feat(devkit): add util for determining the e2e web server info
- feat(vite): add util for determining the e2e web server info
- feat(webpack): add util for determining the e2e web server info
- fix(webpack): allow port override
- fix(devkit): e2e web server info util should handle target defaults
- feat(webpack): export the e2e web server info utils
- fix(vite): rename util
- fix(devkit): util should determine the devTarget for cypress
- fix(react): improve accuracy of e2e project generation

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
The logic for finding the correct targets and web addresses to use when
setting up e2e projects is flawed and missing some key considerations.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
The logic is accurate and usage is simplified across plugins 

Projects:
- [x] Angular
- [x] Expo
- [x] Next
- [x] Nuxt
- [x] Vue
- [x] Web
- [x] Remix
- [x] React
- [x] React Native


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-27 10:00:43 -04:00
Colum Ferry
1dcfbeeeee
feat(testing): e2e-ci should use serve-static or vite preview for playwright and cypress (#27240)
- fix(vite): preview should dependOn build
- fix(react): playwright should use vite preview
- fix(vue): playwright should use vite preview
- fix(web): playwright should use vite preview
- chore(testing): add e2e test

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->
Currently, `playwright` uses the `vite serve` command when setting up
the web server to run the e2e tests against.

The `vite preview` command/target should also depend on `vite build`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
`playwright` should use the `vite preview` command when setting up the
web server

`vite preview` targets add a `dependsOn["build"]`

Ensure `serve-static` has a dependsOn: ['build']

Cypress should use the `ciBaseUrl` if it exists when running the
`e2e-ci` targets

Migrations for Playwright and Cypress to use serve-static and preview
correctly

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-08-02 11:56:07 -04:00
Nicholas Cunningham
2e630568eb
fix(react): respect unitTestRunner passed to the generator (#23383)
closes: #22276
2024-05-16 14:59:57 -06:00
Colum Ferry
739e2e7115
feat(testing): make playwright default e2e test runner option (#22511) 2024-04-23 11:27:09 -04:00
Colum Ferry
7f00927655
fix(testing): app generators should create correct e2e config at generation time (#22565) 2024-04-03 16:51:03 +01:00
Craigory Coppola
a89c73483e
feat(core): use flag in nx.json for toggling crystal (#21980) 2024-02-29 15:18:46 -05:00
Colum Ferry
3b384c78ac
feat(react): add tailwind as style prompt option for app gen (#21784) 2024-02-14 17:51:37 +00:00
Jason Jean
396ffc4636
feat(core): enable project crystal by default (#21403)
Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Emily Xiong <xiongemi@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-02-02 03:40:59 -05:00
Katerina Skroumpelou
3df85295a1
fix(react): respect unitTestRunner none and inform about vitest (#19676) 2023-10-18 16:29:29 -04:00
Jack Hsu
8826a7737d
feat(react): remove stylus option from generators (#19441) 2023-10-12 12:49:45 -04:00
Leosvel Pérez Espinosa
b3a0c0efed
fix(misc): fix normalizing e2e project name and root (#18757) 2023-08-22 15:33:41 +01:00
Leosvel Pérez Espinosa
eb9caa1ade
feat(react): use helper to determine project name and root directory in project generators (#18615) 2023-08-18 13:12:23 -04:00
Emily Xiong
24b1ab5463
feat(react): add playwright to e2eTestRunner option (#18200) 2023-08-03 17:16:35 +02:00
Nicholas Cunningham
539ed5f49e
fix(react): fix windows style paths when generating with --directory (#16961) 2023-05-11 15:07:01 -06:00
Jason Jean
2d195007b0
feat(core): switch packages to use the @nx scope (#16069) 2023-04-14 19:56:37 -04:00
Dirko Odendaal
ee909cf7a5
feat(misc): conditionally allow starter template inclusion (#14268)
Co-authored-by: Colum Ferry <cferry09@gmail.com>
2023-01-27 15:07:07 +00:00
Victor Savkin
fe062f42c3 fix(core): deduce layout directory 2022-11-29 16:08:57 -05:00
Jack Hsu
6c59cbbb3b
feat(react): add SSR suppoprt to host generator for module federation (#13416) 2022-11-29 14:49:15 -05:00
Emily Xiong
662f5413be
feat(react): add minimal flag (#13446) 2022-11-28 13:29:23 -05:00
Katerina Skroumpelou
871f6183d7
fix(bundling): if bundler is vite unitTestRunner is vitest (#13436) 2022-11-28 14:26:15 +02:00
Jack Hsu
a63a25d2e2
feat(react): add Vite bundler option for buildable libraries (#13382) 2022-11-25 20:25:37 +00:00
Jonathan Cammisuli
02e22de7ed
feat(testing): add vitest generators (#13301) 2022-11-23 10:00:29 -05:00
Jason Jean
1b85e20c78
fix(react): set bundler for preset app (#13338) 2022-11-22 21:42:30 +00:00
Victor Savkin
c4ebef2803 feat(react): add a preset to generate a workspace with a single app at the root 2022-11-12 17:17:58 -05:00
Jack Hsu
7913f31cff
fix(react): use normalized app name in host/remote generators (#9909) 2022-04-21 02:54:39 +00:00
Jack Hsu
70985b1052
feat(react): update MFE config and routes when adding remote to host (#9687) 2022-04-05 13:50:43 -04:00
Nicholas Cunningham
12f0f195d2
feat(react): add support for MFEs (#9413)
* feat(react): Add MFE  Generator for Host and Remote Apps
Host generator will be able use the mfe-remote generator when remotes are passed into the CLI for the mfe-host command

* docs(react): React Documentation Update

Co-authored-by: Nicholas Cunningham <nico@Nicholass-MacBook-Pro.local>
Co-authored-by: Nicholas Cunningham <ndcunningham>
2022-04-04 15:44:18 -04:00
Philip Fulcher
5e66babcee
fix(react): enforce valid jest config when creating workspace with react preset (#8626)
ISSUES CLOSED: #8354
2022-01-21 14:25:15 -07:00
Noriyuki Shinpuku
cdb4cdc196
fix(react): fix application template for strict mode (#5552) 2021-05-14 12:00:13 -04:00
Jonathan Cammisuli
871b3c8f35
fix(react): set defaults properly for unitTestRunner and e2eTestRunner (#4781)
Also sets the schema.json files to be nx
2021-02-12 15:46:52 +00:00
Jonathan Cammisuli
d9aef75bd5
chore(react): move react schematics to generators (#4745)
* chore(react): move react schematics to generators

* chore(react): update lib generators

* chore(react): update redux generators

* chore(react): move react story book generators

* chore(react): add old implementation for update babel in next

* chore(react): rename tsconfig json template files to include __tmpl__

* chore(react): update deps

* chore(react): fix component template file

* chore(react): remove angular-devkit deps

* chore(react): remove angular-devkit deps
2021-02-10 21:30:55 -05:00