@symbo.ls/cli 0.6.9 → 0.6.17

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 CHANGED
@@ -1,14 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import 'v8-compile-cache'
4
- import { createRequire } from 'module'
4
+ import { loadModule } from './require.js'
5
5
  import { Command } from 'commander'
6
6
  import fetch from 'node-fetch'
7
7
  import chalk from 'chalk'
8
- import fs from 'fs'
9
8
 
10
- const require = createRequire(import.meta.url)
11
- const pkg = require('../package.json')
9
+ const pkg = loadModule('../package.json')
12
10
  const program = new Command()
13
11
 
14
12
  const API_URL = 'https://api.symbols.app/' // eslint-disable-line
@@ -17,20 +15,6 @@ const DEFAULT_CONFIG = 'https://raw.githubusercontent.com/symbo-ls/uikit/8e7026a
17
15
  program
18
16
  .version(pkg.version)
19
17
 
20
- // program
21
- // .command('login [destination]')
22
- // .description('Sign in to Symbols')
23
- // .argument('<username>', 'user to login')
24
- // .argument('[password]', 'password for user, if required', 'no password given')
25
- // .action(async (username, password) => {
26
- // console.log('username:', username)
27
- // console.log('password:', password)
28
-
29
- // const response = await fetch(API_URL)
30
- // const body = await response.json()
31
- // console.log(body)
32
- // })
33
-
34
18
  program
35
19
  .command('fetch [destination]')
36
20
  .description('Fetch symbols')
package/bin/login.js ADDED
@@ -0,0 +1,15 @@
1
+ 'use strict'
2
+
3
+ program
4
+ .command('login [destination]')
5
+ .description('Sign in to Symbols')
6
+ .argument('<username>', 'user to login')
7
+ .argument('[password]', 'password for user, if required', 'no password given')
8
+ .action(async (username, password) => {
9
+ console.log('username:', username)
10
+ console.log('password:', password)
11
+
12
+ const response = await fetch(API_URL)
13
+ const body = await response.json()
14
+ console.log(body)
15
+ })
package/bin/require.js ADDED
@@ -0,0 +1,10 @@
1
+ class ImportError extends Error {}
2
+
3
+ export const loadModule = async (modulePath) => {
4
+ try {
5
+ return await import(modulePath)
6
+ } catch (e) {
7
+ console.warn('Cant found', modulePath)
8
+ // throw new ImportError(`Unable to import module ${modulePath}`)
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "0.6.9",
3
+ "version": "0.6.17",
4
4
  "description": "Fetch your Symbols configuration",
5
- "main": "index.js",
5
+ "main": "bin/fetch.js",
6
6
  "author": "Symbols",
7
7
  "license": "MIT",
8
8
  "private": false,
@@ -11,15 +11,17 @@
11
11
  "symbo-ls": "bin/fetch.js"
12
12
  },
13
13
  "scripts": {
14
- "start": "node bin/fetch.js"
14
+ "start": "node bin/fetch.js",
15
+ "vpush": "git add . && git commit -am 'version update' && git push",
16
+ "vpatch": "npm version patch && npm publish"
15
17
  },
16
18
  "dependencies": {
17
19
  "chalk": "^5.0.0",
18
- "node-fetch": "^3.1.0"
19
- },
20
- "devDependencies": {
20
+ "node-fetch": "^3.1.0",
21
21
  "commander": "^8.3.0",
22
22
  "v8-compile-cache": "^2.3.0"
23
23
  },
24
- "gitHead": "fa58769cac66c692cb8d39d37a51d017586dde57"
24
+ "devDependencies": {
25
+ "np": "^7.6.0"
26
+ }
25
27
  }