Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/forcedotcom/sfdx-core
https://github.com/forcedotcom/sfdx-core
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/forcedotcom/sfdx-core
- Owner: forcedotcom
- License: bsd-3-clause
- Created: 2018-09-11T21:50:24.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-01T18:14:25.000Z (3 months ago)
- Last Synced: 2024-08-01T19:26:12.958Z (3 months ago)
- Language: TypeScript
- Size: 59.4 MB
- Stars: 148
- Watchers: 32
- Forks: 68
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-sfdx-plugins - sfdx-core - side tools for your plugins (Official plugins/modules from Salesforce)
README
[![NPM](https://img.shields.io/npm/v/@salesforce/core.svg)](https://www.npmjs.com/package/@salesforce/core)
- [Description](#description)
- [Usage](#usage)
- [Contributing](#contributing)
- [Using TestSetup](#using-testsetup)
- [Message Transformer](#message-transformer)# Description
The @salesforce/core library provides client-side management of Salesforce DX projects, org authentication, connections to Salesforce APIs, and other utilities. Much of the core functionality that powers the Salesforce CLI plugins comes from this library. You can use this functionality in your plugins too.
# Usage
See the [API documentation](https://forcedotcom.github.io/sfdx-core/).
## Contributing
If you're interested in contributing, take a look at the [CONTRIBUTING](CONTRIBUTING.md) guide.
## Issues
Report all issues to the [issues only repository](https://github.com/forcedotcom/cli/issues).
# Using TestSetup
The Salesforce DX Core Library provides a unit testing utility to help with mocking and sand-boxing core components. This feature allows unit tests to execute without needing to make API calls to salesforce.com.
See the [Test Setup documentation](TEST_SETUP.md).
## Message Transformer
The Messages class, by default, loads message text during run time. It's optimized to do this only per file.
If you're using @salesforce/core or other code that uses its Messages class in a bundler (webpack, esbuild, etc) it may struggle with these runtime references.
src/messageTransformer will "inline" the messages into the js files during TS compile using `https://github.com/nonara/ts-patch`.
In your plugin or library,
`yarn add --dev ts-patch`
> tsconfig.json
```json
{
...
"plugins": [{ "transform": "@salesforce/core/lib/messageTransformer", "import": "messageTransformer" }]
}
```> .sfdevrc.json, which gets merged into package.json
```json
"wireit": {
"compile": {
"command": "tspc -p . --pretty --incremental",
"files": [
"src/**/*.ts",
"tsconfig.json",
"messages"
],
"output": [
"lib/**",
"*.tsbuildinfo"
],
"clean": "if-file-deleted"
}
}```
## Performance Testing
There are some benchmark.js checks to get a baseline for Logger performance.
https://forcedotcom.github.io/sfdx-core/perf-Linux
https://forcedotcom.github.io/sfdx-core/perf-WindowsYou can add more test cases in test/perf/logger/main.js
If you add tests for new parts of sfdx-core outside of Logger, add new test Suites and create new jobs in the GHA `perf.yml`