Skip to content

Commit

Permalink
Remove template/config folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbruegge committed Apr 10, 2017
1 parent b8d170b commit 278cdc2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ module.exports = {
basics: [
'@cycle/[email protected]'
],
language: {
javascript: [],
typescript: []
},
streamLib: {
xstream: [
'@cycle/[email protected]',
Expand Down
8 changes: 4 additions & 4 deletions packages/cycle-scripts/scripts/init/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
const chalk = require('chalk')
const spawn = require('cross-spawn')

const dependencies = require('../../configs/flavor');
const dependencies = require('../../configs/dependencies')
const success = require('./success')

module.exports = function setup (appPath, appName, options) {
Expand All @@ -16,8 +16,7 @@ module.exports = function setup (appPath, appName, options) {

// STEP #1 - Create boilerplate files
const flavorPath = path.join(appPath, 'node_modules', 'cycle-scripts')
const flavorConfig = require(path.join(flavorPath, 'template/config', language, 'flavor.js'))
const templateStrings = flavorConfig.replacements
const templateStrings = require(path.join(flavorPath, 'template/config', language, 'flavor.js'))
const templatePath = path.join(flavorPath, 'template/src', language)
// Create ./public directory
fs.ensureDirSync(path.join(appPath, 'public'))
Expand Down Expand Up @@ -72,9 +71,10 @@ module.exports = function setup (appPath, appName, options) {
// All the dependency locks and configurations can be found in /configs/flavor.js
const basicDependencies = dependencies.basics
const streamLibDependencies = dependencies.streamLib[streamLib]
const languageDependencies = dependencies.language[language]
const dependenciesToInstall = basicDependencies
.concat(streamLibDependencies)
.concat(flavorConfig.dependencies)
.concat(languageDependencies)
const dependecyList = dependenciesToInstall
.slice(0, (dependenciesToInstall.length - 1))
.join(', ')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const dependencies = []

const replacements = {
module.exports = {
xstream: {
run: '@cycle/run',
import: 'import xs from \'xstream\'',
Expand All @@ -17,8 +15,3 @@ const replacements = {
stream: 'most'
}
}

module.exports = {
dependencies,
replacements
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const dependencies = []

const replacements = {
module.exports = {
xstream: {
run: '@cycle/run',
import: 'import xs from \'xstream\'',
Expand All @@ -23,8 +21,3 @@ const dependencies = []
streamType: 'Stream'
}
}

module.exports = {
dependencies,
replacements
}

0 comments on commit 278cdc2

Please sign in to comment.