-
Notifications
You must be signed in to change notification settings - Fork 9
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
I'm unable to publish #4
base: main
Are you sure you want to change the base?
Conversation
@mabels could you open an issue with an example to reproduce your issues with publishing? ie. is there something specific about the tags you had/setup that would help use debug the other issues? (ie. I know you said there may be issues with how we're streaming the tarball to get & validate the manifest) The way the tags are merged here doesn't do any validation & I'd like to ensure we map to valid keys/throw if they aren't valid based on |
console.log(`ext-1`, buffer); | ||
const blob = new Blob([Buffer.from(buffer)]) | ||
console.log(`ext-2`); | ||
const stream = blob.stream().pipeThrough(new DecompressionStream('gzip')) | ||
console.log(`ext-3`); | ||
for await (const obj of extract(stream)) { | ||
console.log(`ext-3.1`, obj.header.name); |
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.
Let's remove logs meant for debugging
@@ -135,8 +149,7 @@ export async function publishPackage (c) { | |||
const new_versions = Object.keys(body.versions).filter(v => !versions.includes(v)) | |||
|
|||
if (!results || results.length === 0) { | |||
const insertQuery = `INSERT INTO packages (name, tags) VALUES ("${pkg}", json('{"latest": "${new_versions[0]}"}'))` | |||
await c.env.DB.prepare(insertQuery).run() | |||
await mergeTags(c.env.DB, pkg, { latest: new_versions[0] }) |
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.
Since this, somewhat, expands our tagging support, we should validate the tag values before inserting/updating.
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.
how could this been done.
I run vsr per 'npm run dev'.
First I got some SQL constraints problems which I solved by introducing a mergeTags function. I hopefully found the tonality of the project-source code.
Second I run into the problem that extractPackageJSON is not able to extract published tarball. The loop:
only extracts the first file and than:
I don't understand why for now --- any help?
It looks like that streaming-tarball has some issues.