Merge branch 'master' into v4

# Conflicts:
#	.scss-lint.yml
#	README.md
#	scripts/gulp/tasks/e2e.dev.ts
#	scripts/gulp/util.ts
#	src/components/action-sheet/action-sheet-component.ts
#	src/components/card/card.ios.scss
#	src/components/card/card.md.scss
#	src/components/card/card.wp.scss
#	src/components/card/test/map/main.html
#	src/components/card/test/social/main.html
#	src/components/slides/slides.scss
#	src/components/slides/slides.ts
#	src/components/toggle/toggle.ios.scss
#	src/components/toggle/toggle.ts
#	src/themes/ionic.mixins.scss
This commit is contained in:
Brandy Carney
2017-06-12 13:33:33 -04:00
195 changed files with 2991 additions and 1421 deletions

View File

@ -20,7 +20,7 @@ export const BUNDLES = 'bundles';
export const SITE_NAME = 'ionic-site';
// File Paths
export const PROJECT_ROOT = join(__dirname, '../..');
export const PROJECT_ROOT = join(__dirname, '..', '..');
export const DEMOS_ROOT = join(PROJECT_ROOT, DEMOS_NAME);
export const DEMOS_SRC_ROOT = join(DEMOS_ROOT, SRC_NAME);
export const DIST_ROOT = join(PROJECT_ROOT, DIST_NAME);
@ -45,7 +45,7 @@ export const WORKERS_SRC = join(SCRIPTS_ROOT, 'workers');
// NPM
export const NPM_VENDOR_FILES = [
'@angular', 'core-js/client', 'rxjs', 'systemjs/dist', 'zone.js/dist'
'@angular', join('core-js', 'client'), 'rxjs', join('systemjs', 'dist'), join('zone.js', 'dist')
];

View File

@ -1,4 +1,5 @@
import { task } from 'gulp';
import { join } from 'path';
import { DIST_BUILD_ROOT, DIST_BUILD_ES2015_ROOT, DIST_BUILD_UMD_ROOT, ES5, ES_2015, PROJECT_ROOT, UMD_MODULE } from '../constants';
import { copySourceToDest, createTempTsConfig, deleteFiles, runNgc, runTsc } from '../util';
@ -7,8 +8,8 @@ export function buildIonicAngularUmd(excludeSpec: boolean, stripDebug: boolean,
const stream = copySourceToDest(DIST_BUILD_UMD_ROOT, excludeSpec, true, stripDebug);
stream.on('end', () => {
// the source files are copied, copy over a tsconfig from
createTempTsConfig(['./**/*.ts'], ES5, UMD_MODULE, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_UMD_ROOT}/tsconfig.json`);
runNgc(`${DIST_BUILD_UMD_ROOT}/tsconfig.json`, (err) => {
createTempTsConfig([join('.', '**', '*.ts')], ES5, UMD_MODULE, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'));
runNgc(join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'), (err) => {
if (err) {
done(err);
return;
@ -27,8 +28,8 @@ export function buildIonicAngularUmdTsc(excludeSpec: boolean, stripDebug: boolea
const stream = copySourceToDest(DIST_BUILD_UMD_ROOT, excludeSpec, true, stripDebug);
stream.on('end', () => {
// the source files are copied, copy over a tsconfig from
createTempTsConfig(['./**/*.ts'], ES5, UMD_MODULE, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_UMD_ROOT}/tsconfig.json`);
runTsc(`${DIST_BUILD_UMD_ROOT}/tsconfig.json`, (err) => {
createTempTsConfig([join('.', '**', '*.ts')], ES5, UMD_MODULE, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'));
runTsc(join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'), (err) => {
if (err) {
done(err);
return;
@ -48,8 +49,8 @@ export function buildIonicAngularEsm(stripDebug: boolean, done: Function) {
const stream = copySourceToDest(DIST_BUILD_ROOT, true, true, stripDebug);
stream.on('end', () => {
// the source files are copied, copy over a tsconfig from
createTempTsConfig(['./**/*.ts'], ES5, ES_2015, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_ROOT}/tsconfig.json`);
runNgc(`${DIST_BUILD_ROOT}/tsconfig.json`, (err) => {
createTempTsConfig([join('.', '**', '*.ts')], ES5, ES_2015, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_ROOT, 'tsconfig.json'));
runNgc(join(DIST_BUILD_ROOT, 'tsconfig.json'), (err) => {
if (err) {
done(err);
return;
@ -67,8 +68,8 @@ export function buildIonicPureEs6(stripDebug: boolean, done: Function) {
const stream = copySourceToDest(DIST_BUILD_ES2015_ROOT, true, true, stripDebug);
stream.on('end', () => {
// the source files are copied, copy over a tsconfig from
createTempTsConfig(['./**/*.ts'], ES_2015, ES_2015, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_ES2015_ROOT}/tsconfig.json`);
runNgc(`${DIST_BUILD_ES2015_ROOT}/tsconfig.json`, (err) => {
createTempTsConfig([join('.', '**', '*.ts')], ES_2015, ES_2015, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_ES2015_ROOT, 'tsconfig.json'));
runNgc(join(DIST_BUILD_ES2015_ROOT, 'tsconfig.json'), (err) => {
if (err) {
done(err);
return;

View File

@ -132,8 +132,8 @@ task('docs.sassVariables', () => {
callback();
}).on('end', () => {
const config = require('../../config.json');
console.log(`Writing to file at /driftyco/ionic/${outputFile}`);
console.log(`Place this file in /driftyco/ionic-site/${config.v2DocsDir}/theming/overriding-ionic-variables in order to update the docs`);
console.log(`Writing to file at /ionic-team/ionic/${outputFile}`);
console.log(`Place this file in /ionic-team/ionic-site/${config.v2DocsDir}/theming/overriding-ionic-variables in order to update the docs`);
mkdirp.sync('tmp');
writeFileSync(outputFile, JSON.stringify(variables));
}));

View File

@ -49,5 +49,5 @@ function serveTest(folderInfo: any) {
const appNgModulePath = join(dirname(appEntryPoint), 'app.module.ts');
const distDir = join(distTestRoot, 'www');
return runAppScriptsServe(testOrDemoName, appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, coreCompilerFilePath, coreDir, sassConfigPath, copyConfigPath, null);
return runAppScriptsServe(join(folderInfo.componentName, folderInfo.componentTest), appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, null);
}

View File

@ -21,7 +21,7 @@ task('e2e.prepare', (done: Function) => {
task('e2e.prepareSass', (done: Function) => {
const version = `E2E-${createTimestamp()}`;
writeFileSync(join(SRC_ROOT, 'themes/version.scss'), `$ionic-version: "${version}";`);
writeFileSync(join(SRC_ROOT, 'themes', 'version.scss'), `$ionic-version: "${version}";`);
done();
});
@ -41,7 +41,7 @@ task('e2e.prod', ['e2e.prepare', 'core'], (done: Function) => {
});
function e2eComponentExists(folderInfo: any): boolean {
let componentPath = `${SRC_COMPONENTS_ROOT}/${folderInfo.componentName}/test/${folderInfo.componentTest}/app`;
let componentPath = join(SRC_COMPONENTS_ROOT, folderInfo.componentName, 'test', folderInfo.componentTest, 'app');
try {
accessSync(componentPath);
@ -62,11 +62,11 @@ function filterE2eTestfiles() {
const folderInfo = getFolderInfo();
if (folderInfo && folderInfo.componentName && folderInfo.componentTest) {
if (!e2eComponentExists(folderInfo)) {
console.log(`Can't find E2E test "${folderInfo.componentName}/test/${folderInfo.componentTest}". Make sure that the test exists and you are passing the correct folder.`);
console.log('Cannot find E2E test ', join(folderInfo.componentName, 'test', folderInfo.componentTest), '. Make sure that the test exists and you are passing the correct folder.');
return [];
}
const filtered = entryPoints.filter(entryPoint => {
return entryPoint.indexOf(`${folderInfo.componentName}/test/${folderInfo.componentTest}`) >= 0;
return entryPoint.indexOf(join(folderInfo.componentName, 'test', folderInfo.componentTest)) >= 0;
});
return filtered;
}
@ -123,7 +123,7 @@ function buildTest(filePath: string) {
const coreCompilerFilePath = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiler');
const coreDir = join(PROJECT_ROOT, '..', 'ionic-core', 'dist', 'compiled-ionic-angular');
const includeGlob = [ join(ionicAngularDir, '**', '*.ts')];
const includeGlob = [join(ionicAngularDir, '**', '*.ts')];
const pathToWriteFile = join(distTestRoot, 'tsconfig.json');
const pathToReadFile = join(PROJECT_ROOT, 'tsconfig.json');
@ -156,7 +156,7 @@ function copyProtractorTestContent(filePaths: string[]): Promise<any> {
}
function applyTemplate(filePathContent: Map<string, string>) {
const buildConfig = require('../../build/config');
const buildConfig = require(join('..', '..', 'build', 'config'));
const templateFileContent = readFileSync(join(SCRIPTS_ROOT, 'e2e', 'e2e.template.js'));
const templater = template(templateFileContent.toString());
const modifiedMap = new Map<string, string>();
@ -237,7 +237,7 @@ task('e2e.polyfill', (done: Function) => {
return done();
}
writePolyfills('dist/e2e/polyfills').then(() => {
writePolyfills(join('dist', 'e2e', 'polyfills')).then(() => {
done();
}).catch(err => {
done(err);
@ -251,9 +251,8 @@ task('e2e.openProd', (done: Function) => {
task('e2e.open', (done: Function) => {
const folderInfo = getFolderInfo();
if (folderInfo && folderInfo.componentName && folderInfo.componentTest) {
const filePath = `${folderInfo.componentName}/test/${folderInfo.componentTest}/www/index.html`;
const fullPath = join(DIST_E2E_COMPONENTS_ROOT, filePath);
const spawnedCommand = spawn('open', [fullPath]);
const filePath = join(DIST_E2E_COMPONENTS_ROOT, folderInfo.componentName, 'test', folderInfo.componentTest, 'www', 'index.html');
const spawnedCommand = spawn('open', [filePath]);
spawnedCommand.on('close', (code: number) => {
done();

View File

@ -1,9 +1,10 @@
import { task } from 'gulp';
import { writePolyfills } from '../util';
import { join } from 'path';
task('src.polyfill', (done: Function) => {
writePolyfills('scripts/polyfill').then(() => {
writePolyfills(join('scripts', 'polyfills')).then(() => {
done();
}).catch(err => {
done(err);

View File

@ -1,10 +1,11 @@
import { task, src, dest } from 'gulp';
import { writePolyfills } from '../util';
import { join } from 'path';
task('polyfill', ['polyfill.copy-readme', 'polyfill.write']);
task('polyfill.write', (done: Function) => {
writePolyfills('dist/ionic-angular/polyfills').then(() => {
writePolyfills(join('dist', 'ionic-angular', 'polyfills')).then(() => {
done();
}).catch(err => {
done(err);
@ -12,6 +13,6 @@ task('polyfill.write', (done: Function) => {
});
task('polyfill.copy-readme', (done: Function) => {
return src('scripts/polyfill/readme.md')
.pipe(dest('dist/ionic-angular/polyfills/'), done);
return src(join('scripts', 'polyfill', 'readme.md'))
.pipe(dest(join('dist', 'ionic-angular', 'polyfills')), done);
});

View File

@ -86,7 +86,7 @@ task('release.publishGithubRelease', (done: Function) => {
})
.pipe(obj(function(file, enc, cb){
github.releases.createRelease({
owner: 'driftyco',
owner: 'ionic-team',
repo: 'ionic',
target_commitish: 'master',
tag_name: 'v' + packageJSON.version,

View File

@ -77,7 +77,9 @@ function protractor(callback, args, testId: string) {
console.log(`Serving ${process.cwd()} on http://localhost:${buildConfig.protractorPort}`);
const child = spawn('protractor', args, {
let spawnCommand = process.platform === 'win32' ? 'protractor.cmd' : 'protractor';
const child = spawn(spawnCommand, args, {
stdio: [process.stdin, process.stdout, 'pipe']
});

View File

@ -79,7 +79,9 @@ export function createTempTsConfig(includeGlob: string[], target: string, module
config.compilerOptions = Object.assign(config.compilerOptions, overrideCompileOptions);
}
// TS represents paths internally with '/' and expects the tsconfig path to be in this format
let json = JSON.stringify(config, null, 2);
json = json.replace(/\\\\/g, '/');
const dirToCreate = dirname(pathToWriteFile);
ensureDirSync(dirToCreate);
@ -238,9 +240,11 @@ export function runAppScriptsServe(testOrDemoName: string, appEntryPoint: string
}
return new Promise((resolve, reject) => {
const args = ['./node_modules/.bin/ionic-app-scripts'].concat(scriptArgs);
console.log(`node ${args.join(' ')}`);
const spawnedCommand = spawn('node', args, {stdio: 'inherit'});
let pathToAppScripts = join(NODE_MODULES_ROOT, '.bin', 'ionic-app-scripts');
pathToAppScripts = process.platform === 'win32' ? pathToAppScripts + '.cmd' : pathToAppScripts;
const spawnedCommand = spawn(pathToAppScripts, scriptArgs, {stdio: 'inherit'});
console.log(`${pathToAppScripts} ${scriptArgs.join(' ')}`);
spawnedCommand.on('close', (code: number) => {
if (code === 0) {