modpack-lock 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +8 -1
  2. package/index.js +11 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -79,8 +79,15 @@ The `modpack.lock` file has the following structure:
79
79
 
80
80
  ```json
81
81
  {
82
- "version": "1.0.0",
82
+ "version": "1.0.1",
83
83
  "generated": "2026-01-06T03:00:00.000Z",
84
+ "total": 7,
85
+ "counts": {
86
+ "mods": 1,
87
+ "resourcepacks": 3,
88
+ "datapacks": 1,
89
+ "shaderpacks": 2
90
+ },
84
91
  "dependencies": {
85
92
  "mods": [
86
93
  {
package/index.js CHANGED
@@ -4,7 +4,7 @@ import fs from 'fs/promises';
4
4
  import crypto from 'crypto';
5
5
  import path from 'path';
6
6
 
7
- const LOCKFILE_VERSION = '1.0.0';
7
+ const LOCKFILE_VERSION = '1.0.1';
8
8
  const MODPACK_LOCKFILE_NAME = 'modpack.lock';
9
9
  const MODRINTH_API_BASE = 'https://api.modrinth.com/v2';
10
10
  const MODRINTH_VERSION_FILES_ENDPOINT = `${MODRINTH_API_BASE}/version_files`;
@@ -151,6 +151,8 @@ function createEmptyLockfile() {
151
151
  return {
152
152
  version: LOCKFILE_VERSION,
153
153
  generated: new Date().toISOString(),
154
+ total: 0,
155
+ counts: {},
154
156
  dependencies: {},
155
157
  };
156
158
  }
@@ -179,6 +181,14 @@ function createLockfile(fileEntries, versionData) {
179
181
  lockfile.dependencies[fileInfo.category].push(entry);
180
182
  }
181
183
 
184
+ // Calculate counts for each category
185
+ for (const [category, entries] of Object.entries(lockfile.dependencies)) {
186
+ lockfile.counts[category] = entries.length;
187
+ }
188
+
189
+ // Calculate total count
190
+ lockfile.total = fileEntries.length;
191
+
182
192
  return lockfile;
183
193
  }
184
194
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modpack-lock",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Create a modpack lockfile for files hosted on Modrinth (mods, resource packs, shaders and datapacks)",
5
5
  "bugs": {
6
6
  "url": "https://github.com/nickesc/modpack-lock/issues"