mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
Merge branch '2.0' of https://github.com/kkarich/ionic into feature-clear-input
This commit is contained in:
@ -2,6 +2,9 @@ general:
|
|||||||
branches:
|
branches:
|
||||||
ignore:
|
ignore:
|
||||||
- ins_n_outs
|
- ins_n_outs
|
||||||
|
dependencies:
|
||||||
|
cache_directories:
|
||||||
|
- "~/ionic-site" # cache ionic-site
|
||||||
machine:
|
machine:
|
||||||
node:
|
node:
|
||||||
version: 4.1.0
|
version: 4.1.0
|
||||||
|
80
gulpfile.js
80
gulpfile.js
@ -689,9 +689,16 @@ function buildDemoSass(isProductionMode) {
|
|||||||
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
|
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
|
||||||
|
|
||||||
// requires bundle.system to be run once
|
// requires bundle.system to be run once
|
||||||
gulp.task('karma', ['tests'], function() {
|
gulp.task('karma', ['tests'], function(done) {
|
||||||
var karma = require('karma').server;
|
var karma = require('karma').server;
|
||||||
return karma.start({ configFile: __dirname + '/scripts/karma/karma.conf.js' })
|
karma.start({
|
||||||
|
configFile: __dirname + '/scripts/karma/karma.conf.js'
|
||||||
|
}, function(result) {
|
||||||
|
if (result > 0) {
|
||||||
|
return done(new Error('Karma exited with an error'));
|
||||||
|
}
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
||||||
@ -710,8 +717,15 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
|||||||
* some prerelease magic (see 'prepare') and copies npm package and tooling
|
* some prerelease magic (see 'prepare') and copies npm package and tooling
|
||||||
* files to dist.
|
* files to dist.
|
||||||
*/
|
*/
|
||||||
gulp.task('prerelease', ['prepare', 'build.release'], function(done){
|
gulp.task('prerelease', function(done){
|
||||||
runSequence('package', done);
|
runSequence(
|
||||||
|
'tslint',
|
||||||
|
'prepare',
|
||||||
|
'build.release',
|
||||||
|
'karma',
|
||||||
|
'package',
|
||||||
|
done
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -723,25 +737,10 @@ gulp.task('release', ['publish.npm', 'publish.github']);
|
|||||||
* Pulls latest, ensures there are no unstaged/uncommitted changes, updates
|
* Pulls latest, ensures there are no unstaged/uncommitted changes, updates
|
||||||
* package.json minor version and generates CHANGELOG for release.
|
* package.json minor version and generates CHANGELOG for release.
|
||||||
*/
|
*/
|
||||||
gulp.task('prepare', function(){
|
gulp.task('prepare', ['git-pull-latest'], function(){
|
||||||
var execSync = require('child_process').execSync;
|
|
||||||
var spawnSync = require('child_process').spawnSync;
|
|
||||||
var semver = require('semver');
|
var semver = require('semver');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var changelog = require('gulp-conventional-changelog');
|
var changelog = require('gulp-conventional-changelog');
|
||||||
var self = this;
|
|
||||||
|
|
||||||
//Check for uncommitted changes
|
|
||||||
var gitStatusResult = execSync('git status --porcelain');
|
|
||||||
if (gitStatusResult.toString().length > 0) {
|
|
||||||
return fail('You have uncommitted changes, please stash or commit them before running prepare');
|
|
||||||
}
|
|
||||||
|
|
||||||
//Pull latest
|
|
||||||
var gitPullResult = spawnSync('git', ['pull', 'origin', '2.0']);
|
|
||||||
if (gitPullResult.status !== 0) {
|
|
||||||
fail('There was an error running \'git pull\':\n' + gitPullResult.stderr.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
//Update package.json version
|
//Update package.json version
|
||||||
var packageJSON = require('./package.json');
|
var packageJSON = require('./package.json');
|
||||||
@ -754,15 +753,31 @@ gulp.task('prepare', function(){
|
|||||||
preset: 'angular'
|
preset: 'angular'
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('./'));
|
.pipe(gulp.dest('./'));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function fail(msg) {
|
gulp.task('git-pull-latest', function() {
|
||||||
|
var execSync = require('child_process').execSync;
|
||||||
|
var spawnSync = require('child_process').spawnSync;
|
||||||
|
|
||||||
|
function fail(context, msg) {
|
||||||
// remove gulp's 'Finished 'task' after 10ms' message
|
// remove gulp's 'Finished 'task' after 10ms' message
|
||||||
self.removeAllListeners('task_stop');
|
context.removeAllListeners('task_stop');
|
||||||
console.error('Prepare aborted.');
|
console.error('Prepare aborted.');
|
||||||
console.error(msg);
|
console.error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Check for uncommitted changes
|
||||||
|
var gitStatusResult = execSync('git status --porcelain');
|
||||||
|
if (gitStatusResult.toString().length > 0) {
|
||||||
|
return fail(this, 'You have uncommitted changes, please stash or commit them before running prepare');
|
||||||
|
}
|
||||||
|
|
||||||
|
//Pull latest
|
||||||
|
var gitPullResult = spawnSync('git', ['pull', 'origin', '2.0']);
|
||||||
|
if (gitPullResult.status !== 0) {
|
||||||
|
fail('There was an error running \'git pull\':\n' + gitPullResult.stderr.toString());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -843,11 +858,14 @@ gulp.task('publish.npm', function(done) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
gulp.task('publish.nightly', ['build.release'], function(done){
|
||||||
|
runSequence('git-pull-latest', 'nightly', done);
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publishes a new tag to npm with a nightly tag.
|
* Publishes a new tag to npm with a nightly tag.
|
||||||
*/
|
*/
|
||||||
gulp.task('publish.nightly', function(done) {
|
gulp.task('nightly', ['package'], function(done) {
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
var packageJSON = require('./package.json');
|
var packageJSON = require('./package.json');
|
||||||
@ -872,6 +890,8 @@ gulp.task('publish.nightly', function(done) {
|
|||||||
.concat(createUniqueHash())
|
.concat(createUniqueHash())
|
||||||
.join('-');
|
.join('-');
|
||||||
|
|
||||||
|
fs.writeFileSync('./package.json', JSON.stringify(packageJSON, null, 2));
|
||||||
|
|
||||||
var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']);
|
var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']);
|
||||||
|
|
||||||
npmCmd.stdout.on('data', function (data) {
|
npmCmd.stdout.on('data', function (data) {
|
||||||
@ -925,11 +945,11 @@ gulp.task('tooling', function(){
|
|||||||
/**
|
/**
|
||||||
* TS LINT
|
* TS LINT
|
||||||
*/
|
*/
|
||||||
gulp.task("tslint", function() {
|
gulp.task('tslint', function(done) {
|
||||||
var tslint = require("gulp-tslint");
|
var tslint = require('gulp-tslint');
|
||||||
gulp.src([
|
return gulp.src([
|
||||||
'ionic/**/*.ts',
|
'ionic/**/*.ts',
|
||||||
'!ionic/**/test/**/*',
|
'!ionic/**/test/**/*',
|
||||||
]).pipe(tslint())
|
]).pipe(tslint())
|
||||||
.pipe(tslint.report('verbose'));
|
.pipe(tslint.report('verbose'));
|
||||||
});
|
});
|
||||||
|
@ -84,7 +84,7 @@ export class Img {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _loaded(isLoaded: boolean) {
|
private _loaded(isLoaded: boolean) {
|
||||||
this._elementRef.nativeElement.classList[isLoaded ? 'add': 'remove']('img-loaded');
|
this._elementRef.nativeElement.classList[isLoaded ? 'add' : 'remove']('img-loaded');
|
||||||
}
|
}
|
||||||
|
|
||||||
enable(shouldEnable: boolean) {
|
enable(shouldEnable: boolean) {
|
||||||
|
@ -55,8 +55,8 @@ import {Platform} from '../../platform/platform';
|
|||||||
* <ion-input type="tel"></ion-input>
|
* <ion-input type="tel"></ion-input>
|
||||||
* </ion-item>
|
* </ion-item>
|
||||||
*
|
*
|
||||||
* <ion-item clearInput>
|
* <ion-item>
|
||||||
* <ion-input placeholder="Username"></ion-input>
|
* <ion-input placeholder="Username" clearInput></ion-input>
|
||||||
* </ion-item>
|
* </ion-item>
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label>Text 1:</ion-label>
|
<ion-label>Text 1:</ion-label>
|
||||||
<ion-input class="e2eClearInput" [(ngModel)]="myParam" clearInput></ion-input>
|
<ion-input class="e2eClearInput" [(ngModel)]="myValue" clearInput></ion-input>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ export class Platform {
|
|||||||
triggerReady() {
|
triggerReady() {
|
||||||
this._zone.run(() => {
|
this._zone.run(() => {
|
||||||
this._readyResolve();
|
this._readyResolve();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -741,5 +741,5 @@ export interface PlatformVersion {
|
|||||||
str?: string;
|
str?: string;
|
||||||
num?: number;
|
num?: number;
|
||||||
major?: number;
|
major?: number;
|
||||||
minor?: number
|
minor?: number;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ function run {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Install gulp globally for site deploy script.
|
# Install gulp globally for site deploy script.
|
||||||
npm install -g gulp
|
# npm install -g gulp
|
||||||
|
|
||||||
if [[ "$IS_RELEASE" == "true" ]]; then
|
if [[ "$IS_RELEASE" == "true" ]]; then
|
||||||
echo "RELEASE DETECTED!"
|
echo "RELEASE DETECTED!"
|
||||||
|
@ -12,10 +12,21 @@ function init {
|
|||||||
cd ..
|
cd ..
|
||||||
SITE_PATH=$(readJsonProp "config.json" "sitePath")
|
SITE_PATH=$(readJsonProp "config.json" "sitePath")
|
||||||
SITE_DIR=$IONIC_DIR/$SITE_PATH
|
SITE_DIR=$IONIC_DIR/$SITE_PATH
|
||||||
|
DOCS_DEST=$(readJsonProp "config.json" "docsDest")
|
||||||
|
|
||||||
./git/clone.sh --repository="driftyco/ionic-site" \
|
if [ ! -d "$SITE_DIR" ]; then
|
||||||
--directory="$SITE_DIR" \
|
echo "checking out"
|
||||||
--branch="master"
|
./git/clone.sh --repository="driftyco/ionic-site" \
|
||||||
|
--directory="$SITE_DIR" \
|
||||||
|
--branch="master" \
|
||||||
|
--depth=1
|
||||||
|
else
|
||||||
|
echo "using existing"
|
||||||
|
cd $SITE_DIR
|
||||||
|
git reset --hard
|
||||||
|
git pull origin master
|
||||||
|
cd $IONIC_DIR/scripts
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function run {
|
function run {
|
||||||
@ -23,14 +34,15 @@ function run {
|
|||||||
VERSION=$(readJsonProp "package.json" "version")
|
VERSION=$(readJsonProp "package.json" "version")
|
||||||
|
|
||||||
#compile API Demos
|
#compile API Demos
|
||||||
gulp demos --production=true
|
./node_modules/.bin/gulp demos --production=true
|
||||||
|
|
||||||
# process new docs
|
# process new docs
|
||||||
gulp docs --doc-version="$VERSION_NAME"
|
rm -R $DOCS_DEST/api
|
||||||
|
./node_modules/.bin/gulp docs --doc-version="$VERSION_NAME"
|
||||||
|
|
||||||
# compile sass vars json for ionic-site docs
|
# compile sass vars json for ionic-site docs
|
||||||
gulp docs.sass-variables
|
./node_modules/.bin/gulp docs.sass-variables
|
||||||
cp tmp/sass.json $SITE_DIR/docs/v2/theming/overriding-ionic-variables/
|
cp tmp/sass.json $DOCS_DEST/theming/overriding-ionic-variables/
|
||||||
|
|
||||||
# CD in to the site dir to commit updated docs
|
# CD in to the site dir to commit updated docs
|
||||||
cd $SITE_DIR
|
cd $SITE_DIR
|
||||||
|
29
scripts/docs/templates/common.template.html
vendored
29
scripts/docs/templates/common.template.html
vendored
@ -24,10 +24,31 @@ angular_controller: APIDemoCtrl <@ endif @>
|
|||||||
<@- endmacro -@>
|
<@- endmacro -@>
|
||||||
|
|
||||||
<@ macro returnObject(params) -@>
|
<@ macro returnObject(params) -@>
|
||||||
<@- if params -@><br>
|
<@- if params -@>
|
||||||
<@- for param in params -@>
|
<table class="table returns-object-table param-table">
|
||||||
<code><$ param.type $></code> <span class="fixed-width"><$ param.key $></span> <$ param.description $><br>
|
<thead>
|
||||||
<@- endfor @>
|
<tr>
|
||||||
|
<th>Property</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Details</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<@ for param in params @>
|
||||||
|
<tr>
|
||||||
|
<td class="fixed-width">
|
||||||
|
<$ param.key $>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<$ param.type | code $>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<$ param.description | marked $>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<@ endfor @>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<@- endif @>
|
<@- endif @>
|
||||||
<@- endmacro -@>
|
<@- endmacro -@>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user