Initial import of LogDarioSeq baseline
Establishes version control for the personal Logseq DB fork before starting the server-client architecture migration and domain features described in docs/agent-guide and the approved implementation plan. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
61
resources/forge.config.test.js
Normal file
61
resources/forge.config.test.js
Normal file
@@ -0,0 +1,61 @@
|
||||
const test = require('node:test')
|
||||
const assert = require('node:assert/strict')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const config = require('./forge.config')
|
||||
|
||||
const repoRoot = path.resolve(__dirname, '..')
|
||||
|
||||
function normalizeResourcePath(resourcePath) {
|
||||
return path.resolve(resourcePath)
|
||||
}
|
||||
|
||||
function collectExtraResources() {
|
||||
return (config.packagerConfig?.extraResource || []).map(normalizeResourcePath)
|
||||
}
|
||||
|
||||
function isCoveredByExtraResources(targetPath, extraResources) {
|
||||
const normalizedTarget = path.resolve(targetPath)
|
||||
return extraResources.some((resource) =>
|
||||
normalizedTarget === resource || normalizedTarget.startsWith(resource + path.sep)
|
||||
)
|
||||
}
|
||||
|
||||
test('packager includes all JavaScript files under dist/', () => {
|
||||
const distDir = path.resolve(repoRoot, 'dist')
|
||||
const distJsFiles = fs
|
||||
.readdirSync(distDir)
|
||||
.filter((name) => name.endsWith('.js'))
|
||||
.map((name) => path.join(distDir, name))
|
||||
|
||||
assert.ok(
|
||||
distJsFiles.length > 0,
|
||||
'Expected dist/ to contain at least one JavaScript file for packaging checks'
|
||||
)
|
||||
|
||||
const extraResources = collectExtraResources()
|
||||
|
||||
for (const jsFile of distJsFiles) {
|
||||
assert.ok(
|
||||
isCoveredByExtraResources(jsFile, extraResources),
|
||||
`Expected extraResource to include or cover ${jsFile}`
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
test('packager includes dist/build directory', () => {
|
||||
const distBuildDir = path.resolve(repoRoot, 'dist/build')
|
||||
|
||||
assert.ok(
|
||||
fs.existsSync(distBuildDir),
|
||||
'Expected dist/build directory to exist for packaging checks'
|
||||
)
|
||||
|
||||
const extraResources = collectExtraResources()
|
||||
|
||||
assert.ok(
|
||||
isCoveredByExtraResources(distBuildDir, extraResources),
|
||||
`Expected extraResource to include or cover ${distBuildDir}`
|
||||
)
|
||||
})
|
||||
Reference in New Issue
Block a user