Giter Club home page Giter Club logo

charlike's People

Contributors

greenkeeper[bot] avatar renovate-bot avatar renovate[bot] avatar tunnckocore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

charlike's Issues

git push the tweaks from `patch` dist-tag

Issues while using mix things.

For example:

  1. Want to be scoped package, e.g. @gage/app
  2. repo to be different name, e.g. gage-app
  3. and be in @tunnckoCoreLabs org - e.g. 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

Weekly Digest (24 March, 2019 - 31 March, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:

ISSUES

This week, no issues have been created or closed.

PULL REQUESTS

This week, no pull requests has been proposed by the users.

CONTRIBUTORS

This week, no user has contributed to this repository.

STARGAZERS

This week, no user has starred this repository.

COMMITS

This week, there have been no commits.

RELEASES

This week, no releases were published.

That's all for this week, please watch πŸ‘€ and star ⭐ tunnckoCoreLabs/charlike to receive next weekly updates. πŸ˜ƒ

Weekly Digest (28 April, 2019 - 5 May, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

basic nested support (temporary workaroudn)

/*!
 * 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));
  });
}

An in-range update of camelcase is breaking the build 🚨

Version 4.1.0 of camelcase just got published.

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 πŸ’ͺ


Status Details
  • ❌ 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

Commits

The new version differs by 4 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Weekly Digest (24 February, 2019 - 3 March, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

An in-range update of coveralls is breaking the build 🚨

Version 2.13.0 of coveralls just got published.

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 πŸ’ͺ


Status Details
  • ❌ 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

Commits

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.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

bug: Better self resolving - cant find `templates` folder that's in pkg

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')
  }

Weekly Digest (17 February, 2019 - 24 February, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

Ignore option

so we can ignore what template files NOT to be generated, useful for the Update.

Weekly Digest (10 February, 2019 - 17 February, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

Weekly Digest (12 May, 2019 - 19 May, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

Action Required: Fix Renovate Configuration

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)

Weekly Digest (5 May, 2019 - 12 May, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

Weekly Digest (3 March, 2019 - 10 March, 2019)

Here's the Weekly Digest for tunnckoCoreLabs/charlike:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were no stargazers.


RELEASES

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. πŸ“†

settings.dest

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.

An in-range update of nyc is breaking the build 🚨

Version 10.3.0 of nyc just got published.

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 πŸ’ͺ

Status Details - ❌ **continuous-integration/appveyor/branch** Waiting for AppVeyor build to complete [Details](https://ci.appveyor.com/project/tunnckoCore/charlike/build/1.0.136),- βœ… **coverage/coveralls** First build on greenkeeper/nyc-10.3.0 at 75.556% [Details](https://coveralls.io/builds/11301554),- βœ… **continuous-integration/travis-ci/push** The Travis CI build passed [Details](https://travis-ci.org/tunnckoCore/charlike/builds/227087670?utm_source=github_status&utm_medium=notification),- ❌ **ci/circleci** Your tests failed on CircleCI [Details](https://circleci.com/gh/tunnckoCore/charlike/23?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)

Commits

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

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.