Skip to content

Commit 0ca43c4

Browse files
CompuIveslbogdan
authored andcommitted
Fix common deployment problems (codesandbox#1376)
1 parent 7324e6b commit 0ca43c4

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

packages/app/src/app/store/modules/deployment/actions.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { omit } from 'lodash-es';
22

3+
import getTemplate from 'common/templates';
4+
35
export function createZip({ utils, state }) {
46
const sandboxId = state.get('editor.currentId');
57
const sandbox = state.get(`editor.sandboxes.${sandboxId}`);
@@ -16,7 +18,8 @@ export async function createApiData({ props, state }) {
1618
const { contents } = props;
1719
const sandboxId = state.get('editor.currentId');
1820
const sandbox = state.get(`editor.sandboxes.${sandboxId}`);
19-
const apiData = {
21+
const template = getTemplate(sandbox.template);
22+
let apiData = {
2023
files: [],
2124
};
2225

@@ -81,6 +84,10 @@ export async function createApiData({ props, state }) {
8184
}
8285
}
8386

87+
if (template.alterDeploymentData) {
88+
apiData = template.alterDeploymentData(apiData);
89+
}
90+
8491
return { apiData };
8592
}
8693

packages/app/src/app/store/modules/deployment/sequences.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const deploy = [
7878
'An unknown error occurred when connecting to ZEIT',
7979
'error'
8080
),
81+
set(state`deployment.deploying`, false),
8182
],
8283
},
8384
getDeploys,

packages/app/src/app/store/sequences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export const signInZeit = [
251251

252252
actions.updateUserZeitDetails,
253253
{
254-
success: set(state`user`, props`user`),
254+
success: [set(state`user`, props`user`), getZeitUserDetails],
255255
error: factories.addNotification(
256256
'Could not authorize with ZEIT',
257257
'error'

packages/common/templates/template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default class Template {
123123
...parsedFile,
124124
devDependencies: {
125125
...parsedFile.devDependencies,
126-
serve: '^5.0.1',
126+
serve: '^10.1.1',
127127
},
128128
scripts: {
129129
...parsedFile.scripts,

0 commit comments

Comments
 (0)