Skip to content

Commit

Permalink
fix(angular): updated to Angular 16
Browse files Browse the repository at this point in the history
  • Loading branch information
JBBianchi committed Dec 15, 2023
1 parent 2d4599a commit d7ff134
Show file tree
Hide file tree
Showing 11 changed files with 2,095 additions and 1,952 deletions.
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,25 @@
},
"pnpm": {
"overrides": {
"@angular/animations": "^15.0.0",
"@angular/cdk": "^15.0.0",
"@angular/common": "^15.0.0",
"@angular/core": "^15.0.0",
"@angular/forms": "^15.0.0",
"@angular/material": "^15.0.0",
"@angular/platform-browser": "^15.0.0",
"@angular/router": "^15.0.0",
"@angular-devkit/build-angular": "~15.2.10",
"@angular-eslint/eslint-plugin": "^15.0.0",
"@angular-eslint/eslint-plugin-template": "^15.0.0",
"@angular-eslint/schematics": "^15.0.0",
"@angular-eslint/template-parser": "^15.0.0",
"@angular/compiler": "^15.0.0",
"@angular/compiler-cli": "^15.0.0",
"@angular/platform-browser-dynamic": "^15.0.0",
"@ngtools/webpack": "^15.0.0",
"ng-packagr": "^15.0.0"
"@angular/animations": "^16.0.0",
"@angular/cdk": "^16.0.0",
"@angular/common": "^16.0.0",
"@angular/core": "^16.0.0",
"@angular/forms": "^16.0.0",
"@angular/material": "^16.0.0",
"@angular/platform-browser": "^16.0.0",
"@angular/router": "^16.0.0",
"@angular-devkit/build-angular": "^16.0.0",
"@angular-eslint/eslint-plugin": "^16.0.0",
"@angular-eslint/eslint-plugin-template": "^16.0.0",
"@angular-eslint/schematics": "^16.0.0",
"@angular-eslint/template-parser": "^16.0.0",
"@angular/compiler": "^16.0.0",
"@angular/compiler-cli": "^16.0.0",
"@angular/platform-browser-dynamic": "^16.0.0",
"@ngtools/webpack": "^16.0.0",
"ng-packagr": "^16.0.0",
"zone.js": "^0.13.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/angular-material/example/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import 'core-js/es7/reflect';
import 'core-js/es/reflect'
import 'zone.js/dist/zone';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

Expand Down
8 changes: 3 additions & 5 deletions packages/angular-material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"typings": "./lib/esm/index.d.ts",
"scripts": {
"build": "ngc && ngc -p tsconfig.cjs.json",
"build:examples-app": "ngc -p tsconfig.example.json && rollup -c rollup.example.config.js",
"build:examples-app": "ngc -p tsconfig.example.json && rollup -c rollup.example.config.js --bundleConfigAsCjs",
"dev": "pnpm run build:examples-app && npx http-server ./example/dist/ -c-1 -o",
"clean": "rimraf lib coverage dist .nyc_output 2> /dev/null",
"lint": "eslint .",
Expand Down Expand Up @@ -103,7 +103,7 @@
"@jsonforms/examples": "workspace:*",
"@ngtools/webpack": "^15.0.0 || ^16.0.0 || ^17.0.0",
"@rollup/plugin-commonjs": "^23.0.3",
"@rollup/plugin-json": "^5.0.2",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@types/jasmine": "~3.8.0",
Expand Down Expand Up @@ -134,12 +134,10 @@
"prettier": "^2.8.4",
"protractor": "^7.0.0",
"rimraf": "^3.0.2",
"rollup": "^2.78.0",
"rollup-plugin-cleanup": "^3.2.1",
"rollup": "^3.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-import-css": "^3.3.1",
"rollup-plugin-typescript2": "^0.34.1",
"rollup-plugin-visualizer": "^5.4.1",
"rxjs": "^6.6.0",
"ts-loader": "^6.2.1",
"tslib": "^2.5.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/angular-material/rollup.example.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const config = {
format: 'iife',
sourcemap: true,
},
// Disable treeshaking when generating bundles
// see: https://github.com/angular/angular/pull/32069
treeshake: false,
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ import { map, startWith } from 'rxjs/operators';
* <pre><code>
* ...
* imports: [JsonFormsAngularMaterialModule, MatAutocompleteModule],
* declarations: [AutocompleteControlRenderer],
* entryComponents: [AutocompleteControlRenderer]
* declarations: [AutocompleteControlRenderer]
* ...
* </code></pre>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import {
JsonFormsModule,
JsonFormsOutlet,
} from '@jsonforms/angular';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import {
CategorizationTabLayoutRenderer,
TextControlRenderer,
Expand Down Expand Up @@ -83,13 +82,7 @@ describe('Categorization tab layout', () => {
ReactiveFormsModule,
],
providers: [JsonFormsAngularService],
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
entryComponents: [TextControlRenderer],
},
})
.compileComponents();
}).compileComponents();

fixture = TestBed.createComponent(CategorizationTabLayoutRenderer);
component = fixture.componentInstance;
Expand Down
9 changes: 1 addition & 8 deletions packages/angular-material/test/master-detail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatListItem, MatListModule } from '@angular/material/list';
Expand Down Expand Up @@ -117,13 +116,7 @@ describe('Master detail', () => {
MatTooltipModule,
],
providers: [JsonFormsAngularService],
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
entryComponents: [UnknownRenderer],
},
})
.compileComponents();
}).compileComponents();

fixture = TestBed.createComponent(MasterListComponent);
component = fixture.componentInstance;
Expand Down
14 changes: 1 addition & 13 deletions packages/angular-material/test/object-control.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { CommonModule } from '@angular/common';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ReactiveFormsModule } from '@angular/forms';
Expand Down Expand Up @@ -111,18 +110,7 @@ describe('Object Control', () => {
ReactiveFormsModule,
],
providers: [JsonFormsAngularService],
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
entryComponents: [
TextControlRenderer,
VerticalLayoutRenderer,
GroupLayoutRenderer,
ObjectControlRenderer,
],
},
})
.compileComponents();
}).compileComponents();

fixture = TestBed.createComponent(ObjectControlRenderer);
component = fixture.componentInstance;
Expand Down
9 changes: 1 addition & 8 deletions packages/angular-material/test/table-control.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MatIconModule } from '@angular/material/icon';
import { MatTableModule } from '@angular/material/table';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { JsonFormsAngularService, JsonFormsModule } from '@jsonforms/angular';
import { ControlElement } from '@jsonforms/core';
Expand Down Expand Up @@ -154,13 +153,7 @@ describe('Table', () => {
MatTooltipModule,
],
providers: [JsonFormsAngularService],
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
entryComponents: [TextControlRenderer],
},
})
.compileComponents();
}).compileComponents();

fixture = TestBed.createComponent(TableRenderer);
component = fixture.componentInstance;
Expand Down
9 changes: 1 addition & 8 deletions packages/angular-test/src/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
JsonFormsOutlet,
UnknownRenderer,
} from '@jsonforms/angular';
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';

export const beforeEachLayoutTest = <LAYOUT>(
Expand All @@ -38,12 +37,6 @@ export const beforeEachLayoutTest = <LAYOUT>(
declarations: [Renderer, UnknownRenderer, JsonFormsOutlet, ...declarations],
imports,
providers: [JsonFormsAngularService, ...providers],
})
.overrideModule(BrowserDynamicTestingModule, {
set: {
entryComponents: [UnknownRenderer],
},
})
.compileComponents();
}).compileComponents();
return TestBed.createComponent(Renderer);
};
Loading

0 comments on commit d7ff134

Please sign in to comment.