@appdirect/sfb-toolkit 2.0.14 → 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/Dockerfile +26 -0
- package/bin/index.js +191 -189
- package/commands.sh +2 -0
- package/coverage/clover.xml +570 -0
- package/coverage/coverage-final.json +19 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +79 -0
- package/coverage/lcov-report/constants/index.html +126 -0
- package/coverage/lcov-report/constants/pageUrls.js.html +98 -0
- package/coverage/lcov-report/constants/userMock.js.html +158 -0
- package/coverage/lcov-report/controllers/controllers-utils/assetsUtils.js.html +173 -0
- package/coverage/lcov-report/controllers/controllers-utils/index.html +111 -0
- package/coverage/lcov-report/controllers/data-filters/bootstrap-data-filter.js.html +146 -0
- package/coverage/lcov-report/controllers/data-filters/call-to-actions-filter.js.html +347 -0
- package/coverage/lcov-report/controllers/data-filters/index.html +126 -0
- package/coverage/lcov-report/controllers/index.html +111 -0
- package/coverage/lcov-report/controllers/index.js.html +1400 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/front-end-utils/src/components/base/ResultItem.js.html +518 -0
- package/coverage/lcov-report/front-end-utils/src/components/base/SearchBar.js.html +452 -0
- package/coverage/lcov-report/front-end-utils/src/components/base/index.html +141 -0
- package/coverage/lcov-report/front-end-utils/src/components/base/item.js.html +458 -0
- package/coverage/lcov-report/front-end-utils/src/components/container.js.html +548 -0
- package/coverage/lcov-report/front-end-utils/src/components/data-view.js.html +383 -0
- package/coverage/lcov-report/front-end-utils/src/components/header-view.js.html +803 -0
- package/coverage/lcov-report/front-end-utils/src/components/index.html +156 -0
- package/coverage/lcov-report/front-end-utils/src/components/search.js.html +977 -0
- package/coverage/lcov-report/front-end-utils/src/constants/index.html +141 -0
- package/coverage/lcov-report/front-end-utils/src/constants/pageUrl.js.html +86 -0
- package/coverage/lcov-report/front-end-utils/src/constants/roleType.js.html +92 -0
- package/coverage/lcov-report/front-end-utils/src/constants/searchType.js.html +164 -0
- package/coverage/lcov-report/front-end-utils/src/utils/debounce.js.html +116 -0
- package/coverage/lcov-report/front-end-utils/src/utils/index.html +111 -0
- package/coverage/lcov-report/index.html +231 -0
- package/coverage/lcov-report/middlewares/config.js.html +188 -0
- package/coverage/lcov-report/middlewares/index.html +111 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +170 -0
- package/coverage/lcov.info +1146 -0
- package/index.js +1 -3
- package/npm-shrinkwrap.json +35 -46
- package/package.json +11 -4
- package/readme.md +24 -2
- package/src/constants/userMock.js +27 -0
- package/src/controllers/index.js +53 -25
- 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-dev-e2e.js +85 -0
- package/src/tools/toolkit-package.js +44 -37
- package/src/tools/toolkit-setup-e2e.js +109 -0
- 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
package/Dockerfile
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
FROM node:12-alpine
|
|
2
|
+
|
|
3
|
+
ENV NO_UPDATE_NOTIFIER=true
|
|
4
|
+
ENV SFB_TOOLKIT=/app/bin/index.js
|
|
5
|
+
ENV HOME=/home/node
|
|
6
|
+
|
|
7
|
+
WORKDIR /app
|
|
8
|
+
RUN adduser node root && \
|
|
9
|
+
chown node:root /app $HOME && \
|
|
10
|
+
chmod g=u /app $HOME
|
|
11
|
+
USER node:root
|
|
12
|
+
|
|
13
|
+
COPY --chown=node:root . ./
|
|
14
|
+
RUN npm ci && \
|
|
15
|
+
npm cache clean --force
|
|
16
|
+
|
|
17
|
+
RUN chmod a+x /app/commands.sh
|
|
18
|
+
|
|
19
|
+
RUN $SFB_TOOLKIT setup-e2e-theme Plaza
|
|
20
|
+
|
|
21
|
+
WORKDIR /app/Plaza
|
|
22
|
+
|
|
23
|
+
RUN $SFB_TOOLKIT use-local-sfb-components
|
|
24
|
+
|
|
25
|
+
EXPOSE 3555
|
|
26
|
+
ENTRYPOINT ["sh", "/app/commands.sh"]
|
package/bin/index.js
CHANGED
|
@@ -4,209 +4,211 @@ const program = require("commander")
|
|
|
4
4
|
const { spawn } = require("child_process")
|
|
5
5
|
const colors = require("colors")
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const PROJECT_SETUP_PATH = "src/tools/toolkit-setup.js"
|
|
8
|
+
const PROJECT_SETUP_E2E_PATH = "src/tools/toolkit-setup-e2e.js"
|
|
9
|
+
const PROJECT_CONFIG_SETUP_PATH = "src/tools/toolkit-config-setup.js"
|
|
9
10
|
const STATUS_PATH = "src/tools/toolkit-status.js"
|
|
10
11
|
const ABOUT_PATH = "src/tools/toolkit-about.js"
|
|
11
|
-
const
|
|
12
|
+
const NEW_THEME_PATH = "src/tools/toolkit-create.js"
|
|
12
13
|
const CHECKOUT_PATH = "src/tools/toolkit-checkout.js"
|
|
13
14
|
const UPDATE_PATH = "src/tools/toolkit-update.js"
|
|
14
|
-
const
|
|
15
|
-
const
|
|
15
|
+
const SERVER_START_PATH = "src/tools/toolkit-start.js"
|
|
16
|
+
const PACKAGE_PATH = "src/tools/toolkit-package.js"
|
|
16
17
|
const TESTS_PATH = "src/tools/toolkit-tests.js"
|
|
17
18
|
const VERSION_PATH = "src/tools/toolkit-version.js"
|
|
18
19
|
const STORYBOOK = "src/tools/toolkit-storybook.js"
|
|
19
20
|
const INSTALL = "src/tools/toolkit-install.js"
|
|
20
21
|
const COMPONENTS = "src/tools/toolkit-components.js"
|
|
22
|
+
const DEV_E2E = "src/tools/toolkit-dev-e2e.js"
|
|
21
23
|
|
|
22
24
|
program
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
program
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
program
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
25
|
+
.command("setup [name]")
|
|
26
|
+
.description("Creates a new project")
|
|
27
|
+
.action(name => {
|
|
28
|
+
spawn(`node "${__dirname}/../${PROJECT_SETUP_PATH}" ${name}`, {
|
|
29
|
+
stdio: "inherit",
|
|
30
|
+
shell: true
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
program
|
|
35
|
+
.command("setup-e2e-theme")
|
|
36
|
+
.description("Creates a new project for e2e tests")
|
|
37
|
+
.action(name => {
|
|
38
|
+
spawn(`node "${__dirname}/../${PROJECT_SETUP_E2E_PATH}" ${name}`, {
|
|
39
|
+
stdio: "inherit",
|
|
40
|
+
shell: true
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
program
|
|
45
|
+
.command("config-setup [projname] [themename]")
|
|
46
|
+
.description("Creates the config files for a new project")
|
|
47
|
+
.action((projname, themename) => {
|
|
48
|
+
spawn(
|
|
49
|
+
`node "${__dirname}/../${PROJECT_CONFIG_SETUP_PATH}" ${projname} ${themename}`,
|
|
50
|
+
{
|
|
51
|
+
stdio: "inherit",
|
|
52
|
+
shell: true
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
program
|
|
58
|
+
.command("start")
|
|
59
|
+
.description("Starts the Theme Web Server")
|
|
60
|
+
.option(
|
|
61
|
+
"-c, --withLocalComponents",
|
|
62
|
+
"Use components from node-modules",
|
|
63
|
+
true,
|
|
64
|
+
0
|
|
65
|
+
)
|
|
66
|
+
.on("option:withLocalComponents", () => {
|
|
67
|
+
process.env.withLocalComponents = "true"
|
|
68
|
+
})
|
|
69
|
+
.option("-v, --verbose", "Enable all logs in console", true, 0)
|
|
70
|
+
.on("option:verbose", () => {
|
|
71
|
+
process.env.verboseToolkitOutput = "true"
|
|
72
|
+
})
|
|
73
|
+
.action(() => {
|
|
74
|
+
spawn(`node "${__dirname}/../${SERVER_START_PATH}"`, {
|
|
75
|
+
stdio: "inherit",
|
|
76
|
+
shell: true
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
program
|
|
81
|
+
.command("about")
|
|
82
|
+
.description("Lists existing themes")
|
|
83
|
+
.action(name => {
|
|
84
|
+
spawn(`node "${__dirname}/../${ABOUT_PATH}" ${name}`, {
|
|
85
|
+
stdio: "inherit",
|
|
86
|
+
shell: true
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
program
|
|
91
|
+
.command("status")
|
|
92
|
+
.description("Gives information about the current config")
|
|
93
|
+
.action(() => {
|
|
94
|
+
spawn(`node "${__dirname}/../${STATUS_PATH}"`, {
|
|
95
|
+
stdio: "inherit",
|
|
96
|
+
shell: true
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
program
|
|
101
|
+
.command("create [name]")
|
|
102
|
+
.description("Creates a new theme")
|
|
103
|
+
.action(name => {
|
|
104
|
+
spawn(`node "${__dirname}/../${NEW_THEME_PATH}" ${name}`, {
|
|
105
|
+
stdio: "inherit",
|
|
106
|
+
shell: true
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
program
|
|
111
|
+
.command("checkout [name]")
|
|
112
|
+
.description("Changes context to theme")
|
|
113
|
+
.action(name => {
|
|
114
|
+
spawn(`node "${__dirname}/../${CHECKOUT_PATH}" ${name}`, {
|
|
115
|
+
stdio: "inherit",
|
|
116
|
+
shell: true
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
program
|
|
121
|
+
.command("update")
|
|
122
|
+
.description("Updates current theme configuration")
|
|
123
|
+
.action(name => {
|
|
124
|
+
spawn(`node "${__dirname}/../${UPDATE_PATH}" ${name}`, {
|
|
125
|
+
stdio: "inherit",
|
|
126
|
+
shell: true
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
program
|
|
131
|
+
.command("package")
|
|
132
|
+
.description("Creates a .zip file with the current theme files")
|
|
133
|
+
.option("-a, --all", "Pack everything", true, 0)
|
|
134
|
+
.on("option:all", () => {
|
|
135
|
+
process.env.PACK_ALL = "true"
|
|
136
|
+
})
|
|
137
|
+
.action(() => {
|
|
138
|
+
spawn(`node "${__dirname}/../${PACKAGE_PATH}"`, {
|
|
139
|
+
stdio: "inherit",
|
|
140
|
+
shell: true
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
program
|
|
145
|
+
.command("test")
|
|
146
|
+
.description("Execute tests for current theme")
|
|
147
|
+
.option("-h, --headless", "test in headless mode", true, 0)
|
|
148
|
+
.on("option:headless", () => {
|
|
149
|
+
process.env.HEADLESS = "true"
|
|
150
|
+
})
|
|
151
|
+
.action(name => {
|
|
152
|
+
spawn(`node "${__dirname}/../${TESTS_PATH}"`, {
|
|
153
|
+
stdio: "inherit",
|
|
154
|
+
shell: true
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
program
|
|
159
|
+
.command("storybook")
|
|
160
|
+
.description("Start storybook for the currently selected theme.")
|
|
161
|
+
.action(() => {
|
|
162
|
+
spawn(`node "${__dirname}/../${STORYBOOK}"`, {
|
|
163
|
+
stdio: "inherit",
|
|
164
|
+
shell: true
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
program
|
|
169
|
+
.command("install [module]")
|
|
170
|
+
.description("Installs npm module in the currently selected theme.")
|
|
171
|
+
.action(module => {
|
|
172
|
+
spawn(`node "${__dirname}/../${INSTALL}" ${module}`, {
|
|
173
|
+
stdio: "inherit",
|
|
174
|
+
shell: true
|
|
175
|
+
})
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
program
|
|
179
|
+
.command("components")
|
|
180
|
+
.description("Setup custom components")
|
|
181
|
+
.action(() => {
|
|
182
|
+
spawn(`node "${__dirname}/../${COMPONENTS}"`, {
|
|
183
|
+
stdio: "inherit",
|
|
184
|
+
shell: true
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
program
|
|
189
|
+
.command("use-local-sfb-components")
|
|
190
|
+
.description("Setup theme to use local sfb-components bundles for e2e")
|
|
191
|
+
.action(() => {
|
|
192
|
+
spawn(`node "${__dirname}/../${DEV_E2E}"`, {
|
|
193
|
+
stdio: "inherit",
|
|
194
|
+
shell: true
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
program
|
|
199
|
+
.command("version")
|
|
200
|
+
.alias("v")
|
|
201
|
+
.description("Shows version of sfb-toolkit\n")
|
|
202
|
+
.action(() => {
|
|
203
|
+
spawn(`node "${__dirname}/../${VERSION_PATH}"`, {
|
|
204
|
+
stdio: "inherit",
|
|
205
|
+
shell: true
|
|
206
|
+
})
|
|
207
|
+
})
|
|
206
208
|
|
|
207
209
|
program.parse(process.argv)
|
|
208
210
|
|
|
209
211
|
// check if there were no args specified
|
|
210
212
|
if (program.args.length === 0) {
|
|
211
|
-
|
|
213
|
+
program.help()
|
|
212
214
|
}
|
package/commands.sh
ADDED