Skip to content

Commit e087f73

Browse files
committed
Replace a few gulp tasks with npm scripts. Refs #7607.
1 parent e604903 commit e087f73

File tree

3 files changed

+46
-108
lines changed

3 files changed

+46
-108
lines changed

gulpfile.js

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
const gulp = require('gulp');
22
const bump = require('gulp-bump');
3-
const git = require('gulp-git');
43
const tag_version = require('gulp-tag-version');
54
const ts = require('gulp-typescript');
65
const PluginError = require('plugin-error');
76
const minimist = require('minimist');
87
const path = require('path');
9-
const webpack = require('webpack');
10-
const webpack_stream = require('webpack-stream');
118
const es = require('event-stream');
12-
13-
const webpack_config = require('./webpack.config.js');
14-
const webpack_dev_config = require('./webpack.dev.js');
9+
const shell = require('gulp-shell');
1510

1611
const releaseOptions = {
1712
semver: '',
@@ -41,10 +36,6 @@ function createGitTag() {
4136
return gulp.src(['./package.json']).pipe(tag_version());
4237
}
4338

44-
function createGitCommit() {
45-
return gulp.src(['./package.json', './yarn.lock']).pipe(git.commit('bump version'));
46-
}
47-
4839
function updateVersion(done) {
4940
var options = minimist(process.argv.slice(2), releaseOptions);
5041

@@ -102,33 +93,6 @@ gulp.task('tsc', function () {
10293
return tsResult.js.pipe(updatePath()).pipe(gulp.dest('out'));
10394
});
10495

105-
gulp.task('webpack', function () {
106-
return webpack_stream(
107-
{
108-
config: webpack_config,
109-
entry: ['./extension.ts', './extensionWeb.ts'],
110-
},
111-
webpack,
112-
).pipe(gulp.dest('out'));
113-
});
114-
115-
gulp.task('webpack-dev', function () {
116-
return webpack_stream(
117-
{
118-
config: webpack_dev_config,
119-
entry: ['./extension.ts'],
120-
},
121-
webpack,
122-
).pipe(gulp.dest('out'));
123-
});
124-
125-
gulp.task('commit-hash', function (done) {
126-
git.revParse({ args: 'HEAD', quiet: true }, function (err, hash) {
127-
require('fs').writeFileSync('out/version.txt', hash);
128-
done();
129-
});
130-
});
131-
13296
// test
13397
gulp.task('run-test', function (done) {
13498
// the flag --grep takes js regex as a string and filters by test and test suite names
@@ -182,9 +146,15 @@ gulp.task('run-test', function (done) {
182146
});
183147
});
184148

185-
gulp.task('build', gulp.series('webpack', 'commit-hash'));
186-
gulp.task('build-dev', gulp.series('webpack-dev', 'commit-hash'));
187149
gulp.task('prepare-test', gulp.parallel('tsc', copyPackageJson));
188150
gulp.task('test', gulp.series('prepare-test', 'run-test'));
189-
gulp.task('release', gulp.series(validateArgs, updateVersion, createGitCommit, createGitTag));
190-
gulp.task('default', gulp.series('build', 'test'));
151+
gulp.task(
152+
'release',
153+
gulp.series(
154+
validateArgs,
155+
updateVersion,
156+
shell.task('git commit -am "bump version"'),
157+
createGitTag,
158+
),
159+
);
160+
gulp.task('default', shell.task('yarn build-dev'));

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,10 +1178,11 @@
11781178
]
11791179
},
11801180
"scripts": {
1181-
"vscode:prepublish": "gulp build",
1182-
"build": "gulp build",
1183-
"build-dev": "gulp build-dev",
1181+
"vscode:prepublish": "yarn build",
1182+
"build": "webpack -c webpack.config.js && npm run commit-hash",
1183+
"build-dev": "webpack -c webpack.dev.js && npm run commit-hash",
11841184
"build-test": "gulp prepare-test",
1185+
"commit-hash": "git rev-parse HEAD > out/version.txt",
11851186
"test": "node ./out/test/runTest.js",
11861187
"lint": "eslint .",
11871188
"lint:fix": "eslint . --fix",
@@ -1225,7 +1226,7 @@
12251226
"fork-ts-checker-webpack-plugin": "9.1.0",
12261227
"gulp": "5.0.1",
12271228
"gulp-bump": "3.2.0",
1228-
"gulp-git": "2.11.0",
1229+
"gulp-shell": "^0.8.0",
12291230
"gulp-tag-version": "1.3.1",
12301231
"gulp-typescript": "5.0.1",
12311232
"husky": "^9.0.0",
@@ -1239,8 +1240,7 @@
12391240
"typescript": "5.9.3",
12401241
"webpack": "5.103.0",
12411242
"webpack-cli": "6.0.1",
1242-
"webpack-merge": "6.0.1",
1243-
"webpack-stream": "7.0.0"
1243+
"webpack-merge": "6.0.1"
12441244
},
12451245
"lint-staged": {
12461246
"*.{ts,js,json,md,yml}": "prettier --write",

yarn.lock

Lines changed: 29 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
"@azu/format-text@^1.0.1", "@azu/format-text@^1.0.2":
6-
version "1.1.1"
6+
version "1.0.2"
77
resolved "https://registry.yarnpkg.com/@azu/format-text/-/format-text-1.0.2.tgz#abd46dab2422e312bd1bfe36f0d427ab6039825d"
88
integrity sha512-Swi4N7Edy1Eqq82GxgEECXSSLyn6GOb5htRFPzBDdUkECGXtlf12ynO5oJSpWKPwCaUssOu7NfhDcCWpIC6Ywg==
99

@@ -1566,6 +1566,14 @@ chalk@^2.0.0:
15661566
escape-string-regexp "^1.0.5"
15671567
supports-color "^5.3.0"
15681568

1569+
chalk@^3.0.0:
1570+
version "3.0.0"
1571+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
1572+
integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
1573+
dependencies:
1574+
ansi-styles "^4.1.0"
1575+
supports-color "^7.1.0"
1576+
15691577
chalk@^4.0.0, chalk@^4.1.2:
15701578
version "4.1.2"
15711579
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
@@ -2200,13 +2208,6 @@ environment@^1.0.0:
22002208
resolved "https://registry.yarnpkg.com/environment/-/environment-1.1.0.tgz#8e86c66b180f363c7ab311787e0259665f45a9f1"
22012209
integrity sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==
22022210

2203-
errno@^0.1.3:
2204-
version "0.1.7"
2205-
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
2206-
integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==
2207-
dependencies:
2208-
prr "~1.0.1"
2209-
22102211
error-ex@^1.2.0, error-ex@^1.3.1:
22112212
version "1.3.2"
22122213
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
@@ -3137,19 +3138,6 @@ gulp-cli@^3.1.0:
31373138
v8flags "^4.0.0"
31383139
yargs "^16.2.0"
31393140

3140-
3141-
version "2.11.0"
3142-
resolved "https://registry.yarnpkg.com/gulp-git/-/gulp-git-2.11.0.tgz#90eed3ebeabaf2497da405164514c7a9885b59c9"
3143-
integrity sha512-7YOcwin7sr68weYhBNOtZia3LZOGZWXgGcxxcxCi2hjljTgysOhH9mLTH2hdG5YLcuAFNg7mMbb2xIRfYsaQZw==
3144-
dependencies:
3145-
any-shell-escape "^0.1.1"
3146-
fancy-log "^1.3.2"
3147-
lodash "^4.17.21"
3148-
plugin-error "^1.0.1"
3149-
require-dir "^1.0.0"
3150-
strip-bom-stream "^3.0.0"
3151-
vinyl "^2.0.1"
3152-
31533141
gulp-git@^2.4.2:
31543142
version "2.10.1"
31553143
resolved "https://registry.yarnpkg.com/gulp-git/-/gulp-git-2.10.1.tgz#218615c94bbf90660c1cb07a37054041d5e4f2eb"
@@ -3164,6 +3152,18 @@ gulp-git@^2.4.2:
31643152
through2 "^2.0.3"
31653153
vinyl "^2.0.1"
31663154

3155+
gulp-shell@^0.8.0:
3156+
version "0.8.0"
3157+
resolved "https://registry.yarnpkg.com/gulp-shell/-/gulp-shell-0.8.0.tgz#0ed4980de1d0c67e5f6cce971d7201fd0be50555"
3158+
integrity sha512-wHNCgmqbWkk1c6Gc2dOL5SprcoeujQdeepICwfQRo91DIylTE7a794VEE+leq3cE2YDoiS5ulvRfKVIEMazcTQ==
3159+
dependencies:
3160+
chalk "^3.0.0"
3161+
fancy-log "^1.3.3"
3162+
lodash.template "^4.5.0"
3163+
plugin-error "^1.0.1"
3164+
through2 "^3.0.1"
3165+
tslib "^1.10.0"
3166+
31673167
31683168
version "1.3.1"
31693169
resolved "https://registry.yarnpkg.com/gulp-tag-version/-/gulp-tag-version-1.3.1.tgz#afdcd238582fffcd9068b3c93277ad48870fbf36"
@@ -4075,11 +4075,6 @@ lodash._reinterpolate@^3.0.0:
40754075
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
40764076
integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=
40774077

4078-
lodash.clone@^4.3.2:
4079-
version "4.5.0"
4080-
resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6"
4081-
integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=
4082-
40834078
lodash.get@^4.4.2:
40844079
version "4.4.2"
40854080
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
@@ -4125,12 +4120,7 @@ lodash.once@^4.0.0:
41254120
resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
41264121
integrity sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==
41274122

4128-
lodash.some@^4.2.2:
4129-
version "4.6.0"
4130-
resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d"
4131-
integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=
4132-
4133-
lodash.template@^4.4.0:
4123+
lodash.template@^4.4.0, lodash.template@^4.5.0:
41344124
version "4.5.0"
41354125
resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab"
41364126
integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==
@@ -4268,14 +4258,6 @@ memfs@^3.4.1:
42684258
dependencies:
42694259
fs-monkey "1.0.3"
42704260

4271-
memory-fs@^0.5.0:
4272-
version "0.5.0"
4273-
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c"
4274-
integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==
4275-
dependencies:
4276-
errno "^0.1.3"
4277-
readable-stream "^2.0.1"
4278-
42794261
meow@^3.3.0:
42804262
version "3.7.0"
42814263
resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb"
@@ -5062,11 +5044,6 @@ [email protected]:
50625044
resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
50635045
integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
50645046

5065-
prr@~1.0.1:
5066-
version "1.0.1"
5067-
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
5068-
integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY=
5069-
50705047
pump@^2.0.0:
50715048
version "2.0.1"
50725049
resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909"
@@ -6104,7 +6081,7 @@ through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0:
61046081
readable-stream "~2.3.6"
61056082
xtend "~4.0.1"
61066083

6107-
through2@^3.0.0:
6084+
through2@^3.0.0, through2@^3.0.1:
61086085
version "3.0.2"
61096086
resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4"
61106087
integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==
@@ -6190,6 +6167,11 @@ [email protected]:
61906167
semver "^7.3.4"
61916168
source-map "^0.7.4"
61926169

6170+
tslib@^1.10.0:
6171+
version "1.14.1"
6172+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
6173+
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
6174+
61936175
tslib@^1.9.0:
61946176
version "1.13.0"
61956177
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
@@ -6476,7 +6458,7 @@ vinyl-sourcemap@^2.0.0:
64766458
vinyl "^3.0.0"
64776459
vinyl-contents "^2.0.0"
64786460

6479-
vinyl@^2.0.0, vinyl@^2.0.1, vinyl@^2.1.0, vinyl@^2.2.1:
6461+
vinyl@^2.0.0, vinyl@^2.0.1, vinyl@^2.1.0:
64806462
version "2.2.1"
64816463
resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974"
64826464
integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw==
@@ -6550,20 +6532,6 @@ webpack-sources@^3.3.3:
65506532
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.3.tgz#d4bf7f9909675d7a070ff14d0ef2a4f3c982c723"
65516533
integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg==
65526534

6553-
6554-
version "7.0.0"
6555-
resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-7.0.0.tgz#e6a1edb9568198499af872678e95031752d72f00"
6556-
integrity sha512-XoAQTHyCaYMo6TS7Atv1HYhtmBgKiVLONJbzLBl2V3eibXQ2IT/MCRM841RW/r3vToKD5ivrTJFWgd/ghoxoRg==
6557-
dependencies:
6558-
fancy-log "^1.3.3"
6559-
lodash.clone "^4.3.2"
6560-
lodash.some "^4.2.2"
6561-
memory-fs "^0.5.0"
6562-
plugin-error "^1.0.1"
6563-
supports-color "^8.1.1"
6564-
through "^2.3.8"
6565-
vinyl "^2.2.1"
6566-
65676535
65686536
version "5.103.0"
65696537
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.103.0.tgz#17a7c5a5020d5a3a37c118d002eade5ee2c6f3da"

0 commit comments

Comments
 (0)