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

feat: Artsy Open #156

Merged
merged 2 commits into from
May 26, 2021
Merged

feat: Artsy Open #156

merged 2 commits into from
May 26, 2021

Conversation

olerichter00
Copy link
Contributor

@olerichter00 olerichter00 commented May 25, 2021

Description

Open Artsy pages with the iOS, Android or the browser which allows to fastly navigate to any page in our app.

Pages can be opened via a URL, a path, or an alias (e.g. artsy open artist will open the artist page using an artist id from the config file that can be customized).

Examples:

With an alias:

artsy open artist

opens https://artsy.net/artwork/banksy-love-rat-signed-16 on iOS

With a path:

artsy open /artwork/andy-warhol-watercolor-paint-kit-with-brushes-11

opens https://artsy.net/artwork/banksy-love-rat-signed-16 on iOS

With a full URL:

artsy open https://staging.artsy.net/artwork/andy-warhol-watercolor-paint-kit-with-brushes-11

opens https://staging.artsy.net/artwork/banksy-love-rat-signed-16 on iOS

With flags:

artsy open artwork -a -l

opens https://localhost:3000/artwork/banksy-love-rat-signed-16 on Android

With custom variables:

artsy open artist artistID:andy-warhol

opens https://artsy.net/artist/andy-warhol on Android

@olerichter00 olerichter00 self-assigned this May 25, 2021
@olerichter00 olerichter00 force-pushed the olerichter00/artsy-open branch 2 times, most recently from c6437a8 to 1580776 Compare May 25, 2021 13:43
Copy link

@kajatiger kajatiger left a comment

Choose a reason for hiding this comment

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

Wow, this looks like a cool tool!

Copy link
Member

@dblandin dblandin left a comment

Choose a reason for hiding this comment

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

Love this!! 💜 Left a few non-blocking comments.

},
"environments": {
"local": "http://localhost:3000",
"production": "https://artsy.net",
Copy link
Member

Choose a reason for hiding this comment

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

Should we update this from https://artsy.net to https://www.artsy.net to avoid the redirect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍


const templatePath = removeTrailingSlash(pages[dashify(input)] || input)

const path = template(templatePath, variables)
Copy link
Member

Choose a reason for hiding this comment

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

Very cool! 💯

Ios.openAsync({ uri })
break
case "web":
open(uri)
Copy link
Member

Choose a reason for hiding this comment

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

oclif has a built in utility for opening URLs in the browser: https://github.com/oclif/cli-ux#cliopen

Might be worth using so we can drop a dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

Awesome!! 👏🏽

Unless I've misunderstood I think there are a few documentation examples that need updating. Otherwise this looks great to me, and will be very useful!

docs/open.md Outdated Show resolved Hide resolved
docs/open.md Outdated Show resolved Hide resolved
docs/open.md Outdated Show resolved Hide resolved
docs/open.md Outdated Show resolved Hide resolved
src/commands/open.ts Outdated Show resolved Hide resolved
@olerichter00 olerichter00 force-pushed the olerichter00/artsy-open branch 3 times, most recently from 1713817 to eb71f40 Compare May 26, 2021 14:56
@olerichter00 olerichter00 force-pushed the olerichter00/artsy-open branch 2 times, most recently from 7ed660f to a0c05ac Compare May 26, 2021 15:02
@olerichter00 olerichter00 merged commit 34e5aa1 into master May 26, 2021
@olerichter00 olerichter00 deleted the olerichter00/artsy-open branch May 26, 2021 15:08
@artsyit
Copy link
Contributor

artsyit commented May 26, 2021

🚀 PR was released in v0.19.0 🚀

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

Successfully merging this pull request may close these issues.

5 participants