Skip to content

Commit e24cae9

Browse files
authored
chore(improvements): fix code quality (#26)
1 parent d87867c commit e24cae9

17 files changed

Lines changed: 3960 additions & 4740 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2020
with:
2121
node-version: lts/*
22-
cache: "npm"
22+
cache: 'npm'
2323

2424
- name: Install dependencies
2525
run: npm ci
@@ -49,7 +49,7 @@ jobs:
4949
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
5050
with:
5151
node-version: lts/*
52-
cache: "npm"
52+
cache: 'npm'
5353

5454
- name: Install dependencies
5555
run: npm ci

.github/workflows/deploy.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,23 @@ permissions:
1111
jobs:
1212
# Build job
1313
build:
14-
# Specify runner + build & upload the static files as an artifact
14+
# Specify runner + build & upload the static files as an artifact
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1919

20-
- name: Read HEAD_COMMIT
21-
id: webpack-ref
22-
run: echo "ref=$(cat HEAD_COMMIT)" >> "$GITHUB_OUTPUT"
23-
24-
- name: Checkout webpack
25-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26-
with:
27-
repository: webpack/webpack
28-
ref: ${{ steps.webpack-ref.outputs.ref }}
29-
path: webpack
30-
3120
- name: Setup Node.js
3221
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
3322
with:
3423
node-version: lts/*
35-
cache: "npm"
24+
cache: 'npm'
3625

3726
- name: Install dependencies
3827
run: npm ci
3928

4029
- name: Build
41-
run: mkdir out && npm run build
30+
run: mkdir out && npm run build-html
4231

4332
- name: Upload static files as artifact
4433
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0

.github/workflows/sync.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Sync Webpack
33
on:
44
schedule:
55
# Run every 24 hours at 04:00 UTC
6-
- cron: "0 4 * * *"
6+
- cron: '0 4 * * *'
77
workflow_dispatch:
88

99
permissions:
1010
contents: write
11+
pull-requests: write
1112

1213
jobs:
1314
sync:
@@ -50,7 +51,7 @@ jobs:
5051
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
5152
with:
5253
node-version: lts/*
53-
cache: "npm"
54+
cache: 'npm'
5455

5556
- name: Install dependencies
5657
if: steps.check.outputs.changed == 'true'
@@ -64,11 +65,17 @@ jobs:
6465
if: steps.check.outputs.changed == 'true'
6566
run: npm run generate-docs
6667

67-
- name: Commit and push
68+
- name: Create pull request
6869
if: steps.check.outputs.changed == 'true'
69-
run: |
70-
git config user.name "github-actions[bot]"
71-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
72-
git add HEAD_COMMIT pages/
73-
git commit -m "chore: sync webpack docs to $(echo ${{ steps.latest.outputs.latest }} | cut -c1-7)"
74-
git push
70+
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
commit-message: 'chore: sync webpack docs to ${{ steps.latest.outputs.latest }}'
75+
title: 'chore: sync webpack docs to ${{ steps.latest.outputs.latest }}'
76+
body: |
77+
Automated update of webpack docs.
78+
79+
- Latest webpack commit: ${{ steps.latest.outputs.latest }}
80+
- Previous commit: ${{ steps.latest.outputs.current }}
81+
branch: 'chore/sync-webpack'

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"semi": true,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"bracketSpacing": true,
8+
"bracketSameLine": false,
9+
"arrowParens": "avoid"
10+
}

HEAD_COMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
214f361891d8f51f41bafb2e760cb3240d6014be
1+
b5499e05b0c1c2847545a610cbaea3d352328d3d

eslint.config.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import js from "@eslint/js";
2-
import globals from "globals";
1+
import js from '@eslint/js';
2+
import globals from 'globals';
33

44
export default [
55
js.configs.recommended,
66
{
77
languageOptions: {
8-
ecmaVersion: "latest",
9-
sourceType: "module",
8+
ecmaVersion: 'latest',
9+
sourceType: 'module',
1010
globals: globals.node,
1111
},
1212
},
1313
{
14-
ignores: ["node_modules/", "out/", "webpack/"],
14+
ignores: ['node_modules/', 'out/', 'webpack/'],
1515
},
1616
];

generate-md.mjs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import { Application } from "typedoc";
2-
import webpack from "./webpack/package.json" with { type: "json" };
3-
import { major } from "semver";
1+
import { Application } from 'typedoc';
2+
import webpack from './webpack/package.json' with { type: 'json' };
3+
import { major } from 'semver';
44

55
const app = await Application.bootstrapWithPlugins({
6-
entryPoints: ["./webpack/types.d.ts"],
6+
entryPoints: ['./webpack/types.d.ts'],
77
out: `pages/v${major(webpack.version)}.x`,
88

99
// Plugins
1010
plugin: [
11-
"typedoc-plugin-markdown",
12-
"./plugins/processor.mjs",
13-
"./plugins/theme/index.mjs",
11+
'typedoc-plugin-markdown',
12+
'./plugins/processor.mjs',
13+
'./plugins/theme/index.mjs',
1414
],
15-
theme: "doc-kit",
15+
theme: 'doc-kit',
16+
router: 'doc-kit',
1617

1718
// Formatting
1819
hideGroupHeadings: true,
1920
hideBreadcrumbs: true,
2021
hidePageHeader: true,
2122
disableSources: true,
23+
propertiesFormat: 'table',
2224

23-
router: "module",
24-
entryFileName: "index",
25-
26-
tsconfig: "tsconfig.json",
25+
entryFileName: 'index',
26+
tsconfig: 'tsconfig.json',
2727
});
2828

2929
const project = await app.convert();

0 commit comments

Comments
 (0)