How to use the devcert/dist/platforms/darwin.default function in devcert

To help you get started, weā€™ve selected a few devcert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jordaneisenburger / fallback-studio / src / pwa-studio / packages / pwa-buildpack / lib / Utilities / configureHost.js View on Github external
const os = require('os');
const chalk = require('chalk');
const execa = require('execa');
const pkgDir = require('pkg-dir');
const { username } = os.userInfo();

/**
 * Monkeypatch devcert to fix
 * https://github.com/magento/pwa-studio/issues/679 which is blocked by
 * https://github.com/davewasmer/devcert/pull/30.
 * TODO: Remove this when a release of devcert without this bug is available
 */
const devCertUtils = require('devcert/dist/utils');
const MacOSPlatform = require('devcert/dist/platforms/darwin');
/* istanbul ignore next: temporary until we switch to devcert fork */
const proto = (MacOSPlatform.default || MacOSPlatform).prototype;
/* istanbul ignore next: temporary until we switch to devcert fork */
proto.isNSSInstalled = function() {
    try {
        return devCertUtils
            .run('brew list -1')
            .toString()
            .includes('\nnss\n');
    } catch (e) {
        return false;
    }
};

const DEFAULT_NAME = 'my-pwa';
const DEV_DOMAIN = 'local.pwadev';

const isSudoSession = () =>

devcert

Generate trusted local SSL/TLS certificates for local SSL development

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis