|
@ -1,5 +1,5 @@ |
|
|
// Packages
|
|
|
// Packages
|
|
|
import PublicSuffixList from 'publicsuffixlist' |
|
|
import publicSuffixList from 'psl' |
|
|
import chalk from 'chalk' |
|
|
import chalk from 'chalk' |
|
|
|
|
|
|
|
|
// Ours
|
|
|
// Ours
|
|
@ -10,9 +10,6 @@ import {DOMAIN_VERIFICATION_ERROR} from './errors' |
|
|
import Now from './' |
|
|
import Now from './' |
|
|
|
|
|
|
|
|
const domainRegex = /^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}$/ |
|
|
const domainRegex = /^((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}$/ |
|
|
const psl = new PublicSuffixList() |
|
|
|
|
|
|
|
|
|
|
|
psl.initializeSync() |
|
|
|
|
|
|
|
|
|
|
|
export default class Alias extends Now { |
|
|
export default class Alias extends Now { |
|
|
|
|
|
|
|
@ -125,7 +122,7 @@ export default class Alias extends Now { |
|
|
console.log(`> ${chalk.bold(chalk.underline(alias))} is a custom domain.`) |
|
|
console.log(`> ${chalk.bold(chalk.underline(alias))} is a custom domain.`) |
|
|
console.log(`> Verifying the DNS settings for ${chalk.bold(chalk.underline(alias))} (see ${chalk.underline('https://zeit.world')} for help)`) |
|
|
console.log(`> Verifying the DNS settings for ${chalk.bold(chalk.underline(alias))} (see ${chalk.underline('https://zeit.world')} for help)`) |
|
|
|
|
|
|
|
|
const _domain = psl.domain(alias) |
|
|
const _domain = publicSuffixList.parse(alias).domain |
|
|
const _domainInfo = await this.getDomain(_domain) |
|
|
const _domainInfo = await this.getDomain(_domain) |
|
|
const domainInfo = _domainInfo && !_domainInfo.error ? _domainInfo : undefined |
|
|
const domainInfo = _domainInfo && !_domainInfo.error ? _domainInfo : undefined |
|
|
const {domain, nameservers} = domainInfo ? {domain: _domain} : await this.getNameservers(alias) |
|
|
const {domain, nameservers} = domainInfo ? {domain: _domain} : await this.getNameservers(alias) |
|
|