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:
|
||||
ignore:
|
||||
- ins_n_outs
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/ionic-site" # cache ionic-site
|
||||
machine:
|
||||
node:
|
||||
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);
|
||||
|
||||
// requires bundle.system to be run once
|
||||
gulp.task('karma', ['tests'], function() {
|
||||
gulp.task('karma', ['tests'], function(done) {
|
||||
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() {
|
||||
@ -710,8 +717,15 @@ gulp.task('karma-watch', ['watch.tests', 'bundle.system'], function() {
|
||||
* some prerelease magic (see 'prepare') and copies npm package and tooling
|
||||
* files to dist.
|
||||
*/
|
||||
gulp.task('prerelease', ['prepare', 'build.release'], function(done){
|
||||
runSequence('package', done);
|
||||
gulp.task('prerelease', function(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
|
||||
* package.json minor version and generates CHANGELOG for release.
|
||||
*/
|
||||
gulp.task('prepare', function(){
|
||||
var execSync = require('child_process').execSync;
|
||||
var spawnSync = require('child_process').spawnSync;
|
||||
gulp.task('prepare', ['git-pull-latest'], function(){
|
||||
var semver = require('semver');
|
||||
var fs = require('fs');
|
||||
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
|
||||
var packageJSON = require('./package.json');
|
||||
@ -754,15 +753,31 @@ gulp.task('prepare', function(){
|
||||
preset: 'angular'
|
||||
}))
|
||||
.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
|
||||
self.removeAllListeners('task_stop');
|
||||
context.removeAllListeners('task_stop');
|
||||
console.error('Prepare aborted.');
|
||||
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.
|
||||
*/
|
||||
gulp.task('publish.nightly', function(done) {
|
||||
gulp.task('nightly', ['package'], function(done) {
|
||||
var fs = require('fs');
|
||||
var spawn = require('child_process').spawn;
|
||||
var packageJSON = require('./package.json');
|
||||
@ -872,6 +890,8 @@ gulp.task('publish.nightly', function(done) {
|
||||
.concat(createUniqueHash())
|
||||
.join('-');
|
||||
|
||||
fs.writeFileSync('./package.json', JSON.stringify(packageJSON, null, 2));
|
||||
|
||||
var npmCmd = spawn('npm', ['publish', '--tag=nightly', './dist']);
|
||||
|
||||
npmCmd.stdout.on('data', function (data) {
|
||||
@ -925,11 +945,11 @@ gulp.task('tooling', function(){
|
||||
/**
|
||||
* TS LINT
|
||||
*/
|
||||
gulp.task("tslint", function() {
|
||||
var tslint = require("gulp-tslint");
|
||||
gulp.src([
|
||||
'ionic/**/*.ts',
|
||||
'!ionic/**/test/**/*',
|
||||
]).pipe(tslint())
|
||||
.pipe(tslint.report('verbose'));
|
||||
gulp.task('tslint', function(done) {
|
||||
var tslint = require('gulp-tslint');
|
||||
return gulp.src([
|
||||
'ionic/**/*.ts',
|
||||
'!ionic/**/test/**/*',
|
||||
]).pipe(tslint())
|
||||
.pipe(tslint.report('verbose'));
|
||||
});
|
||||
|
@ -84,7 +84,7 @@ export class Img {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
@ -55,8 +55,8 @@ import {Platform} from '../../platform/platform';
|
||||
* <ion-input type="tel"></ion-input>
|
||||
* </ion-item>
|
||||
*
|
||||
* <ion-item clearInput>
|
||||
* <ion-input placeholder="Username"></ion-input>
|
||||
* <ion-item>
|
||||
* <ion-input placeholder="Username" clearInput></ion-input>
|
||||
* </ion-item>
|
||||
* ```
|
||||
*
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<ion-item>
|
||||
<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>
|
||||
|
||||
|
||||
|
@ -190,7 +190,7 @@ export class Platform {
|
||||
triggerReady() {
|
||||
this._zone.run(() => {
|
||||
this._readyResolve();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -741,5 +741,5 @@ export interface PlatformVersion {
|
||||
str?: string;
|
||||
num?: number;
|
||||
major?: number;
|
||||
minor?: number
|
||||
minor?: number;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ function run {
|
||||
fi
|
||||
|
||||
# Install gulp globally for site deploy script.
|
||||
npm install -g gulp
|
||||
# npm install -g gulp
|
||||
|
||||
if [[ "$IS_RELEASE" == "true" ]]; then
|
||||
echo "RELEASE DETECTED!"
|
||||
|
@ -12,10 +12,21 @@ function init {
|
||||
cd ..
|
||||
SITE_PATH=$(readJsonProp "config.json" "sitePath")
|
||||
SITE_DIR=$IONIC_DIR/$SITE_PATH
|
||||
DOCS_DEST=$(readJsonProp "config.json" "docsDest")
|
||||
|
||||
./git/clone.sh --repository="driftyco/ionic-site" \
|
||||
--directory="$SITE_DIR" \
|
||||
--branch="master"
|
||||
if [ ! -d "$SITE_DIR" ]; then
|
||||
echo "checking out"
|
||||
./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 {
|
||||
@ -23,14 +34,15 @@ function run {
|
||||
VERSION=$(readJsonProp "package.json" "version")
|
||||
|
||||
#compile API Demos
|
||||
gulp demos --production=true
|
||||
./node_modules/.bin/gulp demos --production=true
|
||||
|
||||
# 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
|
||||
gulp docs.sass-variables
|
||||
cp tmp/sass.json $SITE_DIR/docs/v2/theming/overriding-ionic-variables/
|
||||
./node_modules/.bin/gulp docs.sass-variables
|
||||
cp tmp/sass.json $DOCS_DEST/theming/overriding-ionic-variables/
|
||||
|
||||
# CD in to the site dir to commit updated docs
|
||||
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 -@>
|
||||
|
||||
<@ macro returnObject(params) -@>
|
||||
<@- if params -@><br>
|
||||
<@- for param in params -@>
|
||||
<code><$ param.type $></code> <span class="fixed-width"><$ param.key $></span> <$ param.description $><br>
|
||||
<@- endfor @>
|
||||
<@- if params -@>
|
||||
<table class="table returns-object-table param-table">
|
||||
<thead>
|
||||
<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 @>
|
||||
<@- endmacro -@>
|
||||
|
||||
|
Reference in New Issue
Block a user