@take-out/cli 0.4.3 → 0.4.5
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/cjs/cli.cjs +53 -35
- package/dist/cjs/commands/changed.cjs +133 -95
- package/dist/cjs/commands/docs.cjs +276 -203
- package/dist/cjs/commands/env-setup.cjs +45 -33
- package/dist/cjs/commands/onboard.cjs +668 -224
- package/dist/cjs/commands/run-all.cjs +54 -45
- package/dist/cjs/commands/run.cjs +80 -65
- package/dist/cjs/commands/script.cjs +263 -187
- package/dist/cjs/commands/skills.cjs +174 -118
- package/dist/cjs/commands/sync.cjs +193 -93
- package/dist/cjs/constants/ascii.cjs +14 -12
- package/dist/cjs/index.cjs +12 -10
- package/dist/cjs/types.cjs +7 -5
- package/dist/cjs/utils/env-categories.cjs +53 -48
- package/dist/cjs/utils/env-setup.cjs +214 -106
- package/dist/cjs/utils/env.cjs +65 -44
- package/dist/cjs/utils/files.cjs +186 -113
- package/dist/cjs/utils/parallel-runner.cjs +125 -75
- package/dist/cjs/utils/ports.cjs +21 -21
- package/dist/cjs/utils/prerequisites.cjs +42 -34
- package/dist/cjs/utils/prompts.cjs +66 -41
- package/dist/cjs/utils/script-listing.cjs +130 -60
- package/dist/cjs/utils/script-utils.cjs +29 -19
- package/dist/cjs/utils/sync.cjs +67 -45
- package/dist/esm/cli.mjs +40 -24
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/commands/changed.mjs +104 -68
- package/dist/esm/commands/changed.mjs.map +1 -1
- package/dist/esm/commands/docs.mjs +245 -174
- package/dist/esm/commands/docs.mjs.map +1 -1
- package/dist/esm/commands/env-setup.mjs +18 -8
- package/dist/esm/commands/env-setup.mjs.map +1 -1
- package/dist/esm/commands/onboard.mjs +631 -189
- package/dist/esm/commands/onboard.mjs.map +1 -1
- package/dist/esm/commands/run-all.mjs +26 -19
- package/dist/esm/commands/run-all.mjs.map +1 -1
- package/dist/esm/commands/run.mjs +52 -39
- package/dist/esm/commands/run.mjs.map +1 -1
- package/dist/esm/commands/script.mjs +230 -156
- package/dist/esm/commands/script.mjs.map +1 -1
- package/dist/esm/commands/skills.mjs +143 -89
- package/dist/esm/commands/skills.mjs.map +1 -1
- package/dist/esm/commands/sync.mjs +160 -62
- package/dist/esm/commands/sync.mjs.map +1 -1
- package/dist/esm/constants/ascii.mjs +2 -2
- package/dist/esm/constants/ascii.mjs.map +1 -1
- package/dist/esm/utils/env-categories.mjs +29 -26
- package/dist/esm/utils/env-categories.mjs.map +1 -1
- package/dist/esm/utils/env-setup.mjs +184 -78
- package/dist/esm/utils/env-setup.mjs.map +1 -1
- package/dist/esm/utils/env.mjs +50 -31
- package/dist/esm/utils/env.mjs.map +1 -1
- package/dist/esm/utils/files.mjs +171 -100
- package/dist/esm/utils/files.mjs.map +1 -1
- package/dist/esm/utils/parallel-runner.mjs +111 -63
- package/dist/esm/utils/parallel-runner.mjs.map +1 -1
- package/dist/esm/utils/ports.mjs +9 -11
- package/dist/esm/utils/ports.mjs.map +1 -1
- package/dist/esm/utils/prerequisites.mjs +30 -24
- package/dist/esm/utils/prerequisites.mjs.map +1 -1
- package/dist/esm/utils/prompts.mjs +40 -17
- package/dist/esm/utils/prompts.mjs.map +1 -1
- package/dist/esm/utils/script-listing.mjs +101 -33
- package/dist/esm/utils/script-listing.mjs.map +1 -1
- package/dist/esm/utils/script-utils.mjs +14 -6
- package/dist/esm/utils/script-utils.mjs.map +1 -1
- package/dist/esm/utils/sync.mjs +38 -18
- package/dist/esm/utils/sync.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var script_utils_exports = {};
|
|
22
24
|
__export(script_utils_exports, {
|
|
@@ -25,9 +27,9 @@ __export(script_utils_exports, {
|
|
|
25
27
|
getLocalScriptsDir: () => getLocalScriptsDir
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(script_utils_exports);
|
|
28
|
-
var import_node_fs = require("node:fs")
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
var import_node_fs = require("node:fs");
|
|
31
|
+
var import_node_path = require("node:path");
|
|
32
|
+
var import_cmd = require("@take-out/scripts/cmd");
|
|
31
33
|
function getLocalScriptsDir() {
|
|
32
34
|
return (0, import_node_path.join)(process.cwd(), "scripts");
|
|
33
35
|
}
|
|
@@ -39,7 +41,8 @@ async function getAllScriptMetadata(scripts) {
|
|
|
39
41
|
});
|
|
40
42
|
for (const [name, path] of scripts) {
|
|
41
43
|
try {
|
|
42
|
-
|
|
44
|
+
const head = (0, import_node_fs.readFileSync)(path, "utf-8").slice(0, 200);
|
|
45
|
+
if (!head.includes("cmd")) continue;
|
|
43
46
|
} catch {
|
|
44
47
|
continue;
|
|
45
48
|
}
|
|
@@ -55,7 +58,9 @@ async function getAllScriptMetadata(scripts) {
|
|
|
55
58
|
};
|
|
56
59
|
if (info.args) {
|
|
57
60
|
const flags = [...info.args.matchAll(/--?([a-z-]+)/gi)];
|
|
58
|
-
flags.length > 0
|
|
61
|
+
if (flags.length > 0) {
|
|
62
|
+
metadata.args = flags.map(m => `--${m[1]}`);
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
results.set(name, metadata);
|
|
61
66
|
}
|
|
@@ -63,23 +68,28 @@ async function getAllScriptMetadata(scripts) {
|
|
|
63
68
|
}
|
|
64
69
|
function discoverScripts(dir, baseDir = dir) {
|
|
65
70
|
const scripts = /* @__PURE__ */new Map();
|
|
66
|
-
if (!(0, import_node_fs.existsSync)(dir))
|
|
71
|
+
if (!(0, import_node_fs.existsSync)(dir)) {
|
|
72
|
+
return scripts;
|
|
73
|
+
}
|
|
67
74
|
try {
|
|
68
75
|
const entries = (0, import_node_fs.readdirSync)(dir);
|
|
69
76
|
for (const entry of entries) {
|
|
70
77
|
const fullPath = (0, import_node_path.join)(dir, entry);
|
|
71
|
-
|
|
78
|
+
const stat = (0, import_node_fs.statSync)(fullPath);
|
|
79
|
+
if (stat.isDirectory()) {
|
|
72
80
|
if (entry === "helpers" || entry === "internal") continue;
|
|
73
81
|
const subEntries = (0, import_node_fs.readdirSync)(fullPath);
|
|
74
82
|
for (const subEntry of subEntries) {
|
|
75
83
|
const subPath = (0, import_node_path.join)(fullPath, subEntry);
|
|
76
84
|
if ((0, import_node_fs.statSync)(subPath).isFile() && (subEntry.endsWith(".ts") || subEntry.endsWith(".js"))) {
|
|
77
|
-
const
|
|
85
|
+
const relativePath = (0, import_node_path.relative)(baseDir, subPath).split("\\").join("/");
|
|
86
|
+
const scriptName = relativePath.replace(/\.(ts|js)$/, "");
|
|
78
87
|
scripts.set(scriptName, subPath);
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
90
|
} else if (entry.endsWith(".ts") || entry.endsWith(".js")) {
|
|
82
|
-
const
|
|
91
|
+
const relativePath = (0, import_node_path.relative)(baseDir, fullPath).split("\\").join("/");
|
|
92
|
+
const scriptName = relativePath.replace(/\.(ts|js)$/, "");
|
|
83
93
|
scripts.set(scriptName, fullPath);
|
|
84
94
|
}
|
|
85
95
|
}
|
package/dist/cjs/utils/sync.cjs
CHANGED
|
@@ -2,33 +2,35 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
20
22
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: true
|
|
33
|
+
}), mod);
|
|
32
34
|
var sync_exports = {};
|
|
33
35
|
__export(sync_exports, {
|
|
34
36
|
compareFiles: () => compareFiles,
|
|
@@ -37,44 +39,64 @@ __export(sync_exports, {
|
|
|
37
39
|
syncFileWithConfirmation: () => syncFileWithConfirmation
|
|
38
40
|
});
|
|
39
41
|
module.exports = __toCommonJS(sync_exports);
|
|
40
|
-
var import_node_crypto = require("node:crypto")
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
var import_node_crypto = require("node:crypto");
|
|
43
|
+
var import_node_fs = require("node:fs");
|
|
44
|
+
var import_node_path = require("node:path");
|
|
45
|
+
var import_prompts = require("@clack/prompts");
|
|
46
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
45
47
|
function getFileHash(filePath) {
|
|
46
48
|
const content = (0, import_node_fs.readFileSync)(filePath);
|
|
47
49
|
return (0, import_node_crypto.createHash)("md5").update(content).digest("hex");
|
|
48
50
|
}
|
|
49
51
|
function compareFiles(sourcePath, targetPath) {
|
|
50
|
-
if (!(0, import_node_fs.existsSync)(targetPath))
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
if (!(0, import_node_fs.existsSync)(targetPath)) {
|
|
53
|
+
return "new";
|
|
54
|
+
}
|
|
55
|
+
const sourceHash = getFileHash(sourcePath);
|
|
56
|
+
const targetHash = getFileHash(targetPath);
|
|
53
57
|
return sourceHash === targetHash ? "identical" : "modified";
|
|
54
58
|
}
|
|
55
59
|
async function syncFileWithConfirmation(file) {
|
|
56
60
|
const relPath = (0, import_node_path.relative)(process.cwd(), file.targetPath);
|
|
57
|
-
if (file.status === "identical")
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
if (file.status === "identical") {
|
|
62
|
+
console.info(import_picocolors.default.dim(` \u2713 ${file.name} (already up to date)`));
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
const statusColor = file.status === "new" ? import_picocolors.default.green : import_picocolors.default.yellow;
|
|
66
|
+
const statusText = file.status === "new" ? "NEW" : "MODIFIED";
|
|
67
|
+
console.info();
|
|
68
|
+
console.info(statusColor(` ${statusText}: ${file.name}`));
|
|
69
|
+
if (file.status === "modified") {
|
|
70
|
+
const sourceSize = file.sourceSize || 0;
|
|
71
|
+
const targetSize = file.targetSize || 0;
|
|
72
|
+
const diff = sourceSize - targetSize;
|
|
73
|
+
console.info(import_picocolors.default.dim(` Source: ${sourceSize} bytes`));
|
|
74
|
+
console.info(import_picocolors.default.dim(` Target: ${targetSize} bytes`));
|
|
75
|
+
if (diff > 0) {
|
|
76
|
+
console.info(import_picocolors.default.cyan(` Source is ${diff} bytes larger`));
|
|
77
|
+
} else if (diff < 0) {
|
|
78
|
+
console.info(import_picocolors.default.magenta(` Target is ${Math.abs(diff)} bytes larger`));
|
|
79
|
+
}
|
|
65
80
|
}
|
|
66
81
|
console.info(import_picocolors.default.dim(` \u2192 ${relPath}`));
|
|
67
82
|
const shouldSync = await (0, import_prompts.confirm)({
|
|
68
|
-
message:
|
|
69
|
-
initialValue:
|
|
83
|
+
message: `Overwrite this file?`,
|
|
84
|
+
initialValue: true
|
|
70
85
|
});
|
|
71
|
-
if (shouldSync ===
|
|
86
|
+
if (shouldSync === false || typeof shouldSync === "symbol") {
|
|
87
|
+
console.info(import_picocolors.default.dim(` \u2298 Skipped`));
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
72
90
|
const targetDir = (0, import_node_path.dirname)(file.targetPath);
|
|
73
|
-
(0, import_node_fs.existsSync)(targetDir)
|
|
74
|
-
|
|
75
|
-
|
|
91
|
+
if (!(0, import_node_fs.existsSync)(targetDir)) {
|
|
92
|
+
(0, import_node_fs.mkdirSync)(targetDir, {
|
|
93
|
+
recursive: true
|
|
94
|
+
});
|
|
95
|
+
}
|
|
76
96
|
const content = (0, import_node_fs.readFileSync)(file.sourcePath);
|
|
77
|
-
|
|
97
|
+
(0, import_node_fs.writeFileSync)(file.targetPath, content);
|
|
98
|
+
console.info(import_picocolors.default.green(` \u2713 Synced`));
|
|
99
|
+
return true;
|
|
78
100
|
}
|
|
79
101
|
function getFileSize(filePath) {
|
|
80
102
|
try {
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -4,20 +4,22 @@ import { existsSync, statSync } from "node:fs";
|
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { defineCommand, runMain } from "citty";
|
|
6
6
|
function isScriptCategory(name) {
|
|
7
|
-
const scriptsDir = join(process.cwd(), "scripts")
|
|
8
|
-
|
|
7
|
+
const scriptsDir = join(process.cwd(), "scripts");
|
|
8
|
+
const categoryPath = join(scriptsDir, name);
|
|
9
9
|
try {
|
|
10
10
|
return existsSync(categoryPath) && statSync(categoryPath).isDirectory();
|
|
11
11
|
} catch {
|
|
12
|
-
return
|
|
12
|
+
return false;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
function findLocalScript(name) {
|
|
16
|
-
const scriptsDir = join(process.cwd(), "scripts")
|
|
17
|
-
|
|
16
|
+
const scriptsDir = join(process.cwd(), "scripts");
|
|
17
|
+
const normalizedName = name.replace(/:/g, "/");
|
|
18
18
|
for (const ext of [".ts", ".js", ""]) {
|
|
19
19
|
const scriptPath = join(scriptsDir, `${normalizedName}${ext}`);
|
|
20
|
-
if (existsSync(scriptPath))
|
|
20
|
+
if (existsSync(scriptPath)) {
|
|
21
|
+
return scriptPath;
|
|
22
|
+
}
|
|
21
23
|
}
|
|
22
24
|
return null;
|
|
23
25
|
}
|
|
@@ -26,14 +28,16 @@ function isLocalScript(name) {
|
|
|
26
28
|
}
|
|
27
29
|
function findBuiltInScript(name) {
|
|
28
30
|
try {
|
|
29
|
-
const resolved = import.meta.resolve("@take-out/scripts/package.json")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const resolved = import.meta.resolve("@take-out/scripts/package.json");
|
|
32
|
+
const packageJsonPath = new URL(resolved).pathname;
|
|
33
|
+
const packageRoot = join(packageJsonPath, "..");
|
|
34
|
+
const srcPath = join(packageRoot, "src");
|
|
35
|
+
const normalizedName = name.replace(/:/g, "/");
|
|
34
36
|
for (const ext of [".ts", ".js", ""]) {
|
|
35
37
|
const scriptPath = join(srcPath, `${normalizedName}${ext}`);
|
|
36
|
-
if (existsSync(scriptPath))
|
|
38
|
+
if (existsSync(scriptPath)) {
|
|
39
|
+
return scriptPath;
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
} catch {}
|
|
39
43
|
return null;
|
|
@@ -41,29 +45,40 @@ function findBuiltInScript(name) {
|
|
|
41
45
|
function isBuiltInScript(name) {
|
|
42
46
|
return findBuiltInScript(name) !== null;
|
|
43
47
|
}
|
|
44
|
-
const isShorthand =
|
|
48
|
+
const isShorthand = true;
|
|
45
49
|
if (isShorthand) {
|
|
46
50
|
const firstArg = process.argv[2];
|
|
47
|
-
|
|
51
|
+
const builtInCommands = ["docs", "onboard", "run", "run-all", "script", "skills", "env:setup", "sync", "changed", "--help", "-h", "--version", "-v"];
|
|
52
|
+
if (firstArg && !builtInCommands.includes(firstArg)) {
|
|
48
53
|
let resolvedScriptName;
|
|
49
54
|
if (isScriptCategory(firstArg)) {
|
|
50
|
-
const restArgs = process.argv.slice(3)
|
|
51
|
-
|
|
55
|
+
const restArgs = process.argv.slice(3);
|
|
56
|
+
const subScriptIdx = restArgs.findIndex(a => !a.startsWith("-"));
|
|
52
57
|
if (subScriptIdx !== -1) {
|
|
53
58
|
const subScript = restArgs[subScriptIdx];
|
|
54
|
-
resolvedScriptName = `${firstArg}/${subScript}
|
|
59
|
+
resolvedScriptName = `${firstArg}/${subScript}`;
|
|
60
|
+
process.argv.splice(3 + subScriptIdx, 1);
|
|
61
|
+
process.argv[2] = resolvedScriptName;
|
|
55
62
|
}
|
|
56
63
|
process.argv.splice(2, 0, "run");
|
|
57
|
-
} else firstArg?.includes("/")
|
|
64
|
+
} else if (firstArg?.includes("/")) {
|
|
65
|
+
resolvedScriptName = firstArg;
|
|
66
|
+
process.argv.splice(2, 0, "run");
|
|
67
|
+
} else if (isLocalScript(firstArg) || isBuiltInScript(firstArg)) {
|
|
68
|
+
resolvedScriptName = firstArg;
|
|
69
|
+
process.argv.splice(2, 0, "run");
|
|
70
|
+
} else {
|
|
71
|
+
process.argv.splice(2, 0, "script");
|
|
72
|
+
}
|
|
58
73
|
const hasHelp = process.argv.includes("--help") || process.argv.includes("-h");
|
|
59
74
|
if (resolvedScriptName && hasHelp) {
|
|
60
75
|
const scriptPath = findLocalScript(resolvedScriptName) || findBuiltInScript(resolvedScriptName);
|
|
61
76
|
if (scriptPath) {
|
|
62
|
-
const flagArgs = process.argv.slice(3).filter(a => a !== resolvedScriptName)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
77
|
+
const flagArgs = process.argv.slice(3).filter(a => a !== resolvedScriptName);
|
|
78
|
+
const result = spawnSync("bun", [scriptPath, ...flagArgs], {
|
|
79
|
+
stdio: "inherit",
|
|
80
|
+
shell: false
|
|
81
|
+
});
|
|
67
82
|
process.exit(result.status || 0);
|
|
68
83
|
}
|
|
69
84
|
}
|
|
@@ -87,7 +102,8 @@ const main = defineCommand({
|
|
|
87
102
|
changed: () => import("./commands/changed.mjs").then(m => m.changedCommand)
|
|
88
103
|
},
|
|
89
104
|
async run() {
|
|
90
|
-
|
|
105
|
+
const hasArgs = process.argv.length > 2;
|
|
106
|
+
if (!hasArgs) {
|
|
91
107
|
const {
|
|
92
108
|
listAllScripts
|
|
93
109
|
} = await import("./utils/script-listing.mjs");
|
package/dist/esm/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["spawnSync","existsSync","statSync","join","defineCommand","runMain","isScriptCategory","name","scriptsDir","process","cwd","categoryPath","isDirectory","findLocalScript","normalizedName","replace","ext","scriptPath","isLocalScript","findBuiltInScript","resolved","import","meta","resolve","packageJsonPath","URL","pathname","packageRoot","srcPath","isBuiltInScript","isShorthand","firstArg","argv","includes","resolvedScriptName","restArgs","slice","subScriptIdx","findIndex","a","startsWith","subScript","splice","hasHelp","flagArgs","filter","result","stdio","shell","exit","status","main","version","description","subCommands","onboard","then","m","onboardCommand","docs","docsCommand","env:setup","envSetupCommand","run","runCommand","run-all","runAllCommand","script","scriptCommand","skills","skillsCommand","sync","syncCommand","changed","changedCommand","length","listAllScripts"],"sources":["../../src/cli.ts"],"sourcesContent":[null],"mappings":";AAOA,SAASA,SAAA,QAAiB;AAC1B,SAASC,UAAA,EAAYC,QAAA,QAAgB;AACrC,SAASC,IAAA,QAAY;AAErB,SAASC,aAAA,EAAeC,OAAA,QAAe;AAGvC,SAASC,iBAAiBC,IAAA,EAAuB;EAC/C,MAAMC,UAAA,GAAaL,IAAA,CAAKM,OAAA,CAAQC,GAAA,CAAI,GAAG,SAAS;
|
|
1
|
+
{"version":3,"names":["spawnSync","existsSync","statSync","join","defineCommand","runMain","isScriptCategory","name","scriptsDir","process","cwd","categoryPath","isDirectory","findLocalScript","normalizedName","replace","ext","scriptPath","isLocalScript","findBuiltInScript","resolved","import","meta","resolve","packageJsonPath","URL","pathname","packageRoot","srcPath","isBuiltInScript","isShorthand","firstArg","argv","builtInCommands","includes","resolvedScriptName","restArgs","slice","subScriptIdx","findIndex","a","startsWith","subScript","splice","hasHelp","flagArgs","filter","result","stdio","shell","exit","status","main","version","description","subCommands","onboard","then","m","onboardCommand","docs","docsCommand","env:setup","envSetupCommand","run","runCommand","run-all","runAllCommand","script","scriptCommand","skills","skillsCommand","sync","syncCommand","changed","changedCommand","hasArgs","length","listAllScripts"],"sources":["../../src/cli.ts"],"sourcesContent":[null],"mappings":";AAOA,SAASA,SAAA,QAAiB;AAC1B,SAASC,UAAA,EAAYC,QAAA,QAAgB;AACrC,SAASC,IAAA,QAAY;AAErB,SAASC,aAAA,EAAeC,OAAA,QAAe;AAGvC,SAASC,iBAAiBC,IAAA,EAAuB;EAC/C,MAAMC,UAAA,GAAaL,IAAA,CAAKM,OAAA,CAAQC,GAAA,CAAI,GAAG,SAAS;EAChD,MAAMC,YAAA,GAAeR,IAAA,CAAKK,UAAA,EAAYD,IAAI;EAE1C,IAAI;IACF,OAAON,UAAA,CAAWU,YAAY,KAAKT,QAAA,CAASS,YAAY,EAAEC,WAAA,CAAY;EACxE,QAAQ;IACN,OAAO;EACT;AACF;AAGA,SAASC,gBAAgBN,IAAA,EAA6B;EACpD,MAAMC,UAAA,GAAaL,IAAA,CAAKM,OAAA,CAAQC,GAAA,CAAI,GAAG,SAAS;EAChD,MAAMI,cAAA,GAAiBP,IAAA,CAAKQ,OAAA,CAAQ,MAAM,GAAG;EAE7C,WAAWC,GAAA,IAAO,CAAC,OAAO,OAAO,EAAE,GAAG;IACpC,MAAMC,UAAA,GAAad,IAAA,CAAKK,UAAA,EAAY,GAAGM,cAAc,GAAGE,GAAG,EAAE;IAC7D,IAAIf,UAAA,CAAWgB,UAAU,GAAG;MAC1B,OAAOA,UAAA;IACT;EACF;EAEA,OAAO;AACT;AAEA,SAASC,cAAcX,IAAA,EAAuB;EAC5C,OAAOM,eAAA,CAAgBN,IAAI,MAAM;AACnC;AAGA,SAASY,kBAAkBZ,IAAA,EAA6B;EACtD,IAAI;IACF,MAAMa,QAAA,GAAWC,MAAA,CAAAC,IAAA,CAAYC,OAAA,CAAQ,gCAAgC;IACrE,MAAMC,eAAA,GAAkB,IAAIC,GAAA,CAAIL,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;AACF,CAAC;AAEDzE,OAAA,CAAQ+C,IAAI","ignoreList":[]}
|
|
@@ -3,23 +3,25 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import pc from "picocolors";
|
|
6
|
-
const UPSTREAM_REPO = "tamagui/takeout2"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const UPSTREAM_REPO = "tamagui/takeout2";
|
|
7
|
+
const UPSTREAM_REMOTE = "takeout-upstream";
|
|
8
|
+
const TAKEOUT_FILE = ".takeout";
|
|
9
|
+
const COMMIT_TYPE_ORDER = ["feat", "fix", "perf", "refactor", "docs", "chore", "test", "ci"];
|
|
10
10
|
function readTakeoutConfig() {
|
|
11
11
|
const configPath = join(process.cwd(), TAKEOUT_FILE);
|
|
12
|
-
if (!existsSync(configPath))
|
|
12
|
+
if (!existsSync(configPath)) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
13
15
|
try {
|
|
14
|
-
const content = readFileSync(configPath, "utf-8")
|
|
15
|
-
|
|
16
|
-
for (const line of content.split(
|
|
17
|
-
`)) {
|
|
16
|
+
const content = readFileSync(configPath, "utf-8");
|
|
17
|
+
const config = {};
|
|
18
|
+
for (const line of content.split("\n")) {
|
|
18
19
|
const trimmed = line.trim();
|
|
19
20
|
if (trimmed.startsWith("#") || !trimmed) continue;
|
|
20
|
-
const [key, ...valueParts] = trimmed.split("=")
|
|
21
|
-
|
|
22
|
-
key === "sha"
|
|
21
|
+
const [key, ...valueParts] = trimmed.split("=");
|
|
22
|
+
const value = valueParts.join("=").trim();
|
|
23
|
+
if (key === "sha") config.sha = value;
|
|
24
|
+
if (key === "date") config.date = value;
|
|
23
25
|
}
|
|
24
26
|
return config;
|
|
25
27
|
} catch {
|
|
@@ -30,7 +32,9 @@ function parseConventionalCommit(message) {
|
|
|
30
32
|
const match = message.match(/^(\w+)(?:\(([^)]+)\))?(!)?: (.+)$/);
|
|
31
33
|
if (!match) return null;
|
|
32
34
|
const [, type, scope, breaking, msg] = match;
|
|
33
|
-
|
|
35
|
+
const validTypes = ["feat", "fix", "perf", "refactor", "docs", "chore", "test", "ci", "build", "style"];
|
|
36
|
+
if (!type || !validTypes.includes(type)) return null;
|
|
37
|
+
return {
|
|
34
38
|
type,
|
|
35
39
|
scope,
|
|
36
40
|
message: msg || message,
|
|
@@ -39,35 +43,43 @@ function parseConventionalCommit(message) {
|
|
|
39
43
|
}
|
|
40
44
|
function ensureUpstreamRemote() {
|
|
41
45
|
try {
|
|
42
|
-
|
|
46
|
+
const remotes = execSync("git remote", {
|
|
43
47
|
encoding: "utf-8"
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
});
|
|
49
|
+
if (!remotes.includes(UPSTREAM_REMOTE)) {
|
|
50
|
+
console.info(pc.dim(` adding ${UPSTREAM_REMOTE} remote...`));
|
|
51
|
+
execSync(`git remote add ${UPSTREAM_REMOTE} git@github.com:${UPSTREAM_REPO}.git`, {
|
|
52
|
+
stdio: "pipe"
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
console.info(pc.dim(` fetching from ${UPSTREAM_REMOTE}...`));
|
|
56
|
+
execSync(`git fetch ${UPSTREAM_REMOTE} --quiet`, {
|
|
47
57
|
stdio: "pipe"
|
|
48
|
-
})
|
|
58
|
+
});
|
|
59
|
+
return true;
|
|
49
60
|
} catch (err) {
|
|
50
|
-
|
|
61
|
+
console.error(pc.red(`failed to setup upstream remote: ${err}`));
|
|
62
|
+
return false;
|
|
51
63
|
}
|
|
52
64
|
}
|
|
53
65
|
function getCommitsBetween(fromSha, toRef) {
|
|
54
66
|
const commits = [];
|
|
55
67
|
try {
|
|
56
|
-
const
|
|
68
|
+
const result = execSync(`git log ${fromSha}..${toRef} --pretty=format:"%H|%ad|%s" --date=short 2>/dev/null`, {
|
|
57
69
|
encoding: "utf-8",
|
|
58
|
-
maxBuffer:
|
|
59
|
-
})
|
|
60
|
-
|
|
70
|
+
maxBuffer: 10 * 1024 * 1024
|
|
71
|
+
});
|
|
72
|
+
const lines = result.trim().split("\n").filter(Boolean);
|
|
61
73
|
for (const line of lines) {
|
|
62
|
-
const [hash = "", date = "", ...messageParts] = line.split("|")
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
const [hash = "", date = "", ...messageParts] = line.split("|");
|
|
75
|
+
const message = messageParts.join("|");
|
|
76
|
+
const parsed = parseConventionalCommit(message);
|
|
65
77
|
commits.push({
|
|
66
78
|
hash: hash.slice(0, 7),
|
|
67
79
|
type: parsed?.type || "other",
|
|
68
80
|
scope: parsed?.scope,
|
|
69
81
|
message: parsed?.message || message,
|
|
70
|
-
breaking: parsed?.breaking ||
|
|
82
|
+
breaking: parsed?.breaking || false,
|
|
71
83
|
date
|
|
72
84
|
});
|
|
73
85
|
}
|
|
@@ -82,53 +94,56 @@ function formatChangelog(commits) {
|
|
|
82
94
|
const grouped = /* @__PURE__ */new Map();
|
|
83
95
|
for (const commit of commits) {
|
|
84
96
|
const existing = grouped.get(commit.type) || [];
|
|
85
|
-
existing.push(commit)
|
|
97
|
+
existing.push(commit);
|
|
98
|
+
grouped.set(commit.type, existing);
|
|
86
99
|
}
|
|
87
100
|
const sortedTypes = Array.from(grouped.keys()).sort((a, b) => {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
const aIdx = COMMIT_TYPE_ORDER.indexOf(a);
|
|
102
|
+
const bIdx = COMMIT_TYPE_ORDER.indexOf(b);
|
|
103
|
+
return (aIdx === -1 ? 999 : aIdx) - (bIdx === -1 ? 999 : bIdx);
|
|
104
|
+
});
|
|
105
|
+
const breakingChanges = commits.filter(c => c.breaking);
|
|
93
106
|
if (breakingChanges.length > 0) {
|
|
94
|
-
console.info()
|
|
107
|
+
console.info();
|
|
108
|
+
console.info(pc.red(pc.bold(" BREAKING CHANGES")));
|
|
95
109
|
for (const commit of breakingChanges) {
|
|
96
110
|
const scope = commit.scope ? pc.cyan(`(${commit.scope})`) : "";
|
|
97
111
|
console.info(` ${pc.red("!")} ${scope} ${commit.message} ${pc.dim(`(${commit.hash})`)}`);
|
|
98
112
|
}
|
|
99
113
|
}
|
|
100
114
|
const typeLabels = {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
115
|
+
feat: "Features",
|
|
116
|
+
fix: "Bug Fixes",
|
|
117
|
+
perf: "Performance",
|
|
118
|
+
refactor: "Refactoring",
|
|
119
|
+
docs: "Documentation",
|
|
120
|
+
chore: "Maintenance",
|
|
121
|
+
test: "Tests",
|
|
122
|
+
ci: "CI",
|
|
123
|
+
build: "Build",
|
|
124
|
+
style: "Style",
|
|
125
|
+
other: "Other"
|
|
126
|
+
};
|
|
127
|
+
const typeColors = {
|
|
128
|
+
feat: pc.green,
|
|
129
|
+
fix: pc.yellow,
|
|
130
|
+
perf: pc.magenta,
|
|
131
|
+
refactor: pc.blue,
|
|
132
|
+
docs: pc.dim,
|
|
133
|
+
chore: pc.dim,
|
|
134
|
+
test: pc.dim,
|
|
135
|
+
ci: pc.dim,
|
|
136
|
+
build: pc.dim,
|
|
137
|
+
style: pc.dim,
|
|
138
|
+
other: pc.white
|
|
139
|
+
};
|
|
126
140
|
for (const type of sortedTypes) {
|
|
127
141
|
const typeCommits = grouped.get(type).filter(c => !c.breaking);
|
|
128
142
|
if (typeCommits.length === 0) continue;
|
|
129
|
-
const label = typeLabels[type] || type
|
|
130
|
-
|
|
131
|
-
console.info()
|
|
143
|
+
const label = typeLabels[type] || type;
|
|
144
|
+
const color = typeColors[type] || pc.white;
|
|
145
|
+
console.info();
|
|
146
|
+
console.info(color(pc.bold(` ${label}`)));
|
|
132
147
|
for (const commit of typeCommits) {
|
|
133
148
|
const scope = commit.scope ? pc.cyan(`(${commit.scope}) `) : "";
|
|
134
149
|
console.info(` ${pc.dim("-")} ${scope}${commit.message} ${pc.dim(`(${commit.hash})`)}`);
|
|
@@ -153,25 +168,46 @@ const changedCommand = defineCommand({
|
|
|
153
168
|
async run({
|
|
154
169
|
args
|
|
155
170
|
}) {
|
|
156
|
-
console.info()
|
|
171
|
+
console.info();
|
|
172
|
+
console.info(pc.bold(pc.cyan("Takeout Changes")));
|
|
173
|
+
console.info();
|
|
157
174
|
let fromSha = args.from;
|
|
158
175
|
const config = readTakeoutConfig();
|
|
159
176
|
if (!fromSha) {
|
|
160
177
|
if (!config?.sha) {
|
|
161
|
-
console.info(pc.yellow("No .takeout file found with last sync SHA."))
|
|
178
|
+
console.info(pc.yellow("No .takeout file found with last sync SHA."));
|
|
179
|
+
console.info();
|
|
180
|
+
console.info(pc.dim("Either:"));
|
|
181
|
+
console.info(pc.dim(" 1. Create a .takeout file with: sha=<commit-sha>"));
|
|
182
|
+
console.info(pc.dim(" 2. Run with --from <sha> to specify starting point"));
|
|
183
|
+
console.info(pc.dim(" 3. Run `tko sync` to sync and create the file"));
|
|
184
|
+
console.info();
|
|
162
185
|
return;
|
|
163
186
|
}
|
|
164
187
|
fromSha = config.sha;
|
|
165
188
|
}
|
|
166
|
-
if (!ensureUpstreamRemote())
|
|
189
|
+
if (!ensureUpstreamRemote()) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
167
192
|
const toRef = args.to || `${UPSTREAM_REMOTE}/main`;
|
|
168
|
-
console.info(pc.dim(` from: ${fromSha.slice(0, 7)}`))
|
|
193
|
+
console.info(pc.dim(` from: ${fromSha.slice(0, 7)}`));
|
|
194
|
+
console.info(pc.dim(` to: ${toRef}`));
|
|
195
|
+
if (config?.date) {
|
|
196
|
+
console.info(pc.dim(` last sync: ${config.date}`));
|
|
197
|
+
}
|
|
169
198
|
const commits = getCommitsBetween(fromSha, toRef);
|
|
170
199
|
if (commits.length === 0) {
|
|
171
|
-
console.info()
|
|
200
|
+
console.info();
|
|
201
|
+
console.info(pc.green("\u2713 Already up to date with upstream!"));
|
|
202
|
+
console.info();
|
|
172
203
|
return;
|
|
173
204
|
}
|
|
174
|
-
console.info()
|
|
205
|
+
console.info();
|
|
206
|
+
console.info(pc.bold(`${commits.length} commit${commits.length === 1 ? "" : "s"} since last sync:`));
|
|
207
|
+
formatChangelog(commits);
|
|
208
|
+
console.info();
|
|
209
|
+
console.info(pc.dim("Run `tko sync` to sync these changes into your fork."));
|
|
210
|
+
console.info();
|
|
175
211
|
}
|
|
176
212
|
});
|
|
177
213
|
export { changedCommand };
|