Skip to content
This repository was archived by the owner on Oct 12, 2021. It is now read-only.
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
22 changes: 0 additions & 22 deletions app-shell/angular-cli-build.js

This file was deleted.

25 changes: 0 additions & 25 deletions app-shell/angular-cli.json

This file was deleted.

52 changes: 0 additions & 52 deletions app-shell/config/karma-test-shim.js

This file was deleted.

52 changes: 0 additions & 52 deletions app-shell/config/karma.conf.js

This file was deleted.

110 changes: 110 additions & 0 deletions app-shell/gulpfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
declare var require;

const childProcess = require('child_process');
const commonjs = require('rollup-plugin-commonjs');
const gulp = require('gulp');
const jsmn = require('gulp-jasmine');
const rimraf = require('rimraf');
const rollup = require('rollup');
const nodeResolve = require('rollup-plugin-node-resolve');
const runSequence = require('run-sequence');


gulp.task('clean', done => {
rimraf('./tmp', () => {
rimraf('./dist', done);
});
});

gulp.task('build', done => runSequence(
'clean',
'task:build',
'task:deploy',
done));

gulp.task('test', done => runSequence(
'clean',
'task:test',
done));

gulp.task('task:build', done => runSequence(
'task:app:compile_esm',
'task:app:bundle',
done));

gulp.task('task:test', done => runSequence(
'task:app:compile_es5',
'task:app:test',
done))

gulp.task('task:deploy', done => runSequence(
[
'task:app:deploy',
'task:bundles:deploy',
'task:package:deploy',
],
done));

gulp.task('task:app:compile_es5', () => {
childProcess.execSync('node_modules/.bin/tsc -p tsconfig.es5.json');
});

gulp.task('task:app:compile_esm', () => {
childProcess.execSync('node_modules/.bin/ngc -p tsconfig.esm.json');
});

gulp.task('task:app:bundle', done => rollup
.rollup({
entry: 'tmp/esm/src/index.js',
plugins: [
nodeResolve({jsnext: true, main: true}),
commonjs({
include: 'node_modules/**',
}),
],
external: [
'@angular/core',
]
})
.then(bundle => bundle.write({
format: 'umd',
moduleName: 'ng.appShell',
dest: 'tmp/es5/bundles/app-shell.umd.js',
globals: {
'@angular/core': 'ng.core',
},
})));

gulp.task('task:app:deploy', () => gulp
.src([
'tmp/esm/src/index.d.ts',
'tmp/esm/src/index.js',
'tmp/esm/src/index.js.map',
'tmp/esm/src/index.metadata.json',
'tmp/esm/src/app/**/*.d.ts',
'tmp/esm/src/app/**/*.js',
'tmp/esm/src/app/**/*.js.map',
'tmp/esm/src/app/**/*.metadata.json',
], {base: 'tmp/esm/src'})
.pipe(gulp.dest('dist')));

gulp.task('task:app:test', () => gulp
.src([
'tmp/es5/src/unit_tests.js',
], {base: '.'})
.pipe(jsmn({
verbose: true,
})));

gulp.task('task:bundles:deploy', () => gulp
.src([
'tmp/es5/bundles/**/*.js',
'tmp/es5/bundles/**/*.js.map',
], {base: 'tmp/es5'})
.pipe(gulp.dest('dist')));

gulp.task('task:package:deploy', () => gulp
.src([
'package.json'
])
.pipe(gulp.dest('dist')));
89 changes: 45 additions & 44 deletions app-shell/package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
{
"name": "app-shell",
"version": "0.0.0",
"name": "@angular/app-shell",
"description": "App Shell runtime library for Angular 2 Progressive Web Apps.",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "git+https://github.com/angular/mobile-toolkit.git"
},
"contributors": [
"Jeff Cross <crossj@google.com>",
"Minko Gechev <mgechev@gmail.com>",
"Alex Rickabaugh <alx+alxhub@alxandria.net>"
],
"keywords": [
"angular2",
"pwa",
"progressive web apps",
"app shell"
],
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng server",
"postinstall": "typings install",
"lint": "tslint \"src/**/*.ts\"",
"format": "clang-format -i -style=file --glob=src/**/*.ts",
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"clean": "rm -rf dist",
"build": "mkdir -p dist/app && ngc -p src/tsconfig.publish.json && cp src/package.json dist/app/package.json",
"build_parser": "echo '' > dist/vendor/parse5/lib/tokenizer/named_entity_trie.js && browserify dist/app/shell-parser/index.js -s shellParserFactory > dist/app/shell-parser.js && rm -rf dist/app/shell-parser && rm -rf dist/app/vendor",
"build_publish": "npm run clean && npm run build"
},
"scripts": {},
"main": "bundles/app-shell.umd.js",
"module": "index.js",
"private": true,
"dependencies": {
"@angular/common": "^2.0.0-rc.6",
"@angular/compiler": "^2.0.0-rc.6",
"@angular/core": "^2.0.0-rc.6",
"@angular/platform-browser": "^2.0.0-rc.6",
"@angular/platform-browser-dynamic": "^2.0.0-rc.6",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.11",
"systemjs": "0.19.26",
"zone.js": "^0.6.17"
},
"dependencies": {},
"devDependencies": {
"@angular/compiler-cli": "^0.6.0",
"@angular/platform-server": "^2.0.0-rc.6",
"angular-cli": "0.0.*",
"browserify": "^13.0.1",
"clang-format": "^1.0.35",
"codelyzer": "0.0.14",
"ember-cli-inject-live-reload": "^1.4.0",
"jasmine-core": "^2.4.1",
"jasmine-spec-reporter": "^2.4.0",
"karma": "^0.13.15",
"karma-chrome-launcher": "^0.2.3",
"karma-jasmine": "^0.3.8",
"parse5": "2.1.5",
"protractor": "^3.3.0",
"ts-node": "^0.5.5",
"tslint": "^3.6.0",
"typescript": "^2.0.2",
"typings": "^1.0.4"
"@angular/common": "^2.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Angular, Zone and RxJS dependencies should be peer dependencies in the published package.json. Fine to move them to dev dependencies here though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @angular/core is the only real peer dep.

"@angular/compiler": "^2.0.0",
"@angular/compiler-cli": "^0.6.2",
"@angular/core": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/platform-server": "^2.0.0",
"@types/jasmine": "^2.2.34",
"gulp": "^3.9.1",
"gulp-jasmine": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rimraf": "^2.5.4",
"rollup": "^0.36.0",
"rollup-plugin-commonjs": "^5.0.4",
"rollup-plugin-node-resolve": "^2.0.0",
"run-sequence": "^1.2.2",
"rxjs": "^5.0.0-beta.12",
"ts-node": "^1.3.0",
"typescript": "^2.0.3",
"zone.js": "^0.6.25"
},
"peerDependencies": {
"@angular/core": "^2.0.0"
}
}
Empty file removed app-shell/public/.gitignore
Empty file.
Empty file removed app-shell/public/.npmignore
Empty file.
31 changes: 3 additions & 28 deletions app-shell/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
import { Type, NgModule, ModuleWithProviders } from '@angular/core';
import { ShellRender } from './shell-render.directive';
import { ShellNoRender } from './shell-no-render.directive';
import { IS_PRERENDER } from './is-prerender.service';
import { APP_SHELL_RUNTIME_PROVIDERS, APP_SHELL_BUILD_PROVIDERS } from './is-prerender.service';

export * from './is-prerender.service';
export * from './shell-no-render.directive';
export * from './shell-render.directive';

const APP_SHELL_DIRECTIVES: Type<any>[] = [
ShellRender,
ShellNoRender
];

@NgModule({
exports: APP_SHELL_DIRECTIVES,
declarations: APP_SHELL_DIRECTIVES
})
export class AppShellModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: AppShellModule,
providers: [APP_SHELL_RUNTIME_PROVIDERS, APP_SHELL_BUILD_PROVIDERS]
};
}
}

export * from './module';
export * from './prerender';
export * from './shell';
Loading