Skip to content

Commit ce576c7

Browse files
authored
chore: rename data dir to .blink (#6)
1 parent bda467d commit ce576c7

File tree

14 files changed

+70
-96
lines changed

14 files changed

+70
-96
lines changed

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.blink/data/
1+
.blink/
22
**/*.hbs

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ agent.on("request", async (request, context) => {
114114
agent.serve();
115115
```
116116

117-
Locally, all chats are stored in `./data/chats/<key>.json` relative to where your agent is running.
117+
Locally, all chats are stored in `./.blink/chats/<key>.json` relative to where your agent is running.
118118

119119
In the cloud, chats keys are namespaced per-agent.
120120

@@ -174,7 +174,7 @@ agent.on("chat", async ({ messages }) => {
174174
agent.serve();
175175
```
176176

177-
Locally, all storage is in `./data/storage.json` relative to where your agent is running.
177+
Locally, all storage is in `./.blink/storage.json` relative to where your agent is running.
178178

179179
In the cloud, storage is namespaced per-agent.
180180

packages/blink/src/build/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface Config {
1414

1515
/**
1616
* outdir is the directory to write the build output to.
17-
* Defaults to `data/build` in the current working directory.
17+
* Defaults to `.blink/build` in the current working directory.
1818
*/
1919
outdir?: string;
2020

@@ -111,7 +111,7 @@ Try creating "agent.ts" or specify "entry" in a blink.config.ts file.`);
111111
}
112112
}
113113
if (!config.outdir) {
114-
config.outdir = path.resolve(directory, "data/build");
114+
config.outdir = path.resolve(directory, ".blink/build");
115115
}
116116
if (!config.build) {
117117
// By default, we bundle with esbuild.

packages/blink/src/cli/deploy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Client, {
55
import { stat, readFile } from "node:fs/promises";
66
import { basename, dirname, join, relative } from "node:path";
77
import { loginIfNeeded } from "./lib/auth";
8-
import { migrateBlinkToData } from "./lib/migrate";
8+
import { migrateDataToBlink } from "./lib/migrate";
99
import { existsSync } from "node:fs";
1010
import { mkdir, writeFile, readdir } from "fs/promises";
1111
import { select, confirm, isCancel, spinner } from "@clack/prompts";
@@ -26,8 +26,8 @@ export default async function deploy(
2626
directory = process.cwd();
2727
}
2828

29-
// Auto-migrate .blink to data if it exists
30-
await migrateBlinkToData(directory);
29+
// Auto-migrate data to .blink if it exists
30+
await migrateDataToBlink(directory);
3131

3232
const token = await loginIfNeeded();
3333
const client = new Client({
@@ -54,8 +54,8 @@ export default async function deploy(
5454
// Find the nearest config file if it exists.
5555
const rootDirectory = dirname(packageJSON);
5656

57-
// Check for a data directory. This stores the agent's deploy config.
58-
const deployConfigPath = join(rootDirectory, "data", "config.json");
57+
// Check for a .blink directory. This stores the agent's deploy config.
58+
const deployConfigPath = join(rootDirectory, ".blink", "config.json");
5959

6060
let deployConfig: DeployConfig = {};
6161
if (existsSync(deployConfigPath)) {
@@ -549,7 +549,7 @@ async function collectSourceFiles(rootDir: string): Promise<string[]> {
549549
const defaultIgnorePatterns = [
550550
".git",
551551
"node_modules",
552-
"data",
552+
".blink",
553553
".env",
554554
".env.*",
555555
];

packages/blink/src/cli/dev.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { resolveConfig } from "../build/index";
55
import { findNearestEntry } from "../build/util";
66
import { startDev } from "../tui/dev";
77
import { getAuthToken } from "./lib/auth";
8-
import { migrateBlinkToData } from "./lib/migrate";
8+
import { migrateDataToBlink } from "./lib/migrate";
99

1010
export default async function dev(directory?: string): Promise<void> {
1111
if (!directory) {
@@ -19,7 +19,7 @@ export default async function dev(directory?: string): Promise<void> {
1919
// No agent found in current directory, search upward for .blink
2020
let dotBlinkPath = await findNearestEntry(cwd, ".blink");
2121

22-
// This is legacy behavior to migrate old Blink directories to the new data/ directory.
22+
// This is legacy behavior to migrate old Blink directories to the new .blink/ directory.
2323
if (dotBlinkPath && existsSync(join(dotBlinkPath, "build"))) {
2424
dotBlinkPath = undefined;
2525
}
@@ -32,9 +32,8 @@ export default async function dev(directory?: string): Promise<void> {
3232
}
3333
}
3434
}
35-
36-
// Auto-migrate .blink to data if it exists
37-
await migrateBlinkToData(directory);
35+
// Auto-migrate data/ to .blink/ if it exists
36+
await migrateDataToBlink(directory);
3837

3938
const exitWithDump = (error: Error) => {
4039
writeFileSync("error.dump", inspect(error, { depth: null }));

packages/blink/src/cli/init-templates/index.ts

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

packages/blink/src/cli/init-templates/scratch/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
node_modules
33

44
# config and build
5-
data
5+
.blink
66

77
# dotenv environment variables file
88
.env

packages/blink/src/cli/init-templates/slack-bot/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
node_modules
33

44
# config and build
5-
data
5+
.blink
66

77
# dotenv environment variables file
88
.env

packages/blink/src/cli/lib/devhook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { dirname, join } from "path";
1111
* Gets the path to the devhook ID file.
1212
*/
1313
export function getDevhookPath(directory: string): string {
14-
return join(directory, "data", "devhook.txt");
14+
return join(directory, ".blink", "devhook.txt");
1515
}
1616

1717
/**

packages/blink/src/cli/lib/first-run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { dirname, join } from "path";
99
* @returns true if this is the first time, false otherwise
1010
*/
1111
export function checkAndMarkFirstRun(directory: string): boolean {
12-
const storagePath = join(directory, "data", ".first-run");
12+
const storagePath = join(directory, ".blink", ".first-run");
1313
mkdirSync(dirname(storagePath), { recursive: true });
1414

1515
if (existsSync(storagePath)) {

0 commit comments

Comments
 (0)