You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/10/04 05:13:58 UTC
[GitHub] erisu edited a comment on issue #32: Link `node_modules` during
platform creation if it exists
erisu edited a comment on issue #32: Link `node_modules` during platform creation if it exists
URL: https://github.com/apache/cordova/issues/32#issuecomment-426887402
@raphinesse
1. Is it important/necessary to keep the platform binaries?
```apple_ios_version
apple_ios_version.bat
apple_osx_version
apple_osx_version.bat
apple_xcode_version
apple_xcode_version.bat
autotest
check_reqs
check_reqs.bat
cordova_plist_to_config_xml
create
create.bat
lib
templates
test
tests
testx
uncrustify.cfg
uncrustify.sh
update
update.bat
```
2. Can we remove them? Currently in question is `create`, but the rest can probably go as well.
I believe project creations is typically performed with Cordova CLI. I am not sure how many people actually create a project from the platform package.
# Purpose of the question
## The originating problems background
Once bundled dependencies were removed, when a platform is added, all of the dependencies are installed into the projects root directory, flattened. Therefore the copy command fails because the `node_modules/cordova-ios/node_modules` directory no longer exists.
## Removing the bug
Yes, the best solution is to remove the copy command but there are still test failures to resolve.
## The test failures
The failures are coming from `create.spec.js`, an e2e test file. The test uses the `create` binary to create a project. When creating a project, a path must be provided where the project will be created. In that folder it will need to copy `node_modules` or it will start failing because of packages that is trying to be required later down in the create script. For example `unorm`.
If I attempt to copy the `node_modules` directory into the temp project folder before it is called, create process will fail because it will appear as if the project already exists.
## The question
Basically, there were two options that I can think of. If CLI `cordova platform add ios` is the typical pattern, should the ability to create a project from the platform be valid? If not it can be removed.
If we want to maintain this option, we can update the binary to pass in a flag within the options argument. The flag could be called `isNotCli: true`, and then update the copy node_modules line to come from the `__dirname` and only called when `isNotCli: true`. The reason for a negated option is so we do not need to update CLI code.
Alternative flags could be: `isPlatformBin: true`, ...
I am thinking the binaries can be removed and the tests using the binaries as well can be removed.
If you have any confusion let me know and I will try to clear it up.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org