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

Release 2023.01.25 #28

Merged
merged 2 commits into from
Jan 26, 2023
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
29 changes: 16 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,30 @@ commands:
nodejs:
description: The NodeJS version to install
type: string
default: ""

steps:
- checkout:
path: ~/repos/rxjs-axios

- run:
name: Install NVM
name: Install NVM and NodeJS
command: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" --install' >> $BASH_ENV
source $BASH_ENV

- run:
name: Install NodeJS v<< parameters.nodejs >>
command: |
nvm install << parameters.nodejs >>
nvm use << parameters.nodejs >>
nvm alias default << parameters.nodejs >>
node --version
- when:
condition: << parameters.nodejs >>
steps:
- run:
name: Install NodeJS v<< parameters.nodejs >>
command: |
nvm install << parameters.nodejs >>
nvm use << parameters.nodejs >>
nvm alias default << parameters.nodejs >>
node --version

- run:
name: Install yarn
Expand Down Expand Up @@ -94,8 +98,7 @@ jobs:
executor: basic

steps:
- bootstrap:
nodejs: "19.0.1"
- bootstrap

- run:
name: Build
Expand All @@ -113,7 +116,7 @@ workflows:
parameters:
nodejs: ["16", "17", "18", "19"]
rxjs: ["5.5.12", "6.6.7", "7.8.0"]
axios: ["1.0.0", "1.1.3", "1.2.2"]
axios: ["1.0.0", "1.1.3", "1.2.4"]

- release:
requires:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/owner-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v2.2.1
- uses: hmarr/auto-approve-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ dist.tar.gz

### Logs ###
*.log

### VSCode ###
.vscode/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19.5.0
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

54 changes: 45 additions & 9 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,53 @@
remote_theme: mmistakes/minimal-mistakes

minimal_mistakes_skin: air
---

atom_feed:
hide: true
remote_theme: mmistakes/minimal-mistakes

repository: JoseLion/rxjs-axios
plugins:
- jekyll-include-cache
- jekyll-github-metadata

defaults:
- scope:
path: ""
type: pages
values:
layout: splash
author_profile: true
classes: wide
layout: single

plugins:
- jekyll-include-cache
minimal_mistakes_skin: air
title: RxJS Axios
subtitle: A complete Axios wrapper that uses RxJS observables instead of promises
name: Jose Luis Leon
repository: JoseLion/rxjs-axios
atom_feed:
hide: true
twitter:
username: joseliont
author:
name: Jose Luis Leon
avatar: https://github.com/JoseLion.png
email: [email protected]
links:
- label: Repository
icon: fab fa-fw fa-github
url: https://github.com/JoseLion/rxjs-axios
- label: GitHub
icon: fab fa-fw fa-github-alt
url: https://github.com/JoseLion
- label: Twitter
icon: fab fa-fw fa-twitter-square
url: https://twitter.com/joseliont
footer:
links:
- label: Repository
icon: fab fa-fw fa-github
url: https://github.com/JoseLion/rxjs-axios
- label: GitHub
icon: fab fa-fw fa-github-alt
url: https://github.com/JoseLion
- label: Twitter
icon: fab fa-fw fa-twitter-square
url: https://twitter.com/joseliont

...
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.18",
"@types/sinon": "^10.0.13",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"axios": "^1.2.2",
"eslint": "^8.31.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.4",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
"axios": "^1.2.4",
"eslint": "^8.32.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^39.6.8",
"form-data": "^4.0.0",
"mocha": "^10.2.0",
"msw": "^0.49.2",
"msw": "^1.0.0",
"rxjs": "^7.8.0",
"semantic-release": "^19.0.5",
"semantic-release": "^20.1.0",
"sinon": "^15.0.1",
"ts-node": "^10.9.1",
"tslib": "^2.4.1",
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export type AxiosObservable<T> = Observable<AxiosResponse<T>>;
*/
export {
AxiosError,
AxiosHeaders,
CanceledError,
type AxiosAdapter,
type AxiosBasicCredentials,
type AxiosHeaders,
type AxiosInterceptorManager,
type AxiosInterceptorOptions,
type AxiosProgressEvent,
Expand Down Expand Up @@ -51,7 +51,6 @@ export {
RxjsAxios as Axios,
AxiosRequestTransformer,
AxiosResponseTransformer,
RxjsAxiosDefaults as AxiosDefaults,
} from "./lib/RxjsAxios";

export const axios = RxjsAxios.of(defaultAxios);
12 changes: 4 additions & 8 deletions src/lib/RxjsAxios.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import axios, {
AxiosDefaults,
AxiosError,
AxiosInstance,
AxiosInterceptorManager,
AxiosRequestConfig,
AxiosRequestHeaders,
AxiosResponse, AxiosResponseHeaders, Cancel,
AxiosResponse,
AxiosResponseHeaders,
Cancel,
CreateAxiosDefaults,
FormSerializerOptions,
GenericFormData,
Expand All @@ -28,11 +29,6 @@ export type AxiosResponseTransformer<T> = (
status?: number
) => T;

export interface RxjsAxiosDefaults<T = unknown> extends AxiosDefaults<T> {
transformRequest?: AxiosRequestTransformer<T> | AxiosRequestTransformer<T>[];
transformResponse?: AxiosResponseTransformer<T> | AxiosResponseTransformer<T>[];
}

interface Interceptors {
request: AxiosInterceptorManager<AxiosRequestConfig<unknown>>;
response: AxiosInterceptorManager<AxiosResponse<unknown>>;
Expand Down Expand Up @@ -81,7 +77,7 @@ export class RxjsAxios {
return axios.formToJSON(form);
}

public get defaults(): RxjsAxiosDefaults {
public get defaults(): CreateAxiosDefaults<unknown> {
return this.axios.defaults;
}

Expand Down
4 changes: 2 additions & 2 deletions test/lib/observify.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expect } from "@stackbuilders/assertive-ts";
import { AxiosError, AxiosResponse } from "axios";
import { AxiosError, AxiosHeaders, AxiosResponse } from "axios";
import Sinon from "sinon";

import { observify } from "../../src/lib/observify";
import { delay } from "../helpers/async.helpers";

const RESPONSE: AxiosResponse<string> = {
config: { },
config: { headers: AxiosHeaders.from() },
data: "ok",
headers: { ["Content-Type"]: "plain/text" },
status: 200,
Expand Down
Loading