Skip to content

Commit

Permalink
Set version to 0.0.0 if using GitHub workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
badsyntax committed Dec 9, 2019
1 parent e785f6b commit 9f02882
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 33 deletions.
4 changes: 2 additions & 2 deletions generators/app/templates/ext-colortheme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand All @@ -18,4 +18,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion generators/app/templates/ext-command-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/ext-command-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand Down
4 changes: 2 additions & 2 deletions generators/app/templates/ext-extensionpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand All @@ -13,4 +13,4 @@
"<%- extensionList[i] %>", <%}%>
"<%- extensionList[extensionList.length-1]%>"
]
}
}
4 changes: 2 additions & 2 deletions generators/app/templates/ext-keymap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand All @@ -17,4 +17,4 @@
}
]
}
}
}
4 changes: 2 additions & 2 deletions generators/app/templates/ext-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand All @@ -22,4 +22,4 @@
"path": <%- JSON.stringify("./syntaxes/" + languageFileName) %>
}]
}
}
}
2 changes: 1 addition & 1 deletion generators/app/templates/ext-localization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/ext-snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": <%- JSON.stringify(name) %>,
"displayName": <%- JSON.stringify(displayName) %>,
"description": <%- JSON.stringify(description) %>,
"version": "0.0.1",
"version": "<% if (gitHubWorkFlowInit) { %>0.0.0<% } else { %>0.0.1<% } %>",
"engines": {
"vscode": <%- JSON.stringify(vsCodeEngine) %>
},
Expand Down
51 changes: 30 additions & 21 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('test code generator', function () {
"name": "testTheme",
"displayName": "Test Theme",
"description": "My TestTheme",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -125,6 +125,7 @@ describe('test code generator', function () {
description: 'My TestTheme',
themeName: 'Green',
themeBase: 'vs-dark',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expectedPackageJSON = {
Expand Down Expand Up @@ -190,6 +191,7 @@ describe('test code generator', function () {
description: 'Theme SeventyFour',
themeName: 'Theme 74',
themeBase: 'vs-dark',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expectedPackageJSON = {
Expand Down Expand Up @@ -273,6 +275,7 @@ describe('test code generator', function () {
description: 'My TestTheme',
themeName: 'Funky',
themeBase: 'vs',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expectedPackageJSON = {
Expand Down Expand Up @@ -330,14 +333,14 @@ describe('test code generator', function () {
languageName: 'ANT',
languageScopeName: 'text.xml.ant',
languageExtensions: '.ant',
gitHubWorkFlowInit: true
gitHubWorkFlowInit: true,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
"name": "testLan",
"displayName": "Test Lan",
"description": "My TestLan",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -385,7 +388,8 @@ describe('test code generator', function () {
languageId: 'foo',
languageName: 'FOO',
languageScopeName: 'source.foo',
languageExtensions: '.foo'
languageExtensions: '.foo',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
Expand Down Expand Up @@ -440,7 +444,8 @@ describe('test code generator', function () {
languageId: 'crusty',
languageName: 'Crusty',
languageScopeName: 'source.crusty',
languageExtensions: '.crusty'
languageExtensions: '.crusty',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
Expand Down Expand Up @@ -500,14 +505,14 @@ describe('test code generator', function () {
displayName: 'Test Snip',
description: 'My TestSnip',
languageId: 'python',
gitHubWorkFlowInit: true
gitHubWorkFlowInit: true,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
"name": "testSnip",
"displayName": 'Test Snip',
"description": "My TestSnip",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -547,7 +552,8 @@ describe('test code generator', function () {
name: 'testSnip',
displayName: 'Test Snip',
description: 'My TestSnip',
languageId: 'python'
languageId: 'python',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
Expand Down Expand Up @@ -623,14 +629,14 @@ describe('test code generator', function () {
name: 'testKeym',
displayName: 'Test Keym',
description: 'My TestKeym',
gitHubWorkFlowInit: true
gitHubWorkFlowInit: true,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
"name": "testKeym",
"displayName": 'Test Keym',
"description": "My TestKeym",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -670,15 +676,15 @@ describe('test code generator', function () {
displayName: 'Test Com',
description: 'My TestCom',
gitInit: true,
pkgManager: 'npm',
gitHubWorkFlowInit: true,
pkgManager: 'npm'
}) // Mock the prompt answers
.toPromise().then(function () {
var expectedPackageJSON = {
"name": "testCom",
"displayName": 'Test Com',
"description": "My TestCom",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -741,7 +747,8 @@ describe('test code generator', function () {
description: 'My TestCom',
tslint: true,
gitInit: false,
pkgManager: 'yarn'
pkgManager: 'yarn',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expectedPackageJSON = {
Expand Down Expand Up @@ -831,15 +838,15 @@ describe('test code generator', function () {
description: 'My TestCom',
checkJavaScript: false,
gitInit: false,
pkgManager: 'npm',
gitHubWorkFlowInit: true,
pkgManager: 'npm'
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
"name": "testCom",
"displayName": 'Test Com',
"description": "My TestCom",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -899,7 +906,8 @@ describe('test code generator', function () {
description: 'My TestCom',
checkJavaScript: true,
gitInit: false,
pkgManager: 'yarn'
pkgManager: 'yarn',
gitHubWorkFlowInit: false,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
Expand Down Expand Up @@ -937,14 +945,14 @@ describe('test code generator', function () {
name: 'testExtensionPack',
displayName: 'Test Extension Pack',
description: 'My Test Extension Pack',
gitHubWorkFlowInit: true
gitHubWorkFlowInit: true,
}) // Mock the prompt answers
.toPromise().then(function () {
var expected = {
"name": "testExtensionPack",
"displayName": "Test Extension Pack",
"description": "My Test Extension Pack",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -978,13 +986,13 @@ describe('test code generator', function () {
lpLanguageName: 'Russian',
lpLocalizedLanguageName: 'русский',
pkgManager: 'npm',
gitHubWorkFlowInit: true
gitHubWorkFlowInit: true,
}).toPromise().then(function () {
var expected = {
"name": "vscode-language-pack-ru",
"displayName": "Russian Language Pack",
"description": "Language pack extension for Russian",
"version": "0.0.1",
"version": "0.0.0",
"engines": {
"vscode": engineVersion
},
Expand Down Expand Up @@ -1024,7 +1032,8 @@ describe('test code generator', function () {
lpLanguageId: 'ru',
lpLanguageName: 'Russian',
lpLocalizedLanguageName: 'русский',
pkgManager: 'yarn'
pkgManager: 'yarn',
gitHubWorkFlowInit: false,
}).toPromise().then(function () {
var expected = {
"name": "vscode-language-pack-ru",
Expand Down

0 comments on commit 9f02882

Please sign in to comment.