Skip to content

Commit 2708485

Browse files
committedAug 22, 2023
feat: support exports for npm, github, coverage.
1 parent 82cd9c0 commit 2708485

File tree

2 files changed

+34
-21
lines changed

2 files changed

+34
-21
lines changed
 

‎core/README.md

+21-13
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,17 @@ yarn add @uiw/react-shields
2323

2424
## Usage
2525

26+
```jsx
27+
import { Github, Coverage, Npm } from '@uiw/react-shields';
28+
// Or
29+
import Npm from '@uiw/react-shields/npm';
30+
import Coverage from '@uiw/react-shields/coverage';
31+
import Github from '@uiw/react-shields/github';
32+
```
33+
2634
```jsx mdx:preview
2735
import React from 'react';
28-
import { Github } from '@uiw/react-shields';
36+
import Github from '@uiw/react-shields/github';
2937

3038
export default function Demo() {
3139
return (
@@ -51,7 +59,7 @@ export default function Demo() {
5159

5260
```jsx mdx:preview
5361
import React from 'react';
54-
import { Github } from '@uiw/react-shields';
62+
import Github from '@uiw/react-shields/github';
5563

5664
export default function Demo() {
5765
return (
@@ -72,7 +80,7 @@ export default function Demo() {
7280

7381
```jsx mdx:preview
7482
import React from 'react';
75-
import { Npm } from '@uiw/react-shields';
83+
import Npm from '@uiw/react-shields/npm';
7684

7785
export default function Demo() {
7886
return (
@@ -99,7 +107,7 @@ export default function Demo() {
99107

100108
```jsx mdx:preview
101109
import React from 'react';
102-
import { Npm } from '@uiw/react-shields';
110+
import Npm from '@uiw/react-shields/npm';
103111

104112
export default function Demo() {
105113
return (
@@ -119,7 +127,7 @@ export default function Demo() {
119127

120128
```jsx mdx:preview
121129
import React from 'react';
122-
import { Npm } from '@uiw/react-shields';
130+
import Npm from '@uiw/react-shields/npm';
123131

124132
export default function Demo() {
125133
return (
@@ -138,7 +146,7 @@ export default function Demo() {
138146

139147
```jsx mdx:preview
140148
import React from 'react';
141-
import { Github } from '@uiw/react-shields';
149+
import Github from '@uiw/react-shields/github';
142150

143151
export default function Demo() {
144152
return (
@@ -167,7 +175,7 @@ export default function Demo() {
167175

168176
```jsx mdx:preview
169177
import React from 'react';
170-
import { Github } from '@uiw/react-shields';
178+
import Github from '@uiw/react-shields/github';
171179

172180
export default function Demo() {
173181
return (
@@ -187,7 +195,7 @@ export default function Demo() {
187195

188196
```jsx mdx:preview
189197
import React from 'react';
190-
import { Github } from '@uiw/react-shields';
198+
import Github from '@uiw/react-shields/github';
191199

192200
export default function Demo() {
193201
return (
@@ -209,7 +217,7 @@ export default function Demo() {
209217

210218
```jsx mdx:preview
211219
import React from 'react';
212-
import { Github } from '@uiw/react-shields';
220+
import Github from '@uiw/react-shields/github';
213221

214222
export default function Demo() {
215223
return (
@@ -233,7 +241,7 @@ export default function Demo() {
233241

234242
```jsx mdx:preview
235243
import React from 'react';
236-
import { Github } from '@uiw/react-shields';
244+
import Github from '@uiw/react-shields/github';
237245

238246
export default function Demo() {
239247
return (
@@ -251,7 +259,7 @@ export default function Demo() {
251259

252260
```jsx mdx:preview
253261
import React from 'react';
254-
import { Github } from '@uiw/react-shields';
262+
import Github from '@uiw/react-shields/github';
255263

256264
export default function Demo() {
257265
return (
@@ -270,7 +278,7 @@ export default function Demo() {
270278

271279
```jsx mdx:preview
272280
import React from 'react';
273-
import { Coverage } from '@uiw/react-shields';
281+
import Coverage from '@uiw/react-shields/coverage';
274282

275283
export default function Demo() {
276284
return (
@@ -289,7 +297,7 @@ export default function Demo() {
289297

290298
```jsx mdx:preview
291299
import React from 'react';
292-
import { Coverage } from '@uiw/react-shields';
300+
import Coverage from '@uiw/react-shields/coverage';
293301

294302
export default function Demo() {
295303
return (

‎core/package.json

+13-8
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@
1717
"require": "./cjs/index.js",
1818
"types": "./esm/index.d.ts"
1919
},
20-
"./if": {
21-
"import": "./esm/If.js",
22-
"require": "./cjs/If.js",
23-
"types": "./esm/If.d.ts"
20+
"./npm": {
21+
"import": "./esm/npm/Npm.js",
22+
"require": "./cjs/npm/Npm.js",
23+
"types": "./esm/npm/Npm.d.ts"
2424
},
25-
"./switch": {
26-
"import": "./esm/switch.js",
27-
"require": "./cjs/switch.js",
28-
"types": "./esm/switch.d.ts"
25+
"./github": {
26+
"import": "./esm/github/Github.js",
27+
"require": "./cjs/github/Github.js",
28+
"types": "./esm/github/Github.d.ts"
29+
},
30+
"./coverage": {
31+
"import": "./esm/coverages/Coverage.js",
32+
"require": "./cjs/coverages/Coverage.js",
33+
"types": "./esm/coverages/Coverage.d.ts"
2934
}
3035
},
3136
"files": [

0 commit comments

Comments
 (0)
Please sign in to comment.