Skip to content

Commit bc23257

Browse files
authored
Merge pull request #75 from solved-ac/feature/modern-bulid
feat: modify build to support vite
2 parents f6fecf4 + 73e06a2 commit bc23257

File tree

4 files changed

+141
-12
lines changed

4 files changed

+141
-12
lines changed

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
{
22
"name": "@solved-ac/ui-react",
3-
"version": "0.6.3",
3+
"version": "0.6.4",
44
"description": "React component library used by solved.ac",
55
"author": "shiftpsh",
66
"license": "MIT",
77
"repository": "solved-ac/ui-react",
88
"homepage": "https://github.com/solved-ac/ui-react",
9-
"main": "dist/index.js",
10-
"source": "src/index.tsx",
9+
"main": "./dist/index.js",
10+
"source": "./src/index.tsx",
11+
"module": "./dist/index.modern.mjs",
12+
"types": "./dist/index.d.ts",
13+
"exports": {
14+
".": {
15+
"types": "./dist/index.d.ts",
16+
"import": "./dist/index.modern.mjs",
17+
"require": "./dist/index.js"
18+
}
19+
},
1120
"engines": {
1221
"node": ">=10"
1322
},
@@ -57,7 +66,6 @@
5766
"babel-plugin-inline-react-svg": "^2.0.1",
5867
"babel-plugin-transform-react-jsx": "^6.24.1",
5968
"cross-env": "^7.0.2",
60-
"emotion-reset": "^3.0.1",
6169
"eslint": "^8.15.0",
6270
"eslint-config-airbnb": "^18.2.1",
6371
"eslint-config-prettier": "^6.7.0",

src/styles/GlobalStyles.tsx

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,136 @@
11
import { css, Global, SerializedStyles, useTheme } from '@emotion/react'
2-
import emotionReset from 'emotion-reset'
32
import { buttons, textInputs, transparentize } from 'polished'
43
import React from 'react'
54
import { SolvedTheme } from './Themes'
65

6+
const reset = css`
7+
html,
8+
body,
9+
div,
10+
span,
11+
applet,
12+
object,
13+
iframe,
14+
h1,
15+
h2,
16+
h3,
17+
h4,
18+
h5,
19+
h6,
20+
p,
21+
blockquote,
22+
pre,
23+
a,
24+
abbr,
25+
acronym,
26+
address,
27+
big,
28+
cite,
29+
code,
30+
del,
31+
dfn,
32+
em,
33+
img,
34+
ins,
35+
kbd,
36+
q,
37+
s,
38+
samp,
39+
small,
40+
strike,
41+
strong,
42+
sub,
43+
sup,
44+
tt,
45+
var,
46+
b,
47+
u,
48+
i,
49+
center,
50+
dl,
51+
dt,
52+
dd,
53+
ol,
54+
ul,
55+
li,
56+
fieldset,
57+
form,
58+
label,
59+
legend,
60+
table,
61+
caption,
62+
tbody,
63+
tfoot,
64+
thead,
65+
tr,
66+
th,
67+
td,
68+
article,
69+
aside,
70+
canvas,
71+
details,
72+
embed,
73+
figure,
74+
figcaption,
75+
footer,
76+
header,
77+
hgroup,
78+
menu,
79+
nav,
80+
output,
81+
ruby,
82+
section,
83+
summary,
84+
time,
85+
mark,
86+
audio,
87+
video {
88+
margin: 0;
89+
padding: 0;
90+
border: 0;
91+
font-size: 100%;
92+
font: inherit;
93+
vertical-align: baseline;
94+
}
95+
article,
96+
aside,
97+
details,
98+
figcaption,
99+
figure,
100+
footer,
101+
header,
102+
hgroup,
103+
menu,
104+
nav,
105+
section {
106+
display: block;
107+
}
108+
body {
109+
line-height: 1;
110+
}
111+
ol,
112+
ul {
113+
list-style: none;
114+
}
115+
blockquote,
116+
q {
117+
quotes: none;
118+
}
119+
blockquote:before,
120+
blockquote:after,
121+
q:before,
122+
q:after {
123+
content: '';
124+
content: none;
125+
}
126+
table {
127+
border-collapse: collapse;
128+
border-spacing: 0;
129+
}
130+
`
131+
7132
const globalCss = (theme: SolvedTheme): SerializedStyles => css`
8-
${emotionReset}
133+
${reset}
9134
10135
* {
11136
box-sizing: border-box;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"compilerOptions": {
33
"outDir": "dist",
4-
"module": "esnext",
4+
"module": "ESNext",
5+
"target": "ESNext",
56
"lib": ["dom", "esnext"],
67
"moduleResolution": "node",
78
"jsx": "react",

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4475,11 +4475,6 @@ emojis-list@^3.0.0:
44754475
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
44764476
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
44774477

4478-
emotion-reset@^3.0.1:
4479-
version "3.0.1"
4480-
resolved "https://registry.yarnpkg.com/emotion-reset/-/emotion-reset-3.0.1.tgz#1445e66bab7e8fd9975ce0d8cd3324589981f0a6"
4481-
integrity sha512-v6scW83qSu+wtxg7lX1s0+/2U4EAAGFxDQMkvXE10jhKtyuXCzy3/su5/MU9ZjXeNv6ZjxZH51WktrKosKUy9g==
4482-
44834478
encodeurl@~1.0.2:
44844479
version "1.0.2"
44854480
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"

0 commit comments

Comments
 (0)