fix(build): verify built public exports during tests
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## Pending
|
||||
|
||||
### Fixes
|
||||
|
||||
- verify built public exports during tests (build)
|
||||
- Run the build before the test suite so generated public export paths are validated.
|
||||
- Add test coverage for built tools, interfaces, and demodata exports.
|
||||
- Exclude generated dist output from TypeScript project resolution.
|
||||
- Update build and test development dependencies.
|
||||
|
||||
## 2026-05-02 - 1.4.0 - feat(exports)
|
||||
re-export shared interfaces package and add compatibility entry points
|
||||
|
||||
|
||||
+5
-5
@@ -12,16 +12,16 @@
|
||||
"author": "Task Venture Capital GmbH",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"test": "pnpm run build && tstest test/ --web --verbose --logfile",
|
||||
"build": "(tsbuild tsfolders --web --allowimplicitany)",
|
||||
"buildDocs": "(tsdoc)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^4.4.0",
|
||||
"@git.zone/tsbundle": "^2.10.1",
|
||||
"@git.zone/tsbuild": "^4.4.2",
|
||||
"@git.zone/tsbundle": "^2.10.4",
|
||||
"@git.zone/tsrun": "^2.0.3",
|
||||
"@git.zone/tstest": "^3.6.3",
|
||||
"@types/node": "^25.6.0"
|
||||
"@git.zone/tstest": "^3.6.6",
|
||||
"@types/node": "^25.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@signature.digital/interfaces": "^1.2.0",
|
||||
|
||||
Generated
+880
-1317
File diff suppressed because it is too large
Load Diff
+16
-7
@@ -1,4 +1,4 @@
|
||||
import { tap } from '@git.zone/tstest/tapbundle';
|
||||
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
||||
import { createEmptyContract } from '../ts/index.js';
|
||||
import { demoContract } from '../ts_demodata/index.js';
|
||||
|
||||
@@ -10,15 +10,24 @@ tap.test('re-exports interfaces from the tools entry point', async () => {
|
||||
'user-123'
|
||||
);
|
||||
|
||||
if (contract.metadata.category !== 'service') {
|
||||
throw new Error('tools should re-export interface factories');
|
||||
}
|
||||
expect(contract.metadata.category).toEqual('service');
|
||||
});
|
||||
|
||||
tap.test('exports demo data against the shared interfaces package', async () => {
|
||||
if (demoContract.lifecycle.currentStatus !== 'draft') {
|
||||
throw new Error('demo contract should start in draft status');
|
||||
}
|
||||
expect(demoContract.lifecycle.currentStatus).toEqual('draft');
|
||||
});
|
||||
|
||||
tap.test('built public export paths resolve after build', async () => {
|
||||
const toolsExportPath = '../dist_ts/index.js';
|
||||
const interfacesExportPath = '../dist_ts/interfaces.js';
|
||||
const demodataExportPath = '../dist_ts_demodata/index.js';
|
||||
const tools = await import(toolsExportPath);
|
||||
const interfaces = await import(interfacesExportPath);
|
||||
const demodata = await import(demodataExportPath);
|
||||
|
||||
expect(typeof tools.createEmptyContract).toEqual('function');
|
||||
expect(typeof interfaces.createEmptyContract).toEqual('function');
|
||||
expect(demodata.demoContract.lifecycle.currentStatus).toEqual('draft');
|
||||
});
|
||||
|
||||
export default tap.start();
|
||||
|
||||
+2
-3
@@ -10,9 +10,8 @@
|
||||
"@signature.digital/tools": ["./ts/index.js"],
|
||||
"@signature.digital/tools/interfaces": ["./ts/interfaces.js"],
|
||||
"@signature.digital/demodata": ["./ts_demodata/index.js"],
|
||||
"@signature.digital/tools/demodata": ["./ts_demodata/index.js"],
|
||||
"@signature.digital/interfaces": ["../interfaces/ts/index.js"]
|
||||
"@signature.digital/tools/demodata": ["./ts_demodata/index.js"]
|
||||
}
|
||||
},
|
||||
"exclude": ["dist_*/**/*.d.ts"]
|
||||
"exclude": ["dist_*/**/*"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user