Skip to content

Commit bf0e70f

Browse files
refactor directory structure
1 parent 6fb1607 commit bf0e70f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+72
-72
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ typings
66
**/*.js.map
77
**/*.d.ts
88
!gulpfile.js
9-
!bundles/**/*.js
9+
!angular2-polyfill/bundles/**/*.js
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# Directories
22
node_modules
33
typings
4-
.vscode
54

65
# Dot files
76
.npmignore
8-
.gitignore
9-
.editorconfig
107

118
# d.ts files
129
**/*.d.ts

bundles/angular2-polyfill.js renamed to angular2-polyfill/bundles/angular2-polyfill.js

Lines changed: 12 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.
File renamed without changes.

angular2-polyfill/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "angular2-polyfill",
3+
"version": "0.0.17",
4+
"description": "Angular2 polyfill for Angular1",
5+
"license": "MIT",
6+
"repository": "SamVerschueren/angular2-polyfill",
7+
"author": {
8+
"name": "Sam Verschueren",
9+
"email": "[email protected]",
10+
"url": "github.com/SamVerschueren"
11+
},
12+
"main": false,
13+
"dependencies": {
14+
"camelcase": "^2.1.1",
15+
"dot-prop": "^2.4.0"
16+
}
17+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

angular2-polyfill/tsconfig.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "commonjs",
5+
"outDir": "./",
6+
"sourceMap": false,
7+
"declaration": true,
8+
"experimentalDecorators": true
9+
},
10+
"exclude": [
11+
"typings/browser",
12+
"typings/browser.d.ts"
13+
]
14+
}
File renamed without changes.
File renamed without changes.

gulpfile.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22
const path = require('path');
33
const gulp = require('gulp');
4-
const del = require('del');
54
const merge = require('merge2');
65
const Builder = require('systemjs-builder');
6+
const ts = require('gulp-typescript');
77

88
const ANGULAR2_POLYFILL_BUNDLE_CONFIG = [
99
'angular2-polyfill/core',
@@ -30,16 +30,15 @@ function bundle(buildConfig, moduleName, outputFile, outputConfig) {
3030
return builder.bundle(moduleName, outputFile, outputConfig);
3131
}
3232

33-
gulp.task('bundle', ['cp'], () => {
34-
return bundle(bundleConfig, NG2_POLYFILL_BUNDLE_CONTENT, './bundles/angular2-polyfill.js', {sourceMaps: true})
35-
.then(() => del('angular2-polyfill'));
33+
gulp.task('bundle', () => {
34+
return bundle(bundleConfig, NG2_POLYFILL_BUNDLE_CONTENT, './angular2-polyfill/bundles/angular2-polyfill.js', {sourceMaps: true});
3635
});
3736

38-
gulp.task('cp', () => {
39-
const streams = [];
40-
streams.push(gulp.src('*.js').pipe(gulp.dest('angular2-polyfill')));
41-
streams.push(gulp.src('**/*.js', {cwd: 'platform'}).pipe(gulp.dest('angular2-polyfill/platform')));
42-
streams.push(gulp.src('**/*.js', {cwd: 'src'}).pipe(gulp.dest('angular2-polyfill/src')));
43-
44-
return merge(streams);
37+
gulp.task('typedefs', () => {
38+
const project = ts.createProject('tsconfig.json', {outFile: 'angular2-polyfill.js'});
39+
const tsResult = project.src()
40+
.pipe(ts(project));
41+
return tsResult.dts.pipe(gulp.dest('./angular2-polyfill/bundles'))
4542
});
43+
44+
gulp.task('build', ['bundle', 'typedefs']);

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,33 @@
44
"description": "Angular2 polyfill for Angular1",
55
"license": "MIT",
66
"repository": "SamVerschueren/angular2-polyfill",
7+
"private": true,
78
"author": {
89
"name": "Sam Verschueren",
910
"email": "[email protected]",
1011
"url": "github.com/SamVerschueren"
1112
},
12-
"main": false,
1313
"scripts": {
1414
"postinstall": "npm run typings install",
15-
"prepublish": "npm run compile && gulp bundle",
16-
"compile": "tsc -p ./",
17-
"watch": "tsc -watch -p ./",
18-
"typings": "typings",
19-
"link": "jspm link npm:angular2-polyfill@dev -y"
15+
"prepublish": "npm run pub",
16+
"build": "npm run compile && npm run tsd-gen && gulp build",
17+
"compile": "tsc -p ./angular2-polyfill",
18+
"watch": "tsc -watch -p ./angular2-polyfill",
19+
"pub": "cd angular2-polyfill && npm publish",
20+
"typings": "cd angular2-polyfill && typings",
21+
"link": "cd angular2-polyfill && jspm link npm:angular2-polyfill@dev -y",
22+
"tsd-gen": "tsc -p angular2-polyfill --outFile angular2-polyfill/bundles/angular2-polyfill.js --module system -d --moduleResolution classic --rootDir \"./\""
2023
},
2124
"dependencies": {
2225
"camelcase": "^2.1.1",
2326
"decamelize": "^1.2.0",
2427
"dot-prop": "^2.4.0"
2528
},
2629
"devDependencies": {
27-
"del": "^2.2.0",
2830
"gulp": "^3.9.1",
29-
"merge2": "^1.0.1",
30-
"systemjs-builder": "^0.15.13",
31-
"typescript": "^1.7.5",
32-
"typings": "^0.6.8"
31+
"gulp-json-editor": "^2.2.1",
32+
"systemjs-builder": "^0.15.12",
33+
"typescript": "^1.8.7",
34+
"typings": "^0.7.9"
3335
}
3436
}

readme.md

Lines changed: 1 addition & 0 deletions

tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"compilerOptions": {
33
"target": "es5",
44
"module": "commonjs",
5-
"outDir": "./",
5+
"outDir": "./angular2-polyfill",
66
"sourceMap": false,
77
"declaration": true,
88
"experimentalDecorators": true
99
},
1010
"exclude": [
11-
"node_modules",
12-
"typings/browser",
13-
"typings/browser.d.ts"
11+
"node_modules",
12+
"angular2-polyfill/typings/browser",
13+
"angular2-polyfill/typings/browser.d.ts"
1414
]
1515
}

0 commit comments

Comments
 (0)