Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.

fix(app-shell): exclude private properties from package.json #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 12 additions & 3 deletions app-shell/gulpfile.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
declare var require;

const childProcess = require('child_process');
const commonjs = require('rollup-plugin-commonjs');
const gulp = require('gulp');
Expand All @@ -8,7 +6,7 @@ const rimraf = require('rimraf');
const rollup = require('rollup');
const nodeResolve = require('rollup-plugin-node-resolve');
const runSequence = require('run-sequence');

const change = require('gulp-change');

gulp.task('clean', done => {
rimraf('./tmp', () => {
Expand Down Expand Up @@ -103,8 +101,19 @@ gulp.task('task:bundles:deploy', () => gulp
], {base: 'tmp/es5'})
.pipe(gulp.dest('dist')));

const updatePackage = (content: string) => {
const blacklist = [
'private',
'devDependencies'
];
const parsed = JSON.parse(content);
blacklist.forEach(prop => delete parsed[prop]);
return JSON.stringify(parsed, null, 2);
};

gulp.task('task:package:deploy', () => gulp
.src([
'package.json'
])
.pipe(change(updatePackage))
.pipe(gulp.dest('dist')));
5 changes: 3 additions & 2 deletions app-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
"progressive web apps",
"app shell"
],
"homepage": "https://mobile.angular.io",
"license": "MIT",
"angular-cli": {},
"scripts": {},
"main": "bundles/app-shell.umd.js",
"module": "index.js",
"private": true,
Expand All @@ -33,7 +32,9 @@
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/platform-server": "^2.0.0",
"@types/jasmine": "^2.2.34",
"@types/node": "^6.0.41",
"gulp": "^3.9.1",
"gulp-change": "^1.0.0",
"gulp-jasmine": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rimraf": "^2.5.4",
Expand Down