-
Notifications
You must be signed in to change notification settings - Fork 24
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
127 customize gateway from bosconfigjson #147
Conversation
lib/dev.ts
Outdated
|
||
gatewayObject.enabled = commandGateway; | ||
|
||
if (configGateway?.bundleUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering we have a default config, ability to override this config, or --no-gateway to disable it, I'm not entirely sure what this function does anymore. Take a step back and reassess it's purpose and if it's clearer to just check if gateway is disabled or not
Although we do need error checking -- we can't have bundleUrl without tagName and can't have tagName without bundleUrl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and let's have a test to confirm both must be populated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error checking is in config.ts
in the configuration schema, if I try to run the app without a gateway with both tagName
and bundleUrl
it will return this error:
(node:20505) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✗ SyntaxError: bos.config.json: Expected double-quoted property name in JSON at position 421 (line 14 column 2)
at JSON.parse (<anonymous>)
at _readFile (/Users/stefano/Workspace/Work/NEAR/bos-workspace/node_modules/jsonfile/index.js:25:16)
Without the option -g
the logic is simpler but still needs to be expressed somewhere, that's the purpose of that function, somehow we need to specify the logic of the gateway: if it's disabled, if it's enabled but without a configuration object in bos.config.json
or if it's enabled with a correctly formatted configuration object!
Let me know if you want to introduce more error checking on top of the Joi schema or if I need to move the gateway logic somewhere else!
@race-of-sloths include |
@bb-face Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
Your contribution is much appreciated with a final score of 5! Another weekly streak completed, well done @bb-face! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
@race-of-sloths score 5 |
Resolves #127