fix build + use webpack 2 + remove ununsed ts dependencies (#17)

This commit is contained in:
Mohit Bagra 2017-04-19 07:49:56 -07:00 коммит произвёл Matthew Manela
Родитель 8527e1aae9
Коммит 6dc09f7219
8 изменённых файлов: 50 добавлений и 58 удалений

Просмотреть файл

@ -14,27 +14,25 @@
"test": "karma start --single-run",
"postinstall": "typings install"
},
"devDependencies": {
"grunt": "~1.0.1",
"grunt-cli": "^1.2.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-copy": "~1.0.0",
"grunt-exec": "~1.0.1",
"grunt-ts": "^6.0.0-beta.3",
"tfx-cli": "^0.3.30",
"typescript": "^2.0.3",
"typings": "^1.4.0",
"vss-web-extension-sdk": "^1.100.0",
"copy-webpack-plugin": "^3.0.0",
"style-loader": "^0.13.1",
"css-loader": "^0.23.1",
"ts-loader": "^0.8.2",
"rimraf": "^2.5.2",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
"devDependencies": {
"@types/react": "^15.0.21",
"@types/react-dom": "^0.14.23",
"@types/jquery": "^2.0.41",
"@types/q": "^1.0.0",
"webpack": "^2.3.3",
"webpack-dev-server": "^2.4.2",
"rimraf": "^2.6.1",
"style-loader": "^0.16.1",
"css-loader": "^0.28.0",
"ts-loader": "^2.0.3",
"tfx-cli": "^0.4.5",
"typescript": "^2.2.2",
"typings": "^2.1.0",
"uglifyjs-webpack-plugin": "^0.4.2",
"copy-webpack-plugin": "^4.0.1"
},
"dependencies": {
"vss-web-extension-sdk": "^1.100.0"
"vss-web-extension-sdk": "^2.114.0"
},
"name": "multivalue-control-extension",
"license": "MIT",

Просмотреть файл

@ -1,9 +1,5 @@
import * as VSSService from "VSS/Service";
import * as WitService from "TFS/WorkItemTracking/Services";
import * as VSSUtilsCore from "VSS/Utils/Core";
import * as Controls from "VSS/Controls";
import * as Combos from "VSS/Controls/Combos";
import * as ExtensionContracts from "TFS/WorkItemTracking/ExtensionContracts";
import Q = require("q");
export class BaseMultiValueControl {

Просмотреть файл

@ -112,7 +112,7 @@ export class MultiValueCombo extends BaseMultiValueControl {
var selectedCheckboxes: JQuery = $("input.valueOption:checked", this._checkboxValuesContainer);
var selectedValues: string[] = [];
$.each(selectedCheckboxes, (i: number, elem: HTMLElement) => {
selectedCheckboxes.each((i: number, elem: HTMLElement) => {
selectedValues.push($(elem).attr("value"));
});

Просмотреть файл

@ -1,5 +1,4 @@
import {MultiValueCombo} from "./MultiValueCombo";
import {IdentityPicker} from "./IdentityPicker";
import {BaseMultiValueControl} from "./BaseMultiValueControl";
import * as WitExtensionContracts from "TFS/WorkItemTracking/ExtensionContracts";
import { WorkItemFormService } from "TFS/WorkItemTracking/Services";
@ -21,19 +20,7 @@ var provider = () => {
if (!control) {
var inputs: IDictionaryStringTo<string> = VSS.getConfiguration().witInputs;
var controlType: string = inputs["InputMode"];
if (controlType) {
switch(controlType.toUpperCase()) {
case "IDENTITY":
control = new IdentityPicker();
break;
default:
control = new MultiValueCombo();
break;
}
}
else {
control = new MultiValueCombo();
}
control = new MultiValueCombo();
control.initialize();
}

Просмотреть файл

@ -2,7 +2,18 @@
"compilerOptions": {
"module": "amd",
"sourceMap": false,
"jsx": "react"
"jsx": "react",
"types": [
"q",
"knockout",
"requirejs",
"jquery",
"react",
"react-dom"
],
"typeRoots": [
"../node_modules/@types"
]
},
"exclude": [
"node_modules"

Просмотреть файл

@ -1,13 +1,7 @@
{
"name": "multivalue-control-extension",
"globalDependencies": {
"jquery": "registry:dt/jquery#1.10.0+20160704162008",
"knockout": "registry:dt/knockout#0.0.0+20160512130947",
"q": "registry:dt/q#0.0.0+20160613154756",
"require": "registry:dt/require#2.1.20+20160316155526",
"tfs": "npm:vss-web-extension-sdk/typings/tfs.d.ts",
"vss": "npm:vss-web-extension-sdk/typings/vss.d.ts",
"react": "registry:dt/react#0.14.0+20160526134601",
"react-dom": "registry:dt/react-dom#0.14.0+20160412154040"
"vss": "npm:vss-web-extension-sdk/typings/vss.d.ts"
}
}

Просмотреть файл

@ -1,7 +1,7 @@
{
"manifestVersion": 1.0,
"id": "vsts-extensions-multivalue-control",
"version": "1.0.5",
"version": "1.0.6",
"name": "Multivalue control",
"description": "A work item form control which allows selection of multiple values.",
"publisher": "ms-devlabs",

Просмотреть файл

@ -1,5 +1,6 @@
var path = require("path");
var webpack = require("webpack");
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
@ -12,19 +13,16 @@ module.exports = {
libraryTarget: "amd"
},
externals: [
{
"q": true,
"react": true,
"react-dom": true
},
/^VSS\/.*/, /^TFS\/.*/, /^q$/
],
resolve: {
extensions: [
"",
".webpack.js",
".web.js",
".ts",
".tsx",
".js"],
root: [
path.resolve("./")
]
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"],
moduleExtensions: ["-loader"],
},
module: {
loaders: [
@ -34,11 +32,19 @@ module.exports = {
},
{
test: /\.s?css$/,
loaders: ["style", "css"]
loaders: ["style-loader", "css-loader"]
}
]
},
plugins: [
new UglifyJSPlugin({
compress: {
warnings: false
},
output: {
comments: false
}
}),
new CopyWebpackPlugin([
{ from: "./node_modules/vss-web-extension-sdk/lib/VSS.SDK.min.js", to: "libs/VSS.SDK.min.js" },
{ from: "./src/index.html", to: "./" },