Skip to content

Commit 1f12ef8

Browse files
committed
chore: working demo
1 parent 42b64c6 commit 1f12ef8

Some content is hidden

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

67 files changed

+40600
-115
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
### Node ###
22

3+
# Demo
4+
/demo/netlify
5+
/demo/serverless.ts
6+
/demo/tsconfig.serverless.json
7+
/demo/_redirects
8+
/demo/node_modules
9+
310
# Logs
411
logs
512
*.log

demo/.browserslistrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.

demo/angular.json

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

demo/karma.conf.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
22+
clearContext: false // leave Jasmine Spec Runner output visible in browser
23+
},
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
28+
dir: require('path').join(__dirname, './coverage/angular-bfdx'),
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'text-summary' }
33+
]
34+
},
35+
reporters: ['progress', 'kjhtml'],
36+
port: 9876,
37+
colors: true,
38+
logLevel: config.LOG_INFO,
39+
autoWatch: true,
40+
browsers: ['Chrome'],
41+
singleRun: false,
42+
restartOnFileChange: true
43+
});
44+
};

demo/netlify.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[build]
2+
command = "npm run build:sls"
3+
publish = "dist/netlify-serverless/browser"
4+
5+
# any additional redirects for the site should come *before* this one
6+
[[redirects]]
7+
from = "/*"
8+
to = "/.netlify/functions/angular-builder"
9+
status = 200
10+
11+
[functions]
12+
included_files=["dist/netlify-serverless/browser/index.html"]
13+
node_bundler="esbuild"
14+
15+
[[plugins]]
16+
package = "../"
17+
[plugins.inputs]
18+
projectName = "angular-bfdx"

0 commit comments

Comments
 (0)