Skip to content

Commit

Permalink
refactor: moved code under modules (extension)
Browse files Browse the repository at this point in the history
* moved everything into modules

* changed npm scripts to reflect better what they do
  • Loading branch information
marabesi committed Jun 30, 2024
1 parent fdb6f2b commit 91628c3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules/
out/
dist/
.vscode-test/
.vscode/
.vscode/
*.vsix
7 changes: 5 additions & 2 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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[] = [];
Expand Down
2 changes: 1 addition & 1 deletion vscode/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 91628c3

Please sign in to comment.