Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Update to support a global .d.ts shim for the $pnp global. As discuss… #350

Merged
merged 1 commit into from
Mar 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ webpack-serve.config.js
.vscode/
coverage/
src/
assets/
tests/
gulptasks/
docs/
Expand Down
3 changes: 3 additions & 0 deletions assets/pnp-global-shim.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference path="pnp.d.ts" />
export * from "pnp";
export as namespace $pnp;
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"server-root/",
"src/",
"tests/",
"assets",
"typings.json",
"gulptasks/",
"typings.json",
Expand Down
1 change: 1 addition & 0 deletions gulptasks/@configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
lib: "./lib",
source: "./src",
sourceGlob: "./src/**/*.ts",
assetsGlob: "./assets/**/*.*"
},
testing: {
testsSource: "./tests",
Expand Down
10 changes: 7 additions & 3 deletions gulptasks/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ gulp.task("package:defs", () => {
var typingsProject = tsc.createProject('tsconfig.json', { "declaration": true, "outFile": "pnp.js", "removeComments": false, "module": "system" });

gulp.src(config.paths.sourceGlob).pipe(typingsProject()).dts.pipe(gulp.dest(config.paths.dist));

});

// package the code files using webpack
Expand All @@ -28,7 +27,7 @@ gulp.task("package:code", ["build:lib"], (done) => {
if (err) {
throw new gutil.PluginError("package:code", err);
}

console.log(stats.toString({
colors: true
}));
Expand All @@ -37,8 +36,13 @@ gulp.task("package:code", ["build:lib"], (done) => {
});
});

// package the assets to dist
gulp.task("package:assets", () => {
gulp.src(config.paths.assetsGlob).pipe(gulp.dest(config.paths.dist));
});

// used by the sync task to rebuild code
gulp.task("package:sync", ["package:code"]);

// run the package chain
gulp.task("package", ["clean", "lint", "package:code", "package:defs"]);
gulp.task("package", ["clean", "lint", "package:code", "package:defs", "package:assets"]);