@salesforce/core-bundle 6.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2024, Salesforce.com, Inc.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+
8
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+
10
+ * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ [![NPM](https://img.shields.io/npm/v/@salesforce/core.svg)](https://www.npmjs.com/package/@salesforce/core)
2
+
3
+ - [Description](#description)
4
+ - [Usage](#usage)
5
+ - [Contributing](#contributing)
6
+ - [Using TestSetup](#using-testsetup)
7
+ - [Message Transformer](#message-transformer)
8
+
9
+ # Description
10
+
11
+ 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.
12
+
13
+ # Usage
14
+
15
+ See the [API documentation](https://forcedotcom.github.io/sfdx-core/).
16
+
17
+ ## Contributing
18
+
19
+ If you're interested in contributing, take a look at the [CONTRIBUTING](CONTRIBUTING.md) guide.
20
+
21
+ ## Issues
22
+
23
+ Report all issues to the [issues only repository](https://github.com/forcedotcom/cli/issues).
24
+
25
+ # Using TestSetup
26
+
27
+ 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.
28
+
29
+ See the [Test Setup documentation](TEST_SETUP.md).
30
+
31
+ ## Message Transformer
32
+
33
+ The Messages class, by default, loads message text during run time. It's optimized to do this only per file.
34
+
35
+ 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.
36
+
37
+ src/messageTransformer will "inline" the messages into the js files during TS compile using `https://github.com/nonara/ts-patch`.
38
+
39
+ In your plugin or library,
40
+
41
+ `yarn add --dev ts-patch`
42
+
43
+ > tsconfig.json
44
+
45
+ ```json
46
+ {
47
+ ...
48
+ "plugins": [{ "transform": "@salesforce/core/lib/messageTransformer", "import": "messageTransformer" }]
49
+ }
50
+ ```
51
+
52
+ > .sfdevrc.json, which gets merged into package.json
53
+
54
+ ```json
55
+ "wireit": {
56
+ "compile": {
57
+ "command": "tspc -p . --pretty --incremental",
58
+ "files": [
59
+ "src/**/*.ts",
60
+ "tsconfig.json",
61
+ "messages"
62
+ ],
63
+ "output": [
64
+ "lib/**",
65
+ "*.tsbuildinfo"
66
+ ],
67
+ "clean": "if-file-deleted"
68
+ }
69
+ }
70
+
71
+ ```
72
+
73
+ ## Performance Testing
74
+
75
+ There are some benchmark.js checks to get a baseline for Logger performance.
76
+ https://forcedotcom.github.io/sfdx-core/perf-Linux
77
+ https://forcedotcom.github.io/sfdx-core/perf-Windows
78
+
79
+ You can add more test cases in test/perf/logger/main.js
80
+
81
+ 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`