![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@salesforce/source-tracking
Advanced tools
API for tracking local and remote Salesforce metadata changes
JavaScript library for tracking local and remote Salesforce metadata changes.
Please report all issues to issues only repository.
You should use the class named SourceTracking.
Start like this:
import { SourceTracking } from '@salesforce/source-tracking';
const tracking = await SourceTracking.create({
org: this.org, // Org from sfdx-core
project: this.project, // Project from sfdx-core
});
Any calls to methods on your instance of tracking
will check to make sure that the appropriate remote/local files are up to date and loaded.
If you know you need to access remote or local, you can ensure
them so that the FS and API operations don't happen multiple time (useful before calling operations that run in parallel)
await tracking.ensureRemoteTracking(); // pass `true` if you know you need to force a re-query.
// Example: the library got Remote Changes from the server, but you just did a deploy and know you need to get the updated SourceMembers.
await tracking.ensureLocalTracking();
getConflicts()
, getChanges()
updateLocalTracking()
,updateRemoteTracking
// send in two arrays of Files (nonDeletes and Deletes)
await tracking.updateLocalTracking({
deployedFiles: ['force-app/main/default/classes/MyClass.cls', 'force-app/main/default/classes/MyClass.cls-meta.xml'],
deletedFiles: [],
});
// Pass an array of objects. The type comes from SDR's FileResponse type, Success variant
// By default, it'll poll the server to get your SourceMembers before committing all the changes to the tracking files
await tracking.updateRemoteTracking([
{
fullName: 'MyClass',
type: 'ApexClass',
state: 'Changed',
filePath: 'force-app/main/default/classes/MyClass.cls',
},
{
fullName: 'MyClass',
type: 'ApexClass',
state: 'Changed',
filePath: 'force-app/main/default/classes/MyClass.cls-meta.xml',
},
]);
Once your retrieve finishes, use the same updateLocalTracking as you did for deploy to commit the file changes to local and remote changes.
// By default, it'll poll the server to get your SourceMembers before committing all the changes to the tracking files. If you already queried sourceMembers as part of conflict check, etc you can pass `false` to prevent polling the server again for SourceMembers
await tracking.updateRemoteTracking(
[
{
fullName: 'MyClass',
type: 'ApexClass',
state: 'Changed',
filePath: 'force-app/main/default/classes/MyClass.cls',
},
{
fullName: 'MyClass',
type: 'ApexClass',
state: 'Changed',
filePath: 'force-app/main/default/classes/MyClass.cls-meta.xml',
},
],
false
);
FAQs
API for tracking local and remote Salesforce metadata changes
The npm package @salesforce/source-tracking receives a total of 1,267 weekly downloads. As such, @salesforce/source-tracking popularity was classified as popular.
We found that @salesforce/source-tracking demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 47 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.