Skip to content

Commit

Permalink
build: wire up ng-dev ts-node config loading (#46437)
Browse files Browse the repository at this point in the history
With the new ESM version of `ng-dev`, the TypeScript config loading
cannot happen automatically because `ts-node` cannot hook into the
Node ESM module resolution at runtime. To fix this `ng-dev` is now
loading a plain `.ng-dev/config.mjs` and the runtime just needs to be
configured accordingly, i.e. running `ng-dev` with `ts-node` so that
the ESM loader can be wired up before Node's runtime starts (using e.g.
`node --loader`).

PR Close #46437
  • Loading branch information
devversion authored and AndrewKushnir committed Jun 21, 2022
1 parent 6b82eb1 commit 7f137fc
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 18 deletions.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions .ng-dev/config.mts
@@ -0,0 +1,15 @@
import {caretaker} from './caretaker.mjs';
import {commitMessage} from './commit-message.mjs';
import {format} from './format.mjs';
import {github} from './github.mjs';
import {pullRequest} from './pull-request.mjs';
import {release} from './release.mjs';

export {
commitMessage,
format,
github,
pullRequest,
caretaker,
release,
};
15 changes: 0 additions & 15 deletions .ng-dev/config.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions .ng-dev/tsconfig.json
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"strict": true,
"target": "es2015",
"module": "commonjs",
"target": "es2020",
"module": "Node16",
"noEmit": true,
"skipLibCheck": true,
"types": []
},
}
}
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -24,6 +24,7 @@
"/ ": "",
"postinstall": "node scripts/webdriver-manager-update.js && node --preserve-symlinks --preserve-symlinks-main ./tools/postinstall-patches.js",
"prepare": "husky install",
"ng-dev": "ts-node --esm --project .ng-dev/tsconfig.json node_modules/@angular/dev-infra-private/ng-dev/bundles/cli.mjs",
"test": "bazelisk test",
"test:ci": "bazelisk test -- //... -//devtools/... -//aio/...",
"test-tsec": "bazelisk test //... --build_tag_filters=tsec --test_tag_filters=tsec",
Expand Down

0 comments on commit 7f137fc

Please sign in to comment.