react-render-image
Advanced tools
Comparing version
# Change log | ||
## 2.0.0 | ||
- Switch from Flowtype to Typescript which changes how the library is bundled and means we're no longer providing typings for Flowtype | ||
- Moved `react` to a `peerDependency` and bumped the minimum version to `^16.8.0` | ||
## 1.1.3 | ||
@@ -4,0 +9,0 @@ |
@@ -1,5 +0,3 @@ | ||
declare module 'react-render-image' { | ||
import * as React from 'react'; | ||
export interface ImageRendererProps { | ||
import * as React from 'react'; | ||
export interface ImageRendererProps { | ||
src: string; | ||
@@ -9,17 +7,16 @@ loading?: React.ReactNode; | ||
errored?: React.ReactNode; | ||
children?: ( | ||
status: { | ||
children?: (status: { | ||
image?: HTMLImageElement; | ||
loaded: boolean; | ||
errored: boolean; | ||
} | ||
) => React.ReactNode; | ||
}) => React.ReactNode; | ||
onLoad?: () => void; | ||
onError?: () => void; | ||
} | ||
export default class ImageRenderer extends React.Component< | ||
ImageRendererProps, | ||
any | ||
> {} | ||
} | ||
export declare enum ImageRendererStatus { | ||
LOADING = 0, | ||
LOADED = 1, | ||
ERRORED = 2 | ||
} | ||
declare const ImageRenderer: React.FC<ImageRendererProps>; | ||
export default ImageRenderer; |
{ | ||
"name": "react-render-image", | ||
"version": "1.1.3", | ||
"version": "2.0.0-preview.1", | ||
"description": "Render an image in React.", | ||
@@ -15,56 +15,53 @@ "keywords": [ | ||
], | ||
"main": "dist/cjs/index.js", | ||
"jsnext:main": "dist/esm/index.js", | ||
"types": "./dist/index.d.ts", | ||
"files": ["dist/index.d.ts", "dist/cjs", "dist/esm"], | ||
"main": "dist/index.js", | ||
"module": "dist/react-render-image.esm.js", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": "jameslnewell/react-render-image", | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"react": ">=16.8.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-core": "^6.26.0", | ||
"babel-jest": "^21.2.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-flow": "^6.23.0", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-0": "^6.24.1", | ||
"enzyme": "^3.2.0", | ||
"enzyme-adapter-react-16": "^1.1.0", | ||
"flow-bin": "^0.59.0", | ||
"@jameslnewell/editor-config": "^1.0.1", | ||
"@jameslnewell/eslint-config": "^0.13.5", | ||
"@jameslnewell/prettier-config": "^1.0.1", | ||
"@jameslnewell/typescript-config": "^3.0.0", | ||
"@testing-library/react": "^9.4.0", | ||
"@types/enzyme": "^3.10.5", | ||
"@types/enzyme-adapter-react-16": "^1.0.6", | ||
"@types/jest": "^25.1.2", | ||
"@types/react": "^16.9.19", | ||
"@types/react-dom": "^16.9.5", | ||
"gh-pages": "^1.1.0", | ||
"html-webpack-plugin": "^2.30.1", | ||
"husky": "^0.14.3", | ||
"jest": "^21.2.1", | ||
"jest-enzyme": "^4.0.1", | ||
"lint-staged": "^6.0.0", | ||
"prettier": "^1.9.2", | ||
"raf": "^3.4.0", | ||
"react": "^16.1.1", | ||
"react-dom": "^16.1.1", | ||
"react-test-renderer": "^16.1.1", | ||
"webpack": "^3.8.1", | ||
"webpack-dev-server": "^2.9.4" | ||
"husky": "^4.2.3", | ||
"parcel-bundler": "^1.12.4", | ||
"prettier": "^1.19.1", | ||
"raf": "^3.4.1", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-test-renderer": "^16.12.0", | ||
"tsdx": "^0.12.3" | ||
}, | ||
"scripts": { | ||
"clean": "rm -rf ./dist", | ||
"flow": "flow", | ||
"build:cjs": "BABEL_ENV=cjs babel ./src -d ./dist/cjs --ignore .test.js", | ||
"build:esm": "BABEL_ENV=esm babel ./src -d ./dist/esm --ignore .test.js", | ||
"build:types": "cp ./src/index.d.ts ./dist/index.d.ts", | ||
"build:example": "BABEL_ENV=cjs webpack", | ||
"build": | ||
"yarn run build:cjs && yarn run build:esm && yarn run build:types && yarn run build:example", | ||
"deploy": "gh-pages -d ./dist/example", | ||
"dev": "BABEL_ENV=cjs webpack-dev-server", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"precommit": "lint-staged", | ||
"prepublishOnly": | ||
"yarn run clean && yarn run build && yarn run test && yarn run flow", | ||
"lint": "tsdx lint --fix", | ||
"build:package": "tsdx build", | ||
"build:example": "parcel build example/index.html --out-dir example/dist", | ||
"build": "yarn run build:package && yarn run build:example", | ||
"deploy": "gh-pages -d ./example/dist", | ||
"start": "parcel serve example/index.html --out-dir example/dist", | ||
"test": "tsdx test src", | ||
"test:watch": "tsdx test src --watch", | ||
"prepublishOnly": "yarn run clean && yarn run build && yarn run test", | ||
"postpublish": "yarn run deploy" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,json,md}": ["prettier --write", "git add"] | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "tsdx lint --fix" | ||
} | ||
}, | ||
"license": "MIT" | ||
} |
@@ -9,4 +9,6 @@ # react-render-image | ||
``` | ||
```bash | ||
npm install --save react-render-image | ||
// OR | ||
yarn add react-render-image | ||
``` | ||
@@ -13,0 +15,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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
29900
98.21%19
-20.83%15
150%87
2.35%1
Infinity%225
-29.25%3
200%2
100%