@symbo.ls/cli 2.11.344 → 2.11.353

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/fs.js CHANGED
@@ -89,9 +89,13 @@ export async function createFs (
89
89
  } else {
90
90
  await overrideFiles(cacheDir, targetDir)
91
91
  console.log('Files overridden successfully.')
92
+ console.log()
93
+ console.log(chalk.dim('\n----------------\n'))
92
94
  }
93
95
  } else {
94
96
  console.log('No differences found.')
97
+ console.log()
98
+ console.log(chalk.dim('\n----------------\n'))
95
99
  }
96
100
  }
97
101
 
@@ -152,6 +156,24 @@ export async function createFs (
152
156
  await fs.promises.writeFile(filePath, stringifiedContent, 'utf8')
153
157
  }
154
158
 
159
+ // Generate final package.json string
160
+ // function createPackageJson (key, data, distDir, update) {
161
+ // const genStr = JSON.stringify({
162
+ // name: `@symbo.ls/${desiredFormat}-${packageName}`,
163
+ // version: packageStruct.version ?? '1.0.0',
164
+ // license: packageStruct.license ?? 'UNLICENSED',
165
+ // dependencies: deps,
166
+ // peerDependencies: {
167
+ // smbls: '^18.2.0',
168
+ // 'react-dom': '^18.2.0'
169
+ // },
170
+ // main: 'index.js',
171
+ // source: 'index.js'
172
+ // }, undefined, 2)
173
+
174
+ // fs.writeFileSync(destPath, genStr)
175
+ // }
176
+
155
177
  await fs.writeFileSync(LOCAL_CONFIG_PATH, '{}')
156
178
  }
157
179
 
@@ -6,21 +6,21 @@ export default [
6
6
  'css-in-props',
7
7
  '@symbo.ls/default-config',
8
8
  '@symbo.ls/emotion',
9
- '@symbo.ls/fetch',
10
9
  '@symbo.ls/init',
10
+ '@symbo.ls/fetch',
11
11
  '@symbo.ls/preview',
12
12
  '@symbo.ls/scratch',
13
- '@symbo.ls/socket-ui',
14
13
  'smbls',
14
+ '@symbo.ls/socket-ui',
15
15
  '@symbo.ls/socket',
16
- '@symbo.ls/utils',
17
16
  '@symbo.ls/uikit',
17
+ '@symbo.ls/utils',
18
18
  '@symbo.ls/default-icons',
19
19
  '@symbo.ls/feather-icons',
20
20
  '@symbo.ls/fluent-icons',
21
21
  '@symbo.ls/material-icons',
22
- '@symbo.ls/editorjs',
23
22
  '@symbo.ls/google-maps',
23
+ '@symbo.ls/editorjs',
24
24
  '@symbo.ls/helmet',
25
25
  '@symbo.ls/markdown',
26
26
  '@symbo.ls/atoms',
@@ -39,13 +39,13 @@ export default [
39
39
  '@symbo.ls/icon',
40
40
  '@symbo.ls/indicator',
41
41
  '@symbo.ls/input',
42
- '@symbo.ls/link',
43
42
  '@symbo.ls/label',
43
+ '@symbo.ls/link',
44
44
  '@symbo.ls/list',
45
- '@symbo.ls/notification',
46
45
  '@symbo.ls/modal',
47
46
  '@symbo.ls/paragraphbutton',
48
47
  '@symbo.ls/pills',
48
+ '@symbo.ls/notification',
49
49
  '@symbo.ls/progress',
50
50
  '@symbo.ls/range',
51
51
  '@symbo.ls/select',
@@ -53,8 +53,8 @@ export default [
53
53
  '@symbo.ls/slider',
54
54
  '@symbo.ls/sociallink',
55
55
  '@symbo.ls/steps',
56
- '@symbo.ls/tab',
57
56
  '@symbo.ls/table',
57
+ '@symbo.ls/tab',
58
58
  '@symbo.ls/threejs',
59
59
  '@symbo.ls/timepicker',
60
60
  '@symbo.ls/tooltip',
package/bin/sync.js CHANGED
@@ -4,11 +4,14 @@ import chalk from 'chalk'
4
4
  import { program } from './program.js'
5
5
  import { loadModule } from './require.js'
6
6
  import { updateDynamycFile } from '@symbo.ls/socket'
7
+ import * as utils from '@domql/utils'
7
8
 
8
9
  import * as socketClient from '@symbo.ls/socket/client.js'
9
10
  import { fetchFromCli } from './fetch.js'
10
11
  import { convertFromCli } from './convert.js'
11
12
 
13
+ const { debounce } = utils.default
14
+
12
15
  const SOCKET_API_URL_LOCAL = 'http://localhost:13336/'
13
16
  const SOCKET_API_URL = 'https://socket.symbols.app/'
14
17
 
@@ -28,6 +31,7 @@ program
28
31
  .option('-k, --key', 'Bypass the symbols.json key, overriding the key manually')
29
32
  .option('-f, --fetch', 'Verbose errors and warnings', true)
30
33
  .option('--convert', 'Verbose errors and warnings', true)
34
+ .option('--update', 'overriding changes from platform', true)
31
35
  .option('--verbose-code', 'Verbose errors and warnings')
32
36
  .action(async (opts) => {
33
37
  const { dev, verbose, fetch: fetchOpt, convert: convertOpt } = opts
@@ -46,8 +50,8 @@ program
46
50
 
47
51
  await rc.then(symbolsrc => {
48
52
  const options = { ...symbolsrc, ...opts }
49
- const { framework } = symbolsrc
50
- const key = symbolsrc.key || opts.key
53
+ const { framework, distDir, prettify, verboseCode } = options
54
+ const key = options.key || opts.key
51
55
  const socketUrl = dev ? SOCKET_API_URL_LOCAL : SOCKET_API_URL
52
56
 
53
57
  console.log('Connecting to:', chalk.bold(socketUrl))
@@ -61,7 +65,7 @@ program
61
65
  console.log('Socket id:', id)
62
66
  console.log(chalk.dim('\nListening to updates...\n'))
63
67
  },
64
- onChange: (event, data) => {
68
+ onChange: debounce(async (event, data) => {
65
69
  if (event === 'clients') {
66
70
  console.log(
67
71
  'Active clients:',
@@ -70,25 +74,26 @@ program
70
74
  return
71
75
  }
72
76
 
73
- data = JSON.parse(data)
74
- const d = {}
75
- const {
76
- PROJECT_DESIGN_SYSTEM,
77
- PROJECT_STATE,
78
- PROJECT_COMPONENTS,
79
- PROJECT_SNIPPETS,
80
- PROJECT_PAGES,
81
- DATA
82
- } = data
83
- if (PROJECT_DESIGN_SYSTEM) d.designSystem = PROJECT_DESIGN_SYSTEM
84
- if (PROJECT_STATE) d.state = PROJECT_STATE
85
- if (PROJECT_COMPONENTS) d.components = PROJECT_COMPONENTS
86
- if (DATA && DATA.components) d.components = DATA.components
87
- if (PROJECT_SNIPPETS) d.snippets = PROJECT_SNIPPETS
88
- if (PROJECT_PAGES) d.pages = PROJECT_PAGES
77
+ const parseData = JSON.parse(data)
78
+ const d = parseData && parseData.DATA
79
+
80
+ if (!d) return
89
81
 
90
82
  if (Object.keys(d).length) {
91
- updateDynamycFile(d, { framework, ...options })
83
+ console.log(chalk.dim('\n----------------\n'))
84
+ console.log(chalk.dim('Received update:'))
85
+ console.log(Object.keys(d).join(', '))
86
+ if (verboseCode) console.log(chalk.dim(JSON.stringify(d, null, prettify ?? 2)))
87
+
88
+ if (distDir) {
89
+ if (fetchOpt) {
90
+ await fetchFromCli(options)
91
+ console.log(chalk.dim('\n----------------\n'))
92
+ return
93
+ }
94
+ } else {
95
+ updateDynamycFile(d, { framework, ...options })
96
+ }
92
97
  }
93
98
 
94
99
  if (d.components && convertOpt && framework) {
@@ -96,7 +101,7 @@ program
96
101
  ...options, framework
97
102
  })
98
103
  }
99
- },
104
+ }, 1500),
100
105
  onError: (err, socket) => {
101
106
  console.log(chalk.bold.green('Error during connection'))
102
107
  if (verbose) console.error(err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "2.11.344",
3
+ "version": "2.11.353",
4
4
  "description": "Fetch your Symbols configuration",
5
5
  "main": "bin/fetch.js",
6
6
  "author": "Symbols",
@@ -26,5 +26,5 @@
26
26
  "node-fetch": "^3.1.0",
27
27
  "v8-compile-cache": "^2.3.0"
28
28
  },
29
- "gitHead": "880b81015450db5e437d60336ca149dc0bd68fc4"
29
+ "gitHead": "c5d01a30797fc044b539a5309a879f6b249e3888"
30
30
  }