Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ async function main() {

// Run the main function if this file is run directly and not imported
if (
process.argv[1].endsWith(join("@bucketco", "cli", "dist", "index.js")) ||
process.argv[1].endsWith(join("cli", "dist", "index.js")) ||
process.argv[1].endsWith(join(".bin", "bucket"))
) {
void main();
Expand Down
7 changes: 4 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bucketco/cli",
"version": "0.1.1",
"version": "0.1.2",
"packageManager": "yarn@4.1.1",
"description": "CLI for Bucket service",
"main": "./dist/index.js",
Expand Down Expand Up @@ -29,8 +29,8 @@
".": "./dist/index.js"
},
"scripts": {
"build": "tsc",
"bucket": "yarn build && node dist/index.js",
"build": "tsc && shx chmod +x dist/index.js",
"bucket": "yarn build && ./dist/index.js",
"lint": "eslint .",
"lint:ci": "eslint --output-file eslint-report.json --format json .",
"prettier": "prettier --check .",
Expand All @@ -53,6 +53,7 @@
"@types/node": "^22.5.1",
"eslint": "^9.21.0",
"prettier": "^3.5.2",
"shx": "^0.3.4",
"typescript": "^5.5.4"
}
}
12 changes: 7 additions & 5 deletions packages/cli/stores/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { findUp } from "find-up";
import JSON5 from "json5";
import { readFile, writeFile } from "node:fs/promises";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

import {
CONFIG_FILE_NAME,
Expand Down Expand Up @@ -56,11 +57,12 @@ class ConfigStore {

protected async createValidator() {
try {
const schemaPath = await findUp("schema.json", {
cwd: import.meta.url,
stopAt: "cli",
});
if (!schemaPath) return;
// Using current config store file, resolve the schema.json path
const filePath = fileURLToPath(import.meta.url);
const schemaPath = join(
filePath.substring(0, filePath.indexOf("cli") + 3),
"schema.json",
);
const content = await readFile(schemaPath, "utf-8");
const parsed = JSON5.parse<Config>(content);
const ajv = new Ajv();
Expand Down
92 changes: 80 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ __metadata:
open: "npm:^10.1.0"
ora: "npm:^8.1.0"
prettier: "npm:^3.5.2"
shx: "npm:^0.3.4"
typescript: "npm:^5.5.4"
bin:
bucket: ./dist/index.js
Expand Down Expand Up @@ -8456,31 +8457,31 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^7.1.3":
version: 7.2.0
resolution: "glob@npm:7.2.0"
"glob@npm:^7.0.0, glob@npm:^7.1.4":
version: 7.2.3
resolution: "glob@npm:7.2.3"
dependencies:
fs.realpath: "npm:^1.0.0"
inflight: "npm:^1.0.4"
inherits: "npm:2"
minimatch: "npm:^3.0.4"
minimatch: "npm:^3.1.1"
once: "npm:^1.3.0"
path-is-absolute: "npm:^1.0.0"
checksum: 10c0/478b40e38be5a3d514e64950e1e07e0ac120585add6a37c98d0ed24d72d9127d734d2a125786073c8deb687096e84ae82b641c441a869ada3a9cc91b68978632
checksum: 10c0/65676153e2b0c9095100fe7f25a778bf45608eeb32c6048cf307f579649bcc30353277b3b898a3792602c65764e5baa4f643714dfbdfd64ea271d210c7a425fe
languageName: node
linkType: hard

"glob@npm:^7.1.4":
version: 7.2.3
resolution: "glob@npm:7.2.3"
"glob@npm:^7.1.3":
version: 7.2.0
resolution: "glob@npm:7.2.0"
dependencies:
fs.realpath: "npm:^1.0.0"
inflight: "npm:^1.0.4"
inherits: "npm:2"
minimatch: "npm:^3.1.1"
minimatch: "npm:^3.0.4"
once: "npm:^1.3.0"
path-is-absolute: "npm:^1.0.0"
checksum: 10c0/65676153e2b0c9095100fe7f25a778bf45608eeb32c6048cf307f579649bcc30353277b3b898a3792602c65764e5baa4f643714dfbdfd64ea271d210c7a425fe
checksum: 10c0/478b40e38be5a3d514e64950e1e07e0ac120585add6a37c98d0ed24d72d9127d734d2a125786073c8deb687096e84ae82b641c441a869ada3a9cc91b68978632
languageName: node
linkType: hard

Expand Down Expand Up @@ -9156,6 +9157,13 @@ __metadata:
languageName: node
linkType: hard

"interpret@npm:^1.0.0":
version: 1.4.0
resolution: "interpret@npm:1.4.0"
checksum: 10c0/08c5ad30032edeec638485bc3f6db7d0094d9b3e85e0f950866600af3c52e9fd69715416d29564731c479d9f4d43ff3e4d302a178196bdc0e6837ec147640450
languageName: node
linkType: hard

"interpret@npm:^3.1.1":
version: 3.1.1
resolution: "interpret@npm:3.1.1"
Expand Down Expand Up @@ -9323,7 +9331,7 @@ __metadata:
languageName: node
linkType: hard

"is-core-module@npm:^2.15.1":
"is-core-module@npm:^2.15.1, is-core-module@npm:^2.16.0":
version: 2.16.1
resolution: "is-core-module@npm:2.16.1"
dependencies:
Expand Down Expand Up @@ -11008,7 +11016,7 @@ __metadata:
languageName: node
linkType: hard

"minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6":
"minimist@npm:^1.2.0, minimist@npm:^1.2.3, minimist@npm:^1.2.5, minimist@npm:^1.2.6":
version: 1.2.8
resolution: "minimist@npm:1.2.8"
checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6
Expand Down Expand Up @@ -13575,6 +13583,15 @@ __metadata:
languageName: node
linkType: hard

"rechoir@npm:^0.6.2":
version: 0.6.2
resolution: "rechoir@npm:0.6.2"
dependencies:
resolve: "npm:^1.1.6"
checksum: 10c0/22c4bb32f4934a9468468b608417194f7e3ceba9a508512125b16082c64f161915a28467562368eeb15dc16058eb5b7c13a20b9eb29ff9927d1ebb3b5aa83e84
languageName: node
linkType: hard

"rechoir@npm:^0.8.0":
version: 0.8.0
resolution: "rechoir@npm:0.8.0"
Expand Down Expand Up @@ -13720,6 +13737,19 @@ __metadata:
languageName: node
linkType: hard

"resolve@npm:^1.1.6":
version: 1.22.10
resolution: "resolve@npm:1.22.10"
dependencies:
is-core-module: "npm:^2.16.0"
path-parse: "npm:^1.0.7"
supports-preserve-symlinks-flag: "npm:^1.0.0"
bin:
resolve: bin/resolve
checksum: 10c0/8967e1f4e2cc40f79b7e080b4582b9a8c5ee36ffb46041dccb20e6461161adf69f843b43067b4a375de926a2cd669157e29a29578191def399dd5ef89a1b5203
languageName: node
linkType: hard

"resolve@npm:^1.1.7, resolve@npm:^1.10.0, resolve@npm:^1.22.2, resolve@npm:~1.22.2":
version: 1.22.8
resolution: "resolve@npm:1.22.8"
Expand Down Expand Up @@ -13769,6 +13799,19 @@ __metadata:
languageName: node
linkType: hard

"resolve@patch:resolve@npm%3A^1.1.6#optional!builtin<compat/resolve>":
version: 1.22.10
resolution: "resolve@patch:resolve@npm%3A1.22.10#optional!builtin<compat/resolve>::version=1.22.10&hash=c3c19d"
dependencies:
is-core-module: "npm:^2.16.0"
path-parse: "npm:^1.0.7"
supports-preserve-symlinks-flag: "npm:^1.0.0"
bin:
resolve: bin/resolve
checksum: 10c0/52a4e505bbfc7925ac8f4cd91fd8c4e096b6a89728b9f46861d3b405ac9a1ccf4dcbf8befb4e89a2e11370dacd0160918163885cbc669369590f2f31f4c58939
languageName: node
linkType: hard

"resolve@patch:resolve@npm%3A^1.1.7#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.10.0#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A^1.22.2#optional!builtin<compat/resolve>, resolve@patch:resolve@npm%3A~1.22.2#optional!builtin<compat/resolve>":
version: 1.22.8
resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin<compat/resolve>::version=1.22.8&hash=c3c19d"
Expand Down Expand Up @@ -14425,6 +14468,31 @@ __metadata:
languageName: node
linkType: hard

"shelljs@npm:^0.8.5":
version: 0.8.5
resolution: "shelljs@npm:0.8.5"
dependencies:
glob: "npm:^7.0.0"
interpret: "npm:^1.0.0"
rechoir: "npm:^0.6.2"
bin:
shjs: bin/shjs
checksum: 10c0/feb25289a12e4bcd04c40ddfab51aff98a3729f5c2602d5b1a1b95f6819ec7804ac8147ebd8d9a85dfab69d501bcf92d7acef03247320f51c1552cec8d8e2382
languageName: node
linkType: hard

"shx@npm:^0.3.4":
version: 0.3.4
resolution: "shx@npm:0.3.4"
dependencies:
minimist: "npm:^1.2.3"
shelljs: "npm:^0.8.5"
bin:
shx: lib/cli.js
checksum: 10c0/83251fb09314682f5a192f0249a4be68c755933313a41b5152b11c19fc0a68311954d3ca971a0cbae05815786a893c59b82f356484d8eeb009c84f4066b3fa31
languageName: node
linkType: hard

"side-channel-list@npm:^1.0.0":
version: 1.0.0
resolution: "side-channel-list@npm:1.0.0"
Expand Down