Skip to content

Commit 10ea330

Browse files
author
Ives van Hoorne
committed
Fix boilerplates
1 parent 7a5668b commit 10ea330

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/sandbox/boilerplates/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
import type { Module } from 'common/types';
2+
import type { Module } from '../eval/entities/module';
33

44
import { getCurrentManager } from '../compile';
55

@@ -9,14 +9,8 @@ export async function evalBoilerplates(boilerplates: Array<any>) {
99
cachedBoilerplates = await Promise.all(
1010
boilerplates.map(async boilerplate => {
1111
const fakeModule: Module = {
12-
id: boilerplate.id,
13-
shortid: boilerplate.id,
14-
title: `boilerplate-${boilerplate.condition}${boilerplate.extension}`,
12+
path: `/boilerplate-${boilerplate.condition}${boilerplate.extension}`,
1513
code: boilerplate.code,
16-
directoryShortid: null,
17-
sourceId: boilerplate.sourceId,
18-
isNotSynced: false,
19-
type: '',
2014
};
2115

2216
const manager = getCurrentManager();

src/sandbox/compile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ async function compile({
167167

168168
if (isReact) {
169169
// initiate boilerplates
170-
if (getBoilerplates().length === 0 && externals != null) {
170+
if (getBoilerplates().length === 0) {
171171
try {
172172
await evalBoilerplates(defaultBoilerplates);
173173
} catch (e) {
@@ -178,6 +178,7 @@ async function compile({
178178
const boilerplate = findBoilerplate(module);
179179
if (boilerplate) {
180180
try {
181+
console.log(boilerplate);
181182
boilerplate.module.default(evalled);
182183
} catch (e) {
183184
console.error(e);

0 commit comments

Comments
 (0)