@salesforce/plugin-sobject 2.0.13 → 2.0.14
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/README.md +4 -4
- package/lib/shared/fs.js +14 -4
- package/lib/shared/fs.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -164,7 +164,7 @@ FLAG DESCRIPTIONS
|
|
|
164
164
|
If you don't specify this flag, the command prompts you to choose from your local objects.
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
_See code: [src/commands/schema/generate/field.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.
|
|
167
|
+
_See code: [src/commands/schema/generate/field.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.14/src/commands/schema/generate/field.ts)_
|
|
168
168
|
|
|
169
169
|
## `sf schema generate platformevent`
|
|
170
170
|
|
|
@@ -196,7 +196,7 @@ EXAMPLES
|
|
|
196
196
|
$ sf schema generate platformevent --label "My Platform Event"
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
_See code: [src/commands/schema/generate/platformevent.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.
|
|
199
|
+
_See code: [src/commands/schema/generate/platformevent.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.14/src/commands/schema/generate/platformevent.ts)_
|
|
200
200
|
|
|
201
201
|
## `sf schema generate sobject`
|
|
202
202
|
|
|
@@ -253,7 +253,7 @@ FLAG DESCRIPTIONS
|
|
|
253
253
|
- Streaming API: With Bulk API and Sharing, classifies the custom object as an Enterprise Application object.
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
_See code: [src/commands/schema/generate/sobject.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.
|
|
256
|
+
_See code: [src/commands/schema/generate/sobject.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.14/src/commands/schema/generate/sobject.ts)_
|
|
257
257
|
|
|
258
258
|
## `sf schema generate tab`
|
|
259
259
|
|
|
@@ -301,6 +301,6 @@ FLAG DESCRIPTIONS
|
|
|
301
301
|
The API name for a custom object always ends in `__c`, such as `MyObject__c`.
|
|
302
302
|
```
|
|
303
303
|
|
|
304
|
-
_See code: [src/commands/schema/generate/tab.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.
|
|
304
|
+
_See code: [src/commands/schema/generate/tab.ts](https://github.com/salesforcecli/plugin-sobject/blob/2.0.14/src/commands/schema/generate/tab.ts)_
|
|
305
305
|
|
|
306
306
|
<!-- commandsstop -->
|
package/lib/shared/fs.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import path from 'node:path';
|
|
17
17
|
import fs from 'node:fs';
|
|
18
|
-
import
|
|
18
|
+
import { glob } from 'tinyglobby';
|
|
19
19
|
import { convertJsonToXml, parseXml } from './convert.js';
|
|
20
20
|
const getObjectXmlByPathAsJson = async (objectFilePath) => {
|
|
21
21
|
const xml = await fs.promises.readFile(objectFilePath, 'utf8');
|
|
@@ -23,13 +23,23 @@ const getObjectXmlByPathAsJson = async (objectFilePath) => {
|
|
|
23
23
|
};
|
|
24
24
|
/** globs don't support windows path, but the input might be */
|
|
25
25
|
const ensurePosixPath = (filePath) => filePath.split(path.sep).join(path.posix.sep);
|
|
26
|
+
/**
|
|
27
|
+
* tinyglobby returns paths relative to cwd (even for absolute patterns), directories with a trailing slash,
|
|
28
|
+
* and interleaves results across patterns.
|
|
29
|
+
* Glob each pattern in order, keep absolute patterns absolute, and strip the trailing slash.
|
|
30
|
+
*/
|
|
31
|
+
const globPaths = async (patterns, onlyDirectories = false) => {
|
|
32
|
+
const patternList = Array.isArray(patterns) ? patterns : [patterns];
|
|
33
|
+
const results = await Promise.all(patternList.map((pattern) => glob(pattern, { onlyDirectories, expandDirectories: false, absolute: path.isAbsolute(pattern) })));
|
|
34
|
+
return [...new Set(results.flat().map((p) => path.normalize(p.endsWith('/') ? p.slice(0, -1) : p)))];
|
|
35
|
+
};
|
|
26
36
|
/**
|
|
27
37
|
* @param targetPaths typically your pkgDirs or project path
|
|
28
38
|
* @returns directories that end in `/objects/`
|
|
29
39
|
*/
|
|
30
40
|
export const getDirectoriesThatContainObjects = async (targetPaths) => {
|
|
31
41
|
const globs = targetPaths.map((p) => `${ensurePosixPath(p)}/**/objects/`);
|
|
32
|
-
return (
|
|
42
|
+
return globPaths(globs, true);
|
|
33
43
|
};
|
|
34
44
|
/**
|
|
35
45
|
* @param targetPaths typically your pkgDirs or project path
|
|
@@ -37,7 +47,7 @@ export const getDirectoriesThatContainObjects = async (targetPaths) => {
|
|
|
37
47
|
*/
|
|
38
48
|
export const getObjectDirectories = async (targetPaths) => {
|
|
39
49
|
const globs = targetPaths.map((p) => `${ensurePosixPath(p)}/**/objects/*`);
|
|
40
|
-
return (
|
|
50
|
+
return globPaths(globs, true);
|
|
41
51
|
};
|
|
42
52
|
/**
|
|
43
53
|
* @param folder folder path to the object name (ex: `force-app/main/default/objects/Account`)
|
|
@@ -45,7 +55,7 @@ export const getObjectDirectories = async (targetPaths) => {
|
|
|
45
55
|
*/
|
|
46
56
|
export const getObjectXmlByFolderAsJson = async (folder) => {
|
|
47
57
|
const globs = `${ensurePosixPath(folder)}/*.object-meta.xml`;
|
|
48
|
-
const [objectMetaPath] = await
|
|
58
|
+
const [objectMetaPath] = await globPaths(globs);
|
|
49
59
|
return getObjectXmlByPathAsJson(objectMetaPath);
|
|
50
60
|
};
|
|
51
61
|
/**
|
package/lib/shared/fs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/shared/fs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/shared/fs.ts"],"names":[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AC,CAAC;IAC7F,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1F,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,kBAAkB,CAAC,CAAC;IACrG,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;IAClG,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/plugin-sobject",
|
|
3
3
|
"description": "Create objects, fields, tabs, etc",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.14",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/forcedotcom/cli/issues",
|
|
7
7
|
"enableO11y": true,
|
|
@@ -12,21 +12,22 @@
|
|
|
12
12
|
"@salesforce/core": "^9.1.0",
|
|
13
13
|
"@salesforce/kit": "^4.0.1",
|
|
14
14
|
"@salesforce/sf-plugins-core": "^13.0.4",
|
|
15
|
-
"fast-glob": "^3.3.3",
|
|
16
15
|
"fast-xml-parser": "^5.10.1",
|
|
17
|
-
"js2xmlparser": "^4.0.2"
|
|
16
|
+
"js2xmlparser": "^4.0.2",
|
|
17
|
+
"tinyglobby": "^0.2.17"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@oclif/plugin-command-snapshot": "^6.0.0",
|
|
21
21
|
"@salesforce/cli-plugins-testkit": "^5.3.66",
|
|
22
22
|
"@salesforce/dev-scripts": "^15.0.0",
|
|
23
|
-
"@salesforce/plugin-command-reference": "^3.1.
|
|
23
|
+
"@salesforce/plugin-command-reference": "^3.1.141",
|
|
24
24
|
"@salesforce/types": "^1.9.0",
|
|
25
25
|
"@types/chai": "^4.3.17",
|
|
26
26
|
"@types/mocha": "^10.0.10",
|
|
27
27
|
"@types/node": "^18",
|
|
28
|
+
"@types/picomatch": "^4.0.3",
|
|
28
29
|
"@types/sinon": "^10.0.20",
|
|
29
|
-
"eslint": "^10.
|
|
30
|
+
"eslint": "^10.12.0",
|
|
30
31
|
"eslint-config-salesforce-typescript": "^7.0.0",
|
|
31
32
|
"eslint-plugin-sf-plugin": "^3.0.1",
|
|
32
33
|
"oclif": "^5.0.2",
|
|
@@ -216,7 +217,7 @@
|
|
|
216
217
|
"exports": "./lib/index.js",
|
|
217
218
|
"type": "module",
|
|
218
219
|
"sfdx": {
|
|
219
|
-
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/2.0.
|
|
220
|
-
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/2.0.
|
|
220
|
+
"publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/2.0.14.crt",
|
|
221
|
+
"signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-sobject/2.0.14.sig"
|
|
221
222
|
}
|
|
222
223
|
}
|