Skip to content

Commit 5f1124f

Browse files
SaerisCompuIves
authored andcommitted
✨ Follow Templates (codesandbox#2225)
* 🚧 Add MultiAction Button, Add Fonts and Breakpoints to Theme This update adds a new MultiAction Button to be used for Following Templates, a prototype can be found here: https://codesandbox.io/s/codesadbox-6vgjh Additionally, this includes some refactoring and additions to common components. Button has been updated with a new Link component. Link can be used to both create an internal or external Link using a single API, intelligently using either a React Router link or an anchor tag with the appropriate attributes. The MultiAction Button extends Button, sharing it's styles and base props, and uses Reakit under the hood to provide full keyboard accessibility. Theme has been reorganized and extended with a set of fonts taken from the design system files in Figma. Additionally a set of breakpoint utilities was added, based on those found in the React documentation site. A new `withoutProps` has been added that can be used to exclude props from being passed down to a component. This is useful for styled components, which sometimes pass down non-HTML attributes which cause console errors. Example usage can be observed in the MultiAction button elements.ts. An error was fixed in Dependencies/VersionEntry for incorrect use of selected on an option element. NotOwnedSandboxInfo now has a Follow Template button. TODO: - [ ]: Add interactivity to the Follow Template button - [ ]: Test functionality - [ ]: Incorporate requested changes * ⚡️ Add Query, Graphql Tag Loader, React Display Name Babel Plugin Added getSandboxInfo query to NotOwnedSandboxInfo component Added graphql tag loader to webpack common config Added babel plugin transform react display name to babel config Fixed ref forwarding error with withoutProps HOC TODO: - Revert API proxy in start script - Fix types for withoutProps HOC * ⚡️ Add Mutation, Add --staging Build Flag, You can now add `--staging` to `yarn start` or `yarn start:fast` to switch the API proxy from codesandbox.io to codesandbox.stream * ⚡️ Use Template ID for Mutation * Followed Templates Modal (codesandbox#2223) * try * fix netlify on static * Fix: trim space (codesandbox#2232) * Fix preview url * [Followup] Convert all Medium blogposts to Markdown (codesandbox#2219) * Cleanup articles * Update all Gatsby dependencies to latest version * Optimize images * Resolve discussions * Use official gatsby-remark-embedder package * add templates for team * 🚧 Add MultiAction Button, Add Fonts and Breakpoints to Theme This update adds a new MultiAction Button to be used for Following Templates, a prototype can be found here: https://codesandbox.io/s/codesadbox-6vgjh Additionally, this includes some refactoring and additions to common components. Button has been updated with a new Link component. Link can be used to both create an internal or external Link using a single API, intelligently using either a React Router link or an anchor tag with the appropriate attributes. The MultiAction Button extends Button, sharing it's styles and base props, and uses Reakit under the hood to provide full keyboard accessibility. Theme has been reorganized and extended with a set of fonts taken from the design system files in Figma. Additionally a set of breakpoint utilities was added, based on those found in the React documentation site. A new `withoutProps` has been added that can be used to exclude props from being passed down to a component. This is useful for styled components, which sometimes pass down non-HTML attributes which cause console errors. Example usage can be observed in the MultiAction button elements.ts. An error was fixed in Dependencies/VersionEntry for incorrect use of selected on an option element. NotOwnedSandboxInfo now has a Follow Template button. TODO: - [ ]: Add interactivity to the Follow Template button - [ ]: Test functionality - [ ]: Incorporate requested changes * ⚡️ Add Query, Graphql Tag Loader, React Display Name Babel Plugin Added getSandboxInfo query to NotOwnedSandboxInfo component Added graphql tag loader to webpack common config Added babel plugin transform react display name to babel config Fixed ref forwarding error with withoutProps HOC TODO: - Revert API proxy in start script - Fix types for withoutProps HOC * ⚡️ Add Mutation, Add --staging Build Flag, You can now add `--staging` to `yarn start` or `yarn start:fast` to switch the API proxy from codesandbox.io to codesandbox.stream * ⚡️ Use Template ID for Mutation * Followed Templates Modal (codesandbox#2223) * try * fix netlify on static * Fix: trim space (codesandbox#2232) * Fix preview url * [Followup] Convert all Medium blogposts to Markdown (codesandbox#2219) * Cleanup articles * Update all Gatsby dependencies to latest version * Optimize images * Resolve discussions * Use official gatsby-remark-embedder package * add templates for team * add most of dashboard stuff * make toggle do toggle things * unfollow on dashboard * 🚚 Move FollowTemplateButton to it's own Component * ⚡️ Add Follow/Unfollow Template Logic, Add GraphQL Codegen Config * moved components * fix tab * its something * hookup import table * fix thingx * finish import tab * done * fix some ts * fix ts * fix lint * fix lint * add my templates * add more stuff * add loading * add select for categories * add empty state * remove tsignore * fix eslint * fix ts * increase memeory * fix category reset * fix scrollbar * ✨ Add Pagination component, clamp and range utilities to Common * fix fonts * fix header * fix icon color * fix all issues * more fixes * add contrast checker * update icon package * fix weird bug * 🚧 Reorganize Create Sandbox Modal Files Committing work in progress to sync with team. * 🚧 Update modal for control via parent * update queries and mutations * update id * add ability to bookmark * fix some css * rename followed to bokmarked * add template banner * 🚧 Add Pagination to Explore Tab, Remove @types/storybook Dependencies * fix pagination * fix page numbers * add types * fix common * fix build * 🚧 Explore Tab Polish * Update package.json * Update yarn.lock * Update yarn.lock * Greatly simplify yarn.lock * Greatly deduplicate yarn.lock * Undo the Button changes for now There are some design inconsistencies and rendering artifacts with the new button, I agree that we should change the buttons, but I'd rather do this in a separate PR instead of in this huge PR. * Alter outer styles modal * Tweaks * Fix create sandbox modal * Extract template list * Add introspection of graphql * New types * Redo TemplateUniverse * Props * Intermediate * Intermediate * Improve the loading in docker * Change message of error * Create separate sandbox fragment for templates * Introduce new TemplateList * Introduce new TemplateList * Better filtering * New Explore Templates * Revert changes in browserfs * Improve all tabs in the modal * Add more typing and fix optimistic bookmarking * More typing * Remove unused code * Handle TS errors * Clean up typings from graphql * Fix tests * Try to find out what happened with jest * fix type * More types * Fix typing issue * Finally fix the clean script * Don't install deps in parallel * Fix ts issues with untyped client * Fix arrow navigation for uneven rows * Remove new users initializer * Move Create Sandbox Modal * More TS * Redo the editor with the bookmark, fix git sandboxes * Tweaks * Add 3 column support * Fix bugs * Tweak styles * Fix more arrow navigation * Fix minor bugs * Merge branch master in follow-templates * Put actions back * Fix * Fix arrow navigation * Dynamically resize columns in create sandbox modal * So many improvements! * Change icon and shortcuts * wait for authenticating before showing right side of navigation * Add first visit indication to welcome, and fix wrong isAuthenticating state usage * Add git to template * Theme tweaks * Styling changes
1 parent 675cfd7 commit 5f1124f

File tree

260 files changed

+10065
-2393
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+10065
-2393
lines changed

.circleci/config.yml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ aliases:
2525

2626
- &restore_deps_cache
2727
keys:
28-
- v29-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
29-
- v29-dependency-cache-{{ .Branch }}
30-
- v29-dependency-cache
28+
- v30-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
29+
- v30-dependency-cache-{{ .Branch }}
30+
- v30-dependency-cache
3131

3232
- &save_deps_cache
33-
key: v29-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
33+
key: v30-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
3434
paths:
3535
- node_modules
3636
- packages/app/node_modules
@@ -49,51 +49,51 @@ aliases:
4949

5050
- &restore_standalone_deps_cache
5151
keys:
52-
- v29-standalone-dependency-cache-{{ .Branch }}-{{ checksum
52+
- v30-standalone-dependency-cache-{{ .Branch }}-{{ checksum
5353
"standalone-packages/codesandbox-browserfs/yarn.lock" }}
54-
- v29-standalone-dependency-cache-{{ .Branch }}
55-
- v29-standalone-dependency-cache
54+
- v30-standalone-dependency-cache-{{ .Branch }}
55+
- v30-standalone-dependency-cache
5656

5757
- &save_standalone_deps_cache
5858
key:
59-
v29-standalone-dependency-cache-{{ .Branch }}-{{ checksum
59+
v30-standalone-dependency-cache-{{ .Branch }}-{{ checksum
6060
"standalone-packages/codesandbox-browserfs/yarn.lock" }}
6161
paths:
6262
- standalone-packages/codesandbox-browserfs/node_modules
6363

6464
- &restore_prod_homepage_cache
65-
key: v29-prod-homepage-build-cache-master
65+
key: v30-prod-homepage-build-cache-master
6666

6767
- &restore_prod_result
6868
key:
69-
v29-prod-build-result-{{ .Environment.CIRCLE_BRANCH
69+
v30-prod-build-result-{{ .Environment.CIRCLE_BRANCH
7070
}}-{{.Environment.CIRCLE_SHA1 }}
7171

7272
- &save_prod_build_cache
7373
key:
74-
v29-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
74+
v30-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
7575
}}-{{.Environment.CIRCLE_SHA1 }}
7676
paths:
7777
- packages/app/node_modules/.cache
7878

7979
- &restore_prod_build_cache
8080
keys:
81-
- v29-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
81+
- v30-prod-build-cache-{{ .Environment.CIRCLE_BRANCH
8282
}}-{{.Environment.CIRCLE_SHA1 }}
83-
- v29-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-
84-
- v29-prod-build-cache-master-
83+
- v30-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-
84+
- v30-prod-build-cache-master-
8585

8686
# To persist the images built by sharp
8787
- &save_prod_homepage_cache
8888
key:
89-
v29-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{
89+
v30-prod-homepage-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{
9090
.Environment.CIRCLE_SHA1 }}
9191
paths:
9292
- ./packages/homepage/public
9393

9494
- &save_prod_result
9595
key:
96-
v29-prod-build-result-{{ .Environment.CIRCLE_BRANCH }}-{{
96+
v30-prod-build-result-{{ .Environment.CIRCLE_BRANCH }}-{{
9797
.Environment.CIRCLE_SHA1 }}
9898
paths:
9999
- ./www
@@ -134,14 +134,14 @@ commands:
134134
steps:
135135
- restore_cache:
136136
keys:
137-
- v29-source-cache-{{ .Branch }}-{{ .Revision }}
138-
- v29-source-cache-{{ .Branch }}-
139-
- v29-source-cache-
137+
- v30-source-cache-{{ .Branch }}-{{ .Revision }}
138+
- v30-source-cache-{{ .Branch }}-
139+
- v30-source-cache-
140140

141141
- checkout
142142

143143
- save_cache:
144-
key: v29-source-cache-{{ .Branch }}-{{ .Revision }}
144+
key: v30-source-cache-{{ .Branch }}-{{ .Revision }}
145145
paths:
146146
- '.git'
147147
build_deps:
@@ -245,6 +245,9 @@ commands:
245245
command:
246246
'[ -n "<< parameters.user >>" ] && echo << parameters.password >> |
247247
docker login -u << parameters.user >> --password-stdin || true'
248+
- run:
249+
name: Create DockerIgnore
250+
command: echo '**\n!www' > .dockerignore
248251
- run:
249252
name: Create Image
250253
command:

.dockerignore

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,30 @@
1-
*
2-
!www
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
# we use yarn
6+
package-lock.json
7+
8+
/integration-tests/**/__diff_output__
9+
10+
# testing
11+
coverage
12+
13+
# production
14+
build
15+
www
16+
.deliver
17+
18+
# misc
19+
.DS_Store
20+
npm-debug.log
21+
yarn-error.log
22+
.idea
23+
jest
24+
25+
lerna-debug.log
26+
27+
standalone-packages/monaco-editor-core
28+
29+
.next
30+
.cache-loader

.graphqlconfig.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
projects:
2+
app:
3+
schemaPath: packages/app/src/app/graphql/schema.graphql
4+
extensions:
5+
endpoints:
6+
default: 'https://codesandbox.io/api/graphql'
7+
staging: 'https://codesandbox.stream/api/graphql'
8+
dev: 'http://localhost:4000/api/graphql'

.yarnclean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,10 @@ wercker.yml
4545

4646
@types/react-native
4747
packages/app/node_modules/styled-components
48+
49+
# Prevent duplicate graphql. This doesn't seem to break anything
50+
@divyenduz/ts-graphql-plugin/node_modules/**
51+
graphql-config/node_modules/**
52+
53+
# Issue with jest conflicting with jest-styled-components
54+
jest-styled-components/typings/**

docker/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM node:10
22
LABEL maintainer "Ives van Hoorne"
33

4-
RUN mkdir /usr/src/app
4+
RUN mkdir /workspace
5+
COPY * /workspace/
56

6-
WORKDIR /usr/src/app
7+
WORKDIR /workspace

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"now-build": "yarn build:deps && lerna run build:storybook --scope @codesandbox/common",
4545
"start": "yarn build:deps && lerna run start --scope @codesandbox/common --scope app --parallel",
4646
"start:common": "lerna run start --scope @codesandbox/common --stream",
47-
"start:dev_api": "lerna run start:dev_api --scope app --stream",
47+
"start:dev_api": "concurrently --raw \"cd packages/app && yarn start:dev_api\" \"cd packages/common && yarn start\"",
4848
"start:dynamic": "lerna run dev --scope dynamic-pages --stream",
4949
"start:fast": "concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\"",
5050
"start:home": "yarn build:deps && yarn start:home:fast",

packages/app/config/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ const { SANDBOX_ONLY } = process.env;
33
const staticAssets = [
44
!SANDBOX_ONLY && {
55
from: 'standalone-packages/vscode-editor/release/min/vs',
6-
to: 'public/vscode25/vs',
6+
to: 'public/vscode26/vs',
77
},
88
!SANDBOX_ONLY && {
99
from: 'standalone-packages/vscode-extensions/out',
10-
to: 'public/vscode-extensions/v11',
10+
to: 'public/vscode-extensions/v12',
1111
},
1212
!SANDBOX_ONLY && {
1313
from: 'node_modules/onigasm/lib/onigasm.wasm',

packages/app/config/webpack.common.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ module.exports = {
162162

163163
module: {
164164
rules: [
165+
{
166+
test: /\.(graphql|gql)$/,
167+
exclude: /node_modules/,
168+
loader: `graphql-tag/loader`,
169+
},
165170
{
166171
test: /\.wasm$/,
167172
loader: 'file-loader',

packages/app/config/webpack.prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ module.exports = merge(commonConfig, {
180180
},
181181
},
182182
{
183-
urlPattern: /\/vscode25/,
183+
urlPattern: /\/vscode26/,
184184
handler: 'cacheFirst',
185185
options: {
186186
cache: {

packages/app/package.json

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"build": "cross-env NODE_ENV=production NODE_OPTIONS=\"--max-old-space-size=4096\" node scripts/build.js",
1313
"build:stats": "cross-env NODE_ENV=production NODE_OPTIONS=\"--max-old-space-size=4096\" webpack --env production --config config/webpack.prod.js --json --profile --progress > stats.json && node scripts/stats",
1414
"build:clean": "rimraf www",
15+
"graphql:replace-schema": "sed -i'' 's/RootQueryType/RootQuery/g' ./src/app/graphql/schema.graphql && sed -i'' 's/RootMutationType/RootMutation/g' ./src/app/graphql/schema.graphql",
16+
"generate:graphql": "graphql get-schema --project app && yarn graphql:replace-schema && graphql-codegen --config ./scripts/codegen.js",
17+
"generate:graphql:staging": "graphql get-schema -e staging --project app && yarn graphql:replace-schema && graphql-codegen --config ./scripts/codegen.js --staging",
1518
"build:embed": "cross-env NODE_ENV=production webpack --config config/webpack.embed.js",
1619
"build:sandbox": "cross-env NODE_ENV=production SANDBOX_ONLY=true node scripts/build.js && yarn copy-assets",
1720
"build:sandpack-sandbox": "cross-env NODE_ENV=production SANDPACK=true SANDBOX_ONLY=true node scripts/build.js && cross-env SANDBOX_ONLY=true yarn copy-assets",
@@ -67,11 +70,11 @@
6770
]
6871
},
6972
"dependencies": {
70-
"@apollo/react-hooks": "^0.1.0-beta.2",
73+
"@apollo/react-hooks": "^3.0.1",
7174
"@babel/plugin-transform-destructuring": "^7.5.0",
7275
"@babel/preset-env": "^7.5.5",
7376
"@codesandbox/executors": "^0.1.0",
74-
"@codesandbox/template-icons": "^1.0.1",
77+
"@codesandbox/template-icons": "^1.0.2",
7578
"@emmetio/codemirror-plugin": "^0.3.5",
7679
"@sentry/webpack-plugin": "^1.8.0",
7780
"@styled-system/css": "^5.0.23",
@@ -117,7 +120,7 @@
117120
"fuse.js": "^3.2.1",
118121
"geniejs": "^0.5.1",
119122
"glamor": "^2.20.25",
120-
"graphql": "^14.1.1",
123+
"graphql": "^14.5.8",
121124
"graphql-tag": "^2.10.1",
122125
"gsap": "^1.20.3",
123126
"gulp": "^3.9.1",
@@ -143,7 +146,6 @@
143146
"lodash-es": "^4.17.2",
144147
"lru-cache": "^4.1.3",
145148
"match-sorter": "^1.8.1",
146-
"memoize-one": "^4.0.0",
147149
"minimatch": "^3.0.4",
148150
"mobx": "^5.11.0",
149151
"mobx-react": "^6.1.1",
@@ -173,6 +175,7 @@
173175
"react-addons-css-transition-group": "^15.6.0",
174176
"react-apollo": "^2.5.6",
175177
"react-color": "^2.17.3",
178+
"react-content-loader": "^4.2.2",
176179
"react-day-picker": "^7.2.4",
177180
"react-devtools-inline": "^4.0.0",
178181
"react-dnd": "^7.0.2",
@@ -183,13 +186,14 @@
183186
"react-icons": "^2.2.7",
184187
"react-input-autosize": "^2.2.1",
185188
"react-inspector": "^2.2.0",
186-
"react-instantsearch": "^5.3.2",
189+
"react-instantsearch": "^5.7.0",
187190
"react-loadable": "^3.3.1",
188191
"react-media": "^1.9.2",
189192
"react-modal": "^3.6.1",
190193
"react-motion": "^0.5.0",
191194
"react-outside-click-handler": "^1.2.3",
192-
"react-router-dom": "^4.3.1",
195+
"react-router-dom": "^5.0.1",
196+
"react-scrollbars-custom": "^4.0.20",
193197
"react-show": "^3.0.4",
194198
"react-split-pane": "^0.1.87",
195199
"react-spring": "^8.0.25",
@@ -233,17 +237,25 @@
233237
"@babel/preset-flow": "^7.0.0",
234238
"@babel/preset-react": "^7.0.0",
235239
"@babel/preset-typescript": "^7.3.3",
240+
"@divyenduz/ts-graphql-plugin": "^0.1.0",
241+
"@graphql-codegen/cli": "^1.8.2",
242+
"@graphql-codegen/fragment-matcher": "^1.8.2",
243+
"@graphql-codegen/typescript": "^1.8.2",
244+
"@graphql-codegen/typescript-graphql-files-modules": "^1.8.2",
245+
"@graphql-codegen/typescript-operations": "^1.8.2",
236246
"@sentry/cli": "^1.47.1",
237247
"@types/codemirror": "^0.0.72",
238248
"@types/debug": "^4.1.1",
239249
"@types/gsap": "^1.20.1",
250+
"@types/jest": "24.0.13",
240251
"@types/lodash-es": "^4.17.2",
241252
"@types/phoenix": "^1.4.0",
242253
"@types/prop-types": "^15.7.0",
243254
"@types/react": "^16.8.12",
244255
"@types/react-dom": "^16.8.3",
245256
"@types/react-helmet": "^5.0.11",
246257
"@types/react-icons": "2.2.7",
258+
"@types/react-instantsearch": "^5.2.3",
247259
"@types/react-router-dom": "^4.3.1",
248260
"@types/react-stripe-elements": "^1.3.2",
249261
"@types/resolve": "^0.0.8",
@@ -262,6 +274,7 @@
262274
"buffer-loader": "^0.0.1",
263275
"case-sensitive-paths-webpack-plugin": "^2.0.0",
264276
"chalk": "1.1.3",
277+
"codesandbox": "^2.1.10",
265278
"codesandbox-deps": "^0.1.1",
266279
"connect-history-api-fallback": "1.3.0",
267280
"copy-webpack-plugin": "^5.0.3",
@@ -274,16 +287,17 @@
274287
"file-loader": "^1.1.11",
275288
"filesize": "^3.5.6",
276289
"fs-extra": "^8.0.1",
290+
"graphql-cli": "^3.0.14",
277291
"gulp-replace": "^0.5.4",
278292
"gzip-size": "3.0.0",
279293
"html-loader": "^0.5.5",
280294
"html-webpack-plugin": "^4.0.0-beta.1",
281295
"http-proxy-middleware": "^0.17.3",
282296
"imagemin-webpack-plugin": "^2.4.2",
283-
"jest": "^24.8.0",
297+
"jest": "^24.9.0",
284298
"jest-image-snapshot": "^1.0.1",
285299
"jest-junit": "^3.4.1",
286-
"jest-styled-components": "6.3.3",
300+
"jest-styled-components": "6.3.4",
287301
"mini-css-extract-plugin": "^0.8.0",
288302
"object-assign": "^4.1.1",
289303
"opn": "4.0.2",

0 commit comments

Comments
 (0)