Skip to content

Commit d6b82ff

Browse files
committed
build: use mjs files for ng-dev configuration
In preperation for ng-dev requiring mjs files for configuration, switch over our usage
1 parent c1a053f commit d6b82ff

File tree

12 files changed

+52
-55
lines changed

12 files changed

+52
-55
lines changed

.ng-dev/caretaker.mts renamed to .ng-dev/caretaker.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import {CaretakerConfig} from '@angular/ng-dev';
2-
3-
/** The configuration for `ng-dev caretaker` commands. */
4-
export const caretaker: CaretakerConfig = {
1+
/**
2+
* The configuration for `ng-dev caretaker` commands.
3+
*
4+
* @type { import("@angular/ng-dev").CaretakerConfig }
5+
*/
6+
export const caretaker = {
57
githubQueries: [
68
{
79
name: 'Merge Queue',

.ng-dev/commit-message.mts renamed to .ng-dev/commit-message.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {CommitMessageConfig} from '@angular/ng-dev';
2-
31
/**
42
* The configuration for `ng-dev commit-message` commands.
3+
*
4+
* @type { import("@angular/ng-dev").CommitMessageConfig }
55
*/
6-
export const commitMessage: CommitMessageConfig = {
6+
export const commitMessage = {
77
maxLineLength: Infinity,
88
minBodyLength: 0,
99
minBodyLengthTypeExcludes: ['docs'],
File renamed without changes.

.ng-dev/format.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Configuration for the `ng-dev format` command.
3+
*
4+
* @type { import("@angular/ng-dev").FormatConfig }
5+
*/
6+
export const format = {
7+
buildifier: true,
8+
prettier: {
9+
matchers: ['**/*.{js,ts,mts,mjs,json}'],
10+
},
11+
};

.ng-dev/format.mts

Lines changed: 0 additions & 12 deletions
This file was deleted.

.ng-dev/github.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Github configuration for the `ng-dev` command. This repository is used as
3+
* remote for the merge script and other utilities like `ng-dev pr rebase`.
4+
*
5+
* @type { import("@angular/ng-dev").GithubConfig }
6+
*/
7+
export const github = {
8+
owner: 'angular',
9+
name: 'components',
10+
mainBranchName: 'main',
11+
useNgDevAuthService: true,
12+
};

.ng-dev/github.mts

Lines changed: 0 additions & 12 deletions
This file was deleted.

.ng-dev/pull-request.mts renamed to .ng-dev/pull-request.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {PullRequestConfig} from '@angular/ng-dev';
2-
31
/**
4-
* Configuration for the pull request commands in `ng-dev`. This includes the
5-
* setup for the merge command.
2+
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
3+
* are respected by the merge script (e.g. the target labels).
4+
*
5+
* @type { import("@angular/ng-dev").PullRequestConfig }
66
*/
7-
export const pullRequest: PullRequestConfig = {
7+
export const pullRequest = {
88
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
99
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.
1010
// In the components repository, since we don't use fixup or squash commits, we can

.ng-dev/release.mts renamed to .ng-dev/release.mjs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* found in the LICENSE file at https://angular.dev/license
77
*/
88

9-
import semver from 'semver';
10-
import {ReleaseConfig} from '@angular/ng-dev';
11-
import {assertValidUpdateMigrationCollections} from '../tools/release-checks/check-migration-collections.mjs';
12-
import {assertValidNpmPackageOutput} from '../tools/release-checks/npm-package-output/index.mjs';
13-
149
/**
1510
* Packages that will be published as part of the project.
1611
*
@@ -30,8 +25,12 @@ export const releasePackages = [
3025
'material-date-fns-adapter',
3126
];
3227

33-
/** Configuration for the `ng-dev release` command. */
34-
export const release: ReleaseConfig = {
28+
/**
29+
* Configuration for the `ng-dev release` command.
30+
*
31+
* @type { import("@angular/ng-dev").ReleaseConfig }
32+
*/
33+
export const release = {
3534
releaseNotes: {
3635
useReleaseTitle: true,
3736
groupOrder: releasePackages,
@@ -58,6 +57,13 @@ export const release: ReleaseConfig = {
5857
return performNpmReleaseBuild();
5958
},
6059
prereleaseCheck: async (newVersionStr, builtPackagesWithInfo) => {
60+
const semver = await import('semver');
61+
const assertValidUpdateMigrationCollections = await import(
62+
'../tools/release-checks/check-migration-collections.mjs'
63+
);
64+
const assertValidNpmPackageOutput = await import(
65+
'../tools/release-checks/npm-package-output/index.mjs'
66+
);
6167
const newVersion = new semver.SemVer(newVersionStr);
6268

6369
await assertValidUpdateMigrationCollections(newVersion);

.ng-dev/tsconfig.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)