當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript update-notifier類代碼示例

本文整理匯總了TypeScript中update-notifier的典型用法代碼示例。如果您正苦於以下問題:TypeScript update-notifier類的具體用法?TypeScript update-notifier怎麽用?TypeScript update-notifier使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了update-notifier類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: listPluggings

import {
  getGraphQLProjectConfig,
  GraphQLProjectConfig,
  GraphQLConfig,
  getGraphQLConfig,
  ConfigNotFoundError,
  resolveEnvsInValues,
} from 'graphql-config'
import * as updateNotifier from 'update-notifier'
const pkg = require('../package.json')
import 'source-map-support/register'

export * from './types'
export * from './utils'

updateNotifier({ pkg }).notify()

function listPluggings(dir: string): string[] {
  return readdirSync(dir)
    .filter(moduleName => moduleName.startsWith('graphql-cli-'))
    .map(moduleName => joinPaths(dir, moduleName))
}

export function installCommands() {
  const plugins = _(npmPaths())
    .filter(existsSync)
    .map(listPluggings)
    .flatten()
    .uniq()
    .value() as string[]
開發者ID:koddsson,項目名稱:graphql-cli,代碼行數:30,代碼來源:index.ts

示例2: require

import * as fs from "fs";
import * as path from "path";
import * as jsyaml from "js-yaml";
import * as updateNotifier from "update-notifier";

import { start } from "./index";
import { ConfigRaw } from "./controller/configRaw";
import { ReportLevel } from "./model/compilerModel";
import { Exec, target2builder } from "./utils/utils";

/* tslint:disable:no-require-imports */
let pkg = require("../package.json");
/* tslint:enable:no-require-imports */

let notifier = updateNotifier({
    packageName: pkg.name,
    packageVersion: pkg.version
});
if (notifier.update) {
    notifier.notify();
}

let packageJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, "../package.json"), "utf8"));

import * as commandpost from "commandpost";

interface RootOpts {
    reviewfile: string[];
    base: string[];
}

let root = commandpost
開發者ID:vvakame,項目名稱:review.js,代碼行數:32,代碼來源:cli.ts

示例3: require

 */

// Be mindful of adding imports here, as this is on the hot path of all
// commands.

import * as logging from 'plylog';
import * as updateNotifier from 'update-notifier';
import {PolymerCli} from './polymer-cli';

const packageJson = require('../package.json');
const logger = logging.getLogger('cli.main');

// Update Notifier: Asynchronously check for package updates and, if needed,
// notify on the next time the CLI is run.
// See https://github.com/yeoman/update-notifier#how for info on how this works.
updateNotifier({pkg: packageJson}).notify();

(async () => {
  const args = process.argv.slice(2);
  const cli = new PolymerCli(args);
  try {
    const result = await cli.run();
    if (result && result.constructor &&
        result.constructor.name === 'CommandResult') {
      process.exit(result.exitCode);
    }
  } catch (err) {
    logger.error('cli runtime exception: ' + err);
    if (err.stack) {
      logger.error(err.stack);
    }
開發者ID:MehdiRaash,項目名稱:tools,代碼行數:31,代碼來源:run.ts

示例4: notifyVersion

export function notifyVersion(pkg) {
    var notifier = updateNotifier({ pkg })

    if (notifier.update) {
        notifier.notify()
    }
}
開發者ID:gamerson,項目名稱:gh,代碼行數:7,代碼來源:base.ts

示例5: constructor

 constructor({ config }: { config?: RunOptions } = {}) {
   if (!config) {
     config = {
       mock: false,
     }
   }
   const parentFilename = module.parent!.parent!
     ? module.parent!.parent!.filename
     : module.parent!.filename
   if (!config.initPath) {
     config.initPath = parentFilename
   }
   if (!config.root) {
     const findUp = require('find-up')
     config.root = path.dirname(
       findUp.sync('package.json', {
         cwd: parentFilename,
       }),
     )
   }
   this.config = new Config(config)
   this.notifier = updateNotifier({
     pkg: this.config.pjson,
     updateCheckInterval: 1,
   })
   this.initRaven()
 }
開發者ID:dhruvcodeword,項目名稱:prisma,代碼行數:27,代碼來源:CLI.ts

示例6: setupUpdateNotifier

export default function setupUpdateNotifier(pkg: any, updateCheckInterval: number = 0) {
	const notifier = updateNotifier({ pkg, updateCheckInterval });
	notifier.notify();
}
開發者ID:dojo,項目名稱:cli,代碼行數:4,代碼來源:updateNotifier.ts

示例7: require

// Commands
import deployCommand from './commands/deploy';
import loginCommand from './commands/login';
import logoutCommand from './commands/logout';

import { extraHelp, logCodeSandbox } from './utils/log';

import packageInfo = require('../package.json');

console.log();
logCodeSandbox();
console.log();

program.version(packageInfo.version);

program.on('--help', extraHelp);

// Register commands
deployCommand(program);
loginCommand(program);
logoutCommand(program);

program.parse(process.argv);

if (!process.argv.slice(2).length) {
  program.outputHelp();
}

updateNotifier({ pkg: packageInfo }).notify();
開發者ID:ghoullier,項目名稱:codesandbox-cli,代碼行數:29,代碼來源:index.ts

示例8: parseInt

        }

        if (messages.tip && messages.tip.message) {
            console.log(chalk.green(messages.tip.message));
        }
        console.log("");
    }
};

console.log("");
console.log(chalk.green("BST: v" + Global.version() + "  Node: " + process.version));

updateNotifier({
    pkg: {
        name: "bespoken-tools",
        version: Global.version(),
    },
    updateCheckInterval: 0
}).notify({
    defer: false,
    isGlobal: true,
});

let Logger = "BST";

let nodeMajorVersion = parseInt(process.version.substr(1, 2));

if (nodeMajorVersion < 4) {
    LoggingHelper.error(Logger, "!!!!Node version must be >= 4!!!!");
    LoggingHelper.error(Logger, "Please install to use bst");
    LoggingHelper.prepareForFileLoggingAndDisableConsole("bst-debug.log");
開發者ID:bespoken,項目名稱:bst,代碼行數:31,代碼來源:bst.ts


注:本文中的update-notifier類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。