chore(): update angular build scripts

This commit is contained in:
Adam Bradley
2018-03-26 16:31:40 -05:00
parent dddaee1719
commit a1eabecc61
14 changed files with 4178 additions and 1268 deletions

View File

@@ -1,37 +0,0 @@
# Demo
The purpose of this application is to provide an Angular CLI application where Ionic Core components can be tested in a simple manner. This application allows the developer to experiment with interactions between Angular and Ionic in an easy and safe manner.
## Getting started
**Note:** This application now uses the last published `@ionic/core` package. To test against changes that you have made locally to core use `npm link` (see below).
To use _this_ application perform the following commands from this directory:
- `npm i`
- `npm start` - to serve the application
- `npm test` - to run the unit tests
- `npm run e2e` - to run the end to end tests
- `npx ts-node server/server.ts` - run the server required by any page that does a test post
See the `package.json` file for a complete list of scripts. The above are just the most common.
## Running the Angular CLI
This application installs the Angular CLI locally so you do not need to have it installed globally. You can use `npm` to run any of the `ng` commands. For example:
- `npm run ng build -- --prod` - run a production build
- `npm run ng g component my-cool-thing`
## Testing Local Changes
In order to test local changes they need to be copied into `node_modules` after the initial `npm i`
1. In `core`, run `npm run build`
1. In `demos/angular`, run `rm -rf node_modules/\@ionic/core/dist`
1. In `demos/angular`, run `cp -R ../../core/dist node_modules/\@ionic/core/dist`
Use a similar procedure if you want to test local changes to `@ionic/angular`
**Note:** A couple of short scripts have been created to handle the copy bits. Just run `./cpang.sh` or `./cpcore.sh` from
`demos/angular` after you have built `@ionic/angular` or `@ionic/core`.

View File

@@ -22,11 +22,7 @@ module.exports = function(config) {
angularCli: {
environment: 'dev'
},
files: [
// TODO: I have not fully worked out how this will work.
// Perhaps just the base include with a plugin?
{ pattern: '../node_modules/@ionic/core/dist/ionic.js', watched: false, served: false, nocache: true, included: true }
],
files: [],
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
{
"name": "@ionic/angular-demo",
"version": "0.0.0",
"name": "@ionic/angular-test-nav",
"private": true,
"version": "0.0.1",
"license": "MIT",
"scripts": {
"ng": "ng",
@@ -8,10 +9,8 @@
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"override-router": "rm -rf ./node_modules/@angular/router && mkdir ./node_modules/@angular/router && cp -R ./scripts/router ./node_modules/@angular"
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "latest",
"@angular/common": "latest",

View File

@@ -1,25 +0,0 @@
import * as bodyParser from 'body-parser';
import * as express from 'express';
const app = express();
app.set('port', process.env.PORT || 5000);
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use(function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
next();
});
app.post('/test', (req, res) => {
res.send(req.body);
});
app.listen(app.get('port'), () => {
console.log('Node app is running on port', app.get('port'));
});

View File

@@ -1,3 +1 @@
/* You can add global styles to this file, and also import other style files */
// @import '~@ionic/core/src/themes/ionic.build.default';

View File

@@ -8,12 +8,24 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
]
"dom",
"es2017"
],
"baseUrl": ".",
"paths": {
"@angular/animations": ["../../../node_modules/@angular/animations/"],
"@angular/common": ["../../../node_modules/@angular/common/"],
"@angular/compiler": ["../../../node_modules/@angular/compiler/"],
"@angular/core": ["../../../node_modules/@angular/core/"],
"@angular/forms": ["../../../node_modules/@angular/forms/"],
"@angular/http": ["../../../node_modules/@angular/http/"],
"@angular/language-service": ["../../../node_modules/@angular/language-service/"],
"@angular/platform-browser": ["../../../node_modules/@angular/platform-browser/"],
"@angular/platform-browser-dynamic": ["../../../node_modules/@angular/platform-browser-dynamic/"],
"@angular/router": ["../../../node_modules/@angular/router/"],
"rxjs": ["../../../node_modules/@angular/rxjs/"],
"@ionic/angular": ["../../../"]
}
}
}