fix: rebuild @devfile/api dependency to fix che-in-che development #472
+127
−122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Re-compiles
@devfile/api
node package on its place insidenode_modules/@devfile/api
directory to have a library with typecommonjs
instead ofmodule
.Since the type of
@devfile/api
node package has been changed fromcommonjs
tomodule
, it become not possible anymore to useimport
from VS Code when we compile it inside the workspace and then launch a secondary editor instance.The
@devfile/api
version we are currently using can be found here https://www.npmjs.com/package/@devfile/api/v/2.3.0-1723034342?activeTab=codeIt it possible to open
packge.json
and check fortype
property.The version we used before is https://www.npmjs.com/package/@devfile/api/v/2.2.1-alpha-1667236163?activeTab=code
There is no
type
property in thepackage.json
file, so defaultcommonjs
value is used.Why do we have the issue when compile and run the editor in the development mode only?
Normally, the
webpack
is used to create the editor bundle, and instead of having a dozen of separate javascript file, we have only one weight, obfuscated javascript file which speeds up the process of downloading the script in the browser.When we compile che-code in the development mode, the compiler creates thousands of seprarate javascript files and then when we run the backend with node, we face the restriction with the incompatibility of types (vscode is compiled as commonjs).
The changes provided by this pull request will be used only when che-code dogfooding.
What issues does this PR fix?
eclipse-che/che#23163
How to test this PR?
create a workspace from this the branch https://github.com/che-incubator/che-code/tree/recompile-devfile-api
run
devfile: Run VS Code server on port 8000
command. When the command is being executed, it is possible to check the output and see which@devfile/api
packages have been recompiled.run
devfile: Compile with npm
commandrun
devfile: Run VS Code server on port 8000
command and open the secondary editor in a separate windowonce the editor is opened, ensure there are no error notifications appeared
Does this PR contain changes that override default upstream Code-OSS behavior?
git rebase
were added to the .rebase folder