Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bonita
bonita-ui-designer-sdk
Commits
db83eb16
Commit
db83eb16
authored
Apr 07, 2021
by
Jerome Cambon
Browse files
Now a real CLI : cwb
parent
74baa2f7
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
custom-widget-builder/package-lock.json
View file @
db83eb16
This diff is collapsed.
Click to expand it.
custom-widget-builder/package.json
View file @
db83eb16
{
"name"
:
"
poc
-widget-builder"
,
"name"
:
"
custom
-widget-builder"
,
"version"
:
"0.0.1"
,
"description"
:
""
,
"
author"
:
"poc-widget-builder
"
,
"description"
:
"
Bonitasoft UI Designer: Custom Widget Builder
"
,
"
main"
:
"build/src/starter.js
"
,
"license"
:
"GPLv2"
,
"scripts"
:
{
"typescript-compile"
:
"tsc --build tsconfig.json"
,
...
...
@@ -21,6 +21,10 @@
"jest"
:
"^26.6.3"
,
"ts-jest"
:
"^26.5.4"
},
"bin"
:
{
"cwb"
:
"./build/src/starter.js"
,
"custom-widget-builder"
:
"./build/src/starter.js"
},
"jest"
:
{
"verbose"
:
true
,
"roots"
:
[
...
...
custom-widget-builder/src/starter.ts
View file @
db83eb16
#!/usr/bin/env node
/*
* Copyright © 2021 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
...
...
@@ -16,17 +18,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import
{
CustomWidgetBuilder
}
from
"
./CustomWidgetBuilder
"
;
let
wcFile
;
let
outputDir
;
for
(
let
param
of
process
.
argv
)
{
if
(
param
.
startsWith
(
"
wcFile
"
))
{
wcFile
=
getParameter
(
param
);
}
let
params
=
process
.
argv
.
slice
(
2
);
let
wcFile
=
params
[
0
];
if
(
!
wcFile
)
{
usage
();
process
.
exit
(
1
);
}
let
outputDir
=
"
.
"
;
for
(
let
param
of
params
)
{
if
(
param
.
startsWith
(
"
outputDir
"
))
{
outputDir
=
getParameter
(
param
);
}
...
...
@@ -38,3 +39,7 @@ new CustomWidgetBuilder().generatePropertiesFile(wcFile, outputDir);
function
getParameter
(
param
:
string
):
any
{
return
param
.
substr
(
param
.
indexOf
(
'
=
'
)
+
1
);
}
function
usage
()
{
console
.
log
(
"
Usage: cwb <web component source file> [outputDir=<directory>]
"
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment