Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes pjson and directly requires package.json #504

Merged
merged 1 commit into from Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -64,7 +64,6 @@
"p-cancelable": "^0.3.0",
"p-queue": "^2.3.0",
"p-retry": "^1.0.0",
"pjson": "^1.0.9",
"retry": "^0.10.1",
"url-join": "^4.0.0",
"ws": "^4.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/KeepAlive.ts
@@ -1,8 +1,8 @@
import { RTMClient, ErrorCode } from './';
import EventEmitter = require('eventemitter3'); // tslint:disable-line:import-name no-require-imports
import * as pjson from 'pjson';
import { LogLevel, Logger, LoggingFunc, getLogger, loggerFromLoggingFunc } from './logger';
import { errorWithCode } from './errors';
const pkg = require('../package.json'); // tslint:disable-line:no-require-imports no-var-requires

export interface KeepAliveOptions {
logger?: LoggingFunc;
Expand Down Expand Up @@ -50,7 +50,7 @@ export class KeepAlive extends EventEmitter {
/**
* The name used to prefix all logging generated from this object
*/
private static loggerName = `${pjson.name}:KeepAlive`;
private static loggerName = `${pkg.name}:KeepAlive`;

/**
* This object's logger instance
Expand Down
4 changes: 2 additions & 2 deletions src/RTMClient.ts
@@ -1,5 +1,4 @@
import { Agent } from 'http';
import * as pjson from 'pjson';
import objectValues = require('object.values'); // tslint:disable-line:import-name no-require-imports
import EventEmitter = require('eventemitter3'); // tslint:disable-line:import-name no-require-imports
import WebSocket = require('ws'); // tslint:disable-line:import-name no-require-imports
Expand All @@ -13,6 +12,7 @@ import { WebClient, WebAPICallResult, WebAPICallError, ErrorCode, CodedError } f
import * as methods from './methods'; // tslint:disable-line:import-name
import { errorWithCode } from './errors';
import { callbackify, TLSOptions } from './util';
const pkg = require('../package.json'); // tslint:disable-line:no-require-imports no-var-requires

/**
* An RTMClient allows programs to communicate with the {@link https://api.slack.com/rtm|Slack Platform's RTM API}.
Expand Down Expand Up @@ -272,7 +272,7 @@ export class RTMClient extends EventEmitter {
/**
* The name used to prefix all logging generated from this object
*/
private static loggerName = `${pjson.name}:RTMClient`;
private static loggerName = `${pkg.name}:RTMClient`;


/**
Expand Down
4 changes: 2 additions & 2 deletions src/WebClient.ts
@@ -1,6 +1,5 @@
import { Readable } from 'stream';
import objectEntries = require('object.entries'); // tslint:disable-line:no-require-imports
import * as pjson from 'pjson';
import urlJoin = require('url-join'); // tslint:disable-line:no-require-imports
import isStream = require('is-stream'); // tslint:disable-line:no-require-imports
import EventEmitter = require('eventemitter3'); // tslint:disable-line:import-name no-require-imports
Expand All @@ -15,6 +14,7 @@ import { CodedError, errorWithCode, ErrorCode } from './errors';
import { LogLevel, Logger, LoggingFunc, getLogger, loggerFromLoggingFunc } from './logger';
import retryPolicies, { RetryOptions } from './retry-policies';
import Method, * as methods from './methods'; // tslint:disable-line:import-name
const pkg = require('../package.json'); // tslint:disable-line:no-require-imports no-var-requires

/**
* A client for Slack's Web API
Expand Down Expand Up @@ -58,7 +58,7 @@ export class WebClient extends EventEmitter {
/**
* The name used to prefix all logging generated from this object
*/
private static loggerName = `${pjson.name}:WebClient`;
private static loggerName = `${pkg.name}:WebClient`;

/**
* This object's logger instance
Expand Down
4 changes: 2 additions & 2 deletions src/util.ts
@@ -1,8 +1,8 @@
import * as util from 'util';
import * as os from 'os';
import * as pjson from 'pjson';
import { Agent } from 'http';
import objectEntries = require('object.entries'); // tslint:disable-line:no-require-imports
const pkg = require('../package.json'); // tslint:disable-line:no-require-imports no-var-requires

/**
* For when you need a function that does nothing
Expand All @@ -17,7 +17,7 @@ function replaceSlashes(s: string): string {
return s.replace('/', ':');
}

const baseUserAgent = `${replaceSlashes(pjson.name)}/${pjson.version} ` +
const baseUserAgent = `${replaceSlashes(pkg.name)}/${pkg.version} ` +
`node/${process.version.replace('v', '')} ` +
`${os.platform()}/${os.release()}`;

Expand Down