@jcoreio/toolchain 1.0.0-beta.5 → 1.0.0-beta.7
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/githooks.cjs +0 -2
- package/package.json +6 -9
- package/plugins/getConfigFiles.cjs +0 -1
- package/scripts/bootstrap/bootstrapProjectPackageJson.cjs +40 -12
- package/scripts/bootstrap/bootstrapRemoveDevDeps.cjs +1 -5
- package/bin/commitizen +0 -5
- package/bin/commitlint +0 -5
- package/bin/cz +0 -5
- package/bin/git-cz +0 -5
- package/commitizen.cjs +0 -1
- package/commitlint.config.cjs +0 -11
package/githooks.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jcoreio/toolchain",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.7",
|
|
4
4
|
"description": "base JS build toolchain",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,15 +14,11 @@
|
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/jcoreio/toolchains/tree/beta/packages/base",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@commitlint/cli": "^15.0.0",
|
|
18
|
-
"@commitlint/config-conventional": "^15.0.0",
|
|
19
17
|
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
20
18
|
"@semantic-release/github": "^8.0.4",
|
|
21
19
|
"@semantic-release/npm": "^10.0.4",
|
|
22
20
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
23
21
|
"chalk": "^4.0.0",
|
|
24
|
-
"commitizen": "^4.2.4",
|
|
25
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
26
22
|
"dedent-js": "^1.0.1",
|
|
27
23
|
"eslint": "^8.5.0",
|
|
28
24
|
"eslint-config-prettier": "^8.3.0",
|
|
@@ -36,15 +32,16 @@
|
|
|
36
32
|
"prettier": "^2.5.1",
|
|
37
33
|
"resolve-bin": "^1.0.0",
|
|
38
34
|
"semantic-release": "^21.0.5",
|
|
35
|
+
"semver": "^7.5.3",
|
|
39
36
|
"toposort": "^2.0.2",
|
|
40
37
|
"zod": "^3.21.4"
|
|
41
38
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
39
|
+
"toolchainManaged": {
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"eslint": "*"
|
|
42
|
+
}
|
|
44
43
|
},
|
|
45
44
|
"bin": {
|
|
46
|
-
"commitizen": "./bin/commitizen",
|
|
47
|
-
"commitlint": "./bin/commitlint",
|
|
48
45
|
"cz": "./bin/cz",
|
|
49
46
|
"eslint": "./bin/eslint",
|
|
50
47
|
"git-cz": "./bin/git-cz",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
const { name
|
|
1
|
+
const { name } = require('../../package.json')
|
|
2
2
|
const { projectDir, toolchainPackages } = require('../../util/findUps.cjs')
|
|
3
3
|
const getPluginsAsyncFunction = require('../../util/getPluginsAsyncFunction.cjs')
|
|
4
4
|
const fs = require('../../util/projectFs.cjs')
|
|
5
5
|
const sortDeps = require('../../util/sortDeps.cjs')
|
|
6
|
+
const semver = require('semver')
|
|
6
7
|
|
|
7
8
|
async function bootstrapProjectPackageJson() {
|
|
8
9
|
const { merge, unset } = require('lodash')
|
|
@@ -11,13 +12,25 @@ async function bootstrapProjectPackageJson() {
|
|
|
11
12
|
const devDependencies =
|
|
12
13
|
packageJson.devDependencies || (packageJson.devDependencies = {})
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
+
const toolchainManaged = {}
|
|
15
16
|
for (const pkg of toolchainPackages) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const toolchainPkgJson = require(require.resolve(`${pkg}/package.json`, {
|
|
18
|
+
paths: [projectDir],
|
|
19
|
+
}))
|
|
20
|
+
const toolchainPkgDeps = toolchainPkgJson.dependencies || {}
|
|
21
|
+
const toolchainPkgDevDeps = toolchainPkgJson.devDependencies || {}
|
|
22
|
+
if (toolchainPkgJson.toolchainManaged) {
|
|
23
|
+
for (const section in toolchainPkgJson.toolchainManaged) {
|
|
24
|
+
const sectionDeps = toolchainPkgJson.toolchainManaged[section]
|
|
25
|
+
if (!toolchainManaged[section]) toolchainManaged[section] = {}
|
|
26
|
+
for (const dep in sectionDeps) {
|
|
27
|
+
let version = sectionDeps[dep]
|
|
28
|
+
if (version === '*')
|
|
29
|
+
version = toolchainPkgDevDeps[dep] || toolchainPkgDeps[dep]
|
|
30
|
+
if (version !== '*') toolchainManaged[section][dep] = version
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
for (const path of [
|
|
@@ -56,11 +69,26 @@ async function bootstrapProjectPackageJson() {
|
|
|
56
69
|
},
|
|
57
70
|
})
|
|
58
71
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
for (const section in toolchainManaged) {
|
|
73
|
+
const managedSection = toolchainManaged[section]
|
|
74
|
+
const pkgSectionName = section.replace(/^optionalD/, 'd')
|
|
75
|
+
let pkgSection = packageJson[pkgSectionName]
|
|
76
|
+
if (!pkgSection) {
|
|
77
|
+
if (/^optional/.test(section)) continue
|
|
78
|
+
pkgSection = packageJson[pkgSectionName] = {}
|
|
79
|
+
}
|
|
80
|
+
for (const dep in managedSection) {
|
|
81
|
+
if (/^optional/.test(section) && !pkgSection[dep]) continue
|
|
82
|
+
const versionRange = managedSection[dep]
|
|
83
|
+
if (
|
|
84
|
+
!pkgSection[dep] ||
|
|
85
|
+
semver.gt(
|
|
86
|
+
versionRange.replace(/^\D+/, ''),
|
|
87
|
+
pkgSection[dep].replace(/^\D+/, '')
|
|
88
|
+
)
|
|
89
|
+
) {
|
|
90
|
+
pkgSection[dep] = versionRange
|
|
91
|
+
}
|
|
64
92
|
}
|
|
65
93
|
}
|
|
66
94
|
|
|
@@ -90,18 +90,14 @@ module.exports = [
|
|
|
90
90
|
'babylon',
|
|
91
91
|
'codecov',
|
|
92
92
|
'coveralls',
|
|
93
|
-
'eslint-plugin-flowtype',
|
|
94
|
-
'eslint-plugin-prettier',
|
|
95
|
-
'eslint-plugin-react',
|
|
96
93
|
'eslint-watch',
|
|
97
|
-
'eslint',
|
|
98
94
|
'flow-copy-source',
|
|
99
95
|
'flow-watch',
|
|
100
96
|
'husky',
|
|
101
97
|
'isparta',
|
|
102
98
|
'istanbul',
|
|
99
|
+
'jsdom-global',
|
|
103
100
|
'lint-staged',
|
|
104
|
-
'mocha',
|
|
105
101
|
'nyc',
|
|
106
102
|
'prettier-eslint',
|
|
107
103
|
'prettier',
|
package/bin/commitizen
DELETED
package/bin/commitlint
DELETED
package/bin/cz
DELETED
package/bin/git-cz
DELETED
package/commitizen.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('cz-conventional-changelog')
|
package/commitlint.config.cjs
DELETED