Skip to content

Commit 26edd25

Browse files
committed
chore: release @workglow/sec@0.0.8
1 parent e72bc31 commit 26edd25

7 files changed

Lines changed: 63 additions & 106 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 0.0.8
4+
5+
### Refactors
6+
7+
#### Form
8+
9+
- improve jpath type check in XML parsing options
10+
11+
### Chores
12+
13+
- update @workglow packages to version 0.0.125
14+
- update @workglow packages to version 0.0.124
15+
- update @workglow packages to version 0.0.123
16+
- update documentation and dependencies for CLI improvements
17+
- upgrade actions/setup-node to v6 in GitHub workflows
18+
- upgrade actions/checkout to v6 in GitHub workflows
19+
- update dependabot configuration to group @workglow packages
20+
21+
### Updated Dependencies
22+
23+
- `@workglow/cli`: 0.0.126
24+
- `csv-parse`: ^6.2.1
25+
- `fast-xml-parser`: ^5.5.9
26+
- `@types/bun`: 1.3.11
27+
328
## 0.0.7
429

530
### Features

CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ The CLI entrypoint is `src/sec.ts` and uses Commander for subcommands (e.g., `./
3131
- **`src/types/edgar/`** — TypeScript types for raw EDGAR API responses.
3232
- **`src/util/`** — Database helpers (`db.ts` manages SQLite connection and prepared statement caching).
3333

34+
### SQLite initialization
35+
36+
`src/sec.ts` invokes **`Sqlite.init()`** when the installed `workglow` package defines it (`typeof Sqlite.init === "function"`), so newer Workglow releases load the SQLite binding before `getDb()` opens a database. Older `workglow` versions without `init` skip this step.
37+
3438
### Dependency Injection
3539

3640
Uses the `workglow` package’s `globalServiceRegistry` with typed tokens. Production uses `SqliteTabularRepository`, tests use `InMemoryTabularRepository`. Call `resetDependencyInjectionsForTesting()` from `src/config/TestingDI.ts` in test setup.

bun.lock

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@workglow/sec",
33
"type": "module",
4-
"version": "0.0.7",
4+
"version": "0.0.8",
55
"description": "Workglow SEC is an example of using the Workglow AI library to build a tool for retrieving SEC data.",
66
"scripts": {
77
"bunset": "bunset && git push",
@@ -23,8 +23,8 @@
2323
"@modelcontextprotocol/sdk": "^1.27.1",
2424
"@sroussey/parse-address": "^2.4.2",
2525
"@sroussey/parse-full-name": "^2.0.0",
26-
"workglow": "0.0.125",
27-
"@workglow/cli": "0.0.125",
26+
"workglow": "0.0.126",
27+
"@workglow/cli": "0.0.126",
2828
"awesome-phonenumber": "^7.8.0",
2929
"cheerio": "^1.2.0",
3030
"cheerio-json-mapper": "^1.0.4",
@@ -52,6 +52,6 @@
5252
],
5353
"private": true,
5454
"peerDependencies": {
55-
"typescript": "^5.9.3"
55+
"typescript": "^6.0.2"
5656
}
5757
}

src/cli/groups/init.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { existsSync, mkdirSync, writeFileSync } from "fs";
33
import { homedir } from "os";
44
import { resolve } from "path";
55
import { createInterface } from "readline";
6-
import { globalServiceRegistry } from "workglow";
6+
import { globalServiceRegistry, Sqlite } from "workglow";
77
import { setupAllDatabases } from "../../config/setupAllDatabases";
88
import { SEC_DRY_RUN } from "../../config/tokens";
99
import { parseGlobalOptions } from "../GlobalOptions";
@@ -142,6 +142,10 @@ export function addInitCommand(parent: Command): void {
142142
process.env.SEC_DB_NAME = config.dbName;
143143
process.env.SEC_RAW_DATA_FOLDER = config.rawDataFolder;
144144

145+
if (config.dbType === "sqlite" && typeof Sqlite.init === "function") {
146+
await Sqlite.init();
147+
}
148+
145149
await setupAllDatabases();
146150
console.log("Database tables created.");
147151

src/sec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bun
22

33
import { program } from "commander";
4-
import { getTaskQueueRegistry } from "workglow";
4+
import { getTaskQueueRegistry, Sqlite } from "workglow";
55
import { applyGlobalOptions } from "./cli/GlobalOptions";
66
import { AddCommands } from "./commands";
77
import { SecCliConfigurationError } from "./config/EnvToDI";
@@ -13,6 +13,11 @@ program
1313
applyGlobalOptions(program);
1414
AddCommands(program);
1515

16+
const secDbType = process.env.SEC_DB_TYPE ?? "sqlite";
17+
if (secDbType === "sqlite" && typeof Sqlite.init === "function") {
18+
await Sqlite.init();
19+
}
20+
1621
try {
1722
await program.parseAsync(process.argv);
1823
} catch (e) {

src/util/db.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@ export function getDb(): Sqlite.Database {
1616
const dir = globalServiceRegistry.get(SEC_DB_FOLDER);
1717
mkdirSync(dir, { recursive: true });
1818
const location = path.join(dir, `${globalServiceRegistry.get(SEC_DB_NAME)}.sqlite`);
19-
db = new Sqlite.Database(location, {
20-
readwrite: true,
21-
create: true,
22-
});
23-
db.run("PRAGMA synchronous = 0");
24-
db.run("PRAGMA cache_size = 1000000");
25-
db.run("PRAGMA locking_mode = EXCLUSIVE");
26-
db.run("PRAGMA temp_store = MEMORY");
27-
db.run("PRAGMA journal_mode = OFF");
19+
db = new Sqlite.Database(location);
20+
db.exec("PRAGMA synchronous = 0");
21+
db.exec("PRAGMA cache_size = 1000000");
22+
db.exec("PRAGMA locking_mode = EXCLUSIVE");
23+
db.exec("PRAGMA temp_store = MEMORY");
24+
db.exec("PRAGMA journal_mode = OFF");
2825
}
2926
return db;
3027
}

0 commit comments

Comments
 (0)