Repository navigation
Write . for an empty package.json name or version - #507
Open
ankitjain91 wants to merge 1 commit into
Open
ankitjain91 wants to merge 1 commit into
ankitjain91 wants to merge 1 commit into
Conversation
A package.json with `"name": ""` or `"version": ""` made scip-typescript write an empty package field, for example `scip-typescript npm 1.0.0 src/`main.ts`/main().`. The SCIP grammar reads a double space as an escaped space, so SCIP consumers misparse every symbol in that package. scip-to-glean, for example, stores an empty symbol name for each one. ScipSymbol.package now writes `.` for an empty field, as the SCIP spec requires. A package.json without a name already gave `. .`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
package.jsonwith"name": ""or"version": ""makes scip-typescript write an empty package field:The SCIP grammar reads a double space as an escaped space, so SCIP consumers misparse every symbol in that package. For example, Glean's
scip-to-gleanparsesnpm 1.0.0as the manager and the descriptor path as the package name. It then stores an empty symbol name for every first-party symbol, so a lookup by name finds nothing.ScipSymbol.packagenow writes.for an empty field, as the SCIP spec requires. Apackage.jsonwith nonamealready gave. .throughanonymousPackage(), so this makes the empty-string case match.Test plan
empty-package-fields: the rootpackage.jsonhas"name": "", andsrc/version/package.jsonhas"version": "".definition 1.0.0 src/main.ts/anddefinition empty-versionlib.ts/.definition . 1.0.0 src/main.ts/anddefinition empty-version .lib.ts/.npm run build,npm run test(36 passed),npm run prettier-check, andnpm run eslintpass. No other snapshot changes.