Skip to content

Commit

Permalink
Merge pull request #52 from bitnami-labs/fix-version-option
Browse files Browse the repository at this point in the history
Fix version option and review documentation
  • Loading branch information
fmulero authored Oct 19, 2022
2 parents 498ea5d + ff0894f commit 9f1aa5e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ npm run-script lint
Usage: readme-generator [options]

Options:
-r, --readme <path> Path to the README.md file to insert the table
-v, --values <path> Path to the values.yaml file
-c, --config <path> Path to the config file
-s, --schema <path> Path to a file where to store the OpenAPI Schema
-h, --help display help for command
-v, --values <path> Path to the values.yaml file
-r, --readme <path> Path to the README.md file
-c, --config <path> Path to the config file
-s, --schema <path> Path for the OpenAPI Schema output file
--version Show Readme Generator version
-h, --help display help for command
```

## values.yaml Metadata
Expand Down Expand Up @@ -121,7 +122,7 @@ The configuration file has the following structure:
"param": "@param", <-- Tag that indicates a parameter
"section": "@section", <-- Tag that indicates a section
"descriptionStart": "@descriptionStart", <-- Tag that indicates the beginning of a section description
"descriptionEnd": "@descriptionEnd", <-- Tag that indicates the end of a section description
"descriptionEnd": "@descriptionEnd", <-- Tag that indicates the end of a section description
"skip": "@skip", <-- Tag that indicates the object must be skipped
"extra": "@extra" <-- Tag to add a description for an intermediate object
},
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/* eslint-disable import/no-dynamic-require */

const fs = require('fs');
const pjson = require('./package.json')

const { createValuesObject, parseMetadataComments } = require('./lib/parser');
const { checkKeys } = require('./lib/checker');
Expand Down Expand Up @@ -38,7 +39,7 @@ function runReadmeGenerator(options) {
const versionFlag = options.version;

if (versionFlag) {
console.log("Version:", JSON.parse(fs.readFileSync('./package.json')).version);
console.log("Version:", pjson.version);
} else {
if (!readmeFilePath && !schemaFilePath) {
throw new Error('Nothing to do. Please provide the --readme or --schema options.');
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "readme-generator-for-helm",
"version": "2.4.1",
"description": "Autogenerate READMEs' tables for Bitnami Helm Charts",
"name": "@bitnami/readme-generator-for-helm",
"version": "2.4.2",
"description": "Autogenerate READMEs tables and OpenAPI schemas for Helm Charts",
"main": "index.js",
"scripts": {
"test": "npx jest",
Expand All @@ -18,7 +18,7 @@
"table",
"autogenerate"
],
"license": "ISC",
"license": "Apache-2.0",
"dependencies": {
"commander": "^7.1.0",
"dot-object": "^2.1.4",
Expand All @@ -31,5 +31,18 @@
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"jest": "^26.6.3"
}
},
"directories": {
"lib": "lib",
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bitnami-labs/readme-generator-for-helm.git"
},
"author": "",
"bugs": {
"url": "https://github.com/bitnami-labs/readme-generator-for-helm/issues"
},
"homepage": "https://github.com/bitnami-labs/readme-generator-for-helm#readme"
}

0 comments on commit 9f1aa5e

Please sign in to comment.