Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Webpack, Mocha to Vite, Vitest and support React 18 #215

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7956da0
feat: add github workflow
CarreraPHP Oct 5, 2023
6068abd
build: remove dist directory
CarreraPHP Oct 5, 2023
788b7fe
Merge branch 'master' of github.com:founding-partner/redux-oidc
CarreraPHP Oct 5, 2023
d426221
build: ignore dist directory
CarreraPHP Oct 5, 2023
250761c
build: replace webpack with vite
CarreraPHP Oct 5, 2023
cae87b1
fix: replace require with esm import
CarreraPHP Oct 5, 2023
f91f8d9
feat: replace oidc-client with oidc-client-ts
CarreraPHP Oct 5, 2023
5073061
test: replace mocha, expect, sinon with vitest
CarreraPHP Oct 5, 2023
f804048
build: update npm scripts to use vite, vitest
CarreraPHP Oct 5, 2023
5dbb692
build: ignore os internal files
CarreraPHP Oct 5, 2023
dcdad88
feat: change package name
CarreraPHP Oct 5, 2023
e425c1b
build: add dependabot to update versions
CarreraPHP Oct 5, 2023
6516979
build: add automatic semantic versioning
CarreraPHP Oct 5, 2023
6bf950f
build: add semantic release changelog package
CarreraPHP Oct 5, 2023
b482276
build: replace github token with personal access token
CarreraPHP Oct 5, 2023
d7f0f5b
build: update repo url in package.json
CarreraPHP Oct 5, 2023
16637ef
chore: fix typo error in readme
CarreraPHP Oct 5, 2023
63aa352
builb: update npm publish access to public
CarreraPHP Oct 5, 2023
851509c
feat: update readme about the example app
CarreraPHP Oct 8, 2023
723df55
feat: change the example app path
CarreraPHP Oct 8, 2023
77a5d92
chore: 🤖 reduce oidc-client peer dependency to avoid conflict
CarreraPHP Oct 19, 2023
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
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js (Latest LTS)
uses: actions/setup-node@v2
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm install react immutable oidc-client-ts

- name: Run tests
run: npm test

- name: Semantic Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.FOR_FOUNDING_PARTNER_REPO }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Pusblish to NPM
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules/
.tmp/
dist/
.DS_Store
6 changes: 3 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.babelrc
webpack.config.js
webpack.config-test.js
vite.config.ts
.github/
tests/
src/
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,29 @@ It contains the following parts:
`npm install --save redux-oidc`

#### Peer dependencies
This package wraps [oidc-client-js](https://github.com/IdentityModel/oidc-client-js) to use with ReactJS / Redux apps.
This package wraps [oidc-client-ts](https://github.com/authts/oidc-client-ts) to use with ReactJS / Redux apps.
Install oidc-client like this:

`npm install --save oidc-client`

In addition there is a peer dependency for [immutable.js](https://facebook.github.io/immutable-js/), if you want to use it.

#### babel-polyfill
You need the [babel-polyfill](https://babeljs.io/docs/usage/polyfill/) in your build configuration for this package to work.
`npm install --save oidc-client-ts`

In addition there is an optional dependency for [immutable.js](https://facebook.github.io/immutable-js/), if you want to use it.

### Version 4 released
*BREAKING CHANGE*: `immutable` is no longer a dependency. If you are using the immutable reducer, please check out the [docs](https://github.com/maxmantz/redux-oidc/blob/master/docs/API.md#immutable-reducer).

*BREAKING CHANGE*:
- Replace oidc-client with oidc-client-ts package
- Update peer dependency to support React 16, 17 & 18
- Replace Webpack bundler with Vite
- Replace mocha, sinon with Vitest
- Update the [example app](https://github.com/founding-partner/redux-oidc-example) to work with `Vite` bunder, make sure to check its `README.md` file for the changes done.
- There is a catch in it, for the google auth to work, i have npm aliased `oidc-client` package in place of `oidc-client-ts`.
- `immutable` is no longer a dependency. If you are using the immutable reducer, please check out the [docs](https://github.com/maxmantz/redux-oidc/blob/master/docs/API.md#immutable-reducer).

#### Documentation
You can find the docs for version 3 here:
- [API docs](docs/API.md),
- [actions](docs/Actions.md),
- [example app](https://github.com/maxmantz/redux-oidc-example)
- [example app](https://github.com/founding-partner/redux-oidc-example)

#### Note for react-native users
This library doesn't fully support react-native apps. Please use [this](https://github.com/FormidableLabs/react-native-app-auth) library instead.
Expand All @@ -47,7 +51,7 @@ This library doesn't fully support react-native apps. Please use [this](https://
Check out the [wiki](https://github.com/maxmantz/redux-oidc/wiki) for further information for Version 2 (deprecated).

### Sample app
There is a sample application demonstrating the use of this package [here](https://github.com/maxmantz/redux-oidc-example).
There is a sample application demonstrating the use of this package [here](https://github.com/founding-partner/redux-oidc-example).

### Tests
You have to install immutableJS for all the tests to pass: `npm install immutable --no-save`.
Expand Down
1 change: 0 additions & 1 deletion dist/redux-oidc.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Usage:
import { createUserManager } from 'redux-oidc';

const settings = {
// the user manager settings for oidc-client
// the user manager settings for oidc-client-ts
};

const userManager = createUserManager(settings);
Expand Down
Empty file added docs/CHANGELOG.md
Empty file.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module "redux-oidc" {
import { SignoutResponse, UserManager, UserManagerSettings, User } from "oidc-client";
import { SignoutResponse, UserManager, UserManagerSettings, User } from "oidc-client-ts";
import { Map, fromJS } from "immutable";
import { Middleware, Store } from "redux";
import * as React from "react";
Expand Down
Loading