@symbo.ls/cli 2.9.2 → 2.9.4
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/fetch.js +1 -1
- package/bin/index.js +1 -2
- package/package.json +2 -3
- package/bin/convert.js +0 -58
package/bin/fetch.js
CHANGED
|
@@ -9,7 +9,7 @@ import { program } from './program.js'
|
|
|
9
9
|
|
|
10
10
|
const PACKAGE_PATH = process.cwd() + '/package.json'
|
|
11
11
|
const RC_PATH = process.cwd() + '/.symbolsrc.json'
|
|
12
|
-
const LOCAL_CONFIG_PATH = process.cwd() + '/node_modules/@symbo.ls/init/dynamic.json'
|
|
12
|
+
const LOCAL_CONFIG_PATH = process.cwd() + '/node_modules/@symbo.ls/init/src/dynamic.json'
|
|
13
13
|
const DEFAULT_REMOTE_REPOSITORY = 'https://github.com/symbo-ls/config-default/'
|
|
14
14
|
const DEFAULT_REMOTE_CONFIG_PATH = 'https://raw.githubusercontent.com/symbo-ls/config-default/main/src/config.json'
|
|
15
15
|
|
package/bin/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/cli",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"description": "Fetch your Symbols configuration",
|
|
5
5
|
"main": "bin/fetch.js",
|
|
6
6
|
"author": "Symbols",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"@symbo.ls/socket": "latest",
|
|
21
21
|
"chalk": "^5.0.0",
|
|
22
22
|
"commander": "^9.4.1",
|
|
23
|
-
"domql-to-mitosis": "latest",
|
|
24
23
|
"esbuild": "latest",
|
|
25
24
|
"node-fetch": "^3.1.0",
|
|
26
25
|
"v8-compile-cache": "^2.3.0"
|
|
@@ -36,5 +35,5 @@
|
|
|
36
35
|
"standard": {
|
|
37
36
|
"parser": "babel-eslint"
|
|
38
37
|
},
|
|
39
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "99277d28d82b494d643faf0251c1595afd041c70"
|
|
40
39
|
}
|
package/bin/convert.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import * as esbuild from 'esbuild'
|
|
4
|
-
import { loadModule } from './require.js'
|
|
5
|
-
import { program } from './program.js'
|
|
6
|
-
import { convert } from 'domql-to-mitosis/asd/convert.js'
|
|
7
|
-
import fs from 'fs'
|
|
8
|
-
import path from 'path'
|
|
9
|
-
|
|
10
|
-
const TMP_DIR_NAME = ".smbls_convert_tmp"
|
|
11
|
-
|
|
12
|
-
program
|
|
13
|
-
.command('convert')
|
|
14
|
-
.description('Recursively convert and copy all DomQL components under a directory')
|
|
15
|
-
.argument('[src]', 'Source directory. By default, it is "."', '.')
|
|
16
|
-
.argument('[dest]', 'Destination directory. By default, it becomes the name of the desired format')
|
|
17
|
-
.option('--react', 'Convert all DomQL components to React')
|
|
18
|
-
.option('--angular', 'Convert all DomQL components to Angular')
|
|
19
|
-
.option('--vue2', 'Convert all DomQL components to Vue2')
|
|
20
|
-
.option('--vue3', 'Convert all DomQL components to Vue3')
|
|
21
|
-
.action(async (src, dest, options) => {
|
|
22
|
-
const srcPath = path.resolve(src)
|
|
23
|
-
const destPath = path.resolve(dest || 'asd')
|
|
24
|
-
const tmpDirPath = path.resolve(path.dirname(destPath), TMP_DIR_NAME)
|
|
25
|
-
|
|
26
|
-
await fs.mkdir(tmpDirPath, async () => {
|
|
27
|
-
const origFiles = await fs.promises.readdir(srcPath)
|
|
28
|
-
console.log(origFiles)
|
|
29
|
-
|
|
30
|
-
await esbuild.build({
|
|
31
|
-
entryPoints: origFiles.map(file => path.join(srcPath, file, '/index.js')),
|
|
32
|
-
bundle: true,
|
|
33
|
-
target: 'node12',
|
|
34
|
-
format: 'cjs',
|
|
35
|
-
outdir: tmpDirPath
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
const files = await fs.promises.readdir(tmpDirPath)
|
|
39
|
-
for (const file of files) {
|
|
40
|
-
if (file === 'atoms') continue
|
|
41
|
-
|
|
42
|
-
let filePath = path.join(tmpDirPath, file)
|
|
43
|
-
|
|
44
|
-
if ((await fs.promises.stat(filePath)).isDirectory()) {
|
|
45
|
-
console.log(`importing ${filePath}`)
|
|
46
|
-
const domqlModule = (await import(`${filePath}/index.js`)).default
|
|
47
|
-
console.log(domqlModule)
|
|
48
|
-
for (const key in domqlModule) {
|
|
49
|
-
const component = domqlModule[key]
|
|
50
|
-
console.group(key)
|
|
51
|
-
console.log('========================', key)
|
|
52
|
-
convert(component, 'react')
|
|
53
|
-
console.groupEnd(key)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
})
|