@dk/hipp 0.1.27 → 0.1.28
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 +8 -7
- package/hipp.js +27 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -110,7 +110,8 @@ npx @dk/hipp -- --access public --tag beta
|
|
|
110
110
|
HIPP provides out-of-band verification to prove package integrity:
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
npx @dk/hipp verify #
|
|
113
|
+
npx @dk/hipp verify # auto-detect: local hipp repo → published version, else @dk/hipp
|
|
114
|
+
npx @dk/hipp verify --self # always verifies @dk/hipp itself
|
|
114
115
|
npx @dk/hipp verify @scope/package # verifies latest of a package
|
|
115
116
|
npx @dk/hipp verify @scope/package@1.0.0 # verifies specific version
|
|
116
117
|
```
|
|
@@ -240,20 +241,20 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
240
241
|
Verify this package with [@dk/hipp](https://www.npmjs.com/package/@dk/hipp):
|
|
241
242
|
|
|
242
243
|
```bash
|
|
243
|
-
npx @dk/hipp verify @dk/hipp@0.1.
|
|
244
|
+
npx @dk/hipp verify @dk/hipp@0.1.28
|
|
244
245
|
```
|
|
245
246
|
|
|
246
247
|
```json
|
|
247
248
|
{
|
|
248
249
|
"origin": "git@github.com:dmytri/hipp.git",
|
|
249
|
-
"tag": "v0.1.
|
|
250
|
-
"revision": "
|
|
251
|
-
"hash": "
|
|
252
|
-
"signature": "
|
|
250
|
+
"tag": "v0.1.28",
|
|
251
|
+
"revision": "9c14060da439f9a4c2b040c282da594703525d14",
|
|
252
|
+
"hash": "ee78fe3bba06ec7cff6f775c43c9cc4bf3fba4a3bfa64e28dd57879426890f11",
|
|
253
|
+
"signature": "0Udja52eMvhKvlJxFpwxW927lV1QzyJhF/5kMdOeTnFXy+zQuqMSUBG0fHNo7PRZ9YEDWGzN+EnyeVL5+pyYBQ==",
|
|
253
254
|
"name": "Dmytri Kleiner",
|
|
254
255
|
"email": "dev@dmytri.to",
|
|
255
256
|
"npm": "11.12.1",
|
|
256
257
|
"node": "v25.8.2",
|
|
257
|
-
"hipp": "0.1.
|
|
258
|
+
"hipp": "0.1.28"
|
|
258
259
|
}
|
|
259
260
|
```
|
package/hipp.js
CHANGED
|
@@ -751,25 +751,40 @@ const verifyIndex = process.argv.indexOf('verify');
|
|
|
751
751
|
const packageSpec = verifyIndex !== -1 ? process.argv[verifyIndex + 1] : null;
|
|
752
752
|
|
|
753
753
|
if (isVerify) {
|
|
754
|
-
const
|
|
755
|
-
if (
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
754
|
+
const hasSelf = process.argv.includes('--self');
|
|
755
|
+
if (!hasSelf) {
|
|
756
|
+
try {
|
|
757
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf8'));
|
|
758
|
+
if (pkg.version === '0.0.0') {
|
|
759
|
+
const rawTag = git(['describe', '--tags', '--exact-match', 'HEAD']);
|
|
760
|
+
if (rawTag.startsWith('v')) {
|
|
761
|
+
const tagVersion = semver.clean(rawTag);
|
|
762
|
+
if (tagVersion) {
|
|
763
|
+
runVerify(`${pkg.name}@${tagVersion}`);
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
} catch {}
|
|
769
|
+
}
|
|
770
|
+
const hippPkgPath = path.join(path.dirname(process.argv[1]), 'package.json');
|
|
771
|
+
const hippPkg = JSON.parse(fs.readFileSync(hippPkgPath, 'utf8'));
|
|
772
|
+
const spec = hippPkg.version === '0.0.0'
|
|
773
|
+
? hippPkg.name
|
|
774
|
+
: `${hippPkg.name}@${hippPkg.version}`;
|
|
775
|
+
runVerify(spec);
|
|
765
776
|
} else if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
766
777
|
console.log(`\x1b[36mHIPP - High Integrity Package Publisher\x1b[0m
|
|
767
778
|
|
|
768
779
|
Usage:
|
|
769
780
|
npx hipp [options] [-- npm-options]
|
|
770
781
|
npx hipp verify [@package[@version]]
|
|
782
|
+
npx hipp verify --self
|
|
771
783
|
|
|
772
|
-
Without arguments
|
|
784
|
+
Without arguments: in a hipp repo (package.json version 0.0.0 with a
|
|
785
|
+
semver tag on HEAD), verifies the published package at that version.
|
|
786
|
+
Otherwise verifies @dk/hipp itself.
|
|
787
|
+
--self: always verifies @dk/hipp.
|
|
773
788
|
|
|
774
789
|
Options:
|
|
775
790
|
-y, --yes Skip confirmation prompt
|