Skip to content

Commit dc00d82

Browse files
committed
chore: Update Deno configuration and refactor workflows
- Add new `nodeModulesDir` setting in deno.json for automatic module resolution - Simplify task commands in deno.json by using the `-A` flag for permissions - Update dependencies in deno.lock, including `drizzle-kit`, `drizzle-orm`, and `mysql2` - Remove unused SQL configuration files and related data sources - Refactor workflow classes to improve logging and error handling - Enhance workflow execution with detailed metrics tracking and structured event handling - Remove deprecated interfaces and streamline configuration management
1 parent 5ee53a9 commit dc00d82

42 files changed

Lines changed: 1205 additions & 714 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deno.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2+
"nodeModulesDir": "auto",
23
"tasks": {
3-
"start": "deno run --watch --allow-env --allow-ffi --allow-read --allow-sys --allow-net src/index.ts",
4-
"test": "deno run --allow-env --allow-ffi --allow-read --allow-sys --allow-net src/test.ts",
5-
"build:win": "deno compile --allow-env --allow-ffi --allow-read --allow-sys --allow-net --target x86_64-pc-windows-msvc --output trendFinder.exe --icon ./docs/images/main.ico --include src/modules/render/templates src/test.ts ",
6-
"build:mac-x64": "deno compile --allow-env --allow-ffi --allow-read --allow-sys --allow-net --target x86_64-apple-darwin --output trendFinder-mac-x64 --include src/modules/render/templates src/test.ts ",
7-
"build:mac-arm64": "deno compile --allow-env --allow-ffi --allow-read --allow-sys --allow-net --target aarch64-apple-darwin --output trendFinder-mac-arm64 --include src/modules/render/templates src/test.ts ",
8-
"build:linux-x64": "deno compile --allow-env --allow-ffi --allow-read --allow-sys --allow-net --target x86_64-unknown-linux-gnu --output trendFinder-linux-x64 --include src/modules/render/templates src/test.ts ",
9-
"build:linux-arm64": "deno compile --allow-env --allow-ffi --allow-read --allow-sys --allow-net --target aarch64-unknown-linux-gnu --output trendFinder-linux-arm64 --include src/modules/render/templates src/test.ts ",
4+
"start": "deno run -A src/index.ts",
5+
"test": "deno run -A src/test.ts",
6+
"build:win": "deno compile -A --target x86_64-pc-windows-msvc --output trendFinder.exe --icon ./docs/images/main.ico --include src/modules/render/templates src/test.ts ",
7+
"build:mac-x64": "deno compile -A --target x86_64-apple-darwin --output trendFinder-mac-x64 --include src/modules/render/templates src/test.ts ",
8+
"build:mac-arm64": "deno compile -A --target aarch64-apple-darwin --output trendFinder-mac-arm64 --include src/modules/render/templates src/test.ts ",
9+
"build:linux-x64": "deno compile -A --target x86_64-unknown-linux-gnu --output trendFinder-linux-x64 --include src/modules/render/templates src/test.ts ",
10+
"build:linux-arm64": "deno compile -A --target aarch64-unknown-linux-gnu --output trendFinder-linux-arm64 --include src/modules/render/templates src/test.ts ",
1011
"build:all": "deno task build:win && deno task build:mac-x64 && deno task build:mac-arm64 && deno task build:linux-x64 && deno task build:linux-arm64",
1112
"build:docs": "deno run --allow-all scripts/md2html.ts"
1213
},
@@ -15,7 +16,10 @@
1516
"@std/assert": "jsr:@std/assert@1",
1617
"@src/": "./src/",
1718
"@zilla/logger": "jsr:@zilla/logger@^1.0.1",
18-
"@sapling/markdown": "https://deno.land/x/sapling_markdown@v1.0.0/mod.ts"
19+
"@sapling/markdown": "https://deno.land/x/sapling_markdown@v1.0.0/mod.ts",
20+
"drizzle-kit": "npm:drizzle-kit@^0.30.5",
21+
"drizzle-orm": "npm:drizzle-orm@^0.40.0",
22+
"mysql2": "npm:mysql2@^3.13.0"
1923
},
2024
"exclude": [
2125
"node_modules",

deno.lock

Lines changed: 314 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

drizzle.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "drizzle-kit";
2+
3+
export default defineConfig({
4+
out: "./drizzle",
5+
schema: "./src/db/schema.ts",
6+
dialect: "mysql",
7+
dbCredentials: {
8+
url: Deno.env.get("DATABASE_URL")!,
9+
},
10+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- Current sql file was generated after introspecting the database
2+
-- If you want to run this migration please uncomment this code before executing migrations
3+
/*
4+
CREATE TABLE `config` (
5+
`id` int AUTO_INCREMENT NOT NULL,
6+
`key` varchar(255),
7+
`value` varchar(255),
8+
CONSTRAINT `config_id` PRIMARY KEY(`id`)
9+
);
10+
--> statement-breakpoint
11+
CREATE TABLE `data_sources` (
12+
`id` int AUTO_INCREMENT NOT NULL,
13+
`platform` varchar(255),
14+
`identifier` varchar(255),
15+
CONSTRAINT `data_sources_id` PRIMARY KEY(`id`)
16+
);
17+
18+
*/

drizzle/meta/0000_snapshot.json

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"id": "00000000-0000-0000-0000-000000000000",
3+
"prevId": "",
4+
"version": "5",
5+
"dialect": "mysql",
6+
"tables": {
7+
"config": {
8+
"name": "config",
9+
"columns": {
10+
"id": {
11+
"autoincrement": true,
12+
"name": "id",
13+
"type": "int",
14+
"primaryKey": false,
15+
"notNull": true
16+
},
17+
"key": {
18+
"autoincrement": false,
19+
"name": "key",
20+
"type": "varchar(255)",
21+
"primaryKey": false,
22+
"notNull": false
23+
},
24+
"value": {
25+
"autoincrement": false,
26+
"name": "value",
27+
"type": "varchar(255)",
28+
"primaryKey": false,
29+
"notNull": false
30+
}
31+
},
32+
"compositePrimaryKeys": {
33+
"config_id": {
34+
"name": "config_id",
35+
"columns": [
36+
"id"
37+
]
38+
}
39+
},
40+
"indexes": {},
41+
"foreignKeys": {},
42+
"uniqueConstraints": {},
43+
"checkConstraint": {}
44+
},
45+
"data_sources": {
46+
"name": "data_sources",
47+
"columns": {
48+
"id": {
49+
"autoincrement": true,
50+
"name": "id",
51+
"type": "int",
52+
"primaryKey": false,
53+
"notNull": true
54+
},
55+
"platform": {
56+
"autoincrement": false,
57+
"name": "platform",
58+
"type": "varchar(255)",
59+
"primaryKey": false,
60+
"notNull": false
61+
},
62+
"identifier": {
63+
"autoincrement": false,
64+
"name": "identifier",
65+
"type": "varchar(255)",
66+
"primaryKey": false,
67+
"notNull": false
68+
}
69+
},
70+
"compositePrimaryKeys": {
71+
"data_sources_id": {
72+
"name": "data_sources_id",
73+
"columns": [
74+
"id"
75+
]
76+
}
77+
},
78+
"indexes": {},
79+
"foreignKeys": {},
80+
"uniqueConstraints": {},
81+
"checkConstraint": {}
82+
}
83+
},
84+
"views": {},
85+
"_meta": {
86+
"schemas": {},
87+
"tables": {},
88+
"columns": {}
89+
},
90+
"internal": {
91+
"tables": {},
92+
"indexes": {}
93+
}
94+
}

drizzle/meta/_journal.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "7",
3+
"dialect": "mysql",
4+
"entries": [
5+
{
6+
"idx": 0,
7+
"version": "5",
8+
"when": 1742104256171,
9+
"tag": "0000_typical_stepford_cuckoos",
10+
"breakpoints": true
11+
}
12+
]
13+
}

drizzle/relations.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { relations } from "drizzle-orm/relations";
2+
import { } from "./schema";
3+

drizzle/schema.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { mysqlTable, mysqlSchema, AnyMySqlColumn, primaryKey, int, varchar } from "drizzle-orm/mysql-core"
2+
import { sql } from "drizzle-orm"
3+
4+
export const config = mysqlTable("config", {
5+
id: int().autoincrement().notNull(),
6+
key: varchar({ length: 255 }),
7+
value: varchar({ length: 255 }),
8+
},
9+
(table) => [
10+
primaryKey({ columns: [table.id], name: "config_id"}),
11+
]);
12+
13+
export const dataSources = mysqlTable("data_sources", {
14+
id: int().autoincrement().notNull(),
15+
platform: varchar({ length: 255 }),
16+
identifier: varchar({ length: 255 }),
17+
},
18+
(table) => [
19+
primaryKey({ columns: [table.id], name: "data_sources_id"}),
20+
]);

sql/config.sql

Lines changed: 0 additions & 31 deletions
This file was deleted.

sql/cron_sources.sql

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)