@smoothbricks/nx-plugin 0.4.17 → 0.4.18

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.
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "version": 2,
4
4
  "title": "TypeScript emit executor",
5
- "description": "Emit transformer-generated JavaScript with ttsc and declarations with native tsc",
5
+ "description": "Emit transformed JavaScript and declarations together with ttsc",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "executableOutputs": {
package/src/index.test.ts CHANGED
@@ -168,7 +168,7 @@ describe('@smoothbricks/nx-plugin inferred targets', () => {
168
168
  }
169
169
  });
170
170
 
171
- it('splits transformed JavaScript emit from native declarations and typechecking', async () => {
171
+ it('uses the transformer-aware compiler for emit and validation', async () => {
172
172
  const workspace = await createWorkspace();
173
173
  try {
174
174
  await workspace.write(
@@ -202,7 +202,7 @@ describe('@smoothbricks/nx-plugin inferred targets', () => {
202
202
  ]);
203
203
  expect(targets['tsc-js']?.outputs).toEqual(['{projectRoot}/dist/**/*.{js,cjs,mjs,jsx,d.ts,d.cts,d.mts}{,.map}']);
204
204
  expect(targets.typecheck?.options).toMatchObject({
205
- command: 'tsc -p tsconfig.lib.json --noEmit',
205
+ command: 'ttsc -p tsconfig.lib.json --noEmit',
206
206
  cwd: 'packages/example',
207
207
  });
208
208
  const checkToolchainInputs = [
@@ -233,7 +233,7 @@ describe('@smoothbricks/nx-plugin inferred targets', () => {
233
233
  expect(targets['typecheck-tests']?.cache).toBe(true);
234
234
  expect(targets['typecheck-tests']?.dependsOn).toEqual(['tsc-js', 'typecheck']);
235
235
  expect(targets['typecheck-tests']?.options).toMatchObject({
236
- command: 'tsc -p tsconfig.test.json --noEmit',
236
+ command: 'ttsc -p tsconfig.test.json --noEmit',
237
237
  cwd: 'packages/example',
238
238
  });
239
239
  expect(targets['typecheck-tests']?.inputs).toEqual([
@@ -246,7 +246,7 @@ describe('@smoothbricks/nx-plugin inferred targets', () => {
246
246
  expect(targets['typecheck-tests:watch']?.executor).toBe('nx:run-commands');
247
247
  expect(targets['typecheck-tests:watch']?.continuous).toBe(true);
248
248
  expect(targets['typecheck-tests:watch']?.options).toMatchObject({
249
- command: 'tsc -p tsconfig.test.json --noEmit --watch',
249
+ command: 'ttsc -p tsconfig.test.json --noEmit --watch',
250
250
  cwd: 'packages/example',
251
251
  });
252
252
 
package/src/index.ts CHANGED
@@ -1051,10 +1051,7 @@ async function createProjectTargets(
1051
1051
  // Build every JavaScript output lane before resolving package exports, without pulling
1052
1052
  // unrelated Wasm, N-API, native, or web outputs onto the compiler critical path.
1053
1053
  //
1054
- // ttsc transforms the source program before declaration emit, so typia's
1055
- // generated implementation identifiers are not valid declaration inputs.
1056
- // The executor gives ttsc a JS-only overlay and emits declarations from the
1057
- // original project with native tsc.
1054
+ // One transformer-aware compiler emits JavaScript and declarations.
1058
1055
  targets['tsc-js'] = {
1059
1056
  executor: '@smoothbricks/nx-plugin:typescript-emit',
1060
1057
  cache: true,
@@ -1074,7 +1071,7 @@ async function createProjectTargets(
1074
1071
  outputs: [],
1075
1072
  dependsOn: ['^*-js', ...(cargoWasmConfig ? ['cargo-wasm'] : [])],
1076
1073
  options: {
1077
- command: 'tsc -p tsconfig.lib.json --noEmit',
1074
+ command: 'ttsc -p tsconfig.lib.json --noEmit',
1078
1075
  cwd: projectRoot,
1079
1076
  },
1080
1077
  };
@@ -1087,7 +1084,7 @@ async function createProjectTargets(
1087
1084
  inputs: [selfDefault, dependencyProduction, ...checkInputs, '{projectRoot}/tsconfig.test.json'],
1088
1085
  dependsOn: ['typecheck'],
1089
1086
  options: {
1090
- command: 'tsc -p tsconfig.test.json --noEmit',
1087
+ command: 'ttsc -p tsconfig.test.json --noEmit',
1091
1088
  cwd: projectRoot,
1092
1089
  },
1093
1090
  };
@@ -1095,7 +1092,7 @@ async function createProjectTargets(
1095
1092
  executor: 'nx:run-commands',
1096
1093
  continuous: true,
1097
1094
  options: {
1098
- command: 'tsc -p tsconfig.test.json --noEmit --watch',
1095
+ command: 'ttsc -p tsconfig.test.json --noEmit --watch',
1099
1096
  cwd: projectRoot,
1100
1097
  },
1101
1098
  };
@@ -1382,11 +1379,15 @@ async function createProjectTargets(
1382
1379
  }
1383
1380
  }
1384
1381
 
1385
- if ('test' in declaredTargets && targets.test === undefined) {
1382
+ if (('test' in declaredTargets || typeof packageJson.scripts?.test === 'string') && targets.test === undefined) {
1386
1383
  targets.test = {
1387
1384
  dependsOn: ['^build', 'build'],
1388
1385
  };
1389
1386
  }
1387
+ for (const name of Object.keys(declaredTargets)) {
1388
+ if (name === 'test' || !isTestRunnerTargetName(name) || targets[name] !== undefined) continue;
1389
+ targets[name] = { dependsOn: ['^build', 'build'] };
1390
+ }
1390
1391
 
1391
1392
  // Every `cargoFrozen` command needs a registry cache holding the whole locked
1392
1393
  // graph, and offline cargo checks that at RESOLUTION — so a dev-dependency no
@@ -67,7 +67,19 @@ export interface ManagedFileContext {
67
67
  crossTestArchives: CiCrossTestArchive[];
68
68
  }
69
69
 
70
+ /** Temporary upstream compiler repairs distributed to smoo-managed Bun workspaces. */
71
+ export const managedTtscPatch = {
72
+ version: '0.30.4',
73
+ key: 'ttsc@0.30.4',
74
+ path: 'patches/ttsc@0.30.4.patch',
75
+ } as const;
76
+
70
77
  const managedFiles: ManagedFileDescriptor[] = [
78
+ {
79
+ kind: 'raw',
80
+ source: managedTtscPatch.path,
81
+ target: managedTtscPatch.path,
82
+ },
71
83
  {
72
84
  kind: 'raw',
73
85
  source: 'envrc',