Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ootb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ jobs:
shell: pwsh
run: npm run build --workspaces --if-present

- name: Seed configs/ from configs-default/
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path configs | Out-Null
Get-ChildItem -Path configs-default -Filter *.json | ForEach-Object {
$dest = Join-Path configs $_.Name
if (-not (Test-Path $dest)) { Copy-Item $_.FullName $dest }
}

- name: Run check-ootb
shell: pwsh
run: node tools/check-ootb.js
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bds-tools/dist/
db-server/dist/
panel/dist/
qq-bridge/dist/
sfmc/dist/
modules/sdk/@sfmc-sdk/dist/
modules/sdk/@sfmc-sdk/node_modules/
shared/**/dist/
Expand Down
2 changes: 1 addition & 1 deletion configs-default/db_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"db_port": 3001,
"http_auth": "",
"dbDir": "./data/sfmc_data.db",
"modulesDir": "../modules"
"modulesDir": "modules"
}
11 changes: 6 additions & 5 deletions tools/check-catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
* - entry.init 仅在 sapi 类型可选
* - 不允许循环依赖(拓扑排序检测)
*/
import { accessSync, constants, readFileSync } from "node:fs";
import { resolve, join, dirname } from "node:path";
import { fileURLToPath } from 'node:url';
import path from "node:path";
// 与其余 tools/*.js 保持一致的 CommonJS 写法:仓库根 package.json 未设置
// "type": "module",若沿用 import 语法,在未启用模块语法自动探测的 Node 版本
// (例如 CI 固定的 22.5.x)上会直接抛出 SyntaxError。
const { accessSync, constants, readFileSync } = require("node:fs");
const { resolve, join } = require("node:path");

const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const ROOT = resolve(__dirname, "..");
const CATALOG = join(ROOT, "modules", "catalog.json");
const SERVICES_CATALOG = join(ROOT, "services", "catalog.json");
/* SAPI modules no longer register through a single static entry.ts —
Expand Down
2 changes: 1 addition & 1 deletion tools/check-ootb.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function fileContains(p, needle) {
{
let dbProc = null;
try {
dbProc = spawn(process.execPath, [path.join(ROOT, "db-server", "index.js")], {
dbProc = spawn(process.execPath, [path.join(ROOT, "db-server", "dist", "index.js")], {
cwd: ROOT,
env: { ...process.env },
stdio: ["ignore", "pipe", "pipe"],
Expand Down
2 changes: 1 addition & 1 deletion tools/sim-new-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let dbProc = null;

function startDb(simDir) {
const env = { ...process.env, SFMC_ROOT: simDir, DB_PORT: String(DB_PORT) };
dbProc = spawn(process.execPath, [path.join(ROOT, "db-server", "index.js")], {
dbProc = spawn(process.execPath, [path.join(ROOT, "db-server", "dist", "index.js")], {
cwd: ROOT,
env,
stdio: ["ignore", "pipe", "pipe"],
Expand Down
4 changes: 2 additions & 2 deletions tools/test-db-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ async function main() {
copy(path.join(ROOT, 'modules', 'module-lock.json'), path.join(workspace, 'modules', 'module-lock.json'));
fs.mkdirSync(path.join(workspace, 'data'), { recursive: true });
fs.mkdirSync(path.join(workspace, 'configs'), { recursive: true });
fs.writeFileSync(path.join(workspace, 'configs', 'db_config.json'), JSON.stringify({ db_port: PORT, dbDir: './data/sfmc_data.db', modulesDir: '../modules' }) + '\n');
fs.writeFileSync(path.join(workspace, 'configs', 'db_config.json'), JSON.stringify({ db_port: PORT, dbDir: './data/sfmc_data.db', modulesDir: 'modules' }) + '\n');
copy(path.join(ROOT, 'configs', 'qq_config.json'), path.join(workspace, 'configs', 'qq_config.json'));
copy(path.join(ROOT, 'configs', 'settings.json'), path.join(workspace, 'configs', 'settings.json'));

const child = spawn(process.execPath, [path.join(ROOT, 'db-server', 'index.js')], {
const child = spawn(process.execPath, [path.join(ROOT, 'db-server', 'dist', 'index.js')], {
cwd: ROOT,
env: { ...process.env, SFMC_ROOT: workspace, SFMC_DB_PATH: dbPath, SFMC_MODULES_DIR: path.join(workspace, 'modules'), DB_PORT: String(PORT) },
stdio: ['ignore', 'pipe', 'pipe'],
Expand Down
Loading