Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@miakapp/cli",
"version": "4.0.0-alpha.3",
"version": "4.0.0-alpha.4",
"description": "Agent-first Miakapp command line: check, build, publish, activate and roll back home components",
"type": "module",
"engines": {
Expand All @@ -20,6 +20,7 @@
"sideEffects": false,
"scripts": {
"build": "tsc -p tsconfig.build.json",
"prepack": "bun run build",
"test": "bun test test/",
"typecheck": "tsc --noEmit",
"check": "bun run typecheck && bun run build && bun run test"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
*/
export const PACKAGE_NAME = '@miakapp/cli';

export const CLI_VERSION = '4.0.0-alpha.3';
export const CLI_VERSION = '4.0.0-alpha.4';
40 changes: 40 additions & 0 deletions packages/cli/test/package.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { describe, expect, test } from 'bun:test';
import { resolve } from 'node:path';

const PACKAGE_DIRECTORY = resolve(import.meta.dir, '..');
const manifest = (await Bun.file(new URL('../package.json', import.meta.url)).json()) as {
scripts?: Record<string, string>;
};

interface PackResult {
files: Array<{ path: string }>;
}

describe('the published package', () => {
test('builds the executable payload during prepack', () => {
expect(manifest.scripts?.['prepack']).toBe('bun run build');

const build = Bun.spawnSync(['bun', 'run', 'build'], {
cwd: PACKAGE_DIRECTORY,
stdout: 'pipe',
stderr: 'pipe',
});
expect(build.exitCode).toBe(0);

const packed = Bun.spawnSync(
['npm', 'pack', '--dry-run', '--ignore-scripts', '--json'],
{
cwd: PACKAGE_DIRECTORY,
stdout: 'pipe',
stderr: 'pipe',
},
);
expect(packed.exitCode).toBe(0);

const results = JSON.parse(packed.stdout.toString()) as PackResult[];
const files = results[0]?.files.map(({ path }) => path).sort() ?? [];
expect(files).toContain('assets/agent-guide.md');
expect(files).toContain('bin/miakapp.js');
expect(files).toContain('dist/main.js');
});
});
Loading