fix: support new vercel style
17
.eslintrc.js
@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint'],
|
||||
env: {
|
||||
es6: true,
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
||||
'plugin:react/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
],
|
||||
};
|
3
.github/workflows/workflow.yml
vendored
@ -13,7 +13,6 @@ jobs:
|
||||
run: yarn test
|
||||
- name: Upload coverage
|
||||
run: |
|
||||
cat ./api/coverage/lcov.info | yarn codacy-coverage
|
||||
cat ./web/coverage/lcov.info | yarn codacy-coverage
|
||||
cat ./coverage/lcov.info | yarn codacy-coverage
|
||||
env:
|
||||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
|
||||
|
4
.gitignore
vendored
@ -1,6 +1,5 @@
|
||||
.vscode
|
||||
/api/dist
|
||||
/web/build
|
||||
/build
|
||||
|
||||
# Created by https://www.gitignore.io/api/node
|
||||
# Edit at https://www.gitignore.io/?templates=node
|
||||
@ -98,3 +97,4 @@ typings/
|
||||
# End of https://www.gitignore.io/api/node
|
||||
|
||||
.now
|
||||
.vercel
|
||||
|
@ -1,7 +0,0 @@
|
||||
/web/build
|
||||
/web/coverage
|
||||
/api/coverage
|
||||
/.envrc
|
||||
/.env
|
||||
/.github
|
||||
/.vscode
|
10
.vercelignore
Normal file
@ -0,0 +1,10 @@
|
||||
/build
|
||||
/tests
|
||||
/.dependabot
|
||||
/.envrc
|
||||
/.env
|
||||
/.github
|
||||
/.vscode
|
||||
coverage
|
||||
*.md
|
||||
*.log
|
@ -2,22 +2,22 @@
|
||||
|
||||
## Setup environment
|
||||
|
||||
Install `now` for development server:
|
||||
Install `vercel` for development server:
|
||||
|
||||
```
|
||||
yarn global add now
|
||||
npm i -g vercel
|
||||
```
|
||||
|
||||
then install deps and fire up dev server.
|
||||
|
||||
```
|
||||
yarn install
|
||||
yarn start
|
||||
vc dev
|
||||
```
|
||||
|
||||
## Add new provider
|
||||
|
||||
Create `web/src/components/cards/<NewCard>.js`. Here is the example card that checks if spcified repository on GitHub is available.
|
||||
Create `src/components/cards/<NewCard>.js`. Here is the example card that checks if spcified repository on GitHub is available.
|
||||
|
||||
```jsx
|
||||
import React from 'react';
|
||||
@ -56,7 +56,7 @@ export default function GithubCard({name}) {
|
||||
}
|
||||
```
|
||||
|
||||
and add the card to `/web/src/App.js`:
|
||||
and add the card to `src/App.js`:
|
||||
|
||||
```jsx
|
||||
import NewCard from './components/cards/NewCard';
|
||||
|
2
LICENSE
@ -1,4 +1,4 @@
|
||||
Copyright 2019 Yasuaki Uechi <y@uechi.io>
|
||||
Copyright 2020 Yasuaki Uechi <y@uechi.io>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
},
|
||||
};
|
@ -1,29 +0,0 @@
|
||||
{
|
||||
"name": "@namae/api",
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"lint": "eslint . --ext .ts,.tsx --format visualstudio --fix",
|
||||
"start": "tsc -w",
|
||||
"test": "jest --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-fetch": "^2.6.0",
|
||||
"npm-name": "^6.0.0",
|
||||
"validator": "^13.1.0",
|
||||
"whois-json": "^2.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"@types/node-fetch": "^2.5.5",
|
||||
"@types/validator": "^13.0.0",
|
||||
"jest": "25.5.4",
|
||||
"nock": "^12.0.3",
|
||||
"ts-jest": "^25.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
interface App {
|
||||
trackId: string;
|
||||
@ -14,12 +15,12 @@ interface AppStoreResponse {
|
||||
}
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest<{query: string; country: string}>,
|
||||
req: NowRequest,
|
||||
res: NowResponse,
|
||||
): Promise<void> {
|
||||
const {query, country} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -6,7 +7,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import dns from 'dns';
|
||||
import {send, sendError, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
function resolvePromise(hostname: string): Promise<string[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
@ -16,7 +17,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import whois from 'whois-json';
|
||||
import {send, sendError, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -7,7 +8,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import isURL from 'validator/lib/isURL';
|
||||
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -7,7 +8,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('no query given'));
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
import nodeFetch from 'node-fetch';
|
||||
|
||||
export default async function handler(
|
||||
@ -7,7 +8,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -6,7 +7,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import npmName from 'npm-name';
|
||||
import {send, sendError, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -7,7 +8,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
import npmName from 'npm-name';
|
||||
import {send, sendError, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -7,7 +8,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,14 +1,15 @@
|
||||
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
const APPLICATION_ID = process.env.NTA_APPLICATION_ID;
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest<{query: string; country: string}>,
|
||||
req: NowRequest,
|
||||
res: NowResponse,
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -6,7 +7,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, fetch, NowResponse, NowRequest} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -6,7 +7,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {send, sendError, fetch, NowResponse, NowRequest} from '../util/http';
|
||||
import {send, sendError, fetch} from '../../../util/http';
|
||||
import {NowRequest, NowResponse} from '@vercel/node';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@ -6,7 +7,7 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const {query} = req.query;
|
||||
|
||||
if (!query) {
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@ -1,63 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||
// "lib": [], /* Specify library files to be included in the compilation. */
|
||||
"allowJs": true /* Allow javascript files to be compiled. */,
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./dist" /* Redirect output structure to the directory. */,
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
||||
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
}
|
||||
}
|
4223
api/yarn.lock
Normal file
@ -3,5 +3,5 @@ module.exports = {
|
||||
setupFiles: ['./setupJest.ts'],
|
||||
testEnvironment: 'node',
|
||||
preset: 'ts-jest',
|
||||
testPathIgnorePatterns: ['/dist/'],
|
||||
testPathIgnorePatterns: ['<rootDir>/dist/', '<rootDir>/src/'],
|
||||
};
|
37
now.json
@ -1,37 +0,0 @@
|
||||
{
|
||||
"version": 2,
|
||||
"alias": "namae.dev",
|
||||
"builds": [
|
||||
{
|
||||
"src": "/web/package.json",
|
||||
"use": "@now/static-build",
|
||||
"config": {"distDir": "build"}
|
||||
},
|
||||
{
|
||||
"src": "/api/services/*.ts",
|
||||
"use": "@now/node"
|
||||
}
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
"src": "/availability/(?<provider>[^/]+)/(?<query>[^/]+)",
|
||||
"dest": "/api/services/$provider.ts?query=$query"
|
||||
},
|
||||
{
|
||||
"src": "/s/(.*)",
|
||||
"dest": "/web/index.html",
|
||||
"headers": {"cache-control": "s-maxage=86400"}
|
||||
},
|
||||
{
|
||||
"src": "/(.*)",
|
||||
"dest": "/web/$1",
|
||||
"headers": {"cache-control": "s-maxage=86400"}
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"NTA_APPLICATION_ID": "@namae-nta-application-id"
|
||||
},
|
||||
"github": {
|
||||
"silent": true
|
||||
}
|
||||
}
|
91
package.json
@ -3,25 +3,64 @@
|
||||
"description": "namae saves your time searching around registries and checking if the desired name is ready for use.",
|
||||
"author": "Yasuaki Uechi <y@uechi.io> (https://uechi.io/)",
|
||||
"scripts": {
|
||||
"dev": "yarn start",
|
||||
"lint": "yarn workspaces run lint",
|
||||
"start": "now dev",
|
||||
"test": "CI=true yarn workspaces run test"
|
||||
"build": "NODE_ENV=production react-scripts build",
|
||||
"dev": "BROWSER=none react-scripts start",
|
||||
"eject": "react-scripts eject",
|
||||
"test": "jest --coverage && CI=true react-scripts test --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"typescript": "^3.8.3"
|
||||
"@sentry/browser": "^5.15.5",
|
||||
"easy-peasy": "^3.3.0",
|
||||
"fetch-suspense": "^1.2.2",
|
||||
"framer-motion": "^1.10.3",
|
||||
"i18next": ">=19.4.4",
|
||||
"i18next-browser-languagedetector": "^4.1.1",
|
||||
"i18next-chained-backend": "^2.0.1",
|
||||
"i18next-localstorage-backend": "^3.1.1",
|
||||
"i18next-xhr-backend": "^3.2.2",
|
||||
"isomorphic-unfetch": "^3.0.0",
|
||||
"node-fetch": "^2.6.0",
|
||||
"npm-name": "^6.0.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"rc-tooltip": "^4.0.3",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-ga": "^3.0.0",
|
||||
"react-helmet": "^6.0.0",
|
||||
"react-i18next": "11.5.1",
|
||||
"react-icons": "^3.10.0",
|
||||
"react-router": "^5.1.2",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"react-scripts": "3.4.1",
|
||||
"react-spinners": "^0.8.1",
|
||||
"styled-components": "^5.1.0",
|
||||
"validator": "^13.1.0",
|
||||
"whois-json": "^2.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@now/build-utils": "^2.4.0",
|
||||
"@sentry/cli": "^1.52.3",
|
||||
"@typescript-eslint/eslint-plugin": "^2.30.0",
|
||||
"@typescript-eslint/parser": "^2.30.0",
|
||||
"@testing-library/jest-dom": "^5.3.0",
|
||||
"@testing-library/react": "^10.0.2",
|
||||
"@types/i18next-node-fs-backend": "^2.1.0",
|
||||
"@types/jest": "24.9.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"@types/node-fetch": "^2.5.5",
|
||||
"@types/react-helmet": "^6.0.0",
|
||||
"@types/react-router-dom": "^5.1.3",
|
||||
"@types/styled-components": "^5.0.1",
|
||||
"@types/validator": "^13.0.0",
|
||||
"@vercel/node": "^1.7.1",
|
||||
"codacy-coverage": "^3.4.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-react": "^7.19.0",
|
||||
"husky": "^4.2.5",
|
||||
"husky": "^4.2.3",
|
||||
"i18next-node-fs-backend": "^2.1.3",
|
||||
"jest": "24.9.0",
|
||||
"mutationobserver-shim": "^0.3.5",
|
||||
"nock": "^12.0.3",
|
||||
"prettier": "^2.0.5",
|
||||
"pretty-quick": "^2.0.1"
|
||||
"pretty-quick": "^2.0.1",
|
||||
"ts-jest": "26.1.0",
|
||||
"typescript": "^3.9.5"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
@ -29,19 +68,23 @@
|
||||
}
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"workspaces": {
|
||||
"packages": [
|
||||
"web",
|
||||
"api"
|
||||
],
|
||||
"nohoist": [
|
||||
"**/babel**",
|
||||
"**/eslint**",
|
||||
"**/jest"
|
||||
]
|
||||
}
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 936 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
19
public/site.webmanifest
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "namae",
|
||||
"short_name": "namae",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png"
|
||||
},
|
||||
{
|
||||
"src": "/android-chrome-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#6f3dff",
|
||||
"background_color": "#6f3dff",
|
||||
"display": "standalone"
|
||||
}
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 169 KiB |
@ -33,7 +33,8 @@ const Footer: React.FC = () => {
|
||||
to="https://twitter.com/uetschy"
|
||||
eventLabel="Author Page"
|
||||
aria-label="Author page"
|
||||
target="_blank">
|
||||
target="_blank"
|
||||
>
|
||||
<Bold>Yasuaki Uechi</Bold>
|
||||
</OutboundLink>
|
||||
</p>
|
||||
@ -47,21 +48,24 @@ const Footer: React.FC = () => {
|
||||
)}&url=${encodeURIComponent('https://namae.dev')}`}
|
||||
eventLabel="Tweet"
|
||||
aria-label="Tweet this page"
|
||||
target="_blank">
|
||||
target="_blank"
|
||||
>
|
||||
<FaTwitter />
|
||||
</OutboundLink>
|
||||
<OutboundLink
|
||||
to="https://www.producthunt.com/posts/namae"
|
||||
eventLabel="ProductHunt"
|
||||
aria-label="Go to ProductHunt page"
|
||||
target="_blank">
|
||||
target="_blank"
|
||||
>
|
||||
<FaProductHunt />
|
||||
</OutboundLink>
|
||||
<OutboundLink
|
||||
to="https://github.com/uetchy/namae"
|
||||
eventLabel="GitHub Repo"
|
||||
aria-label="Go to GitHub repository"
|
||||
target="_blank">
|
||||
target="_blank"
|
||||
>
|
||||
<FaGithub />
|
||||
</OutboundLink>
|
||||
</Links>
|
@ -8,7 +8,8 @@ export const SpectrumIcon: React.FC = () => (
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path d="M6 14.5C6 15.3284 6.67157 16 7.5 16H9C12.866 16 16 19.134 16 23V24.5C16 25.3284 16.6716 26 17.5 26H24.5C25.3284 26 26 25.3284 26 24.5V23C26 13.6111 18.3889 6 9 6H7.5C6.67157 6 6 6.67157 6 7.5V14.5Z" />
|
||||
</svg>
|
||||
);
|
||||
@ -21,7 +22,8 @@ export const NowIcon: React.FC = () => (
|
||||
stroke="currentColor"
|
||||
strokeWidth="0"
|
||||
viewBox="0 0 114 100"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<g id="Black-Triangle" transform="translate(-293.000000, -150.000000)">
|
||||
<polygon id="Logotype---Black" points="350 150 407 250 293 250"></polygon>
|
||||
</g>
|
||||
@ -39,7 +41,8 @@ export const NetlifyIcon: React.FC = () => (
|
||||
focusable="false"
|
||||
// style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
viewBox="0 0 256 256">
|
||||
viewBox="0 0 256 256"
|
||||
>
|
||||
<path d="M185.532 88.839l-.094-.04a.396.396 0 0 1-.154-.087a.734.734 0 0 1-.187-.621l5.167-31.553l24.229 24.209l-25.198 10.709a.555.555 0 0 1-.22.04h-.101a.694.694 0 0 1-.134-.114a11.468 11.468 0 0 0-3.308-2.543zm35.144-1.923l25.906 25.878c5.38 5.381 8.075 8.065 9.057 11.177c.147.46.267.921.361 1.395l-61.913-26.192a4.868 4.868 0 0 0-.1-.04c-.248-.1-.535-.214-.535-.467c0-.254.294-.374.541-.474l.08-.034l26.603-11.243zm34.268 46.756c-1.337 2.51-3.944 5.114-8.355 9.527l-29.209 29.17l-37.777-7.858l-.2-.04c-.335-.054-.689-.114-.689-.414a11.387 11.387 0 0 0-4.378-7.965c-.154-.154-.113-.394-.067-.615c0-.033 0-.066.014-.093l7.105-43.571l.026-.147c.04-.334.1-.721.401-.721a11.566 11.566 0 0 0 7.754-4.44c.06-.067.1-.14.18-.18c.214-.1.468 0 .689.093l64.5 27.254h.006zm-44.28 45.407l-48.031 47.978l8.22-50.475l.014-.067a.905.905 0 0 1 .04-.193c.067-.16.24-.227.408-.294l.08-.034c1.8-.767 3.392-1.95 4.646-3.451c.16-.187.354-.368.601-.401c.064-.01.13-.01.194 0l33.82 6.944l.007-.007zm-58.198 58.133l-5.414 5.408l-59.854-86.408a2.831 2.831 0 0 0-.067-.094c-.093-.127-.194-.253-.173-.4c.006-.107.073-.2.147-.28l.066-.087c.18-.268.335-.535.502-.822l.133-.233l.02-.02c.094-.16.18-.314.341-.401c.14-.067.335-.04.488-.007l66.311 13.66c.186.03.36.105.508.22c.087.088.107.181.127.288a11.735 11.735 0 0 0 6.871 7.845c.187.093.107.3.02.52a1.588 1.588 0 0 0-.1.301c-.835 5.074-8 48.726-9.926 60.51zm-11.309 11.29c-3.99 3.946-6.343 6.035-9.003 6.877a13.382 13.382 0 0 1-8.06 0c-3.115-.989-5.809-3.672-11.19-9.054l-60.108-60.042l15.7-24.323a1 1 0 0 1 .268-.314c.167-.12.408-.066.608 0a16.285 16.285 0 0 0 10.948-.554c.18-.066.361-.113.502.014c.07.064.133.135.187.213l60.148 87.19v-.007zm-94.156-68.008l-13.789-13.773l27.23-11.604a.562.562 0 0 1 .221-.047c.227 0 .361.227.481.434c.274.42.564.83.87 1.229l.086.106c.08.114.027.227-.053.334l-15.04 23.321h-.006zM27.11 160.625L9.665 143.199c-2.968-2.964-5.12-5.114-6.617-6.963l53.043 10.99l.2.033c.328.053.69.113.69.42c0 .334-.395.488-.73.614l-.153.067l-28.988 12.265zM0 127.275a13.34 13.34 0 0 1 .602-3.304c.989-3.112 3.676-5.796 9.063-11.177l22.324-22.3a14524.43 14524.43 0 0 0 30.92 44.647c.18.24.38.507.174.707c-.976 1.075-1.952 2.25-2.64 3.526c-.075.163-.19.306-.335.413c-.087.054-.18.034-.28.014h-.014L0 127.269v.007zm37.965-42.75l30.017-29.984c2.82 1.235 13.087 5.568 22.27 9.44c6.952 2.939 13.288 5.61 15.28 6.477c.2.08.381.16.468.36c.053.12.027.274 0 .401a13.363 13.363 0 0 0 3.496 12.205c.2.2 0 .487-.174.734l-.094.14l-30.478 47.157c-.08.134-.154.247-.288.334c-.16.1-.387.053-.575.007a15.215 15.215 0 0 0-3.629-.494c-1.096 0-2.286.2-3.489.42h-.007c-.133.02-.254.047-.36-.033a1.403 1.403 0 0 1-.301-.34L37.965 84.525zm36.08-36.04l38.86-38.817c5.38-5.375 8.074-8.065 11.188-9.047a13.382 13.382 0 0 1 8.061 0c3.115.982 5.808 3.672 11.189 9.047l8.422 8.413l-27.638 42.756a1.035 1.035 0 0 1-.274.32c-.167.114-.401.067-.602 0a14.028 14.028 0 0 0-12.833 2.471c-.18.187-.448.08-.675-.02c-3.61-1.569-31.682-13.42-35.699-15.122zm83.588-24.542l25.52 25.49l-6.15 38.044v.1a.9.9 0 0 1-.053.254c-.067.133-.201.16-.335.2a12.237 12.237 0 0 0-3.662 1.823a1.029 1.029 0 0 0-.134.113c-.074.08-.147.154-.267.167a.763.763 0 0 1-.288-.047l-38.887-16.504l-.073-.034c-.248-.1-.542-.22-.542-.474a14.664 14.664 0 0 0-2.072-6.109c-.187-.307-.394-.627-.234-.941l27.177-42.082zM131.352 81.4l36.454 15.423c.2.093.421.18.508.387a.707.707 0 0 1 0 .38c-.107.535-.2 1.142-.2 1.757v1.021c0 .254-.261.36-.502.46l-.073.027c-5.775 2.464-81.076 34.538-81.19 34.538c-.113 0-.234 0-.347-.113c-.2-.2 0-.48.18-.735l.094-.133l29.957-46.335l.053-.08c.174-.281.375-.595.696-.595l.3.047c.682.093 1.284.18 1.892.18c4.545 0 8.756-2.21 11.296-5.989c.06-.1.137-.19.227-.267c.18-.133.448-.066.655.027zm-41.748 61.324l82.079-34.965s.12 0 .234.114c.447.447.828.747 1.196 1.028l.18.113c.168.094.335.2.348.374c0 .067 0 .107-.013.167l-7.032 43.144l-.027.174c-.046.333-.093.714-.407.714a11.558 11.558 0 0 0-9.177 5.655l-.034.053c-.093.154-.18.3-.334.38c-.14.068-.32.041-.468.008l-65.455-13.487c-.067-.013-1.016-3.465-1.09-3.472z" />
|
||||
</svg>
|
||||
);
|
||||
@ -52,7 +55,8 @@ export const OcamlIcon: React.FC = () => (
|
||||
height="1em"
|
||||
fill="currentColor"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 165.543 144.277">
|
||||
viewBox="0 0 165.543 144.277"
|
||||
>
|
||||
<g>
|
||||
<path
|
||||
d="M82.223,134.04c-0.459-0.978-1.853-3.524-2.553-4.34c-1.52-1.779-1.875-1.913-2.322-4.159
|
@ -108,7 +108,7 @@ export const DedicatedAvailability: React.FC<{
|
||||
}) => {
|
||||
const increaseCounter = useStoreActions((actions) => actions.stats.add);
|
||||
const response = useFetch(
|
||||
`/availability/${service}/${encodeURIComponent(query || name)}`,
|
||||
`/api/services/${service}/${encodeURIComponent(query || name)}`,
|
||||
) as Response;
|
||||
|
||||
if (response.error) {
|
@ -17,7 +17,7 @@ const Search: React.FC<{query: string}> = ({query}) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{apps.length > 0 ? (
|
||||
{apps && apps.length > 0 ? (
|
||||
apps.map((app) => (
|
||||
<Result
|
||||
title={app.name.split(/[-–—\-:]/)[0]}
|
@ -8,9 +8,10 @@ import {Card, Result} from '../core';
|
||||
const Search: React.FC<{query: string}> = ({query}) => {
|
||||
const {t} = useTranslation();
|
||||
const term = encodeURIComponent(query);
|
||||
const response = useFetch(`/availability/nta/${term}`) as {
|
||||
const response = useFetch(`/api/services/nta/${term}`) as {
|
||||
result: Array<{name: string; phoneticName: string}>;
|
||||
};
|
||||
|
||||
const apps = response.result;
|
||||
|
||||
return (
|
@ -1,7 +1,7 @@
|
||||
import nock from 'nock';
|
||||
import {mockProvider} from '../util/testHelpers';
|
||||
|
||||
import provider from '../services/existence';
|
||||
import provider from '../api/services/existence/[query]';
|
||||
|
||||
test('return false if name is taken', async () => {
|
||||
const result = await mockProvider(provider, {query: 'github.com/uetchy'});
|