@jcoreio/toolchain 5.3.4 → 5.3.5
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
CHANGED
|
@@ -7,11 +7,15 @@ const initBuildIgnore = require('../util/initBuildIgnore.cjs')
|
|
|
7
7
|
const migrateLegacyEslintConfigs = require('../util/migrateLegacyEslintConfigs.cjs')
|
|
8
8
|
const chalk = require('chalk')
|
|
9
9
|
const { glob } = require('../util/glob.cjs')
|
|
10
|
+
const semver = require('semver')
|
|
10
11
|
|
|
11
12
|
module.exports = [
|
|
12
13
|
async function getConfigFiles({ fromVersion }) {
|
|
13
14
|
const files = {
|
|
14
|
-
...(
|
|
15
|
+
...((
|
|
16
|
+
isMonorepoSubpackage ||
|
|
17
|
+
(fromVersion && semver.gte(fromVersion, '5.0.0'))
|
|
18
|
+
) ?
|
|
15
19
|
{}
|
|
16
20
|
: {
|
|
17
21
|
'.npmrc': dedent`
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
const execa = require('../util/execa.cjs')
|
|
4
4
|
const Path = require('path')
|
|
5
5
|
const dedent = require('dedent-js')
|
|
6
|
-
const { findGitDir } = require('../util/findUps.cjs')
|
|
6
|
+
const { findGitDir, projectDir } = require('../util/findUps.cjs')
|
|
7
7
|
const fs = require('fs-extra')
|
|
8
|
-
|
|
9
|
-
const githooksDir = Path.resolve(__dirname, '..', 'githooks')
|
|
8
|
+
const { name } = require('../package.json')
|
|
10
9
|
|
|
11
10
|
async function installGitHooks() {
|
|
12
11
|
const gitDir = findGitDir()
|
|
@@ -18,6 +17,12 @@ async function installGitHooks() {
|
|
|
18
17
|
after you run \`git init\`, try \`pnpm tc install-git-hooks\`.
|
|
19
18
|
`)
|
|
20
19
|
} else {
|
|
20
|
+
const symlinkPath = Path.join('node_modules', name, 'githooks')
|
|
21
|
+
const githooksDir =
|
|
22
|
+
(await fs.pathExists(Path.resolve(projectDir, symlinkPath))) ?
|
|
23
|
+
symlinkPath
|
|
24
|
+
: Path.resolve(__dirname, '..', 'githooks')
|
|
25
|
+
|
|
21
26
|
// chmod in case pnpm doesn't preserve mode of hooks scripts
|
|
22
27
|
await Promise.all(
|
|
23
28
|
(await fs.readdir(githooksDir)).map((hook) =>
|