Skip to content

Conversation

@TomStrepsil
Copy link
Contributor

@TomStrepsil TomStrepsil commented Jul 14, 2025

Issue

resolves #47

Details

The packages shown on npmjs.org show a missing README.md, and have no keywords:
image

To address:

  • The published package should have README.md copied to the root of the package (as is the requirement for npmjs.org). However, rather than rescind the docs/ convention of the repository, a temporary copy of this file out of docs/ is made using a prepublishOnly script (and deleted after publish with a postpublish script, in-case doing a local dry-run).
  • LICENSE is in the repo root, but not copied into the package, and should be based on its notice:
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    
    ...and general advice from npmjs.org

example npm publish --dry-run output:

npm notice 📦  @asos/web-toggle-point-features@0.3.5
npm notice Tarball Contents
npm notice 1.1kB LICENSE
npm notice 6.3kB README.md
npm notice 1.0kB lib/browser.es5.cjs
npm notice 6.5kB lib/browser.es5.cjs.map
npm notice 1.0kB lib/browser.js
npm notice 6.5kB lib/browser.js.map
npm notice 5.9kB lib/main.es5.cjs
npm notice 9.7kB lib/main.es5.cjs.map
npm notice 5.8kB lib/main.js
npm notice 9.7kB lib/main.js.map
npm notice 3.0kB package.json
npm notice Tarball Details
npm notice name: @asos/web-toggle-point-features
npm notice version: 0.3.5
npm notice filename: asos-web-toggle-point-features-0.3.5.tgz
npm notice package size: 9.1 kB
npm notice unpacked size: 56.6 kB
npm notice shasum: 67cfa668ce86fe4b12932c3c60d167a21920a509
npm notice integrity: sha512-nYtyHt7tE9ts4[...]Z5xSA+aO/99nw==
npm notice total files: 11
  • Appropriate keywords have been added to the packages/**/package.json files.

Scout rule

  • keywords had been set naively on the root package.json, and copied over when the peripheral packages were added for the open source version. However, in reality, these keywords are only used to power search on npmjs.org, so for private packages, they make little sense.
  • add an .npmrc pointing to the public registry, to avoid package-lock.json pollution with private registries

CheckList

  • PR starts with [ISSUE_ID].
  • Has been tested (where required) before merge to main.

TomStrepsil and others added 11 commits December 24, 2024 17:31
* rename to proper module namespace

* update docs links

* update versions

* web toggle point in readme title

* fixup changelog from revised 0.x range

* 2.0.0 -> 0.5.0 in oss version scheme

* fix broken link syntax in CHANGELOG

* consistent quoting

* more version history issues

* fixup module name in jsdoc

* add web
remove sdkInstanceProvider

* remove SDKInstanceProvider

* fixup jsdoc dedupe

* tweak

* clarity re: ssr package

* casing etc
* update workflows

* version

* typo

* update chromium linux snaps

* versions for serve update

* package.json repository field

* update root package.lock

* bugs & directories/doc fields

* fix changelog

---------

Co-authored-by: Tom Pereira <tom.pereira@johnlewis.co.uk>
Co-authored-by: Tom Pereira <tom.pereira@johnlewis.co.uk>
Normalise keywords.
Add postfix to features package description.
@TomStrepsil TomStrepsil requested a review from a team as a code owner July 14, 2025 18:21
@TomStrepsil TomStrepsil changed the title [47] ensure README.md included in npm package and add keywords [47] ensure README.md and CHANGELOG.md included in npm package and add keywords Jul 14, 2025
@TomStrepsil TomStrepsil changed the title [47] ensure README.md and CHANGELOG.md included in npm package and add keywords [47] ensure README.md is included in npm package, and add keywords Jul 15, 2025
@TomStrepsil TomStrepsil changed the title [47] ensure README.md is included in npm package, and add keywords [47] ensure README.md & LICENSE is included in npm package, and add keywords Jul 22, 2025
@asos-dominicjomaa asos-dominicjomaa merged commit bc7f6fd into ASOS:main Sep 29, 2025
10 checks passed
Comment on lines +46 to +47
"prepublishOnly": "shx cp docs/README.md ../../LICENSE . && npm run build",
"postpublish": "shx rm ./README.md LICENSE",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These commands pull the README.md and LICENSE files from the appropriate places into the root of the package, so that the publish finds them on the build server.

The postpublish puts them back again (to clean up local workstations, if ever running a --dry-run locally)

@TomStrepsil TomStrepsil deleted the feat/47-ensure-readme-in-npm-package-and-add-keywords branch October 21, 2025 09:23
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.

Move README.md to root of bundled package & add keywords so that they shows on npmjs.org

2 participants