Skip to content

Commit 1d572e1

Browse files
authored
New structure (codesandbox#2)
* Move some files around * Intermediate * Rewrites * Workspace manipulation * Dependency adding/removing * Preview works * Debouncing for editing code * Fix styling of switch * Show path on top * Support for replacestate * Automatic forking * Remove unused import * Sidebar tweaks * Edit icons * Make forking possible * Work work * Update sandbox * UI * Saving * Notifications * Autocomplete and view choice * Fix setting view * Preferences * Autocomplete and vim * Add live preview option * Add dependency when not found * Set title of document * Fix switching between module view and project view * Prettify * Add tooltip to prettify button
1 parent 77b1ca4 commit 1d572e1

File tree

238 files changed

+8636
-8251
lines changed

Some content is hidden

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

238 files changed

+8636
-8251
lines changed

.eslintrc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"extends": "airbnb",
2+
"extends": [
3+
"airbnb",
4+
"prettier",
5+
"prettier/react",
6+
"prettier/flowtype"
7+
],
38
"parser": "babel-eslint",
49
"env": {
510
"browser": true,
@@ -10,6 +15,14 @@
1015
"rules": {
1116
"react/jsx-filename-extension": 0,
1217
"react/sort-comp": 0,
13-
"import/no-extraneous-dependencies": 0
18+
"import/no-extraneous-dependencies": 0,
19+
"arrow-parens": 0
20+
},
21+
"settings": {
22+
"import/resolver": {
23+
"webpack": {
24+
"config": "config/webpack.config.js"
25+
}
26+
}
1427
}
15-
}
28+
}

.flowconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ node_modules/styled-components/flow-typed/react-native.js
2626
node_modules/styled-components/flow-typed/inline-style-prefixer_vx.x.x.js
2727

2828
[options]
29+
module.system.node.resolve_dirname=node_modules
30+
module.system.node.resolve_dirname=src
2931

3032
# Yeah, we use this to ignore errors...
3133
# Just add it, if you have a different suppress_comment notation

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
FROM node:latest
1+
FROM node:7.6
22
MAINTAINER Ives van Hoorne
33

4-
RUN npm install -g yarn
5-
64
RUN mkdir /usr/src/app
75

86
WORKDIR /usr/src/app

config/webpack.config.js

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,28 @@ const __PROD__ = NODE_ENV === 'production'; // eslint-disable-line no-underscore
1515

1616
const babelConfig = __DEV__ ? babelDev : babelProd;
1717

18-
const getOutput = () => (
19-
__DEV__ ? {
20-
path: paths.appBuild,
21-
pathinfo: true,
22-
filename: 'static/js/[name].js',
23-
publicPath: '/',
24-
} : {
25-
path: paths.appBuild,
26-
pathinfo: true,
27-
filename: 'static/js/[name].[hash:8].js',
28-
chunkFilename: 'static/js/[name].[hash:8].chunk.js',
29-
sourceMapFilename: '[file].map', // Default
30-
publicPath: 'https://codesandbox.io/',
31-
}
32-
);
18+
const getOutput = () =>
19+
__DEV__
20+
? {
21+
path: paths.appBuild,
22+
pathinfo: true,
23+
filename: 'static/js/[name].js',
24+
publicPath: '/',
25+
}
26+
: {
27+
path: paths.appBuild,
28+
pathinfo: true,
29+
filename: 'static/js/[name].[hash:8].js',
30+
chunkFilename: 'static/js/[name].[hash:8].chunk.js',
31+
sourceMapFilename: '[file].map', // Default
32+
publicPath: 'https://codesandbox.io/',
33+
};
3334

3435
const config = {
3536
devtool: __DEV__ ? 'eval' : 'source-map',
3637

3738
entry: {
38-
app: [
39-
require.resolve('./polyfills'),
40-
path.join(paths.appSrc, 'index.js'),
41-
],
39+
app: [require.resolve('./polyfills'), path.join(paths.appSrc, 'index.js')],
4240
sandbox: [
4341
require.resolve('./polyfills'),
4442
path.join(paths.sandboxSrc, 'index.js'),
@@ -54,7 +52,6 @@ const config = {
5452

5553
target: 'web',
5654

57-
5855
output: getOutput(),
5956

6057
module: {
@@ -73,7 +70,9 @@ const config = {
7370
options: (() => {
7471
const altererdConfig = Object.assign({}, babelConfig);
7572

76-
altererdConfig.plugins.push(require.resolve('babel-plugin-transform-remove-strict-mode'));
73+
altererdConfig.plugins.push(
74+
require.resolve('babel-plugin-transform-remove-strict-mode')
75+
);
7776
return altererdConfig;
7877
})(),
7978
},
@@ -90,10 +89,7 @@ const config = {
9089
// in development "style" loader enables hot editing of CSS.
9190
{
9291
test: /\.css$/,
93-
loaders: [
94-
'style-loader',
95-
'css-loader',
96-
],
92+
loaders: ['style-loader', 'css-loader'],
9793
},
9894
// "file" loader makes sure those assets get served by WebpackDevServer.
9995
// When you `import` an asset, you get its (virtual) filename.
@@ -138,9 +134,7 @@ const config = {
138134
},
139135
resolve: {
140136
mainFields: ['browser', 'module', 'jsnext:main', 'main'],
141-
modules: [
142-
'node_modules',
143-
],
137+
modules: ['src', 'node_modules'],
144138

145139
extensions: ['.js', '.json'],
146140

deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ mkdir .deliver/www
88
docker cp $id:/app/www/ ./.deliver/
99
docker rm -v $id
1010

11-
1211
echo "Tarring build files"
1312
tar -C .deliver -zcvf .deliver/code_sandbox_client.tar.gz www
1413

@@ -20,3 +19,4 @@ scp .deliver/code_sandbox_client.tar.gz nginx@ssh.codesandbox.io:./
2019

2120
echo "Untarring www files"
2221
ssh nginx@ssh.codesandbox.io "tar -xzf ./code_sandbox_client.tar.gz"
22+

flow-typed/npm/autoprefixer_vx.x.x.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 728a9ce361ef0ea0c3643751346178ef
2-
// flow-typed version: <<STUB>>/autoprefixer_v^6.5.3/flow_v0.36.0
1+
// flow-typed signature: 48cff332d8dbc4fef7bdfee9c9af1bbe
2+
// flow-typed version: <<STUB>>/autoprefixer_v^6.6.0/flow_v0.37.4
33

44
/**
55
* This is an autogenerated libdef stub for:
@@ -90,10 +90,6 @@ declare module 'autoprefixer/lib/hacks/display-grid' {
9090
declare module.exports: any;
9191
}
9292

93-
declare module 'autoprefixer/lib/hacks/fill' {
94-
declare module.exports: any;
95-
}
96-
9793
declare module 'autoprefixer/lib/hacks/filter-value' {
9894
declare module.exports: any;
9995
}
@@ -198,6 +194,10 @@ declare module 'autoprefixer/lib/hacks/placeholder' {
198194
declare module.exports: any;
199195
}
200196

197+
declare module 'autoprefixer/lib/hacks/stretch' {
198+
declare module.exports: any;
199+
}
200+
201201
declare module 'autoprefixer/lib/hacks/text-emphasis-position' {
202202
declare module.exports: any;
203203
}
@@ -310,9 +310,6 @@ declare module 'autoprefixer/lib/hacks/display-flex.js' {
310310
declare module 'autoprefixer/lib/hacks/display-grid.js' {
311311
declare module.exports: $Exports<'autoprefixer/lib/hacks/display-grid'>;
312312
}
313-
declare module 'autoprefixer/lib/hacks/fill.js' {
314-
declare module.exports: $Exports<'autoprefixer/lib/hacks/fill'>;
315-
}
316313
declare module 'autoprefixer/lib/hacks/filter-value.js' {
317314
declare module.exports: $Exports<'autoprefixer/lib/hacks/filter-value'>;
318315
}
@@ -391,6 +388,9 @@ declare module 'autoprefixer/lib/hacks/pixelated.js' {
391388
declare module 'autoprefixer/lib/hacks/placeholder.js' {
392389
declare module.exports: $Exports<'autoprefixer/lib/hacks/placeholder'>;
393390
}
391+
declare module 'autoprefixer/lib/hacks/stretch.js' {
392+
declare module.exports: $Exports<'autoprefixer/lib/hacks/stretch'>;
393+
}
394394
declare module 'autoprefixer/lib/hacks/text-emphasis-position.js' {
395395
declare module.exports: $Exports<'autoprefixer/lib/hacks/text-emphasis-position'>;
396396
}

flow-typed/npm/axios_v0.15.x.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 0341fc5cb920ad62c9155c38bfb57c02
2-
// flow-typed version: 11e2b14097/axios_v0.15.x/flow_>=v0.28.x
1+
// flow-typed signature: 09272b82e4d7a497eb3ffd12dd130407
2+
// flow-typed version: d28912a036/axios_v0.15.x/flow_>=v0.28.x
33

44
declare module 'axios' {
55
declare interface ProxyConfig {
@@ -84,8 +84,7 @@ declare module 'axios' {
8484
declare type AxiosPromise<T> = Promise<AxiosXHR<T>>;
8585
declare class Axios {
8686
constructor<T>(config?: AxiosXHRConfigBase<T>): void;
87-
<T>(config: AxiosXHRConfig<T>): AxiosPromise<T>;
88-
<T>(url: string, config?: AxiosXHRConfig<T>): AxiosPromise<T>;
87+
$call: <T>(config: AxiosXHRConfig<T> | string, config?: AxiosXHRConfig<T>) => AxiosPromise<T>;
8988
request<T>(config: AxiosXHRConfig<T>): AxiosPromise<T>;
9089
delete<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;
9190
get<T>(url: string, config?: AxiosXHRConfigBase<T>): AxiosPromise<T>;

flow-typed/npm/babel-core_vx.x.x.js

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: d1ff8647331487e90db4f0320a5cd122
2-
// flow-typed version: <<STUB>>/babel-core_v^6.18.2/flow_v0.36.0
1+
// flow-typed signature: e5374ea2d55a1f89dd8c75f3e224f943
2+
// flow-typed version: <<STUB>>/babel-core_v^6.21.0/flow_v0.37.4
33

44
/**
55
* This is an autogenerated libdef stub for:
@@ -30,6 +30,14 @@ declare module 'babel-core/lib/api/node' {
3030
declare module.exports: any;
3131
}
3232

33+
declare module 'babel-core/lib/helpers/get-possible-plugin-names' {
34+
declare module.exports: any;
35+
}
36+
37+
declare module 'babel-core/lib/helpers/get-possible-preset-names' {
38+
declare module.exports: any;
39+
}
40+
3341
declare module 'babel-core/lib/helpers/merge' {
3442
declare module.exports: any;
3543
}
@@ -38,6 +46,18 @@ declare module 'babel-core/lib/helpers/normalize-ast' {
3846
declare module.exports: any;
3947
}
4048

49+
declare module 'babel-core/lib/helpers/resolve-from-possible-names' {
50+
declare module.exports: any;
51+
}
52+
53+
declare module 'babel-core/lib/helpers/resolve-plugin' {
54+
declare module.exports: any;
55+
}
56+
57+
declare module 'babel-core/lib/helpers/resolve-preset' {
58+
declare module.exports: any;
59+
}
60+
4161
declare module 'babel-core/lib/helpers/resolve' {
4262
declare module.exports: any;
4363
}
@@ -127,12 +147,27 @@ declare module 'babel-core/lib/api/browser.js' {
127147
declare module 'babel-core/lib/api/node.js' {
128148
declare module.exports: $Exports<'babel-core/lib/api/node'>;
129149
}
150+
declare module 'babel-core/lib/helpers/get-possible-plugin-names.js' {
151+
declare module.exports: $Exports<'babel-core/lib/helpers/get-possible-plugin-names'>;
152+
}
153+
declare module 'babel-core/lib/helpers/get-possible-preset-names.js' {
154+
declare module.exports: $Exports<'babel-core/lib/helpers/get-possible-preset-names'>;
155+
}
130156
declare module 'babel-core/lib/helpers/merge.js' {
131157
declare module.exports: $Exports<'babel-core/lib/helpers/merge'>;
132158
}
133159
declare module 'babel-core/lib/helpers/normalize-ast.js' {
134160
declare module.exports: $Exports<'babel-core/lib/helpers/normalize-ast'>;
135161
}
162+
declare module 'babel-core/lib/helpers/resolve-from-possible-names.js' {
163+
declare module.exports: $Exports<'babel-core/lib/helpers/resolve-from-possible-names'>;
164+
}
165+
declare module 'babel-core/lib/helpers/resolve-plugin.js' {
166+
declare module.exports: $Exports<'babel-core/lib/helpers/resolve-plugin'>;
167+
}
168+
declare module 'babel-core/lib/helpers/resolve-preset.js' {
169+
declare module.exports: $Exports<'babel-core/lib/helpers/resolve-preset'>;
170+
}
136171
declare module 'babel-core/lib/helpers/resolve.js' {
137172
declare module.exports: $Exports<'babel-core/lib/helpers/resolve'>;
138173
}

flow-typed/npm/babel-eslint_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 042641e2e9184922bee0dad8cdf6692c
2-
// flow-typed version: <<STUB>>/babel-eslint_v^7.1.1/flow_v0.36.0
1+
// flow-typed signature: b46ccd1d41acd642bb71bfff7cc58fef
2+
// flow-typed version: <<STUB>>/babel-eslint_v^7.1.1/flow_v0.37.4
33

44
/**
55
* This is an autogenerated libdef stub for:

flow-typed/npm/babel-jest_vx.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// flow-typed signature: 111f08cfa061dbff5e005124e986c5da
2-
// flow-typed version: <<STUB>>/babel-jest_v^17.0.2/flow_v0.36.0
1+
// flow-typed signature: 51d4b0b47762393443b387d205a0632d
2+
// flow-typed version: <<STUB>>/babel-jest_v^18.0.0/flow_v0.37.4
33

44
/**
55
* This is an autogenerated libdef stub for:

0 commit comments

Comments
 (0)