@vasanth-mv/pqs-cli 1.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.
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // ─── Polyfill browser globals for the shared rule-engine modules ─────────────
3
+ // The core analyzers were written for the browser; these stubs let them run
4
+ // in Node.js without any code changes.
5
+ if (typeof globalThis.localStorage === "undefined") {
6
+ globalThis.localStorage = {
7
+ _store: Object.create(null),
8
+ getItem(k) { return this._store[k] ?? null; },
9
+ setItem(k, v) { this._store[k] = String(v); },
10
+ removeItem(k) { delete this._store[k]; },
11
+ clear() { this._store = Object.create(null); },
12
+ };
13
+ }
14
+ if (typeof globalThis.sessionStorage === "undefined") {
15
+ globalThis.sessionStorage = globalThis.localStorage;
16
+ }
17
+
18
+ import "../src/cli.js";
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // ─── Polyfill browser globals for the shared rule-engine modules ─────────────
3
+ // The core analyzers were written for the browser; these stubs let them run
4
+ // in Node.js without any code changes.
5
+ if (typeof globalThis.localStorage === "undefined") {
6
+ globalThis.localStorage = {
7
+ _store: Object.create(null),
8
+ getItem(k) { return this._store[k] ?? null; },
9
+ setItem(k, v) { this._store[k] = String(v); },
10
+ removeItem(k) { delete this._store[k]; },
11
+ clear() { this._store = Object.create(null); },
12
+ };
13
+ }
14
+ if (typeof globalThis.sessionStorage === "undefined") {
15
+ globalThis.sessionStorage = globalThis.localStorage;
16
+ }
17
+
18
+ import "../src/cli.js";
package/bin/qcbot.js ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // ─── Polyfill browser globals for the shared rule-engine modules ─────────────
3
+ // The core analyzers were written for the browser; these stubs let them run
4
+ // in Node.js without any code changes.
5
+ if (typeof globalThis.localStorage === "undefined") {
6
+ globalThis.localStorage = {
7
+ _store: Object.create(null),
8
+ getItem(k) { return this._store[k] ?? null; },
9
+ setItem(k, v) { this._store[k] = String(v); },
10
+ removeItem(k) { delete this._store[k]; },
11
+ clear() { this._store = Object.create(null); },
12
+ };
13
+ }
14
+ if (typeof globalThis.sessionStorage === "undefined") {
15
+ globalThis.sessionStorage = globalThis.localStorage;
16
+ }
17
+
18
+ import "../src/cli.js";
package/build.mjs ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * pqs CLI bundler
3
+ * Produces a single self-contained dist/pqs.js with no external dependencies.
4
+ *
5
+ * Usage: node build.mjs
6
+ */
7
+ import { build } from "esbuild";
8
+ import { writeFileSync, chmodSync, mkdirSync, readFileSync } from "fs";
9
+ import { fileURLToPath } from "url";
10
+ import { dirname, join } from "path";
11
+
12
+ const __dirname = dirname(fileURLToPath(import.meta.url));
13
+
14
+ // Read version from package.json — injected into the bundle at build time
15
+ const { version } = JSON.parse(readFileSync(join(__dirname, "package.json"), "utf8"));
16
+
17
+ mkdirSync(join(__dirname, "dist"), { recursive: true });
18
+
19
+ const result = await build({
20
+ entryPoints: [join(__dirname, "bin/pqs.entry.js")],
21
+ bundle: true,
22
+ platform: "node",
23
+ target: "node18",
24
+ format: "esm",
25
+ outfile: join(__dirname, "dist/pqs.js"),
26
+ // Inject version from package.json at build time
27
+ define: { __PQS_VERSION__: JSON.stringify(version) },
28
+ // Exclude Node.js built-ins (they're always available)
29
+ external: ["fs", "path", "process", "url", "os", "crypto", "stream", "util", "events"],
30
+ // Mark AWS/Google SDKs as external — CLI doesn't need AI providers
31
+ packages: "external",
32
+ minify: false,
33
+ sourcemap: false,
34
+ metafile: true,
35
+ banner: {
36
+ js: `#!/usr/bin/env node\n// pqs v${version} — Code Quality Studio CLI\n`,
37
+ },
38
+ logLevel: "info",
39
+ });
40
+
41
+ // Make the output executable
42
+ const outPath = join(__dirname, "dist/pqs.js");
43
+ chmodSync(outPath, 0o755);
44
+
45
+ // Print bundle stats
46
+ const outputs = Object.entries(result.metafile.outputs);
47
+ for (const [file, info] of outputs) {
48
+ const kb = (info.bytes / 1024).toFixed(1);
49
+ console.log(`\n ✓ ${file} (${kb} KB)`);
50
+ }
51
+
52
+ console.log("\n Done! Install globally with:\n");
53
+ console.log(" npm install -g .\n");
54
+ console.log(" Then run:\n");
55
+ console.log(" pqs ./your-tests/ --stack playwright\n");