Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit 9ce0049

Browse files
authored
Fix readme for Npm (#20)
1 parent a27e57a commit 9ce0049

File tree

6 files changed

+60
-17
lines changed

6 files changed

+60
-17
lines changed

.azext/changelog-cache.json

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
}
3131
],
3232
"pullRequests": [
33+
{
34+
"id": 808530277,
35+
"number": 20,
36+
"submitter": "joachimdalen",
37+
"title": "Fix readme for Npm",
38+
"url": "https://github.com/joachimdalen/azext/pull/20"
39+
},
3340
{
3441
"id": 807673980,
3542
"number": 16,

.azext/changelog.json

+17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
[
2+
{
3+
"publishDate": "2021-12-22",
4+
"version": "0.2.1",
5+
"modules": [
6+
{
7+
"name": "core",
8+
"version": "0.2.1",
9+
"changes": [
10+
{
11+
"type": "docs",
12+
"description": "Updated NPM readme",
13+
"pullRequest": 20
14+
}
15+
]
16+
}
17+
]
18+
},
219
{
320
"publishDate": "2021-12-22",
421
"version": "0.2.0",

npm.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<p align="center">
1010
A collection of tools to help with developing extensions for Azure DevOps.
1111
<br />
12-
<a href="https://github.com/joachimdalen/azext"><strong>Explore the docs »</strong></a>
12+
<a href="https://github.com/joachimdalen/azext/blob/master/docs/index.md"><strong>Explore the docs »</strong></a>
1313
<br />
1414
<br />
1515
<a href="https://www.npmjs.com/package/@joachimdalen/azext">View Package</a>
@@ -34,12 +34,26 @@
3434

3535
AzExt provides a set of utilities to help with developing Extensions for Azure DevOps.
3636

37-
| Command | Description |
38-
| ----------- | --------------------------------------- |
39-
| `init` | Generate default config folder |
40-
| `changelog` | Tools to manage and generate changelogs |
37+
[//]: # "#help-definition[command=help]"
4138

42-
Full documentation is available on GitHub.
39+
```text
40+
41+
Command List
42+
43+
init Generate default config folder
44+
changelog Tools to manage and generate changelogs
45+
readme Tools to manage and generate partial documentation
46+
help Print this usage guide.
47+
48+
Global Options
49+
50+
--ci string Run in CI mode. Currenctly supported: ado (Azure DevOps) --ci=ado
51+
52+
```
53+
54+
[//]: # "#help-definition[end]"
55+
56+
Full documentation is available on [GitHub](https://github.com/joachimdalen/azext/blob/master/docs/index.md).
4357

4458
## License
4559

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@joachimdalen/azext",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "A collection of utilities to help with extension development for Azure DevOps",
55
"main": "dist/azext.js",
66
"bin": {

scripts/readme-generation.ts

+14-9
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import glob from 'glob';
88
import { isModuleInstalled } from '../src/core/addons-checker';
99
import { globalOptionsSection } from '../src/cli/models';
1010

11-
const filePattern = '../docs/**/*.md';
12-
1311
const globFiles = function (pattern: string): Promise<string[] | undefined> {
1412
return new Promise((resolve, reject) => {
1513
glob(pattern, (err, files) =>
@@ -26,12 +24,12 @@ const pattern = [
2624
const fullMatch =
2725
/(?<fullcontent>(?<start>\[\/\/\]\:\s#\s["']#(?<startidentifier>.+)\[command=(?<startcommand>.+)\]["'])(?<content>[\S\s]+)(?<end>\[\/\/\]\:\s#\s["']#(?<endidentifier>.+)\[end\]["']))/gm;
2826

29-
//const files = ['../docs/changelog/generate.md', '../docs/changelog/config.md'];
30-
31-
const replaceDefinitions = async () => {
32-
console.log(chalk.greenBright('Starting documentation processing'));
27+
const replaceDefinitions = async (path: string) => {
28+
console.log(
29+
chalk.greenBright(`Starting documentation processing for pattern: ${path}`)
30+
);
3331
const cli = new AzExtCli();
34-
const files = await globFiles(filePattern);
32+
const files = await globFiles(path);
3533

3634
if (files === undefined) {
3735
console.error(chalk.redBright('Unable to find files'));
@@ -68,7 +66,8 @@ const replaceDefinitions = async () => {
6866
if (command && fullContent) {
6967
const result = cli.parse(command);
7068

71-
const sections = result.data?.parent?.sections || result.data?.command?.sections;
69+
const sections =
70+
result.data?.parent?.sections || result.data?.command?.sections;
7271
if (sections) {
7372
const dt = [...sections, globalOptionsSection];
7473
dt.splice(0, introSections.length);
@@ -112,6 +111,12 @@ const replaceDefinitions = async () => {
112111
}
113112
};
114113

115-
replaceDefinitions().then(() =>
114+
const replaceMultiple = async (patterns: string[]) => {
115+
for (const pattern of patterns) {
116+
await replaceDefinitions(pattern);
117+
}
118+
};
119+
120+
replaceMultiple(['../docs/**/*.md', '../npm.md']).then(() =>
116121
console.log(chalk.bgGreenBright.black('Processing completed'))
117122
);

src/version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const LIB_VERSION = '0.2.0';
1+
export const LIB_VERSION = '0.2.1';

0 commit comments

Comments
 (0)