Skip to content

Commit baf5d21

Browse files
authored
Components package (#3256)
* start * setup packages * update packages * add missing dep * try to fix build * readd test files * no duplication * fix jest * fix ts * ts * add np * small fixes * remove some ts-irgnore * fix rbg colors * fixed yarn * remove unsed deps * re add ts * update circle ci * revert more ts * more ts fixing
1 parent 554e4be commit baf5d21

File tree

29 files changed

+4720
-90
lines changed

29 files changed

+4720
-90
lines changed

.circleci/config.yml

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ aliases:
1313
paths:
1414
- packages/codesandbox-api/dist
1515
- packages/common/lib
16+
- packages/components/lib
1617
- packages/deps/dist
1718
- packages/executors/dist
1819
- packages/node-services/lib
@@ -25,17 +26,18 @@ aliases:
2526

2627
- &restore_deps_cache
2728
keys:
28-
- v30-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
29-
- v30-dependency-cache-{{ .Branch }}
30-
- v30-dependency-cache
29+
- v31-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
30+
- v31-dependency-cache-{{ .Branch }}
31+
- v31-dependency-cache
3132

3233
- &save_deps_cache
33-
key: v30-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
34+
key: v31-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
3435
paths:
3536
- node_modules
3637
- packages/app/node_modules
3738
- packages/chrome-extension/node_modules
3839
- packages/codesandbox-api/node_modules
40+
- packages/components/node_modules
3941
- packages/common/node_modules
4042
- packages/dynamic-pages/node_modules
4143
- packages/deps/node_modules
@@ -49,51 +51,51 @@ aliases:
4951

5052
- &restore_standalone_deps_cache
5153
keys:
52-
- v30-standalone-dependency-cache-{{ .Branch }}-{{ checksum
54+
- v31-standalone-dependency-cache-{{ .Branch }}-{{ checksum
5355
"standalone-packages/codesandbox-browserfs/yarn.lock" }}
54-
- v30-standalone-dependency-cache-{{ .Branch }}
55-
- v30-standalone-dependency-cache
56+
- v31-standalone-dependency-cache-{{ .Branch }}
57+
- v31-standalone-dependency-cache
5658

5759
- &save_standalone_deps_cache
5860
key:
59-
v30-standalone-dependency-cache-{{ .Branch }}-{{ checksum
61+
v31-standalone-dependency-cache-{{ .Branch }}-{{ checksum
6062
"standalone-packages/codesandbox-browserfs/yarn.lock" }}
6163
paths:
6264
- standalone-packages/codesandbox-browserfs/node_modules
6365

6466
- &restore_prod_homepage_cache
65-
key: v30-prod-homepage-build-cache-master
67+
key: v31-prod-homepage-build-cache-master
6668

6769
- &restore_prod_result
6870
key:
69-
v30-prod-build-result-{{ .Environment.CIRCLE_BRANCH
71+
v31-prod-build-result-{{ .Environment.CIRCLE_BRANCH
7072
}}-{{.Environment.CIRCLE_SHA1 }}
7173

7274
- &save_prod_build_cache
7375
key:
74-
v30-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
76+
v31-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
7577
}}-{{.Environment.CIRCLE_SHA1 }}
7678
paths:
7779
- packages/app/node_modules/.cache
7880

7981
- &restore_prod_build_cache
8082
keys:
81-
- v30-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
83+
- v31-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
8284
}}-{{.Environment.CIRCLE_SHA1 }}
83-
- v30-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-
84-
- v30-prod-build-cache-master-
85+
- v31-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-
86+
- v31-prod-build-cache-master-
8587

8688
# To persist the images built by sharp
8789
- &save_prod_homepage_cache
8890
key:
89-
v30-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{
91+
v31-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{
9092
.Environment.CIRCLE_SHA1 }}
9193
paths:
9294
- ./packages/homepage/public
9395

9496
- &save_prod_result
9597
key:
96-
v30-prod-build-result-{{ .Environment.CIRCLE_BRANCH }}-{{
98+
v31-prod-build-result-{{ .Environment.CIRCLE_BRANCH }}-{{
9799
.Environment.CIRCLE_SHA1 }}
98100
paths:
99101
- ./www
@@ -134,14 +136,14 @@ commands:
134136
steps:
135137
- restore_cache:
136138
keys:
137-
- v30-source-cache-{{ .Branch }}-{{ .Revision }}
138-
- v30-source-cache-{{ .Branch }}-
139-
- v30-source-cache-
139+
- v31-source-cache-{{ .Branch }}-{{ .Revision }}
140+
- v31-source-cache-{{ .Branch }}-
141+
- v31-source-cache-
140142

141143
- checkout
142144

143145
- save_cache:
144-
key: v30-source-cache-{{ .Branch }}-{{ .Revision }}
146+
key: v31-source-cache-{{ .Branch }}-{{ .Revision }}
145147
paths:
146148
- '.git'
147149
build_deps:
@@ -194,6 +196,8 @@ commands:
194196
./packages/app/integration-tests/BrowserStackLocal --key
195197
$BROWSER_STACK_KEY || true'
196198
background: true
199+
- run:
200+
command: npm run chromatic
197201
- run:
198202
name: Test Integrations
199203
command: |

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"packages/app",
1313
"packages/homepage",
1414
"packages/common",
15+
"packages/components",
1516
"packages/codesandbox-api",
1617
"packages/node-services",
1718
"packages/sandbox-hooks",
@@ -32,6 +33,7 @@
3233
"build": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" yarn build:deps && yarn build:prod",
3334
"build:clean": "lerna run build:clean --scope app --scope homepage && rimraf www",
3435
"build:common": "lerna run build:dev --scope @codesandbox/common --stream",
36+
"build:components": "lerna run build:dev --scope @codesandbox/components --stream",
3537
"build:deps": "lerna run build:dev",
3638
"build:dynamic": "lerna run build --scope dynamic-pages --stream",
3739
"build:embed": "lerna run build:embed --scope app --stream && gulp",
@@ -42,11 +44,12 @@
4244
"contributors:generate": "all-contributors generate",
4345
"lint": "lerna run lint --stream",
4446
"now-build": "yarn build:deps && lerna run build:storybook --scope @codesandbox/common",
45-
"start": "yarn build:deps && lerna run start --scope @codesandbox/common --scope app --parallel",
47+
"start": "yarn build:deps && lerna run start --scope @codesandbox/common --scope @codesandbox/components --scope app --parallel",
4648
"start:common": "lerna run start --scope @codesandbox/common --stream",
47-
"start:dev_api": "concurrently --raw \"cd packages/app && yarn start:dev_api\" \"cd packages/common && yarn start\"",
49+
"start:components": "lerna run start --scope @codesandbox/components --stream",
50+
"start:dev_api": "concurrently --raw \"cd packages/app && yarn start:dev_api\" \"cd packages/common && yarn start\" \"cd packages/components && yarn start\"",
4851
"start:dynamic": "lerna run dev --scope dynamic-pages --stream",
49-
"start:fast": "concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\"",
52+
"start:fast": "concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\" \"cd packages/components && yarn start\"",
5053
"start:home": "yarn build:deps && yarn start:home:fast",
5154
"start:home:fast": "cd packages/homepage && yarn start",
5255
"start:overmind": "yarn build:deps && concurrently \"lerna run start --scope app --stream\" \"overmind-devtools\"",
@@ -58,6 +61,7 @@
5861
"test:ci": "lerna run test --ignore codesandbox-browserfs -- --ci --testResultsProcessor=\"jest-junit\" ",
5962
"test:integrations": "lerna exec --scope app --stream -- yarn test:integrations",
6063
"test:jest-lite": "lerna exec --scope app --stream -- yarn run test jest-lite --watch --coverage",
64+
"chromatic": "lerna run chromatic --scope=@codesandbox/components --stream",
6165
"typecheck": "lerna run typecheck"
6266
},
6367
"dependencies": {

packages/app/src/app/pages/Dashboard/Sidebar/SandboxesItem/FolderEntry/elements.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import styled from 'styled-components';
22
import { NavLink } from 'react-router-dom';
33
import ChevronRight from 'react-icons/lib/md/chevron-right';
44

5-
export const Container = styled(NavLink)<{ depth?: number }>`
5+
export const Container = styled(NavLink)<{
6+
depth?: number;
7+
}>`
68
transition: 0.25s ease all;
79
display: flex;
810
align-items: center;

packages/app/src/app/pages/Profile/Showcase/SandboxInfo/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const SandboxInfo: FunctionComponent<Props> = ({ sandbox }) => {
2929
<Container>
3030
<Row alignItems="center">
3131
<Title>
32-
{getSandboxName(sandbox)}{' '}
32+
{getSandboxName(sandbox)} {''}
3333
{isLoggedIn ? <Like sandbox={sandbox} /> : null}
3434
</Title>
3535
</Row>

packages/app/src/app/pages/Sandbox/Editor/Workspace/Chat/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,17 @@ export const Chat: React.FC = () => {
112112
<AutosizeTextArea
113113
useCacheForDOMMeasurements
114114
value={value}
115+
// @ts-ignore
115116
onChange={handleChange}
116117
placeholder="Send a message..."
117118
style={{
118119
width: '100%',
119120
minHeight: height,
120121
marginTop: '0.5rem',
121122
}}
123+
// @ts-ignore
122124
onKeyDown={handleKeyDown}
125+
// @ts-ignore
123126
onHeightChange={setHeight}
124127
/>
125128
</Container>

packages/app/src/app/pages/Sandbox/Editor/Workspace/Dependencies/AddFont/FontPicker/elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ background-color: ${theme['input.background'] || 'rgba(0, 0, 0, 0.3)'};
108108
top: 50%;
109109
transform: translateY(-50%);
110110
}
111-
`};æ
111+
`};
112112
`;
113113

114114
export const Arrow = styled.div`

packages/app/src/app/pages/common/LikeHeart/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Sandbox } from '@codesandbox/common/lib/types';
2-
import React, { ComponentProps, FunctionComponent } from 'react';
2+
import React, { FunctionComponent, ComponentProps } from 'react';
33

44
import { useOvermind } from 'app/overmind';
55

@@ -22,6 +22,7 @@ type Props = {
2222
ComponentProps<typeof Container>,
2323
'className' | 'highlightHover' | 'style'
2424
>;
25+
2526
export const LikeHeart: FunctionComponent<Props> = ({
2627
className,
2728
colorless,

packages/app/src/app/pages/common/Modals/FeedbackModal/Feedback.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const Feedback: FunctionComponent<Props> = ({ id, user }) => {
8585
<AutosizeTextArea
8686
minRows={3}
8787
name="feedback"
88+
// @ts-ignore
8889
onChange={onChange}
8990
placeholder="What are your thoughts?"
9091
required

packages/app/src/embed/components/Sidebar/SandboxInfo/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@ export const SandboxInfo: FunctionComponent<Props> = ({ sandbox }) => {
1515
return (
1616
<Container>
1717
<Title title={title}>{title}</Title>
18-
1918
{sandbox.description && <Description>{sandbox.description}</Description>}
20-
2119
{sandbox.author && (
2220
<AvatarBlock
2321
url={sandbox.author.avatarUrl}
2422
name={sandbox.author.username}
2523
/>
2624
)}
27-
2825
<Stats {...sandbox} />
2926
</Container>
3027
);

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"ot": "^0.0.15",
6767
"react": "^16.8.6",
6868
"react-icons": "^2.2.7",
69-
"react-input-autosize": "^2.2.1",
69+
"react-input-autosize": "2.2.1",
7070
"react-router-dom": "^5.0.1",
7171
"react-spring": "^8.0.25",
7272
"react-textarea-autosize": "^6.1.0",

0 commit comments

Comments
 (0)