initialize Electron desktop app and remove unused files
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { existsSync, readdirSync, readFileSync, statSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const VENDOR_ROOT = 'packages/client/src/vendor/arkscore'
|
||||
|
||||
const listFiles = (dir: string): string[] =>
|
||||
readdirSync(dir).flatMap((name) => {
|
||||
const full = join(dir, name)
|
||||
return statSync(full).isDirectory() ? listFiles(full) : [full]
|
||||
})
|
||||
|
||||
describe('ArkScope vendored components', () => {
|
||||
const vendorFiles = listFiles(VENDOR_ROOT)
|
||||
|
||||
it('contains no art assets (images, audio, video)', () => {
|
||||
const assetPattern = /\.(png|jpe?g|webp|mp3|mp4)$/i
|
||||
expect(vendorFiles.filter((file) => assetPattern.test(file))).toEqual([])
|
||||
})
|
||||
|
||||
it('contains no references to upstream asset directories', () => {
|
||||
for (const file of vendorFiles) {
|
||||
const content = readFileSync(file, 'utf8')
|
||||
expect(content, `${file} must not reference upstream assets`).not.toMatch(
|
||||
/src\/assets|public\/assets/,
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps PROVENANCE.md with the pinned upstream commit hash', () => {
|
||||
const provenancePath = join(VENDOR_ROOT, 'PROVENANCE.md')
|
||||
expect(existsSync(provenancePath)).toBe(true)
|
||||
|
||||
const provenance = readFileSync(provenancePath, 'utf8')
|
||||
expect(provenance).toContain('78f3763b0a48608eae00c27ac837449a32bd93df')
|
||||
expect(provenance).toContain('https://github.com/triplepiers/ArkScope')
|
||||
})
|
||||
|
||||
it('vendors no more than 3 components (guards against bulk re-import)', () => {
|
||||
const componentCount = vendorFiles.filter((file) => file.endsWith('index.vue')).length
|
||||
expect(componentCount).toBeLessThanOrEqual(3)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user