cdrca12 0.1.0

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/LICENSE.md ADDED
@@ -0,0 +1,103 @@
1
+ # License
2
+
3
+ This repo (CDRCA tooling — the CLI, installer, and VS Code extension) is
4
+ licensed under the **MrMIB License v1.0**, reproduced in full below. This
5
+ covers the tooling only, not the CDRCA language itself: that's Muhammad
6
+ Ayyan's upstream project at [ISLAH-org/CDRCA](https://github.com/ISLAH-org/CDRCA)
7
+ and is licensed on his own terms there, separately from this repo. See
8
+ [docs/LICENSING.md](./docs/LICENSING.md) for that distinction and a note
9
+ on IOSLF, a broader license framework separately published by CDRCA's
10
+ creator.
11
+
12
+ ---
13
+
14
+ MrMIB License v1.0
15
+ Applies by default to all projects released under this license, unless
16
+ that project's own README explicitly states otherwise.
17
+
18
+ Copyright (c) 2026 MrMIB
19
+
20
+ Permission is hereby granted, free of charge, to any person obtaining a
21
+ copy of this software and associated documentation files (the
22
+ "Software"), to use and run the Software, subject to the following
23
+ conditions:
24
+
25
+ 1. LEAVE A REMARK
26
+ Any use of the Software — running it, building something with it, or
27
+ using it as part of a larger project — must be accompanied by a
28
+ clear, visible credit to the original author (MrMIB) and a link to
29
+ or mention of the original project. This applies whether or not you
30
+ share, publish, or distribute anything: if you use it, you credit
31
+ it.
32
+
33
+ In practice, this only has teeth once you show your work to someone
34
+ else — a private, never-shared use is not something anyone can see
35
+ or enforce a remark against. The rule is the same either way; only
36
+ the ability to check it changes.
37
+
38
+ 2. NO DERIVATIVES BY DEFAULT
39
+ You may NOT modify, fork, extend, or build derivative works on top
40
+ of the Software, and you may NOT create and distribute a modified
41
+ version of it — unless this specific project's README explicitly
42
+ states that derivatives are permitted for that project. Every
43
+ project defaults to closed; permission to build on top of it is
44
+ granted per-project, in writing, in that project's own README, not
45
+ assumed from this license.
46
+
47
+ Using the Software as-is (running it, calling it, integrating with
48
+ its intended public interface) is not the same as modifying it, and
49
+ is allowed under the terms elsewhere in this license.
50
+
51
+ 3. NO RESALE OF THE SOFTWARE ITSELF
52
+ You may NOT sell, sublicense, or distribute for a fee the Software
53
+ itself, or a derivative work (where permitted under #2) whose
54
+ primary value comes from the Software rather than from what you
55
+ added to it — whether as a standalone product, a rebranded copy, or
56
+ bundled access such as a subscription or paid license to use it.
57
+
58
+ You MAY use the Software to create and sell other things — for
59
+ example, producing and monetizing videos, art, data, or documents
60
+ made with it, or running it as an internal tool in a business that
61
+ sells something else entirely. Making money BY USING the Software is
62
+ fine. Making money BY SELLING the Software, or by selling access to
63
+ it, is not.
64
+
65
+ If you're not sure which side of that line something falls on, ask
66
+ the copyright holder before shipping it.
67
+
68
+ 4. FUTURE TERMS MAY CHANGE — YOUR COPY DOESN'T
69
+ The copyright holder may release future versions of a project, or of
70
+ this license, under different terms, pricing, or availability, at
71
+ their sole discretion. That doesn't reach backward: whatever copy of
72
+ the Software you already lawfully obtained keeps the license terms
73
+ it was given under. This section is about what's offered next, not
74
+ about taking back what's already granted.
75
+
76
+ 5. NO WARRANTY
77
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
78
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
79
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
80
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR COPYRIGHT HOLDER BE
81
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
82
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
83
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
84
+ SOFTWARE.
85
+
86
+ ---
87
+
88
+ Plain-language summary (not a substitute for the terms above): you can
89
+ use this, and make money using it — just credit MrMIB when you do,
90
+ don't fork or build on top of it unless the project's own README says
91
+ you can, and don't repackage or sell the software itself. Future
92
+ releases might come with different terms, but whatever version you got
93
+ stays yours under the terms you got it under.
94
+
95
+ Note: this is a custom, non-standard license — it is NOT OSI-approved
96
+ open source (open source definitions don't permit blanket
97
+ no-derivatives or no-forking restrictions like #2). Being unambiguous
98
+ about that up front avoids confusing anyone who assumes "public GitHub
99
+ repo" automatically means "open source" in the traditional sense. The
100
+ private-use "remark" requirement in #1 is a genuine ask, not something
101
+ that can actually be checked or enforced for use nobody ever sees — if
102
+ you need a term with real legal teeth for a specific situation, have a
103
+ lawyer review this before relying on it.
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # cdrca12
2
+
3
+ npm wrapper for the CDRCA CLI. Downloads the prebuilt `cdrca.exe` from
4
+ [GitHub Releases](https://github.com/MrGrimJoe/cdrca-ready-for-the-real-world/releases)
5
+ on install and runs it.
6
+
7
+ **Windows only right now** — that's the only platform CI currently builds
8
+ a binary for. Installing on macOS/Linux will fail with a clear error
9
+ instead of silently installing something broken.
10
+
11
+ ## Install
12
+
13
+ ```
14
+ npm install -g cdrca12
15
+ ```
16
+
17
+ ## Use
18
+
19
+ ```
20
+ cdrca12 --help
21
+ ```
22
+
23
+ ## Source
24
+
25
+ This is a thin wrapper, not the actual implementation — see
26
+ [github.com/MrGrimJoe/cdrca-ready-for-the-real-world](https://github.com/MrGrimJoe/cdrca-ready-for-the-real-world)
27
+ for the CLI source (Rust), the Windows installer, and the VS Code
28
+ extension.
29
+
30
+ ## License
31
+
32
+ MrMIB License v1.0 — see [LICENSE.md](./LICENSE.md).
package/bin/cdrca.js ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const { spawnSync } = require("child_process");
5
+
6
+ const binPath = path.join(__dirname, "..", "dist", "cdrca.exe");
7
+
8
+ if (!fs.existsSync(binPath)) {
9
+ console.error(
10
+ "\ncdrca12: the cdrca.exe binary isn't installed. This usually means " +
11
+ "postinstall didn't run or failed -- try reinstalling with " +
12
+ "`npm install -g cdrca12` and check the output above for an error.\n"
13
+ );
14
+ process.exit(1);
15
+ }
16
+
17
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
18
+
19
+ if (result.error) {
20
+ console.error(`\ncdrca12: failed to run cdrca.exe: ${result.error.message}\n`);
21
+ process.exit(1);
22
+ }
23
+
24
+ process.exit(result.status === null ? 1 : result.status);
package/install.js ADDED
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env node
2
+ // Downloads the prebuilt cdrca.exe for this package's exact version from
3
+ // GitHub Releases. No dependencies beyond Node's own https/fs -- this is
4
+ // meant to stay a thin wrapper, not grow a dependency tree of its own.
5
+ //
6
+ // Windows-only right now: CI (.github/workflows/release.yml in the main
7
+ // repo) only builds a Windows binary. package.json's "os": ["win32"]
8
+ // already makes npm refuse the install on other platforms before this
9
+ // script ever runs, but this check stays too -- defense in depth, and a
10
+ // clearer message than npm's generic "Unsupported platform" if it's ever
11
+ // bypassed (--force, --ignore-scripts games, a future npm behavior
12
+ // change, etc).
13
+
14
+ const fs = require("fs");
15
+ const https = require("https");
16
+ const path = require("path");
17
+
18
+ const pkg = require("./package.json");
19
+ const REPO = "MrGrimJoe/cdrca-ready-for-the-real-world";
20
+ const DIST_DIR = path.join(__dirname, "dist");
21
+ const DEST = path.join(DIST_DIR, "cdrca.exe");
22
+
23
+ function fail(message) {
24
+ console.error(`\ncdrca12: ${message}\n`);
25
+ process.exit(1);
26
+ }
27
+
28
+ if (process.platform !== "win32") {
29
+ fail(
30
+ "no prebuilt binary is available for your platform yet -- only Windows " +
31
+ "builds exist right now. Build from source instead: " +
32
+ `see https://github.com/${REPO}#build`
33
+ );
34
+ }
35
+
36
+ // GitHub redirects release-asset downloads through its CDN (typically two
37
+ // hops: api/github release page -> objects.githubusercontent.com). Follow
38
+ // redirects manually rather than pulling in a request library for it.
39
+ function download(url, destPath, redirectsLeft = 5) {
40
+ return new Promise((resolve, reject) => {
41
+ if (redirectsLeft <= 0) {
42
+ reject(new Error("too many redirects"));
43
+ return;
44
+ }
45
+ https
46
+ .get(url, { headers: { "User-Agent": "cdrca12-postinstall" } }, (res) => {
47
+ if (
48
+ res.statusCode >= 300 &&
49
+ res.statusCode < 400 &&
50
+ res.headers.location
51
+ ) {
52
+ res.resume(); // discard this response body
53
+ download(res.headers.location, destPath, redirectsLeft - 1).then(
54
+ resolve,
55
+ reject
56
+ );
57
+ return;
58
+ }
59
+ if (res.statusCode !== 200) {
60
+ res.resume();
61
+ reject(
62
+ new Error(`HTTP ${res.statusCode} fetching ${url}`)
63
+ );
64
+ return;
65
+ }
66
+ const fileStream = fs.createWriteStream(destPath);
67
+ res.pipe(fileStream);
68
+ fileStream.on("finish", () => fileStream.close(resolve));
69
+ fileStream.on("error", reject);
70
+ })
71
+ .on("error", reject);
72
+ });
73
+ }
74
+
75
+ async function main() {
76
+ fs.mkdirSync(DIST_DIR, { recursive: true });
77
+
78
+ const tag = `v${pkg.version}`;
79
+ const url = `https://github.com/${REPO}/releases/download/${tag}/cdrca-win32-x64.exe`;
80
+
81
+ console.log(`cdrca12: downloading cdrca.exe (${tag}) ...`);
82
+ try {
83
+ await download(url, DEST);
84
+ } catch (err) {
85
+ fail(
86
+ `couldn't download the prebuilt binary from ${url} (${err.message}). ` +
87
+ `Check https://github.com/${REPO}/releases/tag/${tag} exists and has ` +
88
+ "a cdrca-win32-x64.exe asset attached."
89
+ );
90
+ }
91
+
92
+ const stat = fs.statSync(DEST);
93
+ if (stat.size === 0) {
94
+ fs.unlinkSync(DEST);
95
+ fail("downloaded file was empty -- the release asset may be missing or corrupt.");
96
+ }
97
+
98
+ console.log("cdrca12: done.");
99
+ }
100
+
101
+ main();
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "cdrca12",
3
+ "version": "0.1.0",
4
+ "description": "CLI wrapper for CDRCA tooling -- downloads the prebuilt cdrca.exe from GitHub Releases on install. Windows only for now.",
5
+ "license": "SEE LICENSE IN LICENSE.md",
6
+ "author": {
7
+ "name": "MrMIB"
8
+ },
9
+ "homepage": "https://github.com/MrGrimJoe/cdrca-ready-for-the-real-world#readme",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/MrGrimJoe/cdrca-ready-for-the-real-world.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/MrGrimJoe/cdrca-ready-for-the-real-world/issues"
16
+ },
17
+ "keywords": [
18
+ "cdrca",
19
+ "cli"
20
+ ],
21
+ "bin": {
22
+ "cdrca12": "bin/cdrca.js"
23
+ },
24
+ "files": [
25
+ "bin/",
26
+ "install.js",
27
+ "LICENSE.md"
28
+ ],
29
+ "scripts": {
30
+ "postinstall": "node install.js"
31
+ },
32
+ "os": [
33
+ "win32"
34
+ ],
35
+ "engines": {
36
+ "node": ">=16"
37
+ }
38
+ }