mirror of
https://github.com/kiteco/vscode-plugin.git
synced 2024-09-19 03:57:42 +03:00
28f70f2d31
* update: typescript to latest * add: ts bundling with ts-loader * add: KiteCodeLensProvider skeleton * change: wip codelens -> prototype inline decoration * update: rm vscode devDep in favor of @types/vscode and vscode-test See https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest * improve: consolidate after block to avoid conflicting styles Long standing vscode bug "Inline decorations can interfere with one another" https://github.com/microsoft/vscode/issues/33852 * remove: post-install since now using @types/vscode * update: webpack and webpack-cli to latest * migrate: to using vscode-test via webpack transpiling * improve: fix various tests and improve dev test experience * improve: use link theme color for inline message * improve: bump kite-api and use getLineDecoration * add: source-map and typescript test support * migrate: expect.js -> chai for assertion style testing * remove: unused deps + update sinon * test: codenav-decoration
73 lines
1.7 KiB
JavaScript
73 lines
1.7 KiB
JavaScript
'use strict';
|
|
|
|
const glob = require('glob');
|
|
const path = require('path');
|
|
const nodeExternals = require('webpack-node-externals');
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
const OUT_TEST_DIR = path.resolve(__dirname, '..', 'out', 'test');
|
|
const TEST_DIR = path.resolve(__dirname, '..', 'test');
|
|
|
|
const TestNeedsUpdating = {
|
|
'autostart.test.js': true,
|
|
'json-runner.test.js': true,
|
|
};
|
|
|
|
const testEntries = glob
|
|
.sync('*.test.{js,ts}', { cwd: TEST_DIR })
|
|
.reduce((obj, filename) => {
|
|
if (!TestNeedsUpdating[filename]) {
|
|
const filenameWithoutExt = filename.replace(path.extname(filename), '');
|
|
obj[filenameWithoutExt] = path.resolve(TEST_DIR, filename);
|
|
}
|
|
return obj;
|
|
}, {});
|
|
|
|
module.exports = {
|
|
entry: {
|
|
['runTests']: path.resolve(__dirname, '..', 'test', 'runTests.js'),
|
|
['index']: path.resolve(__dirname, '..', 'test', 'index.ts'),
|
|
...testEntries
|
|
},
|
|
output: {
|
|
path: OUT_TEST_DIR,
|
|
filename: '[name].js',
|
|
libraryTarget: 'commonjs2',
|
|
devtoolModuleFilenameTemplate: '../[resource-path]'
|
|
},
|
|
devtool: 'source-map',
|
|
target: 'node',
|
|
externals: [
|
|
{
|
|
vscode: 'commonjs2 vscode',
|
|
fs: 'commonjs2 fs',
|
|
crypto: 'commonjs2 crypto',
|
|
child_process: 'commonjs2 child_process',
|
|
['editors-json-tests']: 'commonjs2 editors-json-tests',
|
|
},
|
|
nodeExternals()
|
|
],
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
use: 'ts-loader',
|
|
exclude: /node_modules/,
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.ts', '.js'],
|
|
},
|
|
plugins: [
|
|
new CopyPlugin([
|
|
{
|
|
from: 'fixtures/',
|
|
to: path.resolve(OUT_TEST_DIR, 'fixtures/')
|
|
}
|
|
],
|
|
{ context: TEST_DIR }
|
|
)
|
|
],
|
|
};
|