Ver a proveniência

Removes separate package.json for ui build

Consolidates ui dependencies & build into main
main
Eric Amodio há 6 anos
ascendente
cometimento
6cb99d30c3
9 ficheiros alterados com 6247 adições e 11541 eliminações
  1. +6044
    -726
      package-lock.json
  2. +19
    -7
      package.json
  3. +0
    -10589
      src/ui/package-lock.json
  4. +0
    -45
      src/ui/package.json
  5. +6
    -7
      ui.tsconfig.json
  6. +42
    -35
      ui.webpack.config.js
  7. +5
    -1
      webpack.config.js

+ 6044
- 726
package-lock.json
A apresentação das diferenças no ficheiro foi suprimida por ser demasiado grande
Ver ficheiro


+ 19
- 7
package.json Ver ficheiro

@ -3519,19 +3519,22 @@
}
},
"scripts": {
"build": "npm run lint && tsc -m commonjs -p ./ && npm run ui:build -- --env.quick",
"bundle": "npm run lint && webpack --env.production --context ./src/ui --config ./src/ui/webpack.config.js && webpack --env.production",
"build": "npm run lint && tsc -m commonjs -p ./ && npm run ui:build",
"bundle": "npm run lint && webpack --env.production && npm run ui:bundle",
"clean": "git clean -Xdf",
"lint": "tslint --project tsconfig.json",
"lint": "tslint --project tsconfig.json && npm run ui:lint",
"pack": "vsce package",
"pretty": "prettier --config .prettierrc --loglevel warn --write \"./**/*.ts\"",
"pub": "vsce publish",
"rebuild": "npm run reset && npm run lint && tsc -m commonjs -p ./ && npm run ui:build",
"reset": "npm run clean && npm install --no-save",
"watch": "tsc -watch -m commonjs -p ./",
"ui:build": "webpack --context ./src/ui --config ./src/ui/webpack.config.js",
"ui:watch": "cd \"./src/ui\" && npm run watch --no-save && cd \"../..\"",
"postinstall": "node ./node_modules/vscode/bin/install && cd \"./src/ui\" && npm install --no-save && cd \"../..\"",
"ui:build": "webpack --config ./ui.webpack.config.js",
"ui:bundle": "webpack --env.production --config ./ui.webpack.config.js",
"ui:lint": "tslint --project ui.tsconfig.json",
"ui:optimize": "webpack --env.optimizeImages --config ./ui.webpack.config.js",
"ui:watch": "webpack --watch --config ./ui.webpack.config.js",
"postinstall": "node ./node_modules/vscode/bin/install",
"prepush": "npm run build",
"vscode:prepublish": "npm run reset && npm run bundle"
},
@ -3548,11 +3551,20 @@
"@types/clipboardy": "1.1.0",
"@types/node": "7.0.67",
"@types/tmp": "0.0.33",
"clean-webpack-plugin": "0.1.19",
"css-loader": "1.0.0",
"html-webpack-inline-source-plugin": "0.0.10",
"html-webpack-plugin": "3.2.0",
"husky": "0.14.3",
"imagemin-webpack-plugin": "2.2.0",
"mini-css-extract-plugin": "0.4.1",
"node-sass": "4.9.2",
"prettier": "1.13.7",
"ts-loader": "4.4.2",
"sass-loader": "7.0.3",
"style-loader": "0.21.0",
"tslint": "5.11.0",
"tslint-prettiest": "0.0.1",
"ts-loader": "4.4.2",
"typescript": "2.9.2",
"vscode": "1.1.18",
"webpack": "4.16.3",

+ 0
- 10589
src/ui/package-lock.json
A apresentação das diferenças no ficheiro foi suprimida por ser demasiado grande
Ver ficheiro


+ 0
- 45
src/ui/package.json Ver ficheiro

@ -1,45 +0,0 @@
{
"name": "gitlens-ui",
"version": "1.0.0",
"author": {
"name": "Eric Amodio",
"email": "eamodio@gmail.com"
},
"engines": {
"node": ">= 6.11.0"
},
"license": "SEE LICENSE IN LICENSE",
"description": "",
"homepage": "https://github.com/eamodio/vscode-gitlens/blob/master/README.md",
"bugs": {
"url": "https://github.com/eamodio/vscode-gitlens/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/eamodio/vscode-gitlens.git"
},
"private": true,
"scripts": {
"build": "webpack",
"bundle": "npm run lint && webpack --env.production",
"lint": "tslint --project tsconfig.json",
"watch": "webpack --watch"
},
"devDependencies": {
"@types/node": "7.0.67",
"@types/webpack": "4.4.8",
"css-loader": "1.0.0",
"html-webpack-inline-source-plugin": "0.0.10",
"html-webpack-plugin": "3.2.0",
"imagemin-webpack-plugin": "2.2.0",
"mini-css-extract-plugin": "0.4.1",
"node-sass": "4.9.2",
"sass-loader": "7.0.3",
"style-loader": "0.21.0",
"tslint": "5.11.0",
"ts-loader": "4.4.2",
"typescript": "2.9.2",
"webpack": "4.16.3",
"webpack-cli": "3.1.0"
}
}

src/ui/tsconfig.json → ui.tsconfig.json Ver ficheiro

@ -3,21 +3,20 @@
"compileOnSave": false,
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"lib": [ "es5", "dom", "dom.iterable", "es2015", "es2015.iterable", "es2016" ],
"lib": ["es5", "dom", "dom.iterable", "es2015", "es2015.iterable", "es2016"],
"module": "es2015",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "out",
"outDir": "out/ui",
"removeComments": true,
"rootDir": ".",
"rootDir": "./src/ui",
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "es2016"
},
"exclude": [
"node_modules"
]
}
"include": ["src/ui/**/*"],
"exclude": ["node_modules"]
}

src/ui/webpack.config.js → ui.webpack.config.js Ver ficheiro

@ -2,6 +2,7 @@
const webpack = require('webpack');
const glob = require('glob');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const HtmlWebpackInlineSourcePlugin = require('html-webpack-inline-source-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ImageminPlugin = require('imagemin-webpack-plugin').default;
@ -10,12 +11,16 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = function(env, argv) {
env = env || {};
const production = !!env.production;
const optimizeImages = production || !!env.optimizeImages;
const quick = !production && !!env.quick;
const minify = production;
const sourceMaps = !production;
const clean = ['out/ui'];
if (optimizeImages) {
console.log('Optimizing images (src/ui/images/settings/*.png)...');
clean.push('images/settings');
}
const plugins = [
new CleanWebpackPlugin(clean),
new webpack.optimize.ModuleConcatenationPlugin(),
new MiniCssExtractPlugin({
filename: '[name].css'
@ -24,11 +29,11 @@ module.exports = function(env, argv) {
excludeAssets: [/.*\.main\.js/],
excludeChunks: ['welcome'],
template: 'settings/index.html',
filename: path.resolve(__dirname, '../..', 'settings.html'),
filename: path.resolve(__dirname, 'settings.html'),
inject: true,
inlineSource: production ? '.(js|css)$' : undefined,
// inlineSource: '.(js|css)$',
minify: minify
minify: production
? {
removeComments: true,
collapseWhitespace: true,
@ -44,11 +49,11 @@ module.exports = function(env, argv) {
excludeAssets: [/.*\.main\.js/],
excludeChunks: ['settings'],
template: 'welcome/index.html',
filename: path.resolve(__dirname, '../..', 'welcome.html'),
filename: path.resolve(__dirname, 'welcome.html'),
inject: true,
inlineSource: production ? '.(js|css)$' : undefined,
// inlineSource: '.(js|css)$',
minify: minify
minify: production
? {
removeComments: true,
collapseWhitespace: true,
@ -60,30 +65,27 @@ module.exports = function(env, argv) {
}
: false
}),
new HtmlWebpackInlineSourcePlugin()
new HtmlWebpackInlineSourcePlugin(),
new ImageminPlugin({
disable: !optimizeImages,
externalImages: {
context: path.resolve(__dirname, 'src/ui/images'),
sources: glob.sync('src/ui/images/settings/*.png'),
destination: path.resolve(__dirname, 'images')
},
gifsicle: null,
jpegtran: null,
optipng: null,
pngquant: {
quality: '85-100',
speed: production ? 1 : 10
},
svgo: null
})
];
if (!quick) {
plugins.push(
new ImageminPlugin({
disable: false,
externalImages: {
sources: glob.sync(path.resolve(__dirname, 'images/settings/*.png')),
destination: path.resolve(__dirname, '../..')
},
gifsicle: null,
jpegtran: null,
optipng: null,
pngquant: {
quality: '85-100',
speed: minify ? 1 : 10
},
svgo: null
})
);
}
return {
context: path.resolve(__dirname, 'src/ui'),
// This is ugly having main.scss on both bundles, but if it is added separately it will generate a js bundle :(
entry: {
settings: ['./settings/index.ts', './scss/main.scss'],
@ -91,10 +93,10 @@ module.exports = function(env, argv) {
// main: ['./scss/main.scss']
},
mode: production ? 'production' : 'development',
devtool: sourceMaps ? 'eval-source-map' : undefined,
devtool: !production ? 'eval-source-map' : undefined,
output: {
filename: '[name].js',
path: path.resolve(__dirname, '../../', 'out/ui'),
path: path.resolve(__dirname, 'out/ui'),
publicPath: '{{root}}/out/ui/'
},
optimization: {
@ -111,13 +113,18 @@ module.exports = function(env, argv) {
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
modules: [path.resolve(__dirname), 'node_modules']
modules: [path.resolve(__dirname, 'src/ui'), 'node_modules']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
use: {
loader: 'ts-loader',
options: {
configFile: 'ui.tsconfig.json'
}
},
exclude: /node_modules/
},
{
@ -129,15 +136,15 @@ module.exports = function(env, argv) {
{
loader: 'css-loader',
options: {
minimize: minify,
sourceMap: sourceMaps,
minimize: production,
sourceMap: !production,
url: false
}
},
{
loader: 'sass-loader',
options: {
sourceMap: sourceMaps
sourceMap: !production
}
}
],

+ 5
- 1
webpack.config.js Ver ficheiro

@ -1,11 +1,14 @@
'use strict';
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const CleanWebpackPlugin = require("clean-webpack-plugin");
module.exports = function(env, argv) {
env = env || {};
const production = !!env.production;
const plugins = [new CleanWebpackPlugin(["out"])];
return {
entry: './src/extension.ts',
mode: production ? 'production' : 'development',
@ -28,6 +31,7 @@ module.exports = function(env, argv) {
exclude: /node_modules/
}
]
}
},
plugins: plugins
};
};

Carregando…
Cancelar
Guardar