1.1.0-next.3 • Published 7 years ago

@kibibit/announce-it v1.1.0-next.3

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

How to install

Install this package as a dev dependency:

npm install --save-dev @kibibit/announce-it

How to use

Intended to run after a new release in your continues integration

Twitter Setup

You have to create a Developer Account on Twitter.

  • Create an App
  • From your apps list go to your app Details
  • Select the Keys and tokens tab
  • You'll need all 4 variables available in that page:
    • API key
    • API secret key
    • Access token
    • Access token secret

As a command line tool

  • You can add a dedicated script in your package.json file:
    // ...
    "scripts": {
      // ...
      "announce": "announce-it"
    }
    // ...
  • If installed as a project dependency, you can run with npx:

    # should be ran inside your project
    # npx
    npx announce-it
    
    # directly 
    ./node_modules/.bin/announce-it
  • If installed globally, you can run it from within any node package with the correct setup

As a node module

import { KbAnnounceIt, PackageDetails } from '@kibibit/announce-it';

const announceIt = new KbAnnounceIt({
  accessTokenKey: 'TWITTER_ACCESS_KEY',
  accessTokenSecret: 'TWITTER_ACCESS_SECRET',
  consumerKey: 'TWITTER_CONSUMER_KEY',
  consumerSecret: 'TWITTER_CONSUMER_SECRET'
});

const myPackage: PackageDetails = require('./package');

// get generated tweet
const tweet: string = announceIt.generateTweet(myPackage);

console.log('going to tweet: ', tweet);

// publish tweet to twitter
announceIt.announceRelease(myPackage);
  • Use these Token as environment variables in this fashion:
  • CONSUMER_KEY = API key
  • CONSUMER_SECRET = API secret key
  • ACCESS_TOKEN_KEY = Access token
  • ACCESS_TOKEN_SECRET = Access token secret

Defining your Templates

Inside your package.json file, add an announcements object with tweet property.

You can then create your own tweet message template that will be posted to twitter.

{
  "name": "my-package",
  "version": "2.4.3",
  // ...
  "announcements": {
    "tweet": "Version <%= version %> of <%= package %> is live! <%= npmpage %>"
  },
}

The tweet template is generated with Lodash template.

You can use these variables:

  • Package name: <%= package %>
  • Version number: <%= version %>
  • Package description: <%= description %>
  • Package author: <%= author %>
  • Homepage link: <%= homepage %>
  • Package page on npm: <%= npmpage %>

Contributing

If you have suggestions for how announce-it could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

Contributors

Thanks goes to our contributors! (emoji key):

Library logo is made by Freepik from www.flaticon.com and licensed by CC 3.0 BY

License

MIT © 2019 Gil Tichon ZimGil@kibibit.io

3.0.1

5 years ago

3.0.1-beta.1

5 years ago

2.0.0-next.1

5 years ago

3.0.0

5 years ago

2.0.0-next.2

6 years ago

1.1.0-next.14

6 years ago

1.1.0-next.13

6 years ago

2.0.0

6 years ago

1.1.0-next.12

6 years ago

1.1.0-next.11

6 years ago

1.1.0-next.10

6 years ago

1.1.0-next.9

6 years ago

1.1.0-next.8

6 years ago

1.1.0-next.7

6 years ago

1.1.0-next.6

6 years ago

1.1.0-next.5

6 years ago

1.1.0-next.4

6 years ago

1.1.0-next.3

7 years ago

1.1.0-next.2

7 years ago

1.1.0

7 years ago

1.1.0-next.1

7 years ago

1.0.0-next.6

7 years ago

1.0.0-next.5

7 years ago

1.0.0

7 years ago

1.0.0-next.4

7 years ago

1.0.0-next.3

7 years ago

1.0.0-next.2

7 years ago

1.0.0-next.1

7 years ago