Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui updates #777

Merged
merged 3 commits into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"babel-loader": "^8.0.5",
"copy-webpack-plugin": "^5.0.0",
"cross-env": "^5.2.0",
"css-loader": "^3.2.0",
"css-loader": "^4.2.1",
"dotenv": "^8.2.0",
"file-loader": "^4.2.0",
"mini-css-extract-plugin": "^0.8.0",
Expand Down
7 changes: 5 additions & 2 deletions build-tools/webpack/webview.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const setDefaults = require('./../common/set-defaults');
const webpack = require('webpack');
const parseEntries = require('./../common/parse-entries');

const { rootdir } = require('../constants');
const { rootdir, IS_PRODUCTION } = require('../constants');

/**
*
Expand Down Expand Up @@ -64,7 +64,10 @@ module.exports = exports = function getWebviewConfig({ entries, packagePath }) {
loader: 'css-loader',
options: {
importLoaders: 3,
modules: true,
modules: {
localIdentName: IS_PRODUCTION ? '[hash:base64]' : '[path][name]__[local]-[hash:base64]',
exportLocalsConvention: 'camelCaseOnly',
},
}
},
'resolve-url-loader',
Expand Down
30 changes: 20 additions & 10 deletions build-tools/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ camelcase@5.0.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42"
integrity sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==

camelcase@5.3.1, camelcase@^5.0.0, camelcase@^5.3.1:
camelcase@5.3.1, camelcase@^5.0.0:
version "5.3.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
Expand All @@ -1608,6 +1608,11 @@ camelcase@^2.0.0:
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"
integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=

camelcase@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.0.0.tgz#5259f7c30e35e278f1bdc2a4d91230b37cad981e"
integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==

caniuse-api@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0"
Expand Down Expand Up @@ -2023,24 +2028,24 @@ css-declaration-sorter@^4.0.1:
postcss "^7.0.1"
timsort "^0.3.0"

css-loader@^3.2.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-3.6.0.tgz#2e4b2c7e6e2d27f8c8f28f61bffcd2e6c91ef645"
integrity sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ==
css-loader@^4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-4.2.1.tgz#9f48fd7eae1219d629a3f085ba9a9102ca1141a7"
integrity sha512-MoqmF1if7Z0pZIEXA4ZF9PgtCXxWbfzfJM+3p+OYfhcrwcqhaCRb74DSnfzRl7e024xEiCRn5hCvfUbTf2sgFA==
dependencies:
camelcase "^5.3.1"
camelcase "^6.0.0"
cssesc "^3.0.0"
icss-utils "^4.1.1"
loader-utils "^1.2.3"
loader-utils "^2.0.0"
normalize-path "^3.0.0"
postcss "^7.0.32"
postcss-modules-extract-imports "^2.0.0"
postcss-modules-local-by-default "^3.0.2"
postcss-modules-local-by-default "^3.0.3"
postcss-modules-scope "^2.2.0"
postcss-modules-values "^3.0.0"
postcss-value-parser "^4.1.0"
schema-utils "^2.7.0"
semver "^6.3.0"
semver "^7.3.2"

css-select-base-adapter@^0.1.1:
version "0.1.1"
Expand Down Expand Up @@ -4741,7 +4746,7 @@ postcss-modules-extract-imports@^2.0.0:
dependencies:
postcss "^7.0.5"

postcss-modules-local-by-default@^3.0.2:
postcss-modules-local-by-default@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz#bb14e0cc78279d504dbdcbfd7e0ca28993ffbbb0"
integrity sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==
Expand Down Expand Up @@ -5494,6 +5499,11 @@ semver@^6.0.0, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==

semver@^7.3.2:
version "7.3.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938"
integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==

semver@~5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
Expand Down
2 changes: 1 addition & 1 deletion packages/base-driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@types/node": "^14.0.9",
"@types/resolve": "^1.17.1",
"rimraf": "^3.0.0",
"typescript": "^3.7.3"
"typescript": "~4.0.2"
},
"dependencies": {
"@sqltools/types": "latest",
Expand Down
2 changes: 1 addition & 1 deletion packages/driver.mssql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"lodash": "^4.17.19",
"mssql": "^5.0.5",
"rimraf": "^3.0.2",
"typescript": "^3.7.3",
"typescript": "~4.0.2",
"vsce": "1.77.0"
}
}
2 changes: 1 addition & 1 deletion packages/driver.mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"lodash": "^4.17.19",
"mysql": "^2.18.1",
"rimraf": "^3.0.2",
"typescript": "^3.7.3",
"typescript": "~4.0.2",
"vsce": "1.77.0"
}
}
2 changes: 1 addition & 1 deletion packages/driver.pg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"lodash": "^4.17.19",
"pg": "^8.2.1",
"rimraf": "^3.0.2",
"typescript": "^3.7.3",
"typescript": "~4.0.2",
"vsce": "1.77.0"
}
}
2 changes: 1 addition & 1 deletion packages/driver.sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"concurrently": "^5.2.0",
"esbuild": "0.6.26",
"rimraf": "^3.0.2",
"typescript": "^3.7.3",
"typescript": "~4.0.2",
"vsce": "1.77.0"
}
}
10 changes: 10 additions & 0 deletions packages/extension/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"endOfLine": "lf"
}
6 changes: 3 additions & 3 deletions packages/extension/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
},
{
"entries": {
"Settings": "../plugins/connection-manager/ui/screens/Settings/index.tsx",
"Results": "../plugins/connection-manager/ui/screens/Results/index.tsx",
"theme": "../plugins/connection-manager/ui/sass/theme.scss"
"Settings": "../plugins/connection-manager/webview/ui/screens/Settings/index.tsx",
"Results": "../plugins/connection-manager/webview/ui/screens/Results/index.tsx",
"theme": "../plugins/connection-manager/webview/ui/sass/theme.scss"
},
"type": "webview"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@
"jest-cli": "^24.5.0",
"lodash": "^4.17.19",
"ts-jest": "^24.0.2",
"typescript": "^3.7.3",
"typescript": "~4.0.2",
"vscode-test": "^1.2.3"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"jest": "^24.5.0",
"jest-cli": "^24.5.0",
"ts-jest": "^24.0.2",
"typescript": "^3.7.3"
"typescript": "~4.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/log/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"@types/pino": "^6.3.0",
"@types/vscode": "^1.47.0",
"rimraf": "^3.0.0",
"typescript": "^3.7.3"
"typescript": "~4.0.2"
}
}
25 changes: 25 additions & 0 deletions packages/log/src/lib/factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
import pino, { LoggerOptions, DestinationStream, Logger } from 'pino';

declare var window: any;

function factory(opts: LoggerOptions = {}, stream?: DestinationStream) {
if (typeof window !=='undefined' && window.navigator && process.env.PRODUCT === 'ui') {
const interpolate = (args: IArguments) => {
const newArgs = args[0].toString().split(/\s*\%[a-z]\s*/i);
return newArgs.reduce((a, p, i) => {
if (typeof p !== 'undefined') {
a.push(p)
}
if (typeof args[i + 1] !== 'undefined') {
a.push(args[i + 1])
}
return a;
}, []);
}

const logger = new Proxy({}, {
get(_: never, prop: string) {
if (prop === 'child') return () => logger;
return function() {(console[prop] || console.log).call(null, prop.toUpperCase(), ...interpolate(arguments));}
},
set() { throw new Error('SET')},
}) as Logger & { show: () => void; outputChannel?: { show: () => void } };
return logger;
};
const logger = pino({
name: process.env.PRODUCT || 'UNINDENTIFIED',
base: {},
Expand Down
10 changes: 10 additions & 0 deletions packages/plugins/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"endOfLine": "lf"
}
26 changes: 0 additions & 26 deletions packages/plugins/connection-manager/actions.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ export default connectionStateCache;

export const ACTIVE_CONNECTIONS_KEY = 'activeConnections';
export const LAST_USED_ID_KEY = 'lastUsedId';
export const CONNECTION_INFO_KEY = 'ConnectionSettingsForm';
4 changes: 2 additions & 2 deletions packages/plugins/connection-manager/extension-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Context from '@sqltools/vscode/context';
import PluginResourcesMap, { buildResouceKey } from '@sqltools/util/plugin-resources';
import { IDriverExtensionApi, IIcons } from '@sqltools/types';
import fs from 'fs';
import prepareSchema from './ui/lib/prepare-schema';
import { SettingsScreenState } from './ui/screens/Settings/interfaces';
import prepareSchema from './webview/lib/prepare-schema';
import { SettingsScreenState } from './webview/ui/screens/Settings/interfaces';
import { createLogger } from '@sqltools/log/src';

const log = createLogger('ext-util');
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/connection-manager/extension.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConnectionExplorer, SidebarConnection, SidebarItem } from '@sqltools/plugins/connection-manager/explorer';
import ResultsWebviewManager from '@sqltools/plugins/connection-manager/screens/results';
import SettingsWebview from '@sqltools/plugins/connection-manager/screens/settings';
import ResultsWebviewManager from '@sqltools/plugins/connection-manager/webview/results';
import SettingsWebview from '@sqltools/plugins/connection-manager/webview/settings';
import { ContextValue, IConnection, IExtension, IExtensionPlugin, ILanguageClient, IQueryOptions, NSDatabase, RequestHandler } from '@sqltools/types';
import Config from '@sqltools/util/config-manager';
import { getConnectionDescription, getConnectionId, getSessionBasename, migrateConnectionSettings } from '@sqltools/util/connection';
Expand Down
14 changes: 0 additions & 14 deletions packages/plugins/connection-manager/ui/components/Themed/index.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions packages/plugins/connection-manager/ui/sass/generic.m.scss

This file was deleted.

5 changes: 0 additions & 5 deletions packages/plugins/connection-manager/ui/sass/lib/_mixins.scss

This file was deleted.