@appdirect/sfb-toolkit 3.0.5 → 4.0.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/.babelrc +8 -13
- package/Dockerfile +2 -2
- package/bin/index.js +0 -14
- package/coverage/clover.xml +32 -32
- package/coverage/coverage-final.json +10 -10
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/constants/customUserAttributesMock.js.html +8 -3
- package/coverage/lcov-report/constants/index.html +8 -3
- package/coverage/lcov-report/constants/pageUrls.js.html +8 -3
- package/coverage/lcov-report/constants/userMock.js.html +8 -3
- package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +8 -3
- package/coverage/lcov-report/controllers/controllers-utils/index.html +8 -3
- package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +9 -4
- package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +8 -3
- package/coverage/lcov-report/controllers/data-filters/index.html +12 -7
- package/coverage/lcov-report/controllers/index.html +8 -3
- package/coverage/lcov-report/controllers/index.js.html +11 -6
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +18 -13
- package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +11 -6
- package/coverage/lcov-report/front-end-utils/src/components/base/index.html +13 -8
- package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +19 -14
- package/coverage/lcov-report/front-end-utils/src/components/container.js.html +11 -6
- package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +10 -5
- package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +10 -5
- package/coverage/lcov-report/front-end-utils/src/components/index.html +17 -12
- package/coverage/lcov-report/front-end-utils/src/components/search.js.html +23 -18
- package/coverage/lcov-report/front-end-utils/src/constants/index.html +8 -3
- package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +8 -3
- package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +8 -3
- package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +8 -3
- package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +8 -3
- package/coverage/lcov-report/front-end-utils/src/utils/index.html +8 -3
- package/coverage/lcov-report/index.html +18 -13
- package/coverage/lcov-report/middlewares/config.js.html +8 -3
- package/coverage/lcov-report/middlewares/index.html +8 -3
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +26 -0
- package/coverage/lcov.info +81 -81
- package/index.js +14 -8
- package/npm-shrinkwrap.json +34576 -7042
- package/package.json +99 -80
- package/readme.md +18 -6
- package/src/controllers/index.js +1 -1
- package/src/front-end-utils/dist/toolbar.bundle.js +2 -49
- package/src/front-end-utils/dist/toolbar.bundle.js.LICENSE.txt +52 -0
- package/src/front-end-utils/src/components/base/ResultItem.js +2 -2
- package/src/front-end-utils/src/components/base/SearchBar.js +1 -1
- package/src/front-end-utils/src/components/container.js +1 -1
- package/src/front-end-utils/src/components/data-view.js +1 -1
- package/src/front-end-utils/src/components/header-view.js +1 -1
- package/src/front-end-utils/src/components/search.js +1 -1
- package/src/tools/compiler-components-prod.js +1 -1
- package/src/tools/gulp-tasks.js +2 -2
- package/src/tools/toolkit-common-fun.js +88 -4
- package/src/tools/toolkit-common-vars.js +1 -1
- package/src/tools/toolkit-components.js +11 -5
- package/src/tools/toolkit-create.js +19 -2
- package/src/tools/toolkit-install.js +20 -2
- package/src/tools/toolkit-package.js +4 -3
- package/src/tools/toolkit-setup.js +41 -7
- package/src/tools/toolkit-storybook.js +5 -5
- package/{webpack-components.config.js → webpack-components.config.cjs} +1 -3
- package/{webpack-components.config.prod.js → webpack-components.config.prod.cjs} +1 -3
- package/{webpack.config.js → webpack.config.cjs} +8 -5
- package/src/tools/toolkit-tests.js +0 -99
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
spawn
|
|
3
|
-
} = require("child_process")
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const colors = require("colors")
|
|
6
|
-
const NODEMON_PATH = "node_modules/nodemon/bin/nodemon.js"
|
|
7
|
-
const {
|
|
8
|
-
TOOLKIT_PATH,
|
|
9
|
-
ACTIVE_THEME,
|
|
10
|
-
ACTIVE_THEME_PATH
|
|
11
|
-
} = require("./toolkit-common-vars")
|
|
12
|
-
|
|
13
|
-
const TESTS_CONFIG_PATH = `${ACTIVE_THEME_PATH}/__tests__/config/index.js`;
|
|
14
|
-
const testsConfig = require(TESTS_CONFIG_PATH);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
function installDepedency(depedency) {
|
|
18
|
-
return new Promise((resolve, reject) => {
|
|
19
|
-
const child = spawn('npm', ['install', depedency], {
|
|
20
|
-
cwd: `${__dirname}/..`,
|
|
21
|
-
stdio: "inherit",
|
|
22
|
-
shell: true
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
child.on('error', reject);
|
|
26
|
-
child.on('exit', code => {
|
|
27
|
-
if (code == 0) {
|
|
28
|
-
return resolve();
|
|
29
|
-
}
|
|
30
|
-
const err = new Error(`child exited with code ${code}`)
|
|
31
|
-
err.code = code;
|
|
32
|
-
return reject(err)
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
async function checkAndInstall(depedency) {
|
|
38
|
-
try {
|
|
39
|
-
fs.accessSync(`${TOOLKIT_PATH}/node_modules/${depedency}`, fs.F_OK);
|
|
40
|
-
} catch (e) {
|
|
41
|
-
console.log(`\n Could not find module ${depedency}. Trying to install...\n`.yellow);
|
|
42
|
-
await installDepedency(depedency);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function runTests() {
|
|
47
|
-
// pre-conditions
|
|
48
|
-
console.log(" \n Checking pre-conditions...");
|
|
49
|
-
for (let depedency of testsConfig.requiredModules) {
|
|
50
|
-
await checkAndInstall(depedency);
|
|
51
|
-
}
|
|
52
|
-
console.log("\n Pre-conditions met.\n".green);
|
|
53
|
-
startTests();
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function startTests() {
|
|
57
|
-
|
|
58
|
-
console.log(" ---");
|
|
59
|
-
console.log(
|
|
60
|
-
` Running browser testing for theme ${ACTIVE_THEME}`
|
|
61
|
-
);
|
|
62
|
-
console.log(" ---");
|
|
63
|
-
|
|
64
|
-
const testsProcess = spawn(
|
|
65
|
-
`node ${TOOLKIT_PATH}/node_modules/.bin/jest --config='${TOOLKIT_PATH}/config/jest-config.js'`, {
|
|
66
|
-
stdio: "inherit",
|
|
67
|
-
shell: true
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
testsProcess.on("error", () => {
|
|
71
|
-
webserverProcess.kill()
|
|
72
|
-
})
|
|
73
|
-
testsProcess.on("close", () => {
|
|
74
|
-
webserverProcess.kill()
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
webserverProcess.on("error", () => {
|
|
78
|
-
testsProcess.kill();
|
|
79
|
-
})
|
|
80
|
-
webserverProcess.on("close", () => {
|
|
81
|
-
testsProcess.kill();
|
|
82
|
-
})
|
|
83
|
-
webserverProcess.on("exit", () => {
|
|
84
|
-
testsProcess.kill();
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const webserverProcess = spawn(
|
|
89
|
-
`node ${TOOLKIT_PATH}/${NODEMON_PATH} ${TOOLKIT_PATH}/index.js`, {
|
|
90
|
-
shell: true
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
webserverProcess.stdout.on("data", data => {
|
|
95
|
-
const message = data.toString()
|
|
96
|
-
if (/running/.test(message)) {
|
|
97
|
-
runTests()
|
|
98
|
-
}
|
|
99
|
-
})
|