Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: package.json docs #7962

Open
wants to merge 4 commits into
base: latest
Choose a base branch
from
Open

fix: package.json docs #7962

wants to merge 4 commits into from

Conversation

reggi
Copy link
Contributor

@reggi reggi commented Dec 5, 2024

This is an attempt to reconcile and fully document package.json properties.

typescript type here: https://github.com/npm/types/blob/main/types/index.d.ts
json schema: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json

I personally had some confusion around maintainers.

Adds node specific fields like imports and type.

Also adds (deprecations) for bundledDependencies / maintainers and licences.

Related to @kenshanta's work on documenting type #7897

Moving forward i'd like to just callout the following:

  1. Any property acknowledged by Node.js should point to the documentation.
  2. We should not "copy and paste" or reinterpret the Node.js docs when a link is better.

@reggi reggi requested a review from a team as a code owner December 5, 2024 20:12
@reggi reggi force-pushed the reggi/packagejson-docs branch from df73168 to 1554bab Compare December 5, 2024 20:14
docs/lib/content/configuring-npm/package-json.md Outdated Show resolved Hide resolved

### typings

Alias of [types](#types).
Copy link
Contributor

Choose a reason for hiding this comment

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

i think this is actually a typescript-deprecated field from TS < v3 or v2.

Copy link
Contributor Author

@reggi reggi Dec 5, 2024

Choose a reason for hiding this comment

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

Yeah i didn't know about it until today.

From the ts docs:

Note that the "typings" field is synonymous with types, and could be used as well.

We do honor it.

If you can find deprecation docs I'm down to add (deprecation). I still think it should be documented.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html implies it's just an alias, so maybe it's not actually deprecated.

reggi and others added 2 commits December 5, 2024 15:19
@kenshanta
Copy link

kenshanta commented Dec 5, 2024

@reggi why overwrite a pre-existing PR specifically created for the addition of the type attribute?
If you disagree with the changes in #7897 please feel free to add your comments and leave the rest for the reviewers to decide.
All the best

@reggi
Copy link
Contributor Author

reggi commented Dec 5, 2024

I'm realizing that past deprecated fields like preferGlobal were just removed. So the latest docs isn't a living list of all fields, which i'm not in favor of generally. I like to see deprecated fields the same way json schema, or @deprecated jsdoc typing would work.

@ljharb
Copy link
Contributor

ljharb commented Dec 5, 2024

@reggi maybe a page that hides deprecated attributes by default, but they can be toggled visible? (and if someone arrives on a # link to one of them, it shows them as well)

that would reduce the risk that someone implements support for, or uses, one of the deprecated attributes without pretending they never existed.

@reggi
Copy link
Contributor Author

reggi commented Dec 5, 2024

I'm also realizing i'm lacking the terminology for the following:

  • deprecated as in "never honored" (maintainers => contributors)
  • deprecated as in "not honored" (ie licenses => license)
  • deprecated as in "honored, not preferred" (bundledDependencies => bundleDependencies, typings => types)

@ljharb
Copy link
Contributor

ljharb commented Dec 5, 2024

i'd say only the third one is "deprecated", the other two are removed, or legacy, or something.

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.

3 participants