Coder Social home page Coder Social logo

Encourage lean packages about skeleton HOT 8 CLOSED

php-pds avatar php-pds commented on September 3, 2024 2
Encourage lean packages

from skeleton.

Comments (8)

pavarnos avatar pavarnos commented on September 3, 2024 1

i like the idea: too often packages come with a lot of extra cruft / clutter eg tools used to develop the package or config files for those tools. These clutter the namespace and can interfere with IDEs eg with phpStorm, i have to manually tell it to ignore symbols in some .phar files a package developer has forgotten to exclude from release because they are duplicates of other packages in my composer.json.

from skeleton.

pmjones avatar pmjones commented on September 3, 2024 1

That's interesting reading; thanks.

On furhter consideration, though, it occurs to me that this, like #6 , might well be out-of-scope for a standard that intends only to define top-level names for common directories and files.

from skeleton.

Revisor avatar Revisor commented on September 3, 2024

Can you provide an example of what is "a lean package"? I read your link but don't understand it.

from skeleton.

raphaelstolt avatar raphaelstolt commented on September 3, 2024

A lean package is a released package that does only contain the minimal required code / artifacts for it to work.

For this standard PHP package skeleton this would be:

$ tree .
.
├── (LICENSE)
├── (bin)
├── composer.json
├── (config)
├── (public)
└── src

(*) optional

With the presence of the directories bin, config, and public being dependent on the type of the package. And the presence of the LICENSE file being dependent on the chosen license model of the package.

This can be achieved by utilising export-ignore patterns in a .gitattributes file like shown next.

.ctl.cache export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
.gitmessage export-ignore
.php_cs export-ignore
.travis.yml export-ignore
bin/application-version export-ignore
bin/release-version export-ignore
bin/start-watchman export-ignore
bin/travis/* export-ignore
CHANGELOG.md export-ignore
example/ export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore
tests/ export-ignore

from skeleton.

pmjones avatar pmjones commented on September 3, 2024

@raphaelstolt -- Can you link to some literature that talks about "lean" packages in general?

Also, I don't know how common this is. At a minimum, analyzing for this would require examining the .gitattributes of each package in the sample, then determining if the "right" files had been excluded. Then it would need to be able to be applied regardless of the SCM system (Git, Hg, Svn, FutureSystem, etc).

If it's not commonly-done, and can't be abstracted away from a particular SCM toolset, then it's probably not a candidate for the standard.

from skeleton.

raphaelstolt avatar raphaelstolt commented on September 3, 2024

@pmjones So there are two links I can provide you. One from reddit and one that got me started using .gitattributes.

I can also remember a debate and decision to not do this for the Symfony components, would really like to know their reasoning against it.

A quick and shallow Google search reveals that this feature seems to be Git specific. However I got a gut feeling that the majority of PHP packages are using a Git based SCM and that lean packages are definitively a goal to strive for. How about making it a MUST for Git based packages and a RECOMMEND or SHALL for the other SCM systems?

from skeleton.

pmjones avatar pmjones commented on September 3, 2024

@raphaelstolt @pavarnos Any further thoughts here? I am leaning toward closing this as "out of scope" but I want to make sure I'm not missing something else important.

from skeleton.

raphaelstolt avatar raphaelstolt commented on September 3, 2024

Feel free to close it.

from skeleton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.