alex-c-line 1.0.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/dist/index.cjs +76 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +53 -0
- package/package.json +44 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
|
|
26
|
+
// src/index.ts
|
|
27
|
+
var import_commander = require("commander");
|
|
28
|
+
|
|
29
|
+
// src/commands/check-lockfile-version-discrepancy.ts
|
|
30
|
+
var import_fs = require("fs");
|
|
31
|
+
var import_path = __toESM(require("path"), 1);
|
|
32
|
+
function checkLockfileVersionDiscrepancy(program2) {
|
|
33
|
+
program2.command("check-lockfile-version-discrepancy").description(
|
|
34
|
+
"Check that version numbers in package.json and package-lock.json match"
|
|
35
|
+
).action(() => {
|
|
36
|
+
console.log(
|
|
37
|
+
"Checking for package.json and package-lock.json discrepancies..."
|
|
38
|
+
);
|
|
39
|
+
const { version: packageVersion } = JSON.parse(
|
|
40
|
+
(0, import_fs.readFileSync)(import_path.default.resolve(process.cwd(), "package.json"), "utf-8")
|
|
41
|
+
);
|
|
42
|
+
const { version: packageLockVersion } = JSON.parse(
|
|
43
|
+
(0, import_fs.readFileSync)(import_path.default.resolve(process.cwd(), "package-lock.json"), "utf-8")
|
|
44
|
+
);
|
|
45
|
+
if (packageVersion !== packageLockVersion) {
|
|
46
|
+
console.error(
|
|
47
|
+
"\u274C ERROR: package.json and package-lock.json out of sync. Please run `npm install` to fix this."
|
|
48
|
+
);
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
console.log("package.json and package-lock.json versions in sync.");
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var check_lockfile_version_discrepancy_default = checkLockfileVersionDiscrepancy;
|
|
56
|
+
|
|
57
|
+
// src/commands/say-hello.ts
|
|
58
|
+
function sayHello(program2) {
|
|
59
|
+
program2.command("say-hello").description("Quick test command").action(() => {
|
|
60
|
+
console.log("Hello!");
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
var say_hello_default = sayHello;
|
|
64
|
+
|
|
65
|
+
// src/commands/index.ts
|
|
66
|
+
function loadCommands(program2) {
|
|
67
|
+
say_hello_default(program2);
|
|
68
|
+
check_lockfile_version_discrepancy_default(program2);
|
|
69
|
+
}
|
|
70
|
+
var commands_default = loadCommands;
|
|
71
|
+
|
|
72
|
+
// src/index.ts
|
|
73
|
+
var program = new import_commander.Command();
|
|
74
|
+
program.name("alex-c-line").description("CLI tool built by Alex").version("1.0.0");
|
|
75
|
+
commands_default(program);
|
|
76
|
+
program.parse(process.argv);
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
|
|
6
|
+
// src/commands/check-lockfile-version-discrepancy.ts
|
|
7
|
+
import { readFileSync } from "fs";
|
|
8
|
+
import path from "path";
|
|
9
|
+
function checkLockfileVersionDiscrepancy(program2) {
|
|
10
|
+
program2.command("check-lockfile-version-discrepancy").description(
|
|
11
|
+
"Check that version numbers in package.json and package-lock.json match"
|
|
12
|
+
).action(() => {
|
|
13
|
+
console.log(
|
|
14
|
+
"Checking for package.json and package-lock.json discrepancies..."
|
|
15
|
+
);
|
|
16
|
+
const { version: packageVersion } = JSON.parse(
|
|
17
|
+
readFileSync(path.resolve(process.cwd(), "package.json"), "utf-8")
|
|
18
|
+
);
|
|
19
|
+
const { version: packageLockVersion } = JSON.parse(
|
|
20
|
+
readFileSync(path.resolve(process.cwd(), "package-lock.json"), "utf-8")
|
|
21
|
+
);
|
|
22
|
+
if (packageVersion !== packageLockVersion) {
|
|
23
|
+
console.error(
|
|
24
|
+
"\u274C ERROR: package.json and package-lock.json out of sync. Please run `npm install` to fix this."
|
|
25
|
+
);
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
console.log("package.json and package-lock.json versions in sync.");
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
var check_lockfile_version_discrepancy_default = checkLockfileVersionDiscrepancy;
|
|
33
|
+
|
|
34
|
+
// src/commands/say-hello.ts
|
|
35
|
+
function sayHello(program2) {
|
|
36
|
+
program2.command("say-hello").description("Quick test command").action(() => {
|
|
37
|
+
console.log("Hello!");
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
var say_hello_default = sayHello;
|
|
41
|
+
|
|
42
|
+
// src/commands/index.ts
|
|
43
|
+
function loadCommands(program2) {
|
|
44
|
+
say_hello_default(program2);
|
|
45
|
+
check_lockfile_version_discrepancy_default(program2);
|
|
46
|
+
}
|
|
47
|
+
var commands_default = loadCommands;
|
|
48
|
+
|
|
49
|
+
// src/index.ts
|
|
50
|
+
var program = new Command();
|
|
51
|
+
program.name("alex-c-line").description("CLI tool built by Alex").version("1.0.0");
|
|
52
|
+
commands_default(program);
|
|
53
|
+
program.parse(process.argv);
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alex-c-line",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"bin": {
|
|
11
|
+
"alex-c-line": "dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test-watch": "vitest",
|
|
16
|
+
"format": "prettier --write --parser typescript 'src/**/*.ts' 'tests/**/*.ts' && ESLINT_MODE=fix eslint --fix 'src/**/*.ts' 'tests/**/*.ts'",
|
|
17
|
+
"lint": "ESLINT_MODE=lint eslint 'src/**/*.ts' 'tests/**/*.ts' && prettier --check --parser typescript 'src/**/*.ts' 'tests/**/*.ts'",
|
|
18
|
+
"build": "tsup",
|
|
19
|
+
"command": "npm run build && echo && echo \"Command output:\" && npx alex-c-line",
|
|
20
|
+
"prepare": "husky"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"commander": "^14.0.0",
|
|
28
|
+
"execa": "^9.6.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@alextheman/eslint-config-typescript-base": "^1.0.11",
|
|
32
|
+
"@types/eslint": "^9.6.1",
|
|
33
|
+
"@types/node": "^24.0.15",
|
|
34
|
+
"eslint": "^9.31.0",
|
|
35
|
+
"husky": "^9.1.7",
|
|
36
|
+
"prettier": "^3.6.2",
|
|
37
|
+
"tempy": "^3.1.0",
|
|
38
|
+
"ts-node": "^10.9.2",
|
|
39
|
+
"tsup": "^8.5.0",
|
|
40
|
+
"typescript": "^5.8.3",
|
|
41
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
42
|
+
"vitest": "^3.2.4"
|
|
43
|
+
}
|
|
44
|
+
}
|