aurelia-polyfills
Advanced tools
Comparing version 1.0.0-beta.1.1.6 to 1.0.0-beta.2.0.0
{ | ||
"name": "aurelia-polyfills", | ||
"version": "1.0.0-beta.1.1.6", | ||
"version": "1.0.0-beta.2.0.0", | ||
"description": "The minimal set of polyfills that the Aurelia platform needs to run on ES5 browsers.", | ||
@@ -20,3 +20,6 @@ "keywords": [ | ||
"url": "http://github.com/aurelia/polyfills" | ||
}, | ||
"dependencies": { | ||
"aurelia-pal": "^1.0.0-beta.1.3.0" | ||
} | ||
} |
@@ -5,3 +5,3 @@ var path = require('path'); | ||
exports.base = function() { | ||
return { | ||
var config = { | ||
filename: '', | ||
@@ -15,7 +15,11 @@ filenameRelative: '', | ||
compact: false, | ||
code:true, | ||
presets: [ 'es2015-loose', 'stage-1'], | ||
code: true, | ||
presets: [ 'es2015-loose', 'stage-1' ], | ||
plugins: [ | ||
'syntax-flow', | ||
'transform-decorators-legacy', | ||
] | ||
}; | ||
if (!paths.useTypeScriptForDTS) { | ||
config.plugins.push( | ||
['babel-dts-generator', { | ||
@@ -26,7 +30,9 @@ packageName: paths.packageName, | ||
suppressComments: false, | ||
memberOutputFilter: /^_.*/ | ||
}], | ||
'transform-flow-strip-types' | ||
] | ||
memberOutputFilter: /^_.*/, | ||
suppressAmbientDeclaration: true | ||
}] | ||
); | ||
}; | ||
config.plugins.push('transform-flow-strip-types'); | ||
return config; | ||
} | ||
@@ -57,1 +63,7 @@ | ||
}; | ||
exports['native-modules'] = function() { | ||
var options = exports.base(); | ||
options.presets[0] = 'es2015-loose-native-modules'; | ||
return options; | ||
} |
@@ -17,2 +17,40 @@ var path = require('path'); | ||
packageName: pkg.name | ||
};var path = require('path'); | ||
var fs = require('fs'); | ||
// hide warning // | ||
var emitter = require('events'); | ||
emitter.defaultMaxListeners = 20; | ||
var appRoot = 'src/'; | ||
var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); | ||
var paths = { | ||
root: appRoot, | ||
source: appRoot + '**/*.js', | ||
html: appRoot + '**/*.html', | ||
style: 'styles/**/*.css', | ||
output: 'dist/', | ||
doc:'./doc', | ||
e2eSpecsSrc: 'test/e2e/src/*.js', | ||
e2eSpecsDist: 'test/e2e/dist/', | ||
packageName: pkg.name, | ||
ignore: [], | ||
useTypeScriptForDTS: false, | ||
importsToAdd: [], | ||
sort: false | ||
}; | ||
paths.files = [ | ||
'symbol.js', | ||
'number.js', | ||
'string.js', | ||
'array.js', | ||
'object.js', | ||
'collections.js', | ||
'reflect.js' | ||
].map(function(file){ | ||
return paths.root + file; | ||
}); | ||
module.exports = paths; |
@@ -6,2 +6,3 @@ var gulp = require('gulp'); | ||
var compilerOptions = require('../babel-options'); | ||
var compilerTsOptions = require('../typescript-options'); | ||
var assign = Object.assign || require('object.assign'); | ||
@@ -13,22 +14,34 @@ var through2 = require('through2'); | ||
var tools = require('aurelia-tools'); | ||
var ts = require('gulp-typescript'); | ||
var gutil = require('gulp-util'); | ||
var gulpIgnore = require('gulp-ignore'); | ||
var merge = require('merge2'); | ||
var jsName = paths.packageName + '.js'; | ||
var compileToModules = ['es2015', 'commonjs', 'amd', 'system', 'native-modules']; | ||
gulp.task('build-index', function(){ | ||
var importsToAdd = []; | ||
var files = [ | ||
'symbol.js', | ||
'number.js', | ||
'string.js', | ||
'array.js', | ||
'object.js', | ||
'collections.js', | ||
'reflect.js' | ||
].map(function(file){ | ||
return paths.root + file; | ||
function cleanGeneratedCode() { | ||
return through2.obj(function(file, enc, callback) { | ||
file.contents = new Buffer(tools.cleanGeneratedCode(file.contents.toString('utf8'))); | ||
this.push(file); | ||
return callback(); | ||
}); | ||
} | ||
return gulp.src(files) | ||
.pipe(through2.obj(function(file, enc, callback) { | ||
file.contents = new Buffer(tools.extractImports(file.contents.toString("utf8"), importsToAdd)); | ||
gulp.task('build-index', function() { | ||
var importsToAdd = paths.importsToAdd.slice(); | ||
var src = gulp.src(paths.files); | ||
if (paths.sort) { | ||
src = src.pipe(tools.sortFiles()); | ||
} | ||
if (paths.ignore) { | ||
paths.ignore.forEach(function(filename){ | ||
src = src.pipe(gulpIgnore.exclude(filename)); | ||
}); | ||
} | ||
return src.pipe(through2.obj(function(file, enc, callback) { | ||
file.contents = new Buffer(tools.extractImports(file.contents.toString('utf8'), importsToAdd)); | ||
this.push(file); | ||
@@ -44,33 +57,53 @@ return callback(); | ||
gulp.task('build-es2015', function () { | ||
return gulp.src(paths.output + jsName) | ||
.pipe(to5(assign({}, compilerOptions.es2015()))) | ||
.pipe(gulp.dest(paths.output + 'es2015')); | ||
}); | ||
function gulpFileFromString(filename, string) { | ||
var src = require('stream').Readable({ objectMode: true }); | ||
src._read = function() { | ||
this.push(new gutil.File({ cwd: paths.appRoot, base: paths.output, path: filename, contents: new Buffer(string) })) | ||
this.push(null) | ||
} | ||
return src; | ||
} | ||
gulp.task('build-commonjs', function () { | ||
return gulp.src(paths.output + jsName) | ||
.pipe(to5(assign({}, compilerOptions.commonjs()))) | ||
.pipe(gulp.dest(paths.output + 'commonjs')); | ||
}); | ||
function srcForBabel() { | ||
return merge( | ||
gulp.src(paths.output + jsName), | ||
gulpFileFromString(paths.output + 'index.js', "export * from './" + paths.packageName + "';") | ||
); | ||
} | ||
gulp.task('build-amd', function () { | ||
return gulp.src(paths.output + jsName) | ||
.pipe(to5(assign({}, compilerOptions.amd()))) | ||
.pipe(gulp.dest(paths.output + 'amd')); | ||
}); | ||
function srcForTypeScript() { | ||
return gulp | ||
.src(paths.output + paths.packageName + '.js') | ||
.pipe(rename(function (path) { | ||
if (path.extname == '.js') { | ||
path.extname = '.ts'; | ||
} | ||
})); | ||
} | ||
gulp.task('build-system', function () { | ||
return gulp.src(paths.output + jsName) | ||
.pipe(to5(assign({}, compilerOptions.system()))) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
compileToModules.forEach(function(moduleType){ | ||
gulp.task('build-babel-' + moduleType, function () { | ||
return srcForBabel() | ||
.pipe(to5(assign({}, compilerOptions[moduleType]()))) | ||
.pipe(cleanGeneratedCode()) | ||
.pipe(gulp.dest(paths.output + moduleType)); | ||
}); | ||
if (moduleType === 'native-modules') return; // typescript doesn't support the combination of: es5 + native modules | ||
gulp.task('build-ts-' + moduleType, function () { | ||
var tsProject = ts.createProject( | ||
compilerTsOptions({ module: moduleType, target: moduleType == 'es2015' ? 'es2015' : 'es5' }), ts.reporter.defaultReporter()); | ||
var tsResult = srcForTypeScript().pipe(ts(tsProject)); | ||
return tsResult.js | ||
.pipe(gulp.dest(paths.output + moduleType)); | ||
}); | ||
}); | ||
gulp.task('build-dts', function(){ | ||
return gulp.src(paths.output + paths.packageName + '.d.ts') | ||
.pipe(rename(paths.packageName + '.d.ts')) | ||
.pipe(gulp.dest(paths.output + 'es2015')) | ||
.pipe(gulp.dest(paths.output + 'commonjs')) | ||
.pipe(gulp.dest(paths.output + 'amd')) | ||
.pipe(gulp.dest(paths.output + 'system')); | ||
gulp.task('build-dts', function() { | ||
var tsProject = ts.createProject( | ||
compilerTsOptions({ removeComments: false, target: "es2015", module: "es2015" }), ts.reporter.defaultReporter()); | ||
var tsResult = srcForTypeScript().pipe(ts(tsProject)); | ||
return tsResult.dts | ||
.pipe(gulp.dest(paths.output)); | ||
}); | ||
@@ -82,6 +115,20 @@ | ||
'build-index', | ||
['build-es2015', 'build-commonjs', 'build-amd', 'build-system'], | ||
'build-dts', | ||
compileToModules | ||
.map(function(moduleType) { return 'build-babel-' + moduleType }) | ||
.concat(paths.useTypeScriptForDTS ? ['build-dts'] : []), | ||
callback | ||
); | ||
}); | ||
gulp.task('build-ts', function(callback) { | ||
return runSequence( | ||
'clean', | ||
'build-index', | ||
'build-babel-native-modules', | ||
compileToModules | ||
.filter(function(moduleType) { return moduleType !== 'native-modules' }) | ||
.map(function(moduleType) { return 'build-ts-' + moduleType }) | ||
.concat(paths.useTypeScriptForDTS ? ['build-dts'] : []), | ||
callback | ||
); | ||
}); |
var gulp = require('gulp'); | ||
var paths = require('../paths'); | ||
var typedoc = require('gulp-typedoc'); | ||
var typedocExtractor = require('gulp-typedoc-extractor'); | ||
var runSequence = require('run-sequence'); | ||
var through2 = require('through2'); | ||
gulp.task('doc-generate', function(){ | ||
return gulp.src([paths.output + '*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/npm/*/*.d.ts']) | ||
return gulp.src([paths.output + paths.packageName + '.d.ts']) | ||
.pipe(typedoc({ | ||
target: 'es6', | ||
includeDeclarations: true, | ||
moduleResolution: 'node', | ||
json: paths.doc + '/api.json', | ||
@@ -21,5 +22,17 @@ name: paths.packageName + '-docs', | ||
gulp.task('doc-extract', function(){ | ||
gulp.task('doc-shape', function(){ | ||
return gulp.src([paths.doc + '/api.json']) | ||
.pipe(typedocExtractor(paths.packageName)) | ||
.pipe(through2.obj(function(file, enc, callback) { | ||
var json = JSON.parse(file.contents.toString('utf8')).children[0]; | ||
json = { | ||
name: paths.packageName, | ||
children: json.children, | ||
groups: json.groups | ||
}; | ||
file.contents = new Buffer(JSON.stringify(json)); | ||
this.push(file); | ||
return callback(); | ||
})) | ||
.pipe(gulp.dest(paths.doc)); | ||
@@ -31,5 +44,5 @@ }); | ||
'doc-generate', | ||
'doc-extract', | ||
'doc-shape', | ||
callback | ||
); | ||
}); | ||
}); |
@@ -16,9 +16,12 @@ System.config({ | ||
map: { | ||
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.1.1", | ||
"babel": "npm:babel-core@5.8.35", | ||
"babel-runtime": "npm:babel-runtime@5.8.35", | ||
"core-js": "npm:core-js@2.1.3", | ||
"aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.3.0", | ||
"babel": "npm:babel-core@5.8.38", | ||
"babel-runtime": "npm:babel-runtime@5.8.38", | ||
"core-js": "npm:core-js@2.4.0", | ||
"github:jspm/nodelibs-assert@0.1.0": { | ||
"assert": "npm:assert@1.3.0" | ||
"assert": "npm:assert@1.4.1" | ||
}, | ||
"github:jspm/nodelibs-buffer@0.1.0": { | ||
"buffer": "npm:buffer@3.6.0" | ||
}, | ||
"github:jspm/nodelibs-path@0.1.0": { | ||
@@ -28,3 +31,3 @@ "path-browserify": "npm:path-browserify@0.0.0" | ||
"github:jspm/nodelibs-process@0.1.2": { | ||
"process": "npm:process@0.11.2" | ||
"process": "npm:process@0.11.4" | ||
}, | ||
@@ -34,13 +37,24 @@ "github:jspm/nodelibs-util@0.1.0": { | ||
}, | ||
"npm:assert@1.3.0": { | ||
"npm:assert@1.4.1": { | ||
"assert": "github:jspm/nodelibs-assert@0.1.0", | ||
"buffer": "github:jspm/nodelibs-buffer@0.1.0", | ||
"process": "github:jspm/nodelibs-process@0.1.2", | ||
"util": "npm:util@0.10.3" | ||
}, | ||
"npm:babel-runtime@5.8.35": { | ||
"npm:babel-runtime@5.8.38": { | ||
"process": "github:jspm/nodelibs-process@0.1.2" | ||
}, | ||
"npm:core-js@2.1.3": { | ||
"npm:buffer@3.6.0": { | ||
"base64-js": "npm:base64-js@0.0.8", | ||
"child_process": "github:jspm/nodelibs-child_process@0.1.0", | ||
"fs": "github:jspm/nodelibs-fs@0.1.2", | ||
"ieee754": "npm:ieee754@1.1.6", | ||
"isarray": "npm:isarray@1.0.0", | ||
"process": "github:jspm/nodelibs-process@0.1.2" | ||
}, | ||
"npm:core-js@2.4.0": { | ||
"fs": "github:jspm/nodelibs-fs@0.1.2", | ||
"path": "github:jspm/nodelibs-path@0.1.0", | ||
"process": "github:jspm/nodelibs-process@0.1.2", | ||
"systemjs-json": "github:systemjs/plugin-json@0.1.0" | ||
"systemjs-json": "github:systemjs/plugin-json@0.1.2" | ||
}, | ||
@@ -53,3 +67,3 @@ "npm:inherits@2.0.1": { | ||
}, | ||
"npm:process@0.11.2": { | ||
"npm:process@0.11.4": { | ||
"assert": "github:jspm/nodelibs-assert@0.1.0" | ||
@@ -56,0 +70,0 @@ }, |
@@ -1,5 +0,3 @@ | ||
declare module 'aurelia-polyfills' { | ||
import { | ||
PLATFORM | ||
} from 'aurelia-pal'; | ||
} | ||
import { | ||
PLATFORM | ||
} from 'aurelia-pal'; |
'use strict'; | ||
System.register(['aurelia-pal'], function (_export, _context) { | ||
"use strict"; | ||
var PLATFORM, _typeof, emptyMetadata, metadataContainerKey, bind; | ||
@@ -5,0 +7,0 @@ |
@@ -1,7 +0,1 @@ | ||
{ | ||
"id": 2, | ||
"name": "\"aurelia-polyfills\"", | ||
"kind": 2, | ||
"kindString": "Module", | ||
"flags": {} | ||
} | ||
{"name":"aurelia-polyfills"} |
{ | ||
"name": "aurelia-polyfills", | ||
"version": "1.0.0-beta.1.1.6", | ||
"version": "1.0.0-beta.2.0.0", | ||
"description": "The minimal set of polyfills that the Aurelia platform needs to run on ES5 browsers.", | ||
@@ -16,2 +16,3 @@ "keywords": [ | ||
"main": "dist/commonjs/aurelia-polyfills.js", | ||
"typings": "dist/aurelia-polyfills.d.ts", | ||
"repository": { | ||
@@ -30,6 +31,6 @@ "type": "git", | ||
"dependencies": { | ||
"aurelia-pal": "^1.0.0-beta.1.1.1" | ||
"aurelia-pal": "^1.0.0-beta.1.3.0" | ||
}, | ||
"peerDependencies": { | ||
"aurelia-pal": "^1.0.0-beta.1.1.1" | ||
"aurelia-pal": "^1.0.0-beta.1.3.0" | ||
}, | ||
@@ -43,42 +44,49 @@ "devDependencies": { | ||
"dependencies": { | ||
"aurelia-pal": "^1.0.0-beta.1.1.1" | ||
"aurelia-pal": "^1.0.0-beta.1.3.0" | ||
}, | ||
"devDependencies": { | ||
"aurelia-tools": "^0.1.12", | ||
"babel-dts-generator": "^0.4.5", | ||
"babel-eslint": "^4.1.1", | ||
"babel-plugin-syntax-flow": "^6.5.0", | ||
"aurelia-tools": "^0.2.1", | ||
"babel-dts-generator": "^0.5.1", | ||
"babel-eslint": "^6.0.4", | ||
"babel-plugin-syntax-flow": "^6.8.0", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-plugin-transform-es2015-modules-amd": "^6.6.5", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.7.0", | ||
"babel-plugin-transform-es2015-modules-systemjs": "^6.6.5", | ||
"babel-plugin-transform-flow-strip-types": "^6.7.0", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-plugin-transform-es2015-modules-amd": "^6.8.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.8.0", | ||
"babel-plugin-transform-es2015-modules-systemjs": "^6.9.0", | ||
"babel-plugin-transform-flow-strip-types": "^6.8.0", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-es2015-loose": "^7.0.0", | ||
"babel-preset-es2015-loose-native-modules": "^1.0.0", | ||
"babel-preset-stage-1": "^6.5.0", | ||
"conventional-changelog": "0.0.11", | ||
"del": "^1.1.0", | ||
"gulp": "^3.8.10", | ||
"conventional-changelog": "1.1.0", | ||
"del": "^2.2.0", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-bump": "^0.3.1", | ||
"gulp-bump": "^2.1.0", | ||
"gulp-concat": "^2.6.0", | ||
"gulp-eslint": "^1.0.0", | ||
"gulp-eslint": "^2.0.0", | ||
"gulp-ignore": "^2.0.1", | ||
"gulp-insert": "^0.5.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-typedoc": "^1.2.1", | ||
"gulp-typedoc": "^2.0.0", | ||
"gulp-typedoc-extractor": "^0.0.8", | ||
"jasmine-core": "^2.1.3", | ||
"karma": "^0.13.15", | ||
"gulp-typescript": "^2.13.6", | ||
"gulp-util": "^3.0.7", | ||
"jasmine-core": "^2.4.1", | ||
"karma": "^0.13.22", | ||
"karma-babel-preprocessor": "^6.0.1", | ||
"karma-chrome-launcher": "^0.1.7", | ||
"karma-coverage": "^0.3.1", | ||
"karma-jasmine": "^0.3.5", | ||
"karma-jspm": "^2.0.1", | ||
"object.assign": "^1.0.3", | ||
"require-dir": "^0.1.0", | ||
"run-sequence": "^1.0.2", | ||
"karma-chrome-launcher": "^1.0.1", | ||
"karma-coverage": "^1.0.0", | ||
"karma-jasmine": "^1.0.2", | ||
"karma-jspm": "^2.1.1", | ||
"merge2": "^1.0.2", | ||
"object.assign": "^4.0.3", | ||
"require-dir": "^0.3.0", | ||
"run-sequence": "^1.2.1", | ||
"through2": "^2.0.1", | ||
"vinyl": "^0.5.1", | ||
"vinyl-paths": "^1.0.0", | ||
"yargs": "^2.1.1" | ||
"typedoc": "^0.4.2", | ||
"typescript": "^1.9.0-dev.20160611-1.0", | ||
"vinyl": "^1.1.1", | ||
"vinyl-paths": "^2.1.0", | ||
"yargs": "^4.7.1" | ||
}, | ||
@@ -85,0 +93,0 @@ "aurelia": { |
@@ -6,2 +6,3 @@ # aurelia-polyfills | ||
[![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![CircleCI](https://circleci.com/gh/aurelia/polyfills.svg?style=shield)](https://circleci.com/gh/aurelia/polyfills) | ||
@@ -8,0 +9,0 @@ This library is part of the [Aurelia](http://www.aurelia.io/) platform and provides the minimal set of polyfills the platform needs to run on evergreen browsers. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
261340
56
5954
11
44
3