Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,36 @@

// A task runner that calls a custom npm script that compiles the extension.
{
"version": "0.1.0",
"version": "2.0.0",

// we want to run npm
"command": "npm",

// the command is a shell script
"isShellCommand": true,

// show the output window only if unrecognized errors occur.
"showOutput": "silent",

// we run the custom script "compile" as defined in package.json
"args": ["run", "compile", "--loglevel", "silent"],

// The tsc compiler is started in watching mode
"isWatching": true,

// use the standard tsc in watch mode problem matcher to find compile problems in the output.
"problemMatcher": "$tsc-watch"
"problemMatcher": "$tsc-watch",
"tasks": [
{
"label": "npm",
"type": "shell",
"command": "npm",
"args": [
"run",
"compile",
"--loglevel",
"silent"
],
"isBackground": true,
"problemMatcher": "$tsc-watch",
"group": {
"_id": "build",
"isDefault": false
}
}
]
}
25 changes: 25 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const production = process.argv[2] === "--production";
const watch = process.argv[2] === "--watch";

require("esbuild")
.build({
entryPoints: ["./src/extension.ts"],
bundle: true,
outdir: "out",
external: ["vscode"],
format: "cjs",
sourcemap: !production,
minify: production,
platform: "node",
target: ["node12"],
watch: watch && {
onRebuild(error) {
if (error) console.error("watch build failed:", error);
else console.log("watch build succeeded");
}
}
})
.catch(e => {
console.error(e);
process.exit(1);
});
144 changes: 144 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"version": "1.15.0",
"publisher": "sysoev",
"engines": {
"vscode": "^1.18.0"
"vscode": "^1.60.0"
},
"categories": [
"Other"
Expand All @@ -24,7 +24,7 @@
"url": "https://github.com/d4rkr00t/vscode-open-in-github.git"
},
"bugs": "https://github.com/d4rkr00t/vscode-open-in-github/issues",
"main": "./out/src/extension",
"main": "./out/extension",
"icon": "assets/icon.jpg",
"activationEvents": [
"onCommand:openInGithub.openInGitHubFile",
Expand Down Expand Up @@ -113,21 +113,22 @@
}
},
"scripts": {
"vscode:prepublish": "./node_modules/.bin/tsc -p ./",
"compile": "tsc -watch -p ./",
"build": "tsc -p ./",
"vscode:prepublish": "node ./build.js --production",
"compile": "node ./build.js",
"watch": "node ./build.js --watch",
"lint:staged": "lint-staged --no-stash",
"postinstall": "node ./node_modules/vscode/bin/install"
},
"devDependencies": {
"@types/mocha": "^5.2.5",
"@types/node": "^10.12.3",
"@types/ramda": "^0.25.41",
"typescript": "^3.1.6",
"vscode": "^1.1.37",
"esbuild": "^0.13.15",
"lint-staged": "^10.1.3",
"pre-commit": "^1.2.2",
"prettier": "^1.19.1"
"prettier": "^1.19.1",
"typescript": "^3.1.6",
"vscode": "^1.1.37"
},
"lint-staged": {
"*.ts": [
Expand Down
23 changes: 9 additions & 14 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "out",
"lib": [
"es6"
],
"sourceMap": true,
"rootDir": "."
},
"exclude": [
"node_modules",
".vscode-test"
]
"compilerOptions": {
"module": "commonjs",
"target": "ES2020",
"outDir": "out",
"lib": ["ES2020"],
"sourceMap": true,
"rootDir": "."
},
"exclude": ["node_modules", ".vscode-test"]
}