Skip to content

Commit

Permalink
feat(core): support TypeScript 5.7
Browse files Browse the repository at this point in the history
Updates the repo to allow for TypeScript 5.7 to be used.
  • Loading branch information
crisbeto committed Nov 25, 2024
1 parent 901fd1c commit b78c707
Show file tree
Hide file tree
Showing 15 changed files with 857 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {By} from '@angular/platform-browser';
describe('ApiItemsSection', () => {
let component: ApiItemsSection;
let fixture: ComponentFixture<ApiItemsSection>;
let apiReferenceManagerSpy: jasmine.SpyObj<ApiReferenceManager>;

const fakeGroup: ApiItemsGroup = {
title: 'Group',
Expand All @@ -41,10 +40,7 @@ describe('ApiItemsSection', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ApiItemsSection],
providers: [
provideRouter([]),
{provide: ApiReferenceManager, useValue: apiReferenceManagerSpy},
],
providers: [provideRouter([])],
});
fixture = TestBed.createComponent(ApiItemsSection);
component = fixture.componentInstance;
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion goldens/public-api/common/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const DATE_PIPE_DEFAULT_TIMEZONE: InjectionToken<string>;

// @public
export class DatePipe implements PipeTransform {
constructor(locale: string, defaultTimezone?: (string | null) | undefined, defaultOptions?: (DatePipeConfig | null) | undefined);
constructor(locale: string, defaultTimezone?: string | null | undefined, defaultOptions?: (DatePipeConfig | null) | undefined);
// (undocumented)
transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null;
// (undocumented)
Expand Down
9 changes: 9 additions & 0 deletions integration/typings_test_ts57/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("//integration:index.bzl", "ng_integration_test")

ng_integration_test(
name = "test",
# Special case for `typings_test_ts57` test as we want to pin
# `typescript` at version 5.7.x for that test and not link to the
# root @npm//typescript package.
pinned_npm_packages = ["typescript"],
)
67 changes: 67 additions & 0 deletions integration/typings_test_ts57/include-all.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

import * as animations from '@angular/animations';
import * as animationsBrowser from '@angular/animations/browser';
import * as animationsBrowserTesting from '@angular/animations/browser/testing';
import * as common from '@angular/common';
import * as commonHttp from '@angular/common/http';
import * as commonTesting from '@angular/common/testing';
import * as commonHttpTesting from '@angular/common/http/testing';
import * as compiler from '@angular/compiler';
import * as core from '@angular/core';
import * as coreTesting from '@angular/core/testing';
import * as elements from '@angular/elements';
import * as forms from '@angular/forms';
import * as localize from '@angular/localize';
import * as platformBrowser from '@angular/platform-browser';
import * as platformBrowserDynamic from '@angular/platform-browser-dynamic';
import * as platformBrowserDynamicTesting from '@angular/platform-browser-dynamic/testing';
import * as platformBrowserAnimations from '@angular/platform-browser/animations';
import * as platformBrowserTesting from '@angular/platform-browser/testing';
import * as platformServer from '@angular/platform-server';
import * as platformServerInit from '@angular/platform-server/init';
import * as platformServerTesting from '@angular/platform-server/testing';
import * as router from '@angular/router';
import * as routerTesting from '@angular/router/testing';
import * as routerUpgrade from '@angular/router/upgrade';
import * as serviceWorker from '@angular/service-worker';
import * as upgrade from '@angular/upgrade';
import * as upgradeStatic from '@angular/upgrade/static';
import * as upgradeTesting from '@angular/upgrade/static/testing';

export default {
animations,
animationsBrowser,
animationsBrowserTesting,
common,
commonTesting,
commonHttp,
commonHttpTesting,
compiler,
core,
coreTesting,
elements,
forms,
localize,
platformBrowser,
platformBrowserTesting,
platformBrowserDynamic,
platformBrowserDynamicTesting,
platformBrowserAnimations,
platformServer,
platformServerInit,
platformServerTesting,
router,
routerTesting,
routerUpgrade,
serviceWorker,
upgrade,
upgradeStatic,
upgradeTesting,
};
29 changes: 29 additions & 0 deletions integration/typings_test_ts57/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "angular-integration",
"description": "Assert that users with TypeScript 5.7 can type-check an Angular application",
"version": "0.0.0",
"license": "MIT",
"dependencies": {
"@angular/animations": "file:../../dist/packages-dist/animations",
"@angular/common": "file:../../dist/packages-dist/common",
"@angular/compiler": "file:../../dist/packages-dist/compiler",
"@angular/compiler-cli": "file:../../dist/packages-dist/compiler-cli",
"@angular/core": "file:../../dist/packages-dist/core",
"@angular/elements": "file:../../dist/packages-dist/elements",
"@angular/forms": "file:../../dist/packages-dist/forms",
"@angular/localize": "file:../../dist/packages-dist/localize",
"@angular/platform-browser": "file:../../dist/packages-dist/platform-browser",
"@angular/platform-browser-dynamic": "file:../../dist/packages-dist/platform-browser-dynamic",
"@angular/platform-server": "file:../../dist/packages-dist/platform-server",
"@angular/router": "file:../../dist/packages-dist/router",
"@angular/service-worker": "file:../../dist/packages-dist/service-worker",
"@angular/upgrade": "file:../../dist/packages-dist/upgrade",
"@types/jasmine": "file:../../node_modules/@types/jasmine",
"rxjs": "file:../../node_modules/rxjs",
"typescript": "5.7.2",
"zone.js": "0.14.10"
},
"scripts": {
"test": "tsc"
}
}
26 changes: 26 additions & 0 deletions integration/typings_test_ts57/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./dist/out-tsc",
"rootDir": ".",
"target": "ES2020",
"lib": [
"es5",
"dom",
"es2015.collection",
"es2015.iterable",
"es2015.promise"
],
"types": [],
},
"files": [
"include-all.ts",
"node_modules/@types/jasmine/index.d.ts"
]
}
Loading

0 comments on commit b78c707

Please sign in to comment.