SQL Operations Studio Public Preview 1 (0.23) release source code

This commit is contained in:
Karl Burtram
2017-11-09 14:30:27 -08:00
parent b88ecb8d93
commit 3cdac41339
8829 changed files with 759707 additions and 286 deletions

View File

@@ -0,0 +1 @@
build/**

View File

@@ -0,0 +1,8 @@
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
[{
"name": "seti-ui",
"version": "0.1.0",
"repositoryURL": "https://github.com/jesseweed/seti-ui",
"description": "The file ./icons/seti.woff has been copied from https://github.com/jesseweed/seti-ui/blob/master/styles/_fonts/seti/seti.woff"
}]

View File

@@ -0,0 +1,331 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
var path = require('path');
var fs = require('fs');
var https = require('https');
var url = require('url');
function getCommitSha(repoId, repoPath) {
var commitInfo = 'https://api.github.com/repos/' + repoId + '/commits?path=' + repoPath;
return download(commitInfo).then(function (content) {
try {
let lastCommit = JSON.parse(content)[0];
return Promise.resolve({
commitSha: lastCommit.sha,
commitDate: lastCommit.commit.author.date
});
} catch (e) {
return Promise.resolve(null);
}
}, function () {
console.err('Failed loading ' + commitInfo);
return Promise.resolve(null);
});
}
function download(source) {
if (source.startsWith('.')) {
return readFile(source);
}
return new Promise((c, e) => {
var _url = url.parse(source);
var options = { host: _url.host, port: _url.port, path: _url.path, headers: { 'User-Agent': 'NodeJS' }};
var content = '';
https.get(options, function (response) {
response.on('data', function (data) {
content += data.toString();
}).on('end', function () {
c(content);
});
}).on('error', function (err) {
e(err.message);
});
});
}
function readFile(fileName) {
return new Promise((c, e) => {
fs.readFile(fileName, function(err, data) {
if (err) {
e(err);
} else {
c(data.toString());
}
});
});
}
function downloadBinary(source, dest) {
if (source.startsWith('.')) {
return copyFile(source, dest);
}
return new Promise((c, e) => {
https.get(source, function (response) {
switch(response.statusCode) {
case 200:
var file = fs.createWriteStream(dest);
response.on('data', function(chunk){
file.write(chunk);
}).on('end', function(){
file.end();
c(null);
}).on('error', function (err) {
fs.unlink(dest);
e(err.message);
});
break;
case 301:
case 302:
case 303:
case 307:
console.log('redirect to ' + response.headers.location);
downloadBinary(response.headers.location, dest).then(c, e);
break;
default:
e(new Error('Server responded with status code ' + response.statusCode));
}
});
});
}
function copyFile(fileName, dest) {
return new Promise((c, e) => {
var cbCalled = false;
function handleError(err) {
if (!cbCalled) {
e(err);
cbCalled = true;
}
}
var rd = fs.createReadStream(fileName);
rd.on("error", handleError);
var wr = fs.createWriteStream(dest);
wr.on("error", handleError);
wr.on("close", function() {
if (!cbCalled) {
c();
cbCalled = true;
}
});
rd.pipe(wr);
});
}
function invertColor(color) {
var res = '#';
for (var i = 1; i < 7; i+=2) {
var newVal = 255 - parseInt('0x' + color.substr(i, 2), 16);
res += newVal.toString(16);
}
return res;
}
function getLanguageMappings() {
let langMappings = {}
var allExtensions = fs.readdirSync('..');
for (var i= 0; i < allExtensions.length; i++) {
let dirPath = path.join('..', allExtensions[i], 'package.json');
if (fs.existsSync(dirPath)) {
let content = fs.readFileSync(dirPath).toString();
let jsonContent = JSON.parse(content);
let languages = jsonContent.contributes && jsonContent.contributes.languages;
if (Array.isArray(languages)) {
for (var k = 0; k < languages.length; k++) {
var languageId = languages[k].id;
if (languageId) {
var extensions = languages[k].extensions;
var mapping = {};
if (Array.isArray(extensions)) {
mapping.extensions = extensions.map(function (e) { return e.substr(1).toLowerCase(); });
}
var filenames = languages[k].filenames;
if (Array.isArray(filenames)) {
mapping.fileNames = filenames.map(function (f) { return f.toLowerCase(); });
}
langMappings[languageId] = mapping;
}
}
}
}
}
return langMappings;
}
//var font = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/_fonts/seti/seti.woff';
var font = '../../../seti-ui/styles/_fonts/seti/seti.woff';
exports.copyFont = function() {
return downloadBinary(font, './icons/seti.woff');
};
//var fontMappings = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/_fonts/seti.less';
//var mappings = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/components/icons/mapping.less';
//var colors = 'https://raw.githubusercontent.com/jesseweed/seti-ui/master/styles/ui-variables.less';
var fontMappings = '../../../seti-ui/styles/_fonts/seti.less';
var mappings = '../../../seti-ui/styles/components/icons/mapping.less';
var colors = '../../../seti-ui/styles/ui-variables.less';
exports.update = function () {
console.log('Reading from ' + fontMappings);
var def2Content = {};
var ext2Def = {};
var fileName2Def = {};
var def2ColorId = {};
var colorId2Value = {};
var lang2Def = {};
function writeFileIconContent(info) {
var iconDefinitions = {};
for (var def in def2Content) {
var entry = { fontCharacter: def2Content[def] };
var colorId = def2ColorId[def];
if (colorId) {
var colorValue = colorId2Value[colorId];
if (colorValue) {
entry.fontColor = colorValue;
var entryInverse = { fontCharacter: entry.fontCharacter, fontColor: invertColor(colorValue) };
iconDefinitions[def + '_light'] = entryInverse;
}
}
iconDefinitions[def] = entry;
}
function getInvertSet(input) {
var result = {};
for (var assoc in input) {
let invertDef = input[assoc] + '_light';
if (iconDefinitions[invertDef]) {
result[assoc] = invertDef;
}
}
return result;
}
var res = {
information_for_contributors: [
'This file has been generated from data in https://github.com/jesseweed/seti-ui:',
'- icon definitions: styles/_fonts/seti.less',
'- icon colors: styles/ui-variables.less',
'- file associations: styles/icons/mapping.less',
'If you want to provide a fix or improvement, please create a pull request against the jesseweed/seti-ui repository.',
'Once accepted there, we are happy to receive an update request.',
],
fonts: [{
id: "seti",
src: [{ "path": "./seti.woff", "format": "woff" }],
weight: "normal",
style: "normal",
size: "150%"
}],
iconDefinitions: iconDefinitions,
// folder: "_folder",
file: "_default",
fileExtensions: ext2Def,
fileNames: fileName2Def,
languageIds: lang2Def,
light: {
file: "_default_light",
fileExtensions: getInvertSet(ext2Def),
languageIds: getInvertSet(lang2Def),
fileNames: getInvertSet(fileName2Def)
},
version: 'https://github.com/jesseweed/seti-ui/commit/' + info.commitSha,
};
var path = './icons/vs-seti-icon-theme.json';
fs.writeFileSync(path, JSON.stringify(res, null, '\t'));
console.log('written ' + path);
}
var match;
return download(fontMappings).then(function (content) {
var regex = /@([\w-]+):\s*'(\\E[0-9A-F]+)';/g;
while ((match = regex.exec(content)) !== null) {
def2Content['_' + match[1]] = match[2];
}
return download(mappings).then(function (content) {
var regex2 = /\.icon-(?:set|partial)\('([\w-\.]+)',\s*'([\w-]+)',\s*(@[\w-]+)\)/g;
while ((match = regex2.exec(content)) !== null) {
let pattern = match[1];
let def = '_' + match[2];
let colorId = match[3];
if (pattern[0] === '.') {
ext2Def[pattern.substr(1).toLowerCase()] = def;
} else {
fileName2Def[pattern.toLowerCase()] = def;
}
def2ColorId[def] = colorId;
}
// replace extensions for languageId
var langMappings = getLanguageMappings();
for (var lang in langMappings) {
var mappings = langMappings[lang];
var exts = mappings.extensions || [];
var fileNames = mappings.fileNames || [];
var preferredDef = null;
// use the first file association for the preferred definition
for (let i1 = 0; i1 < exts.length && !preferredDef; i1++) {
preferredDef = ext2Def[exts[i1]];
}
// use the first file association for the preferred definition
for (let i1 = 0; i1 < fileNames.length && !preferredDef; i1++) {
preferredDef = fileName2Def[fileNames[i1]];
}
if (preferredDef) {
lang2Def[lang] = preferredDef;
for (let i2 = 0; i2 < exts.length; i2++) {
// remove the extension association, unless it is different from the preferred
if (ext2Def[exts[i2]] === preferredDef) {
delete ext2Def[exts[i2]];
}
}
for (let i2 = 0; i2 < fileNames.length; i2++) {
// remove the fileName association, unless it is different from the preferred
if (fileName2Def[fileNames[i2]] === preferredDef) {
delete fileName2Def[fileNames[i2]];
}
}
}
}
return download(colors).then(function (content) {
var regex3 = /(@[\w-]+):\s*(#[0-9a-z]+)/g;
while ((match = regex3.exec(content)) !== null) {
colorId2Value[match[1]] = match[2];
}
return getCommitSha('jesseweed/seti-ui', 'styles/_fonts/seti.less').then(function (info) {
try {
writeFileIconContent(info);
if (info) {
console.log('Updated to jesseweed/seti-ui@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
}
} catch (e) {
console.error(e);
}
});
});
});
}, console.error);
};
if (path.basename(process.argv[1]) === 'update-icon-theme.js') {
exports.copyFont().then(() => exports.update());
}

View File

@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><title>dashboard</title><path d="M8,.19a7.61,7.61,0,0,1,2.07.28,8,8,0,0,1,1.87.79,7.8,7.8,0,0,1,2.8,2.8,8,8,0,0,1,.79,1.87,7.78,7.78,0,0,1,0,4.14,8,8,0,0,1-.79,1.87,7.8,7.8,0,0,1-2.8,2.8,8,8,0,0,1-1.87.79,7.78,7.78,0,0,1-4.14,0,8,8,0,0,1-1.87-.79,7.8,7.8,0,0,1-2.8-2.8,8,8,0,0,1-.79-1.87,7.78,7.78,0,0,1,0-4.14,8,8,0,0,1,.79-1.87,7.8,7.8,0,0,1,2.8-2.8A8,8,0,0,1,5.93.47,7.6,7.6,0,0,1,8,.19ZM8,14.77a6.58,6.58,0,0,0,1.8-.24,6.94,6.94,0,0,0,1.62-.68,6.77,6.77,0,0,0,2.43-2.43,6.94,6.94,0,0,0,.68-1.62,6.75,6.75,0,0,0,0-3.6,6.94,6.94,0,0,0-.68-1.62,6.77,6.77,0,0,0-2.43-2.43A6.94,6.94,0,0,0,9.8,1.47a6.75,6.75,0,0,0-3.6,0,6.93,6.93,0,0,0-1.62.68A6.77,6.77,0,0,0,2.16,4.59,6.94,6.94,0,0,0,1.47,6.2a6.75,6.75,0,0,0,0,3.6,6.94,6.94,0,0,0,.68,1.62,6.77,6.77,0,0,0,2.43,2.43,6.93,6.93,0,0,0,1.62.68A6.57,6.57,0,0,0,8,14.77Zm1.92-11A4.68,4.68,0,0,0,8,3.31,4.58,4.58,0,0,0,5.62,4a4.7,4.7,0,0,0-.94.74A4.77,4.77,0,0,0,4,5.64a4.68,4.68,0,0,0-.47,1.12,4.69,4.69,0,0,0,.19,3,4.66,4.66,0,0,0,1,1.52l-.74.74a5.72,5.72,0,0,1-.9-6.94A5.75,5.75,0,0,1,3.95,4,5.76,5.76,0,0,1,9.2,2.41a5.58,5.58,0,0,1,1.14.38ZM9.4,7.32A1.52,1.52,0,0,1,9.56,8a1.54,1.54,0,0,1-.12.61,1.55,1.55,0,0,1-.83.83,1.59,1.59,0,0,1-1.22,0,1.55,1.55,0,0,1-.83-.83,1.59,1.59,0,0,1,0-1.22,1.55,1.55,0,0,1,.83-.83A1.53,1.53,0,0,1,8,6.44a1.51,1.51,0,0,1,.68.16h0l3-3,.73.73-3,3ZM8,8.52a.53.53,0,1,0-.37-.15A.5.5,0,0,0,8,8.52Zm5.21-2.86a5.58,5.58,0,0,1,.38,1.14A5.71,5.71,0,0,1,13.71,8a5.78,5.78,0,0,1-.43,2.19,5.55,5.55,0,0,1-1.23,1.86l-.74-.74a4.71,4.71,0,0,0,1-1.51A4.52,4.52,0,0,0,12.69,8a4.68,4.68,0,0,0-.42-1.95Z"/></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#fff;}</style></defs><title>dashboard_inverse</title><path class="cls-1" d="M7.95.19A7.61,7.61,0,0,1,10,.47a8,8,0,0,1,1.87.79,7.8,7.8,0,0,1,2.8,2.8,8,8,0,0,1,.79,1.87,7.78,7.78,0,0,1,0,4.14,8,8,0,0,1-.79,1.87,7.8,7.8,0,0,1-2.8,2.8,8,8,0,0,1-1.87.79,7.78,7.78,0,0,1-4.14,0A8,8,0,0,1,4,14.74a7.8,7.8,0,0,1-2.8-2.8,8,8,0,0,1-.79-1.87,7.78,7.78,0,0,1,0-4.14,8,8,0,0,1,.79-1.87A7.8,7.8,0,0,1,4,1.26,8,8,0,0,1,5.88.47,7.6,7.6,0,0,1,7.95.19Zm0,14.58a6.58,6.58,0,0,0,1.8-.24,6.94,6.94,0,0,0,1.62-.68,6.77,6.77,0,0,0,2.43-2.43,6.94,6.94,0,0,0,.68-1.62,6.75,6.75,0,0,0,0-3.6,6.94,6.94,0,0,0-.68-1.62,6.77,6.77,0,0,0-2.43-2.43,6.94,6.94,0,0,0-1.62-.68,6.75,6.75,0,0,0-3.6,0,6.93,6.93,0,0,0-1.62.68A6.77,6.77,0,0,0,2.11,4.59,6.94,6.94,0,0,0,1.42,6.2a6.75,6.75,0,0,0,0,3.6,6.94,6.94,0,0,0,.68,1.62,6.77,6.77,0,0,0,2.43,2.43,6.93,6.93,0,0,0,1.62.68A6.57,6.57,0,0,0,7.95,14.77Zm1.92-11a4.68,4.68,0,0,0-1.95-.42A4.58,4.58,0,0,0,5.57,4a4.7,4.7,0,0,0-.94.74,4.77,4.77,0,0,0-.73.95,4.68,4.68,0,0,0-.47,1.12,4.69,4.69,0,0,0,.19,3,4.66,4.66,0,0,0,1,1.52l-.74.74A5.72,5.72,0,0,1,3,5.11,5.75,5.75,0,0,1,3.9,4,5.76,5.76,0,0,1,9.15,2.41a5.58,5.58,0,0,1,1.14.38ZM9.35,7.32A1.52,1.52,0,0,1,9.51,8a1.54,1.54,0,0,1-.12.61,1.55,1.55,0,0,1-.83.83,1.59,1.59,0,0,1-1.22,0,1.55,1.55,0,0,1-.83-.83,1.59,1.59,0,0,1,0-1.22,1.55,1.55,0,0,1,.83-.83,1.53,1.53,0,0,1,.61-.12,1.51,1.51,0,0,1,.68.16h0l3-3,.73.73-3,3Zm-1.4,1.2a.53.53,0,1,0-.37-.15A.5.5,0,0,0,7.95,8.52Zm5.21-2.86a5.58,5.58,0,0,1,.38,1.14A5.71,5.71,0,0,1,13.66,8a5.78,5.78,0,0,1-.43,2.19A5.55,5.55,0,0,1,12,12.05l-.74-.74a4.71,4.71,0,0,0,1-1.51A4.52,4.52,0,0,0,12.64,8a4.68,4.68,0,0,0-.42-1.95Z"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,20 @@
{
"name": "vscode-theme-seti",
"private": true,
"version": "0.1.0",
"description": "A file icon theme made out of the Seti UI file icons",
"publisher": "vscode",
"scripts": {
"update": "node ./build/update-icon-theme.js"
},
"engines": { "vscode": "*" },
"contributes": {
"iconThemes": [
{
"id": "vs-seti",
"label": "Seti (Visual Studio Code)",
"path": "./icons/vs-seti-icon-theme.json"
}
]
}
}

View File

@@ -0,0 +1,32 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
For Microsoft vscode-theme-seti
This file is based on or incorporates material from the projects listed below ("Third Party OSS"). The original copyright
notice and the license under which Microsoft received such Third Party OSS, are set forth below. Such licenses and notice
are provided for informational purposes only. Microsoft licenses the Third Party OSS to you under the licensing terms for
the Microsoft product or service. Microsoft reserves all other rights not expressly granted under this agreement, whether
by implication, estoppel or otherwise.†
1. Seti UI - A subtle dark colored UI theme for Atom. (https://github.com/jesseweed/seti-ui)
Copyright (c) 2014 Jesse Weed
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.