mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge v4-alpha
This commit is contained in:
@@ -85,6 +85,8 @@ function buildDemo(filePath: string) {
|
||||
const relativePathFromComponents = relative(dirname(DEMOS_SRC_ROOT), componentDir);
|
||||
|
||||
const distTestRoot = join(process.cwd(), 'dist', 'demos', relativePathFromComponents);
|
||||
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'), join(componentDir, '**', '*.ts')];
|
||||
const pathToWriteFile = join(distTestRoot, 'tsconfig.json');
|
||||
@@ -100,14 +102,17 @@ function buildDemo(filePath: string) {
|
||||
const distDir = join(distTestRoot, 'www');
|
||||
|
||||
return runAppScriptsBuild(
|
||||
appEntryPoint,
|
||||
appNgModulePath,
|
||||
ionicAngularDir,
|
||||
distDir,
|
||||
pathToWriteFile,
|
||||
ionicAngularDir,
|
||||
sassConfigPath,
|
||||
copyConfigPath
|
||||
appEntryPoint,
|
||||
appNgModulePath,
|
||||
ionicAngularDir,
|
||||
coreCompilerFilePath,
|
||||
coreDir,
|
||||
distDir,
|
||||
pathToWriteFile,
|
||||
ionicAngularDir,
|
||||
sassConfigPath,
|
||||
copyConfigPath,
|
||||
argv.dev
|
||||
).then(() => {
|
||||
const end = Date.now();
|
||||
console.log(`${filePath} took a total of ${(end - start) / 1000} seconds to build`);
|
||||
@@ -144,7 +149,7 @@ function uploadToS3(path) {
|
||||
|
||||
let params = {
|
||||
localDir: path.replace('tsconfig.json',''),
|
||||
deleteRemoved: true,
|
||||
deleteRemoved: true,
|
||||
s3Params: {
|
||||
Bucket: "ionic-demos",
|
||||
Prefix: demo,
|
||||
@@ -153,7 +158,7 @@ function uploadToS3(path) {
|
||||
|
||||
var uploader = client.uploadDir(params);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploader.on('error', function(err) {
|
||||
console.error("s3 Upload Error:", err.stack);
|
||||
reject();
|
||||
@@ -186,7 +191,7 @@ task('demos.download', (done: Function) => {
|
||||
|
||||
let uploader = client.downloadDir(params);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
uploader.on('error', function(err) {
|
||||
console.error("s3 Download Error:", err.stack);
|
||||
reject();
|
||||
|
||||
@@ -120,6 +120,8 @@ function buildTest(filePath: string) {
|
||||
|
||||
const relativePathFromComponents = relative(dirname(SRC_COMPONENTS_ROOT), srcTestRoot);
|
||||
const distTestRoot = join(process.cwd(), 'dist', 'e2e', relativePathFromComponents);
|
||||
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 pathToWriteFile = join(distTestRoot, 'tsconfig.json');
|
||||
@@ -133,7 +135,7 @@ function buildTest(filePath: string) {
|
||||
const appNgModulePath = join(dirname(appEntryPoint), 'app.module.ts');
|
||||
const distDir = join(distTestRoot, 'www');
|
||||
|
||||
return runAppScriptsBuild(appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, argv.dev).then(() => {
|
||||
return runAppScriptsBuild(appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, coreCompilerFilePath, coreDir, sassConfigPath, copyConfigPath, argv.dev).then(() => {
|
||||
const end = Date.now();
|
||||
console.log(`${filePath} took a total of ${(end - start) / 1000} seconds to build`);
|
||||
}).catch((err) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { spawn } from 'child_process';
|
||||
import { NODE_MODULES_ROOT, SRC_ROOT } from './constants';
|
||||
import { NODE_MODULES_ROOT, SRC_ROOT, PROJECT_ROOT } from './constants';
|
||||
import { src, dest } from 'gulp';
|
||||
import { dirname, join } from 'path';
|
||||
import { ensureDirSync, readdirSync, readFile, readFileSync, statSync, writeFile, writeFileSync } from 'fs-extra';
|
||||
@@ -11,6 +11,7 @@ import * as nodeResolve from 'rollup-plugin-node-resolve';
|
||||
import * as through from 'through2';
|
||||
import * as uglifyPlugin from 'rollup-plugin-uglify';
|
||||
import { argv } from 'yargs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { runWorker } from './utils/app-scripts-worker-client';
|
||||
|
||||
@@ -55,6 +56,21 @@ export function createTempTsConfig(includeGlob: string[], target: string, module
|
||||
config.compilerOptions.target = target;
|
||||
}
|
||||
config.include = includeGlob;
|
||||
const componetsToExclude = [
|
||||
'badge',
|
||||
'card',
|
||||
'card-content',
|
||||
'card-header',
|
||||
'card-title',
|
||||
'slides',
|
||||
'toggle',
|
||||
'gesture'
|
||||
];
|
||||
|
||||
config.exclude = componetsToExclude.map(cmp => path.join(PROJECT_ROOT, `src/components/${cmp}`) + `/*.ts`)
|
||||
.concat([
|
||||
path.join(PROJECT_ROOT, 'src/components/index.ts'),
|
||||
]);
|
||||
|
||||
config.exclude = [
|
||||
'./components/badge/**/*'
|
||||
@@ -236,10 +252,10 @@ export function runAppScriptsServe(testOrDemoName: string, appEntryPoint: string
|
||||
});
|
||||
}
|
||||
|
||||
export function runAppScriptsBuild(appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean = false) {
|
||||
export function runAppScriptsBuild(appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, coreCompilerFilePath: string, coreDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean = false) {
|
||||
const pathToAppScripts = join(NODE_MODULES_ROOT, '.bin', 'ionic-app-scripts');
|
||||
const debug: boolean = argv.debug;
|
||||
return runWorker(pathToAppScripts, debug, appEntryPoint, appNgModulePath, srcDir, distDir, tsConfig, ionicAngularDir, sassConfigPath, copyConfigPath, isDev);
|
||||
return runWorker(pathToAppScripts, debug, appEntryPoint, appNgModulePath, srcDir, distDir, tsConfig, ionicAngularDir, coreCompilerFilePath, coreDir, sassConfigPath, copyConfigPath, isDev);
|
||||
}
|
||||
|
||||
/** Resolves the path for a node package executable. */
|
||||
|
||||
@@ -3,7 +3,7 @@ import { dirname, join } from 'path';
|
||||
|
||||
import { MessageToWorker, WorkerProcess } from './interfaces';
|
||||
|
||||
export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean) {
|
||||
export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoint: string, appNgModulePath: string, srcDir: string, distDir: string, tsConfig: string, ionicAngularDir: string, coreCompilerFilePath: string, coreDir: string, sassConfigPath: string, copyConfigPath: string, isDev: boolean) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
const msgToWorker: MessageToWorker = {
|
||||
@@ -15,6 +15,8 @@ export function runWorker(pathToAppScripts: string, debug: boolean, appEntryPoin
|
||||
distDir: distDir,
|
||||
tsConfig: tsConfig,
|
||||
ionicAngularDir: ionicAngularDir,
|
||||
coreCompilerFilePath: coreCompilerFilePath,
|
||||
coreDir: coreDir,
|
||||
sassConfigPath: sassConfigPath,
|
||||
copyConfigPath: copyConfigPath,
|
||||
isDev: isDev
|
||||
@@ -70,6 +72,8 @@ export function createWorker(msg: MessageToWorker): any {
|
||||
'--experimentalManualTreeshaking', 'false',
|
||||
'--experimentalPurgeDecorators', 'false',
|
||||
'--ionicAngularDir', msg.ionicAngularDir,
|
||||
'--coreCompilerFilePath', msg.coreCompilerFilePath,
|
||||
'--coreDir', msg.coreDir,
|
||||
'--sass', msg.sassConfigPath,
|
||||
'--copy', msg.copyConfigPath,
|
||||
'--enableLint', 'false',
|
||||
|
||||
@@ -13,6 +13,8 @@ export interface MessageToWorker {
|
||||
distDir: string;
|
||||
tsConfig: string;
|
||||
ionicAngularDir: string;
|
||||
coreCompilerFilePath: string;
|
||||
coreDir: string;
|
||||
sassConfigPath: string;
|
||||
copyConfigPath: string;
|
||||
isDev: boolean;
|
||||
|
||||
Reference in New Issue
Block a user