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

@nebula.js/cli-create

Package Overview
Dependencies
Maintainers
4
Versions
160
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nebula.js/cli-create - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

templates/mashup/_package.json

16

command.js
const create = require('./lib/create');
const mashup = {
command: 'mashup <name>',
desc: 'Create a mashup',
builder(yargs) {
yargs.positional('name', {
type: 'string',
description: 'name of the project',
});
},
handler(argv) {
create(argv);
},
};
module.exports = {

@@ -7,2 +21,4 @@ command: 'create <name>',

builder(yargs) {
yargs.command(mashup);
yargs.positional('name', {

@@ -9,0 +25,0 @@ type: 'string',

55

lib/create.js

@@ -49,3 +49,3 @@ const chalk = require('chalk');

function cpy(root, destination) {
function copyFactory(root, destination) {
return (source, target, data) => {

@@ -65,2 +65,4 @@ if (data) {

const isMashup = argv._.includes('mashup');
const projectFolder = name;

@@ -95,3 +97,3 @@ const packageName = name.split('/').slice(-1)[0];

choices: ['none', 'minimal', 'barchart'],
when: !argv.picasso,
when: !isMashup && !argv.picasso,
},

@@ -109,24 +111,26 @@ ]);

// ==== common files ====
// copy raw files
['editorconfig', 'eslintignore', 'gitignore', 'eslintrc.json'].forEach(filename =>
fs.copyFileSync(
path.resolve(templatesRoot, 'common', `_${filename}`), // copying dotfiles may not always work, so they are prefixed with an underline
path.resolve(destination, `.${filename}`)
)
);
const copy = copyFactory(templatesRoot, destination);
const copy = cpy(templatesRoot, destination);
copy('common/README.md', 'README.md', { name: packageName });
// ==== template files ====
const folders = [];
if (picasso !== 'none') {
folders.push('picasso/common');
folders.push(`picasso/${picasso}`);
const folders = ['common'];
if (isMashup) {
folders.push('mashup');
} else {
folders.push('none');
folders.push('sn/common');
if (picasso !== 'none') {
folders.push('sn/picasso/common');
folders.push(`sn/picasso/${picasso}`);
} else {
folders.push('sn/none');
}
}
const data = {
name: packageName,
description: '',
user: options.author.name,
email: options.author.email,
nebulaVersion: pkg.version,
};
const traverse = (sourceFolder, targetFolder = '') => {

@@ -142,12 +146,7 @@ const files = fs.readdirSync(path.resolve(templatesRoot, sourceFolder));

traverse(p, next);
} else if (file === '_package.json') {
copy(`${sourceFolder}/_package.json`, 'package.json', {
name: packageName,
description: '',
user: options.author.name,
email: options.author.email,
nebulaVersion: pkg.version,
});
} else if (file[0] === '_') {
const newFileName = file === '_package.json' ? 'package.json' : `.${file.substr(1)}`;
copy(`${sourceFolder}/${file}`, `${targetFolder}/${newFileName}`.replace(/^\//, ''), data);
} else {
copy(`${sourceFolder}/${file}`, next);
copy(`${sourceFolder}/${file}`, next, data);
}

@@ -154,0 +153,0 @@ });

{
"name": "@nebula.js/cli-create",
"version": "0.2.0",
"version": "0.2.1",
"description": "",

@@ -30,3 +30,3 @@ "license": "MIT",

},
"gitHead": "f831ff585b2cf3adfa0eda2bf8629b2697527550"
"gitHead": "5d7768efdb31e06bf21278713cda61ffe86435ee"
}

@@ -6,3 +6,3 @@ # @nebula.js/cli-create

```sh
npm install -g @nebula.js/cli@next
npm install -g @nebula.js/cli
```

@@ -9,0 +9,0 @@

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