Skip to content

Commit 4f35bc6

Browse files
committed
first
0 parents  commit 4f35bc6

Some content is hidden

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

81 files changed

+16719
-0
lines changed

eggduino-client/.editorconfig

+16
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

eggduino-client/.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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

eggduino-client/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# EggduinoClient
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.0.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
25+
## Further help
26+
27+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

eggduino-client/angular.json

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"eggduino-client": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/eggduino-client",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "tsconfig.app.json",
21+
"aot": true,
22+
"assets": [
23+
"src/favicon.ico",
24+
"src/assets"
25+
],
26+
"styles": [
27+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
28+
"src/styles.scss"
29+
],
30+
"scripts": []
31+
},
32+
"configurations": {
33+
"production": {
34+
"fileReplacements": [
35+
{
36+
"replace": "src/environments/environment.ts",
37+
"with": "src/environments/environment.prod.ts"
38+
}
39+
],
40+
"optimization": true,
41+
"outputHashing": "none",
42+
"sourceMap": false,
43+
"extractCss": true,
44+
"namedChunks": false,
45+
"extractLicenses": true,
46+
"vendorChunk": false,
47+
"buildOptimizer": true,
48+
"budgets": [
49+
{
50+
"type": "initial",
51+
"maximumWarning": "2mb",
52+
"maximumError": "5mb"
53+
},
54+
{
55+
"type": "anyComponentStyle",
56+
"maximumWarning": "6kb",
57+
"maximumError": "10kb"
58+
}
59+
]
60+
}
61+
}
62+
},
63+
"serve": {
64+
"builder": "@angular-devkit/build-angular:dev-server",
65+
"options": {
66+
"browserTarget": "eggduino-client:build",
67+
"proxyConfig": "src/proxy.conf.json"
68+
},
69+
"configurations": {
70+
"production": {
71+
"browserTarget": "eggduino-client:build:production"
72+
}
73+
}
74+
},
75+
"extract-i18n": {
76+
"builder": "@angular-devkit/build-angular:extract-i18n",
77+
"options": {
78+
"browserTarget": "eggduino-client:build"
79+
}
80+
},
81+
"test": {
82+
"builder": "@angular-devkit/build-angular:karma",
83+
"options": {
84+
"main": "src/test.ts",
85+
"polyfills": "src/polyfills.ts",
86+
"tsConfig": "tsconfig.spec.json",
87+
"karmaConfig": "karma.conf.js",
88+
"assets": [
89+
"src/favicon.ico",
90+
"src/assets"
91+
],
92+
"styles": [
93+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
94+
"src/styles.scss"
95+
],
96+
"scripts": []
97+
}
98+
},
99+
"lint": {
100+
"builder": "@angular-devkit/build-angular:tslint",
101+
"options": {
102+
"tsConfig": [
103+
"tsconfig.app.json",
104+
"tsconfig.spec.json",
105+
"e2e/tsconfig.json"
106+
],
107+
"exclude": [
108+
"**/node_modules/**"
109+
]
110+
}
111+
},
112+
"e2e": {
113+
"builder": "@angular-devkit/build-angular:protractor",
114+
"options": {
115+
"protractorConfig": "e2e/protractor.conf.js",
116+
"devServerTarget": "eggduino-client:serve"
117+
},
118+
"configurations": {
119+
"production": {
120+
"devServerTarget": "eggduino-client:serve:production"
121+
}
122+
}
123+
}
124+
}
125+
}
126+
},
127+
"defaultProject": "eggduino-client"
128+
}

eggduino-client/browserslist

+12
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'.

eggduino-client/compress.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
const zlib = require('zlib');
2+
const glob = require('glob');
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
const src = 'dist/eggduino-client/';
7+
const dist = '../eggduino-m5/data/client/';
8+
9+
fs.rmdirSync(dist, { recursive: true });
10+
11+
function compressFile(filename) {
12+
return new Promise(resolve => {
13+
if (fs.statSync(filename).isDirectory()) {
14+
resolve();
15+
return;
16+
}
17+
18+
var destination = dist + filename.substr(src.length) + '.gz';
19+
var destDir = path.dirname(destination);
20+
if (!fs.existsSync(destDir))
21+
fs.mkdirSync(destDir);
22+
23+
console.log(`${filename} -> ${destination}`);
24+
25+
var compress = zlib.createGzip(),
26+
input = fs.createReadStream(filename),
27+
output = fs.createWriteStream(destination);
28+
29+
input.pipe(compress).pipe(output);
30+
31+
output.on('end', resolve);
32+
});
33+
}
34+
35+
async function compressFiles() {
36+
const files = await new Promise((resolve, reject) => glob(src + '**/*', (err, items) => {
37+
if (err) reject(err); else resolve(items);
38+
}));
39+
40+
await Promise.all(files.map(file => compressFile(file)));
41+
}
42+
43+
compressFiles();
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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: [
13+
'./src/**/*.e2e-spec.ts'
14+
],
15+
capabilities: {
16+
browserName: 'chrome'
17+
},
18+
directConnect: true,
19+
baseUrl: 'http://localhost:4200/',
20+
framework: 'jasmine',
21+
jasmineNodeOpts: {
22+
showColors: true,
23+
defaultTimeoutInterval: 30000,
24+
print: function() {}
25+
},
26+
onPrepare() {
27+
require('ts-node').register({
28+
project: require('path').join(__dirname, './tsconfig.json')
29+
});
30+
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
31+
}
32+
};
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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('eggduino-client 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(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
} as logging.Entry));
22+
});
23+
});

eggduino-client/e2e/src/app.po.ts

+11
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+
}

eggduino-client/e2e/tsconfig.json

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

eggduino-client/karma.conf.js

+32
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/eggduino-client'),
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)