{"id":19451249,"url":"https://github.com/thekashey/package-self","last_synced_at":"2025-08-25T00:06:25.007Z","repository":{"id":57317737,"uuid":"115110518","full_name":"theKashey/package-self","owner":"theKashey","description":"Place yourself in the right place.","archived":false,"fork":false,"pushed_at":"2022-04-19T01:27:04.000Z","size":9,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-15T05:31:09.756Z","etag":null,"topics":["npm","npm-scripts","package","testing"],"latest_commit_sha":null,"homepage":null,"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/theKashey.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":"2017-12-22T11:45:20.000Z","updated_at":"2022-04-19T01:27:07.000Z","dependencies_parsed_at":"2022-08-25T20:00:51.536Z","dependency_job_id":null,"html_url":"https://github.com/theKashey/package-self","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fpackage-self","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fpackage-self/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fpackage-self/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theKashey%2Fpackage-self/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theKashey","download_url":"https://codeload.github.com/theKashey/package-self/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233984835,"owners_count":18761347,"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","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":["npm","npm-scripts","package","testing"],"created_at":"2024-11-10T16:40:57.158Z","updated_at":"2025-01-15T02:32:42.268Z","avatar_url":"https://github.com/theKashey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# package-self\n\n[![NPM](https://nodei.co/npm/package-self.png?downloads=true\u0026stars=true)](https://nodei.co/npm/package-self/)\n\nThe common mistake for any library is quite simple, but hard to spot.\n\n\u003e As a library creator you are testing you library __NOT__ as a library. \n\nUsually - one will run tests against /src folder. Usually - no one will test how \nfinal customer will use and consume your library.\n\nThis includes:\n1. Your package was broken on build\n2. Typing, you provided, is wrong\n3. Babel magic wont work\n4. You forget to write down a new file into your package.json\n5. .....\n\n## Solution\n\n```js\nnpm install package-self\n\nnpm run package-self\n```    \nThis will install a package as local dependency, next you can use in in your test\n\n##### Before\n```js\nimport myFunction from '../src/index.js'\ndeclare('lets test it!'....)\n```\nYou should not test yourself in as your self.\n\n##### After\n```js\nimport myFunction from 'myLibrary'\ndeclare('lets test it!'....)\n```\nNow you can test yourself as your final user will use you.\n\n### Hint\nNot all tests could and should be run using the `real` bundle code.\nBut you shall test your public API using the code, you will ship to a customer, not local sources.\n\n### PS\nAs we test this library.\n\nPPS: Inspired by [React tooling bloppost](https://reactjs.org/blog/2017/12/15/improving-the-repository-infrastructure.html#simulating-package-publishing),\nalso some code has origins from that article. \n\n# Licence\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekashey%2Fpackage-self","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekashey%2Fpackage-self","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekashey%2Fpackage-self/lists"}