@jayree/sfdx-plugin-manifest 3.0.0 → 3.0.2
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 +16 -0
- package/README.md +4 -85
- package/lib/hooks/changelog.d.ts +1 -1
- package/lib/hooks/changelog.js +7 -78
- package/lib/hooks/changelog.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +12 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [3.0.2](https://github.com/jayree/sfdx-plugin-manifest/compare/v3.0.1...v3.0.2) (2023-03-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* use new changelog ([48c4f91](https://github.com/jayree/sfdx-plugin-manifest/commit/48c4f91e096fc11407ca08180c9241caedde4afb))
|
|
7
|
+
|
|
8
|
+
## [3.0.1](https://github.com/jayree/sfdx-plugin-manifest/compare/v3.0.0...v3.0.1) (2023-03-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** bump @oclif/core from 2.4.0 to 2.6.2 ([#606](https://github.com/jayree/sfdx-plugin-manifest/issues/606)) ([9d5cd36](https://github.com/jayree/sfdx-plugin-manifest/commit/9d5cd3605fa0cd702a1fa2ef46d2069813a370c0))
|
|
14
|
+
* **deps:** bump @salesforce/kit from 1.9.0 to 1.9.2 ([#609](https://github.com/jayree/sfdx-plugin-manifest/issues/609)) ([2872e65](https://github.com/jayree/sfdx-plugin-manifest/commit/2872e65fb21053dc9b93c5466249fb28b9d33f4a))
|
|
15
|
+
* **deps:** bump @salesforce/source-deploy-retrieve from 7.11.0 to 7.11.3 ([#607](https://github.com/jayree/sfdx-plugin-manifest/issues/607)) ([8dbf910](https://github.com/jayree/sfdx-plugin-manifest/commit/8dbf91005c6a45ad9562cf05e56b4505db765983))
|
|
16
|
+
|
|
1
17
|
# [3.0.0](https://github.com/jayree/sfdx-plugin-manifest/compare/v2.9.1...v3.0.0) (2023-03-03)
|
|
2
18
|
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -17,92 +17,11 @@ sfdx plugins:install @jayree/sfdx-plugin-manifest
|
|
|
17
17
|
## Commands
|
|
18
18
|
|
|
19
19
|
<!-- commands -->
|
|
20
|
-
* [`sfdx jayree:manifest:beta:git:diff`](#sfdx-jayreemanifestbetagitdiff)
|
|
21
20
|
* [`sfdx jayree:manifest:cleanup`](#sfdx-jayreemanifestcleanup)
|
|
22
21
|
* [`sfdx jayree:manifest:generate`](#sfdx-jayreemanifestgenerate)
|
|
23
22
|
* [`sfdx jayree:manifest:git:diff`](#sfdx-jayreemanifestgitdiff)
|
|
24
23
|
* [`sfdx jayree:manifest:legacy:git:diff`](#sfdx-jayreemanifestlegacygitdiff)
|
|
25
24
|
|
|
26
|
-
### `sfdx jayree:manifest:beta:git:diff`
|
|
27
|
-
|
|
28
|
-
Create a project manifest and destructiveChanges manifest that lists the metadata components you want to deploy or delete based on changes in your git history.
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
USAGE
|
|
32
|
-
$ sfdx jayree:manifest:beta:git:diff REF1 [REF2] [--json] [--api-version <value>] [-d <value>] [--output-dir <value>]
|
|
33
|
-
[--destructive-changes-only]
|
|
34
|
-
|
|
35
|
-
ARGUMENTS
|
|
36
|
-
REF1 Base commit or branch.
|
|
37
|
-
REF2 Commit or branch to compare to the base commit.
|
|
38
|
-
|
|
39
|
-
FLAGS
|
|
40
|
-
-d, --source-dir=<value>... Path to the local source files to include in the manifest.
|
|
41
|
-
--api-version=<value> Override the api version used for api requests made by this command
|
|
42
|
-
--destructive-changes-only Create a destructiveChanges manifest only.
|
|
43
|
-
--output-dir=<value> Directory to save the created manifest files.
|
|
44
|
-
|
|
45
|
-
GLOBAL FLAGS
|
|
46
|
-
--json Format output as json.
|
|
47
|
-
|
|
48
|
-
DESCRIPTION
|
|
49
|
-
Create a project manifest and destructiveChanges manifest that lists the metadata components you want to deploy or
|
|
50
|
-
delete based on changes in your git history.
|
|
51
|
-
|
|
52
|
-
Use this command to create a manifest and destructiveChanges manifest file based on the difference (git diff) of two
|
|
53
|
-
git refs.
|
|
54
|
-
|
|
55
|
-
You can use all ways to spell <commit> which are valid for 'git diff' (See https://git-scm.com/docs/git-diff).
|
|
56
|
-
|
|
57
|
-
ALIASES
|
|
58
|
-
$ sfdx jayree:manifest:beta:git:diff
|
|
59
|
-
|
|
60
|
-
EXAMPLES
|
|
61
|
-
Uses the changes between two arbitrary <commit>.
|
|
62
|
-
|
|
63
|
-
$ sfdx jayree:manifest:beta:git:diff <commit> <commit>
|
|
64
|
-
$ sfdx jayree:manifest:beta:git:diff <commit>..<commit>
|
|
65
|
-
|
|
66
|
-
Uses the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both
|
|
67
|
-
<commit>.
|
|
68
|
-
|
|
69
|
-
$ sfdx jayree:manifest:beta:git:diff <commit>...<commit>
|
|
70
|
-
|
|
71
|
-
Uses the diff of what is unique in branchB (REF2) and unique in branchA (REF1).
|
|
72
|
-
|
|
73
|
-
$ sfdx jayree:manifest:beta:git:diff branchA..branchB
|
|
74
|
-
|
|
75
|
-
Uses the diff of what is unique in branchB (REF2).
|
|
76
|
-
|
|
77
|
-
$ sfdx jayree:manifest:beta:git:diff branchA...branchB
|
|
78
|
-
|
|
79
|
-
Specify the flags before or after the REF args
|
|
80
|
-
|
|
81
|
-
$ sfdx jayree:manifest:beta:git:diff --output-dir package <commit> <commit>
|
|
82
|
-
$ sfdx jayree:manifest:beta:git:diff <commit> <commit> --output-dir package
|
|
83
|
-
|
|
84
|
-
If you specify the 'source-dir' flag before the REF args, use '--' to separate the args from the 'source-dir'
|
|
85
|
-
values.
|
|
86
|
-
|
|
87
|
-
$ sfdx jayree:manifest:beta:git:diff --source-dir force-app -- <commit> <commit>
|
|
88
|
-
|
|
89
|
-
FLAG DESCRIPTIONS
|
|
90
|
-
-d, --source-dir=<value>... Path to the local source files to include in the manifest.
|
|
91
|
-
|
|
92
|
-
The supplied path can be to a single file (in which case the operation is applied to only one file) or to a folder
|
|
93
|
-
(in which case the operation is applied to all metadata types in the directory and its subdirectories).
|
|
94
|
-
|
|
95
|
-
You can specify this flag more than once.
|
|
96
|
-
|
|
97
|
-
--destructive-changes-only Create a destructiveChanges manifest only.
|
|
98
|
-
|
|
99
|
-
Use this flag to create a 'destructiveChanges.xml' and a blank 'package.xml'.
|
|
100
|
-
|
|
101
|
-
--output-dir=<value> Directory to save the created manifest files.
|
|
102
|
-
|
|
103
|
-
The location can be an absolute path or relative to the current working directory.
|
|
104
|
-
```
|
|
105
|
-
|
|
106
25
|
### `sfdx jayree:manifest:cleanup`
|
|
107
26
|
|
|
108
27
|
Removes those tags from a manifest file that are present in a second manifest file.
|
|
@@ -129,7 +48,7 @@ EXAMPLES
|
|
|
129
48
|
$ sfdx jayree:manifest:cleanup --manifest=package.xml --file=packageignore.xml
|
|
130
49
|
```
|
|
131
50
|
|
|
132
|
-
_See code: [src/commands/jayree/manifest/cleanup.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.
|
|
51
|
+
_See code: [src/commands/jayree/manifest/cleanup.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.2/src/commands/jayree/manifest/cleanup.ts)_
|
|
133
52
|
|
|
134
53
|
### `sfdx jayree:manifest:generate`
|
|
135
54
|
|
|
@@ -165,7 +84,7 @@ EXAMPLES
|
|
|
165
84
|
<Package xmlns='http://soap.sforce.com/2006/04/metadata'>...</Package>
|
|
166
85
|
```
|
|
167
86
|
|
|
168
|
-
_See code: [src/commands/jayree/manifest/generate.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.
|
|
87
|
+
_See code: [src/commands/jayree/manifest/generate.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.2/src/commands/jayree/manifest/generate.ts)_
|
|
169
88
|
|
|
170
89
|
### `sfdx jayree:manifest:git:diff`
|
|
171
90
|
|
|
@@ -247,7 +166,7 @@ FLAG DESCRIPTIONS
|
|
|
247
166
|
The location can be an absolute path or relative to the current working directory.
|
|
248
167
|
```
|
|
249
168
|
|
|
250
|
-
_See code: [src/commands/jayree/manifest/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.
|
|
169
|
+
_See code: [src/commands/jayree/manifest/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.2/src/commands/jayree/manifest/git/diff.ts)_
|
|
251
170
|
|
|
252
171
|
### `sfdx jayree:manifest:legacy:git:diff`
|
|
253
172
|
|
|
@@ -325,5 +244,5 @@ FLAG DESCRIPTIONS
|
|
|
325
244
|
The location can be an absolute path or relative to the current working directory.
|
|
326
245
|
```
|
|
327
246
|
|
|
328
|
-
_See code: [src/commands/jayree/manifest/legacy/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.
|
|
247
|
+
_See code: [src/commands/jayree/manifest/legacy/git/diff.ts](https://github.com/jayree/sfdx-plugin-manifest/blob/v3.0.2/src/commands/jayree/manifest/legacy/git/diff.ts)_
|
|
329
248
|
<!-- commandsstop -->
|
package/lib/hooks/changelog.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Hook } from '@oclif/core';
|
|
2
|
-
export declare const changelog: Hook<'
|
|
2
|
+
export declare const changelog: Hook<'update'>;
|
package/lib/hooks/changelog.js
CHANGED
|
@@ -7,91 +7,20 @@
|
|
|
7
7
|
/* istanbul ignore file */
|
|
8
8
|
import { join, dirname } from 'node:path';
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
|
-
import
|
|
10
|
+
import printChangeLog from '@jayree/changelog';
|
|
11
11
|
import Debug from 'debug';
|
|
12
|
-
import TerminalRenderer from 'marked-terminal';
|
|
13
|
-
import { marked } from 'marked';
|
|
14
|
-
import semver from 'semver';
|
|
15
12
|
// eslint-disable-next-line no-underscore-dangle
|
|
16
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
17
14
|
// eslint-disable-next-line no-underscore-dangle
|
|
18
15
|
const __dirname = dirname(__filename);
|
|
19
|
-
// original from https://github.com/salesforcecli/plugin-info/blob/main/src/shared/parseReleaseNotes.ts
|
|
20
|
-
const parseReleaseNotes = (notes, version, currentVersion) => {
|
|
21
|
-
let found = false;
|
|
22
|
-
let versions = [];
|
|
23
|
-
const parsed = marked.lexer(notes);
|
|
24
|
-
let tokens = [];
|
|
25
|
-
const findVersion = (desiredVersion, localVersion) => {
|
|
26
|
-
versions = [];
|
|
27
|
-
tokens = parsed.filter((token) => {
|
|
28
|
-
// TODO: Could make header depth (2) a setting in oclif.info.releasenotes
|
|
29
|
-
if (token.type === 'heading' && token.depth <= 2) {
|
|
30
|
-
const coercedVersion = semver.coerce(token.text)?.version;
|
|
31
|
-
if (coercedVersion) {
|
|
32
|
-
// We will use this to find the closest patch if passed version is not found
|
|
33
|
-
versions.push(coercedVersion);
|
|
34
|
-
if (coercedVersion <= desiredVersion && coercedVersion > localVersion) {
|
|
35
|
-
found = true;
|
|
36
|
-
return token;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
found = false;
|
|
40
|
-
}
|
|
41
|
-
else if (found === true) {
|
|
42
|
-
return token;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
findVersion(version, currentVersion);
|
|
47
|
-
if (!versions.includes(version)) {
|
|
48
|
-
const semverRange = `${semver.major(version)}.${semver.minor(version)}.x`;
|
|
49
|
-
const closestVersion = semver.maxSatisfying(versions, semverRange);
|
|
50
|
-
const warning = marked.lexer(`# ATTENTION: Version ${version} was not found. Showing notes for closest patch version ${closestVersion}.`)[0];
|
|
51
|
-
tokens.unshift(warning);
|
|
52
|
-
}
|
|
53
|
-
return tokens;
|
|
54
|
-
};
|
|
55
16
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
56
17
|
export const changelog = async function () {
|
|
57
|
-
const debug = Debug(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const cacheDir = join(this.config.cacheDir, name);
|
|
64
|
-
const versionFile = join(cacheDir, 'version');
|
|
65
|
-
fs.ensureFileSync(versionFile);
|
|
66
|
-
let latestVersion;
|
|
67
|
-
try {
|
|
68
|
-
latestVersion = fs.readJSONSync(versionFile);
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
latestVersion = { version: '0.0.0' };
|
|
72
|
-
}
|
|
73
|
-
debug({ latestVersion: latestVersion.version, version });
|
|
74
|
-
if (latestVersion.version !== version) {
|
|
75
|
-
const tokens = parseReleaseNotes(changelogFile, version, latestVersion.version);
|
|
76
|
-
if (!tokens.length) {
|
|
77
|
-
debug(`${name} - didn't find version '${version}'.`);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
marked.setOptions({
|
|
81
|
-
renderer: new TerminalRenderer({ emoji: false }),
|
|
82
|
-
});
|
|
83
|
-
tokens.unshift(marked.lexer(`# Changelog for '${name}':`)[0]);
|
|
84
|
-
this.log(marked.parser(tokens));
|
|
85
|
-
fs.writeJsonSync(versionFile, { version });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
debug(`${name} - no update`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
debug(error);
|
|
94
|
-
}
|
|
18
|
+
const debug = Debug([this.config.bin, '@jayree/sfdx-plugin-manifest', 'hooks', 'update'].join(':'));
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
20
|
+
process.once('beforeExit', async () => {
|
|
21
|
+
const changes = await printChangeLog(this.config.cacheDir, join(__dirname, '..', '..'), debug);
|
|
22
|
+
if (changes)
|
|
23
|
+
this.log(changes);
|
|
95
24
|
});
|
|
96
25
|
};
|
|
97
26
|
//# sourceMappingURL=changelog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/hooks/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,0BAA0B;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/hooks/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,0BAA0B;AAC1B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,gDAAgD;AAChD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,gDAAgD;AAChD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,SAAS,GAAmB,KAAK;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,8BAA8B,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAEpG,kEAAkE;IAClE,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE;QACpC,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;QAC/F,IAAI,OAAO;YAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jayree/sfdx-plugin-manifest",
|
|
3
3
|
"description": "A Salesforce CLI plugin containing commands for creating manifest files from Salesforce orgs or git commits of sfdx projects.",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"author": "jayree",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bugs": "https://github.com/jayree/sfdx-plugin-manifest/issues",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@
|
|
10
|
-
"@
|
|
9
|
+
"@jayree/changelog": "^1.1.0",
|
|
10
|
+
"@oclif/core": "^2.6.2",
|
|
11
|
+
"@salesforce/kit": "^1.9.2",
|
|
11
12
|
"@salesforce/sf-plugins-core": "^2.2.4",
|
|
12
|
-
"@salesforce/source-deploy-retrieve": "^7.11.
|
|
13
|
+
"@salesforce/source-deploy-retrieve": "^7.11.3",
|
|
13
14
|
"@salesforce/ts-types": "^1.7.3",
|
|
14
15
|
"debug": "^4.3.4",
|
|
15
16
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -18,14 +19,11 @@
|
|
|
18
19
|
"graceful-fs": "^4.2.10",
|
|
19
20
|
"isomorphic-git": "^1.21.0",
|
|
20
21
|
"listr2": "^5.0.7",
|
|
21
|
-
"marked": "^4.2.12",
|
|
22
|
-
"marked-terminal": "^5.1.1",
|
|
23
|
-
"semver": "^7.3.8",
|
|
24
22
|
"tslib": "^2.5.0"
|
|
25
23
|
},
|
|
26
24
|
"devDependencies": {
|
|
27
|
-
"@oclif/plugin-command-snapshot": "^3.3.
|
|
28
|
-
"@oclif/plugin-help": "^5.2.
|
|
25
|
+
"@oclif/plugin-command-snapshot": "^3.3.8",
|
|
26
|
+
"@oclif/plugin-help": "^5.2.7",
|
|
29
27
|
"@salesforce/dev-config": "^3.1.0",
|
|
30
28
|
"@salesforce/dev-scripts": "^4.1.2",
|
|
31
29
|
"@salesforce/prettier-config": "^0.0.2",
|
|
@@ -33,16 +31,13 @@
|
|
|
33
31
|
"@types/debug": "^4.1.7",
|
|
34
32
|
"@types/fs-extra": "^11.0.1",
|
|
35
33
|
"@types/inquirer": "^9.0.3",
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@types/semver": "^7.3.13",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
40
|
-
"@typescript-eslint/parser": "^5.54.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^5.54.1",
|
|
35
|
+
"@typescript-eslint/parser": "^5.54.1",
|
|
41
36
|
"c8": "^7.13.0",
|
|
42
37
|
"chai": "^4.3.7",
|
|
43
38
|
"eslint": "^8.35.0",
|
|
44
39
|
"eslint-config-oclif": "^4.0",
|
|
45
|
-
"eslint-config-prettier": "^8.
|
|
40
|
+
"eslint-config-prettier": "^8.7.0",
|
|
46
41
|
"eslint-config-salesforce": "^1.1.1",
|
|
47
42
|
"eslint-config-salesforce-license": "^0.2.0",
|
|
48
43
|
"eslint-config-salesforce-typescript": "^1.1.1",
|
|
@@ -50,7 +45,7 @@
|
|
|
50
45
|
"eslint-plugin-import": "2.27.5",
|
|
51
46
|
"eslint-plugin-jsdoc": "^40.0.1",
|
|
52
47
|
"eslint-plugin-prettier": "^4.2.1",
|
|
53
|
-
"eslint-plugin-sf-plugin": "^1.
|
|
48
|
+
"eslint-plugin-sf-plugin": "^1.11.0",
|
|
54
49
|
"husky": "^8.0.3",
|
|
55
50
|
"is-ci": "^3.0.1",
|
|
56
51
|
"mocha": "^10.2.0",
|
|
@@ -142,7 +137,7 @@
|
|
|
142
137
|
"prepack": "sf-prepack",
|
|
143
138
|
"prepare": "patch-package && sf-install",
|
|
144
139
|
"test": "wireit",
|
|
145
|
-
"version": "oclif readme"
|
|
140
|
+
"version": "oclif readme --no-aliases"
|
|
146
141
|
},
|
|
147
142
|
"publishConfig": {
|
|
148
143
|
"access": "public"
|