Skip to content

Commit cee5422

Browse files
committed
refactor: builder pipe and plugin system
Signed-off-by: Innei <tukon479@gmail.com>
1 parent ad0c883 commit cee5422

Some content is hidden

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

43 files changed

+1957
-826
lines changed

.github/copilot-instructions.md

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

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ thomas-x2d-xcd-25v-1.webp
1212

1313
config.json
1414
.env
15-
builder.config.json
15+
builder.config.ts
1616

1717
apps/web/assets-git
1818
apps/web/src/data/photos-manifest.json

AGENTS.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,8 @@ This is a pnpm workspace with multiple applications and packages:
9797

9898
**Two-Layer Configuration System**:
9999

100-
1. **Builder Config** (`builder.config.json`) - **Infrastructure/Processing Layer**:
100+
1. **Builder Config** (`builder.config.ts`) - **Infrastructure/Processing Layer**:
101101

102-
```json
103-
{
104-
"storage": { "provider": "s3", "bucket": "...", "region": "..." },
105-
"performance": { "worker": { "workerCount": 8, "useClusterMode": true } },
106-
"repo": { "enable": true, "url": "...", "token": "..." }
107-
}
108-
```
109102
- Controls photo processing, storage connections, and build performance
110103
- Handles remote git repository sync for manifest/thumbnails
111104
- Configures multi-process/cluster processing for large photo sets

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pnpm build
164164
### Notes
165165

166166
- Ensure your S3 bucket already contains photo files
167-
- If using remote repository, configure `builder.config.json` first
167+
- If using remote repository, configure `builder.config.ts` first
168168

169169
## 🔧 Advanced Usage
170170

apps/ssr/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import './.next/types/routes.d.ts'
3+
import './.next/dev/types/routes.d.ts'
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/web/scripts/precheck.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { $ } from 'execa'
55

66
export const precheck = async () => {
77
const __dirname = path.dirname(fileURLToPath(import.meta.url))
8-
const workdir = path.resolve(__dirname, '..')
8+
const workdir = path.resolve(__dirname, '../../..')
99

1010
await $({
1111
cwd: workdir,

apps/web/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
"@config": [
3131
"../../site.config.ts"
3232
],
33-
"@builder": [
34-
"../../builder.config.ts"
35-
],
3633
"@env": [
3734
"../../env.ts"
3835
],
@@ -45,4 +42,4 @@
4542
"./src/**/*",
4643
"./scripts/**/*"
4744
]
48-
}
45+
}

be/apps/dashboard/src/modules/storage-providers/components/ProviderCard.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ export const ProviderCard: FC<ProviderCardProps> = ({
6666
case 'local': {
6767
return cfg.path || 'Not configured'
6868
}
69-
case 'minio': {
70-
return cfg.endpoint || 'Not configured'
71-
}
7269
case 'eagle': {
7370
return cfg.libraryPath || 'Not configured'
7471
}

builder.config.default.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import os from 'node:os'
2+
3+
import { defineBuilderConfig } from '@afilmory/builder'
4+
5+
import { env } from './env.js'
6+
7+
export default defineBuilderConfig(() => ({
8+
repo: {
9+
enable: false,
10+
url: process.env.BUILDER_REPO_URL ?? '',
11+
token: env.GIT_TOKEN,
12+
},
13+
storage: {
14+
provider: 's3',
15+
bucket: env.S3_BUCKET_NAME,
16+
region: env.S3_REGION,
17+
endpoint: env.S3_ENDPOINT,
18+
accessKeyId: env.S3_ACCESS_KEY_ID,
19+
secretAccessKey: env.S3_SECRET_ACCESS_KEY,
20+
prefix: env.S3_PREFIX,
21+
customDomain: env.S3_CUSTOM_DOMAIN,
22+
excludeRegex: env.S3_EXCLUDE_REGEX,
23+
maxFileLimit: 1000,
24+
keepAlive: true,
25+
maxSockets: 64,
26+
connectionTimeoutMs: 5_000,
27+
socketTimeoutMs: 30_000,
28+
requestTimeoutMs: 20_000,
29+
idleTimeoutMs: 10_000,
30+
totalTimeoutMs: 60_000,
31+
retryMode: 'standard',
32+
maxAttempts: 3,
33+
downloadConcurrency: 16,
34+
},
35+
options: {
36+
defaultConcurrency: 10,
37+
enableLivePhotoDetection: true,
38+
showProgress: true,
39+
showDetailedStats: true,
40+
digestSuffixLength: 0,
41+
},
42+
logging: {
43+
verbose: false,
44+
level: 'info',
45+
outputToFile: false,
46+
},
47+
performance: {
48+
worker: {
49+
workerCount: os.cpus().length * 2,
50+
timeout: 30_000,
51+
useClusterMode: true,
52+
workerConcurrency: 2,
53+
},
54+
},
55+
plugins: [],
56+
}))

builder.config.example.json

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

0 commit comments

Comments
 (0)