fix buzzer activated dependencies
Some checks failed
Build and push image for doorman-homeassistant / docker (push) Failing after 12s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Has been skipped
Build and push Doorman UI / API / docker (push) Failing after 1m17s

This commit is contained in:
Martin Dimitrov 2025-06-08 16:32:14 -07:00
parent aa1de04fe7
commit fe8f5ae738
5 changed files with 21 additions and 2 deletions

BIN
bun.lockb

Binary file not shown.

Binary file not shown.

View File

@ -13,13 +13,16 @@
"dependencies": { "dependencies": {
"@twilio-labs/serverless-runtime-types": "^4.0.1", "@twilio-labs/serverless-runtime-types": "^4.0.1",
"@twilio/runtime-handler": "1.3.0", "@twilio/runtime-handler": "1.3.0",
"doorman-api": "workspace:*",
"node-fetch": "^2.7.0", "node-fetch": "^2.7.0",
"prom-client": "^15.1.3", "prom-client": "^15.1.3",
"prometheus-remote-write": "^0.5.1", "prometheus-remote-write": "^0.5.1",
"promise.timeout": "^1.2.0", "promise.timeout": "^1.2.0",
"twilio": "^3.84.1", "twilio": "^3.84.1",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-loki": "^6.1.3" "winston-loki": "^6.1.3",
"zod": "^3.25.56",
"zod_utilz": "^0.8.4"
}, },
"devDependencies": { "devDependencies": {
"@types/bun": "latest", "@types/bun": "latest",

View File

@ -10,12 +10,26 @@ const functionFiles = paths.map(path => readdirSync(path).map(file => path + "/"
// for hot reload to work, we import all the files we want to build // for hot reload to work, we import all the files we want to build
const imports = functionFiles.forEach(file => require('./' + path.relative('src', file))); const imports = functionFiles.forEach(file => require('./' + path.relative('src', file)));
console.log("functions to build:", functionFiles); console.log("functions to build:", functionFiles);
const bundledModules = ['zod_utilz'];
const externalModules = Object.keys(require('../package.json').dependencies)
.filter(dep => !bundledModules.includes(dep));
console.log("Explicitly bundling dependencies", bundledModules);
// console.log("external modules: ", externalModules);
console.log("Building functions..."); console.log("Building functions...");
await Bun.build({ await Bun.build({
entrypoints: functionFiles, entrypoints: functionFiles,
outdir: './build/functions', outdir: './build/functions',
packages: 'external', packages: 'bundle',
target: 'node', target: 'node',
external: externalModules,
root: './src/functions',
format: 'cjs', format: 'cjs',
}); });

View File

@ -15,7 +15,9 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"allowJs": true, "allowJs": true,
"esModuleInterop": true,
"types": [ "types": [
"cypress",
"bun-types" // add Bun global "bun-types" // add Bun global
] ]
} }