Skip to content

Commit 6b5f5b7

Browse files
committed
Merge branch 'master' into vscodeeffect
2 parents e494f03 + ba5cf6d commit 6b5f5b7

File tree

41 files changed

+19556
-440
lines changed

Some content is hidden

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

41 files changed

+19556
-440
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/cra-files/*.*
22
**/eslint-lint.js
3+
**/stories/*.*

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
"packages/homepage",
1414
"packages/common",
1515
"packages/codesandbox-api",
16-
"packages/sandpack",
17-
"packages/react-sandpack",
1816
"packages/node-services",
1917
"packages/sandbox-hooks",
2018
"packages/sse-hooks",
@@ -39,9 +37,9 @@
3937
"build:embed": "lerna run build:embed --scope app --stream && gulp",
4038
"build:prod": "cross-env NODE_OPTIONS=\"--max-old-space-size=4096\" lerna run build --scope homepage --stream && lerna run build --scope app --stream && lerna run copy-assets --scope app --stream",
4139
"commit": "concurrently \"yarn typecheck\" \"yarn lint\" && git commit -m",
40+
"postinstall": "yarn lerna run install-dependencies --stream --concurrency 1 && opencollective postinstall",
4241
"contributors:add": "all-contributors add",
4342
"contributors:generate": "all-contributors generate",
44-
"postinstall": "yarn lerna run install-dependencies --scope vscode-textmate --scope codesandbox-browserfs --scope sse-loading-screen --stream && opencollective postinstall",
4543
"lint": "lerna run lint --stream",
4644
"now-build": "yarn build:deps && lerna run build:storybook --scope @codesandbox/common",
4745
"start": "yarn build:deps && lerna run start --scope @codesandbox/common --scope app --parallel",

packages/app/config/build.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
const isDev = process.env.NODE_ENV === 'development';
2+
const { SANDBOX_ONLY } = process.env;
23
const staticAssets = [
3-
{
4+
!SANDBOX_ONLY && {
45
from: 'standalone-packages/vscode-editor/release/min/vs',
56
to: 'public/vscode25/vs',
67
},
7-
{
8+
!SANDBOX_ONLY && {
89
from: 'standalone-packages/vscode-extensions/out',
910
to: 'public/vscode-extensions/v10',
1011
},
11-
{
12+
!SANDBOX_ONLY && {
1213
from: 'node_modules/onigasm/lib/onigasm.wasm',
1314
to: 'public/onigasm/2.2.1/onigasm.wasm',
1415
},
15-
{
16+
!SANDBOX_ONLY && {
1617
from:
1718
'standalone-packages/vscode-textmate/node_modules/onigasm/lib/onigasm.wasm',
1819
to: 'public/onigasm/2.1.0/onigasm.wasm',
1920
},
20-
{
21+
!SANDBOX_ONLY && {
2122
from: 'node_modules/monaco-vue/release/min',
2223
to: 'public/14/vs/language/vue',
2324
},
24-
{
25+
!SANDBOX_ONLY && {
2526
from: 'standalone-packages/monaco-editor/release/min/vs',
2627
to: 'public/14/vs',
2728
},
@@ -63,7 +64,7 @@ const staticAssets = [
6364
: 'standalone-packages/codesandbox-browserfs/dist',
6465
to: 'static/browserfs3',
6566
},
66-
];
67+
].filter(Boolean);
6768

6869
module.exports = {
6970
staticAssets,

packages/app/config/webpack.common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ module.exports = {
427427
new HtmlWebpackPlugin({
428428
inject: true,
429429
chunks: ['sandbox-startup', 'vendors~sandbox', 'sandbox'],
430-
filename: 'frame.html',
430+
filename: 'index.html',
431431
template: paths.sandboxHtml,
432432
minify: __PROD__ && {
433433
removeComments: true,

packages/app/config/webpack.prod.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ module.exports = merge(commonConfig, {
227227
minify: true,
228228
// For unknown URLs, fallback to the index page
229229
navigateFallback: 'https://new.codesandbox.io/frame.html',
230-
staticFileGlobs: ['www/frame.html'],
230+
staticFileGlobs: process.env.SANDBOX_ONLY
231+
? ['www/index.html']
232+
: ['www/frame.html'],
231233
stripPrefix: 'www/',
232234
// Ignores URLs starting from /__ (useful for Firebase):
233235
// https://github.com/facebookincubator/create-react-app/issues/2237#issuecomment-302693219

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function testPageWitCapabilities(capabilities) {
3636
// Test if a sandbox can be loaded on IE11
3737
return driver
3838
.get(
39-
'http://localhost:3002/#github/codesandbox/integration-sandboxes/tree/master/new'
39+
'http://localhost:3000/#github/codesandbox/integration-sandboxes/tree/master/new'
4040
)
4141
.then(async () => {
4242
const element = webdriver.By.css('h1');

packages/app/integration-tests/tests/sandboxes.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function pageLoaded(page) {
6565
}
6666

6767
function sandboxUrl(sandboxId) {
68-
return `http://localhost:3002/#github/${SANDBOXES_REPO}/tree/master/${sandboxId}`;
68+
return `http://localhost:3000/#github/${SANDBOXES_REPO}/tree/master/${sandboxId}`;
6969
}
7070

7171
function loadSandbox(page, sandboxId, timeout) {

packages/app/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
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",
1515
"build:embed": "cross-env NODE_ENV=production webpack --config config/webpack.embed.js",
16-
"build:sandbox": "cross-env NODE_ENV=production SANDBOX_ONLY=true node scripts/build.js",
16+
"build:sandbox": "cross-env NODE_ENV=production SANDBOX_ONLY=true node scripts/build.js && yarn copy-assets",
17+
"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",
1718
"copy-assets": "cross-env NODE_ENV=production node scripts/copy-assets.js",
1819
"integrations:start": "docker run -v $(pwd):/app/ -it codesandbox/test yarn start:test",
1920
"lint": "npm run lint:app && npm run lint:embed && npm run lint:sandbox",
@@ -22,7 +23,8 @@
2223
"lint:sandbox": "cross-env LINT=1 eslint --ext .js,.ts,.tsx src/sandbox",
2324
"start": "cross-env LOCAL_SERVER=1 LOCAL_DEV=1 NODE_OPTIONS=\"--max-old-space-size=4096\" node scripts/start.js",
2425
"start:dev_api": "node scripts/start.js",
25-
"start:sandbox": "cross-env SANDBOX_ONLY=true node scripts/start.js",
26+
"start:sandbox": "cross-env SANDBOX_ONLY=true LOCAL_SERVER=1 node scripts/start.js",
27+
"start:sandpack-sandbox": "cross-env SANDPACK=true LOCAL_SERVER=1 SANDBOX_ONLY=true node scripts/start.js",
2628
"start:test": "cross-env LOCAL_SERVER=1 SANDBOX_ONLY=true node scripts/start.js",
2729
"test": "jest --env=jsdom",
2830
"test:integrations": "jest --config integration-tests/jest.config.json --maxWorkers=2",
@@ -96,7 +98,7 @@
9698
"browser-resolve": "CompuIves/node-browser-resolve",
9799
"circular-json": "^0.4.0",
98100
"codemirror": "^5.27.4",
99-
"codesandbox-api": "^0.0.22",
101+
"codesandbox-api": "0.0.23",
100102
"codesandbox-import-utils": "2.1.2",
101103
"color": "^0.11.4",
102104
"compare-versions": "^3.1.0",

packages/app/scripts/copy-assets.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,35 @@ const fs = require('fs-extra');
33
const path = require('path');
44
const { staticAssets } = require('../config/build');
55

6+
const { SANDBOX_ONLY } = process.env;
7+
68
const assets = [
79
...staticAssets,
810
{
911
from: 'packages/app/www',
1012
to: '',
1113
},
12-
{
14+
!SANDBOX_ONLY && {
1315
from: 'packages/homepage/public',
1416
to: '',
1517
},
16-
{
18+
!SANDBOX_ONLY && {
1719
from: 'standalone-packages/monaco-editor/release/min/vs',
1820
to: 'public/14/vs',
1921
},
2022
{
2123
from: 'standalone-packages/codesandbox-browserfs/dist',
2224
to: 'static/browserfs2',
2325
},
24-
{
26+
!SANDBOX_ONLY && {
2527
from: 'standalone-packages/vscode-editor/release/min/vs',
2628
to: 'public/vscode24/vs',
2729
},
2830
{
2931
from: 'packages/app/public',
3032
to: '',
3133
},
32-
];
34+
].filter(Boolean);
3335

3436
const rootPath = path.resolve(__dirname, '../../..');
3537
const buildPath = path.resolve(rootPath, 'www');

packages/app/scripts/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fetch = require('cross-fetch');
22

3-
fetch('https://deployment-api.lbogdan.ro/image', {
3+
fetch('https://deploy-api.ops.csb.dev/image', {
44
method: 'POST',
55
headers: {
66
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)