@ci-kit/core 0.0.0-stage → 0.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/cli.d.mts +8 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.mjs +55 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +7 -0
- package/package.json +46 -3
- package/README.md +0 -3
package/dist/cli.d.mts
ADDED
package/dist/cli.d.ts
ADDED
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { cac } from 'cac';
|
|
4
|
+
|
|
5
|
+
const version = "0.0.0";
|
|
6
|
+
const pkg = {
|
|
7
|
+
version: version};
|
|
8
|
+
|
|
9
|
+
const cli = cac("ci-kit");
|
|
10
|
+
cli.command("changelog", "Generate release notes from git history").option("--from <tag>", "Previous tag").option("--to <tag>", "Target tag", { default: "HEAD" }).option("--out <path>", "Write result to file").action(async (options) => {
|
|
11
|
+
const { collectCommits, renderChangelog } = await import('@ci-kit/changelog');
|
|
12
|
+
const markdown = renderChangelog(collectCommits({ from: options.from, to: options.to }));
|
|
13
|
+
await output(markdown, options.out);
|
|
14
|
+
});
|
|
15
|
+
cli.command("release-next", "Compute the next beta or production tag").option("--tags <list>", "Comma separated existing tags", { default: "" }).option("--version <version>", "Current version, for example 1.0.5").option("--channel <channel>", "beta or production", { default: "beta" }).option("--bump <kind>", "patch, minor or major", { default: "patch" }).action(async (options) => {
|
|
16
|
+
const { bumpVersion, formatProductionTag, nextBetaTag, parseTag } = await import('@ci-kit/release');
|
|
17
|
+
const tags = (options.tags ?? "").split(",").map((tag) => tag.trim()).filter(Boolean);
|
|
18
|
+
const version = options.version;
|
|
19
|
+
if (!version) {
|
|
20
|
+
throw new Error("--version is required");
|
|
21
|
+
}
|
|
22
|
+
if (options.channel === "production") {
|
|
23
|
+
process.stdout.write(`${formatProductionTag(bumpVersion(version, options.bump ?? "patch"))}
|
|
24
|
+
`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const betaVersion = tags.map(parseTag).find((tag) => tag?.channel === "production")?.version ?? version;
|
|
28
|
+
process.stdout.write(`${nextBetaTag(tags, betaVersion)}
|
|
29
|
+
`);
|
|
30
|
+
});
|
|
31
|
+
cli.command("ai-text", "Generate text with the configured AI provider").option("--prompt <text>", "Inline prompt").option("--prompt-file <path>", "Prompt file").option("--out <path>", "Output path").action(async (options) => {
|
|
32
|
+
const { readFileSync } = await import('node:fs');
|
|
33
|
+
const { text } = await import('@ci-kit/ai');
|
|
34
|
+
const prompt = options.promptFile ? readFileSync(options.promptFile, "utf8") : options.prompt;
|
|
35
|
+
if (!prompt) {
|
|
36
|
+
throw new Error("Provide --prompt or --prompt-file");
|
|
37
|
+
}
|
|
38
|
+
const result = await text({ prompt });
|
|
39
|
+
await output(result.value, options.out);
|
|
40
|
+
});
|
|
41
|
+
cli.help();
|
|
42
|
+
cli.version(pkg.version);
|
|
43
|
+
cli.parse();
|
|
44
|
+
async function output(content, path) {
|
|
45
|
+
if (!path) {
|
|
46
|
+
process.stdout.write(`${content}
|
|
47
|
+
`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const { writeFileSync } = await import('node:fs');
|
|
51
|
+
writeFileSync(path, `${content}
|
|
52
|
+
`, "utf8");
|
|
53
|
+
process.stdout.write(`Wrote ${path}
|
|
54
|
+
`);
|
|
55
|
+
}
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ci-kit/core",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"description": "Meta package that re-exports every ci-kit module",
|
|
6
|
+
"author": "imba97",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/cikit-js/ci-kit#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/cikit-js/ci-kit.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/cikit-js/ci-kit/issues"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"import": "./dist/index.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.mjs",
|
|
23
|
+
"module": "./dist/index.mjs",
|
|
24
|
+
"types": "./dist/index.d.mts",
|
|
25
|
+
"bin": {
|
|
26
|
+
"ci-kit": "dist/cli.mjs"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@ci-kit/ai": "0.0.0",
|
|
33
|
+
"@ci-kit/changelog": "0.0.0",
|
|
34
|
+
"@ci-kit/env": "0.0.0",
|
|
35
|
+
"@ci-kit/gitlab": "0.0.0",
|
|
36
|
+
"@ci-kit/http": "0.0.0",
|
|
37
|
+
"@ci-kit/release": "0.0.0",
|
|
38
|
+
"@ci-kit/roundtable": "0.0.0",
|
|
39
|
+
"cac": "^7.1.0"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "unbuild",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"stub": "unbuild --stub"
|
|
48
|
+
}
|
|
6
49
|
}
|
package/README.md
DELETED