Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conga

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conga - npm Package Compare versions

Comparing version 0.0.15 to 0.0.17

95

lib/command/create-project.js

@@ -17,2 +17,3 @@ /*

var fs = require('fs-extra');
var git = require('gift');

@@ -38,2 +39,11 @@ /**

/**
* The possible project templates to use
*
* @type {Object}
*/
projectUrls: {
demo: "https://github.com/congajs/conga-demo-project"
},
/**
* Run the command

@@ -66,25 +76,32 @@ *

console.log('Step 1/4: creating project directory');
console.log('Step 1/5: cloning project directory');
// copy the empty project to the target path
fs.copySync(path.join(resourcesDir, 'projects', 'empty'), projectDir);
this.cloneDemoProject('demo', projectDir, function() {
// copy parameters.ini.dist to parameters.ini
fs.linkSync(
path.join(projectDir, 'app', 'config', 'parameters.ini.dist'),
path.join(projectDir, 'app', 'config', 'parameters.ini')
);
console.log('Step 2/5: setting up parameters.ini');
console.log('Step 2/4: creating package.json');
// copy parameters.ini.dist to parameters.ini
fs.linkSync(
path.join(projectDir, 'app', 'config', 'parameters.ini.dist'),
path.join(projectDir, 'app', 'config', 'parameters.ini')
);
// fix the package.json file
this.fixPackageJsonFile(projectDir, projectName);
console.log('Step 3/4: installing npm dependencies');
console.log('Step 3/5: setting up demo data');
// install the project dependencies
this.runNpmInstall(projectDir, function(){
self.copyDemoData(projectDir);
console.log('Step 4/4: setting up demo bundles');
console.log('Step 4/5: creating package.json');
// fix the package.json file
self.fixPackageJsonFile(projectDir, projectName);
console.log('Step 5/5: installing npm dependencies');
// install the project dependencies
self.runNpmInstall(projectDir, function(){
console.log('project created at: ' + projectDir) + '!!!';
});
});

@@ -94,2 +111,28 @@ },

/**
* Clone the demo project to the given path via GIT
*
* @param {String} type
* @param {String} projectDir
* @param {String} projectName
* @param {Function} cb
* @return {void}
*/
cloneDemoProject: function(type, projectDir, cb) {
var self = this;
git.clone(this.projectUrls[type], projectDir, null, function(err, repository) {
if (err) {
self.exitWithError(err);
}
// remove .git directory
fs.removeSync(path.join(projectDir, '.git'));
cb();
});
},
/**
* Fix some stuff in the package.json file

@@ -101,3 +144,4 @@ *

*/
fixPackageJsonFile: function(projectDir, projectName){
fixPackageJsonFile: function(projectDir, projectName) {
var jsonPath = path.join(projectDir, 'package.json');

@@ -115,2 +159,17 @@ var package = require(jsonPath);

/**
* Copy demo data from the demo-bundle to the var directory
*
* @param {String} projectDir
* @return {void}
*/
copyDemoData: function(projectDir) {
var dataPath = path.join(projectDir, 'src', 'demo-bundle', 'lib', 'resources', 'demo-data', 'nedb');
if (fs.existsSync(dataPath)) {
fs.copySync(dataPath, path.join(projectDir, 'var', 'data'));
}
},
/**
* Run npm install in the project

@@ -122,3 +181,3 @@ *

*/
runNpmInstall: function(projectDir, cb){
runNpmInstall: function(projectDir, cb) {

@@ -149,3 +208,3 @@ var self = this;

*/
exitWithError: function(error){
exitWithError: function(error) {
console.error("Error: " + error);

@@ -152,0 +211,0 @@ process.exit();

9

lib/conga.js

@@ -163,4 +163,9 @@ /*

var configPath = path.join(this.path, 'app', 'config', 'bundles.yml');
var bundles = yaml.parse(fs.readFileSync(configPath, 'utf-8')).bundles;
var config = yaml.parse(fs.readFileSync(configPath, 'utf-8'));
//console.log(configPath);
//console.log(config);
var bundles = config.bundles.all;;
// add the core framework bundle

@@ -313,2 +318,2 @@ bundles.push('conga-framework');

}
};
};
{
"name": "conga",
"version": "0.0.15",
"version": "0.0.17",
"description": "MVC framework for node.js",

@@ -28,2 +28,3 @@ "directories": {

"fs-extra": "0.30.0",
"gift": "0.9.0",
"inflect": "0.3.0",

@@ -30,0 +31,0 @@ "supervisor": "0.5.2",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc