@appdirect/sfb-toolkit 4.0.8 → 4.0.9
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 +28 -12
- package/config/index.js +1 -0
- package/coverage/clover.xml +32 -32
- package/coverage/coverage-final.json +4 -4
- 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 +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 +1 -1
- package/coverage/lcov-report/middlewares/config.js.html +1 -1
- package/coverage/lcov-report/middlewares/index.html +1 -1
- package/coverage/lcov.info +81 -81
- package/index.js +11 -10
- package/npm-shrinkwrap.json +559 -113
- package/package.json +4 -3
- package/readme.md +9 -1
- package/src/api/cors.js +1 -1
- package/src/tools/prompt-questions.js +43 -1
- package/src/tools/proxy-fetch.js +16 -0
- package/src/tools/toolkit-common-vars.js +1 -1
- package/src/tools/toolkit-components.js +12 -4
- package/src/tools/toolkit-install.js +15 -7
- package/src/tools/toolkit-start.js +1 -1
package/index.js
CHANGED
|
@@ -14,11 +14,12 @@ const getConfigComponentsWebpack = require("./webpack-components.config.cjs")
|
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
16
|
toolkitAssetsPath,
|
|
17
|
-
themeAssetsPath
|
|
17
|
+
themeAssetsPath,
|
|
18
18
|
} = require("./src/constants/pageUrls")
|
|
19
19
|
|
|
20
20
|
const currentPath = process.cwd() // used to get current dev folder
|
|
21
21
|
const config = require(`${currentPath}/config`)
|
|
22
|
+
const port = config.port || 3555
|
|
22
23
|
|
|
23
24
|
const app = express()
|
|
24
25
|
if (process.env.RUN_ENV === "dev") {
|
|
@@ -26,7 +27,7 @@ if (process.env.RUN_ENV === "dev") {
|
|
|
26
27
|
app.use(
|
|
27
28
|
webpackDevMiddleware(compiler, {
|
|
28
29
|
publicPath: configWebpack.output.publicPath,
|
|
29
|
-
stats: { colors: true }
|
|
30
|
+
stats: { colors: true },
|
|
30
31
|
})
|
|
31
32
|
)
|
|
32
33
|
}
|
|
@@ -38,7 +39,7 @@ if (fs.existsSync(`${currentPath}/themes/${config.theme}/customComponents`)) {
|
|
|
38
39
|
// (in dev mode), and app modules are imported in some unfortunate ways.
|
|
39
40
|
if (!global.location) {
|
|
40
41
|
global.location = {
|
|
41
|
-
href: `${pathToFileURL(process.cwd()).href}${sep}
|
|
42
|
+
href: `${pathToFileURL(process.cwd()).href}${sep}`,
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
const configComponentsWebpackAsset = getConfigComponentsWebpack(
|
|
@@ -51,21 +52,21 @@ if (fs.existsSync(`${currentPath}/themes/${config.theme}/customComponents`)) {
|
|
|
51
52
|
webpackDevMiddleware(compilerComponentsAsset, {
|
|
52
53
|
publicPath: configComponentsWebpackAsset.output.publicPath,
|
|
53
54
|
writeToDisk: true,
|
|
54
|
-
stats: { colors: true }
|
|
55
|
+
stats: { colors: true },
|
|
55
56
|
})
|
|
56
57
|
)
|
|
57
58
|
app.use(
|
|
58
59
|
webpackHotMiddleware(compilerComponentsAsset, {
|
|
59
60
|
log: console.log,
|
|
60
61
|
path: "/__webpack_hmr",
|
|
61
|
-
heartbeat: 10 * 1000
|
|
62
|
+
heartbeat: 10 * 1000,
|
|
62
63
|
})
|
|
63
64
|
)
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
app.use(
|
|
67
68
|
bodyParser.urlencoded({
|
|
68
|
-
extended: true
|
|
69
|
+
extended: true,
|
|
69
70
|
})
|
|
70
71
|
)
|
|
71
72
|
|
|
@@ -84,16 +85,16 @@ app.use(bodyParser.json())
|
|
|
84
85
|
// Connect all our routes to our application
|
|
85
86
|
app.use(configMiddleware)
|
|
86
87
|
app.use("/", routes)
|
|
87
|
-
const server = app.listen(
|
|
88
|
+
const server = app.listen(port, () =>
|
|
88
89
|
console.log(
|
|
89
|
-
|
|
90
|
+
`AppDirect Toolkit is running, you can view your storefront preview at: http://localhost:${port}/en-US/home`
|
|
90
91
|
)
|
|
91
92
|
)
|
|
92
|
-
server.on("error", err => {
|
|
93
|
+
server.on("error", (err) => {
|
|
93
94
|
switch (err.errno) {
|
|
94
95
|
case "EADDRINUSE":
|
|
95
96
|
return console.log(
|
|
96
|
-
`Error (${err.errno}):\n Port
|
|
97
|
+
`Error (${err.errno}):\n Port ${port} is already in use.\n The previous server instance might not have been terminated correctly.\n Make sure the previous sfb-toolkit instance is properly terminated and enter \`rs\` to restart the current instance.`
|
|
97
98
|
.red
|
|
98
99
|
)
|
|
99
100
|
default:
|