@martel/calyx 1.13.3 → 1.13.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.13.4](https://github.com/bmartel/calyx/compare/v1.13.3...v1.13.4) (2026-07-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **cli:** route build:compile through calyx CLI to exclude optional dependencies ([032e04b](https://github.com/bmartel/calyx/commit/032e04bb22bf19a1a73b0870c124bfdcd2cea80a))
7
+
1
8
  ## [1.13.3](https://github.com/bmartel/calyx/compare/v1.13.2...v1.13.3) (2026-07-01)
2
9
 
3
10
 
package/docs/cli.md CHANGED
@@ -118,7 +118,7 @@ The generated `package.json` includes the following scripts:
118
118
  | `bun run start` | `calyx start` | Starts the production server |
119
119
  | `bun run start:dev` | `calyx start --watch` | Runs the server with hot-reloading |
120
120
  | `bun run build` | `calyx build` | Bundles TS assets into `dist/main.js` |
121
- | `bun run build:compile` | `bun build --compile` | Compiles application into a single standalone binary |
121
+ | `bun run build:compile` | `calyx build --compile` | Compiles application into a single standalone binary |
122
122
  | `bun run test` | `bun test` | Runs the Bun-native test runner |
123
123
  | `bun run test:watch` | `bun test --watch` | Runs tests in interactive watch mode |
124
124
  | `bun run test:cov` | `bun test --coverage` | Outputs test coverage details |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@martel/calyx",
3
- "version": "1.13.3",
3
+ "version": "1.13.4",
4
4
  "description": "High-performance Bun-native NestJS-compatible framework",
5
5
  "main": "src/index.ts",
6
6
  "bin": {
package/src/cli/index.ts CHANGED
@@ -84,12 +84,12 @@ function runBuild(cmdArgs: string[]) {
84
84
  process.exit(1);
85
85
  }
86
86
 
87
- console.log('Building Calyx application using bun build...');
88
- const proc = spawnSync('bun', [
87
+ const isCompile = cmdArgs.includes('--compile');
88
+ console.log(`Building Calyx application using bun build${isCompile ? ' --compile' : ''}...`);
89
+
90
+ const buildArgs = [
89
91
  'build',
90
92
  mainPath,
91
- '--outdir',
92
- './dist',
93
93
  '--target',
94
94
  'bun',
95
95
  '--external',
@@ -104,9 +104,23 @@ function runBuild(cmdArgs: string[]) {
104
104
  'class-validator',
105
105
  '--external',
106
106
  'class-transformer'
107
- ], { stdio: 'inherit' });
107
+ ];
108
+
109
+ if (isCompile) {
110
+ buildArgs.push('--compile', '--outfile', './dist/server');
111
+ } else {
112
+ buildArgs.push('--outdir', './dist');
113
+ }
114
+
115
+ const proc = spawnSync('bun', buildArgs, { stdio: 'inherit' });
108
116
  if (proc.status === 0) {
109
- console.log('Build completed successfully. Output at ./dist/main.js');
117
+ if (isCompile) {
118
+ const isWindows = process.platform === 'win32';
119
+ const outPath = isWindows ? './dist/server.exe' : './dist/server';
120
+ console.log(`Build and compilation completed successfully. Output at ${outPath}`);
121
+ } else {
122
+ console.log('Build completed successfully. Output at ./dist/main.js');
123
+ }
110
124
  }
111
125
  process.exit(proc.status ?? 0);
112
126
  }
@@ -157,7 +171,7 @@ function runNew(name: string) {
157
171
  "start": "calyx start",
158
172
  "start:dev": "calyx start --watch",
159
173
  "build": "calyx build",
160
- "build:compile": "bun build src/main.ts --compile --outfile dist/server",
174
+ "build:compile": "calyx build --compile",
161
175
  "test": "bun test",
162
176
  "test:watch": "bun test --watch",
163
177
  "test:cov": "bun test --coverage",
package/tests/cli.test.ts CHANGED
@@ -76,6 +76,7 @@ describe('Calyx CLI Integration Tests', () => {
76
76
  const pkgPath = join(testAppName, 'package.json');
77
77
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
78
78
  pkg.scripts.build = "bun ../../src/cli/index.ts build";
79
+ pkg.scripts["build:compile"] = "bun ../../src/cli/index.ts build --compile";
79
80
  writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
80
81
 
81
82
  // Manually add path mapping to tsconfig.json for TypeScript source resolution during tests
@@ -94,5 +95,16 @@ describe('Calyx CLI Integration Tests', () => {
94
95
  console.log('Build STDERR:', buildProc.stderr);
95
96
  expect(buildProc.status).toBe(0);
96
97
  expect(existsSync(join(testAppName, 'dist/main.js'))).toBe(true);
98
+
99
+ const compileProc = spawnSync('bun', ['run', 'build:compile'], {
100
+ cwd: testAppName,
101
+ encoding: 'utf-8',
102
+ });
103
+ console.log('Compile STDOUT:', compileProc.stdout);
104
+ console.log('Compile STDERR:', compileProc.stderr);
105
+ expect(compileProc.status).toBe(0);
106
+ const isWindows = process.platform === 'win32';
107
+ const compiledPath = join(testAppName, isWindows ? 'dist/server.exe' : 'dist/server');
108
+ expect(existsSync(compiledPath)).toBe(true);
97
109
  });
98
110
  });