Skip to content

Commit 47584d9

Browse files
committed
docs: list extensions and update needed keyword
1 parent 3bd7589 commit 47584d9

File tree

7 files changed

+70
-2
lines changed

7 files changed

+70
-2
lines changed

Diff for: .husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
npm run docs:update-requirements
2-
2+
npm run docs:update-extension

Diff for: docs/.vitepress/config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ export const config: UserConfig = {
445445
text: "Publish an extension",
446446
link: "/pluginsguide/publish",
447447
},
448+
{
449+
text: "Extensions List",
450+
link: "/pluginsguide/list",
451+
},
448452
],
449453
},
450454
],

Diff for: docs/pluginsguide/list.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Extensions List
2+
3+
This list is generated from all NPM packages with the `vue3-openlayers-extension` keyword.
4+
5+
<!-- auto-generated-peer-dependency-requirements START -->
6+
7+
8+
<!-- auto-generated-peer-dependency-requirements END -->

Diff for: docs/pluginsguide/publish.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ When creating and publishing an extension for vue3-openlayers, you should follow
44
This assures, the lib can be found easily and that it follows a common plugin naming pattern.
55

66
- The package name should be `vue3-openlayers-<plugin>-<feature>`, e. g. `vue3-openlayers-source-foo`
7-
- Please add the keywords `vue3-openlayers` and `openlayers` to your published package
7+
- Please add the keywords `vue3-openlayers-extension` and `openlayers` to your published package
88

99
```jsonc [package.json]
1010
{

Diff for: package-lock.json

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"docs:build": "vitepress build docs",
6060
"docs:preview": "vitepress preview docs",
6161
"docs:update-requirements": "node scripts/insert-required-versions.mjs README.md docs/get-started.md",
62+
"docs:update-extension": "node scripts/get-extensions.mjs docs/pluginsguide/list.md",
6263
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore",
6364
"lint-fix": "npm run lint -- --fix",
6465
"prettier": "prettier --write .",
@@ -118,6 +119,7 @@
118119
"get-pkg": "^2.0.0",
119120
"husky": "^9.0.11",
120121
"jsdom": "^24.0.0",
122+
"npm-keyword": "^8.0.0",
121123
"prettier": "^3.2.5",
122124
"release-it": "^17.2.0",
123125
"typescript": "~5.4.5",

Diff for: scripts/get-extensions.mjs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use strict";
2+
3+
import { readFileSync, writeFileSync } from "fs";
4+
import { npmKeyword } from "npm-keyword";
5+
6+
// eslint-disable-next-line no-undef
7+
const file = process.argv[2];
8+
9+
npmKeyword("vue3-openlayers-extension").then((results) => {
10+
console.log(results);
11+
const list = results.map((result) => {
12+
return `- **[${result.name}](https://www.npmjs.com/package/${result.name})**: \`${result.description}\``;
13+
});
14+
15+
const contents = readFileSync(file, "utf-8");
16+
const replaced = contents.replace(
17+
/<!--.* START -->.*.*<!--.* END -->/gs,
18+
[
19+
"<!-- auto-generated-peer-dependency-requirements START -->\n",
20+
...list,
21+
"\n<!-- auto-generated-peer-dependency-requirements END -->",
22+
].join("\n"),
23+
);
24+
writeFileSync(file, replaced, "utf-8");
25+
});

0 commit comments

Comments
 (0)