Skip to content

Commit

Permalink
Dependency update (#303)
Browse files Browse the repository at this point in the history
* updating depedencie and vscode engine, #300

* updating webpack config to use terser plugin. Cleaning up code, #300

* changed clipboard copy lib, #300
  • Loading branch information
nehashri authored Nov 19, 2018
1 parent 9e4e8a8 commit 4151d7b
Show file tree
Hide file tree
Showing 26 changed files with 1,020 additions and 1,059 deletions.
1,944 changes: 945 additions & 999 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 19 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"version": "0.0.8",
"publisher": "getgauge",
"engines": {
"vscode": "^1.25.0"
"vscode": "^1.28.2"
},
"categories": [
"Languages"
Expand Down Expand Up @@ -284,29 +284,28 @@
"publish": "vsce publish"
},
"devDependencies": {
"@types/fs-extra": "^5.0.1",
"@types/mocha": "^2.2.42",
"@types/node": "^9.6.14",
"cross-env": "^5.1.4",
"ts-loader": "4.0.1",
"tslint": "5.9.1",
"typescript": "^2.8.3",
"uglify-es": "3.3.9",
"uglifyjs-webpack-plugin": "1.2.2",
"vsce": "^1.40.0",
"vscode": "^1.1.18",
"webpack": "4.23.1",
"@types/fs-extra": "^5.0.4",
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.5",
"cross-env": "^5.2.0",
"ts-loader": "5.3.0",
"tslint": "^5.11.0",
"typescript": "^3.1.6",
"terser-webpack-plugin": "1.1.0",
"vsce": "^1.53.0",
"vscode": "^1.1.21",
"webpack": "4.25.1",
"webpack-cli": "^3.1.2",
"webpack-node-externals": "^1.7.2"
},
"dependencies": {
"adm-zip": "^0.4.11",
"copy-paste": "^1.3.0",
"fs-extra": "5.0.0",
"get-port": "^3.2.0",
"opn": "^5.1.0",
"vscode-jsonrpc": "^3.6.0",
"vscode-languageclient": "^4.0.0",
"vscode-languageserver-protocol": "^3.6.0"
"clipboardy": "^1.2.3",
"fs-extra": "^7.0.1",
"get-port": "^4.0.0",
"opn": "^5.4.0",
"vscode-jsonrpc": "^4.0.0",
"vscode-languageclient": "^5.1.1",
"vscode-languageserver-protocol": "^3.13.0"
}
}
6 changes: 4 additions & 2 deletions src/annotator/generateStub.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
'use strict';

import { LanguageClient } from "vscode-languageclient";
import { commands, workspace, window, CancellationTokenSource, Disposable } from "vscode";
import * as path from 'path';

import copyPaste = require("copy-paste");
import clipboardy = require("clipboardy");

import { GaugeVSCodeCommands, GaugeRequests, NEW_FILE, COPY_TO_CLIPBOARD } from "../constants";
import { FileListItem } from "../types/fileListItem";
Expand Down Expand Up @@ -45,7 +47,7 @@ export class GenerateStubCommandProvider implements Disposable {
window.showQuickPick(this.getFileLists(files, cwd)).then((selected: FileListItem) => {
if (!selected) return;
if (selected.isCopyToClipBoard()) {
copyPaste.copy(code);
clipboardy.writeSync(code);
window.showInformationMessage("Step Implementation copied to clipboard");
} else {
let params = { implementationFilePath: selected.value, codes: [code] };
Expand Down
2 changes: 2 additions & 0 deletions src/config/configProvider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { Disposable, ExtensionContext, window, commands, workspace, ConfigurationTarget } from "vscode";
import { VSCodeCommands, GaugeVSCodeCommands } from "../constants";

Expand Down
2 changes: 0 additions & 2 deletions src/explorer/specExplorer.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
'use strict';

import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import { LanguageClient, TextDocumentIdentifier } from 'vscode-languageclient';
import { GaugeVSCodeCommands, GaugeRequests, setCommandContext, GaugeCommandContext } from '../constants';
import {
commands, workspace, TextDocument, Uri, Position, Range, window,
TextDocumentShowOptions, TextEditor, Disposable
} from 'vscode';
import { GaugeExecutor } from '../execution/gaugeExecutor';
import { GaugeWorkspace } from '../gaugeWorkspace';

const extensions = [".spec", ".md"];
Expand Down
2 changes: 0 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
import * as path from 'path';

import {
workspace, ExtensionContext, extensions,
Expand All @@ -18,7 +17,6 @@ import { ProjectInitializer } from './init/projectInit';
import { ConfigProvider } from './config/configProvider';
import { isGaugeProject } from './util';
import { showWelcomePage } from './pages/welcome';
import { execSync } from 'child_process';

const GAUGE_EXTENSION_ID = 'getgauge.gauge';
const GAUGE_VSCODE_VERSION = 'gauge.version';
Expand Down
2 changes: 2 additions & 0 deletions src/file/specificationFileProvider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import * as fs from "fs-extra";
import * as path from "path";
import { EOL } from "os";
Expand Down
2 changes: 2 additions & 0 deletions src/gaugeReference.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { Disposable, commands, workspace, Uri, CancellationTokenSource, window } from "vscode";
import { GaugeVSCodeCommands, VSCodeCommands } from "./constants";
import {
Expand Down
2 changes: 2 additions & 0 deletions src/gaugeState.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { Disposable, ExtensionContext } from "vscode";
import * as path from 'path';
import { LAST_REPORT_PATH } from "./constants";
Expand Down
2 changes: 2 additions & 0 deletions src/gaugeVersion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { spawnSync } from 'child_process';
import { GaugeCommands } from './constants';
import { getGaugeCommand } from './util';
Expand Down
10 changes: 5 additions & 5 deletions src/gaugeWorkspace.proposed.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

import { workspace, Disposable } from 'vscode';
import { DynamicFeature, RegistrationData, BaseLanguageClient, NextSignature } from 'vscode-languageclient';
import { DynamicFeature, RegistrationData, BaseLanguageClient } from 'vscode-languageclient';

import {
ClientCapabilities, InitializedParams, RPCMessageType, CancellationToken
} from 'vscode-languageserver-protocol';
import { ClientCapabilities, InitializedParams, RPCMessageType } from 'vscode-languageserver-protocol';

import { SaveFilesRequest, GaugeClientCapabilities } from './protocol/gauge.proposed';

Expand All @@ -28,7 +28,7 @@ export class GaugeWorkspaceFeature implements DynamicFeature<undefined> {

public initialize(): void {
let client = this._client;
client.onRequest(SaveFilesRequest.type, (token: CancellationToken) => {
client.onRequest(SaveFilesRequest.type, () => {
return workspace.saveAll(false).then(() => {
return null;
});
Expand Down
4 changes: 3 additions & 1 deletion src/init/projectInit.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
'use strict';

import * as os from 'os';
import * as path from 'path';
import { get } from 'https';

import * as fs from 'fs-extra';

import { ExtensionContext, Disposable, commands, window, Uri, workspace, QuickPickItem, Progress } from 'vscode';
import { Disposable, commands, window, Uri, workspace, Progress } from 'vscode';

import AdmZip = require('adm-zip');

Expand Down
2 changes: 2 additions & 0 deletions src/pages/page.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

export interface Page {
content(activated: Boolean): string | Thenable<string>;
}
2 changes: 2 additions & 0 deletions src/pages/provider.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { TextDocumentContentProvider, Disposable, Uri, Event, ExtensionContext, EventEmitter, workspace } from "vscode";
import { Page } from "./page";
import { WelcomePage } from "./welcome";
Expand Down
4 changes: 3 additions & 1 deletion src/pages/report.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Disposable, workspace, Uri, ExtensionContext, commands, ViewColumn, window} from 'vscode';
'use strict';

import {Disposable, workspace, Uri, ExtensionContext, commands, ViewColumn} from 'vscode';
import {Page} from "./page";
import * as path from 'path';
import {LAST_REPORT_PATH, GaugeVSCodeCommands, VSCodeCommands, REPORT_URI} from "../constants";
Expand Down
2 changes: 2 additions & 0 deletions src/pages/welcome.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { Disposable, Uri, workspace, commands, ViewColumn, window, ExtensionContext, TextDocument } from "vscode";
import { GaugeVSCodeCommands, VSCodeCommands, WELCOME_PAGE_URI } from "../constants";
import * as path from 'path';
Expand Down
2 changes: 2 additions & 0 deletions src/pages/welcomePageTokenReplace.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { spawnSync } from "child_process";
import { getGaugeVersionInfo } from '../gaugeVersion';

Expand Down
2 changes: 2 additions & 0 deletions src/refactor/workspaceEditor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import {
WorkspaceEdit, window, workspace, TextDocument, TextEdit, Uri, TextEditor,
TextDocumentShowOptions, Position, Range
Expand Down
2 changes: 2 additions & 0 deletions src/terminal/terminal.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { Disposable, window, ExtensionContext, commands, Terminal } from "vscode";
import { GaugeVSCodeCommands } from "../constants";

Expand Down
3 changes: 2 additions & 1 deletion src/types/fileListItem.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as path from 'path';
'use strict';

import { QuickPickItem } from 'vscode';
import { COPY_TO_CLIPBOARD } from '../constants';

Expand Down
3 changes: 1 addition & 2 deletions test/execution/execution.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as assert from 'assert';
import * as path from 'path';
import { TextDocument } from 'vscode-languageclient/lib/main';
import { Uri, commands, window, workspace } from 'vscode';
import { GaugeVSCodeCommands, REPORT_URI } from '../../src/constants';

Expand Down Expand Up @@ -48,7 +47,7 @@ suite('Gauge Execution Tests', () => {

test('should execute scenario at cursor', async () => {
let specFile = Uri.file(path.join(testDataPath, 'specs', 'example.spec'));
let editor = await window.showTextDocument(specFile);
await window.showTextDocument(specFile);
await commands.executeCommand("workbench.action.focusFirstEditorGroup");
let cm = { to: 'down', by: 'line', value: 8 };
await commands.executeCommand("cursorMove", cm);
Expand Down
2 changes: 0 additions & 2 deletions test/gauge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import * as vscode from 'vscode';
import * as path from 'path';

suite('Gauge Extension Tests', () => {
let testDataPath = path.join(__dirname, '..', '..', 'test', 'testdata', 'sampleProject');

test('should activate when manifest file found in path', () => {
assert.ok(vscode.extensions.getExtension('getgauge.gauge').isActive);
});
Expand Down
2 changes: 1 addition & 1 deletion test/pages/welcome.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as assert from 'assert';
import { commands, window, workspace } from 'vscode';
import { commands, workspace } from 'vscode';
import { GaugeVSCodeCommands, WELCOME_PAGE_URI } from '../../src/constants';

suite('Welcome Page', () => {
Expand Down
2 changes: 0 additions & 2 deletions test/pages/welcomePageTokenReplace.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import * as assert from 'assert';
import { WelcomePageTokenReplace } from '../../src/pages/welcomePageTokenReplace';
import * as vscode from 'vscode';
import { platform } from 'os';

suite('Welcome Page', () => {
setup(() => {
Expand Down
24 changes: 10 additions & 14 deletions test/references.test.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import * as assert from 'assert';
import { commands, Uri, window } from 'vscode';
import * as path from 'path';
import vscode = require('vscode');
import { TextDocument } from 'vscode-languageclient/lib/main';
import { connect } from 'tls';

let testDataPath = path.join(__dirname, '..', '..', 'test', 'testdata', 'sampleProject');

suite('Gauge References Tests', () => {
setup(async () => {
await vscode.commands.executeCommand('workbench.action.closeAllEditors');
await commands.executeCommand('workbench.action.closeAllEditors');
});

test('should show references for step at cursor', async () => {
let specFile = vscode.Uri.file(path.join(testDataPath, 'tests', 'step_implementation.js'));
let editor = await vscode.window.showTextDocument(specFile)
await vscode.commands.executeCommand("workbench.action.focusFirstEditorGroup")
await vscode.commands.executeCommand("cursorMove", { to: 'down', by: 'line', value: 18 })
let value = await vscode.commands.executeCommand('gauge.showReferences.atCursor')
let implFile = Uri.file(path.join(testDataPath, 'tests', 'step_implementation.js'));
await window.showTextDocument(implFile);
await commands.executeCommand("workbench.action.focusFirstEditorGroup");
await commands.executeCommand("cursorMove", { to: 'down', by: 'line', value: 18 });
let value = await commands.executeCommand('gauge.showReferences.atCursor');
assert.ok(value);
}).timeout(10000);

test('should not show any reference if cursor is not in step context', async () => {
let specFile = vscode.Uri.file(path.join(testDataPath, 'tests', 'step_implementation.js'));
let editor = await vscode.window.showTextDocument(specFile);
await vscode.commands.executeCommand("workbench.action.focusFirstEditorGroup");
await vscode.commands.executeCommand("cursorMove", { to: 'down', by: 'line', value: 20 });
let value = vscode.commands.executeCommand('gauge.showReferences.atCursor')
await commands.executeCommand("workbench.action.focusFirstEditorGroup");
await commands.executeCommand("cursorMove", { to: 'down', by: 'line', value: 20 });
let value = commands.executeCommand('gauge.showReferences.atCursor');
assert.notEqual(value, true);
}).timeout(10000);
});
10 changes: 5 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const webpack = require('webpack');
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');

module.exports = function(env, argv) {
if (env === undefined) {
Expand All @@ -14,11 +14,11 @@ module.exports = function(env, argv) {
const sourceMaps = !env.production;

const plugins = [
new webpack.optimize.ModuleConcatenationPlugin(),
new UglifyJsPlugin({
new webpack.optimize.ModuleConcatenationPlugin(),
new TerserPlugin({
parallel: true,
sourceMap: sourceMaps,
uglifyOptions: {
terserOptions: {
ecma: 8,
compress: minify ? {} : false,
mangle: minify,
Expand All @@ -45,7 +45,7 @@ module.exports = function(env, argv) {
externals: [
nodeExternals()
],
devtool: sourceMaps ? 'inline-source-map' : false,
devtool: sourceMaps ? 'source-map' : false,
module: {
rules: [
{
Expand Down

0 comments on commit 4151d7b

Please sign in to comment.