@appdirect/sfb-toolkit 3.0.1 → 3.0.3
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/coverage/clover.xml +178 -175
- package/coverage/coverage-final.json +8 -8
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/pageUrls.js.html +2 -2
- package/coverage/lcov-report/constants/userMock.js.html +1 -1
- package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +8 -8
- 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 +18 -18
- package/coverage/lcov-report/controllers/index.js.html +144 -75
- package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +7 -7
- package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +3 -3
- 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 +11 -11
- 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 +13 -13
- 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 +18 -18
- package/coverage/lcov-report/middlewares/config.js.html +9 -3
- package/coverage/lcov-report/middlewares/index.html +1 -1
- package/coverage/lcov.info +350 -336
- package/index.js +1 -3
- package/npm-shrinkwrap.json +10 -20
- package/package.json +3 -2
- package/readme.md +13 -2
- package/src/controllers/index.js +51 -28
- package/src/middlewares/config.js +3 -1
- package/src/tools/compiler-components-prod.js +30 -0
- package/src/tools/toolkit-common-vars.js +1 -1
- package/src/tools/toolkit-components.js +4 -0
- package/src/tools/toolkit-package.js +44 -37
- package/src/tools/zip-theme.js +15 -8
- package/webpack-components.config.js +28 -8
- package/webpack-components.config.prod.js +115 -0
- package/.node-version +0 -1
- package/src/tools/compiler-components.js +0 -25
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
const path = require("path")
|
|
2
|
+
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
|
|
3
|
+
|
|
4
|
+
module.exports = (currentPath, config) => {
|
|
5
|
+
const assetPath = path.resolve(
|
|
6
|
+
currentPath,
|
|
7
|
+
`themes/${config.theme}/assets/js/components`
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
entry: [
|
|
12
|
+
path.resolve(
|
|
13
|
+
currentPath,
|
|
14
|
+
`themes/${config.theme}/customComponents/index.js`
|
|
15
|
+
)
|
|
16
|
+
],
|
|
17
|
+
mode: "production",
|
|
18
|
+
output: {
|
|
19
|
+
library: "__ADComponents",
|
|
20
|
+
libraryTarget: "var",
|
|
21
|
+
filename: "sfb-components.js",
|
|
22
|
+
path: assetPath
|
|
23
|
+
},
|
|
24
|
+
plugins: [
|
|
25
|
+
new MiniCssExtractPlugin({
|
|
26
|
+
filename: "sfb-components.css"
|
|
27
|
+
})
|
|
28
|
+
],
|
|
29
|
+
module: {
|
|
30
|
+
rules: [
|
|
31
|
+
{
|
|
32
|
+
test: /\.(js|jsx)$/,
|
|
33
|
+
use: {
|
|
34
|
+
loader: "babel-loader",
|
|
35
|
+
options: {
|
|
36
|
+
presets: [
|
|
37
|
+
require.resolve("@babel/preset-env"),
|
|
38
|
+
require.resolve("@babel/preset-react")
|
|
39
|
+
],
|
|
40
|
+
plugins: [
|
|
41
|
+
require.resolve("@babel/plugin-proposal-class-properties"),
|
|
42
|
+
require.resolve("@babel/plugin-transform-runtime")
|
|
43
|
+
],
|
|
44
|
+
include: [
|
|
45
|
+
path.resolve(
|
|
46
|
+
currentPath,
|
|
47
|
+
`themes/${config.theme}/customComponents`
|
|
48
|
+
),
|
|
49
|
+
path.resolve(
|
|
50
|
+
currentPath,
|
|
51
|
+
`themes/${
|
|
52
|
+
config.theme
|
|
53
|
+
}/node_modules/@appdirect/sfb-theme-components`
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
test: /\.(sa|sc|c)ss$/,
|
|
61
|
+
use: [
|
|
62
|
+
MiniCssExtractPlugin.loader,
|
|
63
|
+
{ loader: "css-loader" },
|
|
64
|
+
{ loader: "sass-loader" }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
test: /\.(png|gif|jpg|svg)$/,
|
|
69
|
+
use: {
|
|
70
|
+
loader: "url-loader",
|
|
71
|
+
options: {
|
|
72
|
+
limit: 50000
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
|
|
78
|
+
use: [
|
|
79
|
+
{
|
|
80
|
+
loader: "file-loader",
|
|
81
|
+
options: {
|
|
82
|
+
name: "[name].[ext]",
|
|
83
|
+
outputPath: "fonts/"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
resolve: {
|
|
91
|
+
modules: [
|
|
92
|
+
path.resolve(currentPath, "node_modules"),
|
|
93
|
+
path.resolve(__dirname, "node_modules"),
|
|
94
|
+
path.resolve(currentPath, `themes/${config.theme}/node_modules`)
|
|
95
|
+
],
|
|
96
|
+
extensions: [
|
|
97
|
+
".scss",
|
|
98
|
+
".js",
|
|
99
|
+
".jsx",
|
|
100
|
+
".json",
|
|
101
|
+
".png",
|
|
102
|
+
".gif",
|
|
103
|
+
".jpg",
|
|
104
|
+
".svg"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
resolveLoader: {
|
|
108
|
+
modules: [
|
|
109
|
+
path.resolve(currentPath, "node_modules"),
|
|
110
|
+
path.resolve(__dirname, "node_modules"),
|
|
111
|
+
path.resolve(currentPath, `themes/${config.theme}/node_modules`)
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
package/.node-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8.9.4
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const webpack = require("webpack")
|
|
2
|
-
const fs = require("fs")
|
|
3
|
-
const { TOOLKIT_PATH } = require("./toolkit-common-vars")
|
|
4
|
-
|
|
5
|
-
const getConfigComponentsWebpack = require(`${TOOLKIT_PATH}/webpack-components.config`)
|
|
6
|
-
const currentPath = process.cwd() // used to get current dev folder
|
|
7
|
-
const config = require(`${currentPath}/config`)
|
|
8
|
-
|
|
9
|
-
fs.exists(
|
|
10
|
-
`${currentPath}/themes/${config.theme}/components/index.js`,
|
|
11
|
-
exist => {
|
|
12
|
-
if (exist) {
|
|
13
|
-
const configComponentsWebpackAsset = getConfigComponentsWebpack(
|
|
14
|
-
currentPath,
|
|
15
|
-
config,
|
|
16
|
-
true
|
|
17
|
-
)
|
|
18
|
-
webpack(configComponentsWebpackAsset, (err, stats) => {
|
|
19
|
-
if (err || stats.hasErrors()) {
|
|
20
|
-
console.log(stats.hasErrors())
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
)
|