-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid computed root folder for ui5-tooling-transpile
#879
Comments
Yes, the following line is not pointing to the project root path: const cwd = middlewareUtil.getProject().getRootPath() || process.cwd(); also the root path is considered as being in the path where BUT - I'm still not sure what the right behavior is - from where should we derive the project root and the config? Right now, all indicators tend to the root path I geht from the project. The alternative would be to be able to define a root path. |
Cc: @RandomByte @matz3 |
UI5 Tooling determines the project root path to be the directory containing the closest package.json to the CWD of the process (searching in the current and all parent directories). The location of the ui5.yaml is irrelevant. See the implementation for reference. By executing |
Hmm, well - the initial issue is that the configuration is not derived properly from the project as the |
Yes, it is mainly related to the detection of the project type (whether to transform TypeScript or not) - by configuring it manually it works: server:
customMiddleware:
- name: ui5-tooling-transpile-middleware
afterMiddleware: compression
configuration:
transformTypeScript: true The automatic detection is causing the trouble here as by starting from the project root pointing to another |
Food for thoughts :
|
Describe the bug
I created some sample apps to test
ui5-test-runner
in different configurations.In particular, I want to validate that it works with TS transpiling.
I have no problem running a normal JS app inside the project, but the TS one is quite challenging.
I found a workaround but I believe the problem is inside the transpiler in the way the configuration is built.
To Reproduce
npm i
npm run serve:sample:js
works fine even if executed from the root but pointing to aui5.yaml
inside a subfolder./test/sample.ts/ui5.yaml
to add :npx ui5 serve --config ./test/sample.ts/ui5.yaml
http://localhost:8080/index.html
Component.js
is missing (not transpiled)Expected behavior
I would expect the TS sample to work as fine as the JS one
Screenshots
Desktop (please complete the following information):
404
issue)Additional context
Enabling
debug
&--verbose
shows :After long debugging sessions, I finally understood that the problem comes from a combination of
process.cwd()
and the locationof
package.json
. The transpiler configures itself as it in the project root instead of the folder whereui5.yaml
stands.I found a way to 'hack' this but I would expect the whole thing to run fine without hack...
The text was updated successfully, but these errors were encountered: