tunnckocorelabs / charlike Goto Github PK
View Code? Open in Web Editor NEWSmall, fast and streaming project scaffolder with support for hundreds of template engines (via @JSTransformers) and sane defaults
License: Apache License 2.0
Small, fast and streaming project scaffolder with support for hundreds of template engines (via @JSTransformers) and sane defaults
License: Apache License 2.0
since we switch to semantic-release
Issues while using mix things.
For example:
@gage/app
gage-app
tunnckoCoreLabs/gage-app
The problem was settings.project
merging. Actually defaulting it to argv.project = Object.assign({}, argv.project)
inside the charlike.cli
function. This was not working as expected because in that time the settings.project
may be settings['project.repo']
(i.e. a string not an object) which is handled later in the src/defaults.js
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
This week, no issues have been created or closed.
This week, no pull requests has been proposed by the users.
This week, no user has contributed to this repository.
This week, no user has starred this repository.
This week, there have been no commits.
This week, no releases were published.
That's all for this week, please watch π and star β tunnckoCoreLabs/charlike to receive next weekly updates. π
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
https://github.com/zeit/update-check - similar to update-notifier
, but smaller, simpler and working.
Use it on update
and create-project
too.
/*!
* charlike <https://github.com/tunnckoCore/charlike>
*
* Copyright (c) Charlike Mike Reagent <@tunnckoCore> (http://i.am.charlike.online)
* Released under the MIT license.
*/
'use strict';
const fs = require('fs');
const path = require('path');
const exists = require('fs-exists-sync');
const camelcase = require('camelcase');
const dateformat = require('dateformat');
const copyFolder = require('stream-copy-dir');
const JSTransformer = require('jstransformer');
const transformer = JSTransformer(require('jstransformer-jstransformer'));
const readFile = fp =>
new Promise((resolve, reject) => {
fs.readFile(fp, 'utf8', (err, res) => {
if (err) return reject(err);
resolve(res);
});
});
/**
* > Scaffolds project with `name` and `desc` by
* creating folder with `name` to some folder.
* By default it generates folder with `name` to current
* working directory (or `options.cwd`).
* You can also define what _"templates"_ files to be used
* by passing `options.templates`, by default it uses [./templates](./templates)
* folder from this repository root.
*
* **Example**
*
* ```js
* const charlike = require('charlike')
* const opts = {
* cwd: '/home/charlike/code',
* templates: '/home/charlike/config/.jsproject',
* locals: {
* foo: 'bar',
* // some helper
* toUpperCase: (val) => val.toUpperCase()
* }
* }
*
* charlike('my-awesome-project', 'some cool description here', opts)
* .then((dest) => console.log(`Project generated to ${dest}`))
* .catch((err) => console.error(`Error occures: ${err.message}; Sorry!`))
* ```
*
* @param {String} `<name>` project name
* @param {String} `<desc>` project description
* @param {Object} `[options]` use `options.locals` to pass more context to template files,
* use `options.engine` for different template engine to be used
* in template files, or pass `options.render` function
* to use your favorite engine
* @return {Promise} if successful, resolved promise with absolute path to the project
* @api public
*/
module.exports = function charlike(name, desc, options) {
return new Promise((resolve, reject) => {
if (typeof name !== 'string') {
return reject(new TypeError('charlike: expect `name` to be string'));
}
if (typeof desc !== 'string') {
return reject(new TypeError('charlike: expect `desc` to be string'));
}
const opts = options && typeof options === 'object' ? options : {};
const cwd = typeof opts.cwd === 'string' ? path.resolve(opts.cwd) : process.cwd();
const localPkg = path.join(cwd, 'package.json');
const promise = exists(localPkg)
? readFile(localPkg).then(JSON.parse)
: Promise.resolve();
promise.then(pkg => {
const src =
typeof opts.templates === 'string'
? path.resolve(cwd, opts.templates)
: path.resolve(__dirname, 'templates');
const dest = path.join(cwd, name);
// for `templates/src` folder; just copy, no plugin argument
copyFolder(path.join(src, 'src'), path.join(dest, 'src'))
.once('error', reject)
.once('finish', () => {
// resolve(dest)
// for `templates/test` folder; just copy, no plugin argument
copyFolder(path.join(src, 'test'), path.join(dest, 'test'))
.once('error', reject)
.once('finish', () => {
original(pkg, { src, dest, name, desc, opts }).then(resolve, reject);
});
});
// sasa
}, reject);
});
};
function original(pkg, { src, dest, name, desc, opts }) {
return new Promise((resolve, reject) => {
const plugin = (file, cb) => {
// convert templates names to normal names
file.basename = file.basename.replace(/^_/, '.').replace(/^\$/, '');
/**
* Common helper functions passed
* as locals to the template engine.
*
* - dateformat
* - camelcase
* - uppercase
* - lowercase
* - ucfirst
*
* @type {Object}
*/
const helpers = {
date: dateformat,
camelcase: camelcase,
toCamelCase: camelcase,
toUpperCase: val => val.toUpperCase(),
toLowerCase: val => val.toLowerCase(),
ucFirst: val => {
return val.charAt(0).toUpperCase() + val.slice(1);
},
};
/**
* Minimum basic locals
* for template engne.
*
* @type {Object}
*/
const author = {
url: 'https://charlike.online',
realname: 'Charlike Mike Reagent',
username: 'tunnckoCore',
};
const locals = Object.assign(
{
pkg: pkg,
name: name,
description: desc,
owner: author.username,
author: `Charlike Mike Reagent <[email protected]>`,
},
helpers,
opts.locals || {}
);
locals.repository = locals.repository
? locals.repository
: `${locals.owner}/${locals.name}`;
locals.varname = camelcase(locals.name);
const input = file.contents.toString();
if (typeof opts.render === 'function') {
file.contents = Buffer.from(opts.render(input, locals));
cb(null, file);
return;
}
opts.engine = typeof opts.engine === 'string' ? opts.engine : 'j140';
const result = transformer.render(input, opts, locals);
file.contents = Buffer.from(result.body);
cb(null, file);
};
copyFolder(src, dest, plugin)
.once('error', reject)
.once('finish', () => resolve(dest));
});
}
Branch | Build failing π¨ |
---|---|
Dependency | camelcase |
Current Version | 4.0.0 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
As camelcase is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you itβs very likely also breaking them.
I recommend you give this issue a very high priority. Iβm sure you can resolve this πͺ
β continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
β coverage/coveralls First build on greenkeeper/camelcase-4.1.0 at 75.556% Details
β continuous-integration/travis-ci/push The Travis CI build passed Details
β ci/circleci Your tests failed on CircleCI Details
The new version differs by 4 commits .
0e6e4a2
4.1.0
a4c13e5
Style tweaks
e7751f7
Improve performance of the common case
9f61316
please @jdalton
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Currently we read only the given folder and it's not recursive. It's meant to be that way. But my repo template now includes src
and .circleci
and test
dirs.
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
Branch | Build failing π¨ |
---|---|
Dependency | coveralls |
Current Version | 2.12.0 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As coveralls is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
β continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
β coverage/coveralls First build on greenkeeper/coveralls-2.13.0 at 75.556% Details
β ci/circleci Your tests failed on CircleCI Details
β continuous-integration/travis-ci/push The Travis CI build passed Details
The new version differs by 4 commits .
2821200
version bump
ef7e811
Parse commit from packed refs if not available in refs dir. (#163)
e476964
Merge pull request #162 from evanjbowling/patch-1
63a7f92
Update README.md
See the full diff.
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
so we can use it in @tunnckocore/update
Once upon a time it was easy - just __dirname
or __filename
.
It seems that there is no so easy way to get them and not depend on CJS's things or ESM's upcoming import.meta
. Once it come, we'll switch to it.
Using resolve
package. But strangely... we can't use the async, so we are using resolve.sync
.. probably because some caches or something.
let srcPath = null
if (typeof opts.templates === 'string') {
srcPath = path.resolve(opts.templates)
} else {
const selfPath = resolve.sync('charlike')
const dirname = path.dirname(path.dirname(selfPath))
srcPath = path.join(dirname, 'templates')
}
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
so we can ignore what template files NOT to be generated, useful for the Update.
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: Cannot find preset's package (t)
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
Based on https://github.com/tunnckoCore/dush + dush-promise
.
use git-user-email in templates/{CODE_OF_CONDUCT.md,LICENSE,_verb.md}
and git-username
in allcontributorsrc
Here's the Weekly Digest for tunnckoCoreLabs/charlike:
Last week, no issues were created.
Last week, no pull requests were created, updated or merged.
Last week there were no commits.
Last week there were no contributors.
Last week there were no stargazers.
Last week there were no releases.
That's all for last week, please π Watch and β Star the repository tunnckoCoreLabs/charlike to receive next weekly updates. π
You can also view all Weekly Digests by clicking here.
Your Weekly Digest bot. π
Because current settings.project.dest
is used for another thing, which.. Probably drop the support for it make more sense.
Practically, we can use it, but it will affect the locals.repository
for example.
So you can't make it some random thing, because you later can't fix the locals.repository
.
Branch | Build failing π¨ |
---|---|
Dependency | nyc |
Current Version | 10.2.2 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As nyc is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
The new version differs by 4 commits ahead by 4, behind by 2.
55e826d
chore(release): 10.3.0
89dc7a6
chore: explicit update of istanbul dependnecies (#562)
1887d1c
feat: add support for --no-clean, to disable deleting raw coverage output (#558)
ff73b18
fix: source-maps were not being cached in the parent process when --all was being used (#556)
false
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.