From 73062e2d6024ec7dd625a874a1d8e9eab6634066 Mon Sep 17 00:00:00 2001 From: Shane McLaughlin Date: Tue, 26 Mar 2024 16:40:08 -0500 Subject: [PATCH] feat: keep logFn out of code (#94) * feat: keep logFn out of code * chore: external lint without direct dependency * chore: no shx --- .eslintrc.js | 8 +++++++- .github/workflows/externalLint.yml | 5 ++--- .github/workflows/test.yml | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d45a83e..736afc9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -45,6 +45,12 @@ module.exports = { group: ["**/../lib/**", "lib/**"], message: "import from /src not from /lib. /lib is a build artifact", }, + { + group: ["@salesforce/kit"], + importNames: ["logFn"], + message: + "The logging function is only for debug and should not be shipped in production code", + }, ], }, ], @@ -80,6 +86,6 @@ module.exports = { "import/order": "error", "jsdoc/check-alignment": "error", "jsdoc/check-indentation": "error", - "jsdoc/tag-lines": [2, "any", { "startLines": 1,"endLines": 1 }] + "jsdoc/tag-lines": [2, "any", { startLines: 1, endLines: 1 }], }, }; diff --git a/.github/workflows/externalLint.yml b/.github/workflows/externalLint.yml index bb3dc21..4c92f68 100644 --- a/.github/workflows/externalLint.yml +++ b/.github/workflows/externalLint.yml @@ -35,14 +35,13 @@ jobs: name: ${{ inputs.command }} runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.nodeVersion }} - run: git clone ${{ inputs.externalProjectGitUrl}} $(pwd) - - run: yarn install --network-timeout 600000 + - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main - name: swap this dependency for the version on this branch run: | - yarn remove ${{ inputs.packageName }} yarn add ${{ github.repository }}#${{ github.sha }} --dev - name: install/build ${{ inputs.packageName}} in node_modules working-directory: node_modules/${{ inputs.packageName }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef8bf0f..d42e280 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: - https://github.com/salesforcecli/plugin-info - https://github.com/salesforcecli/plugin-limits - https://github.com/salesforcecli/plugin-login + - https://github.com/salesforcecli/plugin-marketplace - https://github.com/salesforcecli/plugin-org - https://github.com/salesforcecli/plugin-packaging - https://github.com/salesforcecli/plugin-schema @@ -42,3 +43,4 @@ jobs: with: packageName: "eslint-config-salesforce" externalProjectGitUrl: ${{ matrix.externalProjectGitUrl }} + preExternalBuildCommands: "rm -rf node_modules/@salesforce/**/node_modules/@salesforce/eslint-config-salesforce"