Skip to content

Commit 50b7bc3

Browse files
committed
release: publish self-contained v0.1.2
1 parent d249415 commit 50b7bc3

18 files changed

+47
-82
lines changed

bin/cache.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#!/usr/bin/env node
22

3-
const path = require("node:path");
4-
const moduleAlias = require("module-alias");
5-
6-
moduleAlias.addAlias("@", path.join(__dirname, "..", "dist"));
7-
83
const { main } = require("../dist/index.js");
94

105
void main();

package-lock.json

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codecache-cli",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "Local-first CLI for storing and retrieving code snippets.",
55
"license": "MIT",
66
"bin": {
@@ -25,12 +25,7 @@
2525
"typecheck": "tsc --noEmit -p tsconfig.json",
2626
"verify": "npm run typecheck && npm run test && npm run build"
2727
},
28-
"_moduleAliases": {
29-
"@": "dist"
30-
},
31-
"dependencies": {
32-
"module-alias": "^2.2.3"
33-
},
28+
"dependencies": {},
3429
"devDependencies": {
3530
"@types/node": "^24.12.0",
3631
"typescript": "^5.9.3",

src/app/attachments.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import path from "node:path";
22
import { stat } from "node:fs/promises";
3-
import { createNotFoundError } from "@/shared/errors";
4-
import { guessMimeType } from "@/shared/mime";
5-
import type { VaultDatabase } from "@/storage/sqlite";
6-
import { createAttachmentRepository, createSnippetRepository } from "@/storage/sqlite";
3+
import { createNotFoundError } from "../shared/errors";
4+
import { guessMimeType } from "../shared/mime";
5+
import type { VaultDatabase } from "../storage/sqlite";
6+
import { createAttachmentRepository, createSnippetRepository } from "../storage/sqlite";
77
import {
88
buildAttachmentRelativePath,
99
deleteAttachmentFile,
1010
deleteSnippetAttachmentDirectory,
1111
exportAttachmentFile,
1212
importAttachmentFile,
13-
} from "@/storage/attachment-files";
13+
} from "../storage/attachment-files";
1414

1515
interface AttachmentServiceDependencies {
1616
attachmentRepository: ReturnType<typeof createAttachmentRepository>;

src/app/snippets.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { CreateSnippetInput, ListSnippetsInput, UpdateSnippetInput } from "@/shared/types";
2-
import { createNotFoundError, createValidationError } from "@/shared/errors";
3-
import { normalizeTags } from "@/shared/tags";
4-
import type { VaultDatabase } from "@/storage/sqlite";
5-
import { createSnippetRepository } from "@/storage/sqlite";
1+
import type { CreateSnippetInput, ListSnippetsInput, UpdateSnippetInput } from "../shared/types";
2+
import { createNotFoundError, createValidationError } from "../shared/errors";
3+
import { normalizeTags } from "../shared/tags";
4+
import type { VaultDatabase } from "../storage/sqlite";
5+
import { createSnippetRepository } from "../storage/sqlite";
66

77
function requireValue(value: string, message: string) {
88
if (!value.trim()) {

src/cli/output.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CacheError } from "@/shared/errors";
1+
import { CacheError } from "../shared/errors";
22

33
export type OutputFormat = "human" | "json" | "jsonl";
44

src/cli/program.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import path from "node:path";
22
import { readFile } from "node:fs/promises";
3-
import { printError, printSuccess, resolveOutputFormat } from "@/cli/output";
4-
import { createVaultDatabase, isVaultInitialized, openVaultDatabase } from "@/storage/sqlite";
5-
import { createSnippetService } from "@/app/snippets";
6-
import { resolveVaultPath, saveDefaultVault } from "@/app/vault";
7-
import { createAttachmentService } from "@/app/attachments";
8-
import { CacheError, createIoError, createValidationError } from "@/shared/errors";
3+
import { printError, printSuccess, resolveOutputFormat } from "./output";
4+
import { createVaultDatabase, isVaultInitialized, openVaultDatabase } from "../storage/sqlite";
5+
import { createSnippetService } from "../app/snippets";
6+
import { resolveVaultPath, saveDefaultVault } from "../app/vault";
7+
import { createAttachmentService } from "../app/attachments";
8+
import { CacheError, createIoError, createValidationError } from "../shared/errors";
99
import type {
1010
CommandFailure,
1111
CommandResult,
1212
CommandSuccess,
1313
CreateSnippetInput,
1414
ListSnippetsInput,
1515
UpdateSnippetInput,
16-
} from "@/shared/types";
17-
import { resolvePath } from "@/shared/paths";
16+
} from "../shared/types";
17+
import { resolvePath } from "../shared/paths";
1818

1919
interface ParsedArgs {
2020
flags: Map<string, string[]>;

src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import path from "node:path";
2-
import moduleAlias = require("module-alias");
3-
4-
moduleAlias.addAlias("@", __dirname);
5-
import { main } from "@/cli/program";
1+
import { main } from "./cli/program";
62

73
if (require.main === module) {
84
void main();

src/storage/attachment-files.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "node:path";
22
import { copyFile, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
3-
import type { VaultDatabase } from "@/storage/sqlite";
3+
import type { VaultDatabase } from "./sqlite";
44

55
function sanitizeFileName(fileName: string) {
66
return fileName.replace(/[^a-zA-Z0-9._-]/g, "-");

src/storage/sqlite.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { existsSync, mkdirSync } from "node:fs";
22
import path from "node:path";
33
import { DatabaseSync } from "node:sqlite";
4-
import type { ListSnippetsInput, SnippetRecord, UpdateSnippetInput } from "@/shared/types";
5-
import { normalizeTags } from "@/shared/tags";
4+
import type { ListSnippetsInput, SnippetRecord, UpdateSnippetInput } from "../shared/types";
5+
import { normalizeTags } from "../shared/tags";
66

77
type SnippetRow = {
88
id: string;

0 commit comments

Comments
 (0)