MeteorPackaging / discussions

Ask for Meteor integration help, or discuss Meteor 3rd party library packaging
5 stars 1 forks source link

Nvd3 #2

Open dandv opened 9 years ago

dandv commented 9 years ago

CC @bobiblazeski

bobiblazeski commented 9 years ago

Here's my progress with the guideline https://github.com/MeteorPackaging/autopublish.meteor.com/wiki

1,2,3 Done 4, 5 Done nvd3 is using development branch 6 nvd3 is using grunt, I haven't used it myself before 7 I have problem with replacing the version, at https://github.com/MeteorPackaging/nvd3/blob/master/GruntFile.js seems that version is read

var  _pkg = grunt.file.readJSON('package.json'); 
 _pkg.version 

I've tried adding initial package.js and then using https://github.com/outaTiME/grunt-replace plugin to search for the semver via regex and do the replacement, without succes. Any clear approach to replace version in package.js without adding template file ?

8 Done

// package.js
Package.describe({
    "name": 'novus:nvd3',
    summary: 'Nvd3.org charts.',
    version: '1.7.1',
    git: "https://github.com/novus/nvd3"
});
Package.on_use(function (api) {
    api.versionsFrom("METEOR@1.0");
    api.use('d3js:d3', 'client');
    api.add_files('build/nv.d3.js', 'client');
    api.add_files('build/nv.d3.css', 'client');
   // should I add export nv ?
});

9 Depends on 7 to be solved

10 Done, tried making some charts it works http://nvd3.org/examples/line.html

11 Done

12 What the organization should be novus or nvd3js ?

splendido commented 9 years ago

@bobiblazeski at a first glance I'd say they're updating "version" by hands file by file... I couldn't find anything within the GruntFile.js But you could have a look at this and propose a similar addition to the repo (which might be seen as an added value if they really have no automation for version bumping...)

For the organization you might ask in the PR before publishing the first official version of the package...

bobiblazeski commented 9 years ago

Where are the versions used by grunt.option( "oldver" ) & grunt.option( "newver" ) specified at the command line or there is some setting? From their readme they seem to want to just run grunt production and finish the build.

splendido commented 9 years ago

If I'm not wrong this is what was supposed to be run from the terminal:

grunt replace:version --oldver 1.0.0 --newver 1.0.1

Edit:: should actually be grunt release --oldver 1.0.0 --newver 1.0.1

dandv commented 9 years ago

It's really late here and I've only scanned this thread before going to sleep, but just wanted to make sure you guys have seen https://github.com/MeteorPackaging/grunt-gulp-meteor. nvd3's package.json has the version in the standard format, like all other packages. Sorry if the suggestion isn't helpful; will check back tomorrow.

bobiblazeski commented 9 years ago

How to push to https://github.com/MeteorPackaging/nvd3 ? @dandv @splendido From what I see neither packagers nor members of nvd3 team have access to nvd3 repository. Could you please add it.

splendido commented 9 years ago

done! @dandv correctly crteated the team for nv3d but apparently forgot to associate it to the nv3d repo...

bobiblazeski commented 9 years ago

Here's the pull request https://github.com/novus/nvd3/pull/782/ Here's few charts displayed from the nvd3 package to prove it works https://github.com/bobiblazeski/nvd3-samples depends on d3js:d3 & nvd3:nvd3

splendido commented 9 years ago

could you please edit the PR OT and replace 'Organization Name Here` with the organization you created on meteor for them? ;-)

splendido commented 9 years ago

Oh, now I see, sorry. You must have copied the text as displayed on the wiki page and not the raw Markdown... It might be better to update it anyway

I've just seen the discussion has already started, well done!

Edit: I'm not sure you can even see the raw text, sorry... But let us know in case you can!

splendido commented 9 years ago

...about the version update, perphaps using grunt-text-replace like this could help:

replace: {
  example: {
    src: [
      'bower.js',
      'package.js',      
    ], 
    overwrite: true,
    replacements: [{
      from: /(version?\s?=?\:?\s\')([\d\.]*)\'/gi,
      to: '$1' + _pkg.version + "'"
    }]
  }
}

this will replace any preexisting version number following 'version = ' or 'version': ' and the like with the version number currently appearing inside the package.js file.

but make sure that both bower.json and package.js are using single ' instead of " (or update teh RegExp` accordingly...)!

splendido commented 9 years ago

See this new section on the wiki...

bobiblazeski commented 9 years ago

It worked many thanks.

splendido commented 9 years ago

You're welcome!

splendido commented 9 years ago

Out of curiosity, have you published the new package from the latest tag or from the devel branch?

bobiblazeski commented 9 years ago

From the tag, nv.d3.js & nv.d3.css in the build directory are identical in devel and master until you run grunt production. I prefer to have same code as if I downloaded nvd3 myself from the official release.

splendido commented 9 years ago

I'm sorry I asked, but I noticed there are a number of commits on both master and devel branch made after the latest relase.

tnx!

dandv commented 9 years ago

I've made the wiki page for the PR proposal raw Markdown. Don't worry about the horizontal scrollbar - it's formatted such that there's no word wrap when you paste the text in a GitHub issue textarea.

splendido commented 9 years ago

:+1: