Skip to content

Commit 5348770

Browse files
committed
[feat] AOT/SSR testing suite
- Testing environment app with AOT/SSR - Linting - Angular CLI - CI Building
1 parent 5e881c7 commit 5348770

File tree

200 files changed

+3604
-2415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+3604
-2415
lines changed

.angular-cli.json

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "ng-intercom"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist/browser",
10+
"assets": [
11+
"assets",
12+
"views"
13+
],
14+
"index": "views/index.ng.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "app",
21+
"serviceWorker": true,
22+
"styles": [
23+
"scss/default-theme.scss",
24+
"scss/styles.scss"
25+
],
26+
"scripts": [
27+
"../node_modules/hammerjs/hammer.min.js"
28+
],
29+
"environmentSource": "environments/environment.ts",
30+
"environments": {
31+
"dev": "environments/environment.ts",
32+
"staging": "environments/environment.staging.ts",
33+
"testing": "environments/environment.testing.ts",
34+
"prod": "environments/environment.production.ts"
35+
}
36+
},
37+
{
38+
"root": "src",
39+
"outDir": "dist/server",
40+
"assets": [],
41+
"platform": "server",
42+
"main": "main.server.ts",
43+
"test": "test.ts",
44+
"tsconfig": "tsconfig.server.json",
45+
"testTsconfig": "tsconfig.spec.json",
46+
"prefix": "app",
47+
"styles": [
48+
"scss/default-theme.scss",
49+
"scss/styles.scss"
50+
],
51+
"scripts": [
52+
"../node_modules/hammerjs/hammer.min.js"
53+
],
54+
"environmentSource": "environments/environment.ts",
55+
"environments": {
56+
"dev": "environments/environment.ts",
57+
"staging": "environments/environment.staging.ts",
58+
"testing": "environments/environment.testing.ts",
59+
"prod": "environments/environment.production.ts"
60+
}
61+
}
62+
],
63+
"e2e": {
64+
"protractor": {
65+
"config": "./protractor.conf.js"
66+
}
67+
},
68+
"lint": [
69+
{
70+
"project": "src/tsconfig.app.json",
71+
"exclude": "**/node_modules/**"
72+
},
73+
{
74+
"project": "src/tsconfig.spec.json",
75+
"exclude": "**/node_modules/**"
76+
},
77+
{
78+
"project": "test/e2e/tsconfig.e2e.json",
79+
"exclude": "**/node_modules/**"
80+
}
81+
],
82+
"test": {
83+
"karma": {
84+
"config": "./karma.conf.js"
85+
}
86+
},
87+
"defaults": {
88+
"styleExt": "scss",
89+
"component": {
90+
}
91+
}
92+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
1-
# Node generated files
2-
node_modules
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
332
npm-debug.log
4-
# OS generated files
5-
.idea
6-
Thumbs.db
33+
testem.log
34+
/typings
35+
36+
# e2e
37+
/test/e2e/*.js
38+
/test/e2e/*.map
39+
40+
# System Files
741
.DS_Store
8-
# Ignored files
9-
dist
10-
.vscode
11-
*.js
12-
*.map
13-
*.d.ts
14-
!index.d.ts
42+
Thumbs.db

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
All fixes and features should be labeled [fix] and [feat] respectively.
2+
Modifications of any sort should include a test and a detailed description of change.
3+
- Node.js test are run with Mocha.
4+
- Angular Unit tests are run with Protractor.
5+
6+
We enjoy all Pull Requests big and small!

ISSUE_TEMPLATE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
We use issues to track bugs and fixes, so general questions or advice should be asked on Stack Overflow or the Gitter Channels. Non "Fix/Bug" issues may closed without a formal response.
2+
3+
Before you submit an issue, please include:
4+
5+
- [ ] Angular Version
6+
- [ ] Angular CLI Version
7+
- [ ] Node & NPM Version
8+
9+
Detailed Description on how to reproduce error:

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Angular Intercom
1+
# ng-intercom
22

3-
[![npm](https://img.shields.io/npm/v/ng-intercom.svg)](https://www.npmjs.com/package/ng-intercom) [![npm](https://img.shields.io/npm/dm/ng-intercom.svg)](https://www.npmjs.com/ng-intercom) [![Maintenance](https://img.shields.io/maintenance/yes/2018.svg)]()
3+
[![npm](https://img.shields.io/npm/v/ng-intercom.svg)](https://www.npmjs.com/package/ng-intercom)
4+
[![npm](https://img.shields.io/npm/dm/ng-intercom.svg)](https://www.npmjs.com/ng-intercom)
5+
[![Build status][ci-image]][ci-url]
6+
[![Maintenance](https://img.shields.io/maintenance/yes/2018.svg)]()
47

58
This is an Intercom wrapper for Angular 2+ with dependency injection for universal applications.
69

@@ -71,7 +74,18 @@ export class AppComponent implements OnInit {
7174
```
7275

7376
### Development
74-
To compile, just run `npm run build`. It will compile into the dist directory.
77+
To run live testing: `ng test`
78+
79+
To run tests: `npm test`
80+
81+
To run distribution: `npm run build:dist`
82+
83+
To publish `npm run build:dist && npm publish dist`
84+
7585

7686
### Credits
7787
Maintained by [Scott Wyatt](https://github.com/scott-wyatt) and [Wilson Hobbs](https://www.twitter.com/wbhob) in 2017 with contributions from [Florian Reifschneider](https://github.com/flore2003), [Devon Sams](https://www.twitter.com/POS1TRON), and [Humberto Rocha](https://github.com/humrochagf)
88+
89+
90+
[ci-image]: https://img.shields.io/circleci/project/github/CaliStyle/NgEngine/master.svg
91+
[ci-url]: https://circleci.com/gh/CaliStyle/NgEngine/tree/master

circle.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
machine:
2+
post:
3+
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
4+
- sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
5+
- sudo apt-get update
6+
- sudo apt-get install google-chrome-stable
7+
node:
8+
version: 6.9.0

karma.conf.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular/cli'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage-istanbul-reporter'),
13+
require('@angular/cli/plugins/karma')
14+
],
15+
client:{
16+
clearContext: false // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
reports: [ 'html', 'lcovonly' ],
20+
fixWebpackSourcePaths: true
21+
},
22+
angularCli: {
23+
environment: 'dev'
24+
},
25+
reporters: ['progress', 'kjhtml'],
26+
port: 9876,
27+
colors: true,
28+
logLevel: config.LOG_INFO,
29+
autoWatch: true,
30+
browsers: ['Chrome'],
31+
singleRun: false
32+
});
33+
};

ng-package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
3+
"name": "ng-intercom",
4+
"version": "1.0.0-beta.12",
5+
"licensePath": "LICENSE",
6+
"lib": {
7+
"entryFile": "public_api.ts",
8+
"languageLevel": [ "dom", "es2017" ],
9+
"externals": {},
10+
"embedded": []
11+
}
12+
}

0 commit comments

Comments
 (0)