Skip to content

Commit

Permalink
Replace now.sh with vercel.com
Browse files Browse the repository at this point in the history
  • Loading branch information
kachkaev committed Apr 12, 2021
1 parent 12109ef commit 7905405
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<p align="center">
<b>🐸 npm jump to 🐸</b><br/>
<a href="https://njt.now.sh">njt.now.sh</a>
<a href="https://njt.vercel.app">njt.vercel.app</a>
</p>

Are you typing npm package names in your search engine to then manually navigate to their source, homepage, changelog, versions and so on? 🕐🕑🕒🕓🕔
Expand Down Expand Up @@ -93,11 +93,11 @@ Note that setting `BROWSER` instead of `NJT_BROWSER` can affect other tools, whi
1. Click _Add_ next to _Other search engines_
1. Fill in the _Add search engine_ form:

| Field | Value |
| ----------------------------- | ------------------------------------------- |
| Search engine | `njt (npm jump to)` |
| Keyword | `njt` |
| Url with %s in place of query | `https://njt.now.sh/jump?from=chrome&to=%s` |
| Field | Value |
| ----------------------------- | ----------------------------------------------- |
| Search engine | `njt (npm jump to)` |
| Keyword | `njt` |
| Url with %s in place of query | `https://njt.vercel.app/jump?from=chrome&to=%s` |

1. Press _Add_

Expand All @@ -113,7 +113,7 @@ The command to type in Chrome address bar will become `n <package> [destination]

You can use `njt` right from the address bar in Firefox.

1. Open [njt.now.sh](https://njt.now.sh)
1. Open [njt.vercel.app](https://njt.vercel.app)
1. Right-click on the search input field
1. In the context menu, select _Add Keyword for this Search..._
1. You’ll see a small form; type `njt` into the _Keyword_ field
Expand All @@ -135,19 +135,19 @@ Want to hop directly from [Alfred launcher](https://www.alfredapp.com/)?
1. Click _Add Custom Search_
1. Fill in the form:

| Field | Value |
| ---------- | ------------------------------------------------ |
| Search URL | `https://njt.now.sh/jump?from=alfred&to={query}` |
| Title | `Search njt for '{query}'` |
| Keyword | `njt` |
| Icon | drag from <https://njt.now.sh/favicon-32x32.png> |
| Field | Value |
| ---------- | ---------------------------------------------------- |
| Search URL | `https://njt.vercel.app/jump?from=alfred&to={query}` |
| Title | `Search njt for '{query}'` |
| Keyword | `njt` |
| Icon | drag from <https://njt.vercel.app/favicon-32x32.png> |

1. Press _Save_

Alternatively, copy and open this special Alfred link to get all the above steps done for you:

```txt
alfred://customsearch/Search%20njt%20for%20%27%7Bquery%7D%27/njt/utf8/nospace/https%3A%2F%2Fnjt.now.sh%2Fjump%3Ffrom%3Dalfred%26to%3D%7Bquery%7D
alfred://customsearch/Search%20njt%20for%20%27%7Bquery%7D%27/njt/utf8/nospace/https%3A%2F%2Fnjt.vercel.app%2Fjump%3Ffrom%3Dalfred%26to%3D%7Bquery%7D
```

**Pro tip 💡** You can use `n` instead of `njt` as a search keyword to avoid typing two extra characters each time.
Expand Down Expand Up @@ -181,11 +181,11 @@ This trick is possible thanks to DuckDuckGo’s awesome [bang feature](https://d

### 🟢 Online search field on the `njt`’s mini-website

Open [njt.now.sh](https://njt.now.sh), type your query, press Enter.
Open [njt.vercel.app](https://njt.vercel.app), type your query, press Enter.
This method is a bit slower than the other ones because it involves opening a web page with an input form.
On the plus side, it works everywhere and does not require setup.

Thanks to [now.sh](https://now.sh) for hosting [njt.now.sh](https://njt.now.sh) 💚
Thanks to [Vercel](https://vercel.com) for hosting [njt.vercel.app](https://njt.vercel.app) 💚

### ❓More ways

Expand All @@ -199,7 +199,7 @@ For requests like `njt <package>` or `njt <package> y`, all the tool does is nav
Most other cases involve a look into `package.json` for the latest published version.
This file contains the location of the repository, the homepage and some other fields, which `njt` uses to construct the destination URL.

The command line version of the tool takes you to `https://njt.now.sh/jump?from=cli@VERSION&to=YOUR_QUERY`, from which you are redirected to the destination.
The command line version of the tool takes you to `https://njt.vercel.app/jump?from=cli@VERSION&to=YOUR_QUERY`, from which you are redirected to the destination.

## Prior art

Expand Down
6 changes: 3 additions & 3 deletions cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ program
`🐸 ✨ 🐸 ✨ 🐸
npm jump to: a quick navigation tool for npm packages
https://njt.now.sh
https://njt.vercel.app
${ /* When updating, remember to reflect changes in README.md and src/ui/PageContentsForIndex/AvailableDestinations.tsx */''}
Available destinations
Expand Down Expand Up @@ -82,7 +82,7 @@ ${chalk.red(
)}
Change directly or replace . with a package name.
🐸 https://njt.now.sh
🐸 https://njt.vercel.app
`);
process.exit(1);
}
Expand All @@ -96,7 +96,7 @@ ${chalk.red(
)}
Change directly or replace . with a package name.
🐸 https://njt.now.sh
🐸 https://njt.vercel.app
`);
process.exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion cli/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const getPackageVersion = () =>
require(path.resolve(__dirname, "./package.json")).version;

const generateUrl = (query) => {
return `https://njt.now.sh/jump?from=cli%40${getPackageVersion()}&to=${encodeURIComponent(
return `https://njt.vercel.app/jump?from=cli%40${getPackageVersion()}&to=${encodeURIComponent(
query,
)}`;
};
Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"productivity",
"shortcut"
],
"homepage": "https://njt.now.sh",
"homepage": "https://njt.vercel.app",
"bugs": "https://github.com/kachkaev/njt/issues",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions public/opensearch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>njt</ShortName>
<Description>npm jump to</Description>
<Image width="32" height="32" type="image/png">https://njt.now.sh/favicon-32x32.png</Image>
<Image width="32" height="32" type="image/png">https://njt.vercel.app/favicon-32x32.png</Image>
<Tags>njt</Tags>
<Url type="text/html" template="https://njt.now.sh/jump?to={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="https://njt.now.sh/opensearch.xml" />
<moz:SearchForm>https://njt.now.sh</moz:SearchForm>
<Url type="text/html" template="https://njt.vercel.app/jump?to={searchTerms}"/>
<Url type="application/opensearchdescription+xml" rel="self" template="https://njt.vercel.app/opensearch.xml" />
<moz:SearchForm>https://njt.vercel.app</moz:SearchForm>
</OpenSearchDescription>
2 changes: 1 addition & 1 deletion src/ui/PageContentsForIndex/PageContentsForIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const PageContentsForIndex: React.FunctionComponent = () => {
</ExternalLink>{" "}
using <ExternalLink href="https://nextjs.org">Next.js</ExternalLink>,
hosted&nbsp;by&nbsp;
<ExternalLink href="https://now.sh" />
<ExternalLink href="https://vercel.com">Vercel</ExternalLink>
&nbsp;💚
</p>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/PageMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from "react";

const getBaseUrl = () => {
const hostname =
process.env.VERCEL_URL ?? process.env.HOSTNAME ?? "njt.now.sh";
process.env.VERCEL_URL ?? process.env.HOSTNAME ?? "njt.vercel.app";
const protocol = hostname.split(":")[0] === "localhost" ? "http" : "https";

return `${protocol}://${hostname}`;
Expand Down

1 comment on commit 7905405

@vercel
Copy link

@vercel vercel bot commented on 7905405 Apr 12, 2021

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

Please sign in to comment.