aws-samples / aws-tools-for-babylonjs-editor

AWS Tools for Babylon.JS Editor is a suite of tools meant to interact with Babylon.JS Editor by utilizing the capabilities of AWS products.
Apache License 2.0
32 stars 9 forks source link

fix the path for runtime `npm install` #6

Closed eherozhao closed 2 years ago

eherozhao commented 2 years ago

What was the problem/requirement? (What/Why)

There is a bug when adding the host, the runtimeDependency npm install aws sdk will fail to run when the process.env path is not the same as global environment.

What was the solution? (How)

Find an open source lib (MIT license) to solve the Electron process path issue. https://github.com/sindresorhus/fix-path Since this project has been updated to version 4.0 for pure ESM so we currently use the version 3.0 which supports CJS as well.

What is the impact of this change? (Focus on the customer experience)

By this change, we solve the bug so that customer don't have to manually install aws-sdk in the Editor Workspace directory.

Are you adding any new dependencies to the system?

A MIT open source library: fix-path

How were these changes tested?

Manually test to check whether there is no error and aws sdk can be installed successfully.

How should reviewers test?

  1. Follow the README to build the host plugin.
  2. Add the plugin into Editor.
  3. Add a host.
  4. Check whether there are red errors shown in the Editor console.
  5. Navigate to the BabylonJS Project you initialized for this test.
  6. Open the Package.json file to check whether aws-sdk was installed as a dependency.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.