Skip to content

Commit

Permalink
feat: updated to angular 14 (#15)
Browse files Browse the repository at this point in the history
* build: update dependencies

* build: ran nx migrations

* build: angular build fixes

* build: nest build fixes

* build: nx build config fix

- added targetDefaults

* build: nx build config fix

* build: nx build cache fixes

* fix: test fix

* build: nx build fix

* build: angular-calendar jest fix

* build: setup-script.sh update

- test-setup-script now runs in parallel with tests

* build: changed build target structure

- "build" target no longer attempts to build children, aside from the "safe" build-base. Projects that need to be built should have build called on them directly.
- added "build-all" target to workspace to facilitate building all components first before deploying.

* build: ideal build

BREAKING CHANGES:
- angular 14
- nestjs 9
  • Loading branch information
dereekb authored Aug 13, 2022
1 parent 9f128b3 commit 739726e
Show file tree
Hide file tree
Showing 63 changed files with 25,937 additions and 12,659 deletions.
15 changes: 9 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults: &defaults
# https://circleci.com/blog/config-best-practices-dependency-caching/

orbs:
nx: nrwl/nx@1.1.3
nx: nrwl/nx@1.6.0
node: circleci/[email protected]
jobs:
build:
Expand All @@ -21,8 +21,10 @@ jobs:
- node/install-packages
# initialize nx
- nx/set-shas
# build content
- run: npx nx affected --base=$NX_BASE --target=build --parallel --max-parallel=2
# builds everything in the project in order
- run:
name: build
command: npx nx run workspace:build-all
# persist builds to workspace
- persist_to_workspace:
root: ~/code
Expand Down Expand Up @@ -116,8 +118,11 @@ jobs:
name: run setup-project.sh script
command: cd setup && ./setup-project.sh myprojectapp myproject myproject 9200 ~/setup-test
- run:
name: replace test project's @dereekb in node_modules with generated packages
name: replace test project's @dereekb in node_modules with generated packages (we don't want symlinks)
command: rm -r ~/setup-test/myproject/node_modules/@dereekb && cp -r dist/packages ~/setup-test/myproject/node_modules/@dereekb
- run:
name: Try build components
command: cd ~/setup-test/myproject && npx nx run-many --target=build-base --projects=myproject-firebase,myproject-components
- run:
name: Try build
command: cd ~/setup-test/myproject && npx -y nx build myproject && npx -y nx build myproject-api
Expand Down Expand Up @@ -203,8 +208,6 @@ workflows:
- test-setup-script:
requires:
- build
- test-with-node
- test-with-node-firebase
- run-release-and-push-to-main:
requires:
- build
Expand Down
14 changes: 2 additions & 12 deletions apps/demo-api/project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/demo-api/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["dist/apps/demo-api"],
"options": {
"command": "npx nx run demo-api:build-base",
"color": true
Expand All @@ -12,12 +14,6 @@
"build-base": {
"executor": "@nrwl/node:webpack",
"outputs": ["{options.outputPath}"],
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
],
"options": {
"outputPath": "dist/apps/demo-api",
"main": "apps/demo-api/src/main.ts",
Expand Down Expand Up @@ -101,12 +97,6 @@
},
"ci-deploy": {
"executor": "@nrwl/workspace:run-commands",
"dependsOn": [
{
"target": "build",
"projects": "self"
}
],
"options": {
"commands": [
{
Expand Down
1 change: 1 addition & 0 deletions apps/demo-e2e/project.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/demo-e2e/src",
"projectType": "application",
"targets": {
Expand Down
22 changes: 3 additions & 19 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/demo/src",
"prefix": "app",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["dist/apps/demo"],
"options": {
"command": "npx nx run demo:build-base",
"color": true
Expand All @@ -13,12 +15,6 @@
"build-base": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": ["{options.outputPath}"],
"dependsOn": [
{
"target": "build",
"projects": "dependencies"
}
],
"options": {
"outputPath": "dist/apps/demo",
"index": "apps/demo/src/index.html",
Expand All @@ -36,7 +32,7 @@
"output": "assets/dbx-firebase"
}
],
"allowedCommonJsDependencies": ["validator", "date-fns-tz"],
"allowedCommonJsDependencies": ["lodash", "make-error", "validator", "date-fns-tz"],
"stylePreprocessorOptions": {
"includePaths": ["packages"]
},
Expand Down Expand Up @@ -114,24 +110,12 @@
},
"deploy": {
"executor": "@nrwl/workspace:run-commands",
"dependsOn": [
{
"target": "build",
"projects": "self"
}
],
"options": {
"command": "npx firebase --project=default deploy --only hosting"
}
},
"ci-deploy": {
"executor": "@nrwl/workspace:run-commands",
"dependsOn": [
{
"target": "build",
"projects": "self"
}
],
"options": {
"command": "npx firebase --project=default deploy --only hosting --token \"$FIREBASE_TOKEN\""
}
Expand Down
5 changes: 1 addition & 4 deletions apps/demo/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
/*
Add jest types to avoid angular compiler issues when importing from util.
*/
"types": ["segment-analytics", "jest"],
"target": "ES2017"
"target": "es2020"
},
"files": ["src/main.ts", "src/polyfills.ts"],
"include": ["src/**/*.d.ts"],
Expand Down
3 changes: 2 additions & 1 deletion apps/demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"target": "es2020"
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
Expand Down
4 changes: 2 additions & 2 deletions components/demo-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@dereekb/demo-components",
"version": "8.15.2",
"peerDependencies": {
"@angular/common": "^13.3.0",
"@angular/core": "^13.3.0"
"@angular/common": "^14.0.0",
"@angular/core": "^14.0.0"
},
"dependencies": {
"tslib": "^2.3.0"
Expand Down
2 changes: 2 additions & 0 deletions components/demo-components/project.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "components/demo-components/src",
"prefix": "demo",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["dist/components/demo-components"],
"options": {
"command": "npx nx run demo-components:build-base",
"color": true
Expand Down
3 changes: 2 additions & 1 deletion components/demo-components/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"target": "es2020"
},
"angularCompilerOptions": {
"strictInjectionParameters": true,
Expand Down
2 changes: 2 additions & 0 deletions components/demo-firebase/project.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "components/demo-firebase/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/workspace:run-commands",
"outputs": ["dist/components/demo-firebase"],
"options": {
"command": "npx nx run demo-firebase:build-base",
"color": true
Expand Down
7 changes: 7 additions & 0 deletions jest.resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ module.exports = (path, options) => {
// console.log('>>>', pkg.name)
delete pkg['exports'];
delete pkg['module'];
} else if (pkg.name === 'angular-calendar') {
// TEMPORARY: remove if/when https://github.com/mattlewis92/angular-calendar/pull/1599 is accepted
pkg['exports']['./date-adapters/date-fns'] = {
main: './date-adapters/date-fns/index.js',
types: './date-adapters/date-fns/index.d.ts',
default: './date-adapters/date-fns/index.js'
};
}

return pkg;
Expand Down
Loading

0 comments on commit 739726e

Please sign in to comment.