fundamentum-cli 0.1.0 → 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 +2 -4
  2. package/install.js +12 -1
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -2,15 +2,13 @@
2
2
 
3
3
  **One command to make your GitHub repo look (and behave) like a pro open-source project.**
4
4
 
5
- [npm](https://www.npmjs.com/package/fundamentum-cli) · [GitHub](https://github.com/jpvelasco/fundamentum)
5
+ [GitHub](https://github.com/jpvelasco/fundamentum)
6
6
 
7
7
  Fundamentum bootstraps and hardens GitHub repos for OSS collaboration — community health files, branch protection, secret scanning, and starter CI workflows. You bring the code, it brings the polish.
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://github.com/jpvelasco/fundamentum/actions/workflows/ci.yml"><img src="https://github.com/jpvelasco/fundamentum/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
11
11
  <a href="https://github.com/jpvelasco/fundamentum/releases/latest"><img src="https://img.shields.io/github/v/release/jpvelasco/fundamentum" alt="Release"></a>
12
- <a href="https://www.npmjs.com/package/fundamentum-cli"><img src="https://img.shields.io/npm/v/fundamentum-cli" alt="npm"></a>
13
- <a href="https://www.npmjs.com/package/fundamentum-cli"><img src="https://img.shields.io/npm/dm/fundamentum-cli" alt="npm downloads"></a>
14
12
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
15
13
  </p>
16
14
 
@@ -27,7 +25,7 @@ npx fundamentum-cli --version
27
25
  npx fundamentum-cli apply OWNER/REPO
28
26
  ```
29
27
 
30
- Works on **macOS**, **Linux**, and **Windows** — `x64` and `arm64`. Postinstall downloads the matching prebuilt binary from GitHub Releases with embedded SHA-256 verification.
28
+ Works on **macOS** and **Linux** (`x64` and `arm64`) and **Windows** (`x64`). Postinstall downloads the matching prebuilt binary from GitHub Releases with embedded SHA-256 verification.
31
29
 
32
30
  > **npm 9+ / Ubuntu 26+ note:** npm's `allow-scripts` security policy may block the postinstall
33
31
  > script, so the binary won't be downloaded at install time. No worries — if `fundamentum` is invoked
package/install.js CHANGED
@@ -29,6 +29,17 @@ const ARCH_MAP = {
29
29
  arm64: "arm64",
30
30
  };
31
31
 
32
+ function getPackageVersion(pkg) {
33
+ const version = pkg.version;
34
+
35
+ // Validate semver format to prevent URL injection
36
+ if (!/^\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?(\+[a-zA-Z0-9.]+)?$/.test(version)) {
37
+ throw new Error(`Invalid version format: ${version}`);
38
+ }
39
+
40
+ return version;
41
+ }
42
+
32
43
  function getArchiveName(version, platform, arch) {
33
44
  const os = PLATFORM_MAP[platform];
34
45
  const cpu = ARCH_MAP[arch];
@@ -178,7 +189,7 @@ async function main() {
178
189
  const pkg = JSON.parse(
179
190
  fs.readFileSync(path.join(__dirname, "package.json"), "utf8")
180
191
  );
181
- const version = pkg.version;
192
+ const version = getPackageVersion(pkg);
182
193
  if (version === "0.0.0") {
183
194
  console.error("fundamentum: skipping binary download for development version");
184
195
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fundamentum-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Bootstrap and harden GitHub repos for OSS collaboration — community files, branch protection, security features, and starter workflows in one command.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -57,10 +57,10 @@
57
57
  "bin/"
58
58
  ],
59
59
  "binaryChecksums": {
60
- "fundamentum_0.1.0_darwin_amd64.tar.gz": "9d7be6fbfee6414005932547e1cc2cef54580739a5a265573942c80bb5fd28d9",
61
- "fundamentum_0.1.0_darwin_arm64.tar.gz": "e50920a5522c9739899e30aa8f9414ac8a66bfcea4b91ef98e2c38f407d54b75",
62
- "fundamentum_0.1.0_linux_amd64.tar.gz": "1772182f6c1d6a13b0e23bafb01ce89a8b9316895b778ce7a38ce2a9409fff16",
63
- "fundamentum_0.1.0_linux_arm64.tar.gz": "5506f3002cdd4fad7ee641dfb023672c80d0e8934602906e9c8bb35a643da4ab",
64
- "fundamentum_0.1.0_windows_amd64.zip": "ba5d12e8a0dbcae168adf7f68141910e0536c186f2921adba000a5b486f68853"
60
+ "fundamentum_0.1.2_darwin_amd64.tar.gz": "3a80afe84553b993fed503fcceee2d206c57dc023ad93c719f37837903bc53e4",
61
+ "fundamentum_0.1.2_darwin_arm64.tar.gz": "6554bb025c3d166c12fe50dde2209546b23c42822ffebfaf34c14528ecd335a2",
62
+ "fundamentum_0.1.2_linux_amd64.tar.gz": "3e827ed72c7ff851fa01f7b834dbaf1962bece2caf862154c3f62cf27bc66262",
63
+ "fundamentum_0.1.2_linux_arm64.tar.gz": "0c5dd67a622553124bbfe6d480e691d895dab1fddf0461e9f42f81db87e9d0d4",
64
+ "fundamentum_0.1.2_windows_amd64.zip": "5c0867554b208e6bf502eee9fb5897a67ae94d88ab41031a5f70169fabe9de08"
65
65
  }
66
66
  }