Skip to content

Commit bed89b4

Browse files
Merge branch 'master' into use-overmind-modals
2 parents 947a2d8 + 7361ce8 commit bed89b4

File tree

189 files changed

+5744
-2210
lines changed

Some content is hidden

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

189 files changed

+5744
-2210
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,15 @@
14401440
"contributions": [
14411441
"code"
14421442
]
1443+
},
1444+
{
1445+
"login": "22PoojaGaur",
1446+
"name": "Pooja Gaur",
1447+
"avatar_url": "https://avatars2.githubusercontent.com/u/43316760?v=4",
1448+
"profile": "https://github.com/22PoojaGaur",
1449+
"contributions": [
1450+
"code"
1451+
]
14431452
}
14441453
],
14451454
"contributorsPerLine": 7,

.circleci/config.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,6 @@ commands:
168168
- run:
169169
name: Build Application
170170
command: yarn build:prod
171-
- run:
172-
name: Mark Sentry release
173-
command: |
174-
if [ "${CIRCLE_BRANCH}" == "master" ]; then
175-
node packages/app/scripts/sentry-create-release.js
176-
fi
177171
- save_cache: *save_prod_build_cache
178172
- save_cache: *save_prod_result
179173
- run:
@@ -302,6 +296,34 @@ jobs:
302296
executor: docker_machine
303297
steps:
304298
- docker_cache
299+
deploy-to-production:
300+
executor: node
301+
environment:
302+
ENVIRONMENT: production
303+
steps:
304+
- checkout_with_cache
305+
- restore_cache: *restore_deps_cache
306+
- attach_workspace: *attach_deps_workspace
307+
- run:
308+
name: Mark Sentry release
309+
command: node packages/app/scripts/sentry-create-release.js
310+
- run:
311+
name: Deploy Image
312+
command: node packages/app/scripts/deploy.js
313+
- run:
314+
name: Deploy Sentry release
315+
command: node packages/app/scripts/sentry-deploy-release.js
316+
deploy-to-staging:
317+
executor: node
318+
environment:
319+
ENVIRONMENT: staging
320+
steps:
321+
- checkout_with_cache
322+
- restore_cache: *restore_deps_cache
323+
- attach_workspace: *attach_deps_workspace
324+
- run:
325+
name: Deploy Image
326+
command: node packages/app/scripts/deploy.js
305327

306328
################################
307329
# Workflows
@@ -334,3 +356,23 @@ workflows:
334356
- typecheck
335357
# - test-integrations
336358
- test-jest
359+
- deploy-production-approval:
360+
type: approval
361+
filters:
362+
branches:
363+
only:
364+
- master
365+
- deploy-to-production:
366+
requires:
367+
- deploy-production-approval
368+
- create-docker-image
369+
filters:
370+
branches:
371+
only:
372+
- master
373+
- deploy-staging-approval:
374+
type: approval
375+
- deploy-to-staging:
376+
requires:
377+
- deploy-staging-approval
378+
- create-docker-image

.eslintrc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,7 @@
2727
"import/no-cycle": "warn",
2828
"react/prop-types": 0,
2929
"arrow-parens": 0,
30-
"prefer-destructuring": [
31-
"error",
32-
{
33-
"VariableDeclarator": {
34-
"array": false,
35-
"object": true
36-
},
37-
"AssignmentExpression": {
38-
"array": false,
39-
"object": false
40-
}
41-
}
42-
],
30+
"prefer-destructuring": 0,
4331
"no-async-promise-executor": "warn",
4432
"import/prefer-default-export": 0,
4533
"class-methods-use-this": 0,

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
# [CodeSandbox](https://codesandbox.io) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/codesandbox) [![All Contributors](https://img.shields.io/badge/all_contributors-153-orange.svg?style=flat-square)](#contributors-) [![CircleCI](https://circleci.com/gh/codesandbox/codesandbox-client.svg?style=svg)](https://circleci.com/gh/codesandbox/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/) [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
1+
<p align="center">
2+
<a href="https://codesandbox.io">
3+
<img src="https://user-images.githubusercontent.com/1863771/68405395-5020f400-0180-11ea-8818-8cb255d9fe71.png" height="200px">
4+
</a>
5+
</p>
6+
7+
&nbsp;
8+
9+
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/codesandbox)
10+
[![All Contributors](https://img.shields.io/badge/all_contributors-153-orange.svg?style=flat-square)](#contributors-)
11+
[![CircleCI](https://circleci.com/gh/codesandbox/codesandbox-client.svg?style=svg)](https://circleci.com/gh/codesandbox/codesandbox-client)
12+
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)
13+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
14+
[![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
15+
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
216

317
[![Backers on Open Collective](https://opencollective.com/codesandbox/backers/badge.svg)](#backers)
418
[![Sponsors on Open Collective](https://opencollective.com/codesandbox/sponsors/badge.svg)](#sponsors)
519

6-
![Banner](https://codesandbox.io/static/img/banner.png)
7-
820
An online code editor tailored for web applications.
921

1022
This project was bootstrapped with
@@ -240,6 +252,7 @@ Thanks goes to these wonderful people
240252
<td align="center"><a href="https://github.com/milap1296"><img src="https://avatars2.githubusercontent.com/u/19545730?v=4" width="100px;" alt="milap1296"/><br /><sub><b>milap1296</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=milap1296" title="Code">💻</a></td>
241253
<td align="center"><a href="http://yevhenorlov.com"><img src="https://avatars2.githubusercontent.com/u/17388747?v=4" width="100px;" alt="yevhen orlov"/><br /><sub><b>yevhen orlov</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=yevhenorlov" title="Code">💻</a></td>
242254
<td align="center"><a href="https://github.com/NileshPatel17"><img src="https://avatars2.githubusercontent.com/u/27020381?v=4" width="100px;" alt="Nilesh Patel"/><br /><sub><b>Nilesh Patel</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=NileshPatel17" title="Code">💻</a></td>
255+
<td align="center"><a href="https://github.com/22PoojaGaur"><img src="https://avatars2.githubusercontent.com/u/43316760?v=4" width="100px;" alt="Pooja Gaur"/><br /><sub><b>Pooja Gaur</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=22PoojaGaur" title="Code">💻</a></td>
243256
</tr>
244257
</table>
245258

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
"husky": "^2.2.0",
8686
"lerna": "^3.16.4",
8787
"lint-staged": "^9.2.5",
88-
"prettier": "1.17.0",
88+
"prettier": "1.19.0",
8989
"pretty-quick": "^1.10.0",
90-
"typescript": "3.6.3",
90+
"typescript": "3.7.2",
9191
"username": "^5.1.0"
9292
},
9393
"husky": {

packages/app/config/build.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ const staticAssets = [
2929
from: 'packages/app/static',
3030
to: 'static',
3131
},
32+
{
33+
from: isDev
34+
? 'standalone-packages/codesandbox-browserfs/build'
35+
: 'standalone-packages/codesandbox-browserfs/dist',
36+
to: 'static/browserfs6',
37+
},
38+
// For caching purposes
3239
{
3340
from: isDev
3441
? 'standalone-packages/codesandbox-browserfs/build'

packages/app/integration-tests/browser-tests/browsers.test.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ const hash = require('child_process')
44
.execSync('git rev-parse --short HEAD')
55
.toString();
66

7+
const delay = ms =>
8+
new Promise(resolve => {
9+
setTimeout(() => {
10+
resolve();
11+
}, ms);
12+
});
13+
714
function getCapabilities(browserInfo) {
815
return {
916
...browserInfo,
@@ -77,8 +84,13 @@ usedDescribe('browser-tests', () => {
7784
os_version: '10',
7885
resolution: '1024x768',
7986
};
80-
81-
await testPageWitCapabilities(capabilities);
87+
try {
88+
await testPageWitCapabilities(capabilities);
89+
} catch (e) {
90+
await delay(10000);
91+
// Retry
92+
await testPageWitCapabilities(capabilities);
93+
}
8294
}, 130000);
8395

8496
test('safari', async () => {
@@ -90,8 +102,13 @@ usedDescribe('browser-tests', () => {
90102
os_version: 'High Sierra',
91103
resolution: '1024x768',
92104
};
93-
94-
await testPageWitCapabilities(capabilities);
105+
try {
106+
await testPageWitCapabilities(capabilities);
107+
} catch (e) {
108+
await delay(10000);
109+
// Retry
110+
await testPageWitCapabilities(capabilities);
111+
}
95112
}, 130000);
96113

97114
test.skip('android', async () => {

packages/app/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"http-browserify": "^1.7.0",
130130
"https-browserify": "^1.0.0",
131131
"humps": "CompuIves/humps",
132+
"ignore": "^5.1.4",
132133
"immer": "^3.2.0",
133134
"immutability-helper": "^2.6.6",
134135
"instantsearch.css": "^7.1.0",
@@ -159,7 +160,7 @@
159160
"overmind": "^20.1.0-1572182984474",
160161
"overmind-devtools": "^19.0.0",
161162
"overmind-react": "^21.1.0-1572182984474",
162-
"phoenix": "^1.3.0",
163+
"phoenix": "^1.4.11",
163164
"postcss": "^6.0.9",
164165
"postcss-selector-parser": "^2.2.3",
165166
"posthtml": "^0.11.3",
@@ -311,7 +312,7 @@
311312
"terser": "^4.1.4",
312313
"terser-webpack-plugin": "^1.4.1",
313314
"thread-loader": "^2.1.2",
314-
"typescript": "3.6.3",
315+
"typescript": "3.7.2",
315316
"url-loader": "1.0.1",
316317
"webpack": "^4.36.1",
317318
"webpack-bundle-analyzer": "^2.13.1",

packages/app/scripts/deploy.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
const fetch = require('cross-fetch');
2+
3+
fetch('https://deployment-api.lbogdan.ro/image', {
4+
method: 'POST',
5+
headers: {
6+
'Content-Type': 'application/json',
7+
Authorization: `Bearer ${process.env.DEPLOY_TOKEN}`,
8+
},
9+
body: JSON.stringify({
10+
env: process.env.ENVIRONMENT,
11+
image: 'client',
12+
tag: process.env.CIRCLE_SHA1.substr(0, 7),
13+
deploy: true,
14+
}),
15+
})
16+
.then(x => {
17+
if (!x.ok) {
18+
return x.json().then(res => {
19+
console.error(res);
20+
throw new Error('Request failed');
21+
});
22+
}
23+
24+
return x.json();
25+
})
26+
.then(res => {
27+
// eslint-disable-next-line
28+
console.log(res);
29+
process.exit(0);
30+
})
31+
.catch(e => {
32+
console.error(e);
33+
process.exit(1);
34+
});

packages/app/scripts/sentry-create-release.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-console */
12
const childProcess = require('child_process');
23
const VERSION = require('@codesandbox/common/lib/version').default;
34

@@ -12,7 +13,7 @@ try {
1213
`yarn sentry-cli releases --org=codesandbox -p frontend new "${VERSION}"`
1314
);
1415
childProcess.execSync(
15-
`yarn sentry-cli releases --org=codesandbox set-commits "${VERSION}" --commit "CompuIves/codesandbox-client@${COMMIT_HASH}"`
16+
`yarn sentry-cli releases --org=codesandbox set-commits "${VERSION}" --commit "codesandbox/codesandbox-client@${COMMIT_HASH}"`
1617
);
1718
console.log('Marked release');
1819
} catch (e) {

0 commit comments

Comments
 (0)