@anthonylzq/simba.js 7.0.1 → 7.0.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.
package/lib/index.js CHANGED
@@ -92,6 +92,8 @@ const argv = yargs(hideBin(process.argv))
92
92
  .alias('h', 'help')
93
93
  .epilog('Developed by AnthonyLzq').argv
94
94
 
95
+ const PROJECT_VERSION = '0.1.0'
96
+ const MAIN_FILE = 'src/index.ts'
95
97
  /** @type {Config} */
96
98
  const config = {
97
99
  author: '',
@@ -100,11 +102,11 @@ const config = {
100
102
  projectDescription: '',
101
103
  heroku: false,
102
104
  license: 'unlicensed',
103
- version: '0.1.0',
105
+ version: PROJECT_VERSION,
104
106
  licenseYear: CURRENT_YEAR,
105
107
  npm: false,
106
108
  manager: 'yarn add',
107
- mainFile: 'src/index.ts',
109
+ mainFile: MAIN_FILE,
108
110
  fastify: false,
109
111
  graphql: false,
110
112
  tests: true,
@@ -210,17 +212,12 @@ const main = async () => {
210
212
  limitMessage: 'That is not a valid email!'
211
213
  })
212
214
  config.version = readLineSync.question('> Project version (0.1.0): ')
213
- config.version = config.version === '' ? '0.1.0' : config.version
214
-
215
- const licensePos = readLineSync.keyInSelect(
216
- LICENSES,
217
- '> Select your license: ',
218
- {
215
+ config.version = config.version === '' ? PROJECT_VERSION : config.version
216
+ config.license = LICENSES[
217
+ readLineSync.keyInSelect(LICENSES, '> Select your license: ', {
219
218
  cancel: false
220
- }
221
- )
222
-
223
- config.license = LICENSES[licensePos]
219
+ })
220
+ ]
224
221
  .toLowerCase()
225
222
  .replace(/ /g, '-')
226
223
  .replace('d', '')
@@ -249,6 +246,7 @@ const main = async () => {
249
246
  }
250
247
  )
251
248
  config.mainFile = readLineSync.question('> Main file (src/index.ts): ')
249
+ config.mainFile = config.mainFile === '' ? MAIN_FILE : config.mainFile
252
250
  config.tests = readLineSync.keyInYNStrict(
253
251
  '> Would you want to have a basic suit of tests with Jest? ',
254
252
  {
@@ -265,13 +263,18 @@ const main = async () => {
265
263
  )
266
264
  else config.ghat = false
267
265
 
268
- config.database = readLineSync.keyInSelect(
269
- Object.keys(DATABASES),
270
- '> Select your database: ',
271
- {
272
- cancel: false
273
- }
274
- )
266
+ config.database =
267
+ DATABASES[
268
+ Object.keys(DATABASES)[
269
+ readLineSync.keyInSelect(
270
+ Object.keys(DATABASES),
271
+ '> Select your database: ',
272
+ {
273
+ cancel: false
274
+ }
275
+ )
276
+ ]
277
+ ]
275
278
  } else {
276
279
  if (!argv.author) return console.log('Error! An author is required!')
277
280
  else config.author = argv.author
package/lib/src/index.js CHANGED
@@ -96,6 +96,9 @@ module.exports = async ({
96
96
  case 'sqlServer':
97
97
  prodPackages +=
98
98
  ' sequelize sequelize-typescript sequelize-typescript-migration-lts tedious'
99
+ break
100
+ default:
101
+ throw new Error('Wrong database')
99
102
  }
100
103
 
101
104
  const expressDevPackages =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthonylzq/simba.js",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "description": "set up a modern backend app by running one command",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {