@symbo.ls/cli 2.11.329 → 2.11.344

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/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,14 @@ 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')
38
39
  .option('--clean-from-git', 'remove starter-kit git repository', true)
39
40
  .action(async (dest = 'symbols-starter-kit', options) => {
40
41
  // Determine framework
@@ -49,6 +50,7 @@ program
49
50
  framework = 'vue3'
50
51
  }
51
52
  const cloneUrl = REPO_URLS[framework]
53
+ const packageManager = options.packageManager || 'yarn'
52
54
 
53
55
  if (folderExists(dest)) {
54
56
  console.error(`Folder ${dest} already exists!`)
@@ -62,14 +64,30 @@ program
62
64
 
63
65
  const SYMBOLS_FILE_PATH = path.join(process.cwd(), 'symbols.json')
64
66
  addToJson(SYMBOLS_FILE_PATH, 'key', `${dest}.symbo.ls`)
65
- 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
+ }
66
83
 
67
- console.log('Installing Dependencies...')
68
- console.log()
69
- spawnSync('yarn')
70
84
  console.log()
71
- console.log(chalk.green.bold(dest), 'successfuly created!')
72
- 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
+ })
73
91
 
74
92
  if (options.cleanFromGit) {
75
93
  fs.rmSync('.git', {
package/bin/fs.js CHANGED
@@ -7,6 +7,9 @@ import { createPatch } from 'diff'
7
7
 
8
8
  const { deepDestringify, objectToString, joinArrays, isString } = utils
9
9
 
10
+ const LOCAL_CONFIG_PATH =
11
+ process.cwd() + '/node_modules/@symbo.ls/init/dynamic.json'
12
+
10
13
  const keys = ['components', 'snippets', 'pages']
11
14
  const singleFileKeys = ['designSystem', 'state']
12
15
  const defaultExports = ['pages', 'designSystem', 'state']
@@ -148,6 +151,8 @@ export async function createFs (
148
151
 
149
152
  await fs.promises.writeFile(filePath, stringifiedContent, 'utf8')
150
153
  }
154
+
155
+ await fs.writeFileSync(LOCAL_CONFIG_PATH, '{}')
151
156
  }
152
157
 
153
158
  async function findDiff (targetDir, distDir) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "2.11.329",
3
+ "version": "2.11.344",
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": "32cca3d81ac46ff4256421fdaca75de64aeb52ef"
29
+ "gitHead": "880b81015450db5e437d60336ca149dc0bd68fc4"
30
30
  }