@salesforce/packaging 0.0.12 → 0.0.13
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/CHANGELOG.md +6 -0
- package/lib/package/packageProfileApi.js +6 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.13](https://github.com/forcedotcom/packaging/compare/v0.0.12...v0.0.13) (2022-08-05)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- use regular xmlDom package ([57262c5](https://github.com/forcedotcom/packaging/commit/57262c574b54aa2690a47d5e702fe48dbdf475c7))
|
|
10
|
+
|
|
5
11
|
### [0.0.12](https://github.com/forcedotcom/packaging/compare/v0.0.11...v0.0.12) (2022-07-29)
|
|
6
12
|
|
|
7
13
|
### Features
|
|
@@ -10,7 +10,7 @@ exports.PackageProfileApi = void 0;
|
|
|
10
10
|
const path = require("path");
|
|
11
11
|
const fs = require("fs");
|
|
12
12
|
const glob = require("glob");
|
|
13
|
-
const
|
|
13
|
+
const xmldom_1 = require("@xmldom/xmldom");
|
|
14
14
|
const core_1 = require("@salesforce/core");
|
|
15
15
|
const kit_1 = require("@salesforce/kit");
|
|
16
16
|
core_1.Messages.importMessagesDirectory(__dirname);
|
|
@@ -109,8 +109,8 @@ class PackageProfileApi extends kit_1.AsyncCreatable {
|
|
|
109
109
|
profilePaths.forEach((profilePath) => {
|
|
110
110
|
// profile metadata can present in any directory in the package structure
|
|
111
111
|
const profileName = profilePath.match(/([^/]+)\.profile-meta.xml/)[1];
|
|
112
|
-
const profileDom = new
|
|
113
|
-
const newDom = new
|
|
112
|
+
const profileDom = new xmldom_1.DOMParser().parseFromString(fs.readFileSync(profilePath, 'utf-8'));
|
|
113
|
+
const newDom = new xmldom_1.DOMParser().parseFromString('<?xml version="1.0" encoding="UTF-8"?><Profile xmlns="http://soap.sforce.com/2006/04/metadata"></Profile>');
|
|
114
114
|
const profileNode = newDom.getElementsByTagName('Profile')[0];
|
|
115
115
|
let hasNodes = false;
|
|
116
116
|
// We need to keep track of all the members for when we package up the "OtherProfileSettings"
|
|
@@ -141,7 +141,7 @@ class PackageProfileApi extends kit_1.AsyncCreatable {
|
|
|
141
141
|
const userLicenses = profileDom.getElementsByTagName('userLicense');
|
|
142
142
|
if (userLicenses) {
|
|
143
143
|
hasNodes = true;
|
|
144
|
-
for (const userLicense of userLicenses) {
|
|
144
|
+
for (const userLicense of Array.from(userLicenses)) {
|
|
145
145
|
profileNode.appendChild(userLicense.cloneNode(true));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -150,7 +150,7 @@ class PackageProfileApi extends kit_1.AsyncCreatable {
|
|
|
150
150
|
const xmlFile = xmlSrcFile.replace(/(.*)(-meta.xml)/, '$1');
|
|
151
151
|
const destFilePath = path.join(destPath, xmlFile);
|
|
152
152
|
if (hasNodes) {
|
|
153
|
-
const serializer = new
|
|
153
|
+
const serializer = new xmldom_1.XMLSerializer();
|
|
154
154
|
serializer.serializeToString(newDom);
|
|
155
155
|
fs.writeFileSync(destFilePath, serializer.serializeToString(newDom), 'utf-8');
|
|
156
156
|
}
|
|
@@ -169,7 +169,7 @@ class PackageProfileApi extends kit_1.AsyncCreatable {
|
|
|
169
169
|
fs.unlinkSync(destFilePath);
|
|
170
170
|
}
|
|
171
171
|
catch (err) {
|
|
172
|
-
// It is normal for the file to not exist if the profile is in the
|
|
172
|
+
// It is normal for the file to not exist if the profile is in the workspace but not in the directory being packaged.
|
|
173
173
|
if (err.code !== 'ENOENT') {
|
|
174
174
|
throw err;
|
|
175
175
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/packaging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "packing libraries to Salesforce packaging platform",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"@salesforce/schemas": "^1.2.0",
|
|
41
41
|
"@salesforce/source-deploy-retrieve": "^6.2.0",
|
|
42
42
|
"@salesforce/ts-types": "^1.5.20",
|
|
43
|
+
"@xmldom/xmldom": "^0.8.2",
|
|
43
44
|
"debug": "^4.3.4",
|
|
44
45
|
"globby": "^11",
|
|
45
46
|
"js2xmlparser": "^4.0.2",
|
|
46
47
|
"jsforce": "beta",
|
|
48
|
+
"jszip": "^3.10.0",
|
|
47
49
|
"mkdirp": "1.0.4",
|
|
48
50
|
"ts-retry-promise": "^0.6.1",
|
|
49
|
-
"
|
|
50
|
-
"xml2js": "^0.4.23",
|
|
51
|
-
"xmldom-sfdx-encoding": "^0.1.30"
|
|
51
|
+
"xml2js": "^0.4.23"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@salesforce/cli-plugins-testkit": "^2.3.4",
|