Skip to content

Commit

Permalink
Combining SDK extension and uninstall script webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
sfoslund committed Feb 22, 2021
1 parent 8fe0f71 commit ea1bc44
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 3,321 deletions.
13 changes: 0 additions & 13 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ if (! $?)
}
popd

#################### Compile uninstall library ####################
pushd vscode-dotnet-uninstall-library
if (Test-Path node_modules) { rm -r -force node_modules }
npm install
npm run compile

if (! $?)
{
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
exit 1
}
popd

#################### Compile runtime extension ####################
pushd vscode-dotnet-runtime-extension
if (Test-Path node_modules) { rm -r -force node_modules }
Expand Down
16 changes: 0 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,6 @@ then
fi
popd

echo ""
echo "----------- Compiling vscode-dotnet-uninstall-library -----------"
echo ""
pushd vscode-dotnet-uninstall-library
rm -rf node_modules
npm install
npm run compile

if [ $? -ne 0 ];
then
echo ""
echo "${RED}Build failed!${NC}"
exit 1
fi
popd

echo ""
echo "----------- Compiling vscode-dotnet-runtime-extension -----------"
echo ""
Expand Down
2 changes: 0 additions & 2 deletions sample/package-lock.json

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

3 changes: 0 additions & 3 deletions vscode-dotnet-runtime.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
},
{
"path": "vscode-dotnet-runtime-library"
},
{
"path": "vscode-dotnet-uninstall-library"
}
],
"settings": {}
Expand Down
29 changes: 0 additions & 29 deletions vscode-dotnet-sdk-extension/package-lock.json

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

5 changes: 2 additions & 3 deletions vscode-dotnet-sdk-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
}
},
"scripts": {
"vscode:prepublish": "npm run compile-all && npm install && cd ../vscode-dotnet-uninstall-library && webpack --mode production && cd ../vscode-dotnet-sdk-extension && webpack --mode production",
"vscode:prepublish": "npm run compile-all && npm install && webpack --mode production",
"vscode:uninstall": "node ./dist/ExtensionUninstall",
"compile": "npm run clean && tsc -p ./",
"watch": "npm run compile && tsc -watch -p ./",
"test": "npm run compile --silent && node ./dist/test/functional/runTest.js",
"clean": "rimraf dist",
"compile-all": "cd ../vscode-dotnet-runtime-library && npm install && npm run compile && cd ../vscode-dotnet-sdk-extension && cd ../vscode-dotnet-uninstall-library && npm install && npm run compile && cd ../vscode-dotnet-sdk-extension && npm install && npm run compile",
"compile-all": "cd ../vscode-dotnet-runtime-library && npm install && npm run compile && cd ../vscode-dotnet-sdk-extension && npm install && npm run compile",
"lint": "tslint -c ../tslint.json '../vscode-dotnet-runtime-library/src/**/*.ts' '../vscode-dotnet-sdk-extension/src/**/*.ts'",
"webpack": "webpack --mode development"
},
Expand All @@ -90,7 +90,6 @@
"tslint": "^5.20.1",
"typescript": "3.4.5",
"vscode-dotnet-runtime-library": "file:../vscode-dotnet-runtime-library",
"vscode-dotnet-uninstall-library": "file:../vscode-dotnet-uninstall-library",
"vscode-test": "^1.3.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import * as fs from 'fs';
import rimraf = require('rimraf');
import * as path from 'path';
import * as os from 'os';
import * as path from 'path';
import rimraf = require('rimraf');

export function uninstallSDKExtension() {
if (os.platform() === 'win32' && process.env.APPDATA) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ import {
MockTelemetryReporter,
MockWindowDisplayWorker,
} from 'vscode-dotnet-runtime-library';
import {
uninstallSDKExtension,
} from 'vscode-dotnet-uninstall-library';
import * as extension from '../../extension';
import { uninstallSDKExtension } from '../../ExtensionUninstall';
const assert = chai.assert;
/* tslint:disable:no-any */

Expand Down
30 changes: 26 additions & 4 deletions vscode-dotnet-sdk-extension/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');

/**@type {import('webpack').Configuration}*/
const config = {
const extensionConfig = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/

entry: './/src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
Expand Down Expand Up @@ -45,9 +45,31 @@ const config = {
plugins: [
new CopyPlugin({ patterns: [
{ from: path.resolve(__dirname, '../vscode-dotnet-runtime-library/install scripts'), to: path.resolve(__dirname, 'dist', 'install scripts') },
{ from: path.resolve(__dirname, '../images'), to: path.resolve(__dirname, 'images') },
{ from: path.resolve(__dirname, '../vscode-dotnet-uninstall-library/dist'), to: path.resolve(__dirname, 'dist') }
{ from: path.resolve(__dirname, '../images'), to: path.resolve(__dirname, 'images') }
]}),
]
};
module.exports = config;
const uninstallConfig = {
entry: './src/ExtensionUninstall.ts',
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
filename: 'ExtensionUninstall.js',
path: path.resolve(__dirname, 'dist'),
},
target: 'node',
};
module.exports = [
extensionConfig,
uninstallConfig
];
Loading

0 comments on commit ea1bc44

Please sign in to comment.