Skip to content

Commit

Permalink
fix: use new @salesfore/bunyan library, run tests in node 10 & 12 (#211)
Browse files Browse the repository at this point in the history
@W-6980157@
  • Loading branch information
lcampos authored Apr 7, 2020
1 parent 44de6f0 commit 249850d
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 89 deletions.
14 changes: 10 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ jobs:
- run: *test
- run: *coverage
- save_cache: *save-cache
node-8:
node-10:
<<: *node-test
docker:
- image: node:8
- image: node:10
node-12:
<<: *node-test
docker:
- image: node:12
release:
<<: *defaults
steps:
Expand Down Expand Up @@ -106,13 +110,15 @@ workflows:
sfdx-core:
jobs:
- node-latest
- node-8
- node-12
- node-10
- release:
filters:
branches: { only: master }
requires:
- node-latest
- node-8
- node-12
- node-10
- merge:
filters:
branches: { only: master }
Expand Down
11 changes: 0 additions & 11 deletions examples/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@salesforce/ts-sinon" "^1.0.0"
"@salesforce/ts-types" "^1.0.0"
"@types/jsforce" "1.9.2"
bunyan-sfdx-no-dtrace "1.8.2"
debug "^3.1.0"
jsen "0.6.6"
jsforce "1.8.5"
Expand Down Expand Up @@ -252,16 +251,6 @@ builtin-modules@^1.1.1:
resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=

bunyan-sfdx-no-dtrace@1.8.2:
version "1.8.2"
resolved "https://registry.npmjs.org/bunyan-sfdx-no-dtrace/-/bunyan-sfdx-no-dtrace-1.8.2.tgz#10682de07fec17ed14528b166995b1f18bbd4f9a"
integrity sha1-EGgt4H/sF+0UUosWaZWx8Yu9T5o=
optionalDependencies:
dtrace-provider "~0.6"
moment "^2.10.6"
mv "~2"
safe-json-stringify "~1"

caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
}
},
"dependencies": {
"@salesforce/bunyan": "^2.0.0",
"@salesforce/kit": "^1.0.0",
"@salesforce/ts-sinon": "^1.0.0",
"@salesforce/ts-types": "^1.0.0",
"@types/jsforce": "1.9.2",
"bunyan-sfdx-no-dtrace": "1.8.2",
"debug": "^3.1.0",
"jsen": "0.6.6",
"jsforce": "1.9.3",
Expand Down
18 changes: 9 additions & 9 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/

// tslint:disable-next-line:ordered-imports
// @ts-ignore No typings available for our copy of bunyan
import * as Bunyan from '@salesforce/bunyan';
import { parseJson, parseJsonMap } from '@salesforce/kit';
import {
Dictionary,
Expand All @@ -20,8 +22,6 @@ import {
Many,
Optional
} from '@salesforce/ts-types';
// @ts-ignore No typings available for our copy of bunyan
import * as Bunyan from 'bunyan-sfdx-no-dtrace';
import * as Debug from 'debug';
import * as EventEmitter from 'events';
import * as os from 'os';
Expand All @@ -34,14 +34,14 @@ import { fs } from './util/fs';
/**
* A Bunyan `Serializer` function.
* @param input The input to be serialized.
* **See** {@link https://github.com/cwallsfdc/node-bunyan#serializers|Bunyan Serializers API}
* **See** {@link https://github.com/forcedotcom/node-bunyan#serializers|Bunyan Serializers API}
*/
export type Serializer = (input: any) => any; // tslint:disable-line:no-any

/**
* A collection of named `Serializer`s.
*
* **See** {@link https://github.com/cwallsfdc/node-bunyan#serializers|Bunyan Serializers API}
* **See** {@link https://github.com/forcedotcom/node-bunyan#serializers|Bunyan Serializers API}
*/
export interface Serializers {
[key: string]: Serializer;
Expand Down Expand Up @@ -80,7 +80,7 @@ export interface LoggerOptions {
/**
* Standard `Logger` levels.
*
* **See** {@link https://github.com/cwallsfdc/node-bunyan#levels|Bunyan Levels}
* **See** {@link https://github.com/forcedotcom/node-bunyan#levels|Bunyan Levels}
*/
export enum LoggerLevel {
TRACE = 10,
Expand All @@ -94,7 +94,7 @@ export enum LoggerLevel {
/**
* A Bunyan stream configuration.
*
* @see {@link https://github.com/cwallsfdc/node-bunyan#streams|Bunyan Streams}
* @see {@link https://github.com/forcedotcom/node-bunyan#streams|Bunyan Streams}
*/
export interface LoggerStream {
/**
Expand Down Expand Up @@ -128,7 +128,7 @@ export type LoggerLevelValue = LoggerLevel | number;
/**
* A collection of named `FieldValue`s.
*
* **See** {@link https://github.com/cwallsfdc/node-bunyan#log-record-fields|Bunyan Log Record Fields}
* **See** {@link https://github.com/forcedotcom/node-bunyan#log-record-fields|Bunyan Log Record Fields}
*/
export interface Fields {
[key: string]: FieldValue;
Expand All @@ -154,7 +154,7 @@ export interface LogLine {
}

/**
* A logging abstraction powered by {@link https://github.com/cwallsfdc/node-bunyan|Bunyan} that provides both a default
* A logging abstraction powered by {@link https://github.com/forcedotcom/node-bunyan|Bunyan} that provides both a default
* logger configuration that will log to `sfdx.log`, and a way to create custom loggers based on the same foundation.
*
* ```
Expand All @@ -170,7 +170,7 @@ export interface LogLine {
* // Creates a child of a custom logger unaffiliated with the root logger with custom fields applied
* const myCustomChildLogger = myCustomLogger.child('myCustomChild', {tag: 'value'});
* ```
* **See** https://github.com/cwallsfdc/node-bunyan
* **See** https://github.com/forcedotcom/node-bunyan
*
* **See** https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_log_messages.htm
*/
Expand Down
95 changes: 31 additions & 64 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,18 @@
dependencies:
"@types/node" "^12.11.1"

"@salesforce/bunyan@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@salesforce/bunyan/-/bunyan-2.0.0.tgz#8dbe377f2cf7d35348a23260416fee15adba5f97"
integrity sha512-5hq+HWQSeymuygl3i9ehlQo3XWrlBE+A+QzmpDaoK37op4u9M+SBUbXfOW0IABOQCg+JmfQPocSMV74hRoqU9w==
dependencies:
dayjs "^1.8.16"
dayjs-plugin-utc "^0.1.2"
optionalDependencies:
dtrace-provider "~0.6"
mv "~2"
safe-json-stringify "~1"

"@salesforce/dev-config@^1.4.4":
version "1.5.0"
resolved "https://registry.npmjs.org/@salesforce/dev-config/-/dev-config-1.5.0.tgz#6a7a63a4b2a9fb27811c456d3a3387d961f8b637"
Expand Down Expand Up @@ -1021,16 +1033,6 @@ builtins@^1.0.3:
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og=

bunyan-sfdx-no-dtrace@1.8.2:
version "1.8.2"
resolved "https://registry.npmjs.org/bunyan-sfdx-no-dtrace/-/bunyan-sfdx-no-dtrace-1.8.2.tgz#10682de07fec17ed14528b166995b1f18bbd4f9a"
integrity sha1-EGgt4H/sF+0UUosWaZWx8Yu9T5o=
optionalDependencies:
dtrace-provider "~0.6"
moment "^2.10.6"
mv "~2"
safe-json-stringify "~1"

byline@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1"
Expand Down Expand Up @@ -1727,6 +1729,16 @@ dateformat@^3.0.0:
resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==

dayjs-plugin-utc@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/dayjs-plugin-utc/-/dayjs-plugin-utc-0.1.2.tgz#48e552407024143922d6499a40f6c765f8c93d03"
integrity sha512-ExERH5o3oo6jFOdkvMP3gytTCQ9Ksi5PtylclJWghr7k7m3o2U5QrwtdiJkOxLOH4ghr0EKhpqGefzGz1VvVJg==

dayjs@^1.8.16:
version "1.8.23"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.8.23.tgz#07b5a8e759c4d75ae07bdd0ad6977f851c01e510"
integrity sha512-NmYHMFONftoZbeOhVz6jfiXI4zSiPN6NoVWJgC0aZQfYVwzy/ZpESPHuCcI0B8BUMpSJQ08zenHDbofOLKq8hQ==

debug@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
Expand Down Expand Up @@ -1755,7 +1767,7 @@ debug@^4.0.0, debug@^4.1.0, debug@^4.1.1:
dependencies:
ms "^2.1.1"

debuglog@*, debuglog@^1.0.1:
debuglog@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
Expand Down Expand Up @@ -1914,7 +1926,7 @@ dotenv@^5.0.1:

dtrace-provider@~0.6:
version "0.6.0"
resolved "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.6.0.tgz#0b078d5517937d873101452d9146737557b75e51"
resolved "https://registry.yarnpkg.com/dtrace-provider/-/dtrace-provider-0.6.0.tgz#0b078d5517937d873101452d9146737557b75e51"
integrity sha1-CweNVReTfYcxAUUtkUZzdVe3XlE=
dependencies:
nan "^2.0.8"
Expand Down Expand Up @@ -2627,7 +2639,7 @@ glob@7.1.3:

glob@^6.0.1:
version "6.0.4"
resolved "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=
dependencies:
inflight "^1.0.4"
Expand Down Expand Up @@ -2977,7 +2989,7 @@ import-lazy@^2.1.0:
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=

imurmurhash@*, imurmurhash@^0.1.4:
imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
Expand Down Expand Up @@ -3827,11 +3839,6 @@ lockfile@^1.0.4:
dependencies:
signal-exit "^3.0.2"

lodash._baseindexof@*:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=

lodash._baseuniq@~4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
Expand All @@ -3840,33 +3847,11 @@ lodash._baseuniq@~4.6.0:
lodash._createset "~4.0.0"
lodash._root "~3.0.0"

lodash._bindcallback@*:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=

lodash._cacheindexof@*:
version "3.0.2"
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=

lodash._createcache@*:
version "3.1.2"
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
dependencies:
lodash._getnative "^3.0.0"

lodash._createset@~4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=

lodash._getnative@*, lodash._getnative@^3.0.0:
version "3.9.1"
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=

lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
Expand Down Expand Up @@ -3947,11 +3932,6 @@ lodash.once@^4.0.0:
resolved "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac"
integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=

lodash.restparam@*:
version "3.6.1"
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=

lodash.set@^4.3.2:
version "4.3.2"
resolved "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23"
Expand Down Expand Up @@ -4382,11 +4362,6 @@ modify-values@^1.0.0:
resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==

moment@^2.10.6:
version "2.24.0"
resolved "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==

move-concurrently@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
Expand Down Expand Up @@ -4444,7 +4419,7 @@ mute-stream@~0.0.4:

mv@~2:
version "2.1.1"
resolved "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2"
resolved "https://registry.yarnpkg.com/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2"
integrity sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=
dependencies:
mkdirp "~0.5.1"
Expand All @@ -4453,7 +4428,7 @@ mv@~2:

nan@^2.0.8:
version "2.14.0"
resolved "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==

nanomatch@^1.2.9:
Expand All @@ -4475,7 +4450,7 @@ nanomatch@^1.2.9:

ncp@~2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=

neo-async@^2.6.0:
Expand Down Expand Up @@ -4714,7 +4689,6 @@ npm@^6.10.3:
cmd-shim "^3.0.3"
columnify "~1.5.4"
config-chain "^1.1.12"
debuglog "*"
detect-indent "~5.0.0"
detect-newline "^2.1.0"
dezalgo "~1.0.3"
Expand All @@ -4729,7 +4703,6 @@ npm@^6.10.3:
has-unicode "~2.0.1"
hosted-git-info "^2.8.5"
iferr "^1.0.2"
imurmurhash "*"
infer-owner "^1.0.4"
inflight "~1.0.6"
inherits "^2.0.4"
Expand All @@ -4748,14 +4721,8 @@ npm@^6.10.3:
libnpx "^10.2.0"
lock-verify "^2.1.0"
lockfile "^1.0.4"
lodash._baseindexof "*"
lodash._baseuniq "~4.6.0"
lodash._bindcallback "*"
lodash._cacheindexof "*"
lodash._createcache "*"
lodash._getnative "*"
lodash.clonedeep "~4.5.0"
lodash.restparam "*"
lodash.union "~4.6.0"
lodash.uniq "~4.5.0"
lodash.without "~4.4.0"
Expand Down Expand Up @@ -5918,7 +5885,7 @@ rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.2, rimraf@^2.6.3:

rimraf@~2.4.0:
version "2.4.5"
resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da"
integrity sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=
dependencies:
glob "^6.0.1"
Expand Down Expand Up @@ -5966,7 +5933,7 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1:

safe-json-stringify@~1:
version "1.2.0"
resolved "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd"
resolved "https://registry.yarnpkg.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd"
integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==

safe-regex@^1.1.0:
Expand Down

0 comments on commit 249850d

Please sign in to comment.