diff --git a/.gitignore b/.gitignore index fd323b6..24b349b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules/ out/ dist/ .vscode-test/ -.vscode/ \ No newline at end of file +.vscode/ +*.vsix diff --git a/vscode/package.json b/vscode/package.json index 64dcc51..891bfd1 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -30,17 +30,20 @@ ] }, "scripts": { + "generate:vsix": "vsce package", "vscode:prepublish": "npm run package", "compile": "webpack", "watch": "webpack --watch", "package": "webpack --mode production --devtool hidden-source-map", - "compile-tests": "rm -rf out/ dist/ && tsc -p . --outDir out", + "clean": "rm -rf out/ dist/", + "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", "lint": "eslint src --ext ts", "test": "node ./out/modules/vscode/test/runTest.js", "test:vscode": "vscode-test", - "test:all": "mocha -r ts-node/register src/modules/smells-finder/**/**.test.ts", + "test:smells-finder": "mocha -r ts-node/register src/modules/smells-finder/**/**.test.ts", + "test:all": "npm run test:smells-finder && npm run test", "test:coverage": "nyc --reporter=text mocha -r ts-node/register src/modules/**/**.test.ts", "coveralls": "npm run test:coveralls:coverage && coveralls --verbose < lcov.info", "cli": "ts-node src/modules/cli/find-smells.ts" diff --git a/vscode/src/extension.ts b/vscode/src/modules/vscode/extension.ts similarity index 95% rename from vscode/src/extension.ts rename to vscode/src/modules/vscode/extension.ts index 8d5541b..aafdb23 100644 --- a/vscode/src/extension.ts +++ b/vscode/src/modules/vscode/extension.ts @@ -1,8 +1,8 @@ import * as vscode from 'vscode'; import path from 'path'; -import { SmellDetector } from './modules/smells-finder/smells-detector'; -import { Smell } from './modules/smells-finder/types'; -import { ComposedSmell, warningDecorationType } from './modules/vscode/extension.types'; +import { SmellDetector } from '../smells-finder/smells-detector'; +import { Smell } from '../smells-finder/types'; +import { ComposedSmell, warningDecorationType } from './extension.types'; let currentDecoration = warningDecorationType; let ranges: ComposedSmell[] = []; diff --git a/vscode/webpack.config.js b/vscode/webpack.config.js index 37d7024..6314f51 100644 --- a/vscode/webpack.config.js +++ b/vscode/webpack.config.js @@ -12,7 +12,7 @@ const extensionConfig = { target: 'node', // VS Code extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/ mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production') - entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ + entry: './src/modules/vscode/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/ output: { // the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/ path: path.resolve(__dirname, 'dist'),