Skip to content

Commit 5bcc73d

Browse files
committed
🎉 Initial commit
0 parents  commit 5bcc73d

Some content is hidden

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

45 files changed

+24178
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://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+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
16+
17+
# IDEs and editors
18+
/.idea
19+
.project
20+
.classpath
21+
.c9/
22+
*.launch
23+
.settings/
24+
*.sublime-workspace
25+
26+
# IDE - VSCode
27+
.vscode/*
28+
!.vscode/settings.json
29+
!.vscode/tasks.json
30+
!.vscode/launch.json
31+
!.vscode/extensions.json
32+
.history/*
33+
34+
# misc
35+
/.sass-cache
36+
/connect.lock
37+
/coverage
38+
/libpeerconnection.log
39+
npm-debug.log
40+
yarn-error.log
41+
testem.log
42+
/typings
43+
44+
# System Files
45+
.DS_Store
46+
Thumbs.db
47+
48+
.vercel

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"printWidth": 110
4+
}

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<p align="center">
2+
<b>Angular Apollo Local</b>
3+
</p>
4+
5+
<p>Basic to-do application using Angular and Apollo Client. Application created for testing purposes only, demo available [here](https://angular-apollo-local.vercel.app/). Feel free to make it yours.</p>
6+
7+
<br/>
8+
<p align="center">
9+
<img width="932" height="612" src="https://i.ibb.co/26bWMs8/Screen-Shot-2020-10-29-at-17-35-00.png">
10+
</p>

angular.json

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular-graphql": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss"
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"outputPath": "dist/angular-graphql",
21+
"index": "src/index.html",
22+
"main": "src/main.ts",
23+
"polyfills": "src/polyfills.ts",
24+
"tsConfig": "tsconfig.app.json",
25+
"aot": true,
26+
"assets": [
27+
"src/favicon.ico",
28+
"src/assets",
29+
{
30+
"glob": "**/*.svg",
31+
"input": "node_modules/ionicons/dist/ionicons/svg",
32+
"output": "./svg"
33+
}
34+
],
35+
"styles": [
36+
"src/styles.scss",
37+
{
38+
"input": "node_modules/@ionic/angular/css/normalize.css"
39+
},
40+
{
41+
"input": "node_modules/@ionic/angular/css/structure.css"
42+
},
43+
{
44+
"input": "node_modules/@ionic/angular/css/typography.css"
45+
},
46+
{
47+
"input": "node_modules/@ionic/angular/css/core.css"
48+
},
49+
{
50+
"input": "node_modules/@ionic/angular/css/padding.css"
51+
},
52+
{
53+
"input": "node_modules/@ionic/angular/css/float-elements.css"
54+
},
55+
{
56+
"input": "node_modules/@ionic/angular/css/text-alignment.css"
57+
},
58+
{
59+
"input": "node_modules/@ionic/angular/css/text-transformation.css"
60+
},
61+
{
62+
"input": "node_modules/@ionic/angular/css/flex-utils.css"
63+
},
64+
{
65+
"input": "src/theme/variables.css"
66+
}
67+
],
68+
"scripts": []
69+
},
70+
"configurations": {
71+
"production": {
72+
"fileReplacements": [
73+
{
74+
"replace": "src/environments/environment.ts",
75+
"with": "src/environments/environment.prod.ts"
76+
}
77+
],
78+
"optimization": true,
79+
"outputHashing": "all",
80+
"sourceMap": false,
81+
"extractCss": true,
82+
"namedChunks": false,
83+
"extractLicenses": true,
84+
"vendorChunk": false,
85+
"buildOptimizer": true,
86+
"budgets": [
87+
{
88+
"type": "initial",
89+
"maximumWarning": "2mb",
90+
"maximumError": "5mb"
91+
},
92+
{
93+
"type": "anyComponentStyle",
94+
"maximumWarning": "6kb",
95+
"maximumError": "10kb"
96+
}
97+
]
98+
}
99+
}
100+
},
101+
"serve": {
102+
"builder": "@angular-devkit/build-angular:dev-server",
103+
"options": {
104+
"browserTarget": "angular-graphql:build"
105+
},
106+
"configurations": {
107+
"production": {
108+
"browserTarget": "angular-graphql:build:production"
109+
}
110+
}
111+
},
112+
"extract-i18n": {
113+
"builder": "@angular-devkit/build-angular:extract-i18n",
114+
"options": {
115+
"browserTarget": "angular-graphql:build"
116+
}
117+
},
118+
"test": {
119+
"builder": "@angular-devkit/build-angular:karma",
120+
"options": {
121+
"main": "src/test.ts",
122+
"polyfills": "src/polyfills.ts",
123+
"tsConfig": "tsconfig.spec.json",
124+
"karmaConfig": "karma.conf.js",
125+
"assets": ["src/favicon.ico", "src/assets"],
126+
"styles": ["src/styles.scss"],
127+
"scripts": []
128+
}
129+
},
130+
"lint": {
131+
"builder": "@angular-devkit/build-angular:tslint",
132+
"options": {
133+
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
134+
"exclude": ["**/node_modules/**"]
135+
}
136+
},
137+
"e2e": {
138+
"builder": "@angular-devkit/build-angular:protractor",
139+
"options": {
140+
"protractorConfig": "e2e/protractor.conf.js",
141+
"devServerTarget": "angular-graphql:serve"
142+
},
143+
"configurations": {
144+
"production": {
145+
"devServerTarget": "angular-graphql:serve:production"
146+
}
147+
}
148+
},
149+
"ionic-cordova-serve": {
150+
"builder": "@ionic/angular-toolkit:cordova-serve",
151+
"options": {
152+
"cordovaBuildTarget": "angular-graphql:ionic-cordova-build",
153+
"devServerTarget": "angular-graphql:serve"
154+
},
155+
"configurations": {
156+
"production": {
157+
"cordovaBuildTarget": "angular-graphql:ionic-cordova-build:production",
158+
"devServerTarget": "angular-graphql:serve:production"
159+
}
160+
}
161+
},
162+
"ionic-cordova-build": {
163+
"builder": "@ionic/angular-toolkit:cordova-build",
164+
"options": {
165+
"browserTarget": "angular-graphql:build"
166+
},
167+
"configurations": {
168+
"production": {
169+
"browserTarget": "angular-graphql:build:production"
170+
}
171+
}
172+
}
173+
}
174+
}
175+
},
176+
"defaultProject": "angular-graphql"
177+
}

browserslist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

e2e/protractor.conf.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// @ts-check
2+
// Protractor configuration file, see link for more information
3+
// https://github.com/angular/protractor/blob/master/lib/config.ts
4+
5+
const { SpecReporter } = require("jasmine-spec-reporter")
6+
7+
/**
8+
* @type { import("protractor").Config }
9+
*/
10+
exports.config = {
11+
allScriptsTimeout: 11000,
12+
specs: ["./src/**/*.e2e-spec.ts"],
13+
capabilities: {
14+
browserName: "chrome",
15+
},
16+
directConnect: true,
17+
baseUrl: "http://localhost:4200/",
18+
framework: "jasmine",
19+
jasmineNodeOpts: {
20+
showColors: true,
21+
defaultTimeoutInterval: 30000,
22+
print: function () {},
23+
},
24+
onPrepare() {
25+
require("ts-node").register({
26+
project: require("path").join(__dirname, "./tsconfig.json"),
27+
})
28+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }))
29+
},
30+
}

e2e/src/app.e2e-spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { AppPage } from './app.po'
2+
import { browser, logging } from 'protractor'
3+
4+
describe('workspace-project App', () => {
5+
let page: AppPage
6+
7+
beforeEach(() => {
8+
page = new AppPage()
9+
})
10+
11+
it('should display welcome message', () => {
12+
page.navigateTo()
13+
expect(page.getTitleText()).toEqual('angular-graphql app is running!')
14+
})
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER)
19+
expect(logs).not.toContain(
20+
jasmine.objectContaining({
21+
level: logging.Level.SEVERE,
22+
} as logging.Entry)
23+
)
24+
})
25+
})

e2e/src/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, by, element } from 'protractor'
2+
3+
export class AppPage {
4+
navigateTo(): Promise<unknown> {
5+
return browser.get(browser.baseUrl) as Promise<unknown>
6+
}
7+
8+
getTitleText(): Promise<string> {
9+
return element(by.css('app-root .content span')).getText() as Promise<string>
10+
}
11+
}

e2e/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": ["jasmine", "jasminewd2", "node"]
8+
}
9+
}

karma.conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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-devkit/build-angular"],
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-devkit/build-angular/plugins/karma"),
14+
],
15+
client: {
16+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
17+
},
18+
coverageIstanbulReporter: {
19+
dir: require("path").join(__dirname, "./coverage/angular-graphql"),
20+
reports: ["html", "lcovonly", "text-summary"],
21+
fixWebpackSourcePaths: true,
22+
},
23+
reporters: ["progress", "kjhtml"],
24+
port: 9876,
25+
colors: true,
26+
logLevel: config.LOG_INFO,
27+
autoWatch: true,
28+
browsers: ["Chrome"],
29+
singleRun: false,
30+
restartOnFileChange: true,
31+
})
32+
}

0 commit comments

Comments
 (0)