difit 1.1.6 → 1.1.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/README.md +1 -1
- package/dist/cli/utils.js +2 -0
- package/dist/cli/utils.test.js +20 -0
- package/dist/client/assets/{index-B2jj_GBb.js → index-BtXScDaj.js} +36 -36
- package/dist/client/assets/{prism-java-BKNDnDw7.js → prism-java-BnGaC8QK.js} +1 -1
- package/dist/client/assets/{prism-php-Dxvk8j_J.js → prism-php-BghhkkC7.js} +1 -1
- package/dist/client/assets/{prism-ruby-kawEeFmo.js → prism-ruby-CubCUQWk.js} +1 -1
- package/dist/client/assets/prism-scala-BjNo2HkN.js +1 -0
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ ReviewIt supports syntax highlighting for multiple programming languages with dy
|
|
|
111
111
|
- **JavaScript/TypeScript**: `.js`, `.jsx`, `.ts`, `.tsx`
|
|
112
112
|
- **Web Technologies**: HTML, CSS, JSON, XML, Markdown
|
|
113
113
|
- **Shell Scripts**: `.sh`, `.bash`, `.zsh`, `.fish` files
|
|
114
|
-
- **Backend Languages**: PHP, SQL, Ruby, Java
|
|
114
|
+
- **Backend Languages**: PHP, SQL, Ruby, Java, Scala
|
|
115
115
|
- **Systems Languages**: C, C++, Rust, Go
|
|
116
116
|
- **Others**: Python, Swift, Kotlin, YAML
|
|
117
117
|
|
package/dist/cli/utils.js
CHANGED
|
@@ -15,6 +15,8 @@ export function validateCommitish(commitish) {
|
|
|
15
15
|
}
|
|
16
16
|
const validPatterns = [
|
|
17
17
|
/^[a-f0-9]{4,40}$/i, // SHA hashes
|
|
18
|
+
/^[a-f0-9]{4,40}\^+$/i, // SHA hashes with ^ suffix (parent references)
|
|
19
|
+
/^[a-f0-9]{4,40}~\d+$/i, // SHA hashes with ~N suffix (ancestor references)
|
|
18
20
|
/^HEAD(~\d+|\^\d*)*$/, // HEAD, HEAD~1, HEAD^, HEAD^2, etc.
|
|
19
21
|
/^[a-zA-Z][a-zA-Z0-9_\-/.]*$/, // branch names, tags (must start with letter, no ^ or ~ in middle)
|
|
20
22
|
];
|
package/dist/cli/utils.test.js
CHANGED
|
@@ -6,6 +6,18 @@ describe('CLI Utils', () => {
|
|
|
6
6
|
expect(validateCommitish('a1b2c3d4e5f6789012345678901234567890abcd')).toBe(true);
|
|
7
7
|
expect(validateCommitish('abc123')).toBe(true);
|
|
8
8
|
});
|
|
9
|
+
it('should validate SHA hashes with parent references', () => {
|
|
10
|
+
expect(validateCommitish('a1b2c3d4e5f6789012345678901234567890abcd^')).toBe(true);
|
|
11
|
+
expect(validateCommitish('abc123^')).toBe(true);
|
|
12
|
+
expect(validateCommitish('abc123^^')).toBe(true);
|
|
13
|
+
expect(validateCommitish('bd4b7513e075b5b245284c38fd23427b9bd0f42e^')).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
it('should validate SHA hashes with ancestor references', () => {
|
|
16
|
+
expect(validateCommitish('a1b2c3d4e5f6789012345678901234567890abcd~1')).toBe(true);
|
|
17
|
+
expect(validateCommitish('abc123~5')).toBe(true);
|
|
18
|
+
expect(validateCommitish('abc123~10')).toBe(true);
|
|
19
|
+
expect(validateCommitish('bd4b7513e075b5b245284c38fd23427b9bd0f42e~2')).toBe(true);
|
|
20
|
+
});
|
|
9
21
|
it('should validate HEAD references', () => {
|
|
10
22
|
expect(validateCommitish('HEAD')).toBe(true);
|
|
11
23
|
expect(validateCommitish('HEAD~1')).toBe(true);
|
|
@@ -131,6 +143,14 @@ describe('CLI Utils', () => {
|
|
|
131
143
|
valid: true,
|
|
132
144
|
});
|
|
133
145
|
});
|
|
146
|
+
it('should handle SHA hashes with parent/ancestor references', () => {
|
|
147
|
+
expect(validateDiffArguments('bd4b7513e075b5b245284c38fd23427b9bd0f42e^', 'abc123')).toEqual({ valid: true });
|
|
148
|
+
expect(validateDiffArguments('abc123', 'def456^')).toEqual({ valid: true });
|
|
149
|
+
expect(validateDiffArguments('abc123~1', 'def456~2')).toEqual({ valid: true });
|
|
150
|
+
expect(validateDiffArguments('a1b2c3d4e5f6789012345678901234567890abcd^', 'HEAD')).toEqual({
|
|
151
|
+
valid: true,
|
|
152
|
+
});
|
|
153
|
+
});
|
|
134
154
|
});
|
|
135
155
|
});
|
|
136
156
|
describe('shortHash', () => {
|