mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
snapshat
This commit is contained in:
62
gulpfile.js
62
gulpfile.js
@ -78,6 +78,7 @@ gulp.task('watch', function() {
|
||||
|
||||
gulp.task('serve', function() {
|
||||
connect.server({
|
||||
root: 'dist',
|
||||
port: 8000,
|
||||
livereload: false
|
||||
});
|
||||
@ -95,11 +96,6 @@ var traceurOptions = {
|
||||
|
||||
var babelOptions = {
|
||||
optional: ['es7.decorators'],
|
||||
/*plugins: [
|
||||
'./transformers/disable-define',
|
||||
'angular2-annotations',
|
||||
'type-assertion:after'
|
||||
],*/
|
||||
modules: "system",
|
||||
moduleIds: true,
|
||||
getModuleId: function(name) {
|
||||
@ -109,29 +105,19 @@ var babelOptions = {
|
||||
|
||||
var exampleBabelOptions = {
|
||||
optional: ['es7.decorators'],
|
||||
/*plugins: [
|
||||
'./transformers/disable-define',
|
||||
'angular2-annotations',
|
||||
'type-assertion:after'
|
||||
],*/
|
||||
modules: "system",
|
||||
moduleIds: true,
|
||||
getModuleId: function(name) {
|
||||
return "dist/examples/" + name.split('/test').join('');
|
||||
return "examples/" + name.split('/test').join('');
|
||||
}
|
||||
};
|
||||
|
||||
var testBabelOptions = {
|
||||
optional: ['es7.decorators'],
|
||||
/*plugins: [
|
||||
'./transformers/disable-define',
|
||||
'angular2-annotations',
|
||||
'type-assertion:after'
|
||||
],*/
|
||||
modules: "system",
|
||||
moduleIds: true,
|
||||
getModuleId: function(name) {
|
||||
return "dist/tests/" + name.split('/test').join('');
|
||||
return "tests/" + name.split('/test').join('');
|
||||
}
|
||||
};
|
||||
|
||||
@ -161,11 +147,6 @@ gulp.task('transpile', function() {
|
||||
.on('error', function(error) {
|
||||
stream.emit('end');
|
||||
})
|
||||
// .pipe(traceur(traceurOptions))
|
||||
// .on('error', function (err) {
|
||||
// console.log("ERROR: " + err.message);
|
||||
// this.emit('end');
|
||||
// })
|
||||
.pipe(gulp.dest('dist/js/es6/ionic'))
|
||||
.pipe(babel(babelOptions))
|
||||
.on('error', function (err) {
|
||||
@ -183,24 +164,6 @@ gulp.task('bundle.js', function() {
|
||||
.pipe(gulp.dest('dist/js/'));
|
||||
});
|
||||
|
||||
//gulp.task('bundle.deps', function() {
|
||||
// var Builder = require('systemjs-builder')
|
||||
// var builder = new Builder();
|
||||
// return builder.loadConfig('config.js').then(function(){
|
||||
// // add ionic and angular2 build paths, since config.js is loaded at runtime from
|
||||
// // tests we don't want to put them there
|
||||
// builder.config({
|
||||
// baseURL: 'file:' + process.cwd(),
|
||||
// paths : {
|
||||
// "ionic/*": "dist/js/es6/ionic/*.js"
|
||||
// }
|
||||
// });
|
||||
// return builder.build('dist/js/es6/ionic/**/* - [dist/js/es6/ionic/**/*]', 'dist/js/dependencies.js');
|
||||
// }, function(error){
|
||||
// console.log("Error building dependency bundle, have you transpiled Ionic and/or built Angular2 yet?");
|
||||
// throw new Error(error);
|
||||
// })
|
||||
//});
|
||||
gulp.task('tests', function() {
|
||||
return gulp.src('ionic/components/*/test/*/**/*.spec.ts')
|
||||
.pipe(tsc(tscOptions, null, tscReporter))
|
||||
@ -214,7 +177,6 @@ gulp.task('tests', function() {
|
||||
|
||||
gulp.task('examples', function() {
|
||||
var buildTest = lazypipe()
|
||||
//.pipe(traceur, traceurOptions)
|
||||
.pipe(tsc, tscOptions, null, tscReporter)
|
||||
.pipe(babel, exampleBabelOptions)
|
||||
|
||||
@ -234,7 +196,7 @@ gulp.task('examples', function() {
|
||||
|
||||
function createIndexHTML() {
|
||||
var template = _.template(
|
||||
fs.readFileSync('scripts/e2e/ionic.template.html')
|
||||
fs.readFileSync('scripts/e2e/example.template.html')
|
||||
)({
|
||||
buildConfig: buildConfig
|
||||
});
|
||||
@ -244,7 +206,7 @@ gulp.task('examples', function() {
|
||||
|
||||
var module = path.dirname(file.path)
|
||||
.replace(__dirname, '')
|
||||
.replace('/ionic/components/', 'dist/examples/')
|
||||
.replace('/ionic/components/', 'examples/')
|
||||
.replace('/test/', '/') +
|
||||
'/index';
|
||||
|
||||
@ -265,11 +227,17 @@ var e2eBabelOptions = {
|
||||
modules: "system",
|
||||
moduleIds: true,
|
||||
getModuleId: function(name) {
|
||||
return "dist/e2e/" + name.split('/test').join('');
|
||||
return "e2e/" + name.split('/test').join('');
|
||||
}
|
||||
};
|
||||
|
||||
gulp.task('e2e', function() {
|
||||
gulp.task('copy-scripts', function(){
|
||||
gulp.src(['scripts/resources/*.js', 'config.js', 'dist/js/ionic.bundle.js',
|
||||
'dist/vendor/web-animations-js/web-animations.min.js'])
|
||||
.pipe(gulp.dest('dist/lib'));
|
||||
})
|
||||
|
||||
gulp.task('e2e', ['copy-scripts'], function() {
|
||||
var buildTest = lazypipe()
|
||||
//.pipe(traceur, traceurOptions)
|
||||
.pipe(tsc, tscOptions, null, tscReporter)
|
||||
@ -281,7 +249,7 @@ gulp.task('e2e', function() {
|
||||
.pipe(babel)
|
||||
|
||||
var indexTemplate = _.template(
|
||||
fs.readFileSync('scripts/e2e/ionic.template.html')
|
||||
fs.readFileSync('scripts/e2e/e2e.template.html')
|
||||
)({
|
||||
buildConfig: buildConfig
|
||||
|
||||
@ -316,7 +284,7 @@ gulp.task('e2e', function() {
|
||||
|
||||
var module = path.dirname(file.path)
|
||||
.replace(__dirname, '')
|
||||
.replace('/ionic/components/', 'dist/e2e/')
|
||||
.replace('/ionic/components/', 'e2e/')
|
||||
.replace('/test/', '/') +
|
||||
'/index';
|
||||
|
||||
|
@ -79,4 +79,3 @@ module.exports = function(options) {
|
||||
console.log('Uploading e2e tests:', options.testId);
|
||||
uploadFiles(inputDir, '');
|
||||
};
|
||||
|
||||
|
62
scripts/e2e/e2e.template.html
Normal file
62
scripts/e2e/e2e.template.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<!-- https://www.chromium.org/developers/design-documents/chromium-graphics/how-to-get-gpu-rasterization -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
|
||||
|
||||
<link href="../../../css/ionic.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
/* hack to create tall scrollable areas for testing using <f></f> */
|
||||
f {
|
||||
display: block;
|
||||
margin: 15px auto;
|
||||
max-width: 150px;
|
||||
height: 150px;
|
||||
background: blue;
|
||||
}
|
||||
f:last-of-type {
|
||||
background: red;
|
||||
}
|
||||
ion-tab:nth-of-type(2) f,
|
||||
.green f {
|
||||
background: green;
|
||||
max-width: 250px;
|
||||
height: 100px;
|
||||
}
|
||||
ion-tab:nth-of-type(3) f,
|
||||
.yellow f {
|
||||
background: yellow;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<ion-app module="{{MODULE}}">
|
||||
<ion-loading-icon></ion-loading-icon>
|
||||
</ion-app>
|
||||
|
||||
<!-- SystemJS Loader -->
|
||||
<script src="../../../lib/traceur-runtime.js"></script>
|
||||
<script src="../../../lib/system.js"></script>
|
||||
<script src="../../../lib/config.js"></script>
|
||||
|
||||
<!-- Angular bundle -->
|
||||
<script src="../../../lib/angular2.dev.js"></script>
|
||||
|
||||
<!-- test module -->
|
||||
<script src="index.js"></script>
|
||||
|
||||
<!-- ionic bundle -->
|
||||
<script src="../../../lib/ionic.bundle.js"></script>
|
||||
|
||||
<!-- web animations polyfill for non-chrome browsers -->
|
||||
<script src="../../../lib/web-animations.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -7,7 +7,7 @@
|
||||
|
||||
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
|
||||
|
||||
<link href="/dist/css/ionic.css" rel="stylesheet">
|
||||
<link href="/css/ionic.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
/* hack to create tall scrollable areas for testing using <f></f> */
|
||||
@ -42,18 +42,18 @@
|
||||
</ion-app>
|
||||
|
||||
<!-- SystemJS Loader -->
|
||||
<script src="/scripts/resources/traceur-runtime.js"></script>
|
||||
<script src="/scripts/resources/system.js"></script>
|
||||
<script src="/config.js"></script>
|
||||
<script src="/lib/traceur-runtime.js"></script>
|
||||
<script src="/lib/system.js"></script>
|
||||
<script src="/lib/config.js"></script>
|
||||
|
||||
<!-- Angular bundle -->
|
||||
<script src="/scripts/resources/angular2.dev.js"></script>
|
||||
<script src="/lib/angular2.dev.js"></script>
|
||||
|
||||
<!-- ionic bundle -->
|
||||
<script src="/dist/js/ionic.bundle.js"></script>
|
||||
<script src="/lib/ionic.bundle.js"></script>
|
||||
|
||||
<!-- web animations polyfill for non-chrome browsers -->
|
||||
<script src="/dist/vendor/web-animations-js/web-animations.min.js"></script>
|
||||
<script src="/lib/web-animations.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -20,7 +20,7 @@ module.exports = function(gulp, argv, buildConfig) {
|
||||
console.log('Serving `dist` on http://localhost:' + buildConfig.protractorPort);
|
||||
});
|
||||
|
||||
gulp.task('snapshot', ['build', 'protractor-server'], function(done) {
|
||||
gulp.task('snapshot', [/*'build',*/ 'protractor-server'], function(done) {
|
||||
var protractorConfigFile = path.resolve(projectRoot, 'scripts/snapshot/protractor.config.js');
|
||||
snapshot(done, protractorConfigFile);
|
||||
});
|
||||
|
Reference in New Issue
Block a user