@toptal/davinci-bootstrap 3.1.12 → 3.1.13
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/package.json +3 -3
- package/src/commands/new.js +6 -7
- package/src/utils/skeleton.js +6 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toptal/davinci-bootstrap",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.13",
|
|
4
4
|
"description": "Creates application from davinci template",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@toptal/davinci-cli-shared": "1.5.1",
|
|
38
|
-
"@toptal/davinci-skeleton": "
|
|
38
|
+
"@toptal/davinci-skeleton": "6.0.0",
|
|
39
39
|
"@toptal/davinci-skeleton-lib": "0.1.1",
|
|
40
|
-
"@toptal/davinci-skeleton-sub-app": "1.
|
|
40
|
+
"@toptal/davinci-skeleton-sub-app": "1.2.0",
|
|
41
41
|
"find-yarn-workspace-root": "^2.0.0",
|
|
42
42
|
"fs-extra": "^9.0.1",
|
|
43
43
|
"lodash.kebabcase": "^4.1.1",
|
package/src/commands/new.js
CHANGED
|
@@ -31,19 +31,15 @@ const checkPrerequisites = async (destDir, appName) => {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const copyApplicationSkeleton = async (destDir, currentDavinciRunningDir) => {
|
|
34
|
-
const skeletonPath = require.resolve(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
paths: [currentDavinciRunningDir]
|
|
38
|
-
}
|
|
39
|
-
)
|
|
34
|
+
const skeletonPath = require.resolve('@toptal/davinci-skeleton', {
|
|
35
|
+
paths: [currentDavinciRunningDir]
|
|
36
|
+
})
|
|
40
37
|
const appDir = path.join(skeletonPath, '../..')
|
|
41
38
|
|
|
42
39
|
const spinner = ora('Copying skeleton...').start()
|
|
43
40
|
|
|
44
41
|
try {
|
|
45
42
|
await skeleton.copyAllFiles(appDir, destDir)
|
|
46
|
-
await skeleton.copyGithub(destDir)
|
|
47
43
|
await skeleton.copyNpmrc(destDir)
|
|
48
44
|
await skeleton.copyTemplatePackageJsonFile(destDir)
|
|
49
45
|
await skeleton.copyTemplateGitIgnoreFile(destDir)
|
|
@@ -75,6 +71,9 @@ const modifyPackageJson = async (destDir, appName) => {
|
|
|
75
71
|
delete config.scripts['build:package']
|
|
76
72
|
delete config.scripts['prepublishOnly']
|
|
77
73
|
|
|
74
|
+
// add husky scripts
|
|
75
|
+
config.scripts.prepare = "if [ -d '.git' ]; then husky install; fi"
|
|
76
|
+
|
|
78
77
|
delete config.publishConfig
|
|
79
78
|
config.license = 'SEE LICENSE IN LICENSE.MD'
|
|
80
79
|
|
package/src/utils/skeleton.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
const fs = require('fs-extra')
|
|
3
3
|
|
|
4
|
-
const {
|
|
5
|
-
NODE_MODULES_PATTERN,
|
|
6
|
-
CHANGELOG_PATTERN
|
|
7
|
-
} = require('../constants')
|
|
4
|
+
const { NODE_MODULES_PATTERN, CHANGELOG_PATTERN } = require('../constants')
|
|
8
5
|
|
|
9
6
|
const readPackageJson = folder => {
|
|
10
7
|
const packageJsonFile = path.join(folder, 'package.json')
|
|
11
8
|
|
|
12
9
|
const configData = fs.readFileSync(packageJsonFile)
|
|
10
|
+
|
|
13
11
|
return JSON.parse(configData)
|
|
14
12
|
}
|
|
15
13
|
|
|
@@ -40,20 +38,11 @@ const copyTemplateGitIgnoreFile = async folder => {
|
|
|
40
38
|
}
|
|
41
39
|
|
|
42
40
|
const copyTemplateEslintrc = async folder => {
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
if (fs.existsSync(gitEslintrcSkeletonFile)) {
|
|
47
|
-
await fs.rename(gitEslintrcSkeletonFile, gitEslintrcFile)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const copyGithub = async folder => {
|
|
52
|
-
const githubDir = path.join(folder, '.github')
|
|
53
|
-
const githubDirSkeletonFile = path.join(folder, 'github.skeleton')
|
|
41
|
+
const eslintrcFile = path.join(folder, '.eslintrc')
|
|
42
|
+
const eslintrcSkeletonFile = path.join(folder, '.eslintrc.skeleton')
|
|
54
43
|
|
|
55
|
-
if (fs.existsSync(
|
|
56
|
-
await fs.rename(
|
|
44
|
+
if (fs.existsSync(eslintrcSkeletonFile)) {
|
|
45
|
+
await fs.rename(eslintrcSkeletonFile, eslintrcFile)
|
|
57
46
|
}
|
|
58
47
|
}
|
|
59
48
|
|
|
@@ -79,7 +68,6 @@ module.exports = {
|
|
|
79
68
|
copyTemplatePackageJsonFile,
|
|
80
69
|
copyTemplateGitIgnoreFile,
|
|
81
70
|
copyTemplateEslintrc,
|
|
82
|
-
copyGithub,
|
|
83
71
|
copyNpmrc,
|
|
84
72
|
copyAllFiles
|
|
85
73
|
}
|