@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.
- package/README.md +12 -11
- package/dist/ensure-built.d.ts +7 -4
- package/dist/ensure-built.d.ts.map +1 -1
- package/dist/ensure-built.js +77 -17
- package/dist/executors/typescript-emit/executor.d.ts +1 -1
- package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
- package/dist/executors/typescript-emit/executor.js +3 -8
- package/dist/index.js +10 -8
- package/dist/managed-files/files.d.ts +6 -0
- package/dist/managed-files/files.d.ts.map +1 -1
- package/dist/managed-files/files.js +11 -0
- package/executors.json +1 -1
- package/managed/raw/patches/ttsc@0.30.4.patch +2255 -0
- package/managed/raw/tooling/direnv/devenv.smoo.nix +14 -1
- package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +3 -4
- package/package.json +5 -5
- package/src/ensure-built.test.ts +41 -5
- package/src/ensure-built.ts +127 -43
- package/src/executors/typescript-emit/executor.test.ts +64 -115
- package/src/executors/typescript-emit/executor.ts +4 -9
- package/src/executors/typescript-emit/schema.json +1 -1
- package/src/index.test.ts +4 -4
- package/src/index.ts +9 -8
- package/src/managed-files/files.ts +12 -0
|
@@ -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
|
|
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('
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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
|
-
//
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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',
|