technote/gutenberg-package-versions

gutenberg package versions

v0.2.4 2019-10-02 16:14 UTC

README

Table of Contents

Gutenberg Package Versions

Build Status Coverage Status CodeFactor License: GPL v2+ PHP: >=5.6 WordPress: >=5.0

This repository fetches the versions of Gutenberg automatically every day.
The version data is provided by API and composer.
You can also use these data by Wrapper.

Last updated

Gutenberg tag WordPress tag Last updated at
v6.6.0 v5.2.3 2 October 2019 16:14:07 UTC

https://api.wp-framework.dev/api/v1/summary.json

Data

Versions of all tags

  • data/gutenberg-versions.json (for Gutenberg Plugin)
  • data/wp-versions.json (for WP Core)

Detail

  • array of (tag => packages)
    • packages
      • array of (wp-<package> => version)

Example

{
  "v3.3.0": {
    "wp-a11y": "1.1.1",
    "wp-api-fetch": "1.0.1",
    "wp-autop": "1.1.1",
    
    ...
    
    "wp-url": "1.2.1",
    "wp-viewport": "1.0.1",
    "wp-wordcount": "1.1.1"
  },
  
  ...
  
  "v5.9.1": {
    "wp-a11y": "2.3.0",
    "wp-annotations": "1.3.0",
    "wp-api-fetch": "3.2.0",
    
    ...
    
    "wp-url": "2.6.0",
    "wp-viewport": "2.4.0",
    "wp-wordcount": "2.3.0"
  },
  "v5.9.2": {
    "wp-a11y": "2.3.0",
    "wp-annotations": "1.3.0",
    "wp-api-fetch": "3.2.0",
    
    ...
    
    "wp-url": "2.6.0",
    "wp-viewport": "2.4.0",
    "wp-wordcount": "2.3.0"
  }
  
  ...
  
}

Versions of each bag

  • data/gutenberg/<TAG>.json (for Gutenberg Plugin)
  • data/wordpress/<TAG>.json (for WP Core)

Contents

  • packages
    • wp-<package> => version

Example

{
  "wp-a11y": "2.0.0",
  "wp-api-fetch": "2.0.0",
  "wp-autop": "2.0.0",
  "wp-blob": "2.0.0",
  "wp-block-library": "2.0.0",
  "wp-block-serialization-default-parser": "1.0.0-rc.0",
  "wp-block-serialization-spec-parser": "1.0.1",
  "wp-blocks": "3.0.0",
  "wp-components": "3.0.0",
  "wp-compose": "2.0.0",
  "wp-core-data": "2.0.0",
  "wp-data": "2.0.0",
  "wp-date": "2.0.0",
  "wp-deprecated": "2.0.0",
  "wp-dom-ready": "2.0.0",
  "wp-dom": "2.0.0",
  "wp-editor": "3.0.0",
  "wp-element": "2.0.0",
  "wp-hooks": "2.0.0",
  "wp-html-entities": "2.0.0",
  "wp-i18n": "2.0.0",
  "wp-is-shallow-equal": "1.1.4",
  "wp-keycodes": "2.0.0",
  "wp-nux": "2.0.0",
  "wp-plugins": "2.0.0",
  "wp-redux-routine": "2.0.0",
  "wp-shortcode": "2.0.0",
  "wp-token-list": "1.0.0",
  "wp-url": "2.0.0",
  "wp-viewport": "2.0.0",
  "wp-wordcount": "2.0.0"
}

Usage

API

Endpoints

composer

composer require technote/gutenberg-package-versions

Helper

<?php

use Technote\GutenbergPackageVersionProvider;

// for Gutenberg
$provider = new GutenbergPackageVersionProvider();

$provider->get_tags(); // tags

$provider->get_versions(); // array of (tag => packages)
$provider->get_versions( '5.2.0' ); // array of (package => version)

$provider->get_package_version( '5.1.0', 'wp-block-editor' ); // false
$provider->get_package_version( '5.2.0', 'wp-block-editor' ); // 1.0.0-alpha.0

$provider->package_exists( '5.1', 'wp-block-editor' ); // false
$provider->package_exists( '5.2.0', 'wp-block-editor' ); // true
$provider->package_exists( 'v5.2', 'wp-block-editor' ); // true

// for WP Core
$provider = new GutenbergPackageVersionProvider( 'wp' );

$provider->get_tags(); // tags

$provider->get_versions(); // array of (tag => packages)
$provider->get_versions( '5.2.0' ); // array of (package => version)

$provider->get_package_version( '5.1.0', 'wp-block-editor' ); // false
$provider->get_package_version( '5.2.0', 'wp-block-editor' ); // 2.0.1

$provider->package_exists( '5.1', 'wp-block-editor' ); // false
$provider->package_exists( '5.2.0', 'wp-block-editor' ); // true
$provider->package_exists( 'v5.2', 'wp-block-editor' ); // true

Addition

  • Tag format
    • 1 (= 1.0.0)
    • 1.2 (= 1.2.0)
    • 1.2.3
    • v1.2.3 (= 1.2.3)
    • v.1.2.3 (= 1.2.3)

Author

GitHub (Technote)
Blog