-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support reading from .npmrc #11979
Support reading from .npmrc #11979
Conversation
❌ @Jarred-Sumner, your commit has failing tests :( 🪟💻 3 failing tests Windows x64 baseline
🪟💻 3 failing tests Windows x64
|
This comment was marked as outdated.
This comment was marked as outdated.
@@ -37,6 +38,7 @@ extern "C" JSPropertyIterator* Bun__JSPropertyIterator__create(JSC::JSGlobalObje | |||
JSC::VM& vm = globalObject->vm(); | |||
JSC::JSValue value = JSValue::decode(encodedValue); | |||
JSC::JSObject* object = value.getObject(); | |||
ASSERT(object != NULL); |
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 assertion doesn't do anything, getObject() will crash before this line is reached if that assertion wasn't true
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.
The implementation of getObject() is this which returns a null pointer
inline JSObject* JSValue::getObject() const
{
return isCell() ? asCell()->getObject() : nullptr;
}
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.
isCell() when given a null pointer returns true (yes, surprising)
asCell()->getObject() then de-references the null pointer and 💥
return error.ParserError; | ||
} | ||
|
||
// if (!bun.Environment.isDebug) { |
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.
is there a reason this is not deleted?
} | ||
|
||
const had_errors = log.hasErrors(); | ||
log.printForLogLevel(Output.errorWriter()) catch bun.outOfMemory(); |
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 are we printing here instead of in the caller?
}); | ||
} | ||
|
||
// await makeTest([["_authToken", "skibidi"]], result => { |
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 is this commented out? Should it be deleted or should it be uncommented?
Global.exit(1); | ||
}, | ||
} | ||
const source = bun.logger.Source.initPathString(".npmrc", npmrc_contents.items[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.
Is there a reason we have another implementation of reading a file from disk, instead of using bun.sys.File.toSource
or bun.sys.File.toSourceAt
?
}; | ||
} | ||
} | ||
return .none; |
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.
the only return thats necessary is the last one right?
@zackradisic looks like the test failures in bun-install-registry are real |
This should be updated. |
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.
Are public-hoist-pattern
, legacy-peer-deps
planned?
legacy-peer-deps
would roughly correspond to peer = false
with this caveat:
What does this PR do?
WIP
This PR implements a .npmrc parser and loads it with Bun's package manager
Fixes #643