Update logger

This commit is contained in:
Kyle Carberry 2019-04-17 17:47:02 -04:00
parent 50e6108012
commit e0f1787ce6
No known key found for this signature in database
GPG Key ID: A0409BDB6B0B3EDB
4 changed files with 1363 additions and 14 deletions

View File

@ -5,7 +5,7 @@
"build": "tsc -p tsconfig.build.json && cp ./out/packages/logger/src/* ./out && rm -rf out/packages && ../../node_modules/.bin/webpack --config ./webpack.config.js", "build": "tsc -p tsconfig.build.json && cp ./out/packages/logger/src/* ./out && rm -rf out/packages && ../../node_modules/.bin/webpack --config ./webpack.config.js",
"postinstall": "if [ ! -d out ];then npm run build; fi" "postinstall": "if [ ! -d out ];then npm run build; fi"
}, },
"version": "1.1.0", "version": "1.1.3",
"main": "out/main.js", "main": "out/main.js",
"types": "out/index.d.ts", "types": "out/index.d.ts",
"author": "Coder", "author": "Coder",

View File

@ -1,16 +1,34 @@
const path = require("path"); const path = require("path");
const merge = require("webpack-merge"); const merge = require("webpack-merge");
module.exports = merge(require(path.join(__dirname, "../../scripts", "webpack.general.config.js"))(), { module.exports = [
devtool: "none", merge(require(path.join(__dirname, "../../scripts", "webpack.general.config.js"))(), {
mode: "production", devtool: "none",
target: "node", mode: "production",
output: { target: "node",
path: path.join(__dirname, "out"), output: {
filename: "main.js", path: path.join(__dirname, "out"),
libraryTarget: "commonjs", filename: "main.js",
}, libraryTarget: "commonjs",
entry: [ },
"./packages/logger/src/index.ts" entry: [
], "./packages/logger/src/index.ts"
}); ],
}),
merge(require(path.join(__dirname, "../../scripts", "webpack.general.config.js"))(), {
devtool: "none",
mode: "production",
target: "node",
output: {
path: path.join(__dirname, "out"),
filename: "extender.js",
libraryTarget: "commonjs",
},
externals: {
"@google-cloud/logging": "commonjs @google-cloud/logging",
},
entry: [
"./packages/logger/src/extender.ts"
],
}),
];

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@ import { IFileService, FileOperation } from "vs/platform/files/common/files";
import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles"; import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles";
import { IModelService } from "vs/editor/common/services/modelService"; import { IModelService } from "vs/editor/common/services/modelService";
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal"; import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
import { IStorageService } from "vs/platform/storage/common/storage";
// NOTE: shouldn't import anything from VS Code here or anything that will // NOTE: shouldn't import anything from VS Code here or anything that will
// depend on a synchronous fill like `os`. // depend on a synchronous fill like `os`.
@ -38,6 +39,14 @@ class VSClient extends IdeClient {
// tslint:disable-next-line:no-any // tslint:disable-next-line:no-any
statusbarService: getService<IStatusbarService>(IStatusbarService) as any, statusbarService: getService<IStatusbarService>(IStatusbarService) as any,
notificationService: getService<INotificationService>(INotificationService), notificationService: getService<INotificationService>(INotificationService),
storageService: {
save: (): Promise<void> => {
// tslint:disable-next-line:no-any
const storageService = getService<IStorageService>(IStorageService) as any;
return storageService.close();
},
},
onFileCreate: (cb): void => { onFileCreate: (cb): void => {
getService<IFileService>(IFileService).onAfterOperation((e) => { getService<IFileService>(IFileService).onAfterOperation((e) => {