Coder Social home page Coder Social logo

opencollective's Introduction

@nuxtjs/opencollective ๐Ÿค Pretty opencollective stats on postinstall!

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

Showcase

๐Ÿ“– Release Notes

Features

Displaying opencollective statistics and a donation URL after users install a package is important for many creators. After problems with current packages that offer similar features, we decided to spin off our one own. Our key goals are:

  • No interference/problems when installing packages. Never break installation because of the package
  • Pretty output for all information
  • Decent configurability
  • Seamless drop-in for common solutions

Setup

  • Add @nuxtjs/opencollective dependency using yarn or npm to your project
  • Add the script to postinstall in your package.json
{
  // ...
  "scripts": {
    "postinstall": "opencollective || exit 0"
  },
  "collective": {
    "url": "https://opencollective.com/nuxtjs"
  }
  // ...
}
  • Configure it

Configuration

Configuration is applied through your project's package.json.

A full configuration looks like:

{
  "collective": {
    "url": "https://opencollective.com/nuxtjs",
    "logoUrl": "https://opencollective.com/nuxtjs/logo.txt?reverse=true&variant=variant2",
    "donation": {
      "slug": "/order/591",
      "amount": "50",
      "text": "Please donate:"
    }
  }
}

Attribute Optional Default Comment
url โŒ - The URL to your opencollective page
logo โœ… - LEGACY: The URL to the logo that should be displayed. Please use logoUrl instead.
logoUrl โœ… - The URL to the ASCII-logo that should be displayed.
donation.slug โœ… '/donate' The slug that should be appended to url. Can be used to setup a specific order.
donation.amount โœ… - The default amount that should be selected on the opencollective page.
donation.text โœ… 'Donate:' The text that will be displayed before your donation url.

Disable message

We know the postinstall messages can be annoying when deploying in production or running a CI pipeline. That's why the message is disabled in those environments by default.

Enabled when one the following environment variables is set:

  • NODE_ENV=dev
  • NODE_ENV=development
  • OPENCOLLECTIVE_FORCE

Strictly Disabled when one the following environment variables is set:

  • OC_POSTINSTALL_TEST
  • OPENCOLLECTIVE_HIDE
  • CI
  • CONTINUOUS_INTEGRATION
  • NODE_ENV (set and not dev or development)

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Run it manually path/to/project/root/src/index.js path/to/package/you/want/to/try
  • Run tests with npm t or yarn test

Inspiration

This project is heavily inspired by opencollective-cli.

License

MIT License

Copyright (c) Alexander Lichter [email protected]

opencollective's People

Contributors

pi0 avatar mannil avatar nojhamster avatar clarkdo avatar renovate[bot] avatar

Watchers

James Cloos avatar  avatar

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.