Skip to content

Commit 1faf826

Browse files
committed
refine formatting of typescript code
1 parent bd93afa commit 1faf826

12 files changed

+509
-506
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ indent_style = space
1010
[{*.json,*.jsonc,*.yml,*.yaml,*.yml.jinja}]
1111
indent_size = 2
1212

13+
[{*.js,*.ts}]
14+
indent_size = 2
15+
1316
[*.jsonnet]
1417
indent_size = 2
1518

workflows/docs.ts

+129-129
Original file line numberDiff line numberDiff line change
@@ -4,149 +4,149 @@ import { checkoutStep } from "./lib/checkout.ts";
44
import { script } from "./lib/script.ts";
55

66
const build: WorkflowJob = {
7-
name: "Build documentation",
8-
"runs-on": "ubuntu-latest",
9-
steps: [
10-
checkoutStep(),
11-
{
12-
"uses": "prefix-dev/[email protected]",
13-
"with": {
14-
"pixi-version": "latest",
15-
"activate-environment": true,
16-
"environments": "doc",
17-
"cache-write": false,
18-
},
19-
},
20-
{
21-
"id": "docs",
22-
"name": "📚 Build documentation site",
23-
"run": script("just docs"),
24-
},
25-
{
26-
"name": "📤 Package documentation site",
27-
"uses": "actions/upload-artifact@v4",
28-
"with": {
29-
"name": "lenskit-docs",
30-
"path": "build/doc",
31-
},
32-
},
33-
],
7+
name: "Build documentation",
8+
"runs-on": "ubuntu-latest",
9+
steps: [
10+
checkoutStep(),
11+
{
12+
uses: "prefix-dev/[email protected]",
13+
with: {
14+
"pixi-version": "latest",
15+
"activate-environment": true,
16+
environments: "doc",
17+
"cache-write": false,
18+
},
19+
},
20+
{
21+
id: "docs",
22+
name: "📚 Build documentation site",
23+
run: script("just docs"),
24+
},
25+
{
26+
name: "📤 Package documentation site",
27+
uses: "actions/upload-artifact@v4",
28+
with: {
29+
name: "lenskit-docs",
30+
path: "build/doc",
31+
},
32+
},
33+
],
3434
};
3535

3636
const archive: WorkflowJob = {
37-
name: "Archive documentation",
38-
"runs-on": "ubuntu-latest",
39-
needs: ["build"],
40-
if: "github.event_name == 'push' || github.event_name == 'release'",
41-
environment: "docs",
42-
steps: [
43-
checkoutStep(1),
44-
{
45-
name: "Check out doc site",
46-
uses: "actions/checkout@v4",
47-
with: {
48-
repository: "lenskit/lenskit-docs",
49-
"ssh-key": "${{ secrets.DOC_DEPLOY_KEY }}",
50-
path: "doc-site",
51-
ref: "version/latest",
52-
},
53-
},
54-
{
55-
name: "📥 Fetch documentation package",
56-
uses: "actions/download-artifact@v4",
57-
with: {
58-
name: "lenskit-docs",
59-
path: "build/doc",
60-
},
61-
},
62-
{
63-
name: "🛻 Copy documentation content",
64-
run: script(
65-
"rsync -av --delete --exclude=.git/ --exclude=.buildinfo --exclude=.doctrees build/doc/ doc-site/",
66-
"cd doc-site",
67-
"git config user.name 'LensKit Doc Bot'",
68-
"git config user.email '[email protected]'",
69-
"git add .",
70-
"git commit -m 'rebuild documentation'",
71-
),
72-
},
73-
{
74-
name: "🛫 Push documentation",
75-
run: "cd doc-site && git push",
76-
},
77-
],
37+
name: "Archive documentation",
38+
"runs-on": "ubuntu-latest",
39+
needs: ["build"],
40+
if: "github.event_name == 'push' || github.event_name == 'release'",
41+
environment: "docs",
42+
steps: [
43+
checkoutStep(1),
44+
{
45+
name: "Check out doc site",
46+
uses: "actions/checkout@v4",
47+
with: {
48+
repository: "lenskit/lenskit-docs",
49+
"ssh-key": "${{ secrets.DOC_DEPLOY_KEY }}",
50+
path: "doc-site",
51+
ref: "version/latest",
52+
},
53+
},
54+
{
55+
name: "📥 Fetch documentation package",
56+
uses: "actions/download-artifact@v4",
57+
with: {
58+
name: "lenskit-docs",
59+
path: "build/doc",
60+
},
61+
},
62+
{
63+
name: "🛻 Copy documentation content",
64+
run: script(
65+
"rsync -av --delete --exclude=.git/ --exclude=.buildinfo --exclude=.doctrees build/doc/ doc-site/",
66+
"cd doc-site",
67+
"git config user.name 'LensKit Doc Bot'",
68+
"git config user.email '[email protected]'",
69+
"git add .",
70+
"git commit -m 'rebuild documentation'",
71+
),
72+
},
73+
{
74+
name: "🛫 Push documentation",
75+
run: "cd doc-site && git push",
76+
},
77+
],
7878
};
7979

8080
const publish: WorkflowJob = {
81-
name: "Publish documentation",
82-
"runs-on": "ubuntu-latest",
83-
needs: ["archive"],
84-
if: "github.event_name == 'push' || github.event_name == 'release'",
85-
environment: {
86-
name: "github-pages",
87-
url: "${{ steps.deployment.outputs.page_url }}",
81+
name: "Publish documentation",
82+
"runs-on": "ubuntu-latest",
83+
needs: ["archive"],
84+
if: "github.event_name == 'push' || github.event_name == 'release'",
85+
environment: {
86+
name: "github-pages",
87+
url: "${{ steps.deployment.outputs.page_url }}",
88+
},
89+
steps: [
90+
{
91+
name: "Check out doc site",
92+
uses: "actions/checkout@v4",
93+
with: {
94+
repository: "lenskit/lenskit-docs",
95+
ref: "main",
96+
"fetch-depth": 0,
97+
},
8898
},
89-
steps: [
90-
{
91-
name: "Check out doc site",
92-
uses: "actions/checkout@v4",
93-
with: {
94-
repository: "lenskit/lenskit-docs",
95-
ref: "main",
96-
"fetch-depth": 0,
97-
},
98-
},
99-
{
100-
name: "🌳 Fix local git branches",
101-
run: script(`
99+
{
100+
name: "🌳 Fix local git branches",
101+
run: script(`
102102
for branch in $(git branch -r --list 'origin/version/*'); do
103103
git branch -t \${branch##origin/} $branch
104104
done
105105
git branch -a
106106
`),
107-
},
108-
{
109-
name: "🛸 Set up Deno",
110-
uses: "denoland/setup-deno@v1",
111-
with: { "deno-version": "~1.44" },
112-
},
113-
{ name: "🧛🏼 Set up Just", uses: "extractions/setup-just@v2" },
114-
{ name: "Build site content", run: "just build" },
115-
{ name: "Setup Pages", uses: "actions/configure-pages@v5" },
116-
{
117-
name: "📦 Upload artifact",
118-
uses: "actions/upload-pages-artifact@v3",
119-
with: { path: "site" },
120-
},
121-
{
122-
name: "🕸️ Deploy to GitHub Pages",
123-
id: "deployment",
124-
uses: "actions/deploy-pages@v4",
125-
},
126-
],
127-
};
128-
129-
export const workflow: Workflow = {
130-
name: "Documentation",
131-
on: {
132-
push: {
133-
branches: ["main"],
134-
},
135-
pull_request: {},
136-
workflow_dispatch: {},
137107
},
138-
concurrency: {
139-
group: "doc-${{github.ref}}",
140-
"cancel-in-progress": true,
108+
{
109+
name: "🛸 Set up Deno",
110+
uses: "denoland/setup-deno@v1",
111+
with: { "deno-version": "~1.44" },
112+
},
113+
{ name: "🧛🏼 Set up Just", uses: "extractions/setup-just@v2" },
114+
{ name: "Build site content", run: "just build" },
115+
{ name: "Setup Pages", uses: "actions/configure-pages@v5" },
116+
{
117+
name: "📦 Upload artifact",
118+
uses: "actions/upload-pages-artifact@v3",
119+
with: { path: "site" },
141120
},
142-
permissions: {
143-
contents: "read",
144-
pages: "write",
145-
"id-token": "write",
121+
{
122+
name: "🕸️ Deploy to GitHub Pages",
123+
id: "deployment",
124+
uses: "actions/deploy-pages@v4",
146125
},
147-
jobs: {
148-
build,
149-
archive,
150-
publish,
126+
],
127+
};
128+
129+
export const workflow: Workflow = {
130+
name: "Documentation",
131+
on: {
132+
push: {
133+
branches: ["main"],
151134
},
135+
pull_request: {},
136+
workflow_dispatch: {},
137+
},
138+
concurrency: {
139+
group: "doc-${{github.ref}}",
140+
"cancel-in-progress": true,
141+
},
142+
permissions: {
143+
contents: "read",
144+
pages: "write",
145+
"id-token": "write",
146+
},
147+
jobs: {
148+
build,
149+
archive,
150+
publish,
151+
},
152152
};

workflows/lib/checkout.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { WorkflowStep } from "@lenskit/typeline/github";
22

33
export function checkoutStep(depth: number = 0): WorkflowStep {
4-
return {
5-
"name": "🛒 Checkout",
6-
"uses": "actions/checkout@v4",
7-
"with": {"fetch-depth": depth},
8-
}
4+
return {
5+
name: "🛒 Checkout",
6+
uses: "actions/checkout@v4",
7+
with: { "fetch-depth": depth },
8+
};
99
}

0 commit comments

Comments
 (0)