Compare commits

...

5 Commits

Author SHA1 Message Date
Samy Pessé 8ee0bcac2a Bump version to 2.5.0-beta.3 2015-10-14 11:54:58 +02:00
Samy Pessé 0c4ad74788 Fix resolve of plugins for prereleases 2015-10-14 11:54:12 +02:00
Samy Pessé 7d944e4f1f Fix instruction for local developement 2015-10-14 11:48:27 +02:00
Samy Pessé 67b2394c16 Bump version to 2.5.0-beta.2 2015-10-14 11:39:23 +02:00
Samy Pessé 269d08a35f Correctly handle pre-version for plugins checks 2015-10-13 15:50:54 +02:00
7 changed files with 35 additions and 10 deletions
+6
View File
@@ -2,6 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 2.5.0-beta.3
- Fix installation of plugins when using a pre-release
## 2.5.0-beta.2
- Fix support for pre-releases
## 2.5.0-beta.1
- Font settings, sharing and search are externalized as default plugins
- Plugins can define a configuration schema in the manifest, this schema will be used to validate configuration during build
+3 -3
View File
@@ -222,9 +222,9 @@ To use the latest commit from `GitBook/gitbook` with `gitbook-cli`:
```
$ git clone https://github.com/GitbookIO/gitbook.git ./gitbook
$ gitbook versions:link 2.0.0 ./gitbook
$ gitbook versions:link ./gitbook
```
Now the version tag `2.0.0` wil be associated with the `./gitbook` folder.
Now `gitbook-cli` will be using the `./gitbook` folder.
You can uninstall it using: `gitbook versions:uninstall 2.0.0`.
You can uninstall it using: `gitbook versions:uninstall latest`.
+2 -1
View File
@@ -5,6 +5,7 @@ var semver = require('semver');
var pkg = require('../package.json');
var i18n = require('./utils/i18n');
var version = require('./version');
var DEFAULT_CONFIG = require('./config_default');
@@ -139,7 +140,7 @@ Configuration.prototype.load = function() {
})
.then(function() {
if (!that.book.isSubBook()) {
if (!semver.satisfies(pkg.version, that.options.gitbook)) {
if (!version.satisfies(that.options.gitbook)) {
throw new Error('GitBook version doesn\'t satisfy version required by the book: '+that.options.gitbook);
}
if (that.options.gitbook != '*' && !semver.satisfies(semver.inc(pkg.version, 'patch'), that.options.gitbook)) {
+2 -3
View File
@@ -1,6 +1,5 @@
var _ = require('lodash');
var Q = require('q');
var semver = require('semver');
var path = require('path');
var url = require('url');
var fs = require('./utils/fs');
@@ -9,7 +8,7 @@ var mergeDefaults = require('merge-defaults');
var jsonschema = require('jsonschema');
var jsonSchemaDefaults = require('json-schema-defaults');
var pkg = require('../package.json');
var version = require('./version');
var PLUGIN_PREFIX = 'gitbook-plugin-';
@@ -145,7 +144,7 @@ Plugin.prototype.isValid = function() {
this.packageInfos.name &&
this.packageInfos.engines &&
this.packageInfos.engines.gitbook &&
semver.satisfies(pkg.version, this.packageInfos.engines.gitbook)
version.satisfies(this.packageInfos.engines.gitbook)
);
// Valid hooks
+2 -2
View File
@@ -5,7 +5,7 @@ var npm = require('npm');
var semver = require('semver');
var Plugin = require('./plugin');
var pkg = require('../package.json');
var version = require('./version');
var initNPM = _.memoize(function() {
return Q.nfcall(npm.load, { silent: true, loglevel: 'silent' });
@@ -191,7 +191,7 @@ PluginsList.prototype.install = function() {
};
})
.filter(function(v) {
return v.gitbook && semver.satisfies(pkg.version, v.gitbook);
return v.gitbook && version.satisfies(v.gitbook);
})
.sort(function(v1, v2) {
return semver.lt(v1.version, v2.version)? 1 : -1;
+19
View File
@@ -0,0 +1,19 @@
var semver = require('semver');
var pkg = require('../package.json');
var VERSION = pkg.version;
var VERSION_STABLE = VERSION.replace(/\-(\S+)/g, '');
// Test if current current gitbook version satisfies a condition
// We can't directly use samver.satisfies since it will break all plugins when gitbook version is a prerelease (beta, alpha)
function satisfies(condition) {
// Test with real version
if (semver.satisfies(VERSION, condition)) return true;
// Test with future stable release
return semver.satisfies(VERSION_STABLE, condition);
}
module.exports = {
satisfies: satisfies
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "gitbook",
"version": "2.5.0-beta.1",
"version": "2.5.0-beta.3",
"homepage": "https://www.gitbook.com",
"description": "Library and cmd utility to generate GitBooks",
"main": "lib/index.js",