-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nagarjun Sanji
committed
Jul 4, 2024
1 parent
c7356db
commit 31992fa
Showing
5 changed files
with
141 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"tabWidth": 4, | ||
"endOfLine": "auto" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { defineConfig } from '@vscode/test-cli'; | ||
import { defineConfig } from "@vscode/test-cli"; | ||
|
||
export default defineConfig({ | ||
files: 'out/test/**/*.test.js', | ||
mocha: { | ||
ui: 'bdd' | ||
} | ||
files: "out/test/**/*.test.js", | ||
mocha: { | ||
ui: "bdd", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
const esbuild = require("esbuild"); | ||
|
||
const production = process.argv.includes('--production'); | ||
const watch = process.argv.includes('--watch'); | ||
const production = process.argv.includes("--production"); | ||
const watch = process.argv.includes("--watch"); | ||
|
||
/** | ||
* @type {import('esbuild').Plugin} | ||
*/ | ||
const esbuildProblemMatcherPlugin = { | ||
name: 'esbuild-problem-matcher', | ||
name: "esbuild-problem-matcher", | ||
|
||
setup(build) { | ||
build.onStart(() => { | ||
console.log('[watch] build started'); | ||
}); | ||
build.onEnd((result) => { | ||
result.errors.forEach(({ text, location }) => { | ||
console.error(`✘ [ERROR] ${text}`); | ||
console.error(` ${location.file}:${location.line}:${location.column}:`); | ||
}); | ||
console.log('[watch] build finished'); | ||
}); | ||
}, | ||
setup(build) { | ||
build.onStart(() => { | ||
console.log("[watch] build started"); | ||
}); | ||
build.onEnd((result) => { | ||
result.errors.forEach(({ text, location }) => { | ||
console.error(`✘ [ERROR] ${text}`); | ||
console.error( | ||
` ${location.file}:${location.line}:${location.column}:`, | ||
); | ||
}); | ||
console.log("[watch] build finished"); | ||
}); | ||
}, | ||
}; | ||
|
||
async function main() { | ||
const ctx = await esbuild.context({ | ||
entryPoints: [ | ||
'src/extension.ts' | ||
], | ||
bundle: true, | ||
format: 'cjs', | ||
minify: production, | ||
sourcemap: !production, | ||
sourcesContent: false, | ||
platform: 'node', | ||
outfile: 'dist/extension.js', | ||
external: ['vscode'], | ||
logLevel: 'silent', | ||
plugins: [ | ||
/* add to the end of plugins array */ | ||
esbuildProblemMatcherPlugin, | ||
], | ||
}); | ||
if (watch) { | ||
await ctx.watch(); | ||
} else { | ||
await ctx.rebuild(); | ||
await ctx.dispose(); | ||
} | ||
const ctx = await esbuild.context({ | ||
entryPoints: ["src/extension.ts"], | ||
bundle: true, | ||
format: "cjs", | ||
minify: production, | ||
sourcemap: !production, | ||
sourcesContent: false, | ||
platform: "node", | ||
outfile: "dist/extension.js", | ||
external: ["vscode"], | ||
logLevel: "silent", | ||
plugins: [ | ||
/* add to the end of plugins array */ | ||
esbuildProblemMatcherPlugin, | ||
], | ||
}); | ||
if (watch) { | ||
await ctx.watch(); | ||
} else { | ||
await ctx.rebuild(); | ||
await ctx.dispose(); | ||
} | ||
} | ||
|
||
main().catch(e => { | ||
console.error(e); | ||
process.exit(1); | ||
main().catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
{ | ||
"name": "vs-code-extension", | ||
"displayName": "debricked", | ||
"description": "A fast and flexible software composition analysis VS Code Extension and CLI tool, given to you by Debricked.", | ||
"publisher": "debricked", | ||
"version": "0.0.1", | ||
"engines": { | ||
"vscode": "^1.90.0" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [], | ||
"main": "./dist/extension.js", | ||
"contributes": { | ||
"commands": [ | ||
{ | ||
"command": "debricked.debricked", | ||
"title": "Debricked : A fast and flexible software composition analysis CLI tool, given to you by Debricked.", | ||
"category": "debricked" | ||
}, | ||
{ | ||
"command": "debricked.help", | ||
"title": "Help about any command", | ||
"category": "debricked" | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "npm run package", | ||
"compile": "npm run check-types && npm run lint && node esbuild.js", | ||
"watch": "npm-run-all -p watch:*", | ||
"watch:esbuild": "node esbuild.js --watch", | ||
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json", | ||
"package": "npm run check-types && npm run lint && node esbuild.js --production", | ||
"compile-tests": "npm run clean && tsc -p . --outDir out", | ||
"watch-tests": "tsc -p . -w --outDir out", | ||
"pretest": "npm run compile-tests && npm run compile && npm run lint", | ||
"check-types": "tsc --noEmit", | ||
"lint": "eslint src --ext ts", | ||
"lint:fix": "eslint --fix src --ext ts", | ||
"test": "vscode-test --coverage", | ||
"clean": "rimraf out && rimraf dist && rimraf coverage", | ||
"clean-all": "rimraf out && rimraf dist && rimraf coverage && rimraf .vscode-test", | ||
"postinstall": "node ./postinstall.js" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.3.16", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "20.x", | ||
"@types/sinon": "^17.0.3", | ||
"@types/vscode": "^1.90.0", | ||
"@typescript-eslint/eslint-plugin": "^7.11.0", | ||
"@typescript-eslint/parser": "^7.11.0", | ||
"@vscode/test-cli": "^0.0.9", | ||
"@vscode/test-electron": "^2.4.0", | ||
"chai": "^5.1.1", | ||
"esbuild": "^0.21.5", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-config-prettier": "^9.1.0", | ||
"mocha": "^10.4.0", | ||
"npm-run-all": "^4.1.5", | ||
"sinon": "^18.0.0", | ||
"typescript": "^5.4.5" | ||
} | ||
} | ||
"name": "vs-code-extension", | ||
"displayName": "debricked", | ||
"description": "A fast and flexible software composition analysis VS Code Extension and CLI tool, given to you by Debricked.", | ||
"publisher": "debricked", | ||
"version": "0.0.1", | ||
"engines": { | ||
"vscode": "^1.90.0" | ||
}, | ||
"categories": [ | ||
"Other" | ||
], | ||
"activationEvents": [], | ||
"main": "./dist/extension.js", | ||
"contributes": { | ||
"commands": [ | ||
{ | ||
"command": "debricked.debricked", | ||
"title": "Debricked : A fast and flexible software composition analysis CLI tool, given to you by Debricked.", | ||
"category": "debricked" | ||
}, | ||
{ | ||
"command": "debricked.help", | ||
"title": "Help about any command", | ||
"category": "debricked" | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "npm run package", | ||
"compile": "npm run check-types && npm run lint && node esbuild.js", | ||
"watch": "npm-run-all -p watch:*", | ||
"watch:esbuild": "node esbuild.js --watch", | ||
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json", | ||
"package": "npm run check-types && npm run lint && node esbuild.js --production", | ||
"compile-tests": "npm run clean && tsc -p . --outDir out", | ||
"watch-tests": "tsc -p . -w --outDir out", | ||
"pretest": "npm run compile-tests && npm run compile && npm run lint", | ||
"check-types": "tsc --noEmit", | ||
"lint": "eslint src --ext ts", | ||
"lint:fix": "eslint --fix src --ext ts", | ||
"test": "vscode-test --coverage", | ||
"clean": "rimraf out && rimraf dist && rimraf coverage", | ||
"clean-all": "rimraf out && rimraf dist && rimraf coverage && rimraf .vscode-test", | ||
"postinstall": "node ./postinstall.js" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.3.16", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "20.x", | ||
"@types/sinon": "^17.0.3", | ||
"@types/vscode": "^1.90.0", | ||
"@typescript-eslint/eslint-plugin": "^7.11.0", | ||
"@typescript-eslint/parser": "^7.11.0", | ||
"@vscode/test-cli": "^0.0.9", | ||
"@vscode/test-electron": "^2.4.0", | ||
"chai": "^5.1.1", | ||
"esbuild": "^0.21.5", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-config-prettier": "^9.1.0", | ||
"mocha": "^10.4.0", | ||
"npm-run-all": "^4.1.5", | ||
"sinon": "^18.0.0", | ||
"typescript": "^5.4.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters