@symbo.ls/cli 2.11.328 → 2.11.330

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 CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  // import chalk from 'chalk'
4
4
  import { program } from './program.js'
5
- import convert, { convertDomqlModule } from '@symbo.ls/convert'
5
+ // import convert, { convertDomqlModule } from '@symbo.ls/convert'
6
6
 
7
7
  const TMP_DIR_NAME = '.smbls_convert_tmp'
8
8
 
9
9
  export function convertFromCli (data, opts) {
10
- const { framework, verbose, verboseCode } = opts
11
- const convertedStrings = convertDomqlModule(data, null, framework)
12
- if (verboseCode) console.log(convertedStrings)
13
- return verbose
10
+ // const { framework, verbose, verboseCode } = opts
11
+ // // const convertedStrings = convertDomqlModule(data, null, framework)
12
+ // if (verboseCode) console.log(convertedStrings)
13
+ // return verbose
14
14
  }
15
15
 
16
16
  program
@@ -36,4 +36,4 @@ program
36
36
  .option('--internal-uikit',
37
37
  '(For internal use only). ' +
38
38
  'Excludes particular components from the conversion')
39
- .action(convert)
39
+ .action(convertFromCli)
package/bin/create.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import chalk from 'chalk'
4
4
  import fs from 'fs'
5
5
  import path from 'path'
6
- import { execSync, spawnSync } from 'child_process'
6
+ import { exec, execSync } from 'child_process'
7
7
  import { program } from './program.js'
8
8
  import { addToJson } from './init-helpers/addToJson.js'
9
9
 
@@ -28,13 +28,15 @@ program
28
28
  .command('create')
29
29
  .description('Create and initialize a new project')
30
30
  .argument('dest', 'Project directory')
31
+ .option('--verbose', 'Verbose output')
31
32
  .option('--remote', 'Fetch from platform', true)
32
33
  .option('--domql', 'Use DOMQL in the project', true)
33
34
  .option('--react', 'Use React in the project (default)')
34
35
  .option('--angular', 'Use Angular in the project')
35
36
  .option('--vue2', 'Use Vue2 in the project')
36
37
  .option('--vue3', 'Use Vue3 in the project')
37
- .option('--yarn', 'Install via yarn', true)
38
+ .option('--package-manager <manager>', 'Choose the package manager (e.g., npm, yarn)', 'npm')
39
+ .option('--clean-from-git', 'remove starter-kit git repository', true)
38
40
  .action(async (dest = 'symbols-starter-kit', options) => {
39
41
  // Determine framework
40
42
  let framework = 'domql'
@@ -48,6 +50,7 @@ program
48
50
  framework = 'vue3'
49
51
  }
50
52
  const cloneUrl = REPO_URLS[framework]
53
+ const packageManager = options.packageManager || 'yarn'
51
54
 
52
55
  if (folderExists(dest)) {
53
56
  console.error(`Folder ${dest} already exists!`)
@@ -61,12 +64,35 @@ program
61
64
 
62
65
  const SYMBOLS_FILE_PATH = path.join(process.cwd(), 'symbols.json')
63
66
  addToJson(SYMBOLS_FILE_PATH, 'key', `${dest}.symbo.ls`)
64
- addToJson(SYMBOLS_FILE_PATH, 'packageManager', `${options.yarn ? 'yarn' : 'npm'}`)
67
+ addToJson(SYMBOLS_FILE_PATH, 'packageManager', `${packageManager}`)
68
+
69
+ console.log(`Installing dependencies using ${packageManager}...`)
70
+
71
+ const exc = exec(packageManager === 'yarn' ? 'yarn' : 'npm i')
72
+
73
+ if (options.verbose) {
74
+ exc.stdout.on('data', (data) => {
75
+ console.log(data)
76
+ })
77
+ exc.stderr.on('data', (data) => {
78
+ console.error(data)
79
+ })
80
+ } else {
81
+ console.log(chalk.dim('Use --verbose to print the output'))
82
+ }
65
83
 
66
- console.log('Installing Dependencies...')
67
- console.log()
68
- spawnSync('yarn')
69
84
  console.log()
70
- console.log(chalk.green.bold(dest), 'successfuly created!')
71
- console.log(`Done! run \`${chalk.bold('npm start')}\` to start the development server.`)
85
+
86
+ exc.on('close', (code) => {
87
+ console.log()
88
+ console.log(chalk.green.bold(dest), 'successfuly created!')
89
+ console.log(`Done! run \`${chalk.bold('cd ' + dest + '; ' + packageManager + ' start')}\` to start the development server.`)
90
+ })
91
+
92
+ if (options.cleanFromGit) {
93
+ fs.rmSync('.git', {
94
+ recursive: true,
95
+ force: true
96
+ })
97
+ }
72
98
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "2.11.328",
3
+ "version": "2.11.330",
4
4
  "description": "Fetch your Symbols configuration",
5
5
  "main": "bin/fetch.js",
6
6
  "author": "Symbols",
@@ -26,8 +26,5 @@
26
26
  "node-fetch": "^3.1.0",
27
27
  "v8-compile-cache": "^2.3.0"
28
28
  },
29
- "peerDependencies": {
30
- "@symbo.ls/convert": "latest"
31
- },
32
- "gitHead": "2fe729a3a00c5badf8ef0b56d67af1aa041f56d9"
29
+ "gitHead": "ad749737e40e7ddab38da2ed89548a6e0d2c4173"
33
30
  }