23 Commits

Author SHA1 Message Date
Leosvel Pérez Espinosa
ada8be473d
fix(misc): fix misc issues in project generators for the ts solution setup (#30111)
The following are the main changes in the context of the TS solution
setup:

- Ensure `name` in `package.json` files is set to the import path for
all projects
- Set `nx.name` in `package.json` files when the user provides a name
different than the package name (import path)
- Clean up project generators so they don't set the `nx` property in
`package.json` files unless strictly needed
- Fix `@nx/vue:application` generator so it creates the Nx config in a
`package.json` file for e2e projects
- Ensure `@types/node` is installed in `vitest` generator
- Fix generated Vite config typing error (surfaced with Vite 6)
- Ensure `jsonc-eslint-parser` is installed when the
`@nx/dependency-checks` rule is added to the ESLint config
- Misc minor alignment changes

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-05 20:08:10 -05:00
Leosvel Pérez Espinosa
a5d20030db
fix(js): update outDir in runtime tsconfig files to match types export in package.json (#30217)
## Current Behavior

In the TS solution setup, several project generators produce the runtime
tsconfig files (e.g. `tsconfig.lib.json`) with the `outDir` set to
`out-tsc/<project name>`. This causes issues with the inferred
`typecheck` task because the project `package.json` has the `types`
export pointing to `dist/...`, which wouldn't be produced by
`typecheck`.

## Expected Behavior

In the TS solution setup, project generators should produce the runtime
tsconfig files (e.g. `tsconfig.lib.json`) with the `outDir` set to a
path (`dist`) that matches the value in the project `package.json`'s
`types` export.

## Related Issue(s)

Fixes #
2025-02-28 16:10:58 -05:00
Jack Hsu
a0cfe88f5f
fix(node): set correct compilerOptions for Nest applications (#29725)
This PR fixes and issue where generating Nest app in the new TS setup
results in a build error due to missing `experimentalDecorators` option
in tsconfig. Decorators are required for Nest to work, but we do not set
it anymore in `tsconfig.base.json` by default.


## Current Behavior
Nest apps are broken

## Expected Behavior
Nest apps work

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

Fixes #
2025-01-22 23:20:25 -05:00
Leosvel Pérez Espinosa
f922e2bcf0
fix(misc): fix misc generation issues with the ts solution setup (#29350)
Fix misc generation issues related to the new TS solution setup:

- Improve Cypress config default formatting (when no prettier)
- Remove leftover compiler options from `tsconfig.json` files
- Do not add TS path mappings
- Update `outDir` for `typecheck` tasks to be `out-tsc/...`
- Generate Nx configuration in `package.json` files for e2e test runner
projects
- Fix issue with `@nx/js:library` and `--bundler=vite`
- Other smaller changes

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

## 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-12-16 16:23:50 +00:00
Leosvel Pérez Espinosa
99a0e7c5a0
fix(misc): ensure tsBuildInfoFile is generated inside outDir (#29343)
<!-- 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 -->

## 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-12-16 14:53:18 +01:00
Jack Hsu
a8de7df0e0
feat(js): update vue/node app and lib generators to support TS solutions (#29299)
<!-- 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 -->

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

---------

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
2024-12-12 15:43:14 -05:00
Nicholas Cunningham
08a33075a7
fix(nest): update project config to enable artifacts to be built as dev (#29110)
<!-- 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, when we generate a Nest application and run the serve target
with development configuration the `node-env` is set to `production`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Running the serve target in `development` should build the artifacts as
`development` so they can be served correctly.

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

Fixes #26761
2024-11-28 10:23:09 -07:00
Jack Hsu
27edf71cef
feat(misc): make directory a required option for generators (#28093)
<!-- 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 -->

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

---------

Co-authored-by: Colum Ferry <cferry09@gmail.com>
Co-authored-by: Nicholas Cunningham <ndcunningham@gmail.com>
2024-10-01 09:29:44 -04:00
Leosvel Pérez Espinosa
81e8d12ed1
fix(misc): do not normalize project name and root when using as-provided format (#19651) 2023-10-17 17:53:48 -04:00
Jack Hsu
74e5879e8d
fix(node): pass projectNameAndRootFormat to js lib generator from nest lib generator (#18891) 2023-08-29 14:35:24 -04:00
Gustavo Perdomo
6cb159e9f7
feat(nest): added es2021 support for nest generators (#17726)
Co-authored-by: Caleb Ukle <caleb.ukle+github@pm.me>
2023-06-22 16:38:54 -05:00
Nicholas Cunningham
ce4a76a975
feat(nest): Add strict option (#16371) 2023-04-18 12:47:02 -06:00
Jason Jean
2d195007b0
feat(core): switch packages to use the @nx scope (#16069) 2023-04-14 19:56:37 -04:00
Luka Furlan
3af649dc3f
feat(node): Added E2E project generation option to NestJs app generator (#14805) 2023-03-31 12:20:03 -04:00
Jack Hsu
d7536aa7e3 feat(core): clean up workspace configuration code 2023-01-23 19:35:15 -05:00
Jason Jean
61d7d74378 fix(misc): fix tsconfig file includes 2022-12-05 10:39:03 -05:00
Craigory Coppola
458fc36014
chore(misc): split create tree with empty workspace to remove parameter (#10188)
* feat(devkit): split create-empty-tree to different functions

* chore(repo): apply migration for createEmptyTree

* cleanup(misc): fix tests that migration misses
2022-08-11 19:24:04 -04:00
Chau Tran
b67ca98758
fix(nest): update nestjs versions for init generators (#11355) 2022-07-29 10:13:17 -04:00
Caleb Ukle
39331d1e17
feat(testing): move jest config to .ts files (#9854)
* feat(testing): move jest config to .ts

move jest config and preset to ts files

ISSUES CLOSED: #8344

* fix(testing): update tests for jest.config.ts changes

update tests broken by renaming jest fils to ts files
2022-04-21 17:58:40 +00:00
Colum Ferry
8d6ac4f694
chore(angular): support angular 13 (#7161)
* chore(angular): support angular 13

Support Angular 13

chore(angular): support ng 13 next 11

chore(angular): upgrade tslib dep

chore(angular): update package and ng-packagr-lite executors to align with ng-packagr v13

chore(angular): update test snapshots with ts version

fix(angular): buildable lib tsconfig transform test

* chore(angular): sync ng-packagr changes to the package and ng-packagr-lite executors

* chore(angular): add migrations

* chore(angular): rxjs7

* feat(angular): check rxjs version to install

* feat(angular): update jest resolver to resolve esm

* chore(angular): fix version

* chore(angular): support jest-preset-angular

* fix(angular): tests

* fix(angular): fix e2e tests and add .angular to gitignore

* fix(angular): fix jest transformers ignore pattern

* fix(angular): fix node test

* fix(angular): fix workspace test

* fix(angular): import marble utils from jasmine-marbles instead of @nrwl/angular/testing

* feat(angular): update ngrx to 13.0.0-beta.;0

* fix(angular): temporarily skip test with pnpm

* fix(angular): bump jest-preset-angular to fix jest performance issues

* fix(angular): webpack-browser and server schema changes

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
Co-authored-by: Jason Jean <jasonjean1993@gmail.com>
2021-11-08 12:01:55 -05:00
Caleb Ukle
0ca5a88bf1
fix(testing) generated jest ts configs mismatch (#7556)
* fix(testing): add .test. files to spec tsconfig template

add support for .test.ts and with supportTsx .test.{js|tsx|jsx} files
in the tsconfig.spec.json template.

Note each package that excludes testing files will need to be updated to
exclude the new files (coming in future commits)

* fix(angular): add .test.ts support in tsconfigs

add .test.ts in angular jest template
update angular generators to exclude test files

* fix(gatsby): add .test. file prefixes to tsconfig ignore

ignore the new .test.{js|ts|jsx|tsx} files added to jest configs

* fix(react): add .test. file prefix to app/lib tsconfigs

add .test.{ts|js|tsx|jsx} files to be excluded by app/lib tsconfig

* fix(node): add .test. file prefix to app/lib tsconfig

add .test.{ts|js|tsx|jsx} files to be excluded by app/lib tsconfig

ISSUES CLOSED: #7263

* fix(nest): update tests for new .test.ts files in tsconfig

update tests to account for changes in node generators which add .test.ts to the exclude of
tsconfigs

* fix(express): update tests to account for new tsconfig changes

updated snapshots
added new patterns for tsconfig

* fix(linter): update snapshots for new tsconfig changes

snapshot updated to include new .test.ts file changes for tsconfig

* fix(node): update testing to account for spec tsconfig changes

add .test.ts files in e2e tests

* fix(testing): add migration for tsconfig changes

initial migration and test for tsconfig changes

* chore(testing): add to migrations collection

add the update-ts-config-for-test-filenames to migrations

* fix(testing): fix filesystem issue with jest tests

mock readConfig to always return an basic config to prevent issues of not finding a config in non
linux environments, aka missing /root

* cleanup(testing): update error message

update message logged when tsconfig isn't found to mention what was trying to be accompished so it
can be manually updated if desired.
2021-11-05 14:25:25 -05:00
Gustavo Perdomo
e960285769
feat(nest): support nest 8 (#6284)
* feat(nest): support nest 8

* feat(nest): update migration and generation logic

* feat(nest): updated according feedback

* feat(nest): fix migration issues

* feat(nest): final changes according feedback

Co-authored-by: Chau Tran <nartc7789@gmail.com>

* fix(nest): log info to install packages install running installPackageTask

Co-authored-by: Chau Tran <nartc7789@gmail.com>
2021-11-04 16:48:38 -05:00
Leosvel Pérez Espinosa
fab43a15e2
cleanup(nest): migrate nest to nx devkit (#6157) 2021-06-28 13:01:00 -04:00