nxext / nx-extensions

Nx Extensions for Stencil, Svelte, SolidJS, Preact, Ionic, and Capacitor
MIT License
467 stars 102 forks source link

Angular/Ionic: generate @nxext/ionic-angular:application fails because of missing .eslintrc.json #1105

Closed mley closed 1 month ago

mley commented 2 months ago

Describe the bug Creating a new ionic-angular app in a fresh nx workspace fails with the error message Cannot find apps/ionic-app-test/.eslintrc.json

I followed the guides on

To Reproduce

npx create-nx-workspace@latest
# test
# angular
# integrated monorepo
# test-app
# esbuild
# css
# no
# none
# do it later
# no remote caching

cd test

npm install eslint@latest @typescript-eslint/utils@latest @angular-eslint/eslint-plugin@latest 
# otherwise the @nxext/ionic-angular plugin won't install at all

npm install --save-dev --exact @nxext/ionic-angular
nx generate @nxext/ionic-angular:application ionic-app-test --verbose
# blank

Expected behavior It generates the app.

Additional context node v18.20.4 npm 10.8.2 NX version v19.8.1

console output

 test % nx generate @nxext/ionic-angular:application ionic-app-test --verbose

 NX  Generating @nxext/ionic-angular:application

✔ Which starter template would you like to use? · blank
In Nx 20, generating projects will no longer derive the name and root.
Please provide the exact project name and root in the future.
Example: nx g @nx/angular:application ionic-app-test --directory apps/ionic-app-test
Fetching @nx/cypress...

added 362 packages, and audited 363 packages in 7s

35 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

 NX   Cannot find apps/ionic-app-test/.eslintrc.json

Error: Cannot find apps/ionic-app-test/.eslintrc.json
    at readJson (/Users/martin/IdeaProjects/test/node_modules/@nxext/ionic-angular/node_modules/nx/src/generators/utils/json.js:14:15)
    at updateJson (/Users/martin/IdeaProjects/test/node_modules/@nxext/ionic-angular/node_modules/nx/src/generators/utils/json.js:46:34)
    at updateEslintConfig (/Users/martin/IdeaProjects/test/node_modules/@nxext/ionic-angular/src/generators/application/lib/update-eslint-config.js:6:29)
    at /Users/martin/IdeaProjects/test/node_modules/@nxext/ionic-angular/src/generators/application/generator.js:21:55
    at Generator.next (<anonymous>)
    at fulfilled (/Users/martin/IdeaProjects/test/node_modules/tslib/tslib.js:166:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
edbzn commented 2 months ago

Hi @mley, this was fixed here (https://github.com/nxext/nx-extensions-ionic/commit/1cd7776f35e0ad6a76a00aaa7ad7c321f0c5304d) but not yet released. Do we want to release it @DominikPieper? Also, note that we are thinking about completely dropping the application generator. See this: https://github.com/nxext/nx-extensions/pull/1103.

mburger81 commented 1 month ago

@edbzn Im having the same issue, but this is just happening if you run the ionic generator in a nx workspace created as a standalone repository, the problem is not running it in a mono repository nx project.

Is there a plan to have available the fix or the change of the dropping application generator? BTW what does it mean for use once the application generator is dropped?

edbzn commented 1 month ago

The issue should no longer appear (once we release main) as we dropped the code updating the eslint config. Actually, we refactored the application generator into a configuration generator, the idea is to delegate the creation of the app to the end user, so you can generate your regular Angular (or React) application with whatever option you want, and the new configuration generator just adds the necessary Ionic/Capacitor boilerplate to your application, so now it's a two steps process.

mburger81 commented 1 month ago

Ok thx for your clarification, is there a plan when you'll release this? I see you already merged the relevant code. Would be nice to have it as soon as possible.

thx for your hard work guys

DominikPieper commented 1 month ago

I'll do a release in the next 30 minutes :-)