ChatGPT-CodeReview icon indicating copy to clipboard operation
ChatGPT-CodeReview copied to clipboard

How can I build this repository?

Open superwoou opened this issue 1 year ago • 3 comments

I tried to improve this repository by fork. But I can't build . npm run build is failed with error.

> [email protected] build
> rm -rf dist && rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript && ncc build src/github-action.cjs -o action

loaded rollup.config.ts with warnings
(!) Plugin typescript: @rollup/plugin-typescript: Rollup 'sourcemap' option must be set to generate source maps.
[!] RollupError: Rollup transpiled your configuration to an  ES module even though it appears to contain CommonJS elements. To resolve this, you can pass the "--bundleConfigAsCjs" flag to Rollup or change your configuration to only contain valid ESM code.

Original error: exports is not defined in ES module scope
https://rollupjs.org/command-line-interface/#bundleconfigascjs
ReferenceError: exports is not defined in ES module scope

Also, I couldn't run the test code.

> [email protected] test
> jest

 FAIL  test/index.test.ts
  ● Test suite failed to run

    test/index.test.ts:6:8 - error TS1192: Module '"/Users/yonghoonlee/gitroot/ChatGPT-CodeReview/src/index"' has no default export.

    6 import myProbotApp from "../src";
             ~~~~~~~~~~~

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.431 s
Ran all test suites.

How can I build and test?

superwoou avatar Aug 18 '23 10:08 superwoou