fix: pb_hooks module not building when @pockethost/common was included

This commit is contained in:
Ben Allfree
2023-10-18 23:05:57 -07:00
parent 9c5c87a62d
commit 65f58d5a8a
3 changed files with 11 additions and 7 deletions

View File

@@ -65,7 +65,7 @@ __export(lib_exports, {
return _getRecord
},
_unsafe_assert: function () {
return import_common.assert
return assert
},
endOfMonth: function () {
return endOfMonth
@@ -96,8 +96,12 @@ __export(lib_exports, {
},
})
module.exports = __toCommonJS(lib_exports)
// src/util/assert.ts
var import_common = require('@pockethost/common')
// ../common/src/assert.ts
function assert(v, msg) {
if (!v) {
throw new Error(msg || 'Assertion failure')
}
}
// ../../node_modules/@s-libs/micro-dash/fesm2022/micro-dash.mjs
function keysOfNonArray(object) {
return object ? Object.getOwnPropertyNames(object) : []
@@ -135,7 +139,7 @@ function startOfMonth(now) {
}
var dao = function () {
var _dao = $app.dao()
;(0, import_common.assert)(_dao)
assert(_dao)
return _dao
}
var queryOne = function (sql, bindings, defaultResult) {
@@ -172,7 +176,7 @@ function _getRecordByIdOrRecord(recordOrInstanceId, name) {
return _getRecord(name, recordOrInstanceId)
return recordOrInstanceId
})()
;(0, import_common.assert)(record)
assert(record)
return record
}
function updateInstance(recordOrInstanceId, fields) {

View File

@@ -1,2 +1,2 @@
import { assert } from '@pockethost/common'
import { assert } from '@pockethost/common/src/assert'
export { assert }

View File

@@ -1,5 +1,5 @@
import { defineConfig } from 'tsup'
export default defineConfig({
noExternal: ['@s-libs/micro-dash'],
noExternal: ['@s-libs/micro-dash', '@pockethost/common'],
})