Skip to content

Commit 0d32e5e

Browse files
committed
chore(gulp): updates to build process to use app-scripts for watch/build
updates to build process to use app-scripts for watch/build
1 parent 0fdff89 commit 0d32e5e

30 files changed

Lines changed: 759 additions & 1019 deletions

scripts/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,18 @@ Run `gulp build` or `gulp watch` to watch for changes.
2828

2929
#### Development
3030

31-
1. Run `gulp e2e` or `gulp e2e.watch` to watch for changes.
32-
2. Navigate to `http://localhost:8000/dist/e2e`
31+
1. Run `gulp e2e.watch --folder nav/basic` to watch for changes, where `nav` is the component, and `basic` is the test name
32+
2. The browser will launch just like when using `ionic serve`. Make changes to an app in the `src` directory and the app will rebuild.
3333

3434
#### Validation
3535

3636
The following commands take longer to run because they use AoT compilation. They should really only be used to validate that our components work with AoT, and fix them if not.
3737

38-
1. Run `gulp e2e.prod` to bundle all e2e tests. Folder is optional, see the flags section below.
39-
2. Run `gulp e2e.watchProd` with a folder passed to watch a test. Folder is required, see the flags section below.
40-
3. Navigate to `http://localhost:8000/dist/e2e`
38+
1. Run `gulp e2e.prod` to bundle all e2e tests.
4139

4240
##### Flags
4341

44-
- `--f | -folder` will run the command with a test folder. For example, `gulp e2e.watchProd --f=select/single-value` will watch the test in `src/components/select/test/single-value`.
42+
- `--f | -folder` will run the command with a test folder.
4543
- `--debug` will run the `ionic-app-scripts` command with debug output printed.
4644

4745

@@ -98,8 +96,6 @@ To remove the linked version of `ionic-angular` do `npm rm ionic-angular`, and t
9896

9997
- `gulp snapshot` will run the `gulp e2e.prod` task with AoT compilation.
10098
- `gulp snapshot.skipBuild` will skip the `gulp e2e.prod` task with AoT compilation.
101-
- `gulp snapshot.dev` will run a development build using the `gulp e2e` task.
102-
- `gulp snapshot.quick` will skip the build and run snapshot without uploading to the server.
10399

104100
#### Flags
105101

scripts/demos/copy.config.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
// we don't want to run copy for the demos, so just override the config for now
2+
var path = require('path');
3+
24
module.exports = {
3-
copyAssets: { },
4-
copyIndexContent: { },
5-
copyFonts: { },
6-
copyPolyfills: { }
5+
copyAssets: {
6+
src: [path.join(path.dirname(process.env.IONIC_APP_ENTRY_POINT), '..', 'assets', '**', '*')],
7+
dest: '{{WWW}}/assets'
8+
},
9+
copyIndexContent: {
10+
src: [path.join(process.cwd(), 'scripts', 'demos', 'index.html')],
11+
dest: '{{WWW}}'
12+
},
13+
copyFonts: {
14+
src: [`${process.cwd()}/node_modules/ionicons/dist/fonts/**/*`, `${process.cwd()}/src/fonts/**/*`],
15+
dest: '{{WWW}}/assets/fonts'
16+
},
17+
copyPolyfills: {
18+
src: [path.join(process.cwd(), 'dist', 'demos', 'polyfills', 'polyfills.js')],
19+
dest: '{{BUILD}}'
20+
},
21+
sharedCss: {
22+
src: [path.join(process.cwd(), 'scripts', 'demos', 'demos.shared.css')],
23+
dest: `{{BUILD}}`
24+
}
725
}

scripts/demos/demos.template.dev.html

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<meta name="apple-mobile-web-app-capable" content="yes">
88

99
<link id="ionicLink" href="./build/main.css" rel="stylesheet">
10-
<link href="../css/demos.shared.css" rel="stylesheet">
10+
<link href="./build/e2e.shared.css" rel="stylesheet">
1111
</head>
1212
<body>
1313

1414
<ion-app></ion-app>
1515

16-
<script src="../polyfills/polyfills.js"></script>
16+
<script src="./build/polyfills.js"></script>
1717
<script src="./build/main.js"></script>
1818
</body>
1919
</html>

scripts/demos/main.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/demos/watch.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var path = require('path');
2+
3+
var watch = require('../../node_modules/@ionic/app-scripts/dist/watch');
4+
5+
var entryPointDirectory = path.dirname(process.env.IONIC_APP_ENTRY_POINT)
6+
7+
module.exports = {
8+
demoSrc: {
9+
paths: [path.join(entryPointDirectory, '..', '**', '*.(ts|html|s(c|a)ss)')],
10+
options: { ignored: [path.join(entryPointDirectory, '..', '**', '*.spec.ts'),
11+
path.join(entryPointDirectory, '..', '**', '*.e2e.ts'),
12+
'**/*.DS_Store'] },
13+
callback: watch.buildUpdate
14+
}
15+
}

scripts/e2e/copy.config.js

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
// we don't want to run copy for the demos, so just override the config for now
2+
var path = require('path');
3+
24
module.exports = {
3-
copyAssets: { },
4-
copyIndexContent: { },
5-
copyFonts: { },
6-
copyPolyfills: { }
7-
}
5+
copyAssets: {
6+
src: [path.join(path.dirname(process.env.IONIC_APP_ENTRY_POINT), '..', 'assets', '**', '*')],
7+
dest: '{{WWW}}/assets'
8+
},
9+
copyIndexContent: {
10+
src: [path.join(process.cwd(), 'scripts', 'e2e', 'index.html')],
11+
dest: '{{WWW}}'
12+
},
13+
copyFonts: {
14+
src: [`${process.cwd()}/node_modules/ionicons/dist/fonts/**/*`, `${process.cwd()}/src/fonts/**/*`],
15+
dest: '{{WWW}}/assets/fonts'
16+
},
17+
copyPolyfills: {
18+
src: [path.join(process.cwd(), 'dist', 'e2e', 'polyfills', 'polyfills.ng.js')],
19+
dest: '{{BUILD}}'
20+
},
21+
sharedCss: {
22+
src: [path.join(process.cwd(), 'scripts', 'e2e', 'e2e.shared.css')],
23+
dest: `{{BUILD}}`
24+
}
25+
}

scripts/e2e/e2e.template.dev.html

Lines changed: 0 additions & 83 deletions
This file was deleted.

scripts/e2e/e2e.template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('<%= relativePath %>: <%= platform %>', function() {
1+
describe('<%= relativePathBackwardsCompatibility %>: <%= platform %>', function() {
22

33
it('should init', function() {
44
browser.get('http://localhost:<%= buildConfig.protractorPort %>/dist/e2e/<%= relativePath %>/index.html?ionicplatform=<%= platform %>&ionicOverlayCreatedDiff=0&ionicanimate=false&snapshot=true');
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<meta name="apple-mobile-web-app-capable" content="yes">
88

99
<link id="ionicLink" href="./build/main.css" rel="stylesheet">
10-
<link href="../../../../css/e2e.shared.css" rel="stylesheet">
10+
<link href="build/e2e.shared.css" rel="stylesheet">
1111

1212
<script>
1313
if (location.href.indexOf('snapshot=true') > -1) {
@@ -43,7 +43,7 @@
4343
document.body.classList.remove('rtl');
4444
}
4545
</script>
46-
<script src="../../../../polyfills/polyfills.js"></script>
46+
<script src="./build/polyfills.ng.js"></script>
4747
<script src="./build/main.js"></script>
4848
</body>
4949
</html>

0 commit comments

Comments
 (0)