Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #113 from data-provider/release
Browse files Browse the repository at this point in the history
Release v2.3.0
  • Loading branch information
javierbrea authored Jan 7, 2021
2 parents 3d18948 + 43720fd commit 3a9e128
Show file tree
Hide file tree
Showing 10 changed files with 844 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
### Removed

## [2.3.0] - 2021-01-07

### Added
- feat: Add compatibility with @data-provider/core v3 arguments.

## [2.2.2] - 2020-12-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
testEnvironment: "node",

// The glob patterns Jest uses to detect test files
testMatch: ["<rootDir>/test/**/?(*.)+(spec|test).js?(x)"],
testMatch: ["<rootDir>/test/**/*.spec.js"],

transform: {
".js$": "babel-jest",
Expand Down
17 changes: 12 additions & 5 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-provider/browser-storage",
"version": "2.2.2",
"version": "2.3.0",
"description": "Data Provider addon providing localStorage and sessionStorage origins",
"keywords": [
"data-provider",
Expand Down Expand Up @@ -38,12 +38,12 @@
"test:mutation": "stryker run"
},
"peerDependencies": {
"@data-provider/core": "2.x"
"@data-provider/core": ">=2.10.0"
},
"devDependencies": {
"@babel/core": "7.12.3",
"@babel/preset-env": "7.12.1",
"@data-provider/core": "2.9.0",
"@data-provider/core": "2.10.0",
"@rollup/plugin-babel": "5.2.2",
"@rollup/plugin-commonjs": "17.0.0",
"@rollup/plugin-json": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.organization=data-provider
sonar.projectKey=data-provider-browser-storage
sonar.projectVersion=2.2.2
sonar.projectVersion=2.3.0

sonar.sources=src,test
sonar.exclusions=node_modules/**
Expand Down
7 changes: 5 additions & 2 deletions src/LocalStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ Unless required by applicable law or agreed to in writing, software distributed
import { Storage } from "./Storage";
import { TAG, LOCAL_TAG } from "./tags";

import { providerArgsV3 } from "@data-provider/core";

export class LocalStorage extends Storage {
constructor(id, options, query) {
super(id, { ...options, storageKey: "localStorage" }, query);
constructor(...args) {
const [id, options, queryValue] = providerArgsV3(args);
super({ id, ...options, storageKey: "localStorage" }, queryValue);
}

get baseTags() {
Expand Down
7 changes: 5 additions & 2 deletions src/SessionStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ Unless required by applicable law or agreed to in writing, software distributed
import { Storage } from "./Storage";
import { TAG, SESSION_TAG } from "./tags";

import { providerArgsV3 } from "@data-provider/core";

export class SessionStorage extends Storage {
constructor(id, options, query) {
super(id, { ...options, storageKey: "sessionStorage" }, query);
constructor(...args) {
const [id, options, queryValue] = providerArgsV3(args);
super({ id, ...options, storageKey: "sessionStorage" }, queryValue);
}

get baseTags() {
Expand Down
8 changes: 4 additions & 4 deletions src/Storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class StorageErrorMock {
}

export class Storage extends Provider {
constructor(id, options, query) {
constructor(options, queryValue) {
const extendedOptions = { ...options };
if (!query) {
extendedOptions.parentId = id;
if (!queryValue) {
extendedOptions.parentId = options.id;
}
super(id, extendedOptions, query);
super(extendedOptions, queryValue);
}

_getStorage(storageKey, root, storageFallback) {
Expand Down
Loading

0 comments on commit 3a9e128

Please sign in to comment.