Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# @see https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions"
open-pull-requests-limit: 15
directory: "/"
schedule:
interval: "monthly"

# - package-ecosystem: "npm"
# open-pull-requests-limit: 15
# directory: "/"
# schedule:
# interval: "monthly"
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: Build
name: build

on:
push:
branches:
- "*"

pull_request:
branches:
- "*"
Expand All @@ -13,14 +14,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "22.x"
cache: "npm"

- name: install
run: npm ci

- name: audit
run: npm audit --audit-level=moderate

- name: build
run: npm run build
5 changes: 3 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: CodeQL
name: codeql

on:
push:
branches:
- "*"

pull_request:
branches:
- "*"
Expand All @@ -18,7 +19,7 @@ jobs:
security-events: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: Lint
name: lint

on:
push:
branches:
- "*"

pull_request:
branches:
- "*"
Expand All @@ -13,8 +14,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "22.x"
cache: "npm"
Expand All @@ -26,4 +27,4 @@ jobs:
run: npx prettier --check .

- name: lint
run: npm run lint
run: npx eslint .
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Publish
name: publish

on:
release:
Expand All @@ -13,8 +13,8 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "22.x"
cache: "npm"
Expand All @@ -26,7 +26,7 @@ jobs:
- name: build
run: npm run build

- name: npm publish
- name: publish
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
name: Test
name: test

on:
push:
branches:
- "*"

pull_request:
branches:
- "*"
Expand All @@ -13,16 +14,16 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "22.x"
cache: "npm"

- name: npm ci
- name: install
run: npm ci

- name: npm test
- name: test
run: npm test -- --coverage --reporters=jest-junit
env:
JEST_JUNIT_CLASSNAME: junit.xml
Expand Down
41 changes: 38 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
coverage
dist
node_modules
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
dist/
coverage/

# dependencies
node_modules/

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
*.tsbuildinfo

# tests
junit.xml
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#!/bin/sh
npx sort-package-json
npx prettier --check .
npx eslint .
npm test
2 changes: 0 additions & 2 deletions .husky/pre-push

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.20.0
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# prevent-widows

[![codecov](https://codecov.io/gh/bashaus/prevent-widows/graph/badge.svg?token=7QNC6PIHUG)](https://codecov.io/gh/bashaus/prevent-widows)
[![github actions build][img:gh-build]][url:gh-build]
[![code coverage][img:codecov]][url:codecov]

Prevent widows from appearing in a string.

Expand Down Expand Up @@ -144,3 +145,7 @@ When `false`, this will output:
```

[url:posthtml]: https://github.com/posthtml/posthtml
[img:codecov]: https://codecov.io/gh/bashaus/prevent-widows/graph/badge.svg?token=D79154VC17
[url:codecov]: https://codecov.io/gh/bashaus/prevent-widows
[img:gh-build]: https://github.com/bashaus/prevent-widows/actions/workflows/build.yml/badge.svg
[url:gh-build]: https://github.com/bashaus/prevent-widows/actions/workflows/build.yml
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
// collectCoverage: true,

// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,
collectCoverageFrom: ["src/**/*.ts"],

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
Expand Down
Loading