Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into RDM-1893-FixedRadioList
* master: (69 commits) RDM-3230 Release new 2.4.0 version - Up version of angular to fix Router bug angular/angular#26496 (#137) RDM-3230 Remove debug console logging and comments. RDM-3230 Up version of angular to fix Router bug angular/angular#26496 RDM-3230 Relax versions in engines. RDM-3230 Relax engines for yarn and npm. RDM-3230 Update README. RDM-3230 Heroku Badge. RDM-3230 Push different heroku badge icon. RDM-3230 Release 2.2.0 RDM-3230 Add badge. Improve shell script. RDM-3230 Update README RDM-3230 Simplify heroku script and update README. RDM-3230 Fix Heroku and improve build steps in package.json. RDM-3230 Replace copyfiles with cp RDM-3230 Swap build of lib with install of demo app. RDM-3230 Create dir for heroku before copying dist. RDM-3230 Fix heroku - use heroku-postbuild instead of postinstall RDM-3230 Downgrade yarn in travis CI. RDM-3230 Downgrade yarn. RDM-3230 Obfuscate gateway api urls. ... # Conflicts: # src/shared/components/palette/palette.module.ts
- Loading branch information
Showing
422 changed files
with
16,257 additions
and
1,543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,8 @@ tmp/* | |
.history/ | ||
|
||
# docs | ||
docs/ | ||
docs/ | ||
|
||
# demo | ||
demo/dist/ | ||
demo/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# `ccd-case-ui-toolkit` demo project | ||
[![Heroku CI Status](https://heroku-badge.herokuapp.com/?app=heroku-badge&style=flat)](https://ccd-case-ui-toolkit-demo.herokuapp.com/) | ||
|
||
> This folder contains a demo-project for [ccd-case-ui-toolkit](https://github.com/hmcts/ccd-case-ui-toolkit). This demo project may help you to test whether your library supports JIT build or not. | ||
> | ||
> - `src` folder contains Angular project that is built using [@angular/cli](https://www.npmjs.com/package/@angular/cli). This demo project utilizes ESM (pure ES2015) sources of your library to do [JIT](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html) (just-in-time) compilation. | ||
> | ||
Demo-project is created as an alternative to `npm link` command. You may simply delete this `demo` folder if you prefer to use [yarn link](https://yarnpkg.com/en/docs/cli/link) instead to check how your library is being built. | ||
|
||
# Quick Start | ||
|
||
```bash | ||
# Open first terminal and assuming that you are already in case-ui-toolkit folder | ||
|
||
# Install all dependencies | ||
yarn install | ||
|
||
# Start build of ccd-case-ui-toolkit in esm watch mode | ||
yarn build:esm:watch | ||
|
||
# Open second terminal and assuming that you are already in case-ui-toolkit/demo folder | ||
|
||
# Install all dependencies | ||
yarn install | ||
|
||
# Start watching library dist folder and do project build in watch mode. (notice it will reload twice as the gulp watch task registers two changes: copy inited and copy finished; also notice this spins up stubs api in the same process - see server.js) | ||
yarn start:watch | ||
|
||
# To verify the demo app is working go to http://localhost:8080 | ||
``` | ||
|
||
# Heroku | ||
|
||
```bash | ||
There is a `heroku-publish.sh` script in this folder that can be used as: | ||
|
||
./heroku-publish.sh | ||
|
||
# After that the app is accessible in heroku under: https://ccd-case-ui-toolkit-demo.herokuapp.com/ | ||
``` | ||
|
||
# File Structure | ||
|
||
``` | ||
ccd-case-ui-toolkit | ||
└─ demo * Folder with demo application (MAY BE DELETED if not required) | ||
├─ src * Demo project | ||
| ├─ app * Demo application sources. Adopt them with your library. | ||
| ├─ public * Demo application resources. Adopt them with your library. | ||
| ├─ style * Demo application styles. Adopt them with your library. | ||
| ├─ index.html * Main application template. | ||
| ├─ main.ts * Main entry. | ||
| ├─ polyfills.ts * Browser polyfills. | ||
| └─ tsconfig.app.json * Angular app configuration. | ||
| | ||
├─ stubs * Stubs routes and data for stub server | ||
├─ .gitignore * List of files that are ignored while publishing to git repository | ||
├─ angular.json * Typescript app configuration. | ||
├─ heroku-publish.sh * Heroku publish script. | ||
├─ server.js * Node js server wrapping angular app (needed for heroku) | ||
├─ gulpfile.js * Gulp helper scripts for building demos | ||
├─ package.json * NPM dependencies and helper scripts for building demos | ||
├─ tsconfig.json * Typescript base configuration. | ||
└─ yarn.lock * Yarn dependency versions lock for demo applications | ||
``` | ||
|
||
# Getting Started | ||
|
||
## Dependencies | ||
|
||
#### Node/NPM | ||
Install latest Node and NPM following the [instructions](https://nodejs.org/en/download/). Make sure you have Node version ≥ 7.0 and NPM ≥ 4. | ||
|
||
- `brew install node` for Mac. | ||
|
||
#### Yarn | ||
Install Yarn by following the [instructions](https://yarnpkg.com/en/docs/install). | ||
|
||
- `brew install yarn` for Mac. | ||
|
||
## Installing | ||
- Switch to `demo` folder in your console. | ||
- `yarn install` to install required dependencies. | ||
|
||
## Build project | ||
- `yarn build` for building Angular Demo app. | ||
|
||
## Start project in watch mode | ||
- `yarn start:watch` for starting version of demo project and start watching for library changes. | ||
|
||
This command may be used simultaneously in combination with [ccd-case-ui-toolkit](https://github.com/hmcts/ccd-case-ui-toolkit)'s `yarn build:watch`. As a result once you change library source code it will be automatically re-compiled and in turn your demo-project will be automatically re-built and you will be able to see that changes in your browser instantly. | ||
|
||
See [Development Workflow](https://github.com/hmcts/ccd-case-ui-toolkit#development-workflow) section of [ccd-case-ui-toolkit](hhttps://github.com/hmcts/ccd-case-ui-toolkit)'s README for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"demo-app": { | ||
"root": "", | ||
"sourceRoot": "src", | ||
"projectType": "application", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"outputPath": "dist/browser", | ||
"index": "src/index.html", | ||
"main": "src/main.ts", | ||
"tsConfig": "src/tsconfig.app.json", | ||
"polyfills": "src/polyfills.ts", | ||
"stylePreprocessorOptions": { | ||
"includePaths": [ | ||
"node_modules/govuk_frontend_toolkit/stylesheets", | ||
"node_modules/govuk-elements-sass/public/sass" | ||
] | ||
}, | ||
"assets": [ | ||
{ | ||
"glob": "**/*", | ||
"input": "src/public", | ||
"output": "/" | ||
} | ||
], | ||
"styles": [ | ||
"src/style/app.scss", | ||
"node_modules/govuk_template_mustache/assets/stylesheets/govuk-template.css" | ||
], | ||
"scripts": [] | ||
} | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"options": { | ||
"browserTarget": "demo-app:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "demo-app:build:production" | ||
} | ||
} | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "demo-app:build" | ||
} | ||
}, | ||
"lint": { | ||
"builder": "@angular-devkit/build-angular:tslint", | ||
"options": { | ||
"tsConfig": [ | ||
"src/tsconfig.app.json" | ||
], | ||
"exclude": [ | ||
"**/node_modules/**" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"cli": {}, | ||
"schematics": { | ||
"@schematics/angular:component": { | ||
"prefix": "app", | ||
"styleext": "scss" | ||
}, | ||
"@schematics/angular:directive": { | ||
"prefix": "app" | ||
}, | ||
"@schematics/angular:guard": { | ||
"spec": false | ||
}, | ||
"@schematics/angular:module": { | ||
"spec": false | ||
}, | ||
"@schematics/angular:pipe": { | ||
"spec": false | ||
}, | ||
"@schematics/angular:service": { | ||
"spec": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const gulp = require('gulp'); | ||
const copyfiles = require('copyfiles'); | ||
|
||
const LIBRARY_SRC = '../dist/**/*'; | ||
const LIBRARY_DIST = 'node_modules/@hmcts/ccd-case-ui-toolkit/dist'; | ||
|
||
gulp.task('copy-lib', (callback) => { | ||
copyfiles([ LIBRARY_SRC, LIBRARY_DIST ], 2, callback); | ||
}); | ||
|
||
gulp.task('copy-lib:watch', () => { | ||
gulp.watch(LIBRARY_SRC, ['copy-lib']); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
CURRENT_BRANCH_NAME=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | ||
heroku create --remote ccd-case-ui-toolkit-demo --stack heroku-16 ccd-case-ui-toolkit-demo | ||
heroku config:set USERNAME=pirate --app ccd-case-ui-toolkit-demo | ||
heroku config:set PASSWORD=bunting --app ccd-case-ui-toolkit-demo | ||
heroku config:set YARN_PRODUCTION=false --app ccd-case-ui-toolkit-demo | ||
git push heroku $CURRENT_BRANCH_NAME:master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "angular-library-seed-demo", | ||
"description": "AOT/JIT/UMD build demo of angular library seed", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "ng build", | ||
"prebuild": "gulp copy-lib", | ||
"start": "node server.js", | ||
"start:watch": "concurrently --raw \"gulp copy-lib:watch\" \"npm run start\"" | ||
}, | ||
"dependencies": { | ||
"@angular/cli": "^7.0.3", | ||
"@angular/common": "^7.0.3", | ||
"@angular/core": "^7.0.3", | ||
"@angular-devkit/build-angular": "0.10.5", | ||
"@angular/animations": "~7.0.3", | ||
"@angular/cdk": "^7.0.3", | ||
"@angular/compiler": "7.0.3", | ||
"@angular/compiler-cli": "7.0.3", | ||
"@angular/forms": "~7.0.3", | ||
"@angular/http": "~7.0.3", | ||
"@angular/material": "^7.0.3", | ||
"@angular/router": "~7.0.3", | ||
"@angular/upgrade": "~7.0.3", | ||
"@angular/platform-browser": "^7.0.3", | ||
"@angular/platform-browser-dynamic": "^7.0.3", | ||
"@hmcts/ccd-case-ui-toolkit": "2.3.0", | ||
"@hmcts/ccpay-web-component": "1.6.2", | ||
"@nicky-lenaers/ngx-scroll-to": "^1.0.0", | ||
"copyfiles": "^2.1.0", | ||
"enhanced-resolve": "3.3.0", | ||
"express": "^4.16.4", | ||
"govuk-elements-sass": "3.1.2", | ||
"govuk_frontend_toolkit": "8.0.0", | ||
"govuk_template_mustache": "0.23.0", | ||
"ngx-md": "~6.0.0", | ||
"node-sass": "4.9.3", | ||
"angular2-router-loader": "^0.3.4", | ||
"angular2-template-loader": "^0.6.0", | ||
"awesome-typescript-loader": "^5.2.1", | ||
"concurrently": "^4.0.1", | ||
"core-js": "^2.4.1", | ||
"css-loader": "^1.0.0", | ||
"extract-text-webpack-plugin": "next", | ||
"file-loader": "^2.0.0", | ||
"gulp": "^3.9.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"json-loader": "^0.5.7", | ||
"json-server": "^0.12.1", | ||
"ncp": "2.0.0", | ||
"postcss": "7.0.5", | ||
"raw-loader": "^0.5.1", | ||
"rimraf": "^2.6.2", | ||
"rxjs": "^6.2.1", | ||
"sass-loader": "^7.1.0", | ||
"style-loader": "^0.23.1", | ||
"typescript": "3.1.6", | ||
"url-loader": "1.1.2", | ||
"webpack": "^4.20.2", | ||
"webpack-dev-server": "^3.1.10", | ||
"zone.js": "^0.8.26" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//Install express server | ||
const express = require('express'); | ||
const path = require('path'); | ||
let jsonServer = require('json-server'); | ||
let router = jsonServer.router('stubs/api.json'); | ||
const app = express(); | ||
|
||
// Serve only the static files form the dist directory | ||
app.use(express.static(__dirname + '/dist/browser')); | ||
app.use(function (req, res) { | ||
let response = null; | ||
let db = router.db // lowdb instance | ||
if (req.method === 'POST') { | ||
res.setHeader('Content-Type', 'application/json;charset=UTF-8') | ||
if (req.url.indexOf('events') !== -1) { | ||
response = db.get('submitted_event').value(); | ||
} else { | ||
response = db.get('submitted_case').value(); | ||
} | ||
} else { | ||
if (req.url.indexOf('event-triggers/createCase') !== -1) { | ||
response = db.get('create-case-event-trigger').value(); | ||
} else if (req.url.indexOf('validate') !== -1) { | ||
response = db.get('validate').value(); | ||
} else if (req.url.indexOf('profile') !== -1) { | ||
response = db.get('profile').value(); | ||
} else if (req.url.indexOf('internal/cases/1111222233334444') !== -1) { | ||
response = db.get('case').value(); | ||
} else if (req.url.indexOf('event-triggers/enterCaseIntoLegacy') !== -1) { | ||
response = db.get('event-trigger').value(); | ||
} | ||
} | ||
if (response) { | ||
res.jsonp(response); | ||
} else { | ||
res.sendFile(path.join(__dirname+'/dist/browser/index.html')); | ||
} | ||
}); | ||
|
||
// Start the app by listening on the default Heroku port | ||
app.listen(process.env.PORT || 8080); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from '@angular/core'; | ||
import '../style/app.scss'; | ||
|
||
@Component({ | ||
selector: 'my-app', | ||
templateUrl: './app.component.html' | ||
}) | ||
export class AppComponent { | ||
} |
Oops, something went wrong.