SAP / generator-easy-ui5

Meta-generator various project types within the UI5 Universe
https://blogs.sap.com/2021/04/09/easy-ui5-3.0-from-community-contributions-to-community-plugins/
Apache License 2.0
243 stars 72 forks source link

[error] No parser could be inferred for file #138

Closed ashrafalimohamed188 closed 10 months ago

ashrafalimohamed188 commented 11 months ago

hello, Steps to reproduce the problem: Step 1 Install NodeJS version 18 Step 2 npm install -g yo generator-easy-ui5 Step 3 execute yo easy-ui5 project

What is the expected result? project generation

Issue explaination: i was trying to create project with generator-easy-ui5,but i am facing the following issue i have tried many node versions but still end up with same issue, kindly help me to overcome this issue.

Screenshot 2023-12-06 110317 Thanks.

bit-mschwingenschloegl commented 11 months ago

Got the same problem. yo easy-ui5 project causes [error] No parser could be inferred ... It seems that yo easy-ui5 app seems to work (See community project https://github.com/ui5-community/generator-ui5-app) At the moment I am not sure about the differences between project and app

ashrafalimohamed188 commented 11 months ago

bit-mschwingenschloegl Is it working?

ziyang-works commented 10 months ago

The generated project uses prettier --plugin-search-dir in its package.json's lint and lint-fix script with Prettier version set to latest, but --plugin-search-dir has been deprecated by Prettier since version 3.0. https://prettier.io/blog/2023/07/05/3.0.0.html#plugin-search-feature-has-been-removed-14759httpsgithubcomprettierprettierpull14759-by-fiskerhttpsgithubcomfisker

I used the following fix as a temporary workaround

  1. Adapt the following scripts in package.json:
    - "lint": "eslint ./**/webapp/**/*.js && prettier --plugin-search-dir=. --check ./**/webapp/**/*.{js,xml} --no-error-on-unmatched-pattern",
    + "lint": "eslint ./**/webapp/**/*.js && prettier --plugin=@prettier/plugin-xml --check ./**/webapp/**/*.{js,xml} --no-error-on-unmatched-pattern",
    - "lint-fix": "eslint ./**/webapp/**/*.js --fix && prettier --plugin-search-dir=. --write ./**/webapp/**/*.{js,xml} --no-error-on-unmatched-pattern",
    + "lint-fix": "eslint ./**/webapp/**/*.js --fix && prettier --plugin=@prettier/plugin-xml --write ./**/webapp/**/*.{js,xml} --no-error-on-unmatched-pattern",
  2. Run npm run lint-fix
ashrafalimohamed188 commented 10 months ago

ziyang-works Thanks a Lot.

vobu commented 10 months ago

excellent, guys! and @ziyang-works - what do you think about putting your solution into a Pull Request?! Would be cool to have it in the codebase 🙌

vobu commented 10 months ago

Got the same problem. yo easy-ui5 project causes [error] No parser could be inferred ... It seems that yo easy-ui5 app seems to work (See community project https://github.com/ui5-community/generator-ui5-app) At the moment I am not sure about the differences between project and app

yo easy-ui5 app → will utilize the sub-generator „generator-ui5-app“ for bootstrapping a JS UI5 app yo easy-ui5 project → uses the built-in (to easy-ui5) generator to bootstrap a full project

hth, v.

ziyang-works commented 10 months ago

excellent, guys! and @ziyang-works - what do you think about putting your solution into a Pull Request?! Would be cool to have it in the codebase 🙌

Hey @vobu , I'd love to! It's submitted at https://github.com/ui5-community/generator-ui5-project/pull/73