question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

format command sorts "files" property and breaks packages

See original GitHub issue

Description

syncpack is reordering the contents of the “files” property which changes the contents of the tarball when using “npm publish” or “npm pack”.

example package.json:

{
    files: [
        "dist/",
        "!*.test.*",
        "!__mocks__"
   ]
}

command: npx syncpack format

result:

{
    files: [
        "!*.test.*",
        "!__mocks__",
        "dist/"
   ]
}

expected result:

{
    files: [
        "dist/",
        "!*.test.*",
        "!__mocks__"
   ]
}

The only work-around is to use .npmignore and remove the files property, but this becomes unmanageable.

Suggested Solution

Do not sort the “files” property.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JamieMasoncommented, Jun 19, 2020

Great, thanks a lot. I have the fix ready locally and will release soon.

0reactions
raijinsetsucommented, Jun 19, 2020

Works perfectly. Thanks for the fast turn around!

-Luke

On Fri, Jun 19, 2020, 12:21 Jamie Mason notifications@github.com wrote:

Should be available now in syncpack@5.0.3

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JamieMason/syncpack/issues/35#issuecomment-646727844, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABT6LNWOAGI5A7XITB5BPCDRXOGARANCNFSM4OC2TFLA .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dir Command (Examples, Options, Switches, & More) - Lifewire
The dir command is a Command Prompt command that's used to display a list of the files and subfolders contained in a folder....
Read more >
dir | Microsoft Learn
Reference article for the dir command, which displays a list of a directory's files and subdirectories.
Read more >
Properties File Format - Oracle Help Center
The properties files read by Nucleus must follow a format that is recognized by the class java.util.Properties . The rules for the format...
Read more >
5. Control files and their fields — Debian Policy Manual v4.6.2.0
The package management system manipulates data represented in a common format, known as control data, stored in control files. Control files are used...
Read more >
What is a flat file and how does it work? - TechTarget
Learn what a flat file is and how it works, types of flat files and their use ... types of databases are significantly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found