Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: escape file names for make step #2752

Merged
merged 5 commits into from
Jun 16, 2022
Merged

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Mar 1, 2022

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

Summarize your changes:

Fixes #1745

Stole some code from Packager which sanitizes file names:

function sanitizeAppName (name) {
  return filenamify(name, { replacement: '-' })
}

Note: the lockfile doesn't change here because we already had this exact version of filenamify as a transitive dep (via packager).

@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #2752 (e4c6a1f) into master (204ec25) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2752      +/-   ##
==========================================
+ Coverage   74.06%   74.07%   +0.01%     
==========================================
  Files          77       77              
  Lines        2356     2357       +1     
  Branches      436      436              
==========================================
+ Hits         1745     1746       +1     
  Misses        462      462              
  Partials      149      149              
Impacted Files Coverage Δ
packages/api/core/src/api/make.ts 81.81% <100.00%> (+0.18%) ⬆️

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 204ec25...e4c6a1f. Read the comment docs.

Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to have updated the lockfile

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if there were tests added for this.

@erickzhao
Copy link
Member Author

oops this PR was not done. i wrangled proxyquire enough to write the worst test in the world. PTAL.

@erickzhao
Copy link
Member Author

This doesn't appear to have updated the lockfile

@MarshallOfSound I grabbed this code change from Packager, which also uses the exact same "filenamify": "^4.1.0" dependency. I tested with other versions (e.g. bolt add filenamify@^4.0.0) and the yarn.lock changed.

I think since filenamify@^4.1.0 is already at the top-level in yarn.lock it's normal that it hasn't changed.

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the foo/null fixture necessary?

@erickzhao
Copy link
Member Author

Is the foo/null fixture necessary?

I stole it from https://github.com/electron-userland/electron-forge/tree/master/packages/api/core/test/fixture/dummy_app and made changes accordingly.

Not sure if it's necessary, but it follows existing conventions from the repo.

@malept
Copy link
Member

malept commented Mar 2, 2022

Is the foo/null fixture necessary?

I stole it from https://github.com/electron-userland/electron-forge/tree/master/packages/api/core/test/fixture/dummy_app and made changes accordingly.

Not sure if it's necessary, but it follows existing conventions from the repo.

It's probably not necessary. It's likely not necessary in dummy_app either but I'd have to do an audit for that one.

@erickzhao
Copy link
Member Author

f5407a7 passed locally

@erickzhao
Copy link
Member Author

e4c6a1f makes the test a bit better now that i understand things a bit better

@erickzhao erickzhao requested a review from malept March 24, 2022 20:19
@MarshallOfSound MarshallOfSound merged commit beb9305 into master Jun 16, 2022
@MarshallOfSound MarshallOfSound deleted the fix/escape-file-names branch June 16, 2022 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make / Package should work with scoped package names
4 participants