forge icon indicating copy to clipboard operation
forge copied to clipboard

fix(maker-pkg): add targetArch to pkg name

Open nsainaney opened this issue 3 years ago • 6 comments

  • [x] I have read the contribution documentation for this project.
  • [x] I agree to follow the code of conduct that this project follows, as appropriate.
  • [ ] The changes are appropriately documented (if applicable).
  • [x] The changes have sufficient test coverage (if applicable).
  • [ ] The testsuite passes successfully on my local machine (if applicable).

Summarize your changes: Made a minor change to added targetArch to pkg name to be consistent with dmg maker.

nsainaney avatar Feb 13 '22 21:02 nsainaney

Thanks @malept - I'm just having build issues so am unable to run yarn test. I've run:

yarn install
yarn build

but get about 250 type errors. Do you have build instructions somewhere that I missed? Thanks!

packages/template/webpack/src/WebpackTemplate.ts:47:18 - error TS2339: Property 'updateFileByLine' does not exist on type 'WebpackTemplate'.

47       await this.updateFileByLine(
                    ~~~~~~~~~~~~~~~~

packages/template/webpack/src/WebpackTemplate.ts:49:10 - error TS7006: Parameter 'line' implicitly has an 'any' type.

49         (line) => {
            ~~~~

packages/template/webpack/src/WebpackTemplate.ts:57:18 - error TS2339: Property 'updateFileByLine' does not exist on type 'WebpackTemplate'.

57       await this.updateFileByLine(path.resolve(directory, 'src', 'index.html'), (line) => {
                    ~~~~~~~~~~~~~~~~

packages/template/webpack/src/WebpackTemplate.ts:57:82 - error TS7006: Parameter 'line' implicitly has an 'any' type.

57       await this.updateFileByLine(path.resolve(directory, 'src', 'index.html'), (line) => {
                                                                                    ~~~~


Found 250 errors.

nsainaney avatar Feb 14 '22 16:02 nsainaney

Please read the contributing docs for how to run commands.

malept avatar Feb 14 '22 16:02 malept

Thanks @malept - I missed the bolt side of things (new to bolt).

In any case, I have updated the MakerPKG unit test to reflect the changes in this PR. There are 2 unit tests failing locally for me (but they are failing irrespective of this PR)

nsainaney avatar Feb 14 '22 17:02 nsainaney

Codecov Report

Merging #2726 (0cc22c8) into master (95185ef) will increase coverage by 0.43%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2726      +/-   ##
==========================================
+ Coverage   63.71%   64.15%   +0.43%     
==========================================
  Files          77       77              
  Lines        2748     2611     -137     
  Branches      682      585      -97     
==========================================
- Hits         1751     1675      -76     
+ Misses        816      753      -63     
- Partials      181      183       +2     
Impacted Files Coverage Δ
packages/maker/pkg/src/MakerPKG.ts 92.85% <100.00%> (ø)
packages/plugin/base/src/Plugin.ts 62.50% <0.00%> (-25.00%) :arrow_down:
packages/installer/exe/src/InstallerExe.ts 50.00% <0.00%> (-25.00%) :arrow_down:
packages/installer/dmg/src/util/hdiutil.ts 42.30% <0.00%> (-9.55%) :arrow_down:
packages/api/core/src/api/index.ts 48.83% <0.00%> (-8.95%) :arrow_down:
packages/api/core/src/api/publish.ts 45.26% <0.00%> (-8.66%) :arrow_down:
packages/installer/base/src/Installer.ts 50.00% <0.00%> (-7.15%) :arrow_down:
packages/api/core/src/api/start.ts 48.88% <0.00%> (-6.44%) :arrow_down:
packages/api/core/src/util/yarn-or-npm.ts 88.23% <0.00%> (-6.21%) :arrow_down:
packages/template/base/src/BaseTemplate.ts 82.14% <0.00%> (-4.96%) :arrow_down:
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 95185ef...0cc22c8. Read the comment docs.

codecov[bot] avatar Feb 14 '22 17:02 codecov[bot]

There are 2 unit tests failing locally for me (but they are failing irrespective of this PR)

It would help to know which tests are failing for you.

malept avatar Feb 14 '22 19:02 malept

The issue appears to be in packages/api/core/test/slow/api_spec_slow.ts:124:17

The call (execSync) to npm unlink is failing with Must provide a package name to remove. I am using npm 7.13.0 which requires npm unlink to be npm unlink -g (see https://github.com/npm/cli/issues/1946)

So I'd disregard my failing errors if npm 7 is not supported.

  333 passing (3m)
  1 pending
  2 failing

  1) electron-forge API (with installer=npm)
       init (with custom templater)
         "after all" hook for "should create deep files correctly":
     Error: Command failed: npm unlink
npm ERR! Must provide a package name to remove

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/narayans/.npm/_logs/2022-02-14T19_57_07_385Z-debug.log

      at checkExecSyncError (node:child_process:707:11)
      at execSync (node:child_process:744:15)
      at Context.<anonymous> (packages/api/core/test/slow/api_spec_slow.ts:124:17)

  2) electron-forge API (with installer=yarn)
       init (with custom templater)
         "after all" hook for "should create deep files correctly":
     Error: Command failed: npm unlink
npm ERR! Must provide a package name to remove

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/narayans/.npm/_logs/2022-02-14T19_58_02_037Z-debug.log

      at checkExecSyncError (node:child_process:707:11)
      at execSync (node:child_process:744:15)
      at Context.<anonymous> (packages/api/core/test/slow/api_spec_slow.ts:124:17)

nsainaney avatar Feb 14 '22 21:02 nsainaney

Merge conflicts aren't letting me check this out locally. I'll spin up a new PR with the exact same diff.

erickzhao avatar Nov 08 '22 22:11 erickzhao

Superseded by #3057

erickzhao avatar Nov 08 '22 22:11 erickzhao