Skip to content

Commit

Permalink
fix: angular dependency, remove fakerjs, nguniversal demo app (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
udayvunnam authored Feb 1, 2022
1 parent 0a300c9 commit 8cd1f98
Show file tree
Hide file tree
Showing 58 changed files with 4,693 additions and 2,108 deletions.
22 changes: 22 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# temporary. After the issue https://github.com/angular/angular-cli/issues/22606 is fixed, remove this

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"got-demo-e2e": "apps/got-demo-e2e",
"simple-demo": "apps/simple-demo",
"simple-demo-e2e": "apps/simple-demo-e2e",
"ssr": "apps/ssr",
"with-gaurd-check": "apps/with-gaurd-check",
"with-gaurd-check-e2e": "apps/with-gaurd-check-e2e",
"xng-breadcrumb": "libs/xng-breadcrumb"
Expand Down
4 changes: 4 additions & 0 deletions apps/breadcrumb-demo/.browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# temporary. After the issue https://github.com/angular/angular-cli/issues/22606 is fixed, remove this

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
Expand All @@ -16,3 +18,5 @@ last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
22 changes: 15 additions & 7 deletions apps/breadcrumb-demo/src/app/core/in-memory-data.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { Injectable } from '@angular/core';
import { InMemoryDbService } from 'angular-in-memory-web-api';
import * as faker from 'faker';
import {
randBoolean,
randCountry,
randFirstName,
randFutureDate,
randLastName,
randPastDate,
randSentence,
} from '@ngneat/falso';

export const allLanguages = [
'React',
Expand Down Expand Up @@ -36,12 +44,12 @@ const getRandomArray = (
const person = (index: number) => {
return {
id: index,
name: `${faker.name.firstName()} ${faker.name.lastName()}`,
country: faker.address.country(),
active: faker.random.boolean(),
description: faker.lorem.sentence(),
available: faker.date.future(),
updatedTs: faker.date.past(),
name: `${randFirstName()} ${randLastName()}`,
country: randCountry(),
active: randBoolean(),
description: randSentence(),
available: randFutureDate(),
updatedTs: randPastDate(),
skills: getRandomArray(allLanguages, 5),
};
};
Expand Down
4 changes: 4 additions & 0 deletions apps/demo/.browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# temporary. After the issue https://github.com/angular/angular-cli/issues/22606 is fixed, remove this

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
Expand All @@ -16,3 +18,5 @@ last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
4 changes: 4 additions & 0 deletions apps/got-demo/.browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# temporary. After the issue https://github.com/angular/angular-cli/issues/22606 is fixed, remove this

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
Expand All @@ -16,3 +18,5 @@ last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
4 changes: 4 additions & 0 deletions apps/simple-demo/.browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# temporary. After the issue https://github.com/angular/angular-cli/issues/22606 is fixed, remove this

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
Expand All @@ -16,3 +18,5 @@ last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
22 changes: 22 additions & 0 deletions apps/ssr/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# temporary. After the issue https://github.com/angular/angular-cli/issues/22606 is fixed, remove this

# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
36 changes: 36 additions & 0 deletions apps/ssr/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"rules": {}
}
]
}
21 changes: 21 additions & 0 deletions apps/ssr/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
displayName: 'ssr',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
},
coverageDirectory: '../../coverage/apps/ssr',
transform: {
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
143 changes: 143 additions & 0 deletions apps/ssr/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
{
"projectType": "application",
"root": "apps/ssr",
"sourceRoot": "apps/ssr/src",
"prefix": "app",
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/ssr/browser",
"index": "apps/ssr/src/index.html",
"main": "apps/ssr/src/main.ts",
"polyfills": "apps/ssr/src/polyfills.ts",
"tsConfig": "apps/ssr/tsconfig.app.json",
"assets": ["apps/ssr/src/favicon.ico", "apps/ssr/src/assets"],
"styles": ["apps/ssr/src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "apps/ssr/src/environments/environment.ts",
"with": "apps/ssr/src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ssr:build:production"
},
"development": {
"browserTarget": "ssr:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ssr:build"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": ["apps/ssr/src/**/*.ts", "apps/ssr/src/**/*.html"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["coverage/apps/ssr"],
"options": {
"jestConfig": "apps/ssr/jest.config.js",
"passWithNoTests": true
}
},
"server": {
"executor": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/apps/ssr/server",
"main": "apps/ssr/server.ts",
"tsConfig": "apps/ssr/tsconfig.server.json"
},
"configurations": {
"production": {
"outputHashing": "media",
"fileReplacements": [
{
"replace": "apps/ssr/src/environments/environment.ts",
"with": "apps/ssr/src/environments/environment.prod.ts"
}
]
},
"development": {
"optimization": false,
"sourceMap": true,
"extractLicenses": false
}
},
"defaultConfiguration": "production"
},
"serve-ssr": {
"executor": "@nguniversal/builders:ssr-dev-server",
"configurations": {
"development": {
"browserTarget": "ssr:build:development",
"serverTarget": "ssr:server:development"
},
"production": {
"browserTarget": "ssr:build:production",
"serverTarget": "ssr:server:production"
}
},
"defaultConfiguration": "development"
},
"prerender": {
"executor": "@nguniversal/builders:prerender",
"options": {
"routes": ["/"]
},
"configurations": {
"production": {
"browserTarget": "ssr:build:production",
"serverTarget": "ssr:server:production"
},
"development": {
"browserTarget": "ssr:build:development",
"serverTarget": "ssr:server:development"
}
},
"defaultConfiguration": "production"
}
},
"tags": []
}
Loading

0 comments on commit 8cd1f98

Please sign in to comment.