| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent cb5d505 commit ad40b3b
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,15 +4,15 @@ var path = require('path'); | |||
| 4 | 4 | module.exports = { | |
| 5 | 5 | copyAssets: { | |
| 6 | 6 | src: [path.join(path.dirname(process.env.IONIC_APP_ENTRY_POINT), '..', 'assets', '**', '*')], | |
| 7 | - dest: '{{WWW}}/assets' | ||
| 7 | + dest: path.join('{{WWW}}', 'assets') | ||
| 8 | 8 | }, | |
| 9 | 9 | copyIndexContent: { | |
| 10 | 10 | src: [path.join(process.cwd(), 'scripts', 'demos', 'index.html')], | |
| 11 | 11 | dest: '{{WWW}}' | |
| 12 | 12 | }, | |
| 13 | 13 | copyFonts: { | |
| 14 | 14 | src: [`${process.cwd()}/node_modules/ionicons/dist/fonts/**/*`, `${process.cwd()}/src/fonts/**/*`], | |
| 15 | - dest: '{{WWW}}/assets/fonts' | ||
| 15 | + dest: path.join('{{WWW}}', 'assets', 'fonts') | ||
| 16 | 16 | }, | |
| 17 | 17 | copyPolyfills: { | |
| 18 | 18 | src: [path.join(process.cwd(), 'dist', 'demos', 'polyfills', 'polyfills.js')], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | var path = require('path'); | |
| 2 | 2 | ||
| 3 | - var watch = require('../../node_modules/@ionic/app-scripts/dist/watch'); | ||
| 3 | + var watch = require(path.join('..', '..', 'node_modules', '@ionic', 'app-scripts', 'dist', 'watch')); | ||
| 4 | 4 | ||
| 5 | 5 | var entryPointDirectory = path.dirname(process.env.IONIC_APP_ENTRY_POINT) | |
| 6 | 6 | ||
@@ -9,7 +9,7 @@ module.exports = { | |||
| 9 | 9 | paths: [path.join(entryPointDirectory, '..', '**', '*.(ts|html|s(c|a)ss)')], | |
| 10 | 10 | options: { ignored: [path.join(entryPointDirectory, '..', '**', '*.spec.ts'), | |
| 11 | 11 | path.join(entryPointDirectory, '..', '**', '*.e2e.ts'), | |
| 12 | - '**/*.DS_Store'] }, | ||
| 12 | + path.join('**', '*.DS_Store')] }, | ||
| 13 | 13 | callback: watch.buildUpdate | |
| 14 | 14 | } | |
| 15 | 15 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,15 +4,15 @@ var path = require('path'); | |||
| 4 | 4 | module.exports = { | |
| 5 | 5 | copyAssets: { | |
| 6 | 6 | src: [path.join(path.dirname(process.env.IONIC_APP_ENTRY_POINT), '..', 'assets', '**', '*')], | |
| 7 | - dest: '{{WWW}}/assets' | ||
| 7 | + dest: path.join('{{WWW}}', 'assets') | ||
| 8 | 8 | }, | |
| 9 | 9 | copyIndexContent: { | |
| 10 | 10 | src: [path.join(process.cwd(), 'scripts', 'e2e', 'index.html')], | |
| 11 | 11 | dest: '{{WWW}}' | |
| 12 | 12 | }, | |
| 13 | 13 | copyFonts: { | |
| 14 | - src: [`${process.cwd()}/node_modules/ionicons/dist/fonts/**/*`, `${process.cwd()}/src/fonts/**/*`], | ||
| 15 | - dest: '{{WWW}}/assets/fonts' | ||
| 14 | + src: [path.join(process.cwd(), 'node_modules', 'ionicons', 'dist', 'fonts', '**', '*'), path.join(process.cwd(), 'src', 'fonts', '**', '*')], | ||
| 15 | + dest: path.join('{{WWW}}', 'assets', 'fonts') | ||
| 16 | 16 | }, | |
| 17 | 17 | copyPolyfills: { | |
| 18 | 18 | src: [path.join(process.cwd(), 'dist', 'e2e', 'polyfills', 'polyfills.ng.js')], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ module.exports = function(options) { | |||
| 4 | 4 | var fs = require('fs'); | |
| 5 | 5 | var path = require('path'); | |
| 6 | 6 | var request = require('request'); | |
| 7 | - var inputDir = path.join(__dirname, '../../dist/e2e/tests'); | ||
| 7 | + var inputDir = path.join(__dirname, '..', '..' , 'dist', 'e2e', 'tests'); | ||
| 8 | 8 | var uploadQueue = []; | |
| 9 | 9 | ||
| 10 | 10 | var ignoreFiles = /(\/test\/|\/ts\/|\/q\/|\/ionic-site\/|\/docs\/|\/examples\/|\/inquirer\/|\/lodash\/|\/tooling\/|\/colors\/|\/bin\/|\.ts$|\.bin|\.map$|\.md$|\.git|\.scss$|\.yml$|\.yaml$|\.dart$|\.txt|\.npm|bower|DS_Store|LICENSE)/i; | |
@@ -13,15 +13,15 @@ module.exports = function(options) { | |||
| 13 | 13 | fs.readdir(dir, function(err, list) { | |
| 14 | 14 | ||
| 15 | 15 | list.forEach(function(file) { | |
| 16 | - var url = urlPath + '/' + file; | ||
| 16 | + var url = path.join(urlPath, file); | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | - fs.stat(dir + '/' + file, function(err, stat) { | ||
| 19 | + fs.stat(path.join(dir, file), function(err, stat) { | ||
| 20 | 20 | if (stat && stat.isDirectory()) { | |
| 21 | - uploadFiles(dir + '/' + file, urlPath + '/' + file); | ||
| 21 | + uploadFiles(path.join(dir, file), path.join(urlPath, file); | ||
| 22 | 22 | } else { | |
| 23 | 23 | if ( shouldProcessPath (url) ){ | |
| 24 | - uploadFile(url, dir + '/' + file); | ||
| 24 | + uploadFile(url, path.join(dir, file)); | ||
| 25 | 25 | } | |
| 26 | 26 | } | |
| 27 | 27 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ export const BUNDLES = 'bundles'; | |||
| 20 | 20 | export const SITE_NAME = 'ionic-site'; | |
| 21 | 21 | ||
| 22 | 22 | // File Paths | |
| 23 | - export const PROJECT_ROOT = join(__dirname, '../..'); | ||
| 23 | + export const PROJECT_ROOT = join(__dirname, '..', '..'); | ||
| 24 | 24 | export const DEMOS_ROOT = join(PROJECT_ROOT, DEMOS_NAME); | |
| 25 | 25 | export const DEMOS_SRC_ROOT = join(DEMOS_ROOT, SRC_NAME); | |
| 26 | 26 | export const DIST_ROOT = join(PROJECT_ROOT, DIST_NAME); | |
@@ -45,7 +45,7 @@ export const WORKERS_SRC = join(SCRIPTS_ROOT, 'workers'); | |||
| 45 | 45 | ||
| 46 | 46 | // NPM | |
| 47 | 47 | export const NPM_VENDOR_FILES = [ | |
| 48 | - '@angular', 'core-js/client', 'rxjs', 'systemjs/dist', 'zone.js/dist' | ||
| 48 | + '@angular', join('core-js', 'client'), 'rxjs', join('systemjs', 'dist'), join('zone.js', 'dist') | ||
| 49 | 49 | ]; | |
| 50 | 50 | ||
| 51 | 51 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | import { task } from 'gulp'; | |
| 2 | + import { join } from 'path'; | ||
| 2 | 3 | import { DIST_BUILD_ROOT, DIST_BUILD_ES2015_ROOT, DIST_BUILD_UMD_ROOT, ES5, ES_2015, PROJECT_ROOT, UMD_MODULE } from '../constants'; | |
| 3 | 4 | import { copySourceToDest, createTempTsConfig, deleteFiles, runNgc, runTsc } from '../util'; | |
| 4 | 5 | ||
@@ -7,8 +8,8 @@ export function buildIonicAngularUmd(excludeSpec: boolean, stripDebug: boolean, | |||
| 7 | 8 | const stream = copySourceToDest(DIST_BUILD_UMD_ROOT, excludeSpec, true, stripDebug); | |
| 8 | 9 | stream.on('end', () => { | |
| 9 | 10 | // the source files are copied, copy over a tsconfig from | |
| 10 | - createTempTsConfig(['./**/*.ts'], ES5, UMD_MODULE, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_UMD_ROOT}/tsconfig.json`); | ||
| 11 | - runNgc(`${DIST_BUILD_UMD_ROOT}/tsconfig.json`, (err) => { | ||
| 11 | + createTempTsConfig([join('.', '**', '*.ts')], ES5, UMD_MODULE, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_UMD_ROOT, 'tsconfig.json')); | ||
| 12 | + runNgc(join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'), (err) => { | ||
| 12 | 13 | if (err) { | |
| 13 | 14 | done(err); | |
| 14 | 15 | return; | |
@@ -27,8 +28,8 @@ export function buildIonicAngularUmdTsc(excludeSpec: boolean, stripDebug: boolea | |||
| 27 | 28 | const stream = copySourceToDest(DIST_BUILD_UMD_ROOT, excludeSpec, true, stripDebug); | |
| 28 | 29 | stream.on('end', () => { | |
| 29 | 30 | // the source files are copied, copy over a tsconfig from | |
| 30 | - createTempTsConfig(['./**/*.ts'], ES5, UMD_MODULE, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_UMD_ROOT}/tsconfig.json`); | ||
| 31 | - runTsc(`${DIST_BUILD_UMD_ROOT}/tsconfig.json`, (err) => { | ||
| 31 | + createTempTsConfig([join('.', '**', '*.ts')], ES5, UMD_MODULE, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_UMD_ROOT, 'tsconfig.json')); | ||
| 32 | + runTsc(join(DIST_BUILD_UMD_ROOT, 'tsconfig.json'), (err) => { | ||
| 32 | 33 | if (err) { | |
| 33 | 34 | done(err); | |
| 34 | 35 | return; | |
@@ -48,8 +49,8 @@ export function buildIonicAngularEsm(stripDebug: boolean, done: Function) { | |||
| 48 | 49 | const stream = copySourceToDest(DIST_BUILD_ROOT, true, true, stripDebug); | |
| 49 | 50 | stream.on('end', () => { | |
| 50 | 51 | // the source files are copied, copy over a tsconfig from | |
| 51 | - createTempTsConfig(['./**/*.ts'], ES5, ES_2015, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_ROOT}/tsconfig.json`); | ||
| 52 | - runNgc(`${DIST_BUILD_ROOT}/tsconfig.json`, (err) => { | ||
| 52 | + createTempTsConfig([join('.', '**', '*.ts')], ES5, ES_2015, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_ROOT, 'tsconfig.json')); | ||
| 53 | + runNgc(join(DIST_BUILD_ROOT, 'tsconfig.json'), (err) => { | ||
| 53 | 54 | if (err) { | |
| 54 | 55 | done(err); | |
| 55 | 56 | return; | |
@@ -67,8 +68,8 @@ export function buildIonicPureEs6(stripDebug: boolean, done: Function) { | |||
| 67 | 68 | const stream = copySourceToDest(DIST_BUILD_ES2015_ROOT, true, true, stripDebug); | |
| 68 | 69 | stream.on('end', () => { | |
| 69 | 70 | // the source files are copied, copy over a tsconfig from | |
| 70 | - createTempTsConfig(['./**/*.ts'], ES_2015, ES_2015, `${PROJECT_ROOT}/tsconfig.json`, `${DIST_BUILD_ES2015_ROOT}/tsconfig.json`); | ||
| 71 | - runNgc(`${DIST_BUILD_ES2015_ROOT}/tsconfig.json`, (err) => { | ||
| 71 | + createTempTsConfig([join('.', '**', '*.ts')], ES_2015, ES_2015, join(PROJECT_ROOT, 'tsconfig.json'), join(DIST_BUILD_ES2015_ROOT, 'tsconfig.json')); | ||
| 72 | + runNgc(join(DIST_BUILD_ES2015_ROOT, 'tsconfig.json'), (err) => { | ||
| 72 | 73 | if (err) { | |
| 73 | 74 | done(err); | |
| 74 | 75 | return; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,5 +47,5 @@ function serveTest(folderInfo: any) { | |||
| 47 | 47 | const appNgModulePath = join(dirname(appEntryPoint), 'app.module.ts'); | |
| 48 | 48 | const distDir = join(distTestRoot, 'www'); | |
| 49 | 49 | ||
| 50 | - return runAppScriptsServe(folderInfo.componentName + '/' + folderInfo.componentTest, appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, null); | ||
| 50 | + return runAppScriptsServe(join(folderInfo.componentName, folderInfo.componentTest), appEntryPoint, appNgModulePath, ionicAngularDir, distDir, pathToWriteFile, ionicAngularDir, sassConfigPath, copyConfigPath, null); | ||
| 51 | 51 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ task('e2e.prepare', (done: Function) => { | |||
| 21 | 21 | ||
| 22 | 22 | task('e2e.prepareSass', (done: Function) => { | |
| 23 | 23 | const version = `E2E-${createTimestamp()}`; | |
| 24 | - writeFileSync(join(SRC_ROOT, 'themes/version.scss'), `$ionic-version: "${version}";`); | ||
| 24 | + writeFileSync(join(SRC_ROOT, 'themes', 'version.scss'), `$ionic-version: "${version}";`); | ||
| 25 | 25 | done(); | |
| 26 | 26 | }); | |
| 27 | 27 | ||
@@ -41,7 +41,7 @@ task('e2e.prod', ['e2e.prepare'], (done: Function) => { | |||
| 41 | 41 | }); | |
| 42 | 42 | ||
| 43 | 43 | function e2eComponentExists(folderInfo: any): boolean { | |
| 44 | - let componentPath = `${SRC_COMPONENTS_ROOT}/${folderInfo.componentName}/test/${folderInfo.componentTest}/app`; | ||
| 44 | + let componentPath = join(SRC_COMPONENTS_ROOT, folderInfo.componentName, 'test', folderInfo.componentTest, 'app'); | ||
| 45 | 45 | ||
| 46 | 46 | try { | |
| 47 | 47 | accessSync(componentPath); | |
@@ -62,11 +62,11 @@ function filterE2eTestfiles() { | |||
| 62 | 62 | const folderInfo = getFolderInfo(); | |
| 63 | 63 | if (folderInfo && folderInfo.componentName && folderInfo.componentTest) { | |
| 64 | 64 | if (!e2eComponentExists(folderInfo)) { | |
| 65 | - 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.`); | ||
| 65 | + 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.'); | ||
| 66 | 66 | return []; | |
| 67 | 67 | } | |
| 68 | 68 | const filtered = entryPoints.filter(entryPoint => { | |
| 69 | - return entryPoint.indexOf(`${folderInfo.componentName}/test/${folderInfo.componentTest}`) >= 0; | ||
| 69 | + return entryPoint.indexOf(join(folderInfo.componentName, 'test', folderInfo.componentTest)) >= 0; | ||
| 70 | 70 | }); | |
| 71 | 71 | return filtered; | |
| 72 | 72 | } | |
@@ -121,7 +121,7 @@ function buildTest(filePath: string) { | |||
| 121 | 121 | const relativePathFromComponents = relative(dirname(SRC_COMPONENTS_ROOT), srcTestRoot); | |
| 122 | 122 | const distTestRoot = join(process.cwd(), 'dist', 'e2e', relativePathFromComponents); | |
| 123 | 123 | ||
| 124 | - const includeGlob = [ join(ionicAngularDir, '**', '*.ts')]; | ||
| 124 | + const includeGlob = [join(ionicAngularDir, '**', '*.ts')]; | ||
| 125 | 125 | const pathToWriteFile = join(distTestRoot, 'tsconfig.json'); | |
| 126 | 126 | const pathToReadFile = join(PROJECT_ROOT, 'tsconfig.json'); | |
| 127 | 127 | ||
@@ -154,7 +154,7 @@ function copyProtractorTestContent(filePaths: string[]): Promise<any> { | |||
| 154 | 154 | } | |
| 155 | 155 | ||
| 156 | 156 | function applyTemplate(filePathContent: Map<string, string>) { | |
| 157 | - const buildConfig = require('../../build/config'); | ||
| 157 | + const buildConfig = require(join('..', '..', 'build', 'config')); | ||
| 158 | 158 | const templateFileContent = readFileSync(join(SCRIPTS_ROOT, 'e2e', 'e2e.template.js')); | |
| 159 | 159 | const templater = template(templateFileContent.toString()); | |
| 160 | 160 | const modifiedMap = new Map<string, string>(); | |
@@ -235,7 +235,7 @@ task('e2e.polyfill', (done: Function) => { | |||
| 235 | 235 | return done(); | |
| 236 | 236 | } | |
| 237 | 237 | ||
| 238 | - writePolyfills('dist/e2e/polyfills').then(() => { | ||
| 238 | + writePolyfills(join('dist', 'e2e', 'polyfills')).then(() => { | ||
| 239 | 239 | done(); | |
| 240 | 240 | }).catch(err => { | |
| 241 | 241 | done(err); | |
@@ -249,9 +249,8 @@ task('e2e.openProd', (done: Function) => { | |||
| 249 | 249 | task('e2e.open', (done: Function) => { | |
| 250 | 250 | const folderInfo = getFolderInfo(); | |
| 251 | 251 | if (folderInfo && folderInfo.componentName && folderInfo.componentTest) { | |
| 252 | - const filePath = `${folderInfo.componentName}/test/${folderInfo.componentTest}/www/index.html`; | ||
| 253 | - const fullPath = join(DIST_E2E_COMPONENTS_ROOT, filePath); | ||
| 254 | - const spawnedCommand = spawn('open', [fullPath]); | ||
| 252 | + const filePath = join(DIST_E2E_COMPONENTS_ROOT, folderInfo.componentName, 'test', folderInfo.componentTest, 'www', 'index.html'); | ||
| 253 | + const spawnedCommand = spawn('open', [filePath]); | ||
| 255 | 254 | ||
| 256 | 255 | spawnedCommand.on('close', (code: number) => { | |
| 257 | 256 | done(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,10 @@ | |||
| 1 | 1 | import { task } from 'gulp'; | |
| 2 | 2 | import { writePolyfills } from '../util'; | |
| 3 | + import { join } from 'path'; | ||
| 3 | 4 | ||
| 4 | 5 | ||
| 5 | 6 | task('src.polyfill', (done: Function) => { | |
| 6 | - writePolyfills('scripts/polyfill').then(() => { | ||
| 7 | + writePolyfills(join('scripts', 'polyfills')).then(() => { | ||
| 7 | 8 | done(); | |
| 8 | 9 | }).catch(err => { | |
| 9 | 10 | done(err); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,17 +1,18 @@ | |||
| 1 | 1 | import { task, src, dest } from 'gulp'; | |
| 2 | 2 | import { writePolyfills } from '../util'; | |
| 3 | + import { join } from 'path'; | ||
| 3 | 4 | ||
| 4 | 5 | task('polyfill', ['polyfill.copy-readme', 'polyfill.write']); | |
| 5 | 6 | ||
| 6 | 7 | task('polyfill.write', (done: Function) => { | |
| 7 | - writePolyfills('dist/ionic-angular/polyfills').then(() => { | ||
| 8 | + writePolyfills(join('dist', 'ionic-angular', 'polyfills')).then(() => { | ||
| 8 | 9 | done(); | |
| 9 | 10 | }).catch(err => { | |
| 10 | 11 | done(err); | |
| 11 | 12 | }); | |
| 12 | 13 | }); | |
| 13 | 14 | ||
| 14 | 15 | task('polyfill.copy-readme', (done: Function) => { | |
| 15 | - return src('scripts/polyfill/readme.md') | ||
| 16 | - .pipe(dest('dist/ionic-angular/polyfills/'), done); | ||
| 16 | + return src(join('scripts', 'polyfill', 'readme.md')) | ||
| 17 | + .pipe(dest(join('dist', 'ionic-angular', 'polyfills')), done); | ||
| 17 | 18 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments