@symbo.ls/cli 2.28.1 → 2.28.2

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.
Files changed (2) hide show
  1. package/bin/fetch.js +22 -12
  2. package/package.json +5 -5
package/bin/fetch.js CHANGED
@@ -8,20 +8,20 @@ import * as fetch from '@symbo.ls/fetch'
8
8
  import * as utils from '@domql/utils'
9
9
  import { convertFromCli } from './convert.js'
10
10
  import { createFs } from './fs.js'
11
- const { isObjectLike } = (utils.default || utils)
12
- const { fetchRemote } = (fetch.default || fetch)
11
+ const { isObjectLike } = utils.default || utils
12
+ const { fetchRemote } = fetch.default || fetch
13
13
 
14
14
  const RC_PATH = process.cwd() + '/symbols.json'
15
15
  const LOCAL_CONFIG_PATH =
16
16
  process.cwd() + '/node_modules/@symbo.ls/init/dynamic.json'
17
17
  const DEFAULT_REMOTE_REPOSITORY = 'https://github.com/symbo-ls/default-config/'
18
- const DEFAULT_REMOTE_CONFIG_PATH = "https://api.symbols.app/"; // eslint-disable-line
18
+ const DEFAULT_REMOTE_CONFIG_PATH = 'https://api.symbols.app/' // eslint-disable-line
19
19
 
20
20
  const API_URL_LOCAL = 'http://localhost:13335/get'
21
21
  const API_URL = 'https://api.symbols.app/get'
22
22
 
23
- const rcFile = loadModule(RC_PATH); // eslint-disable-line
24
- const localConfig = loadModule(LOCAL_CONFIG_PATH); // eslint-disable-line
23
+ const rcFile = loadModule(RC_PATH) // eslint-disable-line
24
+ const localConfig = loadModule(LOCAL_CONFIG_PATH) // eslint-disable-line
25
25
 
26
26
  const debugMsg = chalk.dim(
27
27
  'Use --verbose to debug the error or open the issue at https://github.com/symbo-ls/smbls'
@@ -29,24 +29,32 @@ const debugMsg = chalk.dim(
29
29
 
30
30
  let rc = {}
31
31
  try {
32
- rc = loadModule(RC_PATH); // eslint-disable-line
32
+ rc = loadModule(RC_PATH) // eslint-disable-line
33
33
  } catch (e) {
34
34
  console.error('Please include symbols.json to your root of respository')
35
35
  }
36
36
 
37
- export const fetchFromCli = async (opts) => {
38
- const { dev, verbose, prettify, convert: convertOpt, metadata: metadataOpt, update, force } = opts
39
- await rc.then(async (data) => {
37
+ export const fetchFromCli = async opts => {
38
+ const {
39
+ dev,
40
+ verbose,
41
+ prettify,
42
+ convert: convertOpt,
43
+ metadata: metadataOpt,
44
+ update,
45
+ force
46
+ } = opts
47
+ await rc.then(async data => {
40
48
  const { key, framework, distDir, metadata } = data
41
49
 
42
- const endpoint = dev ? API_URL_LOCAL : API_URL
50
+ const endpoint = dev || utils.isLocal() ? API_URL_LOCAL : API_URL
43
51
 
44
52
  console.log('\nFetching from:', chalk.bold(endpoint), '\n')
45
53
 
46
54
  const body = await fetchRemote(key, {
47
55
  endpoint,
48
56
  metadata: metadata || metadataOpt,
49
- onError: (e) => {
57
+ onError: e => {
50
58
  console.log(chalk.red('Failed to fetch:'), key)
51
59
  if (verbose) console.error(e)
52
60
  else console.log(debugMsg)
@@ -111,7 +119,9 @@ export const fetchFromCli = async (opts) => {
111
119
  }
112
120
 
113
121
  console.log()
114
- console.warn('No --dist-dir option or "distDir" in symbols.json provided. Saving in ./node_modules/@symbo.ls/init/dynamic.json.')
122
+ console.warn(
123
+ 'No --dist-dir option or "distDir" in symbols.json provided. Saving in ./node_modules/@symbo.ls/init/dynamic.json.'
124
+ )
115
125
  return {}
116
126
  }
117
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "2.28.1",
3
+ "version": "2.28.2",
4
4
  "description": "Fetch your Symbols configuration",
5
5
  "main": "bin/fetch.js",
6
6
  "author": "Symbols",
@@ -15,9 +15,9 @@
15
15
  "vpatch": "npm version patch && npm publish"
16
16
  },
17
17
  "dependencies": {
18
- "@symbo.ls/fetch": "^2.28.1",
19
- "@symbo.ls/init": "^2.28.1",
20
- "@symbo.ls/socket": "^2.28.1",
18
+ "@symbo.ls/fetch": "^2.28.2",
19
+ "@symbo.ls/init": "^2.28.2",
20
+ "@symbo.ls/socket": "^2.28.2",
21
21
  "chalk": "^5.4.1",
22
22
  "commander": "^13.1.0",
23
23
  "diff": "^5.2.0",
@@ -26,5 +26,5 @@
26
26
  "node-fetch": "^3.3.2",
27
27
  "v8-compile-cache": "^2.4.0"
28
28
  },
29
- "gitHead": "371cc070cdca345fcd7ea73558d336a03c847825"
29
+ "gitHead": "3c5e8b68269799a0e2382f9c79c51e41f33863bf"
30
30
  }