@jayree/sfdx-plugin-manifest 3.0.1 → 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 +7 -0
 - package/README.md +4 -4
 - 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 +2 -7
 
    
        package/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,10 @@ 
     | 
|
| 
      
 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 
     | 
    
         
            +
             
     | 
| 
       1 
8 
     | 
    
         
             
            ## [3.0.1](https://github.com/jayree/sfdx-plugin-manifest/compare/v3.0.0...v3.0.1) (2023-03-10)
         
     | 
| 
       2 
9 
     | 
    
         | 
| 
       3 
10 
     | 
    
         | 
    
        package/README.md
    CHANGED
    
    | 
         @@ -48,7 +48,7 @@ EXAMPLES 
     | 
|
| 
       48 
48 
     | 
    
         
             
              $ sfdx jayree:manifest:cleanup --manifest=package.xml --file=packageignore.xml
         
     | 
| 
       49 
49 
     | 
    
         
             
            ```
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
            _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)_
         
     | 
| 
       52 
52 
     | 
    
         | 
| 
       53 
53 
     | 
    
         
             
            ### `sfdx jayree:manifest:generate`
         
     | 
| 
       54 
54 
     | 
    
         | 
| 
         @@ -84,7 +84,7 @@ EXAMPLES 
     | 
|
| 
       84 
84 
     | 
    
         
             
              <Package xmlns='http://soap.sforce.com/2006/04/metadata'>...</Package>
         
     | 
| 
       85 
85 
     | 
    
         
             
            ```
         
     | 
| 
       86 
86 
     | 
    
         | 
| 
       87 
     | 
    
         
            -
            _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)_
         
     | 
| 
       88 
88 
     | 
    
         | 
| 
       89 
89 
     | 
    
         
             
            ### `sfdx jayree:manifest:git:diff`
         
     | 
| 
       90 
90 
     | 
    
         | 
| 
         @@ -166,7 +166,7 @@ FLAG DESCRIPTIONS 
     | 
|
| 
       166 
166 
     | 
    
         
             
                The location can be an absolute path or relative to the current working directory.
         
     | 
| 
       167 
167 
     | 
    
         
             
            ```
         
     | 
| 
       168 
168 
     | 
    
         | 
| 
       169 
     | 
    
         
            -
            _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)_
         
     | 
| 
       170 
170 
     | 
    
         | 
| 
       171 
171 
     | 
    
         
             
            ### `sfdx jayree:manifest:legacy:git:diff`
         
     | 
| 
       172 
172 
     | 
    
         | 
| 
         @@ -244,5 +244,5 @@ FLAG DESCRIPTIONS 
     | 
|
| 
       244 
244 
     | 
    
         
             
                The location can be an absolute path or relative to the current working directory.
         
     | 
| 
       245 
245 
     | 
    
         
             
            ```
         
     | 
| 
       246 
246 
     | 
    
         | 
| 
       247 
     | 
    
         
            -
            _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)_
         
     | 
| 
       248 
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,11 +1,12 @@ 
     | 
|
| 
       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 
     | 
    
         
            +
                "@jayree/changelog": "^1.1.0",
         
     | 
| 
       9 
10 
     | 
    
         
             
                "@oclif/core": "^2.6.2",
         
     | 
| 
       10 
11 
     | 
    
         
             
                "@salesforce/kit": "^1.9.2",
         
     | 
| 
       11 
12 
     | 
    
         
             
                "@salesforce/sf-plugins-core": "^2.2.4",
         
     | 
| 
         @@ -18,9 +19,6 @@ 
     | 
|
| 
       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": {
         
     | 
| 
         @@ -33,9 +31,6 @@ 
     | 
|
| 
       33 
31 
     | 
    
         
             
                "@types/debug": "^4.1.7",
         
     | 
| 
       34 
32 
     | 
    
         
             
                "@types/fs-extra": "^11.0.1",
         
     | 
| 
       35 
33 
     | 
    
         
             
                "@types/inquirer": "^9.0.3",
         
     | 
| 
       36 
     | 
    
         
            -
                "@types/marked": "^4.0.8",
         
     | 
| 
       37 
     | 
    
         
            -
                "@types/marked-terminal": "^3.1.3",
         
     | 
| 
       38 
     | 
    
         
            -
                "@types/semver": "^7.3.13",
         
     | 
| 
       39 
34 
     | 
    
         
             
                "@typescript-eslint/eslint-plugin": "^5.54.1",
         
     | 
| 
       40 
35 
     | 
    
         
             
                "@typescript-eslint/parser": "^5.54.1",
         
     | 
| 
       41 
36 
     | 
    
         
             
                "c8": "^7.13.0",
         
     |