Browse Source

Switches to es2017 output

Uses import() for copy/paste and tmp
main
Eric Amodio 7 years ago
parent
commit
f25ca41300
6 changed files with 16 additions and 16 deletions
  1. +4
    -3
      src/commands/copyMessageToClipboard.ts
  2. +3
    -3
      src/commands/copyShaToClipboard.ts
  3. +0
    -1
      src/config.ts
  4. +2
    -1
      src/git/git.ts
  5. +3
    -3
      tsconfig.json
  6. +4
    -5
      webpack.config.js

+ 4
- 3
src/commands/copyMessageToClipboard.ts View File

@ -5,7 +5,6 @@ import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommand
import { Container } from '../container';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import { copy } from 'copy-paste';
export interface CopyMessageToClipboardCommandArgs {
message?: string;
@ -31,6 +30,8 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
async execute(editor?: TextEditor, uri?: Uri, args: CopyMessageToClipboardCommandArgs = {}): Promise<any> {
uri = getCommandUri(uri, editor);
const clipboard = await import('copy-paste');
try {
args = { ...args };
@ -43,7 +44,7 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
if (!log) return undefined;
args.message = Iterables.first(log.commits.values()).message;
copy(args.message);
clipboard.copy(args.message);
return undefined;
}
@ -80,7 +81,7 @@ export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
args.message = commit.message;
}
copy(args.message);
clipboard.copy(args.message);
return undefined;
}
catch (ex) {

+ 3
- 3
src/commands/copyShaToClipboard.ts View File

@ -5,7 +5,6 @@ import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommand
import { Container } from '../container';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import { copy } from 'copy-paste';
export interface CopyShaToClipboardCommandArgs {
sha?: string;
@ -30,6 +29,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
async execute(editor?: TextEditor, uri?: Uri, args: CopyShaToClipboardCommandArgs = {}): Promise<any> {
uri = getCommandUri(uri, editor);
const clipboard = await import('copy-paste');
try {
args = { ...args };
@ -42,7 +42,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
if (!log) return undefined;
args.sha = Iterables.first(log.commits.values()).sha;
copy(args.sha);
clipboard.copy(args.sha);
return undefined;
}
@ -66,7 +66,7 @@ export class CopyShaToClipboardCommand extends ActiveEditorCommand {
}
}
copy(args.sha);
clipboard.copy(args.sha);
return undefined;
}
catch (ex) {

+ 0
- 1
src/config.ts View File

@ -172,7 +172,6 @@ export interface ICodeLensConfig {
scopes: CodeLensScopes[];
scopesByLanguage: CodeLensLanguageScope[];
symbolScopes: string[];
}
export interface IExplorersConfig {

+ 2
- 1
src/git/git.ts View File

@ -6,7 +6,6 @@ import { CommandOptions, runCommand } from './shell';
import * as fs from 'fs';
import * as iconv from 'iconv-lite';
import * as path from 'path';
import * as tmp from 'tmp';
export { IGit };
export * from './models/models';
@ -186,6 +185,8 @@ export class Git {
const suffix = Strings.truncate(Strings.sanitizeForFileSystem(Git.isSha(ref) ? Git.shortenSha(ref) : ref), 50, '');
const ext = path.extname(fileName);
const tmp = await import('tmp');
return new Promise<string>((resolve, reject) => {
tmp.file({ prefix: `${path.basename(fileName, ext)}-${suffix}__`, postfix: ext },
(err, destination, fd, cleanupCallback) => {

+ 3
- 3
tsconfig.json View File

@ -2,8 +2,8 @@
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": [ "es2015", "es2016" ],
"module": "es2015",
"lib": [ "es2015", "es2016", "es2017" ],
"module": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
@ -14,7 +14,7 @@
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es2016"
"target": "es2017"
},
"exclude": [
"node_modules",

+ 4
- 5
webpack.config.js View File

@ -18,13 +18,12 @@ module.exports = function(env, argv) {
parallel: true,
sourceMap: sourceMaps,
uglifyOptions: {
ecma: 7,
compress: minify,
ecma: 8,
compress: minify ? {} : false,
mangle: minify,
output: {
beautify: !minify,
comments: false,
ecma: 7
comments: false
},
sourceMap: sourceMaps,
}
@ -50,7 +49,7 @@ module.exports = function(env, argv) {
rules: [
{
test: /\.ts$/,
use: 'ts-loader',
use: [{ loader: 'ts-loader' }],
exclude: /node_modules/
}
]

||||||
x
 
000:0
Loading…
Cancel
Save