mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
a sloth, by any other name would be as slow
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -24,6 +24,7 @@ bower_components/
|
|||||||
tmp
|
tmp
|
||||||
temp
|
temp
|
||||||
dist
|
dist
|
||||||
|
angular2
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
/src/components/split-view/test/settings/main.js
|
/src/components/split-view/test/settings/main.js
|
||||||
|
@ -10,16 +10,17 @@ System.config({
|
|||||||
"ionic/*": "dist/ionic/*.js",
|
"ionic/*": "dist/ionic/*.js",
|
||||||
"github:*": "jspm_packages/github/*.js",
|
"github:*": "jspm_packages/github/*.js",
|
||||||
"npm:*": "jspm_packages/npm/*.js",
|
"npm:*": "jspm_packages/npm/*.js",
|
||||||
|
"angular2/*": "angular2/dist/js/dev/es6/angular2/*.es6",
|
||||||
"*": "*.js"
|
"*": "*.js"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
System.config({
|
System.config({
|
||||||
"map": {
|
"map": {
|
||||||
"angular2": "npm:angular2@2.0.0-alpha.25",
|
|
||||||
"babel": "npm:babel-core@5.4.7",
|
"babel": "npm:babel-core@5.4.7",
|
||||||
"babel-runtime": "npm:babel-runtime@5.4.7",
|
"babel-runtime": "npm:babel-runtime@5.4.7",
|
||||||
"core-js": "npm:core-js@0.9.13",
|
"core-js": "npm:core-js@0.9.13",
|
||||||
|
"rx": "npm:rx@2.5.3",
|
||||||
"github:jspm/nodelibs-assert@0.1.0": {
|
"github:jspm/nodelibs-assert@0.1.0": {
|
||||||
"assert": "npm:assert@1.3.0"
|
"assert": "npm:assert@1.3.0"
|
||||||
},
|
},
|
||||||
@ -154,6 +155,9 @@ System.config({
|
|||||||
"npm:rx@2.5.1": {
|
"npm:rx@2.5.1": {
|
||||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||||
},
|
},
|
||||||
|
"npm:rx@2.5.3": {
|
||||||
|
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||||
|
},
|
||||||
"npm:semver@2.3.2": {
|
"npm:semver@2.3.2": {
|
||||||
"process": "github:jspm/nodelibs-process@0.1.1"
|
"process": "github:jspm/nodelibs-process@0.1.1"
|
||||||
},
|
},
|
||||||
|
85
gulpfile.js
85
gulpfile.js
@ -23,11 +23,12 @@ var webpack = require('gulp-webpack');
|
|||||||
var lazypipe = require('lazypipe');
|
var lazypipe = require('lazypipe');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gulp.task('build', function() {
|
gulp.task('build', function() {
|
||||||
runSequence(
|
runSequence(
|
||||||
'clean',
|
'clean',
|
||||||
'ionic.copy.js',
|
'ionic.traceur',
|
||||||
|
'ionic.bundle.deps',
|
||||||
|
'ionic.bundle.js',
|
||||||
'ionic.examples',
|
'ionic.examples',
|
||||||
'sass',
|
'sass',
|
||||||
'fonts',
|
'fonts',
|
||||||
@ -38,6 +39,7 @@ gulp.task('watch', function() {
|
|||||||
|
|
||||||
runSequence(
|
runSequence(
|
||||||
'clean',
|
'clean',
|
||||||
|
'link.angular',
|
||||||
'ionic.copy.js',
|
'ionic.copy.js',
|
||||||
'ionic.examples',
|
'ionic.examples',
|
||||||
'sass',
|
'sass',
|
||||||
@ -80,14 +82,9 @@ function doubleCheckDistFiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean', function(done) {
|
gulp.task('clean', function(done) {
|
||||||
del(['../angular-ionic/modules/ionic, ./angular-ionic/modules/examples/src/ionic, dist/'], done);
|
del(['dist/'], done);
|
||||||
});
|
});
|
||||||
|
|
||||||
//gulp.task('ionic.copy.js', function(done) {
|
|
||||||
// return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
|
||||||
// .pipe(gulp.dest('../angular-ionic/modules/ionic'));
|
|
||||||
//});
|
|
||||||
//
|
|
||||||
var traceurOptions = {
|
var traceurOptions = {
|
||||||
annotations: true,
|
annotations: true,
|
||||||
types: true,
|
types: true,
|
||||||
@ -104,13 +101,34 @@ gulp.task('clean', function(done) {
|
|||||||
modules: "system"
|
modules: "system"
|
||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('ionic.traceur.es6', function(done) {
|
gulp.task('ionic.traceur', function(done) {
|
||||||
return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
|
||||||
.pipe(traceur(traceurOptions))
|
.pipe(traceur(traceurOptions))
|
||||||
//.pipe(concat('ionic.bundle.js'))
|
|
||||||
.pipe(gulp.dest('dist/ionic'));
|
.pipe(gulp.dest('dist/ionic'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('ionic.bundle.js', function() {
|
||||||
|
var Builder = require('systemjs-builder');
|
||||||
|
var builder = new Builder();
|
||||||
|
return builder.loadConfig('config.js').then(function(){
|
||||||
|
builder.config({ baseURL: 'file:' + process.cwd() });
|
||||||
|
return builder.build('dist/ionic/ionic - dist/js/dependencies', 'dist/js/ionic.bundle.js');
|
||||||
|
}, function(error){
|
||||||
|
throw new Error(error);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('ionic.bundle.deps', function() {
|
||||||
|
var Builder = require('systemjs-builder');
|
||||||
|
var builder = new Builder();
|
||||||
|
return builder.loadConfig('config.js').then(function(){
|
||||||
|
builder.config({ baseURL: 'file:' + process.cwd() });
|
||||||
|
return builder.build('dist/ionic/ionic - [dist/ionic/ionic]', 'dist/js/dependencies.js');
|
||||||
|
}, function(error){
|
||||||
|
throw new Error(error);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('ionic.examples', function() {
|
gulp.task('ionic.examples', function() {
|
||||||
var buildTest = lazypipe()
|
var buildTest = lazypipe()
|
||||||
.pipe(traceur, traceurOptions)
|
.pipe(traceur, traceurOptions)
|
||||||
@ -119,13 +137,13 @@ gulp.task('ionic.examples', function() {
|
|||||||
// Get each test folder with gulp.src
|
// Get each test folder with gulp.src
|
||||||
return gulp.src('ionic/components/*/test/*/**/*')
|
return gulp.src('ionic/components/*/test/*/**/*')
|
||||||
.pipe(gulpif(/.js$/, buildTest()))
|
.pipe(gulpif(/.js$/, buildTest()))
|
||||||
.pipe(gulpif(/index.js$/, createTest()))
|
.pipe(gulpif(/index.js$/, createIndexHTML()))
|
||||||
.pipe(rename(function(file) {
|
.pipe(rename(function(file) {
|
||||||
file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
|
file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('dist/examples/'))
|
.pipe(gulp.dest('dist/examples/'))
|
||||||
|
|
||||||
function createTest() {
|
function createIndexHTML() {
|
||||||
var indexContents = _.template(
|
var indexContents = _.template(
|
||||||
fs.readFileSync('scripts/e2e/ionic.template.html')
|
fs.readFileSync('scripts/e2e/ionic.template.html')
|
||||||
)({
|
)({
|
||||||
@ -133,12 +151,6 @@ gulp.task('ionic.examples', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return through2.obj(function(file, enc, next) {
|
return through2.obj(function(file, enc, next) {
|
||||||
// debugger;
|
|
||||||
//var Builder = require('systemjs-builder');
|
|
||||||
//var builder = new Builder();
|
|
||||||
//builder.loadConfig('config.js').then(function(){
|
|
||||||
//builder.config(systemjsConfig);
|
|
||||||
// builder.build('index'/*, path.join(path.dirname(file.path), 'index.js')*/).then(function(){
|
|
||||||
var self = this;
|
var self = this;
|
||||||
self.push(new VinylFile({
|
self.push(new VinylFile({
|
||||||
base: file.base,
|
base: file.base,
|
||||||
@ -146,23 +158,10 @@ gulp.task('ionic.examples', function() {
|
|||||||
path: path.join(path.dirname(file.path), 'index.html'),
|
path: path.join(path.dirname(file.path), 'index.html'),
|
||||||
}));
|
}));
|
||||||
next(null, file);
|
next(null, file);
|
||||||
//});
|
|
||||||
//})
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
gulp.task('build.system.js', function() {
|
|
||||||
var Builder = require('systemjs-builder');
|
|
||||||
var builder = new Builder();
|
|
||||||
builder.loadConfig('config.js').then(function(){
|
|
||||||
//builder.config(systemjsConfig);
|
|
||||||
return builder.build('index', 'index.js');
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
gulp.task('sass', function() {
|
gulp.task('sass', function() {
|
||||||
return gulp.src('ionic/ionic.scss')
|
return gulp.src('ionic/ionic.scss')
|
||||||
.pipe(sass({
|
.pipe(sass({
|
||||||
@ -171,29 +170,34 @@ gulp.task('sass', function() {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.pipe(autoprefixer(buildConfig.autoprefixer))
|
.pipe(autoprefixer(buildConfig.autoprefixer))
|
||||||
.pipe(gulp.dest('../angular-ionic/dist/js/dev/es5/css'));
|
.pipe(gulp.dest('dist/css/'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
gulp.task('fonts', function() {
|
gulp.task('fonts', function() {
|
||||||
return gulp.src('ionic/components/icon/fonts/**/*')
|
return gulp.src('ionic/components/icon/fonts/**/*')
|
||||||
.pipe(gulp.dest('../angular-ionic/dist/js/dev/es5/fonts'));
|
.pipe(gulp.dest('dist/fonts'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
gulp.task('polyfills', function() {
|
gulp.task('polyfills', function() {
|
||||||
return gulp.src('ionic/animations/web-animations*')
|
return gulp.src('ionic/animations/web-animations*')
|
||||||
.pipe(gulp.dest('../angular-ionic/dist/js/dev/es5/polyfills'));
|
.pipe(gulp.dest('dist/polyfills'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('link.angular', function() {
|
||||||
|
if (!fs.existsSync('../angular-ionic')) {
|
||||||
|
throw new Error("../angular-ionic doesn't exist. Run gulp update.angular first");
|
||||||
|
}
|
||||||
|
linkAngular();
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task('update.angular', function(done) {
|
gulp.task('update.angular', function(done) {
|
||||||
|
|
||||||
if (!fs.existsSync('../angular-ionic')) {
|
if (!fs.existsSync('../angular-ionic')) {
|
||||||
fs.mkdirSync('../angular-ionic');
|
|
||||||
|
|
||||||
console.log('cloning angular master...');
|
console.log('cloning angular master...');
|
||||||
exec('git clone git@github.com:angular/angular ../angular-ionic', function() {
|
exec('git clone git@github.com:angular/angular ../angular-ionic', function() {
|
||||||
|
linkAngular();
|
||||||
npmInstall();
|
npmInstall();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -222,6 +226,13 @@ gulp.task('update.angular', function(done) {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function linkAngular() {
|
||||||
|
if (!fs.existsSync('angular2')) {
|
||||||
|
console.log("Symlinking ../angular-ionic to angular2");
|
||||||
|
fs.symlinkSync('../angular-ionic', 'angular2');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
|
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
|
||||||
|
@ -56,7 +56,8 @@
|
|||||||
"jspm": {
|
"jspm": {
|
||||||
"directories": {},
|
"directories": {},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "npm:angular2@^2.0.0-alpha.25"
|
"angular2": "npm:angular2@^2.0.0-alpha.25",
|
||||||
|
"rx": "npm:rx@^2.5.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel": "npm:babel-core@^5.1.13",
|
"babel": "npm:babel-core@^5.1.13",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||||
<link href="/css/ionic.css" rel="stylesheet">
|
<link href="/../../../../dist/css/ionic.css" rel="stylesheet">
|
||||||
<!--
|
<!--
|
||||||
<script src="/../../../node_modules/angular2/node_modules/zone.js/dist/zone.js"></script>
|
<script src="/../../../node_modules/angular2/node_modules/zone.js/dist/zone.js"></script>
|
||||||
<script src="/../../../node_modules/reflect-metadata/Reflect.js"></script>
|
<script src="/../../../node_modules/reflect-metadata/Reflect.js"></script>
|
||||||
@ -32,7 +32,8 @@
|
|||||||
<script src="/../../../../scripts/component/babel-external-helpers.js" type="text/javascript"></script><script src="/../../../../scripts/component/Reflect.js" type="text/javascript"></script>
|
<script src="/../../../../scripts/component/babel-external-helpers.js" type="text/javascript"></script><script src="/../../../../scripts/component/Reflect.js" type="text/javascript"></script>
|
||||||
<script src="/../../../../scripts/component/system.src.js"></script>
|
<script src="/../../../../scripts/component/system.src.js"></script>
|
||||||
<script src="/../../../../config.js"></script>
|
<script src="/../../../../config.js"></script>
|
||||||
<script src="/../../../../build.js"></script>
|
<script src="/../../../../dist/js/dependencies.js"></script>
|
||||||
|
<script src="/../../../../dist/js/ionic.bundle.js"></script>
|
||||||
<!-- <script src="../../../../bundle.js"></script> -->
|
<!-- <script src="../../../../bundle.js"></script> -->
|
||||||
<script type="text/javascript">System.import(window.location.pathname.substring(1) + 'index').then(function(m) { m.main(); }, console.error.bind(console))</script>
|
<script type="text/javascript">System.import(window.location.pathname.substring(1) + 'index').then(function(m) { m.main(); }, console.error.bind(console))</script>
|
||||||
</body>
|
</body>
|
||||||
|
Reference in New Issue
Block a user