58 Commits

Author SHA1 Message Date
Caleb Ukle
f3515e4ddc
fix(testing): use @swc/jest if being used as transformer (#12614) 2022-10-28 10:46:58 -05:00
Noriyuki Shinpuku
13c465d46b
fix(react): fix builder options for storybook plugin (#12276) 2022-10-21 14:53:52 -07: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
657b2bff5a
feat(testing): support jest 28 (#10857)
* feat(testing): support jest 28

WIP jest migration

* fix(testing): jest-environment-jsdom must be explicitly added now

* fix(testing): add rxjs to the transform lsit

* fix(testing): jest ts-jest updates and resolver issues

* feat(testing): remove test runner for react native jest

* feat(testing): add preprocessor for react native jest

* fix(testing): update query to handle tsx file syntax, remove rxjs transform

* chore(repo): remove file from accident commit

* chore(testing): update migration to target 14.6 for RN jest preprocessor

* fix(testing): call passed in packageFilter if preset

* docs(testing): add resolver env var to troubleshooting guide

* chore(repo): prep resolver for jest 28 migration

* fix(testing): update deps to handle esbuild-wasm service error

* fix(testing): switch to testEnvironmentOptions for cjs loading vs resolver list

* fix(testing): force babel-jest preset in transformer for project transforms

* chore(testing): address PR feedback

* fix(testing): address pr feedback, remove react-native transform

* chore(testing): update createTreeWithEmptyWorkspace calls

* chore(testing): address pr feedback

* feat(testing): add migration script for react native to rename .babelrc to babel.config.json

* chore(testing): nx format after rebase

* chore(testing): fix display name for @nrwl/js

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
2022-08-18 18:40:31 -04:00
David (ダビッド )
34fdbc0de2
fix(react): fix webpack node api config error serving a react app (#11580)
Webpack compiles a react app and the main.js file created contains __dirname variable. This crash
the application when it is served. The webpack node api config has been enabled.

ISSUES CLOSED: #11571
2022-08-17 13:55:32 -04:00
Katerina Skroumpelou
fee72e4ac6
chore(react): remove storybook logger dependency (#11306) 2022-07-27 13:39:42 +00:00
Mads Thines
edc9ce12a1
fix(storybook): adjusted STORYBOOK_ (#11171)
Corrected the `STORYBOOK_` RegExp to match documentation
https://storybook.js.org/docs/react/configure/environment-variable
2022-07-18 11:50:10 +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
Jorge Rodriguez
52f824cfe1
feat(storybook): Custom .babelrc in Storybook (#10551) 2022-06-07 17:18:34 -04:00
Noriyuki Shinpuku
bb166a5ae9
fix(storybook): allow NX_* environment variables (#10061) 2022-06-02 13:54:32 -04:00
Jack Hsu
8171e68da7
fix(react): handle transform properly for js/ts files in @nrwl/react/plugin/jest (#9898)
Fixes #9640
2022-04-20 16:37:10 +00: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
Miroslav Jonaš
3b21f4dfea
fix(core): switch from appRootPath to workspaceRoot (#9600) 2022-03-30 09:15:20 -04:00
Victor Savkin
74317bebea
chore(repo): fix flaky tests 2022-03-24 17:10:33 -04:00
Victor Savkin
d4b5c30eba
cleanup(core): remove the indirection left after inlining ta… (#9469) 2022-03-23 22:18:17 -04:00
Victor Savkin
6f038e7a4a feat(core): reorganize packges to consolidate all cli-related code in nx 2022-03-14 16:42:51 -04:00
Miroslav Jonaš
a2c5010678
chore(react): fix storybook test failing on local (#9224) 2022-03-07 23:22:13 +00:00
Jack Hsu
85da21bf29
fix(react): update storybook config to skip type checking (#8922) 2022-02-10 17:32:52 +02:00
Jack Hsu
120e987580
fix(react): fix issue with postcss and images in webpack config (#8802)
Fixes #8300
2022-02-01 11:43:01 -05:00
William Ghelfi
b577646589
feat(storybook): enable SVGR support for MDX stories (#7553)
* chore(core): nx plugin submission nx-plugin-unused-deps

* feat(storybook): enable SVGR support for MDX stories
2022-01-27 08:49:34 -05:00
Phillip Barta
e57cef0901
cleanup(repo): use devkit instead of devkit reexports from workspace (#7773) 2021-12-21 21:06:31 +00:00
Katerina Skroumpelou
c293e7779d
fix(storybook): fix webpack5 check (#7836)
ISSUES CLOSED: #7640
2021-11-26 09:26:01 -05:00
Jack Hsu
9c1ae3a1b0
chore(web): clean up webpack setup (#7411) 2021-10-19 09:07:33 -06:00
Leosvel Pérez Espinosa
324129b88d
fix(react): fix react webpack plugin check for babel-loader (#7382) 2021-10-15 12:53:01 -04:00
Jack Hsu
724b0c0e3c
feat(core): upgrade to webpack 5 (#7283)
* feat(core): upgrade to webpack 5

* chore(core): update webpack 5 docs
2021-10-13 00:34:28 -04:00
Jack Hsu
a8bcd27933
fix(react): apply postcss config from apps to their lib dependencies (#7265)
Fixes #7040
2021-10-08 14:10:25 -04:00
Juri Strumpflohner
20d4ae2ed9
fix(storybook): add Emotion v11 support to current Nx React Storybook setup (#6787) 2021-08-20 08:54:56 -04:00
kazamov
05faf8830b
fix(storybook): add check if plugins exist or fallback to empty array (#6714)
As storybookWebpackConfig.resolve.plugins may be undefined add a fallback to empty array.

Co-authored-by: Zakir Nuriiev <zakir.nuriev@caspio.com>
2021-08-13 13:29:32 -04:00
Juri
b5b5f250d0 feat(react): add Nx React Storybook preset 2021-08-06 18:11:47 +02:00
Jack Hsu
70c0921180
feat(react): add fast refresh support for webpack 5 (#6529) 2021-07-29 18:16:26 +00:00
Miroslav Jonaš
8ab463e386
cleanup(core): replace deprecated usage of appRootPath (#6241)
* cleanup(core): replace deprecated usage of appRootPath

* cleanup(core): revert migration changes
2021-07-05 15:51:19 -04:00
Jack Hsu
369da3ee78
feat(web): add support for webpack 5 (#5892) 2021-06-29 08:41:01 -04:00
Emily Xiong
b8584a6f18
feat(react): add react fast refresh to webpack (#5612) 2021-05-18 15:47:18 -04:00
Jack Hsu
c84bbb3c93
feat(react): add support for new jsx transform (#5131) 2021-04-01 13:46:12 +00:00
Jesse M. Holmes
852d7391fb
fix(react): merge options.output.globals with extraGlobals (#4571)
ISSUES CLOSED: #3789
2021-01-25 13:41:00 -05:00
William Ghelfi
742ea79d53
Fix svgr/webpack conf (#4327)
* fix(misc): avoid issues with refs in SVGs

The previous "import friendly" syntax was actually disabling refs in SVGs parsed by svgr.

I found 3 possible solutions:
1. Removing "![path]"
2. Separating "+ref![path]" with another comma: "+ref,![path]"
3. Rewriting the loader entry in the style of the other loader entries

I chose the last one for added clarity within the file.

* fix(core): fix compilation errors
2021-01-15 09:09:55 -05:00
Adam L Barrett
889b648886
Emotion upgrade for React and Next plugins (#4088)
* chore(react): update emotion to new versions and new package names on react plugin

* chore(nextjs): update emotion to latest version and the new package names

* feat(misc): have react and next plugin migrations update emotion imports

 * add renamePackageImports and renameNpmPackage rules to workspace utils
 * update migrations to update emotion imports to the new name and version
2020-11-27 13:32:42 -06:00
victor savkin
234ca36385 cleanup(misc): clean up devkit 2020-11-26 10:19:13 -05:00
Spencer Elliott
5b6df632cb
fix(core): resolve webpack loaders with require.resolve() (#3436)
* fix(core): resolve webpack loaders with `require.resolve()`

With strict package managers such as pnpm or Yarn PnP, transitive
dependencies are *not* hoisted to the root node_modules folder. This
means that a webpack config defined within a package like
'@nrwl/cypress' cannot resolve loaders like 'ts-loader', unless
'ts-loader' is declared in the workspace's own package.json.

This is a problem because the workspace might define a different version
of 'ts-loader', incompatible with the version declared by
'@nrwl/cypress/package.json'. The workspace should not need to declare
a dependency on 'ts-loader' anyway.

See also:
* https://github.com/pnpm/pnpm/issues/801
* https://github.com/webpack/webpack/issues/5087

* fix(core): resolve absolute 'raw-loader' path

When replacing the 'raw-loader' rule in the `getStylesPartial` function,
check for the absolute path of 'raw-loader' rather than just the name.
2020-08-08 17:53:00 -04:00
Jack Hsu
ed8bd2bbe8
Revert "fix(core): resolve webpack loaders with require.resolve() (#3341)" (#3371)
This reverts commit d74ab4e9d6eae6d83c3bb76072b45f7a4c7a6305.
2020-07-20 16:24:47 -04:00
Jack Hsu
83865747e9
fix(react): move url-loader to the react package.json (#3356) 2020-07-17 10:41:16 -04:00
Spencer Elliott
d74ab4e9d6
fix(core): resolve webpack loaders with require.resolve() (#3341)
With strict package managers such as pnpm or Yarn PnP, transitive
dependencies are *not* hoisted to the root node_modules folder. This
means that a webpack config defined within a package like
'@nrwl/cypress' cannot resolve loaders like 'ts-loader', unless
'ts-loader' is declared in the workspace's own package.json.

This is a problem because the workspace might define a different version
of 'ts-loader', incompatible with the version declared by
'@nrwl/cypress/package.json'. The workspace should not need to declare
a dependency on 'ts-loader' anyway.

See also:
* https://github.com/pnpm/pnpm/issues/801
* https://github.com/webpack/webpack/issues/5087
2020-07-15 13:55:38 -04:00
Jack Hsu
d593153a33
feat(react): refactored babel support so options are more easily customized (#3089)
This reverts commit 7679df22f5b90d085b5f32f2135d828036ee5aa7.
2020-05-29 02:09:47 -04:00
Victor Savkin
7679df22f5 Revert "feat(react): refactored babel support so options are more easily customized (#3058)"
This reverts commit 0e036272cbe156fe9750a2f2bc6498a08cf7f457.
2020-05-28 13:11:56 -04:00
Jack Hsu
0e036272cb
feat(react): refactored babel support so options are more easily customized (#3058) 2020-05-26 09:16:36 -04:00
Jason Jean
e06822da7e
chore(repo): update prettier to v2 (#2934)
this is just for the repo, and not the workspace

Co-authored-by: Rares Matei <matei.rar@gmail.com>
2020-04-29 01:09:37 -04:00
Jack Hsu
122af4fff3 fix(react): fix rollup options extension to be compatible with output arrays 2020-03-04 14:27:17 -05:00