nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.62k stars 2.36k forks source link

Preset 'angular-nest' is no longer available since v15.2.0 #14228

Closed onsa closed 1 year ago

onsa commented 1 year ago

Current Behavior

The create-nx-workspace tool no longer supports angular-nest as a preset:

npx create-nx-workspace [workspace-name] --preset angular-nest

 >  NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Enable distributed caching to make your CI faster · Yes

 >  NX   Nx is creating your v15.4.5 workspace.

   To make sure the command works reliably in all environments, and that the preset is applied correctly,
   Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
✖ Creating your workspace in [workspace-name]

 >  NX   Nx failed to create a workspace.

   Exit code: 1
   Log file: /tmp/tmp-[log hash]/error.log

Expected Behavior

The create-nx-workspace tool lists angular-nest as a preset and can scaffold out a new repository with a nestjs application, an angular application and an api-interfaces library.

npx create-nx-workspace [workspace name] --preset angular-nest

>  NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Application name                      · [app name]
✔ Default stylesheet format             · scss
✔ Enable distributed caching to make your CI faster · Yes

 >  NX   Nx is creating your v15.4.5 workspace.

   To make sure the command works reliably in all environments, and that the preset is applied correctly,
   Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
✔ Nx has successfully created the workspace: [workspace name].
✔ NxCloud has been set up successfully
warning: LF will be replaced by CRLF in .editorconfig.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .eslintrc.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .prettierignore.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .prettierrc.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .vscode/extensions.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/.eslintrc.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/jest.config.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/project.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/app/app.controller.spec.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/app/app.controller.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/app/app.module.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/app/app.service.spec.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/app/app.service.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/environments/environment.prod.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/environments/environment.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/src/main.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/tsconfig.app.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/api/tsconfig.spec.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/.eslintrc.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/cypress.config.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/project.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/src/e2e/app.cy.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/src/fixtures/example.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/src/support/app.po.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/src/support/commands.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/src/support/e2e.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app-e2e/tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/.browserslistrc.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/.eslintrc.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/jest.config.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/project.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/proxy.conf.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/app/app.component.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/app/app.component.spec.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/app/app.component.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/app/app.module.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/app/nx-welcome.component.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/environments/environment.prod.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/environments/environment.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/index.html.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/main.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/polyfills.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/styles.scss.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/src/test-setup.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/tsconfig.app.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/tsconfig.editor.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in apps/nx-test-app/tsconfig.spec.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in decorate-angular-cli.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in jest.config.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in jest.preset.js.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/.babelrc.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/.eslintrc.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/README.md.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/project.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/src/index.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/src/lib/api-interfaces.ts.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/tsconfig.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in libs/api-interfaces/tsconfig.lib.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in nx.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in tools/tsconfig.tools.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in tsconfig.base.json.
The file will have its original line endings in your working directory

 >  NX   Successfully initialized git.

 >  NX   First time using Nx? Check out this interactive Nx tutorial.

   https://nx.dev/angular-tutorial/01-create-application

 >  NX   Distributed caching via Nx Cloud has been enabled

   In addition to the caching, Nx Cloud provides config-free distributed execution,
   UI for viewing complex runs and GitHub integration. Learn more at https://nx.app

   Your workspace is currently unclaimed. Run details from unclaimed workspaces can be viewed on cloud.nx.app by anyone
   with the link. Claim your workspace at the following link to restrict access.

   https://cloud.nx.app/orgs/workspace-setup?accessToken=[access token]

Github Repo

No response

Steps to Reproduce

  1. Run npx create-nx-workspace [workspace-name] --preset angular-nest

Nx Report

>  NX   Could not find Nx modules in this workspace.

   Have you run npm/yarn install?

Failure Logs

0 verbose cli /home/[user name]/.nvm/versions/node/v18.13.0/bin/node /home/[user name]/.nvm/versions/node/v18.13.0/bin/npm
1 info using npm@8.19.3
2 info using node@v18.13.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/[path to project]/nx-test/.npmrc Completed in 0ms
10 timing config:load:project Completed in 3ms
11 timing config:load:file:/home/[user name]/.npmrc Completed in 1ms
12 timing config:load:user Completed in 2ms
13 timing config:load:file:/home/[user name]/.nvm/versions/node/v18.13.0/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 10ms
19 timing npm:load:configload Completed in 10ms
20 timing npm:load:mkdirpcache Completed in 3ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm install
23 verbose argv "install"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 2ms
26 timing npm:load:display Completed in 2ms
27 verbose logfile logs-max:10 dir:/home/[user name]/.npm/_logs
28 verbose logfile /home/[user name]/.npm/_logs/2023-01-09T15_15_03_297Z-debug-0.log
29 timing npm:load:logFile Completed in 3ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 20ms
33 timing arborist:ctor Completed in 1ms
34 silly logfile start cleaning logs, removing 1 files
35 silly logfile done cleaning log files
36 timing command:install Completed in 9ms
37 verbose stack TypeError: must provide string spec
37 verbose stack     at new Edge (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/edge.js:51:13)
37 verbose stack     at [_loadDepType] (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:887:9)
37 verbose stack     at [Arborist.Node._loadDeps] (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:864:23)
37 verbose stack     at new Node (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:256:20)
37 verbose stack     at [newNode] (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js:335:9)
37 verbose stack     at /home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js:292:68
37 verbose stack     at async [loadActual] (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/load-actual.js:137:25)
37 verbose stack     at async Promise.all (index 0)
37 verbose stack     at async Arborist.reify (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:154:5)
37 verbose stack     at async Install.exec (/home/[user name]/.nvm/versions/node/v18.13.0/lib/node_modules/npm/lib/commands/install.js:145:5)
38 verbose cwd /[path to project]/nx-test
39 verbose Linux 5.17.0-1020-oem
40 verbose node v18.13.0
41 verbose npm  v8.19.3
42 error must provide string spec
43 verbose exit 1
44 timing npm Completed in 107ms
45 verbose unfinished npm timer reify 1673277303393
46 verbose unfinished npm timer reify:loadTrees 1673277303396
47 verbose unfinished npm timer idealTree 1673277303397
48 verbose unfinished npm timer idealTree:init 1673277303397
49 verbose code 1

Additional Information

The create-nx-workspace tool no longer supports angular-nest as a preset.

I could not find any documentation online about the reasons behind the removal of this preset. I couldn't even find an announcement / heads up.

When I asked over the official @nrwl/community slack channel, I was told that the decision had been made because the menu used to be too "cluttered". This, however, does not explain the fact that the preset is missing altogether from the list of presets. One can no longer scaffold out a new angular-nest project even with the --preset flag. A subjective aesthetic decision not to feature angular-nest as a default configuration does not justify its total removal from the available presets.

Please add back the removed preset. Thanks.

AgentEnder commented 1 year ago

This isn't a bug, but rather a choice made to simplify some of our internal preset logic. The angular-nest preset, and a few other "combo" presets were removed. Instead, you should choose a preset that fits your use case, install the plugins for whatever generators you wish to run, and run them yourself.

The combo presets had some issues such as not allowing all options for each app they generated that were frequently raised, and its not worth cluttering the workspace generation code with edge case fixes for these.

onsa commented 1 year ago

@AgentEnder I chose bug as it leaves me with rather cryptic error messages and it is definitely a regression from v.15.1.1.

Should I take from the rest of your message that even if I reopen this as a feature request, it'll be rejected? If so, would you consider creating release notes to describe what steps should be taken by those who wish to create such combos for themselves? Creating such a regression with no communication whatsoever is quite strange...

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.