-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: make project optional #771
Conversation
@@ -105,7 +106,7 @@ export class PackageVersionListCommand extends SfCommand<PackageVersionListComma | |||
public async run(): Promise<PackageVersionListCommandResult> { | |||
const { flags } = await this.parse(PackageVersionListCommand); | |||
const connection = flags['target-dev-hub'].getConnection(flags['api-version']); | |||
const project = SfProject.getInstance(); |
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 command didn't have requiresProject = true
but this line was enforcing it anyway.
@@ -15,36 +15,46 @@ import { env } from '@salesforce/kit'; | |||
import { PackageVersionCreateCommand } from '../../../src/commands/package/version/create.js'; | |||
import Package2VersionStatus = PackagingSObjects.Package2VersionStatus; | |||
|
|||
const pkgVersionCreateErrorResult: Partial<PackageVersionCreateRequestResult> = { | |||
const pkgVersionCreateErrorResult: PackageVersionCreateRequestResult = { |
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 type changed here:
forcedotcom/packaging#627
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 does package:version:update need a Project? It doesn't look like it's reading the project (flags for tag, branch, etc passed as inputs to the method).
I'm going to ask Vivek about the sfdx-projecet modification commetns.
@@ -19,7 +20,6 @@ export class PackageVersionDeleteCommand extends SfCommand<PackageSaveResult> { | |||
public static readonly examples = messages.getMessages('examples'); | |||
public static readonly deprecateAliases = true; | |||
public static readonly aliases = ['force:package:version:delete']; | |||
public static readonly requiresProject = 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.
hmm...[unrelated to this PR] I would have expected the delete command to remove the packageVersion from my project.
I guess it never has (and this was that whole "delete doesn't really delete, just deprecates" so maybe that's correct?)
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.
so maybe that should happen if there's a project, but it's not required?
@@ -19,7 +20,6 @@ export class PackageDeleteCommand extends SfCommand<PackageSaveResult> { | |||
public static readonly examples = messages.getMessages('examples'); | |||
public static readonly deprecateAliases = true; | |||
public static readonly aliases = ['force:package:delete']; | |||
public static readonly requiresProject = 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.
also would have expected this to modify sfdx-project after deleting the pkg
@@ -20,7 +21,6 @@ export class PackageUpdateCommand extends SfCommand<PackageSaveResult> { | |||
public static readonly examples = messages.getMessages('examples'); | |||
public static readonly deprecateAliases = true; | |||
public static readonly aliases = ['force:package:update']; | |||
public static readonly requiresProject = 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.
same (I'd expect it to update the packageDirectories description/etc with my changes)
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.
@mshanemc - I tested something similar with package version update
.
I updated the --version-name
and --version-description
. Both were updated in the DevHub, but neither impacted sfdx-project.json
src/utils/getProject.ts
Outdated
} catch (err) { | ||
if (err instanceof Error && err.name === 'InvalidProjectWorkspaceError') { | ||
return undefined; | ||
} |
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.
any swallow all other errors?
What's the logic of checking the error name then?
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.
What's the logic of checking the error name then?
none, I think I was just following the error msg from SfProject.resolve
's jsdoc.
Changed to make it swallow all errors that could come from trying to resolve a project.
@mshanemc - Perhaps This would only happen if the I've tested this from inside a project. I updated the |
QA cont ✅ |
DEPENDS ON https://github.com/forcedotcom/packaging/pull/638/files
What does this PR do?
forcedotcom/cli#2932
Allow the following commands to be run outside an sfdx project:
package delete
package update
package version delete
package version displayancestry
package version list
package version promote
package version report
What issues does this PR fix or reference?
@W-16286213@