Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/rxjs-7.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
antoantonyk authored Nov 4, 2023
2 parents 4f27840 + 1502ca9 commit 8747cdc
Show file tree
Hide file tree
Showing 24 changed files with 848 additions and 467 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish NPM Package
on:
release:
types:
- released

jobs:
publish:
# check for version in the release tag - example: v1.0.0
if: contains(github.event.release.tag_name, '^v[0-9]+\.[0-9]+\.[0-9]')
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.14.2]

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

# TODO - find better approch to install the peer dependencies for local developement
- name: Link lib
run: npm link ./projects/password-strength-meter

- name: Build - Lib
run: npm run build:lib:prod

- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- name: Publish to npm
run: npm publish dist/password-strength-meter/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
55 changes: 12 additions & 43 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ jobs:
- name: Install dependencies
run: npm ci

# TODO - find better approch to install the peer dependencies for local developement
- name: Link lib
run: npm link ./projects/password-strength-meter

- name: Lint
run: npm run lint

- name: Build
run: npm run build:lib:prod

- name: Unit Test - Lib
run: npm run test:lib -- -- --watch=false --browsers=ChromeHeadless

- name: Unit Test - App
run: npm run build:lib:prod && npm run test:app -- -- --watch=false --browsers=ChromeHeadless
run: npm run test:app -- -- --watch=false --browsers=ChromeHeadless

- name: Coveralls
uses: coverallsapp/[email protected]
Expand Down Expand Up @@ -67,6 +74,10 @@ jobs:
- name: Install dependencies
run: npm ci

# TODO - find better approch to install the peer dependencies for local developement
- name: Link lib
run: npm link ./projects/password-strength-meter

- name: Build - Lib
run: npm run build:lib:prod

Expand All @@ -78,45 +89,3 @@ jobs:
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.

publish:
needs: deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.14.2]

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci

- name: Build - Lib
run: npm run build:lib:prod

- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@master

- name: Create release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.package-version.outputs.current-version}}
commit: ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to npm
run: npm publish dist/password-strength-meter/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@ Need lib for Vue.js? [Click here](https://github.com/antoantonyk/vue-password-st
```sh
npm install @zxcvbn-ts/core @zxcvbn-ts/language-en angular-password-strength-meter --save
```
**Optional Packages:** zxcvbn packagase are not required if PasswordStrengthMeterModule is using with a custom implementation of IPasswordStrengthMeterService .

**Step 2:** Import Password Strength Meter Module into your app module

```ts
....
import { PasswordStrengthMeterModule } from 'angular-password-strength-meter';

import { DEFAULT_PSM_OPTIONS } from 'angular-password-strength-meter/zxcvbn';
....

@NgModule({
...
imports: [
....
PasswordStrengthMeterModule.forRoot()
PasswordStrengthMeterModule.forRoot(DEFAULT_PSM_OPTIONS)
],
....
})
Expand All @@ -63,7 +64,8 @@ Refer to the [zxcvbn documentation](https://zxcvbn-ts.github.io/zxcvbn/guide/get

```ts
....
import { PasswordStrengthMeterModule, PSM_CONFIG } from 'angular-password-strength-meter';
import { PasswordStrengthMeterModule} from 'angular-password-strength-meter';
import { DEFAULT_PSM_OPTIONS, ZXCVBN_CONFIG } from 'angular-password-strength-meter/zxcvbn';
import zxcvbnCommonPackage from '@zxcvbn-ts/language-common'
import zxcvbnEnPackage from '@zxcvbn-ts/language-en'

Expand All @@ -77,7 +79,7 @@ import zxcvbnEnPackage from '@zxcvbn-ts/language-en'
],
providers: [
{
provide: PSM_CONFIG,
provide: ZXCVBN_CONFIG,
useValue: {
translations: zxcvbnEnPackage.translations,
graphs: zxcvbnCommonPackage.adjacencyGraphs,
Expand Down
Loading

0 comments on commit 8747cdc

Please sign in to comment.