cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Santana <csantan...@gmail.com>
Subject Re: Sharing code between plugman and cordova-cli
Date Wed, 16 Apr 2014 13:59:02 GMT
If you the decision factor is to consolidate all the cli tooling into a
single git repo, that's ok but

I still think we should treat what's inside the single repo as different
small independent npm modules and use the bundleDependencies in the cli and
plugman pacakge.json

/cordova-the-one-repo-to-rule-them-all
|- cli
|  '- package.json
|- plugman
|  '- package.json
|- common
|  '-util_a/package.json
|  '-util_b/package.json
|  '-util_c/package.json

cli and plugman pacakge.json will contain
"bundleDependencies": [
    "util_a",
    "util_b"
    ]

during dev and plublish, coho can automate
cd cli
#link dependencies
npm link ../common/util_a
npm link ../common/util_b
#code and test cli
#npm pack or publish cli
npm publish

what's get "npm pack" or "npm publish" will publish the cli files with the
bundledependencies.
When user "npm install cli" npm will see that it contains bundle
dependencies, and will not try to fetch and install them assuming that they
already included.

my take is the small modules are usable outside from cli an plugman, then I
think is better to versioned them and published them to npm as independent
modules, but keep them in the large single repo.
But take into account that we need to be good citizens if we release this
small npm pacakges because people are going to expect to be maintain.




On Tue, Apr 15, 2014 at 9:42 PM, Carlos Santana <csantana23@gmail.com>wrote:

> You don't need git install for npm to resolved the dependency, npm handles
> the fetching of the git url or simple url to tarball [1]
>
> Another way is when is time to publish you can put these common node
> modules as Bundle Dependencies [2] and send them to npm when publishing
> plugman and cordova-cli
>
> I understand that the problem is the common code to be separated and into
> a common component.
>
> I just want to point out that there is more than one way of accomplish our
> goals, and that npm has a lot capabilities of accomplishing the same thing
> with different approaches.
>
> 1: https://www.npmjs.org/doc/json.html#URLs-as-Dependencies
> 2: https://www.npmjs.org/doc/json.html#bundledDependencies
>
> --Carlos
>
>
>
>
> On Tue, Apr 15, 2014 at 9:32 PM, Andrew Grieve <agrieve@chromium.org>wrote:
>
>> We found out the hard way that having any git-based dependencies
>> causes install to fail if the user doesn't have git installed. For
>> this reason, if something's going to be an npm modules that's depended
>> on, it must be published to npm, and thus go through the proper
>> release process.
>>
>> Note though that the release process isn't the motivator for this,
>> rather, it's the pain of co-ordinating changes to multiple
>> repositories that depend on each other.
>>
>>
>>
>> On Tue, Apr 15, 2014 at 5:21 PM, Carlos Santana <csantana23@gmail.com>
>> wrote:
>> > On Tue, Apr 15, 2014 at 9:07 PM, Carlos Santana <csantana23@gmail.com
>> >wrote:
>> >
>> >> I agree that braking things into small node modules with clear scope
>> and
>> >> function is good and then be shared across other modules that declare
>> them
>> >> ad dependencies.
>> >>
>> >> These common node modules...:
>> >> 1. don't have to be publish to npm or release as a apache/cordova dist
>> >> asset.
>> >> 2. can live in their own git repos
>> >> 3. can be specified as dependencies using git url, manage during dev
>> with
>> >> npm link or git submodules to do test integration while doing dev
>> >> 4. can be treated as common source code to the cordova tools, and not a
>> >> standalone general purpose tool
>> >> 5. what actually gets publish to npm and release as a apache/cordova
>> dist
>> >> asset continue to be plugman and cordova-cli
>> >>
>> >> --Carlos
>> >>
>> >>
>> > This was just things to consider not necessary a proposal.
>> > But wanted to point out that things can be broken up into modules, and
>> not
>> > necessary add overhead on npm and release process/voting, and just
>> treated
>> > as a SCM exercise.
>>
>
>
>
> --
> Carlos Santana
> <csantana23@gmail.com>
>



-- 
Carlos Santana
<csantana23@gmail.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message