Skip to content

Commit

Permalink
fix(package): installation problem resolved
Browse files Browse the repository at this point in the history
There was an error with resolving package.json file by telemetry script.
  • Loading branch information
rafalwolak committed Aug 17, 2019
1 parent 306a4fd commit 378995a
Show file tree
Hide file tree
Showing 53 changed files with 248 additions and 402 deletions.
2 changes: 1 addition & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ plugins:
- dist/**/*.{js,css}
- docs
- package.json
message: 'chore(release): ${nextRelease.version} [skip ci] ${nextRelease.notes}'
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
3 changes: 0 additions & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
out/test/**
test/**
src/**
i18n
node_modules/**/test/**
node_modules
**/*.map
*.log
Expand All @@ -16,5 +14,4 @@ tsconfig.json
tslint.json
vsc-extension-quickstart.md
*.yml
gulpfile.js
webpack.config.js
File renamed without changes.
3 changes: 0 additions & 3 deletions i18n/pl/out/commands/workspace/deleteWorkspace.i18n.json

This file was deleted.

3 changes: 0 additions & 3 deletions i18n/pl/out/commands/workspace/switchWorkspace.i18n.json

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion i18n/pl/out/extension.i18n.json

This file was deleted.

20 changes: 0 additions & 20 deletions i18n/pl/package.i18n.json

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Workspace manager for Visual Studio Code",
"version": "1.0.1",
"publisher": "design4pro",
"icon": "resources/workspace.png",
"homepage": "https://github.com/design4pro/vscode-workspace-manager",
"repository": {
"type": "git",
Expand Down Expand Up @@ -174,7 +175,7 @@
{
"id": "workspaceManager",
"title": "Workspace Manager",
"icon": "media/workspace.svg",
"icon": "resources/workspace.svg",
"when": "workspace-manager:enabled && !workspace-manager:empty"
}
]
Expand Down
19 changes: 0 additions & 19 deletions package.nls.json

This file was deleted.

Binary file added resources/workspace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
8 changes: 3 additions & 5 deletions src/cache/cache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';

import { ExtensionContext } from 'vscode';
import * as vscode from 'vscode';
import { state } from '../state';

/**
Expand All @@ -13,13 +11,13 @@ import { state } from '../state';
const now = (): number => Math.floor(Date.now() / 1000);

export class Cache {
context: ExtensionContext;
context: vscode.ExtensionContext;
namespace: string;
cache: any;

constructor(namespace?: string) {
// ExtensionContext
this.context = <ExtensionContext>state.context;
this.context = <vscode.ExtensionContext>state.context;

// Namespace of the context's globalState
this.namespace = namespace || 'cache';
Expand Down
6 changes: 2 additions & 4 deletions src/cache/cacheWorkspace.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

import * as VError from 'verror';
import { window } from 'vscode';
import * as vscode from 'vscode';
import { Logger } from '../logger';
import { CacheWorkspaceEntries } from './cacheWorkspaceEntries';

Expand All @@ -16,7 +14,7 @@ export async function cacheWorkspace(): Promise<void> {
} catch (err) {
err = new VError(err, 'Failed to cache the workspace entries');
Logger.error(err);
window.showErrorMessage(err.message);
vscode.window.showErrorMessage(err.message);
} finally {
CacheWorkspaceEntries.caching = false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/cache/cacheWorkspaceEntries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import { notifier } from '../extension';
import { Logger } from '../logger';
import { getWorkspaceEntries } from '../util/getWorkspaceEntries';
Expand Down
2 changes: 0 additions & 2 deletions src/commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

export * from './commands/common';
export * from './commands/common/refreshTreeData';
export * from './commands/workspace/cacheWorkspace';
Expand Down
28 changes: 13 additions & 15 deletions src/commands/abstractCommand.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
'use strict';

import * as uuid from 'uuid/v4';
import * as VError from 'verror';
import { commands, Disposable, TextEditor, Uri } from 'vscode';
import * as vscode from 'vscode';
import { Commands } from './common';
import { Logger } from '../logger';
import { Reporter } from '../telemetry';
Expand All @@ -14,8 +12,8 @@ export interface CommandContextParsingOptions {

export interface CommandBaseContext {
command: string;
editor?: TextEditor;
uri?: Uri;
editor?: vscode.TextEditor;
uri?: vscode.Uri;
}

export interface CommandUnknownContext extends CommandBaseContext {
Expand All @@ -28,15 +26,15 @@ export interface CommandUriContext extends CommandBaseContext {

export interface CommandUrisContext extends CommandBaseContext {
type: 'uris';
uris: Uri[];
uris: vscode.Uri[];
}

export type CommandContext =
| CommandUnknownContext
| CommandUriContext
| CommandUrisContext;

export abstract class AbstractCommand implements Disposable {
export abstract class AbstractCommand implements vscode.Disposable {
protected trackSuccess: boolean = false;
protected eventName?: string;

Expand All @@ -45,25 +43,25 @@ export abstract class AbstractCommand implements Disposable {
uri: false
};

private _disposable: Disposable;
private _disposable: vscode.Disposable;

constructor(command: Commands | Commands[]) {
if (typeof command === 'string') {
this._disposable = commands.registerCommand(
this._disposable = vscode.commands.registerCommand(
command,
(...args: any[]) => this._execute(command, ...args),
this
);
} else {
const subscriptions = (<any>command).map((cmd: string) =>
commands.registerCommand(
vscode.commands.registerCommand(
cmd,
(...args: any[]) => this._execute(cmd, ...args),
this
)
);

this._disposable = Disposable.from(...subscriptions);
this._disposable = vscode.Disposable.from(...subscriptions);
}
}

Expand Down Expand Up @@ -132,12 +130,12 @@ export abstract class AbstractCommand implements Disposable {
options: CommandContextParsingOptions,
...args: any[]
): [CommandContext, any[]] {
let editor: TextEditor | undefined = undefined;
let editor: vscode.TextEditor | undefined = undefined;

let firstArg = args[0];

if (options.uri && (firstArg === null || firstArg instanceof Uri)) {
const [uri, ...rest] = args as [Uri, any];
if (options.uri && (firstArg === null || firstArg instanceof vscode.Uri)) {
const [uri, ...rest] = args as [vscode.Uri, any];

if (uri !== undefined) {
const uris = rest[0];
Expand All @@ -146,7 +144,7 @@ export abstract class AbstractCommand implements Disposable {
uris !== null &&
Array.isArray(uris) &&
uris.length !== 0 &&
uris[0] instanceof Uri
uris[0] instanceof vscode.Uri
) {
return [
{
Expand Down
6 changes: 2 additions & 4 deletions src/commands/common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';

import { ExtensionContext } from 'vscode';
import * as vscode from 'vscode';
import { AbstractCommand } from './abstractCommand';

export enum Commands {
Expand All @@ -26,7 +24,7 @@ export function Command(): ClassDecorator {
};
}

export function registerCommands(context: ExtensionContext): void {
export function registerCommands(context: vscode.ExtensionContext): void {
for (const c of registrableCommands) {
context.subscriptions.push(new c());
}
Expand Down
8 changes: 3 additions & 5 deletions src/commands/common/refreshTreeData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';

import { commands } from 'vscode';
import * as vscode from 'vscode';
import { cacheWorkspace } from '../../cache/cacheWorkspace';
import { ViewsCommands } from '../../views/common';
import { AbstractCommand } from '../abstractCommand';
Expand All @@ -17,8 +15,8 @@ export class RefreshTreeData extends AbstractCommand {
async execute() {
await cacheWorkspace();

commands.executeCommand(ViewsCommands.ActiveBarRefresh);
commands.executeCommand(ViewsCommands.ExplorerRefresh);
vscode.commands.executeCommand(ViewsCommands.ActiveBarRefresh);
vscode.commands.executeCommand(ViewsCommands.ExplorerRefresh);

return;
}
Expand Down
6 changes: 2 additions & 4 deletions src/commands/workspace/cacheWorkspace.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';

import { commands } from 'vscode';
import * as vscode from 'vscode';
import { cacheWorkspace } from '../../cache/cacheWorkspace';
import { AbstractCommand } from '../abstractCommand';
import { Command, Commands } from '../common';
Expand All @@ -16,6 +14,6 @@ export class CacheWorkspace extends AbstractCommand {
async execute() {
await cacheWorkspace();

commands.executeCommand(Commands.RefreshTreeData);
vscode.commands.executeCommand(Commands.RefreshTreeData);
}
}
2 changes: 0 additions & 2 deletions src/commands/workspace/closeWorkspace.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

import * as vscode from 'vscode';
import { Command, Commands } from '../common';
import { AbstractCommand } from '../abstractCommand';
Expand Down
28 changes: 9 additions & 19 deletions src/commands/workspace/deleteWorkspace.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
'use strict';

// import * as nls from 'vscode-nls';
import { getWorkspaceEntries } from '../../util/getWorkspaceEntries';
import { window, QuickPickItem, QuickPickOptions } from 'vscode';
import * as vscode from 'vscode';
import { WorkspaceEntry } from '../../model/workspace';
import { deleteWorkspace } from '../../util/deleteWorkspace';
import { Command, Commands } from '../common';
import { getWorkspaceEntries } from '../../util/getWorkspaceEntries';
import { AbstractCommand } from '../abstractCommand';
import { WorkspaceEntry } from '../../model/workspace';

// const localize = nls.loadMessageBundle();
import { Command, Commands } from '../common';

@Command()
export class DeleteWorkspaceCommand extends AbstractCommand {
Expand All @@ -20,32 +15,27 @@ export class DeleteWorkspaceCommand extends AbstractCommand {
let workspaceEntries = await getWorkspaceEntries();

if (!workspaceEntries || !workspaceEntries.length) {
// const noWorkspacesFoundText = localize(
// 'noWorkspacesFound.text',
// 'No workspaces entries found'
// );

window.showInformationMessage('No workspaces entries found');
vscode.window.showInformationMessage('No workspaces entries found');

return;
}

const workspaceItems = workspaceEntries.map(
entry =>
<QuickPickItem>{
<vscode.QuickPickItem>{
label: entry.name,
description: entry.path
}
);

const options = <QuickPickOptions>{
const options = <vscode.QuickPickOptions>{
matchOnDescription: false,
matchOnDetail: false,
placeHolder: `Choose a workspace to delete...`
};

window.showQuickPick(workspaceItems, options).then(
(workspaceItem?: QuickPickItem) => {
vscode.window.showQuickPick(workspaceItems, options).then(
(workspaceItem?: vscode.QuickPickItem) => {
if (!workspaceItem || !workspaceEntries) {
return;
}
Expand Down
Loading

0 comments on commit 378995a

Please sign in to comment.