Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number is not a valid type #106

Closed
emmeowzing opened this issue May 25, 2024 · 2 comments
Closed

number is not a valid type #106

emmeowzing opened this issue May 25, 2024 · 2 comments
Assignees

Comments

@emmeowzing
Copy link

Hello, I'm struggling to specify that a particular field should be a number or some other number-like type. This is mentioned in the README ~

"number": "number"

However, I've tried passing in --config, but it looks like, in the index.js, only the provided config.json is actually ever referenced. Would it be possible to allow for a custom config file to be passed, specifying additional modifiers?

https://github.com/bitnami/readme-generator-for-helm/blob/main/index.js#L50

@emmeowzing
Copy link
Author

I take that back, it looks like there's a ternary here that allows users to pass an options.config-flag ~

const configPath = options.config ? options.config : `${__dirname}/config.json`;

But for some reason it's not reading it from my filesystem properly.

- hook id: helm-readme-generator
- exit code: 1

node:internal/modules/cjs/loader:1189
  throw err;
  ^

Error: Cannot find module './.github/readme-generator-config.json'
Require stack:
- /Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/index.js
- /Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/bin/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)
    at Module._load (node:internal/modules/cjs/loader:1012:27)
    at Module.require (node:internal/modules/cjs/loader:1271:19)
    at require (node:internal/modules/helpers:123:16)
    at getParsedMetadata (/Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/index.js:20:18)
    at runReadmeGenerator (/Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/index.js:52:28)
    at Object.<anonymous> (/Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/bin/index.js:22:1)
    at Module._compile (node:internal/modules/cjs/loader:1434:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
    at Module.load (node:internal/modules/cjs/loader:1249:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/index.js',
    '/Users/emma.doyle/.cache/pre-commit/repofc_34jlq/node_env-default/lib/node_modules/@bitnami/readme-generator-for-helm/bin/index.js'
  ]
}

I was trying to stash it in ./.github/readme-generator-config.json.

@emmeowzing
Copy link
Author

Ah I see, so this may be intended behavior? Like there's no reason to specify a modifier for a type, it already knows it's a number.

"collectionInterval": {
  "type": "number",
  "description": "How often the agent collects metrics and stores them in the database.",
  "default": "60"
},

Closing this, but at least it's documented and I didn't have to open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants