Domain ⮂ Bundle ID
Generate a macOS bundle identifier from a URL/domain.
import {genBundleId, getDomain} from '@danielbayley/domain-bundle-id'
const domain = 'https://domain.com/App?q=uery#anchor'
genBundleId(domain) // com.domain.App
genBundleId(domain, true) // com.domain.app
genBundleId('www.someapp.com') // com.someapp.Some
getDomain('com.domain.App') // domain.com/App
Assuming you already configured npm
to work with GitHub Packages:
npm config set @danielbayley:registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com:_authToken ${GITHUB_TOKEN}
npm install @danielbayley/domain-bundle-id #--save-dev
git config core.hooksPath .github/hooks