@storm-software/git-tools 2.124.86 → 2.125.1
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/README.md +1 -1
- package/bin/chunk-3IBASKZ6.cjs +16 -0
- package/bin/chunk-3IBASKZ6.cjs.map +1 -0
- package/bin/chunk-6FITE6HP.js +52 -0
- package/bin/chunk-6FITE6HP.js.map +1 -0
- package/bin/chunk-C7APS633.cjs +19 -0
- package/bin/chunk-C7APS633.cjs.map +1 -0
- package/bin/{chunk-ZBLIE7F7.cjs → chunk-DFXXNV3C.cjs} +2 -3
- package/bin/chunk-DFXXNV3C.cjs.map +1 -0
- package/bin/chunk-EI723ABQ.cjs +59 -0
- package/bin/chunk-EI723ABQ.cjs.map +1 -0
- package/bin/{chunk-Q3DQKTOI.js → chunk-HBLWPOJV.js} +5 -5
- package/bin/chunk-HBLWPOJV.js.map +1 -0
- package/bin/chunk-IA2Z3BAB.cjs +18 -0
- package/bin/chunk-IA2Z3BAB.cjs.map +1 -0
- package/bin/chunk-JE32WMBP.js +17 -0
- package/bin/chunk-JE32WMBP.js.map +1 -0
- package/bin/chunk-LHPUN2YZ.js +22 -0
- package/bin/chunk-LHPUN2YZ.js.map +1 -0
- package/bin/chunk-N7J3ORRT.js +14 -0
- package/bin/chunk-N7J3ORRT.js.map +1 -0
- package/bin/chunk-ROGUZ46T.js +22 -0
- package/bin/chunk-ROGUZ46T.js.map +1 -0
- package/bin/chunk-RZZ5UCVV.js +22 -0
- package/bin/chunk-RZZ5UCVV.js.map +1 -0
- package/bin/{chunk-WQI3QHPS.js → chunk-S3E6UR4Y.js} +3 -3
- package/bin/chunk-S3E6UR4Y.js.map +1 -0
- package/bin/chunk-S7Z6YPPG.js +16 -0
- package/bin/chunk-S7Z6YPPG.js.map +1 -0
- package/bin/chunk-XHWHVOBP.cjs +24 -0
- package/bin/chunk-XHWHVOBP.cjs.map +1 -0
- package/bin/{chunk-AU5PZKTN.cjs → chunk-YHZNDNCW.cjs} +5 -5
- package/bin/chunk-YHZNDNCW.cjs.map +1 -0
- package/bin/chunk-Z64XNZ43.cjs +24 -0
- package/bin/chunk-Z64XNZ43.cjs.map +1 -0
- package/bin/chunk-ZW2KYP2Z.cjs +24 -0
- package/bin/chunk-ZW2KYP2Z.cjs.map +1 -0
- package/bin/git.cjs +206 -84
- package/bin/git.cjs.map +1 -1
- package/bin/git.js +129 -7
- package/bin/git.js.map +1 -1
- package/bin/post-checkout.cjs +9 -21
- package/bin/post-checkout.cjs.map +1 -1
- package/bin/post-checkout.js +5 -17
- package/bin/post-checkout.js.map +1 -1
- package/bin/post-commit.cjs +9 -21
- package/bin/post-commit.cjs.map +1 -1
- package/bin/post-commit.js +5 -17
- package/bin/post-commit.js.map +1 -1
- package/bin/post-merge.cjs +9 -21
- package/bin/post-merge.cjs.map +1 -1
- package/bin/post-merge.js +5 -17
- package/bin/post-merge.js.map +1 -1
- package/bin/pre-commit.cjs +8 -16
- package/bin/pre-commit.cjs.map +1 -1
- package/bin/pre-commit.js +4 -12
- package/bin/pre-commit.js.map +1 -1
- package/bin/pre-install.cjs +8 -13
- package/bin/pre-install.cjs.map +1 -1
- package/bin/pre-install.js +4 -9
- package/bin/pre-install.js.map +1 -1
- package/bin/pre-push.cjs +9 -72
- package/bin/pre-push.cjs.map +1 -1
- package/bin/pre-push.js +5 -63
- package/bin/pre-push.js.map +1 -1
- package/bin/prepare.cjs +8 -11
- package/bin/prepare.cjs.map +1 -1
- package/bin/prepare.js +4 -7
- package/bin/prepare.js.map +1 -1
- package/bin/version-warning.cjs +7 -7
- package/bin/version-warning.js +2 -2
- package/dist/chunk-2NF67ZEY.js +14 -0
- package/dist/chunk-5DVCH44C.cjs +22 -0
- package/dist/{chunk-NY53WLGC.cjs → chunk-7ZSL4J35.cjs} +9 -9
- package/dist/chunk-AU2RMJUK.js +20 -0
- package/dist/chunk-BUQYMEBK.cjs +17 -0
- package/dist/chunk-C6MBULOZ.js +15 -0
- package/dist/chunk-DMVL4OYZ.cjs +14 -0
- package/dist/chunk-ENL3GCXS.cjs +2 -0
- package/dist/chunk-F2HQMRJH.cjs +16 -0
- package/dist/chunk-FJL2V56E.cjs +24 -0
- package/dist/chunk-GTOCMU46.cjs +57 -0
- package/dist/chunk-HMHOHK22.js +17 -0
- package/dist/{chunk-VVJA5N2W.js → chunk-HVTQXN3A.js} +3 -285
- package/dist/chunk-JOPN56T4.js +22 -0
- package/dist/chunk-LSTKPCAN.cjs +22 -0
- package/dist/chunk-Q47SPRY7.js +1 -0
- package/dist/chunk-QCNDIFYQ.cjs +20 -0
- package/dist/chunk-RK75BACO.js +50 -0
- package/dist/{chunk-EMYFDYKP.cjs → chunk-RQ67RJVN.cjs} +13 -296
- package/dist/chunk-SIFTTG22.cjs +303 -0
- package/dist/chunk-UQMGLURT.js +20 -0
- package/dist/{chunk-JCEVFJCA.js → chunk-USTER7R2.js} +2 -2
- package/dist/chunk-X7F62ZNF.js +290 -0
- package/dist/chunk-YUE6ZNKC.js +12 -0
- package/dist/chunk-Z4CPTYLS.cjs +22 -0
- package/dist/chunk-ZKDVZXHI.js +20 -0
- package/dist/commit/minimal.cjs +4 -4
- package/dist/commit/minimal.js +2 -2
- package/dist/commit/monorepo.cjs +5 -5
- package/dist/commit/monorepo.js +3 -3
- package/dist/index.cjs +51 -12
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +15 -4
- package/dist/lefthook/minimal.yml +69 -0
- package/dist/lefthook/recommended.yml +60 -0
- package/dist/lefthook/strict.yml +32 -0
- package/dist/release/config.cjs +13 -11
- package/dist/release/config.js +6 -4
- package/package.json +79 -65
- package/bin/chunk-AU5PZKTN.cjs.map +0 -1
- package/bin/chunk-Q3DQKTOI.js.map +0 -1
- package/bin/chunk-WQI3QHPS.js.map +0 -1
- package/bin/chunk-ZBLIE7F7.cjs.map +0 -1
- package/dist/lefthook/config.yml +0 -119
- package/dist/{chunk-F7OO6L26.cjs → chunk-CT6VGZZS.cjs} +1 -1
- package/dist/{chunk-KZRVQ5RZ.js → chunk-WCAKLYL2.js} +1 -1
package/bin/pre-push.js
CHANGED
|
@@ -1,71 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { getConfig,
|
|
5
|
-
import fs from 'node:fs';
|
|
6
|
-
import { readFile } from 'node:fs/promises';
|
|
7
|
-
import path from 'node:path';
|
|
2
|
+
import { prePushHook } from './chunk-6FITE6HP.js';
|
|
3
|
+
import './chunk-HBLWPOJV.js';
|
|
4
|
+
import { getConfig, exitWithSuccess, writeFatal, exitWithError } from './chunk-S3E6UR4Y.js';
|
|
8
5
|
|
|
6
|
+
// bin/pre-push.ts
|
|
9
7
|
void (async () => {
|
|
10
8
|
const config = await getConfig();
|
|
11
9
|
try {
|
|
12
|
-
|
|
13
|
-
writeInfo("Running pre-push hook...", config);
|
|
14
|
-
checkPackageVersion(process.argv?.slice(1));
|
|
15
|
-
writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}\n", config);
|
|
16
|
-
const errors = [];
|
|
17
|
-
if (fs.existsSync(
|
|
18
|
-
path.join(config.workspaceRoot ?? "./", "package-lock.json")
|
|
19
|
-
)) {
|
|
20
|
-
errors.push(
|
|
21
|
-
'Invalid occurrence of "package-lock.json" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
if (fs.existsSync(path.join(config.workspaceRoot ?? "./", "yarn.lock"))) {
|
|
25
|
-
errors.push(
|
|
26
|
-
'Invalid occurrence of "yarn.lock" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
const content = await readFile(
|
|
31
|
-
path.join(config.workspaceRoot ?? "./", "pnpm-lock.yaml"),
|
|
32
|
-
{
|
|
33
|
-
encoding: "utf8"
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
if (content?.match(/localhost:487/)) {
|
|
37
|
-
errors.push(
|
|
38
|
-
'The "pnpm-lock.yaml" has reference to local repository ("localhost:4873"). Please use ensure you disable local registry before running "pnpm i"'
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
if (content?.match(/resolution: \{tarball/)) {
|
|
42
|
-
errors.push(
|
|
43
|
-
'The "pnpm-lock.yaml" has reference to tarball package. Please use npm registry only'
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
} catch {
|
|
47
|
-
errors.push('The "pnpm-lock.yaml" does not exist or cannot be read');
|
|
48
|
-
}
|
|
49
|
-
if (errors.length > 0) {
|
|
50
|
-
writeError("\u274C Lock file validation failed", config);
|
|
51
|
-
for (const error of errors) {
|
|
52
|
-
console.error(error);
|
|
53
|
-
}
|
|
54
|
-
exitWithError(config);
|
|
55
|
-
}
|
|
56
|
-
writeSuccess("Lock file is valid \u2705", config);
|
|
57
|
-
run(config, "git lfs pre-push origin");
|
|
58
|
-
try {
|
|
59
|
-
run(config, "git-lfs version");
|
|
60
|
-
} catch (error) {
|
|
61
|
-
writeError(
|
|
62
|
-
`This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.
|
|
63
|
-
Error: ${error?.message}`,
|
|
64
|
-
config
|
|
65
|
-
);
|
|
66
|
-
exitWithError(config);
|
|
67
|
-
}
|
|
68
|
-
run(config, "git lfs pre-push origin");
|
|
10
|
+
await prePushHook(config, process.argv.slice(2));
|
|
69
11
|
exitWithSuccess(config);
|
|
70
12
|
} catch (error) {
|
|
71
13
|
writeFatal(
|
package/bin/pre-push.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../bin/pre-push.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../bin/pre-push.ts"],"names":[],"mappings":";;;;;;AAUA,KAAA,CAAM,YAAY;AAChB,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,EAAU;AAC/B,EAAA,IAAI;AACF,IAAA,MAAM,YAAY,MAAA,EAAQ,OAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,CAAC,CAAC,CAAA;AAE/C,IAAA,eAAA,CAAgB,MAAM,CAAA;AAAA,EACxB,SAAS,KAAA,EAAO;AACd,IAAA,UAAA;AAAA,MACE,CAAA,kDAAA,EAAqD,MAAM,OAAO,CAAA,CAAA;AAAA,MAClE;AAAA,KACF;AACA,IAAA,aAAA,CAAc,MAAM,CAAA;AACpB,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF,CAAA,GAAG","file":"pre-push.js","sourcesContent":["#!/usr/bin/env node\n\nimport { getConfig } from \"@storm-software/config-tools/get-config\";\nimport { writeFatal } from \"@storm-software/config-tools/logger/console\";\nimport {\n exitWithError,\n exitWithSuccess\n} from \"@storm-software/config-tools/utilities/process-handler\";\nimport { prePushHook } from \"../src/hooks/pre-push\";\n\nvoid (async () => {\n const config = await getConfig();\n try {\n await prePushHook(config, process.argv.slice(2));\n\n exitWithSuccess(config);\n } catch (error) {\n writeFatal(\n `A fatal error occurred while running the program: ${error.message}`,\n config\n );\n exitWithError(config);\n process.exit(1);\n }\n})();\n"]}
|
package/bin/prepare.cjs
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
|
|
4
|
+
var chunk3IBASKZ6_cjs = require('./chunk-3IBASKZ6.cjs');
|
|
5
|
+
require('./chunk-FH5OSXAJ.cjs');
|
|
6
|
+
var chunkDFXXNV3C_cjs = require('./chunk-DFXXNV3C.cjs');
|
|
6
7
|
|
|
7
8
|
// bin/prepare.ts
|
|
8
9
|
void (async () => {
|
|
9
|
-
const config = await
|
|
10
|
+
const config = await chunkDFXXNV3C_cjs.getConfig();
|
|
10
11
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!process.env.CI && !process.env.STORM_CI) {
|
|
14
|
-
chunkFH5OSXAJ_cjs.run(config, "lefthook install");
|
|
15
|
-
}
|
|
16
|
-
chunkZBLIE7F7_cjs.exitWithSuccess(config);
|
|
12
|
+
await chunk3IBASKZ6_cjs.prepareHook(config);
|
|
13
|
+
chunkDFXXNV3C_cjs.exitWithSuccess(config);
|
|
17
14
|
} catch (error) {
|
|
18
|
-
|
|
15
|
+
chunkDFXXNV3C_cjs.writeFatal(
|
|
19
16
|
`A fatal error occurred while running the program: ${error.message}`,
|
|
20
17
|
config
|
|
21
18
|
);
|
|
22
|
-
|
|
19
|
+
chunkDFXXNV3C_cjs.exitWithError(config);
|
|
23
20
|
process.exit(1);
|
|
24
21
|
}
|
|
25
22
|
})();
|
package/bin/prepare.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../bin/prepare.ts"],"names":["getConfig","
|
|
1
|
+
{"version":3,"sources":["../../bin/prepare.ts"],"names":["getConfig","prepareHook","exitWithSuccess","writeFatal","exitWithError"],"mappings":";;;;;;;;AAUA,KAAA,CAAM,YAAY;AAChB,EAAA,MAAM,MAAA,GAAS,MAAMA,2BAAA,EAAU;AAC/B,EAAA,IAAI;AACF,IAAA,MAAMC,8BAAY,MAAM,CAAA;AAExB,IAAAC,iCAAA,CAAgB,MAAM,CAAA;AAAA,EACxB,SAAS,KAAA,EAAO;AACd,IAAAC,4BAAA;AAAA,MACE,CAAA,kDAAA,EAAqD,MAAM,OAAO,CAAA,CAAA;AAAA,MAClE;AAAA,KACF;AACA,IAAAC,+BAAA,CAAc,MAAM,CAAA;AACpB,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF,CAAA,GAAG","file":"prepare.cjs","sourcesContent":["#!/usr/bin/env node\n\nimport { getConfig } from \"@storm-software/config-tools/get-config\";\nimport { writeFatal } from \"@storm-software/config-tools/logger/console\";\nimport {\n exitWithError,\n exitWithSuccess\n} from \"@storm-software/config-tools/utilities/process-handler\";\nimport { prepareHook } from \"../src/hooks/prepare\";\n\nvoid (async () => {\n const config = await getConfig();\n try {\n await prepareHook(config);\n\n exitWithSuccess(config);\n } catch (error) {\n writeFatal(\n `A fatal error occurred while running the program: ${error.message}`,\n config\n );\n exitWithError(config);\n process.exit(1);\n }\n})();\n"]}
|
package/bin/prepare.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { prepareHook } from './chunk-N7J3ORRT.js';
|
|
3
|
+
import './chunk-G3YPGVPS.js';
|
|
4
|
+
import { getConfig, exitWithSuccess, writeFatal, exitWithError } from './chunk-S3E6UR4Y.js';
|
|
4
5
|
|
|
5
6
|
// bin/prepare.ts
|
|
6
7
|
void (async () => {
|
|
7
8
|
const config = await getConfig();
|
|
8
9
|
try {
|
|
9
|
-
|
|
10
|
-
writeInfo("Running prepare hook...", config);
|
|
11
|
-
if (!process.env.CI && !process.env.STORM_CI) {
|
|
12
|
-
run(config, "lefthook install");
|
|
13
|
-
}
|
|
10
|
+
await prepareHook(config);
|
|
14
11
|
exitWithSuccess(config);
|
|
15
12
|
} catch (error) {
|
|
16
13
|
writeFatal(
|
package/bin/prepare.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../bin/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../bin/prepare.ts"],"names":[],"mappings":";;;;;;AAUA,KAAA,CAAM,YAAY;AAChB,EAAA,MAAM,MAAA,GAAS,MAAM,SAAA,EAAU;AAC/B,EAAA,IAAI;AACF,IAAA,MAAM,YAAY,MAAM,CAAA;AAExB,IAAA,eAAA,CAAgB,MAAM,CAAA;AAAA,EACxB,SAAS,KAAA,EAAO;AACd,IAAA,UAAA;AAAA,MACE,CAAA,kDAAA,EAAqD,MAAM,OAAO,CAAA,CAAA;AAAA,MAClE;AAAA,KACF;AACA,IAAA,aAAA,CAAc,MAAM,CAAA;AACpB,IAAA,OAAA,CAAQ,KAAK,CAAC,CAAA;AAAA,EAChB;AACF,CAAA,GAAG","file":"prepare.js","sourcesContent":["#!/usr/bin/env node\n\nimport { getConfig } from \"@storm-software/config-tools/get-config\";\nimport { writeFatal } from \"@storm-software/config-tools/logger/console\";\nimport {\n exitWithError,\n exitWithSuccess\n} from \"@storm-software/config-tools/utilities/process-handler\";\nimport { prepareHook } from \"../src/hooks/prepare\";\n\nvoid (async () => {\n const config = await getConfig();\n try {\n await prepareHook(config);\n\n exitWithSuccess(config);\n } catch (error) {\n writeFatal(\n `A fatal error occurred while running the program: ${error.message}`,\n config\n );\n exitWithError(config);\n process.exit(1);\n }\n})();\n"]}
|
package/bin/version-warning.cjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkYHZNDNCW_cjs = require('./chunk-YHZNDNCW.cjs');
|
|
5
|
+
var chunkDFXXNV3C_cjs = require('./chunk-DFXXNV3C.cjs');
|
|
6
6
|
|
|
7
7
|
// bin/version-warning.ts
|
|
8
8
|
void (async () => {
|
|
9
|
-
const config = await
|
|
9
|
+
const config = await chunkDFXXNV3C_cjs.getConfig();
|
|
10
10
|
try {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
chunkDFXXNV3C_cjs.handleProcess(config);
|
|
12
|
+
chunkYHZNDNCW_cjs.checkPackageVersion(process.argv.slice(1));
|
|
13
13
|
} catch (error) {
|
|
14
|
-
|
|
14
|
+
chunkDFXXNV3C_cjs.writeFatal(
|
|
15
15
|
`A fatal error occurred while running the program: ${error.message}`,
|
|
16
16
|
config
|
|
17
17
|
);
|
|
18
|
-
|
|
18
|
+
chunkDFXXNV3C_cjs.exitWithError(config);
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
})();
|
package/bin/version-warning.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { checkPackageVersion } from './chunk-
|
|
3
|
-
import { getConfig, handleProcess, writeFatal, exitWithError } from './chunk-
|
|
2
|
+
import { checkPackageVersion } from './chunk-HBLWPOJV.js';
|
|
3
|
+
import { getConfig, handleProcess, writeFatal, exitWithError } from './chunk-S3E6UR4Y.js';
|
|
4
4
|
|
|
5
5
|
// bin/version-warning.ts
|
|
6
6
|
void (async () => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { run } from './chunk-JOPN56T4.js';
|
|
2
|
+
import { writeInfo } from './chunk-X7F62ZNF.js';
|
|
3
|
+
|
|
4
|
+
// src/hooks/pre-install.ts
|
|
5
|
+
async function preInstallHook(config) {
|
|
6
|
+
writeInfo("Running pre-install hook...", config);
|
|
7
|
+
if (Boolean(process.env.CI) || Boolean(process.env.STORM_CI)) {
|
|
8
|
+
writeInfo("Skipping pre-install for CI process...", config);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
run(config, "npx -y only-allow pnpm");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { preInstallHook };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQCNDIFYQ_cjs = require('./chunk-QCNDIFYQ.cjs');
|
|
4
|
+
var chunkFJL2V56E_cjs = require('./chunk-FJL2V56E.cjs');
|
|
5
|
+
var chunkSIFTTG22_cjs = require('./chunk-SIFTTG22.cjs');
|
|
6
|
+
|
|
7
|
+
// src/hooks/post-merge.ts
|
|
8
|
+
async function postMergeHook(config, files) {
|
|
9
|
+
chunkSIFTTG22_cjs.writeInfo("Running post-merge hook...", config);
|
|
10
|
+
chunkQCNDIFYQ_cjs.checkPackageVersion(files);
|
|
11
|
+
try {
|
|
12
|
+
chunkFJL2V56E_cjs.run(config, "git-lfs version");
|
|
13
|
+
} catch (error) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
`This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.
|
|
16
|
+
Error: ${error?.message}`
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
chunkFJL2V56E_cjs.run(config, "git lfs post-merge");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.postMergeHook = postMergeHook;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunkYBAE6I5L_cjs = require('./chunk-YBAE6I5L.cjs');
|
|
3
|
+
var chunkCT6VGZZS_cjs = require('./chunk-CT6VGZZS.cjs');
|
|
5
4
|
var chunk4VPJA7YJ_cjs = require('./chunk-4VPJA7YJ.cjs');
|
|
5
|
+
var chunkYBAE6I5L_cjs = require('./chunk-YBAE6I5L.cjs');
|
|
6
6
|
|
|
7
7
|
// src/commit/config/monorepo.ts
|
|
8
8
|
var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
|
|
9
|
-
type:
|
|
9
|
+
type: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.type,
|
|
10
10
|
scope: {
|
|
11
11
|
type: "select",
|
|
12
12
|
title: "Commit Scope",
|
|
@@ -16,12 +16,12 @@ var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
|
|
|
16
16
|
maxLength: 50,
|
|
17
17
|
minLength: 1
|
|
18
18
|
},
|
|
19
|
-
subject:
|
|
20
|
-
body:
|
|
21
|
-
isBreaking:
|
|
22
|
-
breakingBody:
|
|
23
|
-
isIssueAffected:
|
|
24
|
-
issuesBody:
|
|
19
|
+
subject: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.subject,
|
|
20
|
+
body: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.body,
|
|
21
|
+
isBreaking: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.isBreaking,
|
|
22
|
+
breakingBody: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.breakingBody,
|
|
23
|
+
isIssueAffected: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.isIssueAffected,
|
|
24
|
+
issuesBody: chunkCT6VGZZS_cjs.DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
|
|
25
25
|
};
|
|
26
26
|
var config = {
|
|
27
27
|
settings: chunk4VPJA7YJ_cjs.COMMIT_CONFIGS.monorepo.commitlint.settings,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { checkPackageVersion } from './chunk-HMHOHK22.js';
|
|
2
|
+
import { run } from './chunk-JOPN56T4.js';
|
|
3
|
+
import { writeInfo } from './chunk-X7F62ZNF.js';
|
|
4
|
+
|
|
5
|
+
// src/hooks/post-merge.ts
|
|
6
|
+
async function postMergeHook(config, files) {
|
|
7
|
+
writeInfo("Running post-merge hook...", config);
|
|
8
|
+
checkPackageVersion(files);
|
|
9
|
+
try {
|
|
10
|
+
run(config, "git-lfs version");
|
|
11
|
+
} catch (error) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/post-merge.
|
|
14
|
+
Error: ${error?.message}`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
run(config, "git lfs post-merge");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { postMergeHook };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQCNDIFYQ_cjs = require('./chunk-QCNDIFYQ.cjs');
|
|
4
|
+
var chunkSIFTTG22_cjs = require('./chunk-SIFTTG22.cjs');
|
|
5
|
+
|
|
6
|
+
// src/hooks/pre-commit.ts
|
|
7
|
+
async function preCommitHook(config, files) {
|
|
8
|
+
chunkSIFTTG22_cjs.writeInfo("Running pre-commit hook...", config);
|
|
9
|
+
chunkQCNDIFYQ_cjs.checkPackageVersion(files);
|
|
10
|
+
if (chunkQCNDIFYQ_cjs.isPackageVersionChanged(files)) {
|
|
11
|
+
throw new Error(
|
|
12
|
+
"Please regenerate the package lock file before committing..."
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.preCommitHook = preCommitHook;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { checkPackageVersion, isPackageVersionChanged } from './chunk-HMHOHK22.js';
|
|
2
|
+
import { writeInfo } from './chunk-X7F62ZNF.js';
|
|
3
|
+
|
|
4
|
+
// src/hooks/pre-commit.ts
|
|
5
|
+
async function preCommitHook(config, files) {
|
|
6
|
+
writeInfo("Running pre-commit hook...", config);
|
|
7
|
+
checkPackageVersion(files);
|
|
8
|
+
if (isPackageVersionChanged(files)) {
|
|
9
|
+
throw new Error(
|
|
10
|
+
"Please regenerate the package lock file before committing..."
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { preCommitHook };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkFJL2V56E_cjs = require('./chunk-FJL2V56E.cjs');
|
|
4
|
+
var chunkSIFTTG22_cjs = require('./chunk-SIFTTG22.cjs');
|
|
5
|
+
|
|
6
|
+
// src/hooks/prepare.ts
|
|
7
|
+
async function prepareHook(config) {
|
|
8
|
+
chunkSIFTTG22_cjs.writeInfo("Running prepare hook...", config);
|
|
9
|
+
if (!process.env.CI && !process.env.STORM_CI) {
|
|
10
|
+
chunkFJL2V56E_cjs.run(config, "pnpm lefthook install");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
exports.prepareHook = prepareHook;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkFJL2V56E_cjs = require('./chunk-FJL2V56E.cjs');
|
|
4
|
+
var chunkSIFTTG22_cjs = require('./chunk-SIFTTG22.cjs');
|
|
5
|
+
|
|
6
|
+
// src/hooks/pre-install.ts
|
|
7
|
+
async function preInstallHook(config) {
|
|
8
|
+
chunkSIFTTG22_cjs.writeInfo("Running pre-install hook...", config);
|
|
9
|
+
if (Boolean(process.env.CI) || Boolean(process.env.STORM_CI)) {
|
|
10
|
+
chunkSIFTTG22_cjs.writeInfo("Skipping pre-install for CI process...", config);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
chunkFJL2V56E_cjs.run(config, "npx -y only-allow pnpm");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.preInstallHook = preInstallHook;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var child_process = require('child_process');
|
|
4
|
+
|
|
5
|
+
// ../config-tools/src/utilities/run.ts
|
|
6
|
+
var LARGE_BUFFER = 1024 * 1e6;
|
|
7
|
+
var run = (config, command, cwd = config.workspaceRoot ?? process.cwd(), stdio = "inherit", env = process.env) => {
|
|
8
|
+
return child_process.execSync(command, {
|
|
9
|
+
cwd,
|
|
10
|
+
env: {
|
|
11
|
+
...process.env,
|
|
12
|
+
...env,
|
|
13
|
+
CLICOLOR: "true",
|
|
14
|
+
FORCE_COLOR: "true"
|
|
15
|
+
},
|
|
16
|
+
windowsHide: true,
|
|
17
|
+
stdio,
|
|
18
|
+
maxBuffer: LARGE_BUFFER,
|
|
19
|
+
killSignal: "SIGTERM",
|
|
20
|
+
encoding: "utf8"
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.run = run;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkQCNDIFYQ_cjs = require('./chunk-QCNDIFYQ.cjs');
|
|
4
|
+
var chunkSIFTTG22_cjs = require('./chunk-SIFTTG22.cjs');
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var promises = require('fs/promises');
|
|
7
|
+
var path = require('path');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
12
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
13
|
+
|
|
14
|
+
async function prePushHook(config, files) {
|
|
15
|
+
chunkSIFTTG22_cjs.writeInfo("Running pre-push hook...", config);
|
|
16
|
+
chunkQCNDIFYQ_cjs.checkPackageVersion(files);
|
|
17
|
+
chunkSIFTTG22_cjs.writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}\n", config);
|
|
18
|
+
const errors = [];
|
|
19
|
+
if (fs__default.default.existsSync(path__default.default.join(config.workspaceRoot ?? "./", "package-lock.json"))) {
|
|
20
|
+
errors.push(
|
|
21
|
+
'Invalid occurrence of "package-lock.json" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
if (fs__default.default.existsSync(path__default.default.join(config.workspaceRoot ?? "./", "yarn.lock"))) {
|
|
25
|
+
errors.push(
|
|
26
|
+
'Invalid occurrence of "yarn.lock" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const content = await promises.readFile(
|
|
31
|
+
path__default.default.join(config.workspaceRoot ?? "./", "pnpm-lock.yaml"),
|
|
32
|
+
{
|
|
33
|
+
encoding: "utf8"
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
if (content?.match(/localhost:487/)) {
|
|
37
|
+
errors.push(
|
|
38
|
+
'The "pnpm-lock.yaml" has reference to local repository ("localhost:4873"). Please use ensure you disable local registry before running "pnpm i"'
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
if (content?.match(/resolution: \{tarball/)) {
|
|
42
|
+
errors.push(
|
|
43
|
+
'The "pnpm-lock.yaml" has reference to tarball package. Please use npm registry only'
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
errors.push('The "pnpm-lock.yaml" does not exist or cannot be read');
|
|
48
|
+
}
|
|
49
|
+
if (errors.length > 0) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
"\u274C Lock file validation failed\n" + errors.join("\n")
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
chunkSIFTTG22_cjs.writeSuccess(" \u2714 Lock file is valid for push", config);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
exports.prePushHook = prePushHook;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/utilities/check-package-version.ts
|
|
2
|
+
var isPackageVersionChanged = (files) => files?.some(
|
|
3
|
+
(arg) => arg.includes("package-lock.json") || arg.includes("yarn.lock") || arg.includes("pnpm-lock.json") || arg.includes("pnpm-lock.yaml") || arg.includes("pnpm-lock.yml") || arg.includes("bun.lockb")
|
|
4
|
+
);
|
|
5
|
+
var checkPackageVersion = (files) => {
|
|
6
|
+
if (isPackageVersionChanged(files)) {
|
|
7
|
+
console.warn(
|
|
8
|
+
[
|
|
9
|
+
"\u26A0\uFE0F ----------------------------------------------------------------------------------------- \u26A0\uFE0F",
|
|
10
|
+
"\u26A0\uFE0F The pnpm-lock file changed! Please run `pnpm i` to ensure your packages are up to date. \u26A0\uFE0F",
|
|
11
|
+
"\u26A0\uFE0F ----------------------------------------------------------------------------------------- \u26A0\uFE0F"
|
|
12
|
+
].join("\n")
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { checkPackageVersion, isPackageVersionChanged };
|