@pega/custom-dx-components 0.25.25 → 0.25.27
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/package.json +1 -1
- package/src/constants.js +2 -0
- package/src/tasks/create-lib/index.js +89 -1
- package/src/tasks/create-version/index.js +68 -21
- package/src/tasks/delete-lib/index.js +43 -15
- package/src/tasks/delete-version/index.js +37 -9
- package/src/tasks/import-archive/index.js +144 -102
- package/src/tasks/import-comp/index.js +33 -14
- package/src/tasks/init/template/package.json.mustache +2 -7
- package/src/tasks/publish/index.js +37 -11
- package/src/tasks/set-perm/index.js +15 -2
- package/src/tasks/switch-lib/index.js +89 -36
- package/src/tasks/switch-version/index.js +74 -14
- package/src/util.js +77 -4
- package/src/tasks/init/template/scripts/components.json +0 -3
- package/src/tasks/init/template/scripts/esbuild.dev.js +0 -34
- package/src/tasks/init/template/scripts/index.mustache +0 -26
- package/src/tasks/init/template/scripts/index.ts +0 -1
- package/src/tasks/init/template/scripts/main.js +0 -75
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
checkAccessTokenExpiration,
|
|
21
21
|
getConfigDefaults,
|
|
22
22
|
getLibraryBased,
|
|
23
|
+
getLibraryBasedCL,
|
|
23
24
|
unZipFromArchive,
|
|
24
25
|
zipVersionAndArchive,
|
|
25
26
|
getLibraryArchiveDirectories,
|
|
@@ -28,7 +29,8 @@ import {
|
|
|
28
29
|
hasArchives,
|
|
29
30
|
restoreFromArchive,
|
|
30
31
|
forceDefaultsUpdate,
|
|
31
|
-
|
|
32
|
+
getUseInputConfig,
|
|
33
|
+
getInputConfigForCommand
|
|
32
34
|
} from '../../util.js';
|
|
33
35
|
import { TASKS_CONFIG_JSON_FILENAME, ARCHIVES_PATH, TEMP_PATH } from '../../constants.js';
|
|
34
36
|
import { getFilePathQuestions, getFileNameQuestions, updateTempArchive, updateSavedFilePath, getServerOrDirectoryQuestion, getLibraryArchiveQuestion, getServerLibraryArchives, getServerLibraryArchive } from './helper.js';
|
|
@@ -646,6 +648,7 @@ export default async options => {
|
|
|
646
648
|
await checkPathAccess(pegaConfigJsonPath);
|
|
647
649
|
const isLibraryBased = getLibraryBased();
|
|
648
650
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
651
|
+
const useInputConfig = getUseInputConfig();
|
|
649
652
|
|
|
650
653
|
if (!isLibraryBased) {
|
|
651
654
|
console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`)
|
|
@@ -669,150 +672,187 @@ export default async options => {
|
|
|
669
672
|
}
|
|
670
673
|
else {
|
|
671
674
|
|
|
672
|
-
|
|
675
|
+
if (useInputConfig) {
|
|
676
|
+
const inputConfig = await getInputConfigForCommand("importLibVersion");
|
|
677
|
+
const filePath = inputConfig.fileLocation;
|
|
678
|
+
const fileName = inputConfig.fileName;
|
|
673
679
|
|
|
674
|
-
let importFrom = "Directory";
|
|
675
680
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
const
|
|
679
|
-
|
|
681
|
+
console.log("");
|
|
682
|
+
|
|
683
|
+
const tasks = new Listr(
|
|
684
|
+
[
|
|
685
|
+
{
|
|
686
|
+
title: `Importing archive`,
|
|
687
|
+
task: async () => {
|
|
688
|
+
await importArch( filePath, fileName, hasArch);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
{ concurrent: false, exitOnError: true }
|
|
693
|
+
);
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
await tasks.run().catch(err => {
|
|
697
|
+
console.log(chalk.bold.red(err.toString()));
|
|
698
|
+
process.exit(1);
|
|
699
|
+
});
|
|
700
|
+
|
|
701
|
+
console.log("");
|
|
702
|
+
|
|
703
|
+
// reapply to save if changed, because imported task.config may have overriden and we want
|
|
704
|
+
// to keep what was entered as the latest
|
|
705
|
+
await updateSavedFilePath(filePath);
|
|
706
|
+
|
|
680
707
|
}
|
|
681
708
|
else {
|
|
682
|
-
|
|
683
|
-
}
|
|
709
|
+
inquirer.registerPrompt('fuzzypath', inquirerFuzzyPath);
|
|
684
710
|
|
|
685
|
-
|
|
686
|
-
await checkAccessTokenExpiration();
|
|
711
|
+
let importFrom = "Directory";
|
|
687
712
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
713
|
+
if (isLibraryBasedCL) {
|
|
714
|
+
const localOrServerQuestion = await getServerOrDirectoryQuestion();
|
|
715
|
+
const localOrServerAnswer = await inquirer.prompt(localOrServerQuestion);
|
|
716
|
+
({importFrom} = localOrServerAnswer);
|
|
691
717
|
}
|
|
692
|
-
|
|
693
|
-
|
|
718
|
+
else {
|
|
719
|
+
importFrom = "Directory";
|
|
694
720
|
}
|
|
695
721
|
|
|
722
|
+
if (importFrom === "Server") {
|
|
723
|
+
await checkAccessTokenExpiration();
|
|
696
724
|
|
|
697
|
-
|
|
698
|
-
|
|
725
|
+
let archiveVersions = [];
|
|
726
|
+
try {
|
|
727
|
+
archiveVersions = await getServerLibraryArchives();
|
|
728
|
+
}
|
|
729
|
+
catch (ex) {
|
|
730
|
+
console.log(chalk.redBright(ex));
|
|
731
|
+
}
|
|
699
732
|
|
|
700
|
-
// to name value pairs
|
|
701
|
-
const archiveResults = archiveVersions["pxResults"].map( archive => ( { value: `${archive.pyApplicationName},${archive.pyFileName},${archive.pyFileType},${archive.pyRuleSet},${archive.pyRuleSetVersion}`, name: `${archive.pyLabel}, ${archive.pyRuleSet}:${archive.pyRuleSetVersion}` }) );
|
|
702
733
|
|
|
734
|
+
if (archiveVersions && archiveVersions.pxResults.length > 0) {
|
|
735
|
+
// ALL option
|
|
703
736
|
|
|
704
|
-
|
|
705
|
-
|
|
737
|
+
// to name value pairs
|
|
738
|
+
const archiveResults = archiveVersions["pxResults"].map( archive => ( { value: `${archive.pyApplicationName},${archive.pyFileName},${archive.pyFileType},${archive.pyRuleSet},${archive.pyRuleSetVersion}`, name: `${archive.pyLabel}, ${archive.pyRuleSet}:${archive.pyRuleSetVersion}` }) );
|
|
706
739
|
|
|
707
|
-
const {archiveData} = versionAnswers;
|
|
708
740
|
|
|
709
|
-
|
|
741
|
+
const versionQuestions = await getLibraryArchiveQuestion(archiveResults);
|
|
742
|
+
const versionAnswers = await inquirer.prompt(versionQuestions);
|
|
710
743
|
|
|
711
|
-
const
|
|
712
|
-
let fileName = `${arArchData[1]}.${arArchData[2]}`;
|
|
713
|
-
let fileData;
|
|
744
|
+
const {archiveData} = versionAnswers;
|
|
714
745
|
|
|
715
|
-
|
|
746
|
+
if (archiveData != "") {
|
|
716
747
|
|
|
717
|
-
|
|
718
|
-
[
|
|
719
|
-
|
|
720
|
-
title: 'Fetching archive from server',
|
|
721
|
-
task: async () => {
|
|
722
|
-
// get archive
|
|
723
|
-
fileData = await getServerLibraryArchive(arArchData[0],arArchData[1], arArchData[2], arArchData[3], arArchData[4]);
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
{
|
|
727
|
-
title: 'Saving archive in store',
|
|
728
|
-
task: async () => {
|
|
729
|
-
await writeZipBuffer(fileName, fileData.pyFileSource);
|
|
748
|
+
const arArchData = archiveData.split(",");
|
|
749
|
+
let fileName = `${arArchData[1]}.${arArchData[2]}`;
|
|
750
|
+
let fileData;
|
|
730
751
|
|
|
731
|
-
|
|
732
|
-
const currentDirectory = process.cwd();
|
|
733
|
-
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
752
|
+
console.log("");
|
|
734
753
|
|
|
735
|
-
|
|
754
|
+
const tasks = new Listr(
|
|
755
|
+
[
|
|
756
|
+
{
|
|
757
|
+
title: 'Fetching archive from server',
|
|
758
|
+
task: async () => {
|
|
759
|
+
// get archive
|
|
760
|
+
fileData = await getServerLibraryArchive(arArchData[0],arArchData[1], arArchData[2], arArchData[3], arArchData[4]);
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
title: 'Saving archive in store',
|
|
765
|
+
task: async () => {
|
|
766
|
+
await writeZipBuffer(fileName, fileData.pyFileSource);
|
|
767
|
+
|
|
768
|
+
// import archive
|
|
769
|
+
const currentDirectory = process.cwd();
|
|
770
|
+
const tempDirectory = join(currentDirectory, TEMP_PATH);
|
|
771
|
+
|
|
772
|
+
await importArchServer( tempDirectory, fileName, hasArch);
|
|
773
|
+
}
|
|
736
774
|
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
);
|
|
775
|
+
],
|
|
776
|
+
{ concurrent: false, exitOnError: true }
|
|
777
|
+
);
|
|
741
778
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
779
|
+
await tasks.run().catch(err => {
|
|
780
|
+
console.log(chalk.bold.red(err.toString()));
|
|
781
|
+
process.exit(1);
|
|
782
|
+
});
|
|
783
|
+
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
// No library with that name
|
|
789
|
+
console.log(chalk.redBright(`No library archives exist on server.`));
|
|
790
|
+
process.exit(1);
|
|
746
791
|
|
|
747
792
|
}
|
|
748
793
|
|
|
749
794
|
}
|
|
750
795
|
else {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
796
|
+
let filePathQuestions;
|
|
797
|
+
try {
|
|
798
|
+
filePathQuestions = await getFilePathQuestions();
|
|
799
|
+
}
|
|
800
|
+
catch (ex) {
|
|
801
|
+
process.exit(1);
|
|
802
|
+
}
|
|
754
803
|
|
|
755
|
-
}
|
|
756
804
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
process.exit(1);
|
|
765
|
-
}
|
|
805
|
+
let filePathAnswers;
|
|
806
|
+
try {
|
|
807
|
+
filePathAnswers = await inquirer.prompt(filePathQuestions);
|
|
808
|
+
}
|
|
809
|
+
catch(ex) {
|
|
810
|
+
process.exit(1);
|
|
811
|
+
}
|
|
766
812
|
|
|
813
|
+
const { filePath } = filePathAnswers;
|
|
814
|
+
const zipFileList = await getZipFileList(filePath);
|
|
767
815
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
catch(ex) {
|
|
773
|
-
process.exit(1);
|
|
774
|
-
}
|
|
816
|
+
if (!zipFileList || zipFileList.length === 0) {
|
|
817
|
+
console.log(chalk.red.bold(`No zip files exist at path: ${filePath}`));
|
|
818
|
+
process.exit();
|
|
819
|
+
}
|
|
775
820
|
|
|
776
|
-
|
|
777
|
-
const zipFileList = await getZipFileList(filePath);
|
|
821
|
+
await updateSavedFilePath(filePath);
|
|
778
822
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
823
|
+
const fileNameQuestions = await getFileNameQuestions(zipFileList);
|
|
824
|
+
const fileNameAnswers = await inquirer.prompt(fileNameQuestions);
|
|
825
|
+
const {fileName} = fileNameAnswers;
|
|
783
826
|
|
|
784
|
-
await updateSavedFilePath(filePath);
|
|
785
827
|
|
|
786
|
-
const fileNameQuestions = await getFileNameQuestions(zipFileList);
|
|
787
|
-
const fileNameAnswers = await inquirer.prompt(fileNameQuestions);
|
|
788
|
-
const {fileName} = fileNameAnswers;
|
|
789
828
|
|
|
790
|
-
|
|
829
|
+
console.log("");
|
|
791
830
|
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
831
|
+
const tasks = new Listr(
|
|
832
|
+
[
|
|
833
|
+
{
|
|
834
|
+
title: `Importing archive`,
|
|
835
|
+
task: async () => {
|
|
836
|
+
await importArch( filePath, fileName, hasArch);
|
|
837
|
+
}
|
|
798
838
|
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
);
|
|
839
|
+
],
|
|
840
|
+
{ concurrent: false, exitOnError: true }
|
|
841
|
+
);
|
|
803
842
|
|
|
804
843
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
844
|
+
await tasks.run().catch(err => {
|
|
845
|
+
console.log(chalk.bold.red(err.toString()));
|
|
846
|
+
process.exit(1);
|
|
847
|
+
});
|
|
809
848
|
|
|
810
|
-
|
|
849
|
+
console.log("");
|
|
811
850
|
|
|
812
851
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
852
|
+
// reapply to save if changed, because imported task.config may have overriden and we want
|
|
853
|
+
// to keep what was entered as the latest
|
|
854
|
+
await updateSavedFilePath(filePath);
|
|
855
|
+
}
|
|
816
856
|
}
|
|
817
857
|
|
|
818
858
|
|
|
@@ -820,6 +860,8 @@ export default async options => {
|
|
|
820
860
|
|
|
821
861
|
|
|
822
862
|
|
|
863
|
+
|
|
864
|
+
|
|
823
865
|
}
|
|
824
866
|
|
|
825
867
|
addDebugLog("importArchive", "END", "-");
|
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
addDebugLog,
|
|
15
15
|
checkLibraryAndArchives,
|
|
16
16
|
getConfigDefaults,
|
|
17
|
-
getComponents
|
|
17
|
+
getComponents,
|
|
18
|
+
getUseInputConfig,
|
|
19
|
+
getInputConfigForCommand,
|
|
20
|
+
convertYNToBoolean
|
|
18
21
|
} from '../../util.js';
|
|
19
22
|
import { TASKS_CONFIG_JSON_FILENAME } from '../../constants.js';
|
|
20
23
|
import { getFilePathQuestions, getFileNameQuestions, updateSavedFilePath } from './helper.js';
|
|
@@ -322,6 +325,7 @@ export default async options => {
|
|
|
322
325
|
await showVersion();
|
|
323
326
|
await checkLibraryAndArchives();
|
|
324
327
|
await checkPathAccess(pegaConfigJsonPath);
|
|
328
|
+
const useInputConfig = getUseInputConfig();
|
|
325
329
|
|
|
326
330
|
addDebugLog("importComponent", "", "+");
|
|
327
331
|
|
|
@@ -342,26 +346,41 @@ addDebugLog("importComponent", "", "+");
|
|
|
342
346
|
}
|
|
343
347
|
else {
|
|
344
348
|
|
|
345
|
-
|
|
349
|
+
let filePath;
|
|
350
|
+
let fileName;
|
|
346
351
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
352
|
+
if (useInputConfig) {
|
|
353
|
+
const inputConfig = await getInputConfigForCommand("importComponent");
|
|
354
|
+
filePath = inputConfig.fileLocation;
|
|
355
|
+
fileName = inputConfig.fileName;
|
|
350
356
|
|
|
351
|
-
|
|
357
|
+
await importComp( filePath, fileName, false);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
inquirer.registerPrompt('fuzzypath', inquirerFuzzyPath);
|
|
361
|
+
|
|
362
|
+
const filePathQuestions = await getFilePathQuestions();
|
|
363
|
+
const filePathAnswers = await inquirer.prompt(filePathQuestions);
|
|
364
|
+
const { filePath } = filePathAnswers;
|
|
365
|
+
|
|
366
|
+
const compFileList = await getComponentList(filePath);
|
|
367
|
+
|
|
368
|
+
if (!compFileList || compFileList.length === 0) {
|
|
369
|
+
console.log(chalk.red.bold(`No component files exist at path: ${filePath}`));
|
|
370
|
+
process.exit();
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
await updateSavedFilePath(filePath);
|
|
374
|
+
|
|
375
|
+
const fileNameQuestions = await getFileNameQuestions(compFileList);
|
|
376
|
+
const fileNameAnswers = await inquirer.prompt(fileNameQuestions);
|
|
377
|
+
const {fileName} = fileNameAnswers;
|
|
352
378
|
|
|
353
|
-
|
|
354
|
-
console.log(chalk.red.bold(`No component files exist at path: ${filePath}`));
|
|
355
|
-
process.exit();
|
|
379
|
+
await importComp( filePath, fileName, true);
|
|
356
380
|
}
|
|
357
381
|
|
|
358
|
-
await updateSavedFilePath(filePath);
|
|
359
382
|
|
|
360
|
-
const fileNameQuestions = await getFileNameQuestions(compFileList);
|
|
361
|
-
const fileNameAnswers = await inquirer.prompt(fileNameQuestions);
|
|
362
|
-
const {fileName} = fileNameAnswers;
|
|
363
383
|
|
|
364
|
-
await importComp( filePath, fileName, true);
|
|
365
384
|
|
|
366
385
|
}
|
|
367
386
|
|
|
@@ -49,10 +49,6 @@
|
|
|
49
49
|
"exportLibVersion": "custom-dx-components exportArchive",
|
|
50
50
|
"validate": "custom-dx-components buildComponent",
|
|
51
51
|
"validateAll": "custom-dx-components buildAllComponents",
|
|
52
|
-
"_***Local component server***": "Commands to lauch local component server for debugging of run time",
|
|
53
|
-
"localDev": "node scripts/esbuild.dev.js",
|
|
54
|
-
"localGenerate": "node scripts/main.js",
|
|
55
|
-
"localStart": "npm run localGenerate && npm run localDev",
|
|
56
52
|
"_***Internal_only***": "Internal usage only",
|
|
57
53
|
"_internal-test-coverage": "node --input-type=module --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand node_modules/@pega/custom-dx-component --ci --testResultsProcessor='jest-junit' --coverage",
|
|
58
54
|
"_internal-test": "echo 'Running functional and unit tests will DELETE existing local components, proceed (y/n)?' && read proceed && if test \"$proceed\" = \"y\"; then npm run _internal-test-full; fi ",
|
|
@@ -111,7 +107,7 @@
|
|
|
111
107
|
"@babel/preset-react": "^7.26.3",
|
|
112
108
|
"@babel/preset-typescript": "^7.26.0",
|
|
113
109
|
"@pega/configs": "^0.16.2",
|
|
114
|
-
"@pega/custom-dx-components": "~0.25.
|
|
110
|
+
"@pega/custom-dx-components": "~0.25.27",
|
|
115
111
|
"@pega/pcore-pconnect-typedefs": "^4.1.0-alpha.1",
|
|
116
112
|
"@storybook/addon-actions": "^7.6.19",
|
|
117
113
|
"@storybook/addon-essentials": "^7.6.19",
|
|
@@ -157,7 +153,6 @@
|
|
|
157
153
|
"storybook": "^7.6.19",
|
|
158
154
|
"stylelint": "^16.10.0",
|
|
159
155
|
"ts-jest": "^29.2.5",
|
|
160
|
-
"typescript": "~5.5.4"
|
|
161
|
-
"esbuild": "^0.25.0"
|
|
156
|
+
"typescript": "~5.5.4"
|
|
162
157
|
}
|
|
163
158
|
}
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
getPegaServerConfig,
|
|
12
12
|
showVersion,
|
|
13
13
|
getLibraryBased,
|
|
14
|
+
getLibraryBasedCL,
|
|
15
|
+
getUseInputConfig,
|
|
14
16
|
addDebugLog,
|
|
15
17
|
updateServerConfigRuleSetAndVersion,
|
|
16
18
|
checkLibraryAndArchives,
|
|
@@ -18,7 +20,7 @@ import {
|
|
|
18
20
|
checkAccessTokenExpiration,
|
|
19
21
|
checkJWTExpiration,
|
|
20
22
|
getConfigDefaults,
|
|
21
|
-
|
|
23
|
+
getInputConfigForCommand } from '../../util.js';
|
|
22
24
|
|
|
23
25
|
import { getPublishComponentQuestions, publishComponentToServer, zipComponent } from './helper.js';
|
|
24
26
|
import { default as buildLibrary } from '../build-lib/index.js';
|
|
@@ -34,6 +36,8 @@ export default async options => {
|
|
|
34
36
|
await checkLibraryAndArchives();
|
|
35
37
|
const isLibraryBased = getLibraryBased();
|
|
36
38
|
const isLibraryBasedCL = getLibraryBasedCL();
|
|
39
|
+
const useInputConfig = getUseInputConfig();
|
|
40
|
+
|
|
37
41
|
|
|
38
42
|
addDebugLog("publish", "", "+");
|
|
39
43
|
|
|
@@ -59,23 +63,42 @@ addDebugLog("publish", "", "+");
|
|
|
59
63
|
console.log();
|
|
60
64
|
console.log(`Publishing to server: ${chalk.green.bold(`${serverConfg.server}`)}`);
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
if (useInputConfig) {
|
|
67
|
+
const inputConfig = await getInputConfigForCommand("publish");
|
|
68
|
+
|
|
69
|
+
// console.log("Input config: ");
|
|
70
|
+
// console.log(inputConfig);
|
|
71
|
+
|
|
72
|
+
if (inputConfig.okToPublish ) {
|
|
73
|
+
if (devBuild || (!devBuild && inputConfig.okToPublishPermanent)) {
|
|
74
|
+
okToPublish = true;
|
|
75
|
+
}
|
|
76
|
+
|
|
68
77
|
}
|
|
69
|
-
]);
|
|
70
78
|
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
|
|
80
|
+
options.params.push(inputConfig.ruleSetName);
|
|
81
|
+
options.params.push(inputConfig.ruleSetVersion);
|
|
82
|
+
|
|
73
83
|
}
|
|
84
|
+
else {
|
|
85
|
+
const publishThisVersion = await inquirer.prompt([
|
|
86
|
+
{
|
|
87
|
+
name: 'confirmPublish',
|
|
88
|
+
type: 'confirm',
|
|
89
|
+
message: `Publish ${chalk.bold.green(`${orgLib.displayLibVersion}`)}, proceed ?`,
|
|
90
|
+
default: true
|
|
91
|
+
}
|
|
92
|
+
]);
|
|
74
93
|
|
|
94
|
+
if (publishThisVersion.confirmPublish) {
|
|
95
|
+
okToPublish = true;
|
|
96
|
+
}
|
|
75
97
|
|
|
98
|
+
}
|
|
76
99
|
|
|
77
100
|
if (okToPublish) {
|
|
78
|
-
if (options.params.length >= 8) {
|
|
101
|
+
if (options.params.length >= 8 || useInputConfig) {
|
|
79
102
|
// const rulesetName = options.params[3];
|
|
80
103
|
// const rulesetVersion = options.params[4]
|
|
81
104
|
|
|
@@ -128,6 +151,9 @@ addDebugLog("publish", "", "+");
|
|
|
128
151
|
|
|
129
152
|
// end of V2 publishing
|
|
130
153
|
return true;
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
131
157
|
}
|
|
132
158
|
|
|
133
159
|
// otherwise continue with original V1 publishig of individual components
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
setConfigDevBuild,
|
|
12
12
|
updateConfigVersion,
|
|
13
13
|
checkLibraryAndArchives,
|
|
14
|
+
getUseInputConfig,
|
|
15
|
+
getInputConfigForCommand,
|
|
14
16
|
forceDefaultsUpdate } from '../../util.js';
|
|
15
17
|
import { showCurrentStatus } from '../show-status/index.js';
|
|
16
18
|
|
|
@@ -124,6 +126,8 @@ addDebugLog("setPermanent", "", "");
|
|
|
124
126
|
|
|
125
127
|
export default async options => {
|
|
126
128
|
const isLibraryBased = getLibraryBased();
|
|
129
|
+
const useInputConfig = getUseInputConfig();
|
|
130
|
+
|
|
127
131
|
if (!isLibraryBased) {
|
|
128
132
|
console.log(`Command only supported for ${chalk.bold.green('library mode')} components.`);
|
|
129
133
|
process.exit();
|
|
@@ -135,8 +139,17 @@ addDebugLog("setPerm", "", "+");
|
|
|
135
139
|
|
|
136
140
|
let inputYN = "";
|
|
137
141
|
|
|
138
|
-
if (
|
|
139
|
-
|
|
142
|
+
if (useInputConfig) {
|
|
143
|
+
const inputConfig = await getInputConfigForCommand("setPermanent");
|
|
144
|
+
inputYN = inputConfig.makePermanent;
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
|
|
149
|
+
if (options.params.length >= 4) {
|
|
150
|
+
inputYN = options.params[3];
|
|
151
|
+
}
|
|
152
|
+
|
|
140
153
|
}
|
|
141
154
|
|
|
142
155
|
// await showCurrentStatus();
|