@appdirect/sfb-toolkit 4.0.1 → 4.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/bin/index.js +0 -1
- package/coverage/clover.xml +2 -2
- package/coverage/lcov-report/constants/customUserAttributesMock.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/pageUrls.js.html +1 -1
- package/coverage/lcov-report/constants/userMock.js.html +1 -1
- package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +1 -1
- package/coverage/lcov-report/controllers/controllers-utils/index.html +1 -1
- package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +1 -1
- package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +1 -1
- package/coverage/lcov-report/controllers/data-filters/index.html +1 -1
- package/coverage/lcov-report/controllers/index.html +1 -1
- package/coverage/lcov-report/controllers/index.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/base/index.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/container.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/index.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/components/search.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/constants/index.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +1 -1
- package/coverage/lcov-report/front-end-utils/src/utils/index.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/middlewares/config.js.html +1 -1
- package/coverage/lcov-report/middlewares/index.html +1 -1
- package/npm-shrinkwrap.json +359 -3346
- package/package.json +3 -4
- package/readme.md +8 -1
- package/src/tools/prompt-questions.js +9 -9
- package/src/tools/toolkit-about.js +7 -7
- package/src/tools/toolkit-checkout.js +8 -8
- package/src/tools/toolkit-common-fun.js +35 -17
- package/src/tools/toolkit-common-vars.js +10 -2
- package/src/tools/toolkit-components.js +26 -14
- package/src/tools/toolkit-config-setup.js +10 -10
- package/src/tools/toolkit-config.js +0 -1
- package/src/tools/toolkit-create.js +14 -14
- package/src/tools/toolkit-install.js +5 -4
- package/src/tools/toolkit-package.js +5 -4
- package/src/tools/toolkit-setup-e2e.js +14 -14
- package/src/tools/toolkit-setup.js +13 -13
- package/src/tools/toolkit-status.js +2 -2
- package/src/tools/toolkit-storybook.js +4 -3
- package/src/tools/toolkit-update.js +5 -5
- package/src/tools/zip-theme.js +6 -6
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require("fs")
|
|
2
2
|
const { copy, remove } = require("fs-extra")
|
|
3
|
+
const chalk = require("chalk")
|
|
3
4
|
|
|
4
5
|
const {
|
|
5
6
|
CURRENT_PATH,
|
|
@@ -54,7 +55,7 @@ const freshLocalConfig = {
|
|
|
54
55
|
await remove(`${projectPath}/themes/Plaza/package.json`)
|
|
55
56
|
freshLocalConfig.defaultValues.themeName = projectName
|
|
56
57
|
} catch (err) {
|
|
57
|
-
console.error(` Could not create theme folder due to: \n ${err}
|
|
58
|
+
console.error(chalk.red(` Could not create theme folder due to: \n ${err}`))
|
|
58
59
|
selfDestruction(projectPath) // revert changes
|
|
59
60
|
process.exit(1)
|
|
60
61
|
}
|
|
@@ -69,7 +70,7 @@ const freshLocalConfig = {
|
|
|
69
70
|
freshLocalConfig.defaultValues.marketplacePath = marketplacePath
|
|
70
71
|
freshLocalConfig.defaultValues.pageObjectsPath = `${marketplacePath}${PAGE_OBJECTS_SUFFIX}`
|
|
71
72
|
} catch (err) {
|
|
72
|
-
console.error(` Couldn't copy config file due to: \n ${err}
|
|
73
|
+
console.error(chalk.red(` Couldn't copy config file due to: \n ${err}`))
|
|
73
74
|
selfDestruction(projectPath) // revert changes
|
|
74
75
|
process.exit(1)
|
|
75
76
|
}
|
|
@@ -82,28 +83,27 @@ const freshLocalConfig = {
|
|
|
82
83
|
try {
|
|
83
84
|
LOCAL_CONFIG.save(freshLocalConfig, projectPath)
|
|
84
85
|
} catch (err) {
|
|
85
|
-
console.error(` ERROR: Unable to save config file due to: \n ${err}
|
|
86
|
+
console.error(chalk.red(` ERROR: Unable to save config file due to: \n ${err}`))
|
|
86
87
|
process.exit(1)
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
try {
|
|
90
91
|
LOCAL_CONFIG.configFileUpdate(projectPath)
|
|
91
|
-
console.log(
|
|
92
|
-
` Project context switched to ${freshLocalConfig.current}
|
|
93
|
-
)
|
|
92
|
+
console.log(chalk.green(
|
|
93
|
+
` Project context switched to ${freshLocalConfig.current}.`
|
|
94
|
+
))
|
|
94
95
|
} catch (err) {
|
|
95
|
-
console.error(
|
|
96
|
+
console.error(chalk.red(
|
|
96
97
|
` ERROR: Unable to switch context to ${
|
|
97
98
|
freshLocalConfig.current
|
|
98
|
-
} due to: ${err}
|
|
99
|
-
)
|
|
99
|
+
} due to: ${err}`
|
|
100
|
+
))
|
|
100
101
|
process.exit(1)
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
console.log(` Theme location: ${projectPath}
|
|
104
|
-
console.log(` Configuration file location: ${projectPath}/config
|
|
105
|
-
console.log(
|
|
104
|
+
console.log(chalk.green(` Theme location: ${projectPath}/`))
|
|
105
|
+
console.log(chalk.green(` Configuration file location: ${projectPath}/config/`))
|
|
106
|
+
console.log(chalk.green(
|
|
106
107
|
`\n All done! You can start your server by running \`sfb-toolkit start\` inside the project root folder: ${projectPath}\n`
|
|
107
|
-
|
|
108
|
-
)
|
|
108
|
+
))
|
|
109
109
|
})()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require("fs")
|
|
2
2
|
const { copy, remove } = require("fs-extra")
|
|
3
|
-
const colors = require("colors")
|
|
4
3
|
const prompt = require("./prompt-questions");
|
|
4
|
+
const chalk = require("chalk")
|
|
5
5
|
|
|
6
6
|
const { CURRENT_PATH, TOOLKIT_PATH, COMMAND_PARAM, BOOTSTRAP_FOLDERS, CONFIG_PATH, PAGE_OBJECTS_SUFFIX } = require("./toolkit-common-vars");
|
|
7
7
|
const { selfDestruction, filesCounter, shouldBeProjectFolder, getAvailableFolderWithPrompt,
|
|
@@ -21,7 +21,7 @@ let userThemeAnswer;
|
|
|
21
21
|
try {
|
|
22
22
|
await licenseAgreement();
|
|
23
23
|
} catch (err) {
|
|
24
|
-
console.error(` ERROR: In order to use this software, you need to type 'agree' to accept the license agreement that can be found at https://help.appdirect.com/sfb-eula.pdf
|
|
24
|
+
console.error(chalk.red(` ERROR: In order to use this software, you need to type 'agree' to accept the license agreement that can be found at https://help.appdirect.com/sfb-eula.pdf.`));
|
|
25
25
|
process.exit(1);
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -39,7 +39,7 @@ let userThemeAnswer;
|
|
|
39
39
|
case filesCounter(CURRENT_PATH) === 0 :
|
|
40
40
|
// if not provided with command, but current path is empty, so set the pointer on the current path
|
|
41
41
|
projectPath = CURRENT_PATH;
|
|
42
|
-
console.log(` Using current folder as project folder
|
|
42
|
+
console.log(chalk.green(` Using current folder as project folder.`));
|
|
43
43
|
break;
|
|
44
44
|
default:
|
|
45
45
|
const userAnswer = await prompt.ask(["ProjectName"]);
|
|
@@ -71,7 +71,7 @@ let userThemeAnswer;
|
|
|
71
71
|
);
|
|
72
72
|
freshLocalConfig.defaultValues.themeName = themeName.ThemeName;
|
|
73
73
|
} catch (err) {
|
|
74
|
-
console.error(` Could not copy clasic theme due to: \n ${err}
|
|
74
|
+
console.error(chalk.red(` Could not copy clasic theme due to: \n ${err}`));
|
|
75
75
|
selfDestruction(projectPath); // revert changes
|
|
76
76
|
process.exit(1);
|
|
77
77
|
}
|
|
@@ -86,7 +86,7 @@ let userThemeAnswer;
|
|
|
86
86
|
)
|
|
87
87
|
);
|
|
88
88
|
} catch(err) {
|
|
89
|
-
console.error(` ERROR: Unable to create ${themeName.ThemeName}'s package.json file due to ${err}
|
|
89
|
+
console.error(chalk.red(` ERROR: Unable to create ${themeName.ThemeName}'s package.json file due to ${err}.`));
|
|
90
90
|
process.exit(1);
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -100,7 +100,7 @@ let userThemeAnswer;
|
|
|
100
100
|
freshLocalConfig.defaultValues.marketplacePath = userAnswer.MarketplacePath;
|
|
101
101
|
freshLocalConfig.defaultValues.pageObjectsPath = `${userAnswer.MarketplacePath}${PAGE_OBJECTS_SUFFIX}`;
|
|
102
102
|
} catch (err) {
|
|
103
|
-
console.error(` Couldn't copy config file due to: \n ${err}
|
|
103
|
+
console.error(chalk.red(` Couldn't copy config file due to: \n ${err}`));
|
|
104
104
|
selfDestruction(projectPath); // revert changes
|
|
105
105
|
process.exit(1);
|
|
106
106
|
}
|
|
@@ -113,15 +113,15 @@ let userThemeAnswer;
|
|
|
113
113
|
try {
|
|
114
114
|
LOCAL_CONFIG.save(freshLocalConfig, projectPath);
|
|
115
115
|
} catch (err) {
|
|
116
|
-
console.error(` ERROR: Unable to save config file due to: \n ${err}
|
|
116
|
+
console.error(chalk.red(` ERROR: Unable to save config file due to: \n ${err}`));
|
|
117
117
|
process.exit(1);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
try {
|
|
121
121
|
LOCAL_CONFIG.configFileUpdate(projectPath);
|
|
122
|
-
console.log(` Project context switched to ${freshLocalConfig.current}
|
|
122
|
+
console.log(chalk.green(` Project context switched to ${freshLocalConfig.current}.`));
|
|
123
123
|
} catch ( err ) {
|
|
124
|
-
console.error(` ERROR: Unable to switch context to ${freshLocalConfig.current} due to: ${err}
|
|
124
|
+
console.error(chalk.red(` ERROR: Unable to switch context to ${freshLocalConfig.current} due to: ${err}`));
|
|
125
125
|
process.exit(1);
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -138,10 +138,10 @@ let userThemeAnswer;
|
|
|
138
138
|
}, projectPath);
|
|
139
139
|
|
|
140
140
|
} catch (err) {
|
|
141
|
-
console.error(` ERROR: Unable to save metadata due to: ${err}
|
|
141
|
+
console.error(chalk.red(` ERROR: Unable to save metadata due to: ${err}`));
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
console.log(` Theme location: ${projectPath}
|
|
145
|
-
console.log(` Configuration file location: ${projectPath}/config
|
|
146
|
-
console.log(`\n All done! You can start your server by running \`sfb-toolkit start\` inside the project root folder: ${projectPath}\n
|
|
144
|
+
console.log(chalk.green(` Theme location: ${projectPath}/`))
|
|
145
|
+
console.log(chalk.green(` Configuration file location: ${projectPath}/config/`))
|
|
146
|
+
console.log(chalk.green(`\n All done! You can start your server by running \`sfb-toolkit start\` inside the project root folder: ${projectPath}\n`));
|
|
147
147
|
})();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const fs = require("fs")
|
|
2
|
-
const
|
|
2
|
+
const chalk = require("chalk")
|
|
3
3
|
const { shouldBeProjectFolder } = require("./toolkit-common-fun");
|
|
4
4
|
const { LOCAL_CONFIG } = require("./toolkit-config");
|
|
5
5
|
|
|
@@ -14,6 +14,6 @@ shouldBeProjectFolder(true);
|
|
|
14
14
|
.map( namespace => Object.keys(namespace).map( param => param != 'themeName' && console.log(` ${param}: ${namespace[param].yellow}`)));
|
|
15
15
|
console.log(`\n To make changes in ${projectData.current.yellow} theme configuration, run \`sfb-toolkit update\`\n`);
|
|
16
16
|
} catch (err) {
|
|
17
|
-
console.error(`\n ERROR: Unable to find configuration file.\n
|
|
17
|
+
console.error(chalk.red(`\n ERROR: Unable to find configuration file.\n`));
|
|
18
18
|
}
|
|
19
19
|
})();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const fs = require("fs-extra")
|
|
1
|
+
const fs = require("fs-extra");
|
|
2
|
+
const chalk = require("chalk");
|
|
2
3
|
const { shouldBeProjectFolder, installSfbThemeComponents, createPackageJson } = require("./toolkit-common-fun");
|
|
3
|
-
const { spawnSync } = require("child_process")
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
4
5
|
const { ACTIVE_THEME_PATH, THEME_LOGS_FILE_PATH } = require("./toolkit-common-vars");
|
|
5
6
|
|
|
6
7
|
shouldBeProjectFolder(true);
|
|
@@ -34,7 +35,7 @@ const storybookModule = "@storybook/react";
|
|
|
34
35
|
|
|
35
36
|
// check if .storybook is part of the @appdirect/sfb-theme-components module
|
|
36
37
|
if(!fs.existsSync(`${ACTIVE_THEME_PATH}/node_modules/@appdirect/sfb-theme-components/.storybook`)) {
|
|
37
|
-
return console.log("ERROR: missing storybook support, please update to the latest version by executing the following command:\n sfb-toolkit install @appdirect/sfb-theme-components@latest"
|
|
38
|
+
return console.log(chalk.red("ERROR: missing storybook support, please update to the latest version by executing the following command:\n sfb-toolkit install @appdirect/sfb-theme-components@latest"));
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
// check if storybook module is installed otherwise install storybook dependencies
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = require("fs")
|
|
2
|
-
const colors = require("colors")
|
|
3
2
|
const prompt = require("./prompt-questions");
|
|
3
|
+
const chalk = require("chalk");
|
|
4
4
|
|
|
5
5
|
const { shouldBeProjectFolder } = require("./toolkit-common-fun");
|
|
6
6
|
const { PAGE_OBJECTS_SUFFIX } = require("./toolkit-common-vars");
|
|
@@ -29,20 +29,20 @@ shouldBeProjectFolder(true);
|
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
} catch (err) {
|
|
32
|
-
console.error(`\n ERROR: Unable to find configuration file.\n
|
|
32
|
+
console.error(chalk.red(`\n ERROR: Unable to find configuration file.\n`));
|
|
33
33
|
process.exit(1);
|
|
34
34
|
}
|
|
35
35
|
try{
|
|
36
36
|
LOCAL_CONFIG.save(newConfig);
|
|
37
37
|
} catch (err) {
|
|
38
|
-
console.error(`\n ERROR: Unable to save config file due to: \n ${err}
|
|
38
|
+
console.error(chalk.red(`\n ERROR: Unable to save config file due to: \n ${err}`));
|
|
39
39
|
process.exit(1);
|
|
40
40
|
}
|
|
41
41
|
try {
|
|
42
42
|
LOCAL_CONFIG.configFileUpdate();
|
|
43
43
|
} catch (err) {
|
|
44
|
-
console.error(` ERROR: Unable to update configuration to ${newConfig.current} due to: ${err}
|
|
44
|
+
console.error(chalk.red(` ERROR: Unable to update configuration to ${newConfig.current} due to: ${err}`));
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
47
|
-
console.log(`\n Configuration for ${newConfig.current.yellow} updated.\n
|
|
47
|
+
console.log(chalk.green(`\n Configuration for ${newConfig.current.yellow} updated.\n`));
|
|
48
48
|
})();
|
package/src/tools/zip-theme.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require("fs")
|
|
2
2
|
const archiver = require("archiver")
|
|
3
3
|
const moment = require("moment")
|
|
4
|
-
const
|
|
4
|
+
const chalk = require("chalk")
|
|
5
5
|
|
|
6
6
|
const currentPath = process.cwd() // used to get current dev folder
|
|
7
7
|
const config = require(`${currentPath}/config`)
|
|
@@ -24,10 +24,10 @@ const fileOutput = fs.createWriteStream(fileName)
|
|
|
24
24
|
const archive = archiver("zip")
|
|
25
25
|
|
|
26
26
|
fileOutput.on("close", () => {
|
|
27
|
-
console.log(`${archive.pointer()} total bytes
|
|
28
|
-
console.log(
|
|
29
|
-
`Archive has been finalized in /theme-zips with theme ${theme}
|
|
30
|
-
)
|
|
27
|
+
console.log(chalk.green(`${archive.pointer()} total bytes`))
|
|
28
|
+
console.log(chalk.green(
|
|
29
|
+
`Archive has been finalized in /theme-zips with theme ${theme}`
|
|
30
|
+
))
|
|
31
31
|
})
|
|
32
32
|
|
|
33
33
|
archive.pipe(fileOutput)
|
|
@@ -58,7 +58,7 @@ archive.glob("**", {
|
|
|
58
58
|
})
|
|
59
59
|
// add as many as you like
|
|
60
60
|
archive.on("error", err => {
|
|
61
|
-
console.log(
|
|
61
|
+
console.log(chalk.red(err))
|
|
62
62
|
throw err
|
|
63
63
|
})
|
|
64
64
|
archive.finalize()
|