Skip to content

Commit cf89c9e

Browse files
committed
Update onecfg; upgrade dependencies; add types to package.json
1 parent 553155b commit cf89c9e

12 files changed

+1276
-1663
lines changed

.eslintrc.json

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"allowDirectConstAssertionInArrowFunctions": true
5757
}
5858
],
59-
"@typescript-eslint/no-duplicate-imports": "error",
6059
"@typescript-eslint/no-floating-promises": "error",
6160
"@typescript-eslint/no-import-type-side-effects": "error",
6261
"@typescript-eslint/no-require-imports": "error",

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ jobs:
22
CI:
33
runs-on: ubuntu-latest
44
steps:
5-
- uses: actions/checkout@v3
5+
- uses: actions/checkout@v4
66
- uses: actions/setup-node@v3
77
with:
88
node-version-file: .node-version
99
- uses: bahmutov/npm-install@v1
10-
- run: npm run ci
10+
- run: bash ./ci.sh
1111
- env:
1212
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
1313
if: ${{ github.event_name == 'release' }}

.prettierignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/.prettierrc.json
22
/LICENSE*
33
/.eslintrc.json
4-
/package-lock.json
54
/.github/workflows/ci.yml
5+
/package-lock.json
66
/tsconfig.base.json
77
/tsconfig.json
88
/lib

.prettierrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"bracketSpacing": false,
3-
"printWidth": 80,
2+
"bracketSpacing": true,
3+
"printWidth": 100,
44
"proseWrap": "always",
55
"quoteProps": "consistent",
66
"singleQuote": true,

.vscode/settings.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"[json]": {
1515
"editor.defaultFormatter": "esbenp.prettier-vscode"
1616
},
17+
"[markdown]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode"
19+
},
1720
"[typescript]": {
1821
"editor.defaultFormatter": "esbenp.prettier-vscode"
1922
},
@@ -29,7 +32,7 @@
2932
},
3033
"editor.formatOnSave": true,
3134
"editor.rulers": [
32-
80
35+
100
3336
],
3437
"files.exclude": {
3538
".editorconfig": true,
@@ -44,6 +47,7 @@
4447
".vscode": true,
4548
".vscode/extensions.json": true,
4649
".vscode/settings.json": true,
50+
"ci.sh": true,
4751
"tsconfig.base.json": true,
4852
"tsconfig.emit.json": true,
4953
"tsconfig.eslint.json": true,

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
> An esbuild plugin that generates an HTML file.
44
5-
This esbuild plugin allows the creation of an HTML file featuring output URLs of
6-
bundled assets, while supporting customization of head and body elements. The
7-
esbuild's `minify` option handles minification.
5+
This esbuild plugin allows the creation of an HTML file featuring output URLs of bundled assets,
6+
while supporting customization of head and body elements. The esbuild's `minify` option handles
7+
minification.
88

99
## Installation
1010

@@ -46,8 +46,8 @@ await esbuild.build({
4646

4747
### `outfile` (required)
4848

49-
The output file's name for the generated HTML. This name will be combined with
50-
the `outdir` or the dirname of the `outfile` from the esbuild options.
49+
The output file's name for the generated HTML. This name will be combined with the `outdir` or the
50+
dirname of the `outfile` from the esbuild options.
5151

5252
```
5353
{
@@ -67,8 +67,8 @@ The language attribute for the HTML tag.
6767

6868
### `createHeadElements` (optional)
6969

70-
A function that receives the output URLs of the bundled assets and returns an
71-
array of strings representing the custom head elements.
70+
A function that receives the output URLs of the bundled assets and returns an array of strings
71+
representing the custom head elements.
7272

7373
```
7474
{
@@ -81,8 +81,8 @@ array of strings representing the custom head elements.
8181

8282
### `createBodyElements` (optional)
8383

84-
A function that receives the output URLs of the bundled assets and returns an
85-
array of strings representing the custom body elements.
84+
A function that receives the output URLs of the bundled assets and returns an array of strings
85+
representing the custom body elements.
8686

8787
```
8888
{

ci.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -e # Terminates script at the first error
3+
set -o pipefail # Sets the exit status for pipes
4+
set -u # Triggers an error when an unset variable is called
5+
set -o noclobber # Prevents from overwriting existing files
6+
npm run format:check
7+
npm run lint
8+
npm run compile:check
9+
npm run compile:emit

onecfg.json

+17-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,27 @@
33
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-editorconfig.json",
44
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-eslint.json",
55
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-git.json",
6+
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-github-ci.json",
7+
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-github-ci-node.json",
8+
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-github-ci-npm.json",
9+
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-github-ci-npm-publish.json",
610
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-node.json",
7-
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-node-github.json",
8-
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-npm-github.json",
911
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-prettier.json",
1012
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-typescript.json",
1113
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-typescript-emit.json",
1214
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-typescript-eslint.json",
1315
"https://raw.githubusercontent.com/clebert/onecfg-lib/main/lib/onecfg-vscode.json"
14-
]
16+
],
17+
"patches": {
18+
"ci.sh": [
19+
{
20+
"value": [
21+
"npm run format:check",
22+
"npm run lint",
23+
"npm run compile:check",
24+
"npm run compile:emit"
25+
]
26+
}
27+
]
28+
}
1529
}

0 commit comments

Comments
 (0)