Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Add getCurrentIpAddress action #23

Merged
merged 3 commits into from
Dec 1, 2018

Conversation

bachya
Copy link
Contributor

@bachya bachya commented Nov 30, 2018

Checks

  • I've checked there are no linting errors.
  • I've checked the code is still at 100% test coverage.

Added Actions (if relevant)

  • Get Current IP Address

Are you happy to be listed as a contributor on Shortcuts.fun?

Yes

Any other information / comments

This is my first foray into Node and TypeScript – ever (after 10 years of Python). After I got my feet under me, your guides worked great.

Overall, I'm still getting used to the architecture of a Node module, how TypeScript is managed, etc., so it's entirely possible I haven't done things elegantly. Please send any feedback my way; I plan on contributing a lot! 😎

@joshfarrant
Copy link
Owner

Hey @bachya 👋 Great to have you as a contributor!

This is a good-looking PR, thanks!

To say this is your first foray into Node and Typescript this is excellent, and the code you've written is perfect. The only thing I'd ask would be to add two more tests to getCurrentIpAddress.spec.ts, something like:

builds a getCurrentIpAddress action when an address is passed

and

builds a getCurrentIpAddress action when a type is passed

The tests will pass in either an address or type to the getCurrentIpAddress function and then check that the output matches what we'd expect. You can essentially copy this test in setTorch.spec.ts, but just change the setting to address in the first test and type in the second. Other than that the PR is good to go!

Hope that makes sense. If you run into any issues let me know and I'd be happy to help 👍

Copy link
Owner

@joshfarrant joshfarrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just spotted a couple of very minor things.

src/interfaces/WF/WFIPAddressType.ts Outdated Show resolved Hide resolved
src/interfaces/WF/WFIPAddressAddress.ts Outdated Show resolved Hide resolved
src/interfaces/WF/WFWorkflowActionParameters.ts Outdated Show resolved Hide resolved
src/interfaces/WF/WFIPAddressType.ts Outdated Show resolved Hide resolved
src/interfaces/WF/WFIPAddressAddress.ts Outdated Show resolved Hide resolved
src/actions/getCurrentIpAddress.ts Outdated Show resolved Hide resolved
@xAlien95
Copy link
Contributor

@joshfarrant, should runScriptOverSSH be renamed to runScriptOverSsh?

Time ago I asked to use SSH instead of Ssh to follow how some JS functions/properties are named (e.g. .innerHTML), without noticing that in the CONTRIBUTING section is expressly written to use camelCase:

The file (and action) you're creating should be the name of the action as it appears in the Shortcuts app, camelCased.

@joshfarrant
Copy link
Owner

@xAlien95 I suppose we need to formally come down on one side or the other, and update the CONTRIBUTING.md to reflect that.

Take a look at #26

@joshfarrant
Copy link
Owner

Don't worry about the changes to casing mentioned in the previous two comments btw @bachya, we'll sort that out at a later point once a decision's been made in #26.

@joshfarrant
Copy link
Owner

Looking good!

@joshfarrant joshfarrant merged commit 3a90ca6 into joshfarrant:master Dec 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants