Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): upgrade Angular to v10 #1229

Closed
wants to merge 79 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
caddc23
chore(all): upgrade Angular to v10 package and dependencies
griest024 Jan 12, 2021
65771c1
feat(all): pass generic type to ModuleWithProviders
griest024 Jan 12, 2021
8597a18
chore(design): drop static: false from @ContentChild and @ViewChild
griest024 Jan 12, 2021
3cca166
chore(driver): remove DaffCoreTestingModule from Magento testing
griest024 Jan 12, 2021
5c57d31
feat(design): add Directive decorator to mixin
griest024 Jan 12, 2021
0129883
build(demo,daffio,design-land): add component style budgets
griest024 Jan 12, 2021
dd284cc
fix(demo): aot compatible driver map
griest024 Jan 12, 2021
d5fb40d
test(auth,geography): change response instead of spying validators
griest024 Jan 12, 2021
a5a05c4
feat(checkout): add export
griest024 Jan 12, 2021
c8e9c52
feat(design): add checkbox CVA export
griest024 Jan 12, 2021
9806cdd
feat(design): add radio CVA export
griest024 Jan 12, 2021
4c3eced
feat(design): add modal exports
griest024 Jan 12, 2021
c2092b5
feat(design): add form error messages export
griest024 Jan 12, 2021
e524920
test(core): simplify persistence token test
griest024 Jan 12, 2021
9a3ad38
feat(core): add scan generic in substream
griest024 Jan 12, 2021
9e41007
fix(design): handle edge case with @self injected control
griest024 Jan 12, 2021
fffab87
test(design): test classList differently
griest024 Jan 12, 2021
414299d
test(design): call super() in mixin tests
griest024 Jan 12, 2021
b924a6e
refactor(all): TestBed.get -> TestBed.inject
griest024 Dec 29, 2020
3cdb2a0
chore(daffio): upgrade angular universal
griest024 Jan 8, 2021
ce2d422
test(daffio): fix injected types
griest024 Jan 12, 2021
5edd792
chore(daffio): upgrade @ngrx/router-store
griest024 Jan 8, 2021
cb345dd
test(demo): fix injected mocks
griest024 Jan 12, 2021
9c5f623
test(demo): fix spied function type signatures
griest024 Jan 8, 2021
cbe8ec8
test(demo): remove unused imports and mocks
griest024 Jan 8, 2021
c758dbf
test(authorizenet): fix injected types
griest024 Jan 8, 2021
f878ab3
test(cart): use individual spies instead of spy objects
griest024 Jan 8, 2021
51ce28b
feat(cart): provide magento transformers in root
griest024 Jan 8, 2021
1049fc5
test(cart): fix injected types
griest024 Jan 8, 2021
f341850
feat(cart): update to support @apollo/client 3 and apollo-angular
griest024 Jan 8, 2021
a436538
feat(cart): add typename on all Magento responses
griest024 Jan 8, 2021
c9db9c7
chore(auth): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 8, 2021
c6b1012
test(auth): fix injected types
griest024 Jan 8, 2021
dfefb92
test(auth): use individual spies instead of spy objects
griest024 Jan 8, 2021
f0ac395
chore(category): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 10, 2021
82081d5
test(category): fix injected types and use individual spies instead o…
griest024 Jan 10, 2021
032cf81
test(checkout): fix injected types
griest024 Jan 10, 2021
8b2fb23
build(all): allow synthetic default imports
griest024 Jan 10, 2021
262b54b
test(contact): fix injected types
griest024 Jan 10, 2021
5e21c57
docs(tools): add blurb about fragment types builder changes
griest024 Jan 10, 2021
b704f9e
feat(design-land): remove unused entryComponents
griest024 Jan 10, 2021
e31cffd
feat(demo): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 10, 2021
588a77d
test(design-land): import modal module
griest024 Jan 10, 2021
bcc4c29
build(core): fix code coverage script
griest024 Jan 10, 2021
080ce05
test(core): fix injected types and use individual spies instead of sp…
griest024 Jan 11, 2021
531b333
feat(core): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 11, 2021
70751a7
feat(driver): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 11, 2021
b256e3b
feat(driver): add typename to Magento models
griest024 Jan 11, 2021
9bf8a9f
feat(geography): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 11, 2021
4619bf3
feat(geography): add typename to Magento models
griest024 Jan 11, 2021
b8bf90d
test(geography): fix injected types and use individual spies instead …
griest024 Jan 11, 2021
53ea656
feat(navigation): update to support @apollo/client 3 and apollo-angul…
griest024 Jan 11, 2021
3e2c7cd
test(navigation): add root field to test query and unique tree ID to …
griest024 Jan 11, 2021
d2e6dc2
test(navigation): fix injected types
griest024 Jan 11, 2021
d613d0e
test(newsletter): fix injected types
griest024 Jan 11, 2021
a051e2b
feat(paypal): add default generic types to transformer interface
griest024 Jan 11, 2021
0285323
feat(paypal): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 11, 2021
35f8058
test(paypal): fix injected types
griest024 Jan 11, 2021
7150e5b
feat(product): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 11, 2021
c707749
feat(product): add typename to driver response models
griest024 Jan 11, 2021
a6b6cdf
test(product): fix injected types and use individual spies instead of…
griest024 Jan 11, 2021
2d44052
feat(order): update to support @apollo/client 3 and apollo-angular 2
griest024 Jan 11, 2021
16396c8
feat(order): add typename to driver response models
griest024 Jan 11, 2021
da1e314
test(order): fix injected types and use individual spies instead of s…
griest024 Jan 11, 2021
bac4abe
test(contact,newsletter): fix page name assertion
griest024 Jan 12, 2021
615932c
style(design-land,design): linting
griest024 Jan 12, 2021
95ab845
chore(all): fix placeholder dependency names
griest024 Jan 12, 2021
5636edc
feat(cart): add injection token types
griest024 Jan 8, 2021
13dc896
feat(auth): add injection token types
griest024 Jan 8, 2021
ed7b9c6
feat(category): add injection token types
griest024 Jan 8, 2021
b1b4039
feat(contact): add injection token types
griest024 Jan 10, 2021
f0b2dab
feat(geography): add injection token types
griest024 Jan 11, 2021
66a17b6
feat(newsletter): add injection token types
griest024 Jan 11, 2021
0e5363f
feat(paypal): add injection token types
griest024 Jan 11, 2021
cb55f35
feat(product): add injection token types
griest024 Jan 11, 2021
58f701e
feat(authorizenet): add injection token types
griest024 Jan 8, 2021
7cc9c4e
chore(external-router): disable coverage reporting
griest024 Jan 13, 2021
3e73263
remove cart testing module from product test
griest024 Jan 15, 2021
8a53bdf
bump jasminewd2
griest024 Jan 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
105 changes: 74 additions & 31 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
Expand Down Expand Up @@ -267,8 +273,8 @@
"libs/product/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**",
"**/*.json"
"**/node_modules/**",
"**/*.json"
]
}
}
Expand Down Expand Up @@ -565,6 +571,12 @@
},
"configurations": {
"production": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "apps/daffio/src/environments/environment.ts",
Expand Down Expand Up @@ -648,7 +660,7 @@
"builder": "@angular-devkit/build-angular:server",
"options": {
"outputPath": "dist/apps/daffio/server",
"main": "apps/daffio/src/main.server.ts",
"main": "apps/daffio/server/server.ts",
"tsConfig": "apps/daffio/tsconfig.server.json",
"stylePreprocessorOptions": {
"includePaths": [
Expand All @@ -668,6 +680,32 @@
]
}
}
},
"serve-ssr": {
"builder": "@nguniversal/builders:ssr-dev-server",
"options": {
"browserTarget": "daffio:build",
"serverTarget": "daffio:server"
},
"configurations": {
"production": {
"browserTarget": "daffio:build:production",
"serverTarget": "daffio:server:production"
}
}
},
"prerender": {
"builder": "@nguniversal/builders:prerender",
"options": {
"browserTarget": "daffio:build:production",
"serverTarget": "daffio:server:production",
"routes": [
"/"
]
},
"configurations": {
"production": {}
}
}
}
},
Expand Down Expand Up @@ -803,6 +841,10 @@
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
}
Expand Down Expand Up @@ -1096,19 +1138,19 @@
"geography": {
"projectType": "library",
"root": "libs/geography",
"sourceRoot": "libs/geography/src",
"prefix": "@daffodil",
"sourceRoot": "libs/geography/src",
"prefix": "@daffodil",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "libs/geography/tsconfig.lib.json",
"tsConfig": "libs/geography/tsconfig.lib.json",
"project": "libs/geography/ng-package.json"
},
"configurations": {
"production": {
"project": "libs/geography/ng-package.json"
}
"project": "libs/geography/ng-package.json"
}
}
},
"test": {
Expand All @@ -1117,33 +1159,33 @@
"main": "libs/geography/test.ts",
"codeCoverage": true,
"tsConfig": "libs/geography/tsconfig.spec.json",
"karmaConfig": "libs/geography/karma.conf.js"
}
"karmaConfig": "libs/geography/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/geography/tsconfig.lib.json",
"libs/geography/tsconfig.spec.json"
],
"libs/geography/tsconfig.lib.json",
"libs/geography/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"paypal": {
},
"paypal": {
"root": "libs/paypal",
"sourceRoot": "libs/paypal/src",
"projectType": "library",
"prefix": "@daffodil",
"projectType": "library",
"prefix": "@daffodil",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "libs/paypal/tsconfig.lib.json",
"tsConfig": "libs/paypal/tsconfig.lib.json",
"project": "libs/paypal/ng-package.json"
},
"configurations": {
Expand All @@ -1155,7 +1197,7 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "libs/paypal/test.ts",
"main": "libs/paypal/test.ts",
"tsConfig": "libs/paypal/tsconfig.spec.json",
"karmaConfig": "libs/paypal/karma.conf.js"
}
Expand All @@ -1164,7 +1206,7 @@
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/paypal/tsconfig.lib.json",
"libs/paypal/tsconfig.lib.json",
"libs/paypal/tsconfig.spec.json"
],
"exclude": [
Expand All @@ -1177,19 +1219,19 @@
"order": {
"projectType": "library",
"root": "libs/order",
"sourceRoot": "libs/order/src",
"prefix": "@daffodil",
"sourceRoot": "libs/order/src",
"prefix": "@daffodil",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "libs/order/tsconfig.lib.json",
"tsConfig": "libs/order/tsconfig.lib.json",
"project": "libs/order/ng-package.json"
},
"configurations": {
"production": {
"project": "libs/order/ng-package.json"
}
"project": "libs/order/ng-package.json"
}
}
},
"test": {
Expand All @@ -1198,16 +1240,16 @@
"main": "libs/order/test.ts",
"codeCoverage": true,
"tsConfig": "libs/order/tsconfig.spec.json",
"karmaConfig": "libs/order/karma.conf.js"
}
"karmaConfig": "libs/order/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/order/tsconfig.lib.json",
"libs/order/tsconfig.spec.json"
],
"libs/order/tsconfig.lib.json",
"libs/order/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
Expand Down Expand Up @@ -1261,6 +1303,7 @@
"warnings": {
"typescriptMismatch": false,
"versionMismatch": false
}
},
"analytics": "afd3c7da-d12a-4ec7-8adc-6cb3b4e33196"
}
}
12 changes: 7 additions & 5 deletions apps/daffio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
"url": "https://github.com/graycoreio/daffodil/issues"
},
"scripts": {
"build": "npm run build:client-and-server-bundles && npm run compile:server && npm run build:serverless",
"build:client-and-server-bundles": "ng build daffio --prod && ng run daffio:server:production",
"build:serverless": "cp ./serverless/* ../../dist/apps/daffio/",
"build": "npm run build:client-and-server-bundles && npm run build:serverless",
"build:client": "ng build daffio --prod",
"build:server": "ng run daffio:server:production",
"build:client-and-server-bundles": "npm run build:client && npm run build:server",
"build:serverless": "cp -r ./serverless/vercel/* ../../dist/apps/daffio/",
"test": "ng test daffio --watch=false --browsers=ChromeHeadless",
"lint": "ng lint daffio",
"compile:server": "webpack --config ./server/webpack.server.config.js --progress --colors",
"serve:ssr": "node ../../dist/apps/daffio/server.js"
"dev:ssr": "ng run daffio:serve-ssr",
"serve:ssr": "node ../../dist/apps/daffio/server/main.js"
},
"homepage": "https://github.com/graycoreio/daffodil",
"description": "A documentation site for the daffodil project",
Expand Down
90 changes: 55 additions & 35 deletions apps/daffio/server/server.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,61 @@
import 'zone.js/dist/zone-node';
import { enableProdMode } from '@angular/core';
// Express Engine

import { ngExpressEngine } from '@nguniversal/express-engine';
// Import module map for lazy loading
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';



import * as express from 'express';
import { join } from 'path';

// Faster server renders w/ Prod mode (dev mode never needed)
enableProdMode();

// Express server
export const app = express();

const BROWSER_FOLDER = join(__dirname, 'browser');

const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./../../../dist/apps/daffio/server/main');


app.engine('html', ngExpressEngine({
bootstrap: AppServerModuleNgFactory,
providers: [
provideModuleMap(LAZY_MODULE_MAP)
]
}));

app.set('view engine', 'html');
app.set('views', join(BROWSER_FOLDER));

// Server static files from /browser
app.get('*.*', express.static(BROWSER_FOLDER));

// All regular routes use the Universal engine
app.get('*', (req, res) => {
res.render(join(BROWSER_FOLDER, 'index.html'), { req });
});
import { AppServerModule } from '../src/main.server';
import { APP_BASE_HREF } from '@angular/common';
import { existsSync } from 'fs';

// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const BROWSER_FOLDER = join(__dirname, '../browser');

const indexHtml = existsSync(join(BROWSER_FOLDER, 'index.original.html')) ? 'index.original.html' : 'index';

// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
server.engine('html', ngExpressEngine({
bootstrap: AppServerModule,
}));

server.set('view engine', 'html');
server.set('views', BROWSER_FOLDER);

// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser
server.get('*.*', express.static(BROWSER_FOLDER, {
maxAge: '1y'
}));

// All regular routes use the Universal engine
server.get('*', (req, res) => {
res.render(indexHtml, { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
});

return server;
}

function run(): void {
const port = process.env.PORT || 4000;

// Start up the Node server
const server = app();
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}

// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = mainModule && mainModule.filename || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
run();
}

export * from '../src/main.server';
Loading