fix(medusa-dev-cli): Avoid dev cli auth (#2360)
This commit is contained in:
5
.changeset/lemon-peaches-protect.md
Normal file
5
.changeset/lemon-peaches-protect.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"medusa-dev-cli": patch
|
||||
---
|
||||
|
||||
Avoid dev cli auth
|
||||
@@ -49,6 +49,7 @@ exports.publishPackagesLocallyAndInstall = async ({
|
||||
ignorePackageJSONChanges,
|
||||
yarnWorkspaceRoot,
|
||||
externalRegistry,
|
||||
root,
|
||||
}) => {
|
||||
await startServer()
|
||||
|
||||
@@ -63,6 +64,7 @@ exports.publishPackagesLocallyAndInstall = async ({
|
||||
packageNameToPath,
|
||||
versionPostFix,
|
||||
ignorePackageJSONChanges,
|
||||
root,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -87,12 +87,16 @@ const adjustPackageJson = ({
|
||||
* This is `npm publish` (as in linked comment) and `yarn publish` requirement.
|
||||
* This is not verdaccio restriction.
|
||||
*/
|
||||
const createTemporaryNPMRC = ({ pathToPackage }) => {
|
||||
const NPMRCPath = path.join(pathToPackage, `.npmrc`)
|
||||
fs.outputFileSync(NPMRCPath, NPMRCContent)
|
||||
const createTemporaryNPMRC = ({ pathToPackage, root }) => {
|
||||
const NPMRCPathInPackage = path.join(pathToPackage, `.npmrc`)
|
||||
fs.outputFileSync(NPMRCPathInPackage, NPMRCContent)
|
||||
|
||||
const NPMRCPathInRoot = path.join(root, `.npmrc`)
|
||||
fs.outputFileSync(NPMRCPathInRoot, NPMRCContent)
|
||||
|
||||
return registerCleanupTask(() => {
|
||||
fs.removeSync(NPMRCPath)
|
||||
fs.removeSync(NPMRCPathInPackage)
|
||||
fs.removeSync(NPMRCPathInRoot)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -102,6 +106,7 @@ const publishPackage = async ({
|
||||
versionPostFix,
|
||||
ignorePackageJSONChanges,
|
||||
packageNameToPath,
|
||||
root,
|
||||
}) => {
|
||||
const monoRepoPackageJsonPath = getMonorepoPackageJsonPath({
|
||||
packageName,
|
||||
@@ -119,7 +124,7 @@ const publishPackage = async ({
|
||||
|
||||
const pathToPackage = path.dirname(monoRepoPackageJsonPath)
|
||||
|
||||
const uncreateTemporaryNPMRC = createTemporaryNPMRC({ pathToPackage })
|
||||
const uncreateTemporaryNPMRC = createTemporaryNPMRC({ pathToPackage, root })
|
||||
|
||||
// npm publish
|
||||
const publishCmd = [
|
||||
|
||||
@@ -157,6 +157,7 @@ async function watch(
|
||||
ignorePackageJSONChanges,
|
||||
yarnWorkspaceRoot,
|
||||
externalRegistry,
|
||||
root,
|
||||
})
|
||||
} else {
|
||||
// run `yarn`
|
||||
@@ -342,6 +343,7 @@ async function watch(
|
||||
localPackages,
|
||||
ignorePackageJSONChanges,
|
||||
externalRegistry,
|
||||
root,
|
||||
})
|
||||
packagesToPublish.clear()
|
||||
isPublishing = false
|
||||
|
||||
Reference in New Issue
Block a user