33 Commits

Author SHA1 Message Date
Jack Hsu
81892b51fd
feat(misc)!: handle v20 deprecations in plugins (#28222)
This PR removes these from v20 since they were deprecated and slated for
removal:

- `executeWebpackDevServerBuilder` export from `@nx/angular/executors`,
users should use `executeDevServerBuilder`
- `withStylus` util from `@nx/next/plugins/with-stylus` since it was
deprecated in v17 and has just throw an error that users need to use
SASS with Next.js

The `getRollupOptions` function from `@nx/react/plugins/bundle-rollup`
has been deprecated as mention previously and slated for removal in v22.
New users are using inferred targets from Rollup, and existing projects
using this module should run `nx g @nx/rollup:convert-to-inferred` or
manually update rollup config to use `withNx` function.

Also, bumped some deprecation for later in v21:

- Remove inline builds from tsc/swc 
- Changes to SVGR to align with Webpack v5 (e.g. `import ReactComponent
from './img.svg?svgr'`)
- Remove `isolatedConfig` from Webpack executor -- requires a migration
that extracts to a standard webpack config just in case (different from
the original one that extracts to `withNx`)

The ESLint TODOs were rescoped to `TODO(eslint)` and we'll look at it in
further flat config work rather than tying it to an Nx release.

<!-- 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 -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #
2024-10-02 15:29:31 -04:00
Jack Hsu
2e621f324c
feat(misc): v19 cleanup for Nx plugins (#23104)
This PR removes deprecated code that's been slated for removal in Nx 19
- mentioned as `TODO(v19)` comments.

## Breaking Changes

- **CNW:** `create-nx-workspace` no longer support `--preset=empty` and
`--preset=core`, use `--preset=apps` and `--preset=npm` respectively.
Deprecated in Nx 15.9.
- **Next.js:** `NX_` environment variables are no longer bundled into
Next.js apps, use `NEXT_PUBLIC` instead. Deprecated in Nx 16.8.
- **Webpack, Storybook, Esbuild:** `NX_` environment variables are no
longer bundled into browser bundles, use `NX_PUBLIC` instead. This
removes the possibility of intentional bundling of `NX_` variables.
Deprecated in Nx 18.
- **Cypress:** `cypressComponentConfiguration` generator removed from
`@nx/cypress`, use `configurationGenerator`instead. Deprecated in Nx
16.8.
- **Cypress:** `cypressProjectGenerator` generator removed from
`@nx/cypress`, use `configurationGenerator` instead. Deprecated in Nx
15.9.
- **Expo:** `withNxWebpack` removed from `@nx/expo`, use [metro
bundler](https://docs.expo.dev/guides/customizing-metro/)
(https://docs.expo.dev/guides/customizing-metro/) in app.json instead.
There is a migration to handle this in Nx 19. Deprecated in Nx 15.8.

## Deferred to v20

- **JS:** `classProperties.loose` option removed from `@nx/js/babel`
preset, use `loose` instead. Deprecated in Nx 17.0.
- **ESLint:** Low priority task to "deviations from
@typescript-eslint/recommended" for our lint rules. @JamesHenry will
look at this later before Nx 20, but it is unimportant.
- **React:** component testing does not work with Project Crystal, and
we need the executor + built-in webpack configs to run CT. Will do a
follow-up on this after Nx 19 release. Related issue:
https://github.com/nrwl/nx/issues/21546
- **Next.js:** `withStylus` removal from `@nx/next`, use SASS instead.
It hasn't worked, but we kept the file to throw an error when used.
Deprecated in Nx 17.0.
- **Next.js**: `@nx/next:component` and `@nx/next:page` generators to
not derive the `components` and `app`/`pages` directory. Use `nx g
@nx/next:component apps/myapp/components/button` instead. Deprecated in
Nx 17.0.
- **Webpack:** `isolatedConfig` option removal from
`@nx/webpack:webpack` executor. There is a migration to handle this in
Nx 19. Deprecated in in Nx 17.2.
- **Angular:** `executeWebpackDevServerBuilder` removal from
`@nx/angular/executors`, use `executeDevServerBuilder` instead.
Deprecated in Nx 17.0.
2024-05-02 13:37:12 -04:00
Jason Jean
bf206e578e
feat(misc): non conflicting init/add flow (#22791) 2024-04-15 16:45:08 -04: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
Craigory Coppola
deb0f1a492
chore(repo): bump deprecation messages to v19 (#21430) 2024-01-30 16:29:05 -05:00
Jack Hsu
f4569efe0a
fix(react): update default webpack config for component testing (#20749) 2023-12-13 15:02:45 -05:00
Jack Hsu
507fe42e4f
feat(webpack): add plugin to automatically configure build and serve targets (#20243) 2023-11-28 13:01:03 -05:00
Eric Renken
e8b6034b6c
feat(nextjs): can set compiler when setting up nxComponentTestingPreset (#19171) 2023-11-03 17:11:42 +02:00
Jack Hsu
8826a7737d
feat(react): remove stylus option from generators (#19441) 2023-10-12 12:49:45 -04:00
Colum Ferry
14643b68b5
feat(react): use TS config files for module federation (#19455) 2023-10-12 11:42:41 -04:00
Craigory Coppola
a18dd48510
chore(react): pass full context to parseTargetString (#19156) 2023-09-20 09:07:21 -04:00
Caleb Ukle
193206ac86
feat(testing): support cypress v13 (#18899) 2023-09-01 11:55:13 -04:00
Ben McCann
38fec9ca77
feat(testing): Vite 5 compatibility for Cypress (#18535) 2023-08-08 14:24:05 -05:00
Caleb Ukle
f3f74068ea
fix(testing): update default webpack config for react CT (#17562) 2023-06-21 11:41:33 -04:00
Colum Ferry
99739179c7
chore(react): remove unnecessary type cast (#17689) 2023-06-20 08:50:42 -05:00
Chris McLeod
be267a7cd9
fix(react): do not require webpackConfig for cypress component testing (#16966)
Co-authored-by: Loïc BERTRAND <loic.bert.marcel@gmail.com>
2023-05-16 21:53:09 +00:00
Caleb Ukle
dfd51634f3
fix(testing): prevent ct and e2e generators overwriting configs (#16651) 2023-05-11 12:19:16 -04:00
Caleb Ukle
ebcc4363d0
fix(testing): fix react CT w/ vite and dependant projects (#16475) 2023-04-28 16:40:04 -04:00
Jason Jean
76dfc62412
feat(web): replace usages of @nrwl with @nx (#16376) 2023-04-19 10:59:41 -04:00
Jason Jean
2d195007b0
feat(core): switch packages to use the @nx scope (#16069) 2023-04-14 19:56:37 -04:00
Jack Hsu
6feb56e014
feat(webpack): remove support for legacy browsers (#14190) (#14257) 2023-01-11 10:13:35 +02:00
Jack Hsu
fcc02d1932
feat(webpack): remove support for legacy browsers (#14190) 2023-01-09 12:15:37 +02:00
Craigory Coppola
285dc39371
feat(core): support targets with colons in the name without quotes (#13938) 2022-12-28 15:18:07 -05:00
Caleb Ukle
663d38bdba
feat(testing): support async webpack config for react component testing (#14037) 2022-12-28 11:17:53 -05:00
Katerina Skroumpelou
1ef01f8ccc
feat(testing): cypress vite (#13474) 2022-12-15 04:28:53 +00:00
Jason Jean
2c819048bc
fix(angular): fix imports into nx from ng-add (#13645) 2022-12-05 21:05:26 +00:00
Caleb Ukle
ddc2dca30d
fix(testing): only target files in src/* directory for component testing (#13604) 2022-12-05 10:10:45 -05:00
Dan Roujinsky
3e2b8d987f
fix(react): fix path to CT tsconfig (#13177) 2022-12-02 15:43:57 -06:00
Caleb Ukle
73fd49aab3
fix(testing): use webpack defined in executor options for react ct (#12005)
* fix(testing): resolve custom webpacks for react ct

* chore(testing): add more complex react ct e2e tests

* chore(testing): lower ct test timeout to prevent CI stalling when error
2022-09-14 10:58:01 -05:00
Jack Hsu
f49769a34a
feat(webpack): add webpack plugin (#11966) 2022-09-12 21:19:50 +01:00
Caleb Ukle
a0904a601b
feat(testing): support angular cypress component testing (#11790)
* feat(testing): ng cypress component testing

closes: #11602

* chore(testing): move story utils into common util area

* feat(testing): add options for ng component testing

* docs(testing): add more info for component testing

* chore(testing): address PR feedback

* chore(testing): remove logs
2022-09-07 13:32:19 +00:00
Caleb Ukle
c7249db386
fix(testing): handle more complex projects for react component testing (#11725)
* fix(testing): use @nrwl/web:webpack utils to generate a more robust webpack config

fixes: #11372

* fix(testing): do not overwrite existing component test

* fix(testing): add component-test to cacheable operations

* chore(testing): address pr feedback
2022-08-30 16:42:42 +00:00
Caleb Ukle
8154191eb1
feat(testing): Cypress 10 and component testing support (#9201)
* feat(testing): add generator to aid in the migration to cypress 10

cypress 10 introduces a new configuration format and new layout that requires update settings and
files for e2e projects

* feat(testing): cypress component tests for react/next

initial work for cypress component tests for react and next

* feat(testing): add support for v10 e2e cypress projects

create the correct files for cypress projects >v10 and reorganize tests based on version to allow
easier parsing of tests

* feat(testing): add utils for modifying cypress v10 config

provide ts transformers to take in an existing cypress config and update/add properties within the
given configuration

* fix(testing): fix tests affected by the cypress v10 changes

update tests to assert the correct files/folders/file contents due to the cypress changes in v10

* cleanup(testing): move cypress component testing plugins into the respective packages

move the plugins into out of cypress plugins into the specific vertical plugin to prevent issues
with circular refs

* cleanup(testing): bump cypress version

bump to latest cypress v10 release

* docs(testing): update docs for cypress 10

update cypress docs to include info about component testing and migration to cypress v10

* fix(repo): revert cypress version bump

keep v9 of cypress installed for nx repo until v10 release

* fix(testing): update cypress gen tsconfig and infer targets with converter

* fix(testing): make sure tests use the cypress v10 (for the intermediate)

* fix(testing): update target name after feedback

* fix(testing): support multiple target w/custom configs for cypress v10 migration

* fix(testing): refactor cy component tests into seperate verticals

* feat(testing): create storybook cypress preset

* fix(testing): clean up cy v10 migration

* fix(testing): don't branch for cypress executor testingType

* fix(testing): move cy comp test generator to next

* fix(testing): bump cypress deps

* fix(testing): clean up cy component testing generators

* fix(testing): update cy component testing docs

* fix(testign): dep check. runtime plugin pulls from @nrwl/react

* fix(testing): move e2e into verticals

* fix(testing): address PR feedback

* fix(testing): clean up unit tests

* feat(angular): support migrating angular cli workspaces using cypress v10

* chore(testing): update e2e tests

* fix(testing): address pr feedback

* chore(testing): remove cypress component testing for next.js

* fix(testing): address pr feedback

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2022-07-08 14:34:00 -05:00