@jedmao/location
Advanced tools
Comparing version 2.0.4 to 3.0.0
@@ -6,2 +6,14 @@ # Changelog | ||
# [3.0.0](https://github.com/jedmao/location/compare/v2.0.4...v3.0.0) (2020-03-08) | ||
### Features | ||
* provide builds for both cjs and esm ([fd53dca](https://github.com/jedmao/location/commit/fd53dca)) | ||
### BREAKING CHANGES | ||
* default export removed. use `import { LocationMock } from '@jedmao/location'`. | ||
## [2.0.4](https://github.com/jedmao/location/compare/v2.0.3...v2.0.4) (2019-09-25) | ||
@@ -8,0 +20,0 @@ |
{ | ||
"name": "@jedmao/location", | ||
"version": "2.0.4", | ||
"version": "3.0.0", | ||
"description": "A Location class that implements the Location interface of the Web API.", | ||
"main": "dist/Location.js", | ||
"types": "dist/Location.d.ts", | ||
"main": "dist/LocationMock.js", | ||
"module": "dist/esm/LocationMock.js", | ||
"types": "dist/LocationMock.d.ts", | ||
"files": [ | ||
"dist" | ||
"dist/LocationMock*", | ||
"dist/esm/LocationMock.js" | ||
], | ||
@@ -14,3 +16,5 @@ "scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "tsc -p tsconfig.build.json", | ||
"build": "npm run build:cjs && npm run build:esm", | ||
"build:cjs": "tsc -p tsconfig.cjs.json", | ||
"build:esm": "tsc -p tsconfig.esm.json", | ||
"precover": "rimraf coverage", | ||
@@ -29,6 +33,7 @@ "cover": "jest --coverage", | ||
"lint-staged": { | ||
"src/**/*.{ts,tsx,json,md}": [ | ||
"eslint --fix", | ||
"prettier --write", | ||
"git add" | ||
"*.{ts,tsx}": [ | ||
"eslint --fix" | ||
], | ||
"*.{json,md}": [ | ||
"prettier --write" | ||
] | ||
@@ -84,2 +89,3 @@ }, | ||
"location", | ||
"mock", | ||
"web", | ||
@@ -96,24 +102,24 @@ "api", | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.2.0", | ||
"@commitlint/config-conventional": "^8.2.0", | ||
"@jedmao/semantic-release-npm-github-config": "^1.0.7", | ||
"@jedmao/tsconfig": "^0.3.0", | ||
"@types/jest": "^24.0.18", | ||
"@types/node": "^12.7.7", | ||
"@typescript-eslint/eslint-plugin": "^2.3.1", | ||
"@typescript-eslint/parser": "^2.3.1", | ||
"commitizen": "^4.0.3", | ||
"cz-conventional-changelog": "^3.0.2", | ||
"eslint": "^6.4.0", | ||
"eslint-config-prettier": "^6.3.0", | ||
"husky": "^3.0.5", | ||
"jest": "^24.9.0", | ||
"jest-watch-typeahead": "^0.4.0", | ||
"lint-staged": "^9.3.0", | ||
"prettier": "^1.18.2", | ||
"rimraf": "^3.0.0", | ||
"semantic-release": "^15.13.24", | ||
"ts-jest": "^24.1.0", | ||
"typescript": "^3.6.3" | ||
"@commitlint/cli": "^8", | ||
"@commitlint/config-conventional": "^8", | ||
"@jedmao/semantic-release-npm-github-config": "^1", | ||
"@jedmao/tsconfig": "^0.3", | ||
"@types/jest": "^25", | ||
"@types/node": "^13", | ||
"@typescript-eslint/eslint-plugin": "^2", | ||
"@typescript-eslint/parser": "^2", | ||
"commitizen": "^4", | ||
"cz-conventional-changelog": "^3", | ||
"eslint": "^6", | ||
"eslint-config-prettier": "^6", | ||
"husky": "^4", | ||
"jest": "^25", | ||
"jest-watch-typeahead": "^0.4", | ||
"lint-staged": "^10", | ||
"prettier": "^1", | ||
"rimraf": "^3", | ||
"semantic-release": "^17", | ||
"ts-jest": "^25", | ||
"typescript": "^3.8" | ||
} | ||
} |
# @jedmao/location | ||
<!-- markdownlint-disable --> | ||
[![GitHub Actions](https://github.com/jedmao/location/workflows/master/badge.svg)](https://github.com/jedmao/location/actions) | ||
[![GitHub Actions](https://github.com/jedmao/location/workflows/Node%20CI/badge.svg?event=push)](https://github.com/jedmao/location/actions) | ||
[![NPM version](http://img.shields.io/npm/v/@jedmao/location.svg)](https://www.npmjs.org/package/@jedmao/location) | ||
@@ -16,3 +16,3 @@ [![npm license](http://img.shields.io/npm/l/@jedmao/location.svg)](https://www.npmjs.org/package/@jedmao/location) | ||
A `Location` class that extends [`URL`][] and implements the [`Location interface of the Web API`](https://developer.mozilla.org/en-US/docs/Web/API/Location). As always, with first-class TypeScript support! | ||
A `LocationMock` class that extends [`URL`][] and implements the [`Location interface of the Web API`](https://developer.mozilla.org/en-US/docs/Web/API/Location). As always, with first-class TypeScript support! | ||
@@ -22,3 +22,3 @@ ## Installation | ||
```bash | ||
npm i @jedmao/location | ||
npm i --save-dev @jedmao/location | ||
``` | ||
@@ -29,5 +29,5 @@ | ||
```ts | ||
import Location = require('@jedmao/location') | ||
import { LocationMock } from '@jedmao/location' | ||
const loc = new Location('http://foo.com/') | ||
const loc = new LocationMock('http://foo.com/') | ||
loc.assign('http://bar.com/') | ||
@@ -41,3 +41,3 @@ loc.replace('http://baz.com/') | ||
```ts | ||
new Location('http://jed:secret@test:42/foo?bar=baz#qux') | ||
new LocationMock('http://jed:secret@test:42/foo?bar=baz#qux') | ||
``` | ||
@@ -48,3 +48,3 @@ | ||
```ts | ||
Location { | ||
LocationMock { | ||
href: 'http://jed:secret@test:42/foo?bar=baz#qux', | ||
@@ -76,3 +76,3 @@ origin: 'http://test:42', | ||
beforeEach(() => { | ||
window.location = new Location('http://test/') | ||
window.location = new LocationMock('http://test/') | ||
}) | ||
@@ -79,0 +79,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12630
139
7
1