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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
trim_trailing_whitespace = true
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,44 @@
"es6": true,
"node": true
},
"overrides": [
{
"files": ["*.mjs"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
}
}
],
"extends": ["eslint:recommended"],
"ignorePatterns": ["*.min.*"],
"rules": {
"array-callback-return": "error",
"curly": "error",
"default-case": "error",
"default-case-last": "error",
"dot-notation": "error",
"eqeqeq": "error",
"func-name-matching": "error",
"grouped-accessor-pairs": "error",
"no-implicit-coercion": "error",
"no-implicit-globals": "error",
"no-return-assign": "error",
"no-shadow": "error",
"no-throw-literal": "error",
"no-unneeded-ternary": "error",
"no-undef": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-useless-return": "error",
"no-var": "error",
"object-shorthand": "error",
"prefer-const": "error",
"prefer-promise-reject-errors": "error",
"prefer-regex-literals": "error",
"radix": "error",
"require-await": "error",
"vars-on-top": "error",
"yoda": "error"
}
}
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: "CodeQL"

on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: ESLint

on:
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:

permissions: {}

concurrency:
group: npm-publish-${{ github.event.release.tag_name || github.ref_name || github.run_id }}
cancel-in-progress: false

jobs:
build:
name: Build release artifact
runs-on: ubuntu-latest
if: ${{ github.repository == 'coliff/bootstrap-show-password-toggle' }}
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: .nvmrc

Comment thread
coliff marked this conversation as resolved.
- name: Verify release tag matches package version
if: ${{ github.event_name == 'release' }}
run: |
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
TAG_NAME="${{ github.event.release.tag_name }}"

if [ "$TAG_NAME" != "$PACKAGE_VERSION" ] && [ "$TAG_NAME" != "v$PACKAGE_VERSION" ]; then
echo "Release tag '$TAG_NAME' does not match package version '$PACKAGE_VERSION'."
exit 1
fi

- name: Install dependencies
run: npm install --ignore-scripts --no-package-lock

- name: Run tests
run: npm test

- name: Build package assets
run: npm run build

- name: Verify generated files are committed
run: git diff --exit-code -- css js scss package.json

- name: Pack npm tarball
run: npm pack --json > npm-pack.json

- name: Upload npm tarball
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: npm-package
path: |
*.tgz
npm-pack.json
if-no-files-found: error
retention-days: 7

publish:
name: Publish package
runs-on: ubuntu-latest
needs: build
environment:
name: npm
permissions:
contents: read
id-token: write

steps:
- name: Download npm tarball
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: npm-package
path: dist

- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org
package-manager-cache: false
Comment thread
coliff marked this conversation as resolved.

- name: Publish to npm
working-directory: dist
run: npm publish --provenance "$(node -p 'require("./npm-pack.json")[0].filename')"
1 change: 1 addition & 0 deletions .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Scorecards supply-chain security
on:
branch_protection_rule:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Lint Code Base
---
name: Super Linter

on:
push:
Expand All @@ -16,9 +17,8 @@ jobs:
issues: write
pull-requests: write
statuses: write
name: Lint Code Base
name: Super Linter
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && !startsWith(github.head_ref || github.ref_name, 'dependabot/') }}

steps:
- name: Checkout Code
Expand All @@ -33,6 +33,7 @@ jobs:
- name: Lint Code Base
uses: super-linter/super-linter/slim@9e863354e3ff62e0727d37183162c4a88873df41 # v8.6.0
env:
CSS_FILE_NAME: stylelint.config.mjs
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_GITIGNORED_FILES: true
Expand All @@ -45,6 +46,7 @@ jobs:
VALIDATE_CHECKOV: false
VALIDATE_EDITORCONFIG: false
VALIDATE_GIT_COMMITLINT: false
VALIDATE_GITHUB_ACTIONS_ZIZMOR: false
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
VALIDATE_MARKDOWN: false
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CODEOWNERS
*.min.*
*.md
.cspell.json
package.json
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "EditorConfig.EditorConfig",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
"source.fixAll.eslint": "always",
"source.fixAll.stylelint": "always"
},
"eslint.validate": ["javascript"],
"stylelint.validate": ["scss"]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2025 Christian Oliff
Copyright (c) 2020-2026 Christian Oliff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions js/show-password-toggle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* Bootstrap Show Password Toggle v1.4.1
* Copyright 2020-2024 C.Oliff
* Bootstrap Show Password Toggle v1.4.2
* Copyright 2020-2026 C.Oliff
* Licensed under MIT (https://github.com/coliff/bootstrap-show-password-toggle/blob/main/LICENSE)
*/

Expand Down
4 changes: 2 additions & 2 deletions js/show-password-toggle.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-show-password-toggle",
"version": "1.4.1",
"version": "1.4.2",
"description": "A show password as text toggle for Bootstrap",
"keywords": [
"bootstrap",
Expand Down Expand Up @@ -57,4 +57,4 @@
"volta": {
"node": "22.22.2"
}
}
}
Loading