@storm-software/git-tools 1.2.18 β 1.2.20
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 +23 -0
- package/README.md +1 -1
- package/bin/post-checkout.cjs +6 -2
- package/bin/post-commit.cjs +1 -1
- package/bin/post-merge.cjs +6 -2
- package/bin/pre-push.cjs +38 -2
- package/package.json +1 -1
- package/readme/templates/README.header.md +1 -1
- package/scripts/check-lock-file.cjs +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## [1.2.19](https://github.com/storm-software/storm-ops/compare/git-tools-v1.2.18...git-tools-v1.2.19) (2023-11-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **git-tools:** Add origin to git lfs command ([4c33508](https://github.com/storm-software/storm-ops/commit/4c335088d426535eb443b01d653696576dc1d237))
|
|
7
|
+
* **git-tools:** Added branch name to git command ([f411035](https://github.com/storm-software/storm-ops/commit/f41103595cfa383256b347c5e93635445a051fda))
|
|
8
|
+
* **git-tools:** Ensure full path is added to remote branch params ([bb2c668](https://github.com/storm-software/storm-ops/commit/bb2c668ccb959b038929a30436163088b4c02a7d))
|
|
9
|
+
* **git-tools:** More updates to variables in hooks ([1096948](https://github.com/storm-software/storm-ops/commit/10969481676eba0b86118dff0e1365adfbf4bd75))
|
|
10
|
+
* **git-tools:** Remove git-lfs variables from the husky ([0f80794](https://github.com/storm-software/storm-ops/commit/0f80794418bb82000e73029df6c7d738d289ca78))
|
|
11
|
+
* **git-tools:** Remove git-lfs variables from the husky hooks ([cad7eff](https://github.com/storm-software/storm-ops/commit/cad7eff3c2ed3a1f0b318d9973b6756b8446eb0a))
|
|
12
|
+
* **git-tools:** Resolved issue calling git-lfs commands on current branch ([f5c4dd8](https://github.com/storm-software/storm-ops/commit/f5c4dd8331f1df05e0661b1aa72dcd1260a972ad))
|
|
13
|
+
* **git-tools:** Update code to use the provided git variables ([f5acee1](https://github.com/storm-software/storm-ops/commit/f5acee1da47f1d0ec730a82a20aaaff9f6e77e54))
|
|
14
|
+
* **git-tools:** Update hook execution scripts ([1d1b426](https://github.com/storm-software/storm-ops/commit/1d1b4265ad99ad9fc97764dd89f5cf2cf5f9a2ca))
|
|
15
|
+
* **git-tools:** Update use of command line variables ([a6c0d18](https://github.com/storm-software/storm-ops/commit/a6c0d1858a19791d92316a4fc2ec520f4bf69d98))
|
|
16
|
+
|
|
17
|
+
## [1.2.18](https://github.com/storm-software/storm-ops/compare/git-tools-v1.2.17...git-tools-v1.2.18) (2023-11-10)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **git-tools:** Updated code that checks for git-lfs in hooks ([ec4e632](https://github.com/storm-software/storm-ops/commit/ec4e632fe5db27eba12e7dffbbab7ef96c2ef40e))
|
|
23
|
+
|
|
1
24
|
## [1.2.17](https://github.com/storm-software/storm-ops/compare/git-tools-v1.2.16...git-tools-v1.2.17) (2023-11-10)
|
|
2
25
|
|
|
3
26
|
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ This package is part of the <b>β‘Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
15
15
|
|
|
16
16
|
<h3 align="center">π» Visit <a href="https://stormsoftware.org" target="_blank">stormsoftware.org</a> to stay up to date with this developer</h3><br />
|
|
17
17
|
|
|
18
|
-
[](https://prettier.io/)
|
|
19
19
|
[](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://docusaurus.io/) 
|
|
20
20
|
|
|
21
21
|
<h3 align="center" bold="true">β οΈ <b>Attention</b> β οΈ - This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.</h3><br />
|
package/bin/post-checkout.cjs
CHANGED
|
@@ -5,8 +5,12 @@ const { execSync } = require("node:child_process");
|
|
|
5
5
|
try {
|
|
6
6
|
console.log("Running Storm post-checkout hook...");
|
|
7
7
|
|
|
8
|
+
const changed = execSync(
|
|
9
|
+
"git diff-tree -r --name-only --no-commit-id $1 $2",
|
|
10
|
+
"utf8"
|
|
11
|
+
);
|
|
8
12
|
execSync(
|
|
9
|
-
|
|
13
|
+
`node @storm-software/git-tools/scripts/package-version-warning.cjs ${changed}`
|
|
10
14
|
);
|
|
11
15
|
|
|
12
16
|
const result = execSync("git-lfs -v", "utf8");
|
|
@@ -17,7 +21,7 @@ try {
|
|
|
17
21
|
process.exit(1);
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
execSync(
|
|
24
|
+
execSync("git lfs post-checkout origin main");
|
|
21
25
|
} catch (e) {
|
|
22
26
|
console.error(e);
|
|
23
27
|
process.exit(1);
|
package/bin/post-commit.cjs
CHANGED
package/bin/post-merge.cjs
CHANGED
|
@@ -5,8 +5,12 @@ const { execSync } = require("node:child_process");
|
|
|
5
5
|
try {
|
|
6
6
|
console.log("Running Storm post-merge hook...");
|
|
7
7
|
|
|
8
|
+
const changed = execSync(
|
|
9
|
+
"git diff-tree -r --name-only --no-commit-id $1 $2",
|
|
10
|
+
"utf8"
|
|
11
|
+
);
|
|
8
12
|
execSync(
|
|
9
|
-
|
|
13
|
+
`node @storm-software/git-tools/scripts/package-version-warning.cjs ${changed}`
|
|
10
14
|
);
|
|
11
15
|
|
|
12
16
|
const result = execSync("git-lfs -v", "utf8");
|
|
@@ -17,7 +21,7 @@ try {
|
|
|
17
21
|
process.exit(1);
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
execSync(
|
|
24
|
+
execSync("git lfs post-merge origin main");
|
|
21
25
|
} catch (e) {
|
|
22
26
|
console.error(e);
|
|
23
27
|
process.exit(1);
|
package/bin/pre-push.cjs
CHANGED
|
@@ -1,11 +1,47 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { execSync } = require("node:child_process");
|
|
4
|
+
const fs = require("fs");
|
|
4
5
|
|
|
5
6
|
try {
|
|
6
7
|
console.log("Running Storm pre-push hook...");
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
console.log("πππ Validating lock files πππ\n");
|
|
10
|
+
|
|
11
|
+
const errors = [];
|
|
12
|
+
if (fs.existsSync("package-lock.json")) {
|
|
13
|
+
errors.push(
|
|
14
|
+
'Invalid occurrence of "package-lock.json" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
if (fs.existsSync("yarn.lock")) {
|
|
18
|
+
errors.push(
|
|
19
|
+
'Invalid occurrence of "yarn.lock" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const content = fs.readFileSync("pnpm-lock.yaml", "utf-8");
|
|
25
|
+
if (content.match(/localhost:487/)) {
|
|
26
|
+
errors.push(
|
|
27
|
+
'The "pnpm-lock.yaml" has reference to local repository ("localhost:4873"). Please use ensure you disable local registry before running "pnpm i"'
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
if (content.match(/resolution: \{tarball/)) {
|
|
31
|
+
errors.push(
|
|
32
|
+
'The "pnpm-lock.yaml" has reference to tarball package. Please use npm registry only'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
errors.push('The "pnpm-lock.yaml" does not exist or cannot be read');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (errors.length > 0) {
|
|
40
|
+
errors.forEach(e => console.error(e));
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.log("Lock file is valid π");
|
|
9
45
|
|
|
10
46
|
const result = execSync("git-lfs -v", "utf8");
|
|
11
47
|
if (result && Number.isInteger(Number.parseInt(result)) && Number(result)) {
|
|
@@ -15,7 +51,7 @@ try {
|
|
|
15
51
|
process.exit(1);
|
|
16
52
|
}
|
|
17
53
|
|
|
18
|
-
execSync(
|
|
54
|
+
execSync("git lfs pre-push origin main");
|
|
19
55
|
} catch (e) {
|
|
20
56
|
console.error(e);
|
|
21
57
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div align="center"><img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/
|
|
1
|
+
<div align="center"><img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/storm-banner.gif" width="100%" altText="Storm Software" /></div>
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
<a href="https://stormsoftware.org" target="_blank">Website</a> | <a href="https://stormsoftware.org/contact" target="_blank">Contact</a> | <a href="https://github.com/storm-software/stormstack" target="_blank">Repository</a> | <a href="https://stormstack.github.io/stormstack/" target="_blank">Documentation</a> | <a href="https://github.com/storm-software/stormstack/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a> | <a href="https://github.com/storm-software/stormstack/issues/new?assignees=&labels=enhancement&template=feature-request.yml&title=Feature Request%3A+">Request a Feature</a> | <a href="https://github.com/storm-software/stormstack/issues/new?assignees=&labels=documentation&template=documentation.yml&title=Documentation Request%3A+">Request Documentation</a> | <a href="https://github.com/storm-software/stormstack/discussions">Ask a Question</a>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
|
|
3
|
-
console.log("πππ Validating lock files πππ\n");
|
|
4
|
-
|
|
5
|
-
const errors = [];
|
|
6
|
-
if (fs.existsSync("package-lock.json")) {
|
|
7
|
-
errors.push(
|
|
8
|
-
'Invalid occurrence of "package-lock.json" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
if (fs.existsSync("yarn.lock")) {
|
|
12
|
-
errors.push(
|
|
13
|
-
'Invalid occurrence of "yarn.lock" file. Please remove it and use only "pnpm-lock.yaml"'
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
const content = fs.readFileSync("pnpm-lock.yaml", "utf-8");
|
|
19
|
-
if (content.match(/localhost:487/)) {
|
|
20
|
-
errors.push(
|
|
21
|
-
'The "pnpm-lock.yaml" has reference to local repository ("localhost:4873"). Please use ensure you disable local registry before running "pnpm i"'
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
if (content.match(/resolution: \{tarball/)) {
|
|
25
|
-
errors.push(
|
|
26
|
-
'The "pnpm-lock.yaml" has reference to tarball package. Please use npm registry only'
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
} catch {
|
|
30
|
-
errors.push('The "pnpm-lock.yaml" does not exist or cannot be read');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (errors.length > 0) {
|
|
34
|
-
errors.forEach(e => console.log(e));
|
|
35
|
-
process.exit(1);
|
|
36
|
-
} else {
|
|
37
|
-
console.log("Lock file is valid π");
|
|
38
|
-
process.exit(0);
|
|
39
|
-
}
|