Skip to content

Commit 69f9d6c

Browse files
authored
Use gulp.js
* Switch to gulp build * Working gulp build * add script * Remove npm install from gulp build
1 parent 62416f8 commit 69f9d6c

6 files changed

Lines changed: 8427 additions & 677 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Build output
2-
lib/
3-
41
# Logs
52
logs
63
*.log

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,25 @@ An Azure DevOps javascript library for running the [Microsoft Security DevOps CL
1313

1414
### Preqrequisities:
1515

16-
* Install [dotnet](https://dotnet.microsoft.com/en-us/)
17-
* install [node.js](https://nodejs.org/en) (for npm)
18-
19-
To build, run:
20-
```powershell
21-
dotnet build ./build.proj [/p:NpmInstall=true|false]
16+
* Install [node.js](https://nodejs.org/en) (for npm)
17+
* Install [gulp-cli](https://www.npmjs.com/package/gulp-cli) globally:
18+
```
19+
npm install -g gulp-cli
20+
```
21+
* Install node package dependencies
22+
```
23+
npm install
24+
```
25+
26+
To build, simply run `gulp` in the root of the repo:
27+
```
28+
gulp
2229
```
2330

2431
The build:
25-
1. If `NpmInstall` is true, runs `npm install` at the root of the repo
2632
1. Compiles the typescript in the `./src` directory
27-
1. Outputs javascript to the `./lib` directory
28-
1. Copies the `./package.json` file to the `./lib` folder
33+
1. Outputs javascript to the `./dist` directory
34+
1. Copies the `./package.json` file to the `./dist` folder
2935

3036
## Publish
3137

build.proj

Lines changed: 0 additions & 32 deletions
This file was deleted.

gulpfile.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const gulp = require('gulp');
2+
const shell = require('gulp-shell');
3+
const ts = require('gulp-typescript');
4+
5+
const tsProject = ts.createProject('tsconfig.json');
6+
7+
function clean(cb) {
8+
import('del')
9+
.then((del) => del.deleteSync(['dist']))
10+
.then(() => cb());
11+
}
12+
13+
function compile(cb) {
14+
tsProject
15+
.src()
16+
.pipe(tsProject()).js
17+
.pipe(gulp.dest('dist'));
18+
cb();
19+
}
20+
21+
function copyPackageJson(cb) {
22+
gulp
23+
.src('package.json')
24+
.pipe(gulp.dest('dist'));
25+
cb();
26+
}
27+
28+
exports.clean = clean;
29+
exports.compile = compile;
30+
exports.build = gulp.series(clean, compile, copyPackageJson);
31+
exports.default = exports.build;

0 commit comments

Comments
 (0)