jamessimone / apex-rollup

Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
MIT License
210 stars 30 forks source link

chore: sfdx to sf cli upgrade, project files, dependencies #535

Closed dschach closed 9 months ago

dschach commented 9 months ago

test:lwc is failing, and I don't know why, but I think the rest should be good. I would prefer to have opened this against a branch so you can test your workflows. If you'd like to make one, I can open against that and you can check before merging.

dschach commented 9 months ago

It is interesting that some of the Salesforce cpackages (oclif and salesforce command) are using such outdated dependencies that there's no compatible version of eslint, it seems, that will work with all of these. I would suggest removing all the dependencies that you don't need.

dschach commented 9 months ago

ESLint is still giving me errors.

    console.error
      ERROR!!

      49 |       } catch (err) {
      50 |         // eslint-disable-next-line
    > 51 |         console.error(err);
         |                 ^
      52 |       }
      53 |     }
      54 |

      at RecalculateParentRollupFlexipage.error [as handleClick] (rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:51:17)

    console.error
      TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
          at Object.exports.convert (<vscode>/apex-rollup/node_modules/jsdom/lib/jsdom/living/generated/Event.js:22:9)
          at HTMLBridgeElement.dispatchEvent (<vscode>/apex-rollup/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:236:24)
          at dispatchEvent (<vscode>/apex-rollup/node_modules/@lwc/engine-dom/src/renderer-factory.ts:41:22)
          at RecalculateParentRollupFlexipage.dispatchEvent (<vscode>/apex-rollup/node_modules/@lwc/engine-core/dist/index.js:1566:16)
          at RecalculateParentRollupFlexipage.value [as dispatchEvent] (<vscode>/apex-rollup/node_modules/@lwc/engine-core/dist/index.js:743:46)
          at RecalculateParentRollupFlexipage.dispatchEvent [as handleClick] (<vscode>/apex-rollup/rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:48:14)

      49 |       } catch (err) {
      50 |         // eslint-disable-next-line
    > 51 |         console.error(err);
         |                 ^
      52 |       }
      53 |     }
      54 |

      at RecalculateParentRollupFlexipage.error [as handleClick] (rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:51:17)

    console.error
      TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
          at Object.exports.convert (<vscode>/apex-rollup/node_modules/jsdom/lib/jsdom/living/generated/Event.js:22:9)
          at HTMLBridgeElement.dispatchEvent (<vscode>/apex-rollup/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:236:24)
          at dispatchEvent (<vscode>/apex-rollup/node_modules/@lwc/engine-dom/src/renderer-factory.ts:41:22)
          at RecalculateParentRollupFlexipage.dispatchEvent (<vscode>/apex-rollup/node_modules/@lwc/engine-core/dist/index.js:1566:16)
          at RecalculateParentRollupFlexipage.value [as dispatchEvent] (<vscode>/apex-rollup/node_modules/@lwc/engine-core/dist/index.js:743:46)
          at RecalculateParentRollupFlexipage.dispatchEvent [as handleClick] (<vscode>/apex-rollup/rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:48:14)

      49 |       } catch (err) {
      50 |         // eslint-disable-next-line
    > 51 |         console.error(err);
         |                 ^
      52 |       }
      53 |     }
      54 |

      at RecalculateParentRollupFlexipage.error [as handleClick] (rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:51:17)

    console.error
      TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
          at Object.exports.convert (<vscode>/apex-rollup/node_modules/jsdom/lib/jsdom/living/generated/Event.js:22:9)
          at HTMLBridgeElement.dispatchEvent (<vscode>/apex-rollup/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:236:24)
          at dispatchEvent (<vscode>/apex-rollup/node_modules/@lwc/engine-dom/src/renderer-factory.ts:41:22)
          at RecalculateParentRollupFlexipage.dispatchEvent (<vscode>/apex-rollup/node_modules/@lwc/engine-core/dist/index.js:1566:16)
          at RecalculateParentRollupFlexipage.value [as dispatchEvent] (<vscode>/apex-rollup/node_modules/@lwc/engine-core/dist/index.js:743:46)
          at RecalculateParentRollupFlexipage.dispatchEvent [as handleClick] (<vscode>/apex-rollup/rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:48:14)

      49 |       } catch (err) {
      50 |         // eslint-disable-next-line
    > 51 |         console.error(err);
         |                 ^
      52 |       }
      53 |     }
      54 |

      at RecalculateParentRollupFlexipage.error [as handleClick] (rollup/app/lwc/recalculateParentRollupFlexipage/recalculateParentRollupFlexipage.js:51:17)

 FAIL  rollup/app/lwc/rollupForceRecalculation/__tests__/rollupForceRecalculation.test.js
  ● Console

    console.error
      error!

      190 |       this._displayErrorToast('An error occurred while rolling up', errorMessage);
      191 |       // eslint-disable-next-line
    > 192 |       console.error(e); // in the event you dismiss the toast but still want to see the error
          |               ^
      193 |     }
      194 |   }
      195 |

      at RollupForceRecalculation.error [as handleSubmit] (rollup/app/lwc/rollupForceRecalculation/rollupForceRecalculation.js:192:15)

  ● Rollup force recalc tests › polls when process Id given

    TypeError: getBatchRollupStatus.mockResolvedValueOnce is not a function

      285 |   it('polls when process Id given', async () => {
      286 |     // simulate second poll receiving one of the completed values
    > 287 |     getBatchRollupStatus.mockResolvedValueOnce('Completed').mockResolvedValueOnce('test');
          |                          ^
      288 |     performSerializedFullRecalculation.mockResolvedValueOnce('someProcessId');
      289 |
      290 |     const fullRecalc = await mountComponent();

      at Object.mockResolvedValueOnce (rollup/app/lwc/rollupForceRecalculation/__tests__/rollupForceRecalculation.test.js:287:26)

  ● Rollup force recalc tests › returns immediately when first poll is success

    TypeError: getBatchRollupStatus.mockResolvedValue is not a function

      304 |
      305 |   it('returns immediately when first poll is success', async () => {
    > 306 |     getBatchRollupStatus.mockResolvedValue('Completed');
          |                          ^
      307 |     performSerializedFullRecalculation.mockResolvedValueOnce('someProcessId');
      308 |
      309 |     const fullRecalc = await mountComponent();

      at Object.mockResolvedValue (rollup/app/lwc/rollupForceRecalculation/__tests__/rollupForceRecalculation.test.js:306:26)

--------------------------------------|---------|----------|---------|---------|---------------------------
File                                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s         
--------------------------------------|---------|----------|---------|---------|---------------------------
All files                             |   90.68 |    71.42 |   94.66 |   90.84 |                           
 __mockData__                         |     100 |      100 |     100 |     100 |                           
  index.js                            |     100 |      100 |     100 |     100 |                           
 recalculateParentRollupFlexipage     |   91.22 |    57.89 |     100 |   90.74 |                           
  recalculateParentRollupFlexipage.js |   91.22 |    57.89 |     100 |   90.74 | 29-30,37-38,95            
 rollupForceRecalculation             |   88.19 |       74 |   91.17 |   88.23 |                           
  rollupForceRecalculation.js         |   88.19 |       74 |   91.17 |   88.23 | 89,91,112-125,212-214,243 
 rollupOrderBy                        |   92.42 |    73.68 |   95.45 |   93.44 |                           
  rollupOrderBy.js                    |   92.42 |    73.68 |   95.45 |   93.44 | 45-47,87                  
 rollupUtils                          |     100 |       80 |     100 |     100 |                           
  rollupUtils.js                      |     100 |       80 |     100 |     100 | 37                        
--------------------------------------|---------|----------|---------|---------|---------------------------
Test Suites: 1 failed, 3 passed, 4 total
Tests:       2 failed, 23 passed, 25 total
Snapshots:   0 total
Time:        1.422 s, estimated 2 s
Ran all test suites.
dschach commented 9 months ago

@jamessimone I don't have write access, so you'll need to merge it