Skip to content

Commit 0b15cbf

Browse files
authored
chore!: expose pluginsUrl (#407)
1 parent 1fee291 commit 0b15cbf

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

docs/versioning.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ This section explains how the `plugins.json`'s syntax is versioned. This relates
2525
To introduce a breaking change to the syntax of `plugins.json`:
2626

2727
- Update `plugins.json` with that breaking change.
28-
- Increment every reference of `list-v2` in this repository (including this file).
28+
- Increment every reference of `list-v2` in this repository, including this file and the `pluginsUrl` returned property.
29+
- Ensure the PR is marked with `!` so that `release-please` makes a major release of the `@netlify/plugins-list` npm package.
2930
- Wait for the new versioned URL to be built and ensure it can be accessed and looks normal.
3031
- Update the URL in Netlify Build, CLI and App.
3132

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
const pluginsList = require('./site/plugins.json');
4+
5+
const pluginsUrl = 'https://list-v2--netlify-plugins.netlify.app/plugins.json';
6+
7+
module.exports = { pluginsList, pluginsUrl };

test/main.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { upperCaseFirst } from 'upper-case-first';
77
import isPlainObj from 'is-plain-obj';
88
import semver from 'semver';
99
import normalizeNodeVersion from 'normalize-node-version';
10-
import plugins from '../site/plugins.json';
10+
import { pluginsList, pluginsUrl } from '../index.js';
1111

1212
const { manifest } = pacote;
1313
const { valid: validVersion, validRange, lt: ltVersion, major, minor, patch, minVersion } = semver;
@@ -49,7 +49,7 @@ const getMajorVersion = function (version) {
4949
return `${majorVersion}.${minorVersion}.${patchVersion}`;
5050
};
5151

52-
plugins.forEach((plugin) => {
52+
pluginsList.forEach((plugin) => {
5353
const { package: packageName, repo, version, name, compatibility } = plugin;
5454

5555
Object.entries(plugin).forEach(([attribute, value]) => {
@@ -175,3 +175,7 @@ plugins.forEach((plugin) => {
175175
});
176176
});
177177
});
178+
179+
test('Plugins URL exists', (t) => {
180+
t.true(pluginsUrl.startsWith('https://'));
181+
});

0 commit comments

Comments
 (0)