Skip to content

Commit 776e491

Browse files
committed
bundle into dist folder, copy ask-pass shell scripts into dist, some 💄
1 parent 4bdf15b commit 776e491

9 files changed

Lines changed: 94 additions & 26 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ npm-debug.log
33
Thumbs.db
44
node_modules/
55
.build/
6+
extensions/**/dist/
67
out/
78
out-build/
89
out-editor/
@@ -17,4 +18,4 @@ build/node_modules
1718
coverage/
1819
test_data/
1920
test-results/
20-
yarn-error.log
21+
yarn-error.log

build/lib/extensions.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@ function fromLocal(extensionPath) {
4040
var patchFilesStream = filesStream
4141
.pipe(packageJsonFilter)
4242
.pipe(buffer())
43-
.pipe(json({ main: './out/main.bundle' })) // hardcoded entry point!
43+
.pipe(json(function (data) {
44+
// hardcoded entry point directory!
45+
data.main = data.main.replace('/out/', /dist/);
46+
return data;
47+
}))
4448
.pipe(packageJsonFilter.restore);
4549
var webpackConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
4650
var webpackStream = webpackGulp(webpackConfig, webpack)
4751
.pipe(es.through(function (data) {
52+
data.stat = data.stat || {};
4853
data.base = extensionPath;
4954
this.emit('data', data);
5055
}));

build/lib/extensions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import * as fs from 'fs';
2020
import * as path from 'path';
2121
import * as vsce from 'vsce';
2222
import * as File from 'vinyl';
23-
import { rebase } from './util';
2423

2524
export function fromLocal(extensionPath: string): Stream {
2625
let result = es.through();
@@ -46,12 +45,17 @@ export function fromLocal(extensionPath: string): Stream {
4645
const patchFilesStream = filesStream
4746
.pipe(packageJsonFilter)
4847
.pipe(buffer())
49-
.pipe(json({ main: './out/main.bundle' })) // hardcoded entry point!
48+
.pipe(json(data => {
49+
// hardcoded entry point directory!
50+
data.main = data.main.replace('/out/', /dist/);
51+
return data;
52+
}))
5053
.pipe(packageJsonFilter.restore);
5154

5255
const webpackConfig = require(path.join(extensionPath, 'extension.webpack.config.js'));
5356
const webpackStream = webpackGulp(webpackConfig, webpack)
5457
.pipe(es.through(function (data) {
58+
data.stat = data.stat || {};
5559
data.base = extensionPath;
5660
this.emit('data', data);
5761
}));

extensions/emmet/.vscodeignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
test/**
22
src/**
3-
tsconfig.json
3+
out/**
4+
node_modules/**
5+
tsconfig.json

extensions/emmet/extension.webpack.config.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,22 @@
88
const path = require('path');
99

1010
module.exports = {
11-
// mode: 'none',
12-
mode: 'production',
13-
target: 'node',
11+
stats: 'errors-only',
12+
// mode: 'none', // default is production
1413
context: __dirname,
14+
target: 'node',
15+
resolve: {
16+
mainFields: ['main']
17+
},
1518
entry: {
16-
main: './out/extension.js',
19+
extension: './out/extension.js',
1720
},
1821
output: {
19-
filename: '[name].bundle.js',
20-
path: path.join(__dirname, 'out'),
22+
filename: '[name].js',
23+
path: path.join(__dirname, 'dist'),
2124
libraryTarget: "commonjs",
2225
},
2326
externals: {
2427
'vscode': 'commonjs vscode',
2528
},
26-
resolve: {
27-
mainFields: ['main']
28-
},
29-
stats: 'errors-only'
3029
};

extensions/git/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

extensions/git/extension.webpack.config.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,32 @@
66
'use strict';
77

88
const path = require('path');
9+
const CopyWebpackPlugin = require('copy-webpack-plugin');
910

1011
module.exports = {
11-
// mode: 'none',
12-
mode: 'production',
13-
target: 'node',
12+
stats: 'errors-only',
13+
// mode: 'none', // default is production
1414
context: __dirname,
15+
target: 'node',
16+
node: {
17+
__dirname: false
18+
},
19+
resolve: {
20+
mainFields: ['main']
21+
},
1522
entry: {
1623
main: './out/main.js',
1724
['askpass-main']: './out/askpass-main.js'
1825
},
1926
output: {
20-
filename: '[name].bundle.js',
21-
path: path.join(__dirname, 'out'),
27+
filename: '[name].js',
28+
path: path.join(__dirname, 'dist'),
2229
libraryTarget: "commonjs"
2330
},
2431
externals: {
2532
'vscode': 'commonjs vscode',
2633
},
27-
resolve: {
28-
mainFields: ['main']
29-
},
30-
stats: 'errors-only'
34+
plugins: [
35+
new CopyWebpackPlugin([{ from: './out/*.sh', to: '[name].sh' }])
36+
]
3137
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"asar": "^0.14.0",
6464
"chromium-pickle-js": "^0.2.0",
6565
"clean-css": "3.4.6",
66+
"copy-webpack-plugin": "^4.5.2",
6667
"coveralls": "^2.11.11",
6768
"cson-parser": "^1.3.3",
6869
"debounce": "^1.0.0",

yarn.lock

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ array-unique@^0.3.2:
471471
version "0.3.2"
472472
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
473473

474-
arrify@^1.0.0:
474+
arrify@^1.0.0, arrify@^1.0.1:
475475
version "1.0.1"
476476
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
477477

@@ -1375,6 +1375,19 @@ copy-descriptor@^0.1.0:
13751375
version "0.1.1"
13761376
resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
13771377

1378+
copy-webpack-plugin@^4.5.2:
1379+
version "4.5.2"
1380+
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.2.tgz#d53444a8fea2912d806e78937390ddd7e632ee5c"
1381+
dependencies:
1382+
cacache "^10.0.4"
1383+
find-cache-dir "^1.0.0"
1384+
globby "^7.1.1"
1385+
is-glob "^4.0.0"
1386+
loader-utils "^1.1.0"
1387+
minimatch "^3.0.4"
1388+
p-limit "^1.0.0"
1389+
serialize-javascript "^1.4.0"
1390+
13781391
core-util-is@1.0.2, core-util-is@~1.0.0:
13791392
version "1.0.2"
13801393
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -1793,6 +1806,13 @@ diffie-hellman@^5.0.0:
17931806
miller-rabin "^4.0.0"
17941807
randombytes "^2.0.0"
17951808

1809+
dir-glob@^2.0.0:
1810+
version "2.0.0"
1811+
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034"
1812+
dependencies:
1813+
arrify "^1.0.1"
1814+
path-type "^3.0.0"
1815+
17961816
doctrine@^2.0.0:
17971817
version "2.0.0"
17981818
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63"
@@ -2943,6 +2963,17 @@ globby@^5.0.0:
29432963
pify "^2.0.0"
29442964
pinkie-promise "^2.0.0"
29452965

2966+
globby@^7.1.1:
2967+
version "7.1.1"
2968+
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
2969+
dependencies:
2970+
array-union "^1.0.1"
2971+
dir-glob "^2.0.0"
2972+
glob "^7.1.2"
2973+
ignore "^3.3.5"
2974+
pify "^3.0.0"
2975+
slash "^1.0.0"
2976+
29462977
globule@~0.1.0:
29472978
version "0.1.0"
29482979
resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5"
@@ -3582,6 +3613,10 @@ ignore@^3.2.0:
35823613
version "3.3.7"
35833614
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
35843615

3616+
ignore@^3.3.5:
3617+
version "3.3.10"
3618+
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043"
3619+
35853620
import-local@^1.0.0:
35863621
version "1.0.0"
35873622
resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc"
@@ -5402,6 +5437,12 @@ p-finally@^1.0.0:
54025437
version "1.0.0"
54035438
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae"
54045439

5440+
p-limit@^1.0.0:
5441+
version "1.3.0"
5442+
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
5443+
dependencies:
5444+
p-try "^1.0.0"
5445+
54055446
p-limit@^1.1.0:
54065447
version "1.2.0"
54075448
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c"
@@ -5567,6 +5608,12 @@ path-type@^1.0.0:
55675608
pify "^2.0.0"
55685609
pinkie-promise "^2.0.0"
55695610

5611+
path-type@^3.0.0:
5612+
version "3.0.0"
5613+
resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
5614+
dependencies:
5615+
pify "^3.0.0"
5616+
55705617
pause-stream@0.0.11:
55715618
version "0.0.11"
55725619
resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445"
@@ -6737,6 +6784,10 @@ sinon@^1.17.2:
67376784
samsam "1.1.2"
67386785
util ">=0.10.3 <1"
67396786

6787+
slash@^1.0.0:
6788+
version "1.0.0"
6789+
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
6790+
67406791
slice-ansi@0.0.4:
67416792
version "0.0.4"
67426793
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"

0 commit comments

Comments
 (0)