@toptal/davinci-code 1.5.4-alpha-FX-2734-upgrade-cypress.118 → 1.5.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`1212e098`](https://github.com/toptal/davinci/commit/1212e098c668fc1c87ee9b1824edf0bc80509bc4)]:
8
+ - @toptal/davinci-cli-shared@1.5.2
9
+
3
10
  ## 1.5.3
4
11
 
5
12
  ### Patch Changes
@@ -2,22 +2,26 @@ const DEFAULT_NEWCOMPONENT_COMMAND = 'new'
2
2
 
3
3
  module.exports = {
4
4
  prompt: ({ prompter, args }) => {
5
- let argvName = process.argv[process.argv.length - 2]
6
- let argvModuleName = process.argv[process.argv.length - 1]
5
+ const argvName = process.argv[process.argv.length - 2]
6
+ const argvModuleName = process.argv[process.argv.length - 1]
7
7
 
8
8
  if (argvName && argvName !== DEFAULT_NEWCOMPONENT_COMMAND) {
9
9
  return Promise.resolve({ name: argvName, moduleName: argvModuleName })
10
10
  } else if (args.name && args.moduleName) {
11
11
  return Promise.resolve({ name: args.name, moduleName: args.moduleName })
12
12
  }
13
- return prompter.prompt([{
14
- type: 'input',
15
- name: 'name',
16
- message: "What's the component name?"
17
- }, {
18
- type: 'input',
19
- name: 'moduleName',
20
- message: "What's the module name?"
21
- }])
13
+
14
+ return prompter.prompt([
15
+ {
16
+ type: 'input',
17
+ name: 'name',
18
+ message: "What's the component name?"
19
+ },
20
+ {
21
+ type: 'input',
22
+ name: 'moduleName',
23
+ message: "What's the module name?"
24
+ }
25
+ ])
22
26
  }
23
27
  }
@@ -2,13 +2,14 @@ const DEFAULT_NEWCOMPONENT_COMMAND = 'new'
2
2
 
3
3
  module.exports = {
4
4
  prompt: ({ prompter, args }) => {
5
- let argvName = process.argv[process.argv.length - 1]
5
+ const argvName = process.argv[process.argv.length - 1]
6
6
 
7
7
  if (argvName && argvName !== DEFAULT_NEWCOMPONENT_COMMAND) {
8
8
  return Promise.resolve({ name: argvName })
9
9
  } else if (args.name) {
10
10
  return Promise.resolve({ name: args.name })
11
11
  }
12
+
12
13
  return prompter.prompt({
13
14
  type: 'input',
14
15
  name: 'name',
@@ -2,22 +2,26 @@ const DEFAULT_NEWCOMPONENT_COMMAND = 'new'
2
2
 
3
3
  module.exports = {
4
4
  prompt: ({ prompter, args }) => {
5
- let argvName = process.argv[process.argv.length - 2]
6
- let argvModuleName = process.argv[process.argv.length - 1]
5
+ const argvName = process.argv[process.argv.length - 2]
6
+ const argvModuleName = process.argv[process.argv.length - 1]
7
7
 
8
8
  if (argvName && argvName !== DEFAULT_NEWCOMPONENT_COMMAND) {
9
9
  return Promise.resolve({ name: argvName, moduleName: argvModuleName })
10
10
  } else if (args.name && args.moduleName) {
11
11
  return Promise.resolve({ name: args.name, moduleName: args.moduleName })
12
12
  }
13
- return prompter.prompt([{
14
- type: 'input',
15
- name: 'name',
16
- message: "What's the page name?"
17
- }, {
18
- type: 'input',
19
- name: 'moduleName',
20
- message: "What's the module name?"
21
- }])
13
+
14
+ return prompter.prompt([
15
+ {
16
+ type: 'input',
17
+ name: 'name',
18
+ message: "What's the page name?"
19
+ },
20
+ {
21
+ type: 'input',
22
+ name: 'moduleName',
23
+ message: "What's the module name?"
24
+ }
25
+ ])
22
26
  }
23
27
  }
@@ -5,12 +5,10 @@ const cliEngine = require('@toptal/davinci-cli-shared')
5
5
  const moduleCommandCreator = require('../src/commands/module')
6
6
  const componentCommandCreator = require('../src/commands/component')
7
7
 
8
- cliEngine.loadCommands([
9
- moduleCommandCreator,
10
- componentCommandCreator
11
- ])
8
+ cliEngine.loadCommands([moduleCommandCreator, componentCommandCreator])
12
9
 
13
- cliEngine.help(() => `
10
+ cliEngine.help(
11
+ () => `
14
12
  Commands:
15
13
 
16
14
  help [command...] Provides help for a given command
@@ -25,8 +23,8 @@ Commands:
25
23
 
26
24
  const args = cliEngine.bootstrap({ use: 'minimist' })
27
25
 
28
- cliEngine.catchErrorCommand((args, cb) => {
29
- cliEngine.execCommand(`new ${args.commands.join(' ')}`)
26
+ cliEngine.catchErrorCommand((parsedArgs, cb) => {
27
+ cliEngine.execCommand(`new ${parsedArgs.commands.join(' ')}`)
30
28
  cb()
31
29
  })
32
30
 
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@toptal/davinci-code",
3
+ "version": "1.5.4",
4
+ "description": "Code generation package for frontend applications",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "keywords": [
9
+ "code",
10
+ "templates",
11
+ "generator"
12
+ ],
13
+ "author": "Toptal",
14
+ "homepage": "https://github.com/toptal/davinci/tree/master/packages/code#readme",
15
+ "license": "ISC",
16
+ "bin": {
17
+ "davinci-code": "./bin/davinci-code.js"
18
+ },
19
+ "main": "./src/index.js",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/toptal/davinci.git"
23
+ },
24
+ "scripts": {
25
+ "build:package": "../../bin/build-package.js",
26
+ "prepublishOnly": "../../bin/prepublish.js",
27
+ "test": "echo \"Error: run tests from root\" && exit 1"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/toptal/davinci/issues"
31
+ },
32
+ "dependencies": {
33
+ "@toptal/davinci-cli-shared": "1.5.2",
34
+ "hygen": "^6.1.0",
35
+ "lodash.camelcase": "^4.3.0",
36
+ "lodash.kebabcase": "^4.1.1"
37
+ }
38
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/davinci-code",
3
- "version": "1.5.4-alpha-FX-2734-upgrade-cypress.118+ac801e68",
3
+ "version": "1.5.4",
4
4
  "description": "Code generation package for frontend applications",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,10 +30,9 @@
30
30
  "url": "https://github.com/toptal/davinci/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@toptal/davinci-cli-shared": "1.5.2-alpha-FX-2734-upgrade-cypress.125+ac801e68",
33
+ "@toptal/davinci-cli-shared": "1.5.2",
34
34
  "hygen": "^6.1.0",
35
35
  "lodash.camelcase": "^4.3.0",
36
36
  "lodash.kebabcase": "^4.1.1"
37
- },
38
- "gitHead": "ac801e68bf3fb45dc8769c859f14632885734b7e"
37
+ }
39
38
  }
@@ -12,7 +12,7 @@ const componentCommandCreator = {
12
12
  const componentName = camelCase(name)
13
13
  const componentModuleName = kebabCase(moduleName || CORE_MODULE)
14
14
  const template = camelCase(templateName)
15
-
15
+
16
16
  print.green(
17
17
  'Creating new',
18
18
  componentName,
package/src/index.js CHANGED
@@ -2,8 +2,5 @@ const moduleCommandCreator = require('./commands/module')
2
2
  const componentCommandCreator = require('./commands/component')
3
3
 
4
4
  module.exports = {
5
- commands: [
6
- moduleCommandCreator,
7
- componentCommandCreator
8
- ]
5
+ commands: [moduleCommandCreator, componentCommandCreator]
9
6
  }
package/src/templates.js CHANGED
@@ -18,7 +18,9 @@ const generateModule = name =>
18
18
 
19
19
  const generate = (template, name, moduleName) => {
20
20
  const customTemplatesDir = './_templates'
21
- const customTemplateDirExists = checkDirExists(`${customTemplatesDir}/${template}/new`)
21
+ const customTemplateDirExists = checkDirExists(
22
+ `${customTemplatesDir}/${template}/new`
23
+ )
22
24
 
23
25
  if (customTemplateDirExists) {
24
26
  return runSync('yarn', ['hygen', template, 'new', name, moduleName], {