@symbo.ls/cli 2.28.72 → 2.28.75

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
@@ -35,8 +35,14 @@ program
35
35
  .option('--angular', 'Use Angular in the project')
36
36
  .option('--vue2', 'Use Vue2 in the project')
37
37
  .option('--vue3', 'Use Vue3 in the project')
38
- .option('--package-manager <manager>', 'Choose the package manager (e.g., npm, yarn)', 'npm')
38
+ .option(
39
+ '--package-manager <manager>',
40
+ 'Choose the package manager (e.g., npm, yarn)',
41
+ 'npm'
42
+ )
39
43
  .option('--clean-from-git', 'remove starter-kit git repository', true)
44
+ .option('--no-dependencies', 'Skip installing dependencies')
45
+ .option('--no-clone', 'Create folder instead of cloning from git')
40
46
  .action(async (dest = 'symbols-starter-kit', options) => {
41
47
  // Determine framework
42
48
  let framework = 'domql'
@@ -57,39 +63,79 @@ program
57
63
  return
58
64
  }
59
65
 
60
- console.log(`Cloning ${cloneUrl} into '${dest}'...`)
61
- execSync(`git clone ${options.remote ? ' -b feature/remote' : ''} ${cloneUrl} ${dest}`)
66
+ if (options.clone) {
67
+ console.log(`Cloning ${cloneUrl} into '${dest}'...`)
68
+ execSync(
69
+ `git clone ${
70
+ options.remote ? ' -b feature/remote' : ''
71
+ } ${cloneUrl} ${dest}`
72
+ )
73
+ } else {
74
+ console.log(`Creating directory '${dest}'...`)
75
+ fs.mkdirSync(dest, { recursive: true })
76
+ }
62
77
 
63
78
  process.chdir(dest)
64
79
 
65
80
  const SYMBOLS_FILE_PATH = path.join(process.cwd(), 'symbols.json')
66
- addToJson(SYMBOLS_FILE_PATH, 'key', `${dest}.symbo.ls`)
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
81
 
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
- })
82
+ // Create symbols.json if not using clone
83
+ if (!options.clone) {
84
+ const initialSymbolsJson = {
85
+ key: `${dest}.symbo.ls`,
86
+ packageManager: packageManager
87
+ }
88
+ fs.writeFileSync(
89
+ SYMBOLS_FILE_PATH,
90
+ JSON.stringify(initialSymbolsJson, null, 2)
91
+ )
92
+ console.log('Created symbols.json file')
80
93
  } else {
81
- console.log(chalk.dim('Use --verbose to print the output'))
94
+ addToJson(SYMBOLS_FILE_PATH, 'key', `${dest}.symbo.ls`)
95
+ addToJson(SYMBOLS_FILE_PATH, 'packageManager', `${packageManager}`)
82
96
  }
83
97
 
84
- console.log()
98
+ if (options.dependencies) {
99
+ console.log(`Installing dependencies using ${packageManager}...`)
100
+
101
+ const exc = exec(packageManager === 'yarn' ? 'yarn' : 'npm i')
85
102
 
86
- exc.on('close', (code) => {
103
+ if (options.verbose) {
104
+ exc.stdout.on('data', data => {
105
+ console.log(data)
106
+ })
107
+ exc.stderr.on('data', data => {
108
+ console.error(data)
109
+ })
110
+ } else {
111
+ console.log(chalk.dim('Use --verbose to print the output'))
112
+ }
113
+
114
+ console.log()
115
+
116
+ exc.on('close', code => {
117
+ console.log()
118
+ console.log(chalk.green.bold(dest), 'successfuly created!')
119
+ console.log(
120
+ `Done! run \`${chalk.bold(
121
+ 'cd ' + dest + '; ' + packageManager + ' start'
122
+ )}\` to start the development server.`
123
+ )
124
+ })
125
+ } else {
126
+ console.log(
127
+ chalk.dim('Skipping dependency installation (--no-dependencies)')
128
+ )
87
129
  console.log()
88
130
  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
- })
131
+ console.log(
132
+ `Done! Now run \`${chalk.bold(
133
+ 'cd ' + dest
134
+ )}\` and install dependencies manually.`
135
+ )
136
+ }
91
137
 
92
- if (options.cleanFromGit) {
138
+ if (options.cleanFromGit && options.clone) {
93
139
  fs.rmSync('.git', {
94
140
  recursive: true,
95
141
  force: true
package/bin/fetch.js CHANGED
@@ -45,7 +45,7 @@ export const fetchFromCli = async opts => {
45
45
  force
46
46
  } = opts
47
47
  await rc.then(async data => {
48
- const { key, framework, distDir, metadata } = data
48
+ const { key, framework, distDir, metadata } = data || {}
49
49
 
50
50
  const endpoint = dev || utils.isLocal() ? API_URL_LOCAL : API_URL
51
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/cli",
3
- "version": "2.28.72",
3
+ "version": "2.28.75",
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.72",
19
- "@symbo.ls/init": "^2.28.72",
20
- "@symbo.ls/socket": "^2.28.72",
18
+ "@symbo.ls/fetch": "^2.28.75",
19
+ "@symbo.ls/init": "^2.28.75",
20
+ "@symbo.ls/socket": "^2.28.75",
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": "cc717713f9bbbdba8c6bca168d0661871969c23f"
29
+ "gitHead": "4874ca45cbb46acbff14a2eee7c3bd9b656b1300"
30
30
  }