-
Notifications
You must be signed in to change notification settings - Fork 215
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
Publish old versions without touching latest tag #472
base: main
Are you sure you want to change the base?
Conversation
d36ff5b
to
8ce850e
Compare
1d54b72
to
383193f
Compare
"tar-stream": "^3.1.6", | ||
"which": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/charm": "^1.0.6", | ||
"@types/tar": "^6.1.9", | ||
"@types/tar-stream": "^3.1.3", | ||
"@types/which": "^3.0.2", | ||
"@qiwi/npm-types": "^1.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, wasn't this PR supposed to get rid of the @qiwi
dep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one step, I have more changes I was building on this PR; probably I'll send a new one instead that includes this one.
const tarData = await pacote.tarball(packageDir); | ||
// Make sure we never assign the latest tag to an old version. | ||
if (!dry) | ||
await libpub.publish(manifest ? { ...manifest, bundledDependencies: undefined } : manifest, tarData, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why might manifest be undefined? Should we publish if it's missing?
I noticed this because I'd prefer to pull out a manifest.bundledDependencies = undefined
instead of a spread, but that doesn't work if it's possibly undefined.
@@ -10,13 +10,16 @@ | |||
"@definitelytyped/header-parser": "workspace:*", | |||
"@definitelytyped/retag": "workspace:*", | |||
"@definitelytyped/utils": "workspace:*", | |||
"libnpmpublish": "^9.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this change would let us stop depending on npm-registry-publish, but it just adds the new dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's half a change; this PR removed some of the registry dep but not all.
|
||
export const cacheDir = joinPaths(process.env.GITHUB_ACTIONS ? joinPaths(__dirname, "../../..") : os.tmpdir(), "cache"); | ||
|
||
type NeedToFixNpmRegistryClientTypings = any; | ||
|
||
export class NpmPublishClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this only tags and deprecates now. I'd rename to NpmTagger or something
and we seem to mostly create it on-demand, so maybe callers should switch to calling tag
/deprecate
directly.
const token = await getSecret(Secret.NPM_TYPES_TOKEN); | ||
const client = new NpmPublishClient(token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splitting this statement seems unnecessary
Use the
defaultTag
option when publishing old versions to avoid changing thelatest
tag and then having to undo and retag the latest version:DefinitelyTyped-tools/packages/types-publisher/src/lib/package-publisher.ts
Lines 23 to 26 in 5ccbffd
I switched to using libnpmpublish because I couldn't pass the
defaultTag
option to npm-registry-client's publish() method. libnpmpublish is what the npm CLI's publish command now uses.