diff --git a/.circleci/config.yml b/.circleci/config.yml index 5fcbb359d7..d3a6c758b9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,131 +1,28 @@ version: 2.1 - -_refs: - cwd: &cwd ~/jobs - ssh-config: &ssh-config - fingerprints: - - '0d:94:44:8a:82:3d:01:b0:58:fb:97:3a:a4:cd:f4:b2' - cache-config: &cache-config - key: dependency-cache-{{ checksum "package.json" }} - restore-cache: &restore-cache - <<: *cache-config - save-cache: &save-cache - <<: *cache-config - paths: - - ~/jobs/node_modules - - /usr/local/share/.cache/yarn - - /usr/local/share/.config/yarn - install: &install - name: Install dependencies - command: yarn - build: &build - name: Building - command: yarn build - test: &test - name: Testing - command: yarn test - coverage: &coverage - name: Submitting code coverage to codecov - command: | - ./node_modules/.bin/nyc report --reporter text-lcov > coverage.lcov - curl -s https://codecov.io/bash | bash - gh-config: &gh-config - name: Configuring GitHub - command: | - git config credential.helper 'cache --timeout=120' - git config user.email "$GH_EMAIL" - git config user.name "Deployment Bot" - -_defaults: &defaults - docker: - - image: node:latest - working_directory: *cwd - -jobs: - node-latest: &node-test - <<: *defaults - steps: - - add_ssh_keys: *ssh-config - - checkout - - restore_cache: *restore-cache - - run: *install - - run: *build - - run: *test - - run: *coverage - - save_cache: *save-cache - node-10: - <<: *node-test - docker: - - image: node:10 - node-12: - <<: *node-test - docker: - - image: node:12 - release: - <<: *defaults - steps: - - add_ssh_keys: *ssh-config - - checkout - - restore_cache: *restore-cache - - run: *gh-config - - run: *install - - run: yarn global add semantic-release@16 - - run: yarn global add @oclif/semantic-release@3 - - run: *build - - run: semantic-release -e @oclif/semantic-release - - run: git status - - save_cache: *save-cache - merge: - <<: *defaults - steps: - - add_ssh_keys: *ssh-config - - checkout - - restore_cache: *restore-cache - - run: *install - - run: *build - - run: *gh-config - - run: - name: Merging - command: | - git fetch - git checkout develop - git pull origin develop - git merge origin/master - git push origin develop - - save_cache: *save-cache - ci-docs: - <<: *defaults - steps: - - add_ssh_keys: *ssh-config - - checkout - - restore_cache: *restore-cache - - run: *install - - run: *build - - run: *gh-config - - run: yarn ci-docs - - save_cache: *save-cache +orbs: + release-management: salesforce/npm-release-management@3 workflows: version: 2 - sfdx-core: + test-and-release: jobs: - - node-latest - - node-12 - - node-10 - - release: - filters: - branches: { only: master } + - release-management/test-package: + name: node-latest + node_version: latest + upload-coverage: true + - release-management/test-package: + name: node-12 + - release-management/test-package: + node_version: '10' + name: node-10 + - release-management/release-package: + post-job-steps: + - release-management/merge + - run: yarn ci-docs requires: - node-latest - node-12 - node-10 - - merge: filters: - branches: { only: master } - requires: - - release - - ci-docs: - filters: - branches: { only: master } - requires: - - release + branches: + only: master diff --git a/CHANGELOG.md b/CHANGELOG.md index 121eab4be6..a56958b30a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,337 +1,292 @@ # [2.10.0](https://github.com/forcedotcom/sfdx-core/compare/v2.9.4...v2.10.0) (2020-08-10) - ### Features -* support logfmt style formatting ([#273](https://github.com/forcedotcom/sfdx-core/issues/273)) ([#274](https://github.com/forcedotcom/sfdx-core/issues/274)) ([93b156c](https://github.com/forcedotcom/sfdx-core/commit/93b156c6e82ee8029bd4c8ec714b75c89e0f531f)) +- support logfmt style formatting ([#273](https://github.com/forcedotcom/sfdx-core/issues/273)) ([#274](https://github.com/forcedotcom/sfdx-core/issues/274)) ([93b156c](https://github.com/forcedotcom/sfdx-core/commit/93b156c6e82ee8029bd4c8ec714b75c89e0f531f)) ## [2.9.4](https://github.com/forcedotcom/sfdx-core/compare/v2.9.3...v2.9.4) (2020-08-07) - ### Bug Fixes -* updated messaging ([7f9ab06](https://github.com/forcedotcom/sfdx-core/commit/7f9ab06ecbde1ac082f027f35f07002efb8dc7cf)) -* fix edge case, updated messaging ([a8f9a54](https://github.com/forcedotcom/sfdx-core/commit/a8f9a547893918b2a3f6a23e9bcfa99e13b28974)) +- updated messaging ([7f9ab06](https://github.com/forcedotcom/sfdx-core/commit/7f9ab06ecbde1ac082f027f35f07002efb8dc7cf)) +- fix edge case, updated messaging ([a8f9a54](https://github.com/forcedotcom/sfdx-core/commit/a8f9a547893918b2a3f6a23e9bcfa99e13b28974)) ## [2.9.3](https://github.com/forcedotcom/sfdx-core/compare/v2.9.2...v2.9.3) (2020-08-06) - ### Bug Fixes -* changed to be greater than, not greater than or equal to ([7f1a12d](https://github.com/forcedotcom/sfdx-core/commit/7f1a12d7a7d7aa460de5bb32a368f52c11219a4e)) +- changed to be greater than, not greater than or equal to ([7f1a12d](https://github.com/forcedotcom/sfdx-core/commit/7f1a12d7a7d7aa460de5bb32a368f52c11219a4e)) ## [2.9.2](https://github.com/forcedotcom/sfdx-core/compare/v2.9.1...v2.9.2) (2020-08-06) - ### Bug Fixes -* maxQueryLimit config, return full jsforce result, fix build issue ([6c11196](https://github.com/forcedotcom/sfdx-core/commit/6c11196a48e19bca8d43fd994fa864bf3cb72cfa)) -* removed promise.reject ([d28d649](https://github.com/forcedotcom/sfdx-core/commit/d28d649f60ca1362380b4e5e408376561d6a64ed)) -* updated autoFetchQuery method ([4d018f6](https://github.com/forcedotcom/sfdx-core/commit/4d018f6d2c8e4d6b19179563f11db2ff1f9b5f3d)) +- maxQueryLimit config, return full jsforce result, fix build issue ([6c11196](https://github.com/forcedotcom/sfdx-core/commit/6c11196a48e19bca8d43fd994fa864bf3cb72cfa)) +- removed promise.reject ([d28d649](https://github.com/forcedotcom/sfdx-core/commit/d28d649f60ca1362380b4e5e408376561d6a64ed)) +- updated autoFetchQuery method ([4d018f6](https://github.com/forcedotcom/sfdx-core/commit/4d018f6d2c8e4d6b19179563f11db2ff1f9b5f3d)) ## [2.9.1](https://github.com/forcedotcom/sfdx-core/compare/v2.9.0...v2.9.1) (2020-08-04) - ### Bug Fixes -* remove encrypted from ISV_URL ([d2c89fe](https://github.com/forcedotcom/sfdx-core/commit/d2c89fed3602f0f9e06a3cefa605268914d69d6e)), closes [#262](https://github.com/forcedotcom/sfdx-core/issues/262) +- remove encrypted from ISV_URL ([d2c89fe](https://github.com/forcedotcom/sfdx-core/commit/d2c89fed3602f0f9e06a3cefa605268914d69d6e)), closes [#262](https://github.com/forcedotcom/sfdx-core/issues/262) # [2.9.0](https://github.com/forcedotcom/sfdx-core/compare/v2.8.0...v2.9.0) (2020-07-29) - ### Features -* overwriting configStore unset ([6095dd6](https://github.com/forcedotcom/sfdx-core/commit/6095dd69ab4ed5e4324e5a46d8ec5bed74bb538a)) +- overwriting configStore unset ([6095dd6](https://github.com/forcedotcom/sfdx-core/commit/6095dd69ab4ed5e4324e5a46d8ec5bed74bb538a)) # [2.8.0](https://github.com/forcedotcom/sfdx-core/compare/v2.7.0...v2.8.0) (2020-07-27) - ### Features -* changed data to be more flexible type ([50414f9](https://github.com/forcedotcom/sfdx-core/commit/50414f936569993b5bdf96c90bf251bbd6083b10)) +- changed data to be more flexible type ([50414f9](https://github.com/forcedotcom/sfdx-core/commit/50414f936569993b5bdf96c90bf251bbd6083b10)) # [2.7.0](https://github.com/forcedotcom/sfdx-core/compare/v2.6.0...v2.7.0) (2020-07-01) - ### Features -* adds areFilesEqual / actOn / getContentHash from toolbelt to core ([807dc72](https://github.com/forcedotcom/sfdx-core/commit/807dc729f414cda335fcba737580b53fc6ceddc1)) +- adds areFilesEqual / actOn / getContentHash from toolbelt to core ([807dc72](https://github.com/forcedotcom/sfdx-core/commit/807dc729f414cda335fcba737580b53fc6ceddc1)) # [2.6.0](https://github.com/forcedotcom/sfdx-core/compare/v2.5.1...v2.6.0) (2020-06-23) - ### Bug Fixes -* added line breaks for readability ([0f8b857](https://github.com/forcedotcom/sfdx-core/commit/0f8b8576d6401ed88b424e60e2f9302003d9ea90)) -* fixed a capitalization that caused CircleCI to fail ([db803a7](https://github.com/forcedotcom/sfdx-core/commit/db803a7fc83ead6fccf84e1791ba668cd25d013e)) -* updated comments and async for loop ([fa3b580](https://github.com/forcedotcom/sfdx-core/commit/fa3b580d82b3bb389a4d1b7edf9340080d392f50)) - +- added line breaks for readability ([0f8b857](https://github.com/forcedotcom/sfdx-core/commit/0f8b8576d6401ed88b424e60e2f9302003d9ea90)) +- fixed a capitalization that caused CircleCI to fail ([db803a7](https://github.com/forcedotcom/sfdx-core/commit/db803a7fc83ead6fccf84e1791ba668cd25d013e)) +- updated comments and async for loop ([fa3b580](https://github.com/forcedotcom/sfdx-core/commit/fa3b580d82b3bb389a4d1b7edf9340080d392f50)) ### Features -* added lifecycleEvents.ts from toolbelt: an event listener/emitter ([099478c](https://github.com/forcedotcom/sfdx-core/commit/099478cf087c024d965bba16bb6341df64ce7edb)) +- added lifecycleEvents.ts from toolbelt: an event listener/emitter ([099478c](https://github.com/forcedotcom/sfdx-core/commit/099478cf087c024d965bba16bb6341df64ce7edb)) ## [2.5.1](https://github.com/forcedotcom/sfdx-core/compare/v2.5.0...v2.5.1) (2020-06-11) - ### Bug Fixes -* fix child logger unit test ([93da343](https://github.com/forcedotcom/sfdx-core/commit/93da3432e83e4db0f2642b54f618521ea53bc414)) -* log uncaught exception in root logger only ([7a80662](https://github.com/forcedotcom/sfdx-core/commit/7a806622e1007d363f317f90a392328f6b6d40e7)) -* mock audience url for unit test ([963b696](https://github.com/forcedotcom/sfdx-core/commit/963b6960e971adaafd43c31581ffc07686fc8378)) +- fix child logger unit test ([93da343](https://github.com/forcedotcom/sfdx-core/commit/93da3432e83e4db0f2642b54f618521ea53bc414)) +- log uncaught exception in root logger only ([7a80662](https://github.com/forcedotcom/sfdx-core/commit/7a806622e1007d363f317f90a392328f6b6d40e7)) +- mock audience url for unit test ([963b696](https://github.com/forcedotcom/sfdx-core/commit/963b6960e971adaafd43c31581ffc07686fc8378)) # [2.5.0](https://github.com/forcedotcom/sfdx-core/compare/v2.4.1...v2.5.0) (2020-06-08) - ### Bug Fixes -* update mkdirp for updated dep ([e2b471b](https://github.com/forcedotcom/sfdx-core/commit/e2b471b120edd1b55bca50d71a2fe8d995ef8bbd)) - +- update mkdirp for updated dep ([e2b471b](https://github.com/forcedotcom/sfdx-core/commit/e2b471b120edd1b55bca50d71a2fe8d995ef8bbd)) ### Features -* add fs.fileExists ([0c5d0a7](https://github.com/forcedotcom/sfdx-core/commit/0c5d0a75867094f5b05d9d356f23c94c38d6213e)) +- add fs.fileExists ([0c5d0a7](https://github.com/forcedotcom/sfdx-core/commit/0c5d0a75867094f5b05d9d356f23c94c38d6213e)) ## [2.4.1](https://github.com/forcedotcom/sfdx-core/compare/v2.4.0...v2.4.1) (2020-05-05) - ### Bug Fixes -* don't ship with ts-sinon ([b4005fb](https://github.com/forcedotcom/sfdx-core/commit/b4005fb27b3f85be1297b9cfec0bc7e0de91979d)) -* fixed test spy ([c1f4ba4](https://github.com/forcedotcom/sfdx-core/commit/c1f4ba42ba94a03c5e3e77e793558cfea947f78e)) -* path.resolve jwt key file path ([86e6957](https://github.com/forcedotcom/sfdx-core/commit/86e695757a68dca1ea659e801ead59e57e6632b9)) +- don't ship with ts-sinon ([b4005fb](https://github.com/forcedotcom/sfdx-core/commit/b4005fb27b3f85be1297b9cfec0bc7e0de91979d)) +- fixed test spy ([c1f4ba4](https://github.com/forcedotcom/sfdx-core/commit/c1f4ba42ba94a03c5e3e77e793558cfea947f78e)) +- path.resolve jwt key file path ([86e6957](https://github.com/forcedotcom/sfdx-core/commit/86e695757a68dca1ea659e801ead59e57e6632b9)) # [2.4.0](https://github.com/forcedotcom/sfdx-core/compare/v2.3.1...v2.4.0) (2020-04-23) - ### Features -* create auth info with sfdx auth url ([68dbfad](https://github.com/forcedotcom/sfdx-core/commit/68dbfad817202813555b5438c498b24bfdb5aa0f)) +- create auth info with sfdx auth url ([68dbfad](https://github.com/forcedotcom/sfdx-core/commit/68dbfad817202813555b5438c498b24bfdb5aa0f)) ## [2.3.1](https://github.com/forcedotcom/sfdx-core/compare/v2.3.0...v2.3.1) (2020-04-13) - ### Bug Fixes -* use new @salesfore/bunyan library, run tests in node 10 & 12 ([#211](https://github.com/forcedotcom/sfdx-core/issues/211)) ([249850d](https://github.com/forcedotcom/sfdx-core/commit/249850dfbf5da4199709e9573944a4da72d0581d)) +- use new @salesfore/bunyan library, run tests in node 10 & 12 ([#211](https://github.com/forcedotcom/sfdx-core/issues/211)) ([249850d](https://github.com/forcedotcom/sfdx-core/commit/249850dfbf5da4199709e9573944a4da72d0581d)) # [2.3.0](https://github.com/forcedotcom/sfdx-core/compare/v2.2.0...v2.3.0) (2020-03-20) - ### Features -* allow stubbing on single tests ([37cef1b](https://github.com/forcedotcom/sfdx-core/commit/37cef1bbf8f4d1c4909f13c1fac7757f1430e40b)) +- allow stubbing on single tests ([37cef1b](https://github.com/forcedotcom/sfdx-core/commit/37cef1bbf8f4d1c4909f13c1fac7757f1430e40b)) # [2.2.0](https://github.com/forcedotcom/sfdx-core/compare/v2.1.6...v2.2.0) (2020-02-11) - ### Features -* create authinfo with a parent authinfo ([9b21226](https://github.com/forcedotcom/sfdx-core/commit/9b212264bafe458c95ae22fce11298c706d23393)), closes [#202](https://github.com/forcedotcom/sfdx-core/issues/202) +- create authinfo with a parent authinfo ([9b21226](https://github.com/forcedotcom/sfdx-core/commit/9b212264bafe458c95ae22fce11298c706d23393)), closes [#202](https://github.com/forcedotcom/sfdx-core/issues/202) ## [2.1.6](https://github.com/forcedotcom/sfdx-core/compare/v2.1.5...v2.1.6) (2020-01-13) - ### Bug Fixes -* add config var for telemetry opt out ([f79ace3](https://github.com/forcedotcom/sfdx-core/commit/f79ace34462f586feb296b94ee369e1f7922341d)) +- add config var for telemetry opt out ([f79ace3](https://github.com/forcedotcom/sfdx-core/commit/f79ace34462f586feb296b94ee369e1f7922341d)) ## [2.1.5](https://github.com/forcedotcom/sfdx-core/compare/v2.1.4...v2.1.5) (2019-11-15) - ### Bug Fixes -* rogue import causing compile issue ([d0b5e5c](https://github.com/forcedotcom/sfdx-core/commit/d0b5e5c13dc497ef0ba98d460e91514ea0400d7a)) +- rogue import causing compile issue ([d0b5e5c](https://github.com/forcedotcom/sfdx-core/commit/d0b5e5c13dc497ef0ba98d460e91514ea0400d7a)) ## [2.1.4](https://github.com/forcedotcom/sfdx-core/compare/v2.1.3...v2.1.4) (2019-11-04) - ### Bug Fixes -* contrib ([7e91751](https://github.com/forcedotcom/sfdx-core/commit/7e91751e1dcb1d3ca18d083262ae675503a7614b)) +- contrib ([7e91751](https://github.com/forcedotcom/sfdx-core/commit/7e91751e1dcb1d3ca18d083262ae675503a7614b)) ## [2.1.3](https://github.com/forcedotcom/sfdx-core/compare/v2.1.2...v2.1.3) (2019-10-09) - ### Bug Fixes -* make sure when stream processor throws an error we disconnect the streaming client ([6dc8de9](https://github.com/forcedotcom/sfdx-core/commit/6dc8de9cfbf7aebfadf50233d914c05cba6eda9a)) +- make sure when stream processor throws an error we disconnect the streaming client ([6dc8de9](https://github.com/forcedotcom/sfdx-core/commit/6dc8de9cfbf7aebfadf50233d914c05cba6eda9a)) ## [2.1.2](https://github.com/forcedotcom/sfdx-core/compare/v2.1.1...v2.1.2) (2019-08-29) - ### Bug Fixes -* add debug logger that accepts a function ([117dee4](https://github.com/forcedotcom/sfdx-core/commit/117dee4)) -* deleting and org auth file never worked ([a6a77c6](https://github.com/forcedotcom/sfdx-core/commit/a6a77c6)) -* review feedback ([7c1f630](https://github.com/forcedotcom/sfdx-core/commit/7c1f630)) +- add debug logger that accepts a function ([117dee4](https://github.com/forcedotcom/sfdx-core/commit/117dee4)) +- deleting and org auth file never worked ([a6a77c6](https://github.com/forcedotcom/sfdx-core/commit/a6a77c6)) +- review feedback ([7c1f630](https://github.com/forcedotcom/sfdx-core/commit/7c1f630)) ## [2.1.1](https://github.com/forcedotcom/sfdx-core/compare/v2.1.0...v2.1.1) (2019-07-17) - ### Bug Fixes -* yarn.lock ([70e75a2](https://github.com/forcedotcom/sfdx-core/commit/70e75a2)) +- yarn.lock ([70e75a2](https://github.com/forcedotcom/sfdx-core/commit/70e75a2)) # [2.1.0](https://github.com/forcedotcom/sfdx-core/compare/v2.0.1...v2.1.0) (2019-07-16) - ### Bug Fixes -* update secureBuffer cipherName ([b55fcde](https://github.com/forcedotcom/sfdx-core/commit/b55fcde)) -* update secureBuffer cipherName ([8e66a0c](https://github.com/forcedotcom/sfdx-core/commit/8e66a0c)) -* use empty string for client secret when client secret is undefined ([9513551](https://github.com/forcedotcom/sfdx-core/commit/9513551)) - +- update secureBuffer cipherName ([b55fcde](https://github.com/forcedotcom/sfdx-core/commit/b55fcde)) +- update secureBuffer cipherName ([8e66a0c](https://github.com/forcedotcom/sfdx-core/commit/8e66a0c)) +- use empty string for client secret when client secret is undefined ([9513551](https://github.com/forcedotcom/sfdx-core/commit/9513551)) ### Features -* add config file for sandbox ([db2026e](https://github.com/forcedotcom/sfdx-core/commit/db2026e)) -* do not throw error on org.remove if sandbox config doesn't exist ([3912993](https://github.com/forcedotcom/sfdx-core/commit/3912993)) +- add config file for sandbox ([db2026e](https://github.com/forcedotcom/sfdx-core/commit/db2026e)) +- do not throw error on org.remove if sandbox config doesn't exist ([3912993](https://github.com/forcedotcom/sfdx-core/commit/3912993)) ## [2.0.1](https://github.com/forcedotcom/sfdx-core/compare/v2.0.0...v2.0.1) (2019-07-02) - ### Bug Fixes -* update secureBuffer cipherName ([1e8037b](https://github.com/forcedotcom/sfdx-core/commit/1e8037b)) -* update secureBuffer cipherName ([874d5b6](https://github.com/forcedotcom/sfdx-core/commit/874d5b6)) -* use empty string for client secret when client secret is undefined ([0d22a56](https://github.com/forcedotcom/sfdx-core/commit/0d22a56)) +- update secureBuffer cipherName ([1e8037b](https://github.com/forcedotcom/sfdx-core/commit/1e8037b)) +- update secureBuffer cipherName ([874d5b6](https://github.com/forcedotcom/sfdx-core/commit/874d5b6)) +- use empty string for client secret when client secret is undefined ([0d22a56](https://github.com/forcedotcom/sfdx-core/commit/0d22a56)) # [2.0.0](https://github.com/forcedotcom/sfdx-core/compare/v1.3.3...v2.0.0) (2019-06-17) - ### Bug Fixes -* ๐Ÿ› prevent auth files from being accidentally overwritten ([06d96fc](https://github.com/forcedotcom/sfdx-core/commit/06d96fc)), closes [PR#114](https://github.com/PR/issues/114) -* add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) -* force version bump to test ci-docs on release ([ecb6a66](https://github.com/forcedotcom/sfdx-core/commit/ecb6a66)) - +- ๐Ÿ› prevent auth files from being accidentally overwritten ([06d96fc](https://github.com/forcedotcom/sfdx-core/commit/06d96fc)), closes [PR#114](https://github.com/PR/issues/114) +- add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) +- force version bump to test ci-docs on release ([ecb6a66](https://github.com/forcedotcom/sfdx-core/commit/ecb6a66)) ### BREAKING CHANGES -* ๐Ÿงจ some commands that call getCoreConnection with auth options and a -username will now throw an error. +- ๐Ÿงจ some commands that call getCoreConnection with auth options and a + username will now throw an error. ## [1.3.4](https://github.com/forcedotcom/sfdx-core/compare/v1.3.3...v1.3.4) (2019-05-02) - ### Bug Fixes -* add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) -* force version bump to test ci-docs on release ([ecb6a66](https://github.com/forcedotcom/sfdx-core/commit/ecb6a66)) +- add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) +- force version bump to test ci-docs on release ([ecb6a66](https://github.com/forcedotcom/sfdx-core/commit/ecb6a66)) ## [1.3.4](https://github.com/forcedotcom/sfdx-core/compare/v1.3.3...v1.3.4) (2019-05-01) - ### Bug Fixes -* add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) +- add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) ## [1.3.4](https://github.com/forcedotcom/sfdx-core/compare/v1.3.3...v1.3.4) (2019-04-11) - ### Bug Fixes -* add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) +- add clientId to jwt fields ([8a7c040](https://github.com/forcedotcom/sfdx-core/commit/8a7c040)) ## [1.3.3](https://github.com/forcedotcom/sfdx-core/compare/v1.3.2...v1.3.3) (2019-04-04) - ### Bug Fixes -* allow aliases with dots ([e8b17af](https://github.com/forcedotcom/sfdx-core/commit/e8b17af)) -* allow packageAliases in sfdx-project.json ([8d7b1fe](https://github.com/forcedotcom/sfdx-core/commit/8d7b1fe)) -* hide sensitive values from being logged ([8505f04](https://github.com/forcedotcom/sfdx-core/commit/8505f04)) -* move generating the secretfile path to the catch block ([2b9e57d](https://github.com/forcedotcom/sfdx-core/commit/2b9e57d)) -* potential missing key.json file on windows ([f94f127](https://github.com/forcedotcom/sfdx-core/commit/f94f127)) -* properly invoke callbacks ([f03838c](https://github.com/forcedotcom/sfdx-core/commit/f03838c)) +- allow aliases with dots ([e8b17af](https://github.com/forcedotcom/sfdx-core/commit/e8b17af)) +- allow packageAliases in sfdx-project.json ([8d7b1fe](https://github.com/forcedotcom/sfdx-core/commit/8d7b1fe)) +- hide sensitive values from being logged ([8505f04](https://github.com/forcedotcom/sfdx-core/commit/8505f04)) +- move generating the secretfile path to the catch block ([2b9e57d](https://github.com/forcedotcom/sfdx-core/commit/2b9e57d)) +- potential missing key.json file on windows ([f94f127](https://github.com/forcedotcom/sfdx-core/commit/f94f127)) +- properly invoke callbacks ([f03838c](https://github.com/forcedotcom/sfdx-core/commit/f03838c)) ## [1.3.2](https://github.com/forcedotcom/sfdx-core/compare/v1.3.1...v1.3.2) (2019-03-25) - ### Bug Fixes -* revert of throwing auth error ([f6ebe12](https://github.com/forcedotcom/sfdx-core/commit/f6ebe12)) +- revert of throwing auth error ([f6ebe12](https://github.com/forcedotcom/sfdx-core/commit/f6ebe12)) ## [1.3.1](https://github.com/forcedotcom/sfdx-core/compare/v1.3.0...v1.3.1) (2019-03-25) - ### Bug Fixes -* prevent auth files from being inadvertently overwritten ([45195c1](https://github.com/forcedotcom/sfdx-core/commit/45195c1)) -* update test and don't throw when auth file not found ([75af396](https://github.com/forcedotcom/sfdx-core/commit/75af396)) +- prevent auth files from being inadvertently overwritten ([45195c1](https://github.com/forcedotcom/sfdx-core/commit/45195c1)) +- update test and don't throw when auth file not found ([75af396](https://github.com/forcedotcom/sfdx-core/commit/75af396)) # [1.3.0](https://github.com/forcedotcom/sfdx-core/compare/v1.2.3...v1.3.0) (2019-03-19) - ### Features -* support wrapping a string ([2445003](https://github.com/forcedotcom/sfdx-core/commit/2445003)) +- support wrapping a string ([2445003](https://github.com/forcedotcom/sfdx-core/commit/2445003)) ## [1.2.3](https://github.com/forcedotcom/sfdx-core/compare/v1.2.2...v1.2.3) (2019-03-18) - ### Bug Fixes -* @W-5907580@ respect code if it exist ([5263fe2](https://github.com/forcedotcom/sfdx-core/commit/5263fe2)) -* do not let name and code get out-of-date is name is set ([3e5914e](https://github.com/forcedotcom/sfdx-core/commit/3e5914e)) -* security update and patch to allow colons in filepaths for windows ([a385b40](https://github.com/forcedotcom/sfdx-core/commit/a385b40)) -* use name by default for code ([c5283d3](https://github.com/forcedotcom/sfdx-core/commit/c5283d3)) +- @W-5907580@ respect code if it exist ([5263fe2](https://github.com/forcedotcom/sfdx-core/commit/5263fe2)) +- do not let name and code get out-of-date is name is set ([3e5914e](https://github.com/forcedotcom/sfdx-core/commit/3e5914e)) +- security update and patch to allow colons in filepaths for windows ([a385b40](https://github.com/forcedotcom/sfdx-core/commit/a385b40)) +- use name by default for code ([c5283d3](https://github.com/forcedotcom/sfdx-core/commit/c5283d3)) ## [1.2.2](https://github.com/forcedotcom/sfdx-core/compare/v1.2.1...v1.2.2) (2019-02-11) - ### Bug Fixes -* use default options off the constructor ([368a5f1](https://github.com/forcedotcom/sfdx-core/commit/368a5f1)) +- use default options off the constructor ([368a5f1](https://github.com/forcedotcom/sfdx-core/commit/368a5f1)) ## [1.2.1](https://github.com/forcedotcom/sfdx-core/compare/v1.2.0...v1.2.1) (2019-01-31) - ### Bug Fixes -* update docs ([789816e](https://github.com/forcedotcom/sfdx-core/commit/789816e)) +- update docs ([789816e](https://github.com/forcedotcom/sfdx-core/commit/789816e)) # [1.2.0](https://github.com/forcedotcom/sfdx-core/compare/v1.1.2...v1.2.0) (2019-01-30) - ### Bug Fixes -* do not query server if cached ([d7ccf99](https://github.com/forcedotcom/sfdx-core/commit/d7ccf99)) -* update to allow stored connected app info ([66ea057](https://github.com/forcedotcom/sfdx-core/commit/66ea057)) - +- do not query server if cached ([d7ccf99](https://github.com/forcedotcom/sfdx-core/commit/d7ccf99)) +- update to allow stored connected app info ([66ea057](https://github.com/forcedotcom/sfdx-core/commit/66ea057)) ### Features -* determine if a org is a dev hub ([586d7ba](https://github.com/forcedotcom/sfdx-core/commit/586d7ba)) +- determine if a org is a dev hub ([586d7ba](https://github.com/forcedotcom/sfdx-core/commit/586d7ba)) ## [1.1.2](https://github.com/forcedotcom/sfdx-core/compare/v1.1.1...v1.1.2) (2018-12-21) - ### Bug Fixes -* update contrib doc to trigger build ([28c6945](https://github.com/forcedotcom/sfdx-core/commit/28c6945)) +- update contrib doc to trigger build ([28c6945](https://github.com/forcedotcom/sfdx-core/commit/28c6945)) ## [1.1.1](https://github.com/forcedotcom/sfdx-core/compare/v1.1.0...v1.1.1) (2018-12-19) - ### Bug Fixes -* bump kit, ts-types, and ts-sinon versions ([1f088b4](https://github.com/forcedotcom/sfdx-core/commit/1f088b4)) -* downgrade jsforce to match sfdx toolbelt ([5fba254](https://github.com/forcedotcom/sfdx-core/commit/5fba254)) -* fix jsforce types reference ([407e3df](https://github.com/forcedotcom/sfdx-core/commit/407e3df)) -* migrate from /docs to gh-pages branch ([7d36139](https://github.com/forcedotcom/sfdx-core/commit/7d36139)) +- bump kit, ts-types, and ts-sinon versions ([1f088b4](https://github.com/forcedotcom/sfdx-core/commit/1f088b4)) +- downgrade jsforce to match sfdx toolbelt ([5fba254](https://github.com/forcedotcom/sfdx-core/commit/5fba254)) +- fix jsforce types reference ([407e3df](https://github.com/forcedotcom/sfdx-core/commit/407e3df)) +- migrate from /docs to gh-pages branch ([7d36139](https://github.com/forcedotcom/sfdx-core/commit/7d36139)) # [1.1.0](https://github.com/forcedotcom/sfdx-core/compare/v1.0.3...v1.1.0) (2018-12-14) - ### Bug Fixes -* doc update ([7ad690e](https://github.com/forcedotcom/sfdx-core/commit/7ad690e)) -* ensure AuthInfoConfig can throw when config file not found ([f11b84a](https://github.com/forcedotcom/sfdx-core/commit/f11b84a)) -* move throwOnNotFound option to ConfigFile ([924352a](https://github.com/forcedotcom/sfdx-core/commit/924352a)) - +- doc update ([7ad690e](https://github.com/forcedotcom/sfdx-core/commit/7ad690e)) +- ensure AuthInfoConfig can throw when config file not found ([f11b84a](https://github.com/forcedotcom/sfdx-core/commit/f11b84a)) +- move throwOnNotFound option to ConfigFile ([924352a](https://github.com/forcedotcom/sfdx-core/commit/924352a)) ### Features -* update jsforce typings ([374b8fc](https://github.com/forcedotcom/sfdx-core/commit/374b8fc)) +- update jsforce typings ([374b8fc](https://github.com/forcedotcom/sfdx-core/commit/374b8fc)) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..8249025739 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +## Security + +Please report any security issue to [security@salesforce.com](mailto:security@salesforce.com) +as soon as it is discovered. This library limits its runtime dependencies in +order to reduce the total cost of ownership as much as can be, but all consumers +should remain vigilant and have their security stakeholders review all third-party +products (3PP) like this one and their dependencies. diff --git a/examples/package.json b/examples/package.json index 70b06cb393..c4a5b1d6a3 100644 --- a/examples/package.json +++ b/examples/package.json @@ -17,7 +17,7 @@ "@salesforce/core": "^1", "chalk": "^2.4.1", "inquirer": "^6.0.0", - "lodash": "^4.17.19", + "lodash": "^4.17.20", "strip-ansi": "^4.0.0" }, "devDependencies": { diff --git a/examples/yarn.lock b/examples/yarn.lock index 468db63d99..bff34a0c71 100644 --- a/examples/yarn.lock +++ b/examples/yarn.lock @@ -11,6 +11,7 @@ "@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" @@ -827,11 +828,16 @@ lodash.get@^4.4.2, lodash.get@~4.4.2: resolved "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= -lodash@^4.11.1, lodash@^4.17.11, lodash@^4.17.19: +lodash@^4.11.1, lodash@^4.17.11: version "4.17.19" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== +lodash@^4.17.20: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + lolex@^2.2.0, lolex@^2.3.2, lolex@^2.7.5: version "2.7.5" resolved "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz#113001d56bfc7e02d56e36291cc5c413d1aa0733" diff --git a/src/logger.ts b/src/logger.ts index 1bf63799ad..53f4abce84 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -717,7 +717,11 @@ export class Logger { let logEntry = ''; keys.forEach(key => { - logEntry += `${key}=${parsedJSON[key]} `; + let logMsg = `${parsedJSON[key]}`; + if (logMsg.trim().includes(' ')) { + logMsg = `"${logMsg}"`; + } + logEntry += `${key}=${logMsg} `; }); if (loggerStream.stream) { loggerStream.stream.write(logEntry.trimRight() + '\n'); diff --git a/src/messages.ts b/src/messages.ts index c7a87f5001..0357a27178 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -11,8 +11,18 @@ */ import { NamedError } from '@salesforce/kit'; -import { AnyJson, asString, ensureJsonMap, ensureString, isAnyJson, isObject, Optional } from '@salesforce/ts-types'; +import { + AnyJson, + asString, + ensureJsonMap, + ensureString, + isAnyJson, + isArray, + isObject, + Optional +} from '@salesforce/ts-types'; import * as fs from 'fs'; +import * as os from 'os'; import * as path from 'path'; import * as util from 'util'; @@ -339,7 +349,13 @@ export class Messages { `Missing message ${this.bundleName}:${key} for locale ${Messages.getLocale()}.` ); } - const msg = ensureString(map.get(key)); - return util.format(msg, ...tokens); + const msg = map.get(key); + const messages = (isArray(msg) ? msg : [msg]) as string[]; + return messages + .map(message => { + ensureString(message); + return util.format(message, ...tokens); + }) + .join(os.EOL); } } diff --git a/test/unit/loggerTest.ts b/test/unit/loggerTest.ts index c6413090c9..7bf9280d97 100644 --- a/test/unit/loggerTest.ts +++ b/test/unit/loggerTest.ts @@ -214,6 +214,7 @@ describe('Logger', () => { expect(cbSpy.callCount).to.be.equal(0); }); }); + describe('filters', () => { const sid = 'SIDHERE!'; const simpleString = `sid=${sid}`; @@ -380,32 +381,47 @@ describe('Logger', () => { it('should transform to logfmt streams', () => { let output = ''; - const out = $$.SANDBOX.stub(process.stdout, 'write'); - const err = $$.SANDBOX.stub(process.stderr, 'write').callsFake(error => { - output += error; + const out = $$.SANDBOX.stub(process.stdout, 'write').callsFake(info => { + output += info; }); - const testStream1: LoggerStream = { - name: 'test stream 1', - level: LoggerLevel.DEBUG, - stream: process.stderr - }; - const testStream2: LoggerStream = { - name: 'test stream 2', + const testStream: LoggerStream = { + name: 'test stream', level: LoggerLevel.INFO, stream: process.stdout }; const testLogger = new Logger({ name: 'testLogger', format: LoggerFormat.LOGFMT }); - testLogger.addStream(testStream1); - testLogger.addStream(testStream2); - - // const logger = await Logger.root(); + testLogger.addStream(testStream); testLogger.addField('container_id', '1234567890'); + testLogger.info('info'); out.restore(); - err.restore(); + + expect(output).to.contain('msg=info'); expect(output).to.contain('container_id=1234567890'); }); + + it('should wrap LogFmt message with quotes', () => { + let output = ''; + + const out = $$.SANDBOX.stub(process.stdout, 'write').callsFake(info => { + output += info; + }); + + const testStream: LoggerStream = { + name: 'test stream', + level: LoggerLevel.INFO, + stream: process.stdout + }; + + const testLogger = new Logger({ name: 'testLogger', format: LoggerFormat.LOGFMT }); + testLogger.addStream(testStream); + + testLogger.info('some long message with white space in between'); + out.restore(); + + expect(output).to.contain('msg="some long message with white space in between"'); + }); }); }); diff --git a/test/unit/messagesTest.ts b/test/unit/messagesTest.ts index 39850d0b1b..c114807a27 100644 --- a/test/unit/messagesTest.ts +++ b/test/unit/messagesTest.ts @@ -18,7 +18,8 @@ const $$ = testSetup(); describe('Messages', () => { const testMessages = { msg1: 'test message 1', - msg2: 'test message 2 %s and %s' + msg2: 'test message 2 %s and %s', + manyMsgs: ['hello', 'world', 'test message 2 %s and %s'] }; const msgMap = new Map(); @@ -26,6 +27,7 @@ describe('Messages', () => { msgMap.set('msg2', testMessages.msg2); msgMap.set('msg3', cloneJson(testMessages)); msgMap.get('msg3').msg3 = cloneJson(testMessages); + msgMap.set('manyMsgs', testMessages.manyMsgs); describe('getMessage', () => { const messages = new Messages('myBundle', Messages.getLocale(), msgMap); @@ -59,6 +61,12 @@ describe('Messages', () => { expect(err.message).to.equal('Missing message myBundle:msg4 for locale en_US.'); } }); + + it('should return single string from array of messages', () => { + expect(messages.getMessage('manyMsgs', ['blah', 864])).to.equal( + 'hello blah 864\nworld blah 864\ntest message 2 blah and 864' + ); + }); }); describe('importMessageFile', () => {