Skip to content

Commit 8756c8a

Browse files
josephperrottAndrewKushnir
authored andcommitted
build: migrate documentation site deploy script to use ts_project (angular#61102)
Migrate to the new toolchain PR Close angular#61102
1 parent c39e799 commit 8756c8a

13 files changed

Lines changed: 2549 additions & 2552 deletions

File tree

‎.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-203833057
5-
package.json=1896764724
6-
pnpm-lock.yaml=506935828
5+
package.json=-985513713
6+
pnpm-lock.yaml=-1773194256
77
pnpm-workspace.yaml=1711114604
8-
yarn.lock=1439972262
8+
yarn.lock=1673166009
Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
1+
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
12
load("//tools:defaults.bzl", "esbuild_checked_in")
3+
load("//tools:defaults2.bzl", "ts_project")
4+
5+
package(default_visibility = ["//.github/actions/deploy-docs-site:__subpackages__"])
26

37
exports_files([
48
"tsconfig.json",
59
])
610

711
esbuild_checked_in(
812
name = "main",
9-
entry_point = "//.github/actions/deploy-docs-site/lib:main.ts",
13+
entry_point = ":lib/main.mts",
1014
external = [
1115
"undici",
1216
],
1317
platform = "node",
1418
target = "node14",
1519
deps = [
16-
"//.github/actions/deploy-docs-site/lib",
20+
":lib",
21+
],
22+
)
23+
24+
rules_js_tsconfig(
25+
name = "tsconfig",
26+
src = "tsconfig.json",
27+
)
28+
29+
ts_project(
30+
name = "lib",
31+
srcs = glob(["lib/*.mts"]),
32+
tsconfig = ":tsconfig",
33+
deps = [
34+
"//:node_modules/@actions/core",
35+
"//:node_modules/@actions/github",
36+
"//:node_modules/@angular/ng-dev",
37+
"//:node_modules/@types/node",
38+
"//:node_modules/@types/tmp",
39+
"//:node_modules/tmp",
1740
],
1841
)

‎.github/actions/deploy-docs-site/lib/BUILD.bazel‎

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

.github/actions/deploy-docs-site/lib/credential.ts renamed to .github/actions/deploy-docs-site/lib/credential.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {fileSync} from 'tmp';
2-
import {writeSync} from 'fs';
2+
import {writeSync} from 'node:fs';
33
import {getInput, setSecret} from '@actions/core';
44

55
let credentialFilePath: undefined | string;

.github/actions/deploy-docs-site/lib/deploy.ts renamed to .github/actions/deploy-docs-site/lib/deploy.mts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {cp, mkdtemp, readFile, rm, writeFile} from 'fs/promises';
2-
import {Deployment} from './deployments';
3-
import {join} from 'path';
1+
import {cp, mkdtemp, readFile, rm, writeFile} from 'node:fs/promises';
2+
import {Deployment} from './deployments.mjs';
3+
import {join} from 'node:path';
44

5-
import {tmpdir} from 'os';
6-
import {spawnSync} from 'child_process';
7-
import {getCredentialFilePath} from './credential';
5+
import {tmpdir} from 'node:os';
6+
import {spawnSync} from 'node:child_process';
7+
import {getCredentialFilePath} from './credential.mjs';
88

99
export async function deployToFirebase(
1010
deployment: Deployment,
File renamed without changes.

.github/actions/deploy-docs-site/lib/main.ts renamed to .github/actions/deploy-docs-site/lib/main.mts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import {getInput, setFailed} from '@actions/core';
22
import {context} from '@actions/github';
3-
import {deployToFirebase, setupRedirect} from './deploy';
4-
import {getDeployments} from './deployments';
3+
import {deployToFirebase, setupRedirect} from './deploy.mjs';
4+
import {getDeployments} from './deployments.mjs';
55
import {AuthenticatedGitClient, GithubConfig, setConfig} from '@angular/ng-dev';
6-
import {githubReleaseTrainReadToken} from './credential';
6+
import {githubReleaseTrainReadToken} from './credential.mjs';
77

88
const refMatcher = /refs\/heads\/(.*)/;
99

1010
async function deployDocs() {
1111
setConfig({
12-
github: <GithubConfig>{
12+
github: {
1313
mainBranchName: 'main',
1414
name: 'angular',
1515
owner: 'angular',
16-
},
16+
} as GithubConfig,
1717
});
1818

1919
AuthenticatedGitClient.configure(githubReleaseTrainReadToken);

‎.github/actions/deploy-docs-site/package.json‎

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

‎.github/actions/deploy-docs-site/tsconfig.json‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
"lib": ["es2021", "dom"],
66
"experimentalDecorators": true,
77
"strict": true,
8-
"outDir": "../../../dist/tsc-non-bazel-out",
98
"skipLibCheck": true,
109
"noImplicitOverride": true,
11-
// TODO(ESM): Remove this when Bazel also uses the Node resolution.
1210
"esModuleInterop": true,
1311
"noImplicitReturns": true,
14-
"jsx": "react",
15-
"jsxFactory": "h",
16-
"jsxFragmentFactory": "Fragment"
17-
},
18-
"exclude": []
19-
}
12+
"declaration": true,
13+
"sourceMap": true
14+
15+
}
16+
}

‎WORKSPACE‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ setup_dependencies_2()
258258

259259
git_repository(
260260
name = "rules_angular",
261-
commit = "42d4791c1c2cd8b21deaf960443dd883033fdedf",
261+
commit = "f47fe935fecac02f02fe1337274207f00146a765",
262262
remote = "https://github.com/devversion/rules_angular.git",
263263
)
264264

@@ -273,6 +273,6 @@ rules_angular_step2()
273273
load("@rules_angular//setup:step_3.bzl", "rules_angular_step3")
274274

275275
rules_angular_step3(
276-
angular_compiler_cli = "//:node_modules/@angular/compiler-cli",
276+
angular_compiler_cli = "@angular//packages/compiler-cli",
277277
typescript = "//:node_modules/typescript",
278278
)

0 commit comments

Comments
 (0)