Skip to content

Commit 9e74c51

Browse files
committed
Add new packaging process
1 parent c4f8059 commit 9e74c51

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
bower_components/
22
_bower_components/
33
_InstallPackages/
4+
/node_modules/

gulpfile.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const path = require("path");
2+
const gulp = require("gulp");
3+
const glob = require("glob");
4+
const zip = require("gulp-zip");
5+
const mergeStream = require("merge-stream");
6+
7+
const matches = glob.sync("*/dnn-library.json");
8+
gulp.task(
9+
"default",
10+
matches
11+
.map(m => ({ manifestPath: m, manifest: require(path.resolve(m)) }))
12+
.map(({ manifestPath, manifest }) => ({
13+
manifestPath,
14+
task: gulp.task(manifestPath, () =>
15+
mergeStream(
16+
gulp.src(manifest.files),
17+
gulp.src(manifest.resources || []).pipe(zip("Resources.zip"))
18+
)
19+
.add(
20+
gulp.src(["LICENSE.htm", "CHANGES.htm", "*.dnn"], {
21+
cwd: path.dirname(manifestPath)
22+
})
23+
)
24+
.pipe(zip(path.basename(path.dirname(manifestPath)) + ".zip"))
25+
.pipe(gulp.dest("./_InstallPackages/"))
26+
)
27+
}))
28+
.reduce((tasks, { manifestPath }) => tasks.concat(manifestPath), [])
29+
);

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,13 @@
22
"name": "engage-dnn-javascript-libraries",
33
"version": "0.10.0",
44
"private": true,
5-
"file": ["_InstallPackages"]
6-
}
5+
"file": [
6+
"_InstallPackages"
7+
],
8+
"devDependencies": {
9+
"glob": "^7.1.2",
10+
"gulp": "^3.9.1",
11+
"gulp-zip": "^4.0.0",
12+
"merge-stream": "^1.0.1"
13+
}
14+
}

0 commit comments

Comments
 (0)