{"id":15645180,"url":"https://github.com/andarist/cherry-pick","last_synced_at":"2025-09-02T11:36:57.671Z","repository":{"id":33765851,"uuid":"133144979","full_name":"Andarist/cherry-pick","owner":"Andarist","description":"🍒⛏📦 Build tool to generate proxy directories.","archived":false,"fork":false,"pushed_at":"2022-05-02T16:34:42.000Z","size":38,"stargazers_count":57,"open_issues_count":7,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-18T08:15:36.348Z","etag":null,"topics":["build","build-tool","tool"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Andarist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-12T12:41:13.000Z","updated_at":"2025-02-19T06:45:51.000Z","dependencies_parsed_at":"2022-08-08T05:15:18.284Z","dependency_job_id":null,"html_url":"https://github.com/Andarist/cherry-pick","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Andarist/cherry-pick","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fcherry-pick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fcherry-pick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fcherry-pick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fcherry-pick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Andarist","download_url":"https://codeload.github.com/Andarist/cherry-pick/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Andarist%2Fcherry-pick/sbom","scorecard":{"id":13147,"data":{"date":"2025-08-11","repo":{"name":"github.com/Andarist/cherry-pick","commit":"efeb028cdabd3d5fe1990d98ca7b3edac6ef024b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":2,"reason":"Found 4/17 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T15:04:04.809Z","repository_id":33765851,"created_at":"2025-08-14T15:04:04.809Z","updated_at":"2025-08-14T15:04:04.809Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273278943,"owners_count":25077307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","build-tool","tool"],"created_at":"2024-10-03T12:04:58.523Z","updated_at":"2025-09-02T11:36:57.628Z","avatar_url":"https://github.com/Andarist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cherry-pick 🍒⛏📦\n\nBuild tool to generate proxy directories with `package.json` files such as this:\n\n```json\n{\n  \"name\": \"redux-saga/effects\",\n  \"private\": true,\n  \"main\": \"../lib/effects.js\",\n  \"module\": \"../es/effects.js\"\n}\n```\n\n## Why?\n\nWhen it comes to \"main\" entry points of our libraries we have an _easy_ way for\nsupporting both CJS \u0026 ESM files with respectively `\"main\"` and `\"module\"` fields\nin `package.json`. This allows resolution algorithms to chose a file with the\nbest format _automatically_. However if we have multiple files in a package and\nwe want all of them to be importable we often suggest to users doing it like\nthis:\n\n```js\nimport module from \"package/lib/module\";\n```\n\nThere are problems with this approach:\n\n* it is often encouraging people to import files authored in CJS format, which\n  if produced with tools like [`babel`](https://github.com/babel/babel) has i.e.\n  interop helper functions deoptimizing imported file size when comparing to the\n  same file authored in ESM format. Also `webpack` just bails out on CJS files\n  when trying to optimize your application size with techniques such as\n  tree-shaking \u0026 scope hoisting (a.k.a module concatenation).\n* it is exposing **internal directory structure** to the user. Why `lib` is in\n  the requested path? If you ship both CJS \u0026 ESM directories to `npm` and if\n  users would like to import appropriate file depending on the tool they are\n  \"forced\" to remember this and switch between importing the same thing with\n  paths like `package/lib/module` and `package/es/module`. This is a mental\n  overhead that can be avoided.\n\nThis technique was also described by me in more details in\n[this article](https://developers.livechatinc.com/blog/how-to-create-javascript-libraries-in-2018-part-2#proxy-directories).\n\n## CLI Options\n\n### default\n\n```\ncherry-pick [input-dir]\n\nCreate proxy directories\n\nCommands:\n  cherry-pick [input-dir]        Create proxy directories              [default]\n  cherry-pick clean [input-dir]  Cleanup generated directories\n\nOptions:\n  --help, -h     Show help                                             [boolean]\n  --version, -v  Show version number                                   [boolean]\n  --cjs-dir                                                     [default: \"lib\"]\n  --esm-dir                                                      [default: \"es\"]\n  --types-dir\n  --cwd                                                           [default: \".\"]\n  --input-dir                                                   [default: \"src\"]\n```\n\n### clean\n\n```\ncherry-pick clean [input-dir]\n\nCleanup generated directories\n\nOptions:\n  --help, -h     Show help                                             [boolean]\n  --version, -v  Show version number                                   [boolean]\n  --cwd                                                           [default: \".\"]\n  --input-dir                                                   [default: \"src\"]\n```\n\n## JS API\n\n`cherry-pick` exports a `default` method which creates proxy directories and\n`clean` which removes them. Both accepts the same options as corresponding CLI\ncommands, only they are camelCased.\n\n```js\nconst { default: cherryPick, clean } = require(\"cherry-pick\");\n\ncherryPick({ inputDir: \"source\" })\n  .then(cherryPicked =\u003e\n    console.log(`Created proxy directories: ${cherryPicked.join(\", \")}`)\n  )\n  .then(() =\u003e clean({ inputDir: \"source\" }))\n  .then(removed =\u003e\n    console.log(`Removed proxy directories: ${Removed.join(\", \")}`)\n  );\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandarist%2Fcherry-pick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandarist%2Fcherry-pick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandarist%2Fcherry-pick/lists"}