Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ng-dev/commit-message.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { packages } from '../scripts/packages.mjs';
import { packages } from '../scripts/packages.mts';

/**
* The configuration for `ng-dev commit-message` commands.
Expand Down
9 changes: 4 additions & 5 deletions .ng-dev/release.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import semver from 'semver';
import { releasePackages } from '../scripts/packages.mjs';
import { releasePackages } from '../scripts/packages.mts';

/**
* Configuration for the `ng-dev release` command.
Expand All @@ -12,14 +12,13 @@ export const release = {
buildPackages: async () => {
// The `performNpmReleaseBuild` function is loaded at runtime to avoid loading additional
// files and dependencies unless a build is required.
const { performNpmReleaseBuild } = await import('../scripts/build-packages-dist.mjs');
const { performNpmReleaseBuild } = await import('../scripts/build-packages-dist.mts');
return performNpmReleaseBuild();
},
prereleaseCheck: async (newVersionStr) => {
const newVersion = new semver.SemVer(newVersionStr);
const { assertValidDependencyRanges } = await import(
'../scripts/release-checks/dependency-ranges/index.mjs'
);
const { assertValidDependencyRanges } =
await import('../scripts/release-checks/dependency-ranges/index.mts');

await assertValidDependencyRanges(newVersion, releasePackages);
},
Expand Down
3 changes: 3 additions & 0 deletions .ng-dev/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"compilerOptions": {
"resolveJsonModule": true,
"allowJs": true,
"rewriteRelativeImportExtensions": true,
"erasableSyntaxOnly": true,
"verbatimModuleSyntax": true,
"module": "Node16",
"moduleResolution": "Node16",
"checkJs": true,
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Angular DevKit"
],
"scripts": {
"admin": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/devkit-admin.mjs",
"admin": "node --no-warnings=ExperimentalWarning --experimental-transform-types ./scripts/devkit-admin.mts",
"bazel": "bazelisk",
"test": "bazel test //packages/...",
"build": "pnpm -s admin build",
Expand All @@ -20,10 +20,9 @@
"templates": "pnpm -s admin templates",
"validate": "pnpm -s admin validate",
"postinstall": "husky",
"ng-dev": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs",
"ts-circular-deps": "pnpm -s ng-dev ts-circular-deps --config ./scripts/circular-deps-test.conf.mjs",
"ts-circular-deps": "ng-dev ts-circular-deps --config ./scripts/circular-deps-test.conf.mjs",
"check-tooling-setup": "tsc --project .ng-dev/tsconfig.json",
"diff-release-package": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/diff-release-package.mts"
"diff-release-package": "node scripts/diff-release-package.mts"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-packages-dist.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* distribution folder within the project.
*/

import { BuiltPackage } from '@angular/ng-dev';
import type { BuiltPackage } from '@angular/ng-dev';
import { execSync } from 'node:child_process';
import {
chmodSync,
Expand Down
2 changes: 1 addition & 1 deletion scripts/circular-deps-test.conf.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { statSync } from 'node:fs';
import { join } from 'node:path';

import { packages } from './packages.mjs';
import { packages } from './packages.mts';

export const baseDir = '../';
export const goldenFile = '../goldens/circular-deps/packages.json';
Expand Down
4 changes: 2 additions & 2 deletions scripts/create.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import * as child_process from 'node:child_process';
import { copyFile, readFile, rm, writeFile } from 'node:fs/promises';
import * as path from 'node:path';
import { pathToFileURL } from 'node:url';
import build from './build.mjs';
import { packages } from './packages.mjs';
import build from './build.mts';
import { packages } from './packages.mts';

export interface CreateOptions extends Record<string, unknown> {
_: string[];
Expand Down
2 changes: 1 addition & 1 deletion scripts/devkit-admin.mts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ console.error = function (...args) {
};

try {
const script = await import(`./${scriptName}.mjs`);
const script = await import(`./${scriptName}.mts`);
const exitCode = await script.default(args, cwd);
process.exitCode = typeof exitCode === 'number' ? exitCode : 0;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion scripts/json-help.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { spawnSync } from 'node:child_process';
import { promises as fs } from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import create from './create.mjs';
import create from './create.mts';

const __dirname = import.meta.dirname;

Expand Down
4 changes: 2 additions & 2 deletions scripts/release-checks/dependency-ranges/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import { Log, ReleasePrecheckError, bold } from '@angular/ng-dev';
import semver from 'semver';
import { checkSchematicsAngularLatestVersion } from './latest-versions-check.mjs';
import { PackageJson, checkPeerDependencies } from './peer-deps-check.mjs';
import { checkSchematicsAngularLatestVersion } from './latest-versions-check.mts';
import { type PackageJson, checkPeerDependencies } from './peer-deps-check.mts';

/** Environment variable that can be used to skip this pre-check. */
const skipEnvVar = 'SKIP_DEPENDENCY_RANGE_PRECHECK';
Expand Down
4 changes: 2 additions & 2 deletions scripts/snapshots.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import build from './build.mjs';
import jsonHelp, { createTemporaryProject } from './json-help.mjs';
import { PackageInfo, packages } from './packages.mjs';
import jsonHelp, { createTemporaryProject } from './json-help.mts';
import { type PackageInfo, packages } from './packages.mts';

const __dirname = import.meta.dirname;

Expand Down
2 changes: 1 addition & 1 deletion scripts/templates.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import lodash from 'lodash';
import { readFile, writeFile } from 'node:fs/promises';
import * as path from 'node:path';
import { releasePackages } from './packages.mjs';
import { releasePackages } from './packages.mts';

const __dirname = import.meta.dirname;

Expand Down
3 changes: 3 additions & 0 deletions scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
"erasableSyntaxOnly": true,
"verbatimModuleSyntax": true,
"rewriteRelativeImportExtensions": true,
"noEmit": true,
"types": []
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/validate-user-analytics.mts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
EventCustomDimension,
EventCustomMetric,
UserCustomDimension,
} from '../packages/angular/cli/src/analytics/analytics-parameters.mjs';
} from '../packages/angular/cli/src/analytics/analytics-parameters.ts';

const __dirname = import.meta.dirname;
const userAnalyticsTable = lodash.template(
Expand Down Expand Up @@ -82,7 +82,7 @@ async function _checkDimensions(dimensionsTable: string) {
};

// Find all the schemas
const { packages } = await import('./packages.mjs');
const { packages } = await import('./packages.mts');
const packagesPaths = packages.map(({ root }) => root);
for (const packagePath of packagesPaths) {
const schemasPaths = await glob('**/schema.json', { cwd: packagePath });
Expand Down
6 changes: 3 additions & 3 deletions scripts/validate.mts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import { execSync } from 'node:child_process';
import templates from './templates.mjs';
import validateUserAnalytics from './validate-user-analytics.mjs';
import templates from './templates.mts';
import validateUserAnalytics from './validate-user-analytics.mts';

export default async function (options: { verbose: boolean }) {
let error = false;
Expand All @@ -24,7 +24,7 @@ export default async function (options: { verbose: boolean }) {
}

console.info('Running templates validation...');
await templates({});
await templates();
if (execSync(`git status --porcelain`).toString()) {
console.error(
'Running templates updated files... Please run "devkit-admin templates" before submitting a PR.',
Expand Down