@symbo.ls/cli 2.11.23 → 2.11.25
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/convert.js +9 -1
- package/package.json +2 -2
package/bin/convert.js
CHANGED
|
@@ -59,6 +59,7 @@ async function importDomqlModule (modulePath) {
|
|
|
59
59
|
|
|
60
60
|
function convertDomqlModule (domqlModule, desiredFormat, options) {
|
|
61
61
|
let convertedStr = ''
|
|
62
|
+
const whitelist = (options.only ? options.only.split(',') : null)
|
|
62
63
|
|
|
63
64
|
console.group()
|
|
64
65
|
const uniqueImports = []
|
|
@@ -66,11 +67,17 @@ function convertDomqlModule (domqlModule, desiredFormat, options) {
|
|
|
66
67
|
let removeUseContextImport = false
|
|
67
68
|
const exportCount = Object.keys(domqlModule).length
|
|
68
69
|
for (const key in domqlModule) {
|
|
70
|
+
// Skip if not found in whitelist
|
|
71
|
+
if (whitelist && !whitelist.includes(key))
|
|
72
|
+
continue
|
|
73
|
+
|
|
74
|
+
// Skip some components if converting smbls uikit
|
|
69
75
|
if (options.internalUikit &&
|
|
70
76
|
EXCLUDED_FROM_INTERNAL_UIKIT.includes(key)) {
|
|
71
77
|
console.log(`Skipping ${key} component due to exclusion`)
|
|
72
78
|
continue
|
|
73
79
|
}
|
|
80
|
+
|
|
74
81
|
console.log(key)
|
|
75
82
|
try {
|
|
76
83
|
// import('domql-to-mitosis').then(({ convert }) => {
|
|
@@ -115,8 +122,9 @@ program
|
|
|
115
122
|
.option('--angular', 'Convert all DomQL components to Angular')
|
|
116
123
|
.option('--vue2', 'Convert all DomQL components to Vue2')
|
|
117
124
|
.option('--vue3', 'Convert all DomQL components to Vue3')
|
|
125
|
+
.option('-t, --tmp-dir <path>', `Use this directory for storing intermediate & build files instead of the default (dest/${TMP_DIR_NAME})`)
|
|
126
|
+
.option('-o, --only <components>', `Only convert these components; comma separated (for example: --only=Flex,Img)`)
|
|
118
127
|
.option('--internal-uikit', '(For internal use only). Excludes particular components from the conversion')
|
|
119
|
-
.option('--tmp-dir', `Use this directory for storing intermediate & build files instead of the default (dest/${TMP_DIR_NAME})`)
|
|
120
128
|
.action(async (src, dest, options) => {
|
|
121
129
|
// Desired format
|
|
122
130
|
let desiredFormat = 'react'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.25",
|
|
4
4
|
"description": "Fetch your Symbols configuration",
|
|
5
5
|
"main": "bin/fetch.js",
|
|
6
6
|
"author": "Symbols",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"domql-to-mitosis": "latest"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "920a0a24e71053cd1e83cfbd8ee4bd4534f516d6"
|
|
31
31
|
}
|