import { readFileSync } from 'node:fs'
import path from 'node:path'
import { describe, expect, it } from 'vitest'

const packageJsonPath = path.resolve(__dirname, '../../package.json')
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as {
  publishConfig?: {
    name?: string
    exports?: Record<string, unknown>
  }
}

describe('core publish surface', () => {
  it('publishes the curated @elevasis/core organization-model wrapper', () => {
    expect(packageJson.publishConfig?.name).toBe('@elevasis/core')
    expect(Object.keys(packageJson.publishConfig?.exports ?? {})).toEqual([
      '.',
      './auth',
      './test-utils',
      './organization-model',
      './entities',
      './knowledge'
    ])
  })
})
