Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"start:dev_api": "(tmux new-session -d -s csb \"NODE_OPTIONS=--max_old_space_size=8192 concurrently --raw 'cd packages/app && yarn start:dev_api' 'cd packages/common && yarn start' 'cd packages/components && yarn start'\" || tmux attach -t csb) && tmux attach -t csb",
"start:dynamic": "lerna run dev --scope dynamic-pages --stream",
"start:fast": "cross-env NODE_ENV=development concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\" \"cd packages/components && yarn start\"",
"start:csb-dev": "cross-env NODE_ENV=development stmux -w always -e ERROR -m beep,system -- [ \"cd packages/app && sleep 15 && yarn start:dev_api\" : [ \"cd packages/common && yarn start\" .. \"cd packages/components && yarn start\" ] ]",
"start:profiling": "cross-env NODE_ENV=production PROFILING=true concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\" \"cd packages/components && yarn start\"",
"start:hot": "cross-env NODE_ENV=development APP_ONLY=true concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\" \"cd packages/components && yarn start\"",
"start:fast:stream": "cross-env ENDPOINT=https://codesandbox.stream NODE_ENV=development concurrently --raw \"cd packages/app && yarn start\" \"cd packages/common && yarn start\" \"cd packages/components && yarn start\"",
Expand Down
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"lint:app": "cross-env LINT=1 eslint --ext .js,.ts,.tsx src/app",
"lint:embed": "cross-env LINT=1 eslint --ext .js,.ts,.tsx src/embed",
"lint:sandbox": "cross-env LINT=1 eslint --ext .js,.ts,.tsx src/sandbox",
"start": "cross-env LOCAL_SERVER=1 LOCAL_DEV=1 NODE_OPTIONS=\"--max-old-space-size=4096\" node scripts/start.js",
"start": "cross-env LOCAL_SERVER=1 NODE_OPTIONS=\"--max-old-space-size=4096\" node scripts/start.js",
"start:dev_api": "node scripts/start.js",
"start:app": "cross-env APP_ONLY=true LOCAL_SERVER=1 node scripts/start.js",
"start:sandbox": "cross-env SANDBOX_ONLY=true LOCAL_SERVER=1 node scripts/start.js",
Expand Down Expand Up @@ -344,6 +344,7 @@
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "^2.1.4",
"selenium-webdriver": "^4.0.0-alpha.1",
"stmux": "^1.8.0",
"strip-ansi": "3.0.1",
"style-loader": "^0.21.0",
"svgo": "^1.3.0",
Expand Down
14 changes: 9 additions & 5 deletions packages/app/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ function setupCompiler(port, protocol) {
// in ./packages/app/src/app/components/CodeEditor/CodeMirror/index.js
const warnings = stats.compilation.warnings
.concat(...stats.compilation.children.map(child => child.warnings))
.filter(warning => warning.error.name !== 'CriticalDependencyWarning');
.filter(warning => warning.error.name !== 'CriticalDependencyWarning')
// ignore "Error: Can't resolve 'sugarss' in '/client/node_modules/postcss-import/lib'" warning
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bless you

.filter(warning => !warning.module.resource.endsWith('node_modules/postcss-import/lib/process-content.js'));
const hasWarnings = warnings.length > 0;
if (hasWarnings) {
console.log(chalk.yellow(`Compiled with warnings in ${took / 1000}s.\n`));
Expand Down Expand Up @@ -264,7 +266,7 @@ function addMiddleware(devServer, index) {
}

function runDevServer(port, protocol, index) {
var devServer = new WebpackDevServer(compiler, {
var devServerConfig = {
// It is important to tell WebpackDevServer to use the same "root" path
// as we specified in the config. In development, we always serve from /.
publicPath: config.output.publicPath,
Expand All @@ -279,16 +281,18 @@ function runDevServer(port, protocol, index) {
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https: protocol === 'https',
// contentBase: paths.staticPath,
public: 'localhost:3000',
host: process.env.LOCAL_SERVER ? 'localhost' : 'codesandbox.test',
// public: 'localhost:3000',
host: process.env.LOCAL_SERVER ? 'localhost' : (process.env.DEV_DOMAIN || 'codesandbox.test'),
disableHostCheck: !process.env.LOCAL_SERVER,
contentBase: false,
clientLogLevel: 'warning',
overlay: true,
inline: true,
hot: true,
liveReload: process.env['DISABLE_REFRESH'] ? false : true,
});
};
// console.log(JSON.stringify(devServerConfig, null, 2));
var devServer = new WebpackDevServer(compiler, devServerConfig);

// Our custom middleware proxies requests to /index.html or a remote API.
const { wsProxy } = addMiddleware(devServer, index);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/app/pages/Profile2/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const SANDBOXES_PER_PAGE = 15;
export { ProfileCollection as ProfileCollectionType } from 'app/overmind/namespaces/profile/state';
export type { ProfileCollection as ProfileCollectionType } from 'app/overmind/namespaces/profile/state';

export enum SandboxType {
ALL_SANDBOX = 'ALL_SANDBOX',
Expand Down
3 changes: 2 additions & 1 deletion packages/chrome-extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"https://codesandbox.io/*",
"https://codesandbox.test/*",
"https://codesandbox.stream/*",
"https://*.build.csb.dev/*"
"https://*.build.csb.dev/*",
"https://*.csb.dev/*"
]
}
]
Expand Down
1 change: 1 addition & 0 deletions packages/common/src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ export default Object.keys(process.env)
'process.env.SANDPACK': Boolean(
JSON.parse(process.env.SANDPACK || 'false')
),
'process.env.DEV_DOMAIN': JSON.stringify(process.env.DEV_DOMAIN || 'codesandbox.test'),
}
);
2 changes: 1 addition & 1 deletion packages/common/src/utils/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default () => {
}

if (process.env.NODE_ENV === 'development') {
return 'https://codesandbox.test';
return `https://${process.env.DEV_DOMAIN}`;
}

if ('STAGING_BRANCH' in process.env) {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/utils/url-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const host = () => {
if (process.env.LOCAL_SERVER) {
return 'localhost:3000';
}
return 'codesandbox.test';
return process.env.DEV_DOMAIN;
};

export const protocolAndHost = () => `${location.protocol}//${host()}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/homepage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"build:clean": "rimraf public",
"lint": "eslint .",
"start": "gatsby develop --host=0.0.0.0",
"start:dev": "LOCAL_SERVER=1 LOCAL_DEV=1 gatsby develop",
"start:dev": "LOCAL_SERVER=1 gatsby develop",
"test": "echo \"Todo: no test specified\" && exit 0"
},
"browserslist": [
Expand Down
Loading