diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2aaf0bb60513..0bfb3eca1583 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,6 @@ jobs: uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@95e3a0ede6dfa1aedd34b03918ad72b18f87e5ae - name: Install node modules run: pnpm install --frozen-lockfile - - name: Validate ng-dev config - run: pnpm ng-dev config validate - name: Checking package externals run: | bazel build //:package_externals diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 239d3143a533..5d093eab9329 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -22,8 +22,6 @@ jobs: uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@95e3a0ede6dfa1aedd34b03918ad72b18f87e5ae - name: Install node modules run: pnpm install --frozen-lockfile - - name: Validate ng-dev config - run: pnpm ng-dev config validate - name: Checking package externals run: | bazel build //:package_externals diff --git a/.ng-dev/caretaker.mjs b/.ng-dev/caretaker.mts similarity index 72% rename from .ng-dev/caretaker.mjs rename to .ng-dev/caretaker.mts index 6c0688e5a342..9e92c09245c6 100644 --- a/.ng-dev/caretaker.mjs +++ b/.ng-dev/caretaker.mts @@ -1,9 +1,7 @@ -/** - * The configuration for `ng-dev caretaker` commands. - * - * @type { import("@angular/ng-dev").CaretakerConfig } - */ -export const caretaker = { +import {CaretakerConfig} from '@angular/ng-dev'; + +/** The configuration for `ng-dev caretaker` commands. */ +export const caretaker: CaretakerConfig = { githubQueries: [ { name: 'Merge Queue', diff --git a/.ng-dev/commit-message.mjs b/.ng-dev/commit-message.mts similarity index 95% rename from .ng-dev/commit-message.mjs rename to .ng-dev/commit-message.mts index 2a22f1dda8d8..c868f0e0b1d4 100644 --- a/.ng-dev/commit-message.mjs +++ b/.ng-dev/commit-message.mts @@ -1,9 +1,9 @@ +import {CommitMessageConfig} from '@angular/ng-dev'; + /** * The configuration for `ng-dev commit-message` commands. - * - * @type { import("@angular/ng-dev").CommitMessageConfig } */ -export const commitMessage = { +export const commitMessage: CommitMessageConfig = { maxLineLength: Infinity, minBodyLength: 0, minBodyLengthTypeExcludes: ['docs'], diff --git a/.ng-dev/config.mjs b/.ng-dev/config.mts similarity index 100% rename from .ng-dev/config.mjs rename to .ng-dev/config.mts diff --git a/.ng-dev/format.mjs b/.ng-dev/format.mjs deleted file mode 100644 index 8df6ce8f99e6..000000000000 --- a/.ng-dev/format.mjs +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Configuration for the `ng-dev format` command. - * - * @type { import("@angular/ng-dev").FormatConfig } - */ -export const format = { - buildifier: true, - prettier: { - matchers: ['**/*.{js,ts,mts,mjs,json}'], - }, -}; diff --git a/.ng-dev/format.mts b/.ng-dev/format.mts new file mode 100644 index 000000000000..0e182edbe38f --- /dev/null +++ b/.ng-dev/format.mts @@ -0,0 +1,12 @@ +import {FormatConfig} from '@angular/ng-dev'; + +/** + * Configuration for the ng-dev format command. We currently only use the buildifier + * formatter that is responsible for formatting Bazel build and `.bzl` files. + */ +export const format: FormatConfig = { + buildifier: true, + prettier: { + matchers: ['**/*.{js,ts,mts,mjs,json}'], + }, +}; diff --git a/.ng-dev/github.mjs b/.ng-dev/github.mjs deleted file mode 100644 index b956dfdb8dfa..000000000000 --- a/.ng-dev/github.mjs +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Github configuration for the `ng-dev` command. This repository is used as - * remote for the merge script and other utilities like `ng-dev pr rebase`. - * - * @type { import("@angular/ng-dev").GithubConfig } - */ -export const github = { - owner: 'angular', - name: 'components', - mainBranchName: 'main', - useNgDevAuthService: true, -}; diff --git a/.ng-dev/github.mts b/.ng-dev/github.mts new file mode 100644 index 000000000000..382a66b0de32 --- /dev/null +++ b/.ng-dev/github.mts @@ -0,0 +1,12 @@ +import {GithubConfig} from '@angular/ng-dev'; + +/** + * Github configuration for the ng-dev command. This repository is + * uses as remote for the merge script. + */ +export const github: GithubConfig = { + owner: 'angular', + name: 'components', + mainBranchName: 'main', + useNgDevAuthService: true, +}; diff --git a/.ng-dev/pull-request.mjs b/.ng-dev/pull-request.mts similarity index 67% rename from .ng-dev/pull-request.mjs rename to .ng-dev/pull-request.mts index 434a3c1143b9..8beb04bb8326 100644 --- a/.ng-dev/pull-request.mjs +++ b/.ng-dev/pull-request.mts @@ -1,10 +1,10 @@ +import {PullRequestConfig} from '@angular/ng-dev'; + /** - * Configuration for the merge tool in `ng-dev`. This sets up the labels which - * are respected by the merge script (e.g. the target labels). - * - * @type { import("@angular/ng-dev").PullRequestConfig } + * Configuration for the pull request commands in `ng-dev`. This includes the + * setup for the merge command. */ -export const pullRequest = { +export const pullRequest: PullRequestConfig = { // By default, the merge script merges locally with `git cherry-pick` and autosquash. // This has the downside of pull requests showing up as `Closed` instead of `Merged`. // In the components repository, since we don't use fixup or squash commits, we can diff --git a/.ng-dev/release.mjs b/.ng-dev/release.mts similarity index 82% rename from .ng-dev/release.mjs rename to .ng-dev/release.mts index a19a992b77c8..86318b3c3a85 100644 --- a/.ng-dev/release.mjs +++ b/.ng-dev/release.mts @@ -6,6 +6,11 @@ * found in the LICENSE file at https://angular.dev/license */ +import semver from 'semver'; +import {ReleaseConfig} from '@angular/ng-dev'; +import {assertValidUpdateMigrationCollections} from '../tools/release-checks/check-migration-collections.mjs'; +import {assertValidNpmPackageOutput} from '../tools/release-checks/npm-package-output/index.mjs'; + /** * Packages that will be published as part of the project. * @@ -25,12 +30,8 @@ export const releasePackages = [ 'material-date-fns-adapter', ]; -/** - * Configuration for the `ng-dev release` command. - * - * @type { import("@angular/ng-dev").ReleaseConfig } - */ -export const release = { +/** Configuration for the `ng-dev release` command. */ +export const release: ReleaseConfig = { releaseNotes: { useReleaseTitle: true, groupOrder: releasePackages, @@ -57,13 +58,6 @@ export const release = { return performNpmReleaseBuild(); }, prereleaseCheck: async (newVersionStr, builtPackagesWithInfo) => { - const semver = await import('semver'); - const assertValidUpdateMigrationCollections = await import( - '../tools/release-checks/check-migration-collections.mjs' - ); - const assertValidNpmPackageOutput = await import( - '../tools/release-checks/npm-package-output/index.mjs' - ); const newVersion = new semver.SemVer(newVersionStr); await assertValidUpdateMigrationCollections(newVersion); diff --git a/.ng-dev/tsconfig.json b/.ng-dev/tsconfig.json new file mode 100644 index 000000000000..0ae4bf3f1fb1 --- /dev/null +++ b/.ng-dev/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2020", + "module": "Node16", + "esModuleInterop": true, + "noEmit": true, + "skipLibCheck": true, + "types": [] + } +} diff --git a/package.json b/package.json index 355ef803889d..b73445427b48 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "pnpm": "10.23.0" }, "scripts": { + "ng-dev": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs", "ng-dev:stamp": "pnpm -s ng-dev release build-env-stamp --additional-stamping-script=tools/bazel-additional-stamp.mjs", "build": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-packages-dist-main.mts", "build-docs-content": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/build-docs-content-main.mts", @@ -46,7 +47,7 @@ "integration-tests": "bazel test --test_tag_filters=-linker-integration-test --build_tests_only -- //integration/...", "test-linker-aot": "bazel test --partial_compilation --test_tag_filters=partial-compilation-integration,-firefox --build_tests_only -- //integration/... //src/...", "test-linker-jit": "bazel test --partial_compilation --test_tag_filters=partial-compilation-integration,-firefox --build_tests_only --//tools:force_partial_jit_compilation=True -- //integration/... //src/...", - "check-tooling-setup": "pnpm tsc --project tools/tsconfig.json --noEmit && pnpm tsc --project tools/adev-api-extraction/tsconfig.json --noEmit && pnpm tsc --project scripts/tsconfig.json --noEmit && pnpm tsc --project tools/release-checks/tsconfig.json --noEmit", + "check-tooling-setup": "pnpm tsc --project tools/tsconfig.json --noEmit && pnpm tsc --project tools/adev-api-extraction/tsconfig.json --noEmit && pnpm tsc --project scripts/tsconfig.json --noEmit && pnpm tsc --project .ng-dev/tsconfig.json --noEmit", "tsc": "node ./node_modules/typescript/bin/tsc", "ci-push-deploy-docs-app": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/docs-deploy/deploy-ci-push.mts", "ci-docs-monitor-test": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/docs-deploy/monitoring/ci-test.mts", diff --git a/tools/release-checks/tsconfig.json b/tools/release-checks/tsconfig.json deleted file mode 100644 index 2f10c52d6d80..000000000000 --- a/tools/release-checks/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "allowJs": true - } -} diff --git a/tools/tsconfig.json b/tools/tsconfig.json index a53e28ba631f..810d8d3a6e3f 100644 --- a/tools/tsconfig.json +++ b/tools/tsconfig.json @@ -12,5 +12,5 @@ "downlevelIteration": true, "types": ["node"] }, - "exclude": ["**/*.spec.ts", "**/*.spec.mts", "adev-api-extraction/**", "release-checks/**"] + "exclude": ["**/*.spec.ts", "**/*.spec.mts", "adev-api-extraction/**"] }