Skip to content

Commit c1c3cdf

Browse files
committed
Merge branch 'jharting-defaultVersion'
2 parents 919c592 + 7b5778d commit c1c3cdf

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

lib/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ var defaultPackageInfos = {
112112
description: '',
113113
name : '',
114114
sampleUrl : false,
115-
version : '0.0.0'
115+
version : '0.0.0',
116+
defaultVersion: '0.0.0'
116117
};
117118

118119
// Simple logger interace

lib/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Worker.prototype.process = function(parsedFiles, parsedFilenames, packageInfos)
7272
block.local.url = '';
7373

7474
if ( ! block.local.version)
75-
block.local.version = '0.0.0';
75+
block.local.version = packageInfos.defaultVersion;
7676

7777
if ( ! block.local.filename)
7878
block.local.filename = parsedFilenames[fileIndex];

lib/workers/api_group.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function preProcess(parsedFiles, filenames, packageInfos, target) {
3131
parsedFile.forEach(function(block) {
3232
if (block.global[source]) {
3333
var name = block.global[source].name;
34-
var version = block.version || '0.0.0';
34+
var version = block.version || packageInfos.defaultVersion;
3535

3636
if ( ! result[target][name])
3737
result[target][name] = {};
@@ -94,7 +94,7 @@ function postProcess(parsedFiles, filenames, preProcess, packageInfos, source, t
9494
return;
9595

9696
var name = block.local[target];
97-
var version = block.version || '0.0.0';
97+
var version = block.version || packageInfos.defaultVersion;
9898
var matchedData = {};
9999

100100
if ( ! preProcess[source] || ! preProcess[source][name]) {
@@ -127,7 +127,7 @@ else {
127127
} else {
128128
// find nearest matching version
129129
var foundIndex = -1;
130-
var lastVersion = '0.0.0';
130+
var lastVersion = packageInfos.defaultVersion;
131131

132132
var versionKeys = Object.keys(preProcess[source][name]);
133133
versionKeys.forEach(function(currentVersion, versionIndex) {

lib/workers/api_param_title.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function preProcess(parsedFiles, filenames, packageInfos, target) {
3030
parsedFile.forEach(function(block) {
3131
if (block.global[source]) {
3232
var name = block.global[source].name;
33-
var version = block.version || '0.0.0';
33+
var version = block.version || packageInfos.defaultVersion;
3434

3535
if ( ! result[target][name])
3636
result[target][name] = {};
@@ -76,7 +76,7 @@ function postProcess(parsedFiles, filenames, preProcess, packageInfos, source, t
7676

7777
params.forEach(function(definition) {
7878
var name = definition.group;
79-
var version = block.version || '0.0.0';
79+
var version = block.version || packageInfos.defaultVersion;
8080
var matchedData = {};
8181

8282
if ( ! preProcess[source] || ! preProcess[source][name]) {
@@ -109,7 +109,7 @@ else {
109109
} else {
110110
// find nearest matching version
111111
var foundIndex = -1;
112-
var lastVersion = '0.0.0';
112+
var lastVersion = packageInfos.defaultVersion;
113113

114114
var versionKeys = Object.keys(preProcess[source][name]);
115115
versionKeys.forEach(function(currentVersion, versionIndex) {

lib/workers/api_permission.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function preProcess(parsedFiles, filenames, packageInfos, target) {
3030
parsedFile.forEach(function(block) {
3131
if (block.global[source]) {
3232
var name = block.global[source].name;
33-
var version = block.version || '0.0.0';
33+
var version = block.version || packageInfos.defaultVersion;
3434

3535
if ( ! result[target][name])
3636
result[target][name] = {};
@@ -71,7 +71,7 @@ function postProcess(parsedFiles, filenames, preProcess, packageInfos, source, t
7171
var newPermissions = [];
7272
block.local[target].forEach(function(definition) {
7373
var name = definition.name;
74-
var version = block.version || '0.0.0';
74+
var version = block.version || packageInfos.defaultVersion;
7575
var matchedData = {};
7676

7777
if ( ! preProcess[source] || ! preProcess[source][name]) {
@@ -105,7 +105,7 @@ else {
105105
} else {
106106
// find nearest matching version
107107
var foundIndex = -1;
108-
var lastVersion = '0.0.0';
108+
var lastVersion = packageInfos.defaultVersion;
109109

110110
var versionKeys = Object.keys(preProcess[source][name]);
111111
versionKeys.forEach(function(currentVersion, versionIndex) {

lib/workers/api_use.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function preProcess(parsedFiles, filenames, packageInfos, target) {
3131
parsedFile.forEach(function(block) {
3232
if (block.global[source]) {
3333
var name = block.global[source].name;
34-
var version = block.version || '0.0.0';
34+
var version = block.version || packageInfos.defaultVersion;
3535

3636
if ( ! result[target][name])
3737
result[target][name] = {};
@@ -71,7 +71,7 @@ function postProcess(parsedFiles, filenames, preProcess, packageInfos, source, t
7171

7272
block.local[target].forEach(function(definition) {
7373
var name = definition.name;
74-
var version = block.version || '0.0.0';
74+
var version = block.version || packageInfos.defaultVersion;
7575

7676
if ( ! preProcess[source] || ! preProcess[source][name]) {
7777
throw new WorkerError('Referenced groupname does not exist / it is not defined with @apiDefine.',
@@ -93,7 +93,7 @@ function postProcess(parsedFiles, filenames, preProcess, packageInfos, source, t
9393
} else {
9494
// find nearest matching version
9595
var foundIndex = -1;
96-
var lastVersion = '0.0.0';
96+
var lastVersion = packageInfos.defaultVersion;
9797

9898
var versionKeys = Object.keys(preProcess[source][name]);
9999
versionKeys.forEach(function(currentVersion, versionIndex) {

0 commit comments

Comments
 (0)