Compare commits

..

No commits in common. "main" and "v0.2.1" have entirely different histories.

8 changed files with 107 additions and 1431 deletions

View file

@ -2,7 +2,7 @@ name: Release
on: on:
push: push:
branches: branches:
- "release" - "main"
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
@ -20,9 +20,6 @@ jobs:
pull-requests: write pull-requests: write
id-token: write id-token: write
steps: steps:
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Create Release - name: Create Release
uses: https://git.kjan.de/actions/semantic-release@v1.1.0 uses: https://git.kjan.de/actions/semantic-release@v1.1.0
with: with:

View file

@ -1,33 +1,3 @@
## [0.3.3](https://git.kjan.de/jank/project-cli/compare/v0.3.2...v0.3.3) (2025-06-19)
### Bug Fixes
* Fix wrong config ([1f0d3aa](https://git.kjan.de/jank/project-cli/commit/1f0d3aa030d462b7f1df1646b7b4431a8ef43d2c))
## [0.3.2](https://git.kjan.de/jank/project-cli/compare/v0.3.1...v0.3.2) (2025-06-19)
### Bug Fixes
* Remove stupid toml ([a38aedc](https://git.kjan.de/jank/project-cli/commit/a38aedc2481930a9bc5ac4454e5b0b4b6fff5104))
## [0.3.1](https://git.kjan.de/jank/project-cli/compare/v0.3.0...v0.3.1) (2025-06-19)
### Bug Fixes
* Setup bun ([6a1b731](https://git.kjan.de/jank/project-cli/commit/6a1b7317308fdeb2719c258f6c2b62463d81ca3a))
## [0.3.0](https://git.kjan.de/jank/project-cli/compare/v0.2.2...v0.3.0) (2025-06-19)
### Features
* Add some compiling ([81ee09b](https://git.kjan.de/jank/project-cli/commit/81ee09b42fafa5300e384a236602ee22f838da00))
## [0.2.2](https://git.kjan.de/jank/project-cli/compare/v0.2.1...v0.2.2) (2025-06-19)
### Bug Fixes
* Fix releases ([8bfcadd](https://git.kjan.de/jank/project-cli/commit/8bfcadd11f346645eb79027349b791d016ca2b0d))
## [0.2.1](https://git.kjan.de/jank/project-cli/compare/v0.2.0...v0.2.1) (2025-06-19) ## [0.2.1](https://git.kjan.de/jank/project-cli/compare/v0.2.0...v0.2.1) (2025-06-19)
### Chores ### Chores

1264
bun.lock

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
import fs from "fs"; import fs from "fs";
import os from "os"; import os from "os";
import * as toml from "@std/toml";
export const configPath = os.homedir() + "/.config/project-cli/"; export const configPath = os.homedir() + "/.config/project-cli/";
@ -20,9 +21,9 @@ export function getProjects(): Project[] {
} }
export function getConfiguration(): Configuration { export function getConfiguration(): Configuration {
return JSON.parse( return toml.parse(
fs.readFileSync(configPath + "config.json").toString(), fs.readFileSync(configPath + "config.toml").toString(),
) as Configuration; ) as unknown as Configuration;
} }
export function addProject(project: Project) { export function addProject(project: Project) {
@ -44,8 +45,10 @@ export function generateDefaultConfig() {
cloningCommand: "git clone %s %n", cloningCommand: "git clone %s %n",
}; };
const configString = JSON.stringify(defaultConfig); const configString = toml.stringify(
fs.writeFileSync(configPath + "config.json", configString); defaultConfig as unknown as Record<string, unknown>,
);
fs.writeFileSync(configPath + "config.toml", configString);
const projects: Project[] = []; const projects: Project[] = [];
saveProjects(projects); saveProjects(projects);

View file

@ -1,5 +1,3 @@
#!/usr/bin/env node
import fs from "fs"; import fs from "fs";
import { confirm, select, input } from "@inquirer/prompts"; import { confirm, select, input } from "@inquirer/prompts";
import { exit } from "process"; import { exit } from "process";
@ -12,22 +10,10 @@ import {
type Project, type Project,
} from "./configuration/configuration"; } from "./configuration/configuration";
import { execSync } from "child_process"; import { execSync } from "child_process";
import { program } from "commander";
import packageJson from "./package.json"; if (!fs.existsSync(configPath + "config.toml")) {
export const VERSION = packageJson.version;
const CLI_NAME = "pcli";
program
.name("project-cli")
.description("A cli for managing projects")
.version(VERSION)
.action(async () => {
if (!fs.existsSync(configPath + "config.json")) {
const createConfig = await confirm({ const createConfig = await confirm({
message: message: "No cofig has been found. Would you like to generate a new one?",
"No cofig has been found. Would you like to generate a new one?",
}); });
if (createConfig) { if (createConfig) {
@ -50,9 +36,7 @@ program
choices: ["Clone a project with git", "Create a new empty Project"], choices: ["Clone a project with git", "Create a new empty Project"],
}); });
if (anwser == "Clone a project with git") { if (anwser == "Clone a project with git") {
const repoUrl = await input({ const repoUrl = await input({ message: "What is the url of the repo?" });
message: "What is the url of the repo?",
});
const wantsCustomName = await confirm({ const wantsCustomName = await confirm({
message: "Would you like to give this project a custom name?", message: "Would you like to give this project a custom name?",
default: false, default: false,
@ -88,32 +72,4 @@ program
addProject(newProject); addProject(newProject);
} }
} }
const pickedProject = await select({
message: "Which Project would you like to go to?",
choices: getProjects().map((project: Project) => project.name),
});
console.log(
"__EXEC__ cd " +
getConfiguration().projectsDirectory +
"/" +
pickedProject,
);
console.log(getProjects()); console.log(getProjects());
});
program.command("init").action(() => {
console.log(`${CLI_NAME}() {
command ${CLI_NAME} "$@" | while IFS= read -r line; do
if [[ $line == __EXEC__* ]]; then
eval "\${line#__EXEC__}"
else
echo "$line"
fi
done
}`);
});
program.parse();

48
package-lock.json generated
View file

@ -1,17 +1,18 @@
{ {
"name": "proj-cli", "name": "proj-cli",
"version": "0.3.3", "version": "0.2.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "proj-cli", "name": "proj-cli",
"version": "0.3.3", "version": "0.2.1",
"dependencies": { "dependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0", "@saithodev/semantic-release-gitea": "^2.1.0",
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^14.0.3", "@semantic-release/release-notes-generator": "^14.0.3",
"@std/toml": "npm:@jsr/std__toml",
"@types/commander": "^2.12.5", "@types/commander": "^2.12.5",
"@types/inquirer": "^9.0.8", "@types/inquirer": "^9.0.8",
"commander": "^14.0.0", "commander": "^14.0.0",
@ -20,9 +21,6 @@
"inquirer": "^12.6.3", "inquirer": "^12.6.3",
"semantic-release": "^24.2.5" "semantic-release": "^24.2.5"
}, },
"bin": {
"pcli": "dist/index.js"
},
"devDependencies": { "devDependencies": {
"@types/bun": "latest" "@types/bun": "latest"
}, },
@ -492,6 +490,11 @@
} }
} }
}, },
"node_modules/@jsr/std__collections": {
"version": "1.1.1",
"resolved": "https://npm.jsr.io/~/11/@jsr/std__collections/1.1.1.tgz",
"integrity": "sha512-bS4Y5f80IUeDUf+0BgVVWValgBeGcJ/UwFYTC5PBIJtrFqwEmU8IohDBwFLJILyUtiAB1jbJewl0K+REEQ9kQQ=="
},
"node_modules/@nodelib/fs.scandir": { "node_modules/@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@ -636,9 +639,9 @@
} }
}, },
"node_modules/@octokit/request": { "node_modules/@octokit/request": {
"version": "10.0.3", "version": "10.0.2",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.3.tgz", "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.2.tgz",
"integrity": "sha512-V6jhKokg35vk098iBqp2FBKunk3kMTXlmq+PtbV9Gl3TfskWlebSofU9uunVKhUN7xl+0+i5vt0TGTG8/p/7HA==", "integrity": "sha512-iYj4SJG/2bbhh+iIpFmG5u49DtJ4lipQ+aPakjL9OKpsGY93wM8w06gvFbEQxcMsZcCvk5th5KkIm2m8o14aWA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@octokit/endpoint": "^11.0.0", "@octokit/endpoint": "^11.0.0",
@ -1385,6 +1388,15 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/@std/toml": {
"name": "@jsr/std__toml",
"version": "1.0.8",
"resolved": "https://npm.jsr.io/~/11/@jsr/std__toml/1.0.8.tgz",
"integrity": "sha512-rnMoiySl30TrsdnfKcroYEWIBlmPvdNoA8fn/Njy3rsZR9C8k5nUeo9kWP/D/PhxYlUaYPtmQ31YhNqGpmEZ3Q==",
"dependencies": {
"@jsr/std__collections": "^1.1.1"
}
},
"node_modules/@szmarczak/http-timer": { "node_modules/@szmarczak/http-timer": {
"version": "4.0.6", "version": "4.0.6",
"resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz",
@ -1398,13 +1410,13 @@
} }
}, },
"node_modules/@types/bun": { "node_modules/@types/bun": {
"version": "1.2.17", "version": "1.2.16",
"resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.2.17.tgz", "resolved": "https://registry.npmjs.org/@types/bun/-/bun-1.2.16.tgz",
"integrity": "sha512-l/BYs/JYt+cXA/0+wUhulYJB6a6p//GTPiJ7nV+QHa8iiId4HZmnu/3J/SowP5g0rTiERY2kfGKXEK5Ehltx4Q==", "integrity": "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"bun-types": "1.2.17" "bun-types": "1.2.16"
} }
}, },
"node_modules/@types/cacheable-request": { "node_modules/@types/cacheable-request": {
@ -1481,9 +1493,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.0.4", "version": "24.0.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.4.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.3.tgz",
"integrity": "sha512-ulyqAkrhnuNq9pB76DRBTkcS6YsmDALy6Ua63V8OhrOBgbcYt6IOdzpw5P1+dyRIyMerzLkeYWBeOXPpA9GMAA==", "integrity": "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"undici-types": "~7.8.0" "undici-types": "~7.8.0"
@ -1669,9 +1681,9 @@
} }
}, },
"node_modules/bun-types": { "node_modules/bun-types": {
"version": "1.2.17", "version": "1.2.16",
"resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.17.tgz", "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.16.tgz",
"integrity": "sha512-ElC7ItwT3SCQwYZDYoAH+q6KT4Fxjl8DtZ6qDulUFBmXA8YB4xo+l54J9ZJN+k2pphfn9vk7kfubeSd5QfTVJQ==", "integrity": "sha512-ciXLrHV4PXax9vHvUrkvun9VPVGOVwbbbBF/Ev1cXz12lyEZMoJpIJABOfPcN9gDJRaiKF9MVbSygLg4NXu3/A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View file

@ -1,19 +1,8 @@
{ {
"name": "proj-cli", "name": "proj-cli",
"version": "0.3.3", "version": "0.2.1",
"module": "index.ts", "module": "index.ts",
"type": "module", "type": "module",
"bin": {
"pcli": "./dist/index.js"
},
"scripts": {
"build": "bun build index.ts --outfile dist/index.js --target node",
"dev": "bun run index.ts",
"prepublishOnly": "bun run build"
},
"files": [
"dist/"
],
"devDependencies": { "devDependencies": {
"@types/bun": "latest" "@types/bun": "latest"
}, },
@ -25,6 +14,7 @@
"@semantic-release/changelog": "^6.0.3", "@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^14.0.3", "@semantic-release/release-notes-generator": "^14.0.3",
"@std/toml": "npm:@jsr/std__toml",
"@types/commander": "^2.12.5", "@types/commander": "^2.12.5",
"@types/inquirer": "^9.0.8", "@types/inquirer": "^9.0.8",
"commander": "^14.0.0", "commander": "^14.0.0",

View file

@ -1,5 +1,5 @@
module.exports = { module.exports = {
branches: ["release"], branches: ["main"],
plugins: [ plugins: [
[ [
"@semantic-release/commit-analyzer", "@semantic-release/commit-analyzer",