Skip to content

Commit ea751de

Browse files
authored
Editor Modules (codesandbox#1200)
* Add VSCode * Update * Progress * Yes * Progress * Progress * Fix * Progress * More improvements * Cleanup * Editor optimizations * new version * Fix lint * Adjustments * aa * Update * Remove cache * Make it stop * Fix * new version * Test * Work * Remove need of node services * Add build script * Remove node-services for now * Put VS back * CHange * Update * New editor * Update preload scripts * Remove duplicate modules * Fix embed * Fix windows * New version * Update * Fix paths * Change vscode message
1 parent 9751f01 commit ea751de

File tree

3,263 files changed

+1652575
-208533
lines changed

Some content is hidden

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

3,263 files changed

+1652575
-208533
lines changed

.circleci/config.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ jobs:
99
- checkout
1010
- restore_cache:
1111
keys:
12-
- v12-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
13-
- v12-dependency-cache-{{ .Branch }}
14-
- v12-dependency-cache
12+
- v13-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
13+
- v13-dependency-cache-{{ .Branch }}
14+
- v13-dependency-cache
1515
- restore_cache:
1616
keys:
17-
- v12-standalone-dependency-cache-{{ .Branch }}-{{ checksum "standalone-packages/codesandbox-browserfs/yarn.lock" }}
18-
- v12-standalone-dependency-cache-{{ .Branch }}
19-
- v12-standalone-dependency-cache
17+
- v13-standalone-dependency-cache-{{ .Branch }}-{{ checksum "standalone-packages/codesandbox-browserfs/yarn.lock" }}
18+
- v13-standalone-dependency-cache-{{ .Branch }}
19+
- v13-standalone-dependency-cache
2020
- run:
2121
name: Install Dependencies
2222
command: yarn install
2323
- save_cache:
24-
key: v12-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
24+
key: v13-dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
2525
paths:
2626
- node_modules
2727
- packages/app/node_modules
@@ -31,14 +31,14 @@ jobs:
3131
- packages/react-sandpack/node_modules
3232
- packages/sandpack/node_modules
3333
- save_cache:
34-
key: v12-standalone-dependency-cache-{{ .Branch }}-{{ checksum "standalone-packages/codesandbox-browserfs/yarn.lock" }}
34+
key: v13-standalone-dependency-cache-{{ .Branch }}-{{ checksum "standalone-packages/codesandbox-browserfs/yarn.lock" }}
3535
paths:
3636
- standalone-packages/codesandbox-browserfs/node_modules
3737
- run:
3838
name: Build
3939
command: yarn build:deps
4040
- save_cache:
41-
key: v12-repo-{{ .Environment.CIRCLE_SHA1 }}
41+
key: v13-repo-{{ .Environment.CIRCLE_SHA1 }}
4242
paths:
4343
- ~/codesandbox-client
4444

@@ -48,19 +48,19 @@ jobs:
4848
working_directory: ~/codesandbox-client
4949
steps:
5050
- restore_cache:
51-
key: v12-repo-{{ .Environment.CIRCLE_SHA1 }}
51+
key: v13-repo-{{ .Environment.CIRCLE_SHA1 }}
5252
# We do this to compare sizes from these builds with master
5353
- restore_cache:
54-
key: v12-prod-app-build-cache-master
54+
key: v13-prod-app-build-cache-master
5555
- run:
5656
name: Build Application
5757
command: yarn build:prod
5858
- save_cache:
59-
key: v12-prod-app-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
59+
key: v13-prod-app-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
6060
paths:
6161
- ./packages/app/www
6262
- save_cache:
63-
key: v12-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
63+
key: v13-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
6464
paths:
6565
- ./www
6666

@@ -70,7 +70,7 @@ jobs:
7070
working_directory: ~/codesandbox-client
7171
steps:
7272
- restore_cache:
73-
key: v12-repo-{{ .Environment.CIRCLE_SHA1 }}
73+
key: v13-repo-{{ .Environment.CIRCLE_SHA1 }}
7474
- run:
7575
name: Start Test Server
7676
command: yarn start:test
@@ -98,7 +98,7 @@ jobs:
9898
working_directory: ~/codesandbox-client
9999
steps:
100100
- restore_cache:
101-
key: v12-repo-{{ .Environment.CIRCLE_SHA1 }}
101+
key: v13-repo-{{ .Environment.CIRCLE_SHA1 }}
102102
- run:
103103
name: Test
104104
command: yarn test --ci --testResultsProcessor="jest-junit"
@@ -111,7 +111,7 @@ jobs:
111111
working_directory: ~/codesandbox-client
112112
steps:
113113
- restore_cache:
114-
key: v12-repo-{{ .Environment.CIRCLE_SHA1 }}
114+
key: v13-repo-{{ .Environment.CIRCLE_SHA1 }}
115115
- run:
116116
name: Lint
117117
command: yarn lint
@@ -122,7 +122,7 @@ jobs:
122122
steps:
123123
- checkout
124124
- restore_cache:
125-
key: v12-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
125+
key: v13-prod-build-cache-{{ .Environment.CIRCLE_BRANCH }}-{{ .Environment.CIRCLE_SHA1 }}
126126
- run:
127127
name: Docker Sign In
128128
command: '[ -n "$DOCKER_USER" ] && echo $DOCKER_PWD | docker login -u $DOCKER_USER --password-stdin || true'

.prettierignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
!/standalone-packages/vscode/src/vs/codesandbox/
2+
!/standalone-packages/vscode/src/vs/codesandbox/*
3+
!/standalone-packages/vscode/src/vs/codesandbox/**/*.ts
4+
!/standalone-packages/vscode/src/vs/codesandbox/**/*.*
5+
16
static/
2-
package.json
7+
/package.json
8+
/standalone-packages/*

Gulpfile.js

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,44 @@
11
const gulp = require('gulp');
2+
const _rimraf = require('rimraf');
23

3-
gulp.task('app', function() {
4-
return gulp.src('packages/app/www/**/*').pipe(gulp.dest('www'));
5-
});
4+
function rimraf(dir) {
5+
let retries = 0;
66

7-
gulp.task('homepage', function() {
8-
return gulp.src('packages/homepage/public/**/*').pipe(gulp.dest('www'));
9-
});
7+
const retry = cb => {
8+
_rimraf(dir, { maxBusyTries: 1 }, err => {
9+
if (!err) {
10+
return cb();
11+
}
1012

11-
gulp.task('statics', function() {
12-
return gulp.src('packages/app/public/**/*').pipe(gulp.dest('www'));
13-
});
13+
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
14+
return setTimeout(() => retry(cb), 10);
15+
}
16+
17+
return cb(err);
18+
});
19+
};
20+
21+
return cb => retry(cb);
22+
}
23+
24+
gulp.task('app', () =>
25+
gulp.src('packages/app/www/**/*').pipe(gulp.dest('www'))
26+
);
27+
28+
gulp.task('homepage', () =>
29+
gulp.src('packages/homepage/public/**/*').pipe(gulp.dest('www'))
30+
);
31+
32+
gulp.task('statics', () =>
33+
gulp.src('packages/app/public/**/*').pipe(gulp.dest('www'))
34+
);
1435

1536
gulp.task('default', ['app', 'homepage', 'statics']);
37+
38+
gulp.task('clean-vscode', rimraf('standalone-packages/monaco-editor-core'));
39+
40+
gulp.task('prepare-vscode', ['clean-vscode'], () =>
41+
gulp
42+
.src('standalone-packages/vscode/out-monaco-editor-core/**/*')
43+
.pipe(gulp.dest('standalone-packages/monaco-editor-core'))
44+
);

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"build": "NODE_OPTIONS=\"--max-old-space-size=4096\" yarn build:deps && yarn build:prod",
88
"build:prod": "lerna run build --scope homepage --stream && lerna run build --scope app --stream && gulp",
99
"build:clean": "lerna run build:clean --scope app --scope homepage && rimraf www",
10-
"build:deps": "lerna run build:dev --scope codesandbox-api --scope codesandbox-browserfs",
10+
"build:deps": "lerna run build:dev --scope codesandbox-api --scope codesandbox-browserfs --scope node-services",
1111
"start": "yarn build:deps && lerna run start --scope app --stream",
1212
"start:fast": "lerna run start --scope app --stream",
13+
"start:vscode": "VSCODE=1 yarn start:fast & cd standalone-packages/monaco-editor && yarn simpleserver & cd standalone-packages/vscode && yarn watch",
1314
"start:home": "lerna run start --scope homepage --stream",
1415
"start:test": "lerna run start:test --scope app --stream",
1516
"start:dev_api": "lerna run start --parallel --scope codesandbox-api & lerna run start:dev_api --scope app --stream",
@@ -36,6 +37,7 @@
3637
"packages/sandpack",
3738
"packages/react-sandpack",
3839
"packages/homepage",
40+
"packages/node-services",
3941
"packages/sandbox-hooks",
4042
"packages/sse-hooks"
4143
],
@@ -73,4 +75,4 @@
7375
"url": "https://opencollective.com/codesandbox",
7476
"logo": "https://opencollective.com/codesandbox/logo.txt"
7577
}
76-
}
78+
}

packages/app/config/env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ module.exports = Object.keys(process.env)
1818
'process.env.CODESANDBOX_HOST': JSON.stringify(getHost()),
1919
'process.env.LOCAL_SERVER': !!LOCAL_SERVER,
2020
'process.env.STAGING': 'STAGING_BRANCH' in process.env,
21+
'process.env.VSCODE': !!JSON.stringify(process.env.VSCODE),
2122
}
2223
);

packages/app/config/webpack.common.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ module.exports = {
277277
/typescriptServices\.js$/,
278278
/browserfs\.js/,
279279
/browserfs\.min\.js/,
280-
/standalone-packages/,
280+
/standalone-packages\/codesandbox-browserfs/,
281+
/standalone-packages\/vscode\//,
281282
],
282283
},
283284

@@ -449,6 +450,11 @@ module.exports = {
449450
to: 'public/13/vs',
450451
force: true,
451452
},
453+
{
454+
from: '../../standalone-packages/vscode-editor/release/min/vs',
455+
to: 'public/vscode1/vs',
456+
force: true,
457+
},
452458
__PROD__ && {
453459
from: '../../node_modules/monaco-editor/min-maps',
454460
to: 'public/min-maps',
@@ -467,7 +473,7 @@ module.exports = {
467473
},
468474
{
469475
from: '../../standalone-packages/codesandbox-browserfs/dist',
470-
to: 'static/browserfs',
476+
to: 'static/browserfs2',
471477
},
472478
].filter(x => x)
473479
),
16 KB
Loading
15.2 KB
Loading
60.2 KB
Loading
132 KB
Loading

0 commit comments

Comments
 (0)