sfdx-git-delta 5.13.2 → 5.14.0
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 +18 -0
- package/README.md +8 -7
- package/lib/metadata/v55.json +35 -0
- package/lib/metadata/v56.json +35 -0
- package/lib/metadata/v57.json +35 -0
- package/lib/post-processor/flowTranslationProcessor.js +5 -8
- package/lib/post-processor/flowTranslationProcessor.js.map +1 -1
- package/lib/service/botHandler.js +2 -2
- package/lib/service/botHandler.js.map +1 -1
- package/lib/service/inBundleHandler.js +3 -3
- package/lib/service/inBundleHandler.js.map +1 -1
- package/lib/service/inFileHandler.d.ts +6 -14
- package/lib/service/inFileHandler.js +35 -114
- package/lib/service/inFileHandler.js.map +1 -1
- package/lib/service/inFolderHandler.js +3 -3
- package/lib/service/inFolderHandler.js.map +1 -1
- package/lib/service/inResourceHandler.js +4 -3
- package/lib/service/inResourceHandler.js.map +1 -1
- package/lib/service/standardHandler.d.ts +2 -4
- package/lib/service/standardHandler.js +10 -15
- package/lib/service/standardHandler.js.map +1 -1
- package/lib/service/waveHandler.js +4 -4
- package/lib/service/waveHandler.js.map +1 -1
- package/lib/utils/fileGitDiff.d.ts +22 -2
- package/lib/utils/fileGitDiff.js +103 -18
- package/lib/utils/fileGitDiff.js.map +1 -1
- package/lib/utils/fsHelper.d.ts +3 -0
- package/lib/utils/fsHelper.js +9 -9
- package/lib/utils/fsHelper.js.map +1 -1
- package/lib/utils/fxpHelper.d.ts +2 -12
- package/lib/utils/fxpHelper.js +17 -2
- package/lib/utils/fxpHelper.js.map +1 -1
- package/lib/utils/packageHelper.d.ts +12 -2
- package/lib/utils/packageHelper.js +13 -4
- package/lib/utils/packageHelper.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +20 -18
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
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
|
+
## [5.14.0](https://github.com/scolladon/sfdx-git-delta/compare/v5.13.3...v5.14.0) (2023-03-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add support for forecasting metadata types ([#518](https://github.com/scolladon/sfdx-git-delta/issues/518)) ([89d6aa7](https://github.com/scolladon/sfdx-git-delta/commit/89d6aa793c5aea6650e1dbffc7da7cf982379df8))
|
|
11
|
+
* implement diff detection using file content comparison ([#511](https://github.com/scolladon/sfdx-git-delta/issues/511)) ([9bf60c5](https://github.com/scolladon/sfdx-git-delta/commit/9bf60c50e30d2ba0be7f58121404c2dabd85a303))
|
|
12
|
+
|
|
13
|
+
## [5.13.3](https://github.com/scolladon/sfdx-git-delta/compare/v5.13.2...v5.13.3) (2023-02-26)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* `fsHelper.pathExist` when path does not exist ([#482](https://github.com/scolladon/sfdx-git-delta/issues/482)) ([fef6734](https://github.com/scolladon/sfdx-git-delta/commit/fef6734c947c7811d5d6995320f996fdfd329d2a))
|
|
19
|
+
* flow translation post processing ([#487](https://github.com/scolladon/sfdx-git-delta/issues/487)) ([225c435](https://github.com/scolladon/sfdx-git-delta/commit/225c4356a95fc781f4fbe938d57709a7fa795a6e))
|
|
20
|
+
* in file comparison while ignoring whitespace ([#478](https://github.com/scolladon/sfdx-git-delta/issues/478) ([0855dcc](https://github.com/scolladon/sfdx-git-delta/commit/0855dcc5bdae8cfe47788fd3201f9a44c9b2743c))
|
|
21
|
+
* typos in readme ([a3459b0](https://github.com/scolladon/sfdx-git-delta/commit/a3459b0e61cee0d270a0f4c4007316a6a6b496eb))
|
|
22
|
+
|
|
5
23
|
## [5.13.2](https://github.com/scolladon/sfdx-git-delta/compare/v5.13.1...v5.13.2) (2023-02-16)
|
|
6
24
|
|
|
7
25
|
|
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ OPTIONS
|
|
|
186
186
|
this command invocation
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v5.
|
|
189
|
+
_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v5.14.0/src/commands/sgd/source/delta.ts)_
|
|
190
190
|
<!-- commandsstop -->
|
|
191
191
|
|
|
192
192
|
### Windows users
|
|
@@ -215,7 +215,7 @@ In CI/CD pipelines, branches are not checked out locally when the repository is
|
|
|
215
215
|
If you do not specify the remote in CI context, the git pointer check will raise an error (as the branch is not created locally).
|
|
216
216
|
This applies to both `--from` and `--to` parameters as they both accept git pointers.
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
Example comparing `HEAD` with a `development` branch when the CI clone the repository with `origin` set as reference to the remote:
|
|
219
219
|
|
|
220
220
|
```sh
|
|
221
221
|
sfdx sgd:source:delta --to "HEAD" --from "origin/development" --output .
|
|
@@ -223,7 +223,7 @@ sfdx sgd:source:delta --to "HEAD" --from "origin/development" --output .
|
|
|
223
223
|
|
|
224
224
|
Use global variable when you need to easily switch sgd version (`vX.X.X` format) or channel (`stable`, `latest`, `latest-rc`) in your pipeline, without having to commit a new version of your pipeline.
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
Example with [github action](https://docs.github.com/en/actions/learn-github-actions/variables#using-the-vars-context-to-access-configuration-variable-values), [create a variable](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository) SGD_VERSION and use it in the plugin installation phase
|
|
227
227
|
|
|
228
228
|
```yaml
|
|
229
229
|
- name: Install SGD
|
|
@@ -291,7 +291,7 @@ which means:
|
|
|
291
291
|
|
|
292
292
|
> Analyze the difference between HEAD (latest commit) and HEAD~1 (previous commit), and output the result in the current folder.
|
|
293
293
|
|
|
294
|
-
The `sfdx sgd:source:delta` command produces 2
|
|
294
|
+
The `sfdx sgd:source:delta` command produces 2 useful artifacts:
|
|
295
295
|
|
|
296
296
|
**1) A `package.xml` file, inside a `package` folder.** This `package.xml` file contains just the added/changed metadata to deploy to the target org.
|
|
297
297
|
|
|
@@ -315,7 +315,7 @@ sfdx force:source:deploy -x package/package.xml --postdestructivechanges destruc
|
|
|
315
315
|
|
|
316
316
|
And voilà! 🥳
|
|
317
317
|
|
|
318
|
-
However, keep in mind
|
|
318
|
+
However, keep in mind that the above command will fail if the destructive change was supposed to be executed before the deployment (i.e. as `--predestructivechanges`), or if a warning occurs during deployment. Make sure to protect your CI/CD pipeline from those scenarios, so that it doesn't get stuck by a failed destructive change.
|
|
319
319
|
|
|
320
320
|
If needed, you can also split the added/modified metadata deployment from the deleted/renamed metadata deployment, as in the below examples:
|
|
321
321
|
|
|
@@ -363,7 +363,7 @@ _Content of the output folder when using the --generate-delta option, with the s
|
|
|
363
363
|

|
|
364
364
|
|
|
365
365
|
> ⚠️ Use `--generate-delta (-d)` when `--to (-t)` value is set to "HEAD" or to the "HEAD commit SHA".
|
|
366
|
-
> If you need to use it with `--to (-t)` pointing to another commit than "HEAD", checkout that commit first.
|
|
366
|
+
> If you need to use it with `--to (-t)` pointing to another commit than "HEAD", checkout that commit first. Example:
|
|
367
367
|
>
|
|
368
368
|
> ```sh
|
|
369
369
|
> # move HEAD to the wanted past commit
|
|
@@ -518,8 +518,9 @@ console.log(JSON.stringify(work))
|
|
|
518
518
|
- [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) - Validate XML, Parse XML to JS/JSON and vise versa, or parse XML to Nimn rapidly without C/C++ based libraries and no callback
|
|
519
519
|
- [fs-extra](https://github.com/jprichardson/node-fs-extra) - Node.js: extra methods for the fs object like copy(), remove(), mkdirs().
|
|
520
520
|
- [ignore](https://github.com/kaelzhang/node-ignore#readme) - is a manager, filter and parser which implemented in pure JavaScript according to the .gitignore spec 2.22.1.
|
|
521
|
-
- [
|
|
521
|
+
- [lodash](https://github.com/lodash/lodash) - A modern JavaScript utility library delivering modularity, performance & extras.
|
|
522
522
|
- [micromatch](https://github.com/micromatch/micromatch) - a file glob matcher utility
|
|
523
|
+
- [xmlbuilder2](https://github.com/oozcitak/xmlbuilder2) - An XML builder for node.js.
|
|
523
524
|
|
|
524
525
|
## Versioning
|
|
525
526
|
|
package/lib/metadata/v55.json
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"directoryName": "forecastingFilters",
|
|
4
|
+
"inFolder": false,
|
|
5
|
+
"metaFile": false,
|
|
6
|
+
"suffix": "forecastingFilter",
|
|
7
|
+
"xmlName": "ForecastingFilter"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"directoryName": "forecastingFilterConditions",
|
|
11
|
+
"inFolder": false,
|
|
12
|
+
"metaFile": false,
|
|
13
|
+
"suffix": "forecastingFilterCondition",
|
|
14
|
+
"xmlName": "ForecastingFilterCondition"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"directoryName": "forecastingSourceDefinitions",
|
|
18
|
+
"inFolder": false,
|
|
19
|
+
"metaFile": false,
|
|
20
|
+
"suffix": "forecastingSourceDefinition",
|
|
21
|
+
"xmlName": "ForecastingSourceDefinition"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"directoryName": "forecastingTypes",
|
|
25
|
+
"inFolder": false,
|
|
26
|
+
"metaFile": false,
|
|
27
|
+
"suffix": "forecastingType",
|
|
28
|
+
"xmlName": "ForecastingType"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"directoryName": "forecastingTypeSources",
|
|
32
|
+
"inFolder": false,
|
|
33
|
+
"metaFile": false,
|
|
34
|
+
"suffix": "forecastingTypeSource",
|
|
35
|
+
"xmlName": "ForecastingTypeSource"
|
|
36
|
+
},
|
|
2
37
|
{
|
|
3
38
|
"directoryName": "decisionMatrixDefinition",
|
|
4
39
|
"inFolder": false,
|
package/lib/metadata/v56.json
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"directoryName": "forecastingFilters",
|
|
4
|
+
"inFolder": false,
|
|
5
|
+
"metaFile": false,
|
|
6
|
+
"suffix": "forecastingFilter",
|
|
7
|
+
"xmlName": "ForecastingFilter"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"directoryName": "forecastingFilterConditions",
|
|
11
|
+
"inFolder": false,
|
|
12
|
+
"metaFile": false,
|
|
13
|
+
"suffix": "forecastingFilterCondition",
|
|
14
|
+
"xmlName": "ForecastingFilterCondition"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"directoryName": "forecastingSourceDefinitions",
|
|
18
|
+
"inFolder": false,
|
|
19
|
+
"metaFile": false,
|
|
20
|
+
"suffix": "forecastingSourceDefinition",
|
|
21
|
+
"xmlName": "ForecastingSourceDefinition"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"directoryName": "forecastingTypes",
|
|
25
|
+
"inFolder": false,
|
|
26
|
+
"metaFile": false,
|
|
27
|
+
"suffix": "forecastingType",
|
|
28
|
+
"xmlName": "ForecastingType"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"directoryName": "forecastingTypeSources",
|
|
32
|
+
"inFolder": false,
|
|
33
|
+
"metaFile": false,
|
|
34
|
+
"suffix": "forecastingTypeSource",
|
|
35
|
+
"xmlName": "ForecastingTypeSource"
|
|
36
|
+
},
|
|
2
37
|
{
|
|
3
38
|
"directoryName": "decisionMatrixDefinition",
|
|
4
39
|
"inFolder": false,
|
package/lib/metadata/v57.json
CHANGED
|
@@ -1,4 +1,39 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"directoryName": "forecastingFilters",
|
|
4
|
+
"inFolder": false,
|
|
5
|
+
"metaFile": false,
|
|
6
|
+
"suffix": "forecastingFilter",
|
|
7
|
+
"xmlName": "ForecastingFilter"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"directoryName": "forecastingFilterConditions",
|
|
11
|
+
"inFolder": false,
|
|
12
|
+
"metaFile": false,
|
|
13
|
+
"suffix": "forecastingFilterCondition",
|
|
14
|
+
"xmlName": "ForecastingFilterCondition"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"directoryName": "forecastingSourceDefinitions",
|
|
18
|
+
"inFolder": false,
|
|
19
|
+
"metaFile": false,
|
|
20
|
+
"suffix": "forecastingSourceDefinition",
|
|
21
|
+
"xmlName": "ForecastingSourceDefinition"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"directoryName": "forecastingTypes",
|
|
25
|
+
"inFolder": false,
|
|
26
|
+
"metaFile": false,
|
|
27
|
+
"suffix": "forecastingType",
|
|
28
|
+
"xmlName": "ForecastingType"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"directoryName": "forecastingTypeSources",
|
|
32
|
+
"inFolder": false,
|
|
33
|
+
"metaFile": false,
|
|
34
|
+
"suffix": "forecastingTypeSource",
|
|
35
|
+
"xmlName": "ForecastingTypeSource"
|
|
36
|
+
},
|
|
2
37
|
{
|
|
3
38
|
"directoryName": "decisionMatrixDefinition",
|
|
4
39
|
"inFolder": false,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const BaseProcessor = require('./baseProcessor');
|
|
3
3
|
const { FLOW_DIRECTORY_NAME, META_REGEX, METAFILE_SUFFIX, TRANSLATION_EXTENSION, TRANSLATION_TYPE, } = require('../utils/metadataConstants');
|
|
4
|
-
const { copyFiles, scanExtension,
|
|
4
|
+
const { copyFiles, scanExtension, isSubDir } = require('../utils/fsHelper');
|
|
5
5
|
const { parse } = require('path');
|
|
6
6
|
const { forPath } = require('../utils/ignoreHelper');
|
|
7
|
-
const {
|
|
8
|
-
const { asArray, XML_PARSER_OPTION } = require('../utils/fxpHelper');
|
|
7
|
+
const { asArray, parseXmlFileToJson } = require('../utils/fxpHelper');
|
|
9
8
|
const { fillPackageWithParameter } = require('../utils/packageHelper');
|
|
10
9
|
const getTranslationName = translationPath => parse(translationPath.replace(META_REGEX, '')).name;
|
|
11
10
|
const EXTENSION = `${TRANSLATION_EXTENSION}${METAFILE_SUFFIX}`;
|
|
@@ -20,7 +19,7 @@ class FlowTranslationProcessor extends BaseProcessor {
|
|
|
20
19
|
}
|
|
21
20
|
async _buildFlowDefinitionsMap() {
|
|
22
21
|
this.translationPaths.clear();
|
|
23
|
-
const translationsIterator = scanExtension(this.config.source, EXTENSION, this.work);
|
|
22
|
+
const translationsIterator = scanExtension(this.config.source, EXTENSION, this.work.config);
|
|
24
23
|
const ign = await this._getIgnoreInstance();
|
|
25
24
|
for await (const translationPath of translationsIterator) {
|
|
26
25
|
const translationName = getTranslationName(translationPath);
|
|
@@ -35,7 +34,7 @@ class FlowTranslationProcessor extends BaseProcessor {
|
|
|
35
34
|
const copyTranslationsPromises = [];
|
|
36
35
|
for (const translationPath of this.translationPaths.keys()) {
|
|
37
36
|
fillPackageWithParameter({
|
|
38
|
-
|
|
37
|
+
store: this.work.diffs.package,
|
|
39
38
|
type: TRANSLATION_TYPE,
|
|
40
39
|
elementName: getTranslationName(translationPath),
|
|
41
40
|
});
|
|
@@ -46,9 +45,7 @@ class FlowTranslationProcessor extends BaseProcessor {
|
|
|
46
45
|
await Promise.all(copyTranslationsPromises);
|
|
47
46
|
}
|
|
48
47
|
async _parseTranslationFile(translationPath) {
|
|
49
|
-
const
|
|
50
|
-
const xmlParser = new XMLParser(XML_PARSER_OPTION);
|
|
51
|
-
const translationJSON = xmlParser.parse(translationXML);
|
|
48
|
+
const translationJSON = await parseXmlFileToJson(translationPath, this.config);
|
|
52
49
|
const flowDefinitions = asArray(translationJSON?.Translations?.flowDefinitions);
|
|
53
50
|
flowDefinitions.forEach(flowDefinition => this._addFlowPerTranslation({
|
|
54
51
|
translationPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowTranslationProcessor.js","sourceRoot":"","sources":["../../src/post-processor/flowTranslationProcessor.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAChD,MAAM,EACJ,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,gBAAgB,GACjB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;AACzC,MAAM,
|
|
1
|
+
{"version":3,"file":"flowTranslationProcessor.js","sourceRoot":"","sources":["../../src/post-processor/flowTranslationProcessor.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;AAChD,MAAM,EACJ,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,gBAAgB,GACjB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;AACzC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAC3E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AACjC,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACpD,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACrE,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAEtE,MAAM,kBAAkB,GAAG,eAAe,CAAC,EAAE,CAC3C,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAErD,MAAM,SAAS,GAAG,GAAG,qBAAqB,GAAG,eAAe,EAAE,CAAA;AAC9D,MAAM,wBAAyB,SAAQ,aAAa;IAGlD,YAAY,IAAI,EAAE,QAAQ;QACxB,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CA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Path().dir.split(sep).pop();
|
|
22
22
|
fillPackageWithParameter({
|
|
23
|
-
|
|
23
|
+
store: this.diffs.package,
|
|
24
24
|
type: BOT_TYPE,
|
|
25
|
-
|
|
25
|
+
member: botName,
|
|
26
26
|
});
|
|
27
27
|
if (!this.config.generateDelta)
|
|
28
28
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"botHandler.js","sourceRoot":"","sources":["../../src/service/botHandler.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;AAC5C,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACtE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEtC,MAAM,QAAQ,GAAG,KAAK,CAAA;AACtB,MAAM,aAAa,GAAG,KAAK,CAAA;AAE3B,MAAM,UAAW,SAAQ,WAAW;IAClC,eAAe;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QACxC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;YAC1B,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE;YAC/B,UAAU,CAAC,IAAI;SAChB,CAAC,CAAA;QACF,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACnC,CAAC;IACD,KAAK,CAAC,cAAc;QAClB,MAAM,KAAK,CAAC,cAAc,EAAE,CAAA;QAC5B,MAAM,IAAI,CAAC,aAAa,EAAE,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QAC1D,wBAAwB,CAAC;YACvB,
|
|
1
|
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,GAAG,GAAG,GAAG,GAAG,OAAO,IAAI,aAAa,EAAE,CAAA;QAE1E,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;IACvC,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,UAAU,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const InResourceHandler = require('./inResourceHandler');
|
|
3
|
-
const StandardHandler = require('./standardHandler');
|
|
4
3
|
const { sep } = require('path');
|
|
5
4
|
const { META_REGEX } = require('../utils/metadataConstants');
|
|
5
|
+
const { cleanUpPackageMember } = require('../utils/packageHelper');
|
|
6
6
|
class BundleHandler extends InResourceHandler {
|
|
7
7
|
constructor(line, type, work, metadata) {
|
|
8
8
|
super(line, type, work, metadata);
|
|
@@ -14,8 +14,8 @@ class BundleHandler extends InResourceHandler {
|
|
|
14
14
|
const packageMember = bundlePath
|
|
15
15
|
.join(sep)
|
|
16
16
|
.replace(META_REGEX, '')
|
|
17
|
-
.replace(new RegExp(`\\.${
|
|
18
|
-
return
|
|
17
|
+
.replace(new RegExp(`\\.${this.metadata.get(this.type).suffix}$`), '');
|
|
18
|
+
return cleanUpPackageMember(packageMember);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
module.exports = BundleHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inBundleHandler.js","sourceRoot":"","sources":["../../src/service/inBundleHandler.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACxD,MAAM,
|
|
1
|
+
{"version":3,"file":"inBundleHandler.js","sourceRoot":"","sources":["../../src/service/inBundleHandler.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACxD,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;AAC5D,MAAM,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAElE,MAAM,aAAc,SAAQ,iBAAiB;IAC3C,YAAY,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ;QACpC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IACnC,CAAC;IAED,eAAe;QACb,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY;aACjC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAEd,MAAM,aAAa,GAAG,UAAU;aAC7B,IAAI,CAAC,GAAG,CAAC;aACT,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;aACvB,OAAO,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,CAAA;QAExE,OAAO,oBAAoB,CAAC,aAAa,CAAC,CAAA;IAC5C,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,aAAa,CAAA"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
export = InFileHandler;
|
|
2
2
|
declare class InFileHandler extends StandardHandler {
|
|
3
|
-
|
|
4
|
-
static _matchAllowedXmlTag(matchResult: any): any;
|
|
5
|
-
parentMetadata: any;
|
|
6
|
-
customLabelElementName: string;
|
|
3
|
+
fileGitDiff: FileGitDiff;
|
|
7
4
|
handleDeletion(): Promise<void>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_treatInFileResult(toRemove: any, toAdd: any): void;
|
|
13
|
-
_parseFile(): Promise<{
|
|
14
|
-
authorizedKeys: string[];
|
|
15
|
-
fileContent: any;
|
|
16
|
-
}>;
|
|
17
|
-
_fillPackageFromDiff(packageObject: any, subType: any, value: any): void;
|
|
5
|
+
_compareRevision(): Promise<void>;
|
|
6
|
+
_writeScopedContent(): Promise<void>;
|
|
7
|
+
_storeComparison(store: any, content: any): void;
|
|
8
|
+
_fillPackage(store: any, subType: any, fullName: any, ...args: any[]): void;
|
|
18
9
|
}
|
|
19
10
|
import StandardHandler = require("./standardHandler");
|
|
11
|
+
import FileGitDiff = require("../utils/fileGitDiff");
|
|
@@ -1,140 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
const
|
|
3
|
-
const { MINUS, PLUS } = require('../utils/gitConstants');
|
|
4
|
-
const { FULLNAME, FULLNAME_XML_TAG, LABEL_DIRECTORY_NAME, LABEL_EXTENSION, XML_TAG, XML_HEADER_TAG_END, } = require('../utils/metadataConstants');
|
|
5
|
-
const { readPathFromGit } = require('../utils/fsHelper');
|
|
2
|
+
const { LABEL_EXTENSION, LABEL_DIRECTORY_NAME, } = require('../utils/metadataConstants');
|
|
6
3
|
const StandardHandler = require('./standardHandler');
|
|
7
|
-
const {
|
|
8
|
-
const {
|
|
9
|
-
const
|
|
10
|
-
const {
|
|
11
|
-
const
|
|
12
|
-
const {
|
|
4
|
+
const { basename } = require('path');
|
|
5
|
+
const { writeFile } = require('../utils/fsHelper');
|
|
6
|
+
const FileGitDiff = require('../utils/fileGitDiff');
|
|
7
|
+
const { cleanUpPackageMember, fillPackageWithParameter, } = require('../utils/packageHelper');
|
|
8
|
+
const getRootType = line => basename(line).split('.')[0];
|
|
9
|
+
const getNamePreffix = ({ subType, line }) => subType !== LABEL_DIRECTORY_NAME ? `${getRootType(line)}.` : '';
|
|
13
10
|
class InFileHandler extends StandardHandler {
|
|
14
11
|
constructor(line, type, work, metadata) {
|
|
15
12
|
super(line, type, work, metadata);
|
|
16
|
-
this.
|
|
17
|
-
this.customLabelElementName = `${basename(this.line).split('.')[0]}.`;
|
|
18
|
-
InFileHandler.xmlObjectToPackageType =
|
|
19
|
-
InFileHandler.xmlObjectToPackageType ??
|
|
20
|
-
[...StandardHandler.metadata.keys()]
|
|
21
|
-
.filter(meta => StandardHandler.metadata.get(meta)?.xmlTag)
|
|
22
|
-
.reduce((acc, meta) => acc.set(StandardHandler.metadata.get(meta).xmlTag, StandardHandler.metadata.get(meta)), new Map());
|
|
13
|
+
this.fileGitDiff = new FileGitDiff(metadata.get(this.type)?.directoryName, this.config, metadata);
|
|
23
14
|
}
|
|
24
15
|
async handleAddition() {
|
|
25
16
|
await super.handleAddition();
|
|
26
|
-
|
|
17
|
+
await this._compareRevision();
|
|
27
18
|
if (!this.config.generateDelta)
|
|
28
19
|
return;
|
|
29
|
-
await this.
|
|
20
|
+
await this._writeScopedContent();
|
|
30
21
|
}
|
|
31
22
|
async handleDeletion() {
|
|
32
|
-
await this.
|
|
23
|
+
await this._compareRevision();
|
|
33
24
|
}
|
|
34
25
|
async handleModification() {
|
|
35
26
|
await this.handleAddition();
|
|
36
27
|
}
|
|
37
|
-
async
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const meta = asArray(metadataContent[subType]);
|
|
42
|
-
metadataContent[subType] = meta.filter(elem => toAdd
|
|
43
|
-
.get(InFileHandler.xmlObjectToPackageType.get(subType).directoryName)
|
|
44
|
-
?.has(elem.fullName));
|
|
45
|
-
});
|
|
46
|
-
const xmlBuilder = new XMLBuilder(JSON_PARSER_OPTION);
|
|
47
|
-
const xmlContent = xmlBuilder.build(result.fileContent);
|
|
48
|
-
await outputFile(join(this.config.output, treatPathSep(this.line)), xmlContent.replace(XML_HEADER_TAG_END, `${XML_HEADER_TAG_END}\n`));
|
|
49
|
-
}
|
|
50
|
-
async _handleInDiff() {
|
|
51
|
-
const data = {
|
|
52
|
-
toDel: new Map(),
|
|
53
|
-
toAdd: new Map(),
|
|
54
|
-
potentialType: null,
|
|
55
|
-
subType: null,
|
|
56
|
-
fullName: null,
|
|
57
|
-
};
|
|
58
|
-
const diffContentIterator = fileGitDiff(this.line, this.config);
|
|
59
|
-
for await (const line of diffContentIterator) {
|
|
60
|
-
this._preProcessHandleInDiff(line, data);
|
|
61
|
-
if (!data.subType || !data.fullName)
|
|
62
|
-
continue;
|
|
63
|
-
this._postProcessHandleInDiff(line, data);
|
|
64
|
-
}
|
|
65
|
-
this._treatInFileResult(data.toDel, data.toAdd);
|
|
66
|
-
return data.toAdd;
|
|
28
|
+
async _compareRevision() {
|
|
29
|
+
const { added, deleted } = await this.fileGitDiff.compare(this.line);
|
|
30
|
+
this._storeComparison(this.diffs.destructiveChanges, deleted);
|
|
31
|
+
this._storeComparison(this.diffs.package, added);
|
|
67
32
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
data.subType = `${this.parentMetadata.directoryName}.${data.potentialType}`;
|
|
72
|
-
}
|
|
73
|
-
const xmlTagMatchResult = line.match(XML_TAG);
|
|
74
|
-
if (InFileHandler._matchAllowedXmlTag(xmlTagMatchResult)) {
|
|
75
|
-
data.potentialType = xmlTagMatchResult[1];
|
|
76
|
-
data.fullName = null;
|
|
77
|
-
}
|
|
33
|
+
async _writeScopedContent() {
|
|
34
|
+
const xmlContent = this.fileGitDiff.prune();
|
|
35
|
+
await writeFile(this.line, xmlContent, this.config);
|
|
78
36
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
else if (line.startsWith(PLUS) || line.startsWith(MINUS)) {
|
|
85
|
-
tempMap = data.toAdd;
|
|
86
|
-
}
|
|
87
|
-
if (tempMap) {
|
|
88
|
-
if (!tempMap.has(data.subType)) {
|
|
89
|
-
tempMap.set(data.subType, new Set());
|
|
37
|
+
_storeComparison(store, content) {
|
|
38
|
+
for (const [type, members] of content) {
|
|
39
|
+
for (const fullName of members) {
|
|
40
|
+
this._fillPackage(store, type, fullName);
|
|
90
41
|
}
|
|
91
|
-
tempMap.get(data.subType).add(data.fullName);
|
|
92
|
-
data.subType = data.fullName = null;
|
|
93
42
|
}
|
|
94
43
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.
|
|
101
|
-
}
|
|
102
|
-
for (const [type, members] of toAdd) {
|
|
103
|
-
for (let fullName of members) {
|
|
104
|
-
this._fillPackageFromDiff(this.diffs.package, type, fullName);
|
|
44
|
+
_fillPackage(store, subType, fullName) {
|
|
45
|
+
// Call from super.handleAddition to add the Root Type
|
|
46
|
+
// InFile element are not deployable when root component is not listed in package.xml...
|
|
47
|
+
if (arguments.length === 1) {
|
|
48
|
+
if (this.type !== LABEL_EXTENSION) {
|
|
49
|
+
super._fillPackage(store);
|
|
105
50
|
}
|
|
51
|
+
return;
|
|
106
52
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.flatMap(tag => Object.keys(tag))
|
|
114
|
-
.filter(tag => InFileHandler.xmlObjectToPackageType.has(tag));
|
|
115
|
-
return {
|
|
116
|
-
authorizedKeys: authorizedKeys,
|
|
117
|
-
fileContent: result,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
_fillPackage(packageObject) {
|
|
121
|
-
if (this.type !== LABEL_EXTENSION) {
|
|
122
|
-
super._fillPackage(packageObject);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
_fillPackageFromDiff(packageObject, subType, value) {
|
|
126
|
-
const elementFullName = `${(subType !== LABEL_DIRECTORY_NAME ? this.customLabelElementName : '') +
|
|
127
|
-
value}`;
|
|
128
|
-
if (!packageObject.has(subType)) {
|
|
129
|
-
packageObject.set(subType, new Set());
|
|
130
|
-
}
|
|
131
|
-
packageObject
|
|
132
|
-
.get(subType)
|
|
133
|
-
.add(StandardHandler.cleanUpPackageMember(elementFullName));
|
|
134
|
-
}
|
|
135
|
-
static _matchAllowedXmlTag(matchResult) {
|
|
136
|
-
return (matchResult?.[1] &&
|
|
137
|
-
InFileHandler.xmlObjectToPackageType.has(matchResult?.[1]));
|
|
53
|
+
const member = cleanUpPackageMember(`${getNamePreffix({ subType, line: this.line })}${fullName}`);
|
|
54
|
+
fillPackageWithParameter({
|
|
55
|
+
store,
|
|
56
|
+
type: subType,
|
|
57
|
+
member,
|
|
58
|
+
});
|
|
138
59
|
}
|
|
139
60
|
}
|
|
140
61
|
module.exports = InFileHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inFileHandler.js","sourceRoot":"","sources":["../../src/service/inFileHandler.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"inFileHandler.js","sourceRoot":"","sources":["../../src/service/inFileHandler.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,EACJ,eAAe,EACf,oBAAoB,GACrB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;AACzC,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACpD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AACpC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAClD,MAAM,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACnD,MAAM,EACJ,oBAAoB,EACpB,wBAAwB,GACzB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAErC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AACxD,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAC3C,OAAO,KAAK,oBAAoB,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,IAA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EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IACrD,CAAC;IAED,gBAAgB,CAAC,KAAK,EAAE,OAAO;QAC7B,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,OAAO,EAAE;YACrC,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE;gBAC9B,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;aACzC;SACF;IACH,CAAC;IAED,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ;QACnC,sDAAsD;QACtD,wFAAwF;QACxF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1B,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,EAAE;gBACjC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;aAC1B;YACD,OAAM;SACP;QAED,MAAM,MAAM,GAAG,oBAAoB,CACjC,GAAG,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,CAC7D,CAAA;QAED,wBAAwB,CAAC;YACvB,KAAK;YACL,IAAI,EAAE,OAAO;YACb,MAAM;SACP,CAAC,CAAA;IACJ,CAAC;CACF;AAED,MAAM,CAAC,OAAO,GAAG,aAAa,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const StandardHandler = require('./standardHandler');
|
|
3
3
|
const { INFOLDER_SUFFIX, META_REGEX, METAFILE_SUFFIX, } = require('../utils/metadataConstants');
|
|
4
|
+
const { cleanUpPackageMember } = require('../utils/packageHelper');
|
|
4
5
|
const { join, parse, sep } = require('path');
|
|
5
6
|
const { readDir } = require('../utils/fsHelper');
|
|
6
7
|
const INFOLDER_SUFFIX_REGEX = new RegExp(`${INFOLDER_SUFFIX}$`);
|
|
@@ -15,8 +16,7 @@ class InFolderHandler extends StandardHandler {
|
|
|
15
16
|
}
|
|
16
17
|
async _copyFolderMetaFile() {
|
|
17
18
|
const [, folderPath, folderName] = this._parseLine();
|
|
18
|
-
const folderFileName = `${folderName}.${
|
|
19
|
-
METAFILE_SUFFIX}`;
|
|
19
|
+
const folderFileName = `${folderName}.${this.metadata.get(this.type).suffix.toLowerCase() + METAFILE_SUFFIX}`;
|
|
20
20
|
await this._copyWithMetaFile(join(folderPath, folderFileName));
|
|
21
21
|
}
|
|
22
22
|
async _copySpecialExtension() {
|
|
@@ -33,7 +33,7 @@ class InFolderHandler extends StandardHandler {
|
|
|
33
33
|
.replace(META_REGEX, '')
|
|
34
34
|
.replace(INFOLDER_SUFFIX_REGEX, '')
|
|
35
35
|
.replace(EXTENSION_SUFFIX_REGEX, '');
|
|
36
|
-
return
|
|
36
|
+
return cleanUpPackageMember(packageMember);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
module.exports = InFolderHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inFolderHandler.js","sourceRoot":"","sources":["../../src/service/inFolderHandler.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACpD,MAAM,EACJ,eAAe,EACf,UAAU,EACV,eAAe,GAChB,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;AACzC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAEhD,MAAM,qBAAqB,GAAG,IAAI,MAAM,CAAC,GAAG,eAAe,GAAG,CAAC,CAAA;AAC/D,MAAM,sBAAsB,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAA;AACtD,MAAM,eAAgB,SAAQ,eAAe;IAC3C,KAAK,CAAC,cAAc;QAClB,MAAM,KAAK,CAAC,cAAc,EA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AAe,CAAA"}
|
|
@@ -3,6 +3,7 @@ const StandardHandler = require('./standardHandler');
|
|
|
3
3
|
const { join, parse } = require('path');
|
|
4
4
|
const { pathExists, readDir } = require('../utils/fsHelper');
|
|
5
5
|
const { META_REGEX, METAFILE_SUFFIX } = require('../utils/metadataConstants');
|
|
6
|
+
const { cleanUpPackageMember } = require('../utils/packageHelper');
|
|
6
7
|
const STATICRESOURCE_TYPE = 'staticresources';
|
|
7
8
|
const elementSrc = new Map();
|
|
8
9
|
class ResourceHandler extends StandardHandler {
|
|
@@ -35,7 +36,7 @@ class ResourceHandler extends StandardHandler {
|
|
|
35
36
|
}
|
|
36
37
|
_getElementName() {
|
|
37
38
|
const parsedPath = this._getParsedPath();
|
|
38
|
-
return
|
|
39
|
+
return cleanUpPackageMember(parsedPath.name);
|
|
39
40
|
}
|
|
40
41
|
_getParsedPath() {
|
|
41
42
|
return parse(this.splittedLine[this.splittedLine.indexOf(this.type) + 1]
|
|
@@ -45,8 +46,8 @@ class ResourceHandler extends StandardHandler {
|
|
|
45
46
|
_buildMatchingFiles(elementName) {
|
|
46
47
|
const parsedElementName = parse(elementName).name;
|
|
47
48
|
const matchingFiles = [parsedElementName];
|
|
48
|
-
if (
|
|
49
|
-
matchingFiles.push(`${parsedElementName}.${
|
|
49
|
+
if (this.metadata.get(this.type).metaFile) {
|
|
50
|
+
matchingFiles.push(`${parsedElementName}.${this.metadata.get(this.type).suffix}${METAFILE_SUFFIX}`);
|
|
50
51
|
}
|
|
51
52
|
return matchingFiles;
|
|
52
53
|
}
|