|
|
|
@ -20,8 +20,7 @@ import fs from "fs/promises"; |
|
|
|
|
|
|
|
const isDev = config.has('mode') && config.get('mode') === 'development'; |
|
|
|
const modulePath = 'node_modules/create-block-dev-tool/'; |
|
|
|
const projectDir = isDev ? '' : modulePath; |
|
|
|
console.log('Development Mode:', isDev); |
|
|
|
const projectDir = modulePath; |
|
|
|
|
|
|
|
const sass = gulpSass(dartSass); |
|
|
|
|
|
|
|
@ -53,18 +52,20 @@ app.get('/', async (req, res) => { |
|
|
|
const data = await fsExtra.readJson(`./data/${jsonFileName}.json`); |
|
|
|
|
|
|
|
Object.assign(data, { |
|
|
|
config: { |
|
|
|
projectDir, |
|
|
|
dataFiles: dataFiles.map((name) => { |
|
|
|
return { |
|
|
|
name, |
|
|
|
active: jsonFileName === name, |
|
|
|
}; |
|
|
|
}), |
|
|
|
remToPx: config.has('remToPx') ? config.get('remToPx') : 16, |
|
|
|
cssUrl: config.get('cssUrl'), |
|
|
|
blockName: config.get('blockName') |
|
|
|
} |
|
|
|
config: Object.assign( |
|
|
|
JSON.parse(JSON.stringify(config)), // The entire config object.
|
|
|
|
{ |
|
|
|
projectDir, |
|
|
|
activeDataFile: jsonFileName, |
|
|
|
dataFiles: dataFiles.map((name) => { |
|
|
|
return { |
|
|
|
name, |
|
|
|
active: jsonFileName === name, |
|
|
|
}; |
|
|
|
}), |
|
|
|
remToPx: config.has('remToPx') ? config.get('remToPx') : 16, |
|
|
|
} |
|
|
|
) |
|
|
|
}); |
|
|
|
|
|
|
|
data.helpers = { |
|
|
|
@ -159,8 +160,3 @@ function prepareListOfDataFiles(dataFiles) { |
|
|
|
}) |
|
|
|
.sort(); |
|
|
|
} |
|
|
|
|
|
|
|
// TODO:
|
|
|
|
// Breakpoints and data options will come from backend server.
|
|
|
|
// [v] Top Panel with options to switch data (select input)
|
|
|
|
// - Options to resize the page and test Responsiveness (select input)
|
|
|
|
|