npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nova-publisher

v1.1.7

Published

Plugin dedicated to call multiple webhooks for publishing actions.

Downloads

15

Readme

View on Strapi Marketplace

This plugin does several things:

  1. Flexible publishing, a URL, in POST or GET, with or without headers ;
  2. Allows you to publish to multiple instances (Prod, Preview, etc.);
  3. Adds a publishing component to override Strapi's state management, useful with CRON in particular (no obligation to use);
  4. Activate a cron that will update the active instances that need to be rebuilt every day at 1am (no obligation to use).

1. Installation

a. How to Install

Copy the following code and run from your terminal

npm i nova-publisher

or

yarn add nova-publisher

b. Configuration

I. plugins.js

The configuration is done in the environment variables and in the plugin configuration.

Here there are two instances configured, but you can add more or put only one.

// ./config/plugins.js
// if change, run `npm run build --clean`

module.exports = ({ env }) => ({
  // ...
  'nova-publisher': {
    enabled: true,
    config: {
      dateConfiguration: {
        dateLocaleString: 'fr-FR', // sample
        options: {
          // sample
          timeZone: 'Europe/Paris',
          timeZoneName: 'short',
          hour12: false,
        },
      },
      addPublishComponent: false,
      instances: [
        {
          name: env('INSTANCE_0_NAME'),
          icon: '🚀', // sample
          enabled: env('INSTANCE_0_ENABLED'),
          cron: env('INSTANCE_0_USE_CRON'),
          url: env('INSTANCE_0_URL'),
          web_url: env('INSTANCE_0_WEB_URL'),
          method: 'post',
          headers: {
            // sample
            Authorization: `Beaver ${env('INSTANCE_0_BEAVER')}`,
          },
        },
        {
          name: env('INSTANCE_1_NAME'),
          icon: '👁️', // sample
          enabled: env('INSTANCE_1_ENABLED'),
          cron: env('INSTANCE_1_USE_CRON'),
          url: env('INSTANCE_1_URL'),
          web_url: env('INSTANCE_1_WEB_URL'),
          method: 'post',
          headers: {
            // sample
            Authorization: `Beaver ${env('INSTANCE_1_BEAVER')}`,
          },
        },
      ],
    },
  },
  // ...
});

| Variable | Description | Type | Default value | | ------------------------------------ | ----------------------------------------------------------------- | ------- | --------------------------------------------------------------------- | | dateConfiguration | Configuration of the date format in the messages, see (1). | Object | (See below) | | dateConfiguration.dateLocaleString | Date local to use, see (1) | String | en-EN | | dateConfiguration.options | Date formatting options, see (1) | Object | { timeZone: 'Europe/London', timeZoneName: 'short', hour12: false } | | addPublishComponent | Adds the helper component to manage more finely the publications. | Boolean | false | | instances | Configuration of the instances where to launch the publication. | Object | (See below) | | instances.name * | Name of the intance. | String | Mandatory | | instances.icon * | Emoji. | String | Mandatory | | instances.enabled * | Enables or disables the display of the instance. | Boolean | Mandatory | | instances.url * | Target publish url. | String | Mandatory | | instances.web_url | URL of your instance to open it from Nova-Publisher page. | String | - | | instances.method | POST ou GET. | String | POST | | instances.headers | Headers to send, see (2). | Object | - |

* Mandatory field

(1) Pour dateConfiguration, see Date.prototype.toLocaleString()

(2) pour instances.headers, see HTTP headers

II. server.js

Enabled internal Strapi CRON

// ./config/server.js
module.exports = ({ env }) => ({
  // ...
  cron: {
    enabled: true,
  },
  // ...
});

2. Utilisation

preview

Warning Before any use, the `Publication Status' displays a generic message.

Note The Publication Status' message is not stored in the database (in case it is copied to other instances), but in a file under ./public/status-${instances[id].name}.txt`.

If several instances are configured, the block is repeated.

Auto-publish enabledindicates whether CRON is enabled for this instance, seeinstances.enabled`.

Publish

Click on Publish to initiate the action.

  • The button is disabled while waiting (if you refresh the page, the button will be enabled again).
  • The Publish Status displays Build started at <date>.
  • When the action returns, the button is reactivated.

Return management

When the action returns, the Publish Status will be updated with a success or error message and the time.

  • Release in progress: Build started at <date>.
  • Success: Last build with success at <date>.
  • Error: Last build in error at <date>.

In case of an error, a Toast is displayed with the error message returned by the remote server, which you can find in the Strapi server logs.