Skip to content

Commit 506cb1b

Browse files
committed
downgrade to Angular 13 build system
1 parent ddfeeb9 commit 506cb1b

21 files changed

+316
-47
lines changed

CONTRIBUTORS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
Information for people wanting to contribute code to this project.
55

66

7+
## Special Monorepo Note
8+
9+
Building this package only works (from a TypeScript perspective) if the outer monorepo is
10+
fully BUILT, not in dev-mode.
11+
12+
713
## Important Directories
814

915
This repo was initially created with Angular CLI, which is why certain directories are where they are:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ This project is built and maintained by [irustm](https://github.com/irustm) in p
1212

1313
## Supported Angular Versions
1414

15-
`@fullcalendar/angular` version 5 supports Angular 9 - 15.
15+
`@fullcalendar/angular` version 5 supports Angular 12 - 15.

angular.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,20 @@
2727
"test": {
2828
"builder": "@angular-devkit/build-angular:karma",
2929
"options": {
30+
"main": "lib/src/test.ts",
3031
"tsConfig": "lib/tsconfig.spec.json",
31-
"polyfills": [
32-
"zone.js",
33-
"zone.js/testing"
34-
]
32+
"karmaConfig": "lib/karma.conf.js"
3533
}
3634
}
3735
}
3836
},
3937
"app": {
4038
"projectType": "application",
41-
"schematics": {},
39+
"schematics": {
40+
"@schematics/angular:application": {
41+
"strict": true
42+
}
43+
},
4244
"root": "app",
4345
"sourceRoot": "app/src",
4446
"prefix": "app",
@@ -49,9 +51,7 @@
4951
"outputPath": "dist/app",
5052
"index": "app/src/index.html",
5153
"main": "app/src/main.ts",
52-
"polyfills": [
53-
"zone.js"
54-
],
54+
"polyfills": "app/src/polyfills.ts",
5555
"tsConfig": "app/tsconfig.app.json",
5656
"styles": [
5757
"app/src/styles.css"
@@ -72,6 +72,12 @@
7272
"maximumError": "4kb"
7373
}
7474
],
75+
"fileReplacements": [
76+
{
77+
"replace": "app/src/environments/environment.ts",
78+
"with": "app/src/environments/environment.prod.ts"
79+
}
80+
],
7581
"outputHashing": "all"
7682
},
7783
"development": {
@@ -106,11 +112,10 @@
106112
"test": {
107113
"builder": "@angular-devkit/build-angular:karma",
108114
"options": {
109-
"polyfills": [
110-
"zone.js",
111-
"zone.js/testing"
112-
],
115+
"main": "app/src/test.ts",
116+
"polyfills": "app/src/polyfills.ts",
113117
"tsConfig": "app/tsconfig.spec.json",
118+
"karmaConfig": "app/karma.conf.js",
114119
"styles": [
115120
"app/src/styles.css"
116121
],
@@ -119,5 +124,6 @@
119124
}
120125
}
121126
}
122-
}
127+
},
128+
"defaultProject": "lib"
123129
}

app/.browserslistrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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

app/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/app'),
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+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file can be replaced during build by using the `fileReplacements` array.
2+
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
3+
// The list of file replacements can be found in `angular.json`.
4+
5+
export const environment = {
6+
production: false
7+
};
8+
9+
/*
10+
* For easier debugging in development mode, you can import the following file
11+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12+
*
13+
* This import should be commented out in production mode because it will have a negative impact
14+
* on performance if an error is thrown.
15+
*/
16+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

app/src/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
import { enableProdMode } from '@angular/core';
12
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
24
import { AppModule } from './app.module';
5+
import { environment } from './environments/environment';
6+
7+
if (environment.production) {
8+
enableProdMode();
9+
}
310

411
platformBrowserDynamic().bootstrapModule(AppModule)
512
.catch(err => console.error(err));

app/src/polyfills.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* This file includes polyfills needed by Angular and is loaded before the app.
3+
* You can add your own extra polyfills to this file.
4+
*
5+
* This file is divided into 2 sections:
6+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8+
* file.
9+
*
10+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11+
* automatically update themselves. This includes recent versions of Safari, Chrome (including
12+
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
13+
*
14+
* Learn more in https://angular.io/guide/browser-support
15+
*/
16+
17+
/***************************************************************************************************
18+
* BROWSER POLYFILLS
19+
*/
20+
21+
/**
22+
* By default, zone.js will patch all possible macroTask and DomEvents
23+
* user can disable parts of macroTask/DomEvents patch by setting following flags
24+
* because those flags need to be set before `zone.js` being loaded, and webpack
25+
* will put import in the top of bundle, so user need to create a separate file
26+
* in this directory (for example: zone-flags.ts), and put the following flags
27+
* into that file, and then add the following code before importing zone.js.
28+
* import './zone-flags';
29+
*
30+
* The flags allowed in zone-flags.ts are listed here.
31+
*
32+
* The following flags will work for all browsers.
33+
*
34+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
35+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
36+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
37+
*
38+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
39+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
40+
*
41+
* (window as any).__Zone_enable_cross_context_check = true;
42+
*
43+
*/
44+
45+
/***************************************************************************************************
46+
* Zone JS is required by default for Angular itself.
47+
*/
48+
import 'zone.js'; // Included with Angular CLI.
49+
50+
51+
/***************************************************************************************************
52+
* APPLICATION IMPORTS
53+
*/

app/src/test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'zone.js/testing';
4+
import { getTestBed } from '@angular/core/testing';
5+
import {
6+
BrowserDynamicTestingModule,
7+
platformBrowserDynamicTesting
8+
} from '@angular/platform-browser-dynamic/testing';
9+
10+
declare const require: {
11+
context(path: string, deep?: boolean, filter?: RegExp): {
12+
<T>(id: string): T;
13+
keys(): string[];
14+
};
15+
};
16+
17+
// First, initialize the Angular testing environment.
18+
getTestBed().initTestEnvironment(
19+
BrowserDynamicTestingModule,
20+
platformBrowserDynamicTesting(),
21+
);
22+
23+
// Then we find all the tests.
24+
const context = require.context('./', true, /\.spec\.ts$/);
25+
// And load the modules.
26+
context.keys().map(context);

0 commit comments

Comments
 (0)