@smoothbricks/nx-plugin 0.7.15 → 0.7.17
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 +15 -0
- package/dist/.build-inputs.json +10 -7
- package/dist/compile-environment.d.ts +8 -0
- package/dist/compile-environment.d.ts.map +1 -0
- package/dist/compile-environment.js +80 -0
- package/dist/dependency-manifests.d.ts +13 -0
- package/dist/dependency-manifests.d.ts.map +1 -0
- package/dist/dependency-manifests.js +20 -0
- package/dist/executors/bounded-exec/child-exit-diagnostics.d.ts +45 -0
- package/dist/executors/bounded-exec/child-exit-diagnostics.d.ts.map +1 -0
- package/dist/executors/bounded-exec/child-exit-diagnostics.js +188 -0
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +10 -1
- package/dist/executors/bounded-exec/host-memory.d.ts +11 -0
- package/dist/executors/bounded-exec/host-memory.d.ts.map +1 -1
- package/dist/executors/bounded-exec/host-memory.darwin.d.ts.map +1 -1
- package/dist/executors/bounded-exec/host-memory.darwin.js +1 -0
- package/dist/executors/bounded-exec/host-memory.linux.d.ts +3 -1
- package/dist/executors/bounded-exec/host-memory.linux.d.ts.map +1 -1
- package/dist/executors/bounded-exec/host-memory.linux.js +16 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -8
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.js +3 -3
- package/dist/typecheck-route.d.ts +3 -4
- package/dist/typecheck-route.d.ts.map +1 -1
- package/dist/typecheck-route.js +4 -15
- package/managed/raw/patches/{ttsc@0.34.1.patch → ttsc@0.36.3.patch} +728 -71
- package/managed/raw/tooling/direnv/devenv.smoo.nix +1 -1
- package/package.json +9 -4
- package/src/compile-environment.ts +35 -0
- package/src/dependency-manifests.ts +30 -0
- package/src/executors/bounded-exec/child-exit-diagnostics.ts +87 -0
- package/src/executors/bounded-exec/executor.ts +10 -1
- package/src/executors/bounded-exec/host-memory.darwin.ts +1 -0
- package/src/executors/bounded-exec/host-memory.linux.ts +25 -2
- package/src/executors/bounded-exec/host-memory.ts +7 -0
- package/src/index.ts +17 -8
- package/src/managed-files/files.ts +3 -3
- package/src/typecheck-route.ts +5 -14
- package/test-timings.json +138 -137
package/dist/index.js
CHANGED
|
@@ -15,7 +15,9 @@ import { CARGO_CLOSURE_INPUT, CARGO_LOCK_NODE_PREFIX, cargoClosureInputs, cargoL
|
|
|
15
15
|
import { CARGO_PRODUCER_METADATA, postTasksExecution as postCargoRetention } from './cargo-retention-hook.js';
|
|
16
16
|
import { CARGO_TOOLCHAIN_NAMED_INPUT, cargoRuntimeInput, cargoToolchainInputs } from './cargo-toolchain-policy.js';
|
|
17
17
|
import { attributeCargoWorkspacePackages, CARGO_TEST_BUILD_TARGET, CARGO_TEST_EXCEPTIONS_SUFFIX, CARGO_TEST_TARGET, cargoPackageTestInputs, cargoTestGroupTargetName, cargoTestPackageTargetName, createCargoInputsCache, EXTERNAL_RUST_CRATES_INPUT, exceptionalTestFilter, listCargoCrossTestTargets, listCargoWorkspacePackages, NEXTEST_REPO_CONFIG_PATH, nextestToolConfigArg, PLUGIN_NEXTEST_CONFIG_PATH, requireExternalRustCratesInput, serialTestGroups, } from './cargo-workspace.js';
|
|
18
|
+
import { compileEnvironment } from './compile-environment.js';
|
|
18
19
|
import { CARGO_CROSS_LINT_COMMAND, CARGO_CROSS_LINT_TARGET, CARGO_FETCH_COMMAND, CARGO_FETCH_TARGET, CARGO_LINT_CLIPPY_COMMAND, cargoCrossTestArchiveFile, cargoCrossTestArchiveTargetName, cargoCrossTestTargetName, cargoFrozen, runsFrozenCargo, } from './cross-check-policy.js';
|
|
20
|
+
import { directDependencyManifests } from './dependency-manifests.js';
|
|
19
21
|
import { eslintConfigClosure } from './eslint-config-closure.js';
|
|
20
22
|
import { ESLINT_SOURCES_GLOB, eslintSources } from './eslint-sources.js';
|
|
21
23
|
import { ALL_VERDICTS_EXECUTOR, ESLINT_SOURCES_TOKEN, } from './executors/all-verdicts/schema.js';
|
|
@@ -70,11 +72,8 @@ function typecheckCommand(args) {
|
|
|
70
72
|
* which bun.lock and the patches in its check inputs already key, and it waits for the targets the declaring package
|
|
71
73
|
* names to prepare the plugin binaries ttsc loads. Every other project runs the pinned native compiler.
|
|
72
74
|
*/
|
|
73
|
-
function typecheckTargets(
|
|
74
|
-
const route = typecheckRoute(
|
|
75
|
-
...Object.keys(packageJson.dependencies ?? {}),
|
|
76
|
-
...Object.keys(packageJson.devDependencies ?? {}),
|
|
77
|
-
]);
|
|
75
|
+
function typecheckTargets(manifests) {
|
|
76
|
+
const route = typecheckRoute(manifests);
|
|
78
77
|
return route.declaredBy.length === 0
|
|
79
78
|
? { command: typecheckCommand, inputs: [TYPECHECK_COMPILER_INPUT], dependsOn: [] }
|
|
80
79
|
: { command: (args) => `ttsc ${args}`, inputs: [], dependsOn: route.dependsOn };
|
|
@@ -1291,7 +1290,14 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
|
|
|
1291
1290
|
const projectRoot = dirname(packageJsonPath);
|
|
1292
1291
|
const absoluteProjectRoot = join(workspaceRoot, projectRoot);
|
|
1293
1292
|
const packageJson = await readPackageJson(join(workspaceRoot, packageJsonPath));
|
|
1294
|
-
const
|
|
1293
|
+
const dependencyManifests = directDependencyManifests(join(workspaceRoot, packageJsonPath), [
|
|
1294
|
+
...Object.keys(packageJson.dependencies ?? {}),
|
|
1295
|
+
...Object.keys(packageJson.devDependencies ?? {}),
|
|
1296
|
+
]);
|
|
1297
|
+
const typecheck = typecheckTargets(dependencyManifests);
|
|
1298
|
+
// The environment a direct dependency's ttsc plugin lowers by (compile-environment.ts): the emitted JavaScript is a
|
|
1299
|
+
// function of it, so every target whose output is the transformed compile hashes it. A check never is.
|
|
1300
|
+
const compileEnvInputs = compileEnvironment(dependencyManifests).map((name) => ({ env: name }));
|
|
1295
1301
|
const projectName = packageJson.nx?.name ?? packageJson.name;
|
|
1296
1302
|
if (typeof projectName !== 'string' || projectName.length === 0) {
|
|
1297
1303
|
throw new Error(`${packageJsonPath} must declare a non-empty package or nx project name`);
|
|
@@ -1367,7 +1373,7 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
|
|
|
1367
1373
|
targets['tsc-js'] = {
|
|
1368
1374
|
executor: '@smoothbricks/nx-plugin:typescript-emit',
|
|
1369
1375
|
cache: true,
|
|
1370
|
-
inputs: ['production', '^production', ...toolchainInputs, '{projectRoot}/tsconfig.lib.json'],
|
|
1376
|
+
inputs: ['production', '^production', ...toolchainInputs, ...compileEnvInputs, '{projectRoot}/tsconfig.lib.json'],
|
|
1371
1377
|
outputs: inferTypescriptOutputs(libOutDir),
|
|
1372
1378
|
dependsOn: ['^*-js', ...(cargoWasmConfig ? ['cargo-wasm'] : [])],
|
|
1373
1379
|
options: {
|
|
@@ -1393,7 +1399,10 @@ async function createProjectTargets(packageJsonPath, workspaceRoot, hostPlatform
|
|
|
1393
1399
|
cwd: projectRoot,
|
|
1394
1400
|
},
|
|
1395
1401
|
};
|
|
1396
|
-
Object.assign(targets, scriptcPlatformTargets(packageJson, packageJsonPath, projectRoot, libTsconfigPath,
|
|
1402
|
+
Object.assign(targets, scriptcPlatformTargets(packageJson, packageJsonPath, projectRoot, libTsconfigPath, [
|
|
1403
|
+
...toolchainInputs,
|
|
1404
|
+
...compileEnvInputs,
|
|
1405
|
+
]));
|
|
1397
1406
|
}
|
|
1398
1407
|
if (hasTestTsconfig) {
|
|
1399
1408
|
targets['typecheck-tests'] = {
|
|
@@ -44,9 +44,9 @@ export interface ManagedFileContext {
|
|
|
44
44
|
}
|
|
45
45
|
/** Temporary upstream compiler repairs distributed to smoo-managed Bun workspaces. */
|
|
46
46
|
export declare const managedTtscPatch: {
|
|
47
|
-
readonly version: '0.
|
|
48
|
-
readonly key: 'ttsc@0.
|
|
49
|
-
readonly path: 'patches/ttsc@0.
|
|
47
|
+
readonly version: '0.36.3';
|
|
48
|
+
readonly key: 'ttsc@0.36.3';
|
|
49
|
+
readonly path: 'patches/ttsc@0.36.3.patch';
|
|
50
50
|
};
|
|
51
51
|
/** Maintained Nx 24.0.3 repairs, applied as an ordinary Bun patchedDependency over the registry release. */
|
|
52
52
|
export declare const managedNxPatch: {
|
|
@@ -7,9 +7,9 @@ import { renderPrPreviewCleanupWorkflowYaml, renderPrStageSweepWorkflowYaml } fr
|
|
|
7
7
|
import { renderPublishWorkflowYaml } from './publish-workflow.js';
|
|
8
8
|
/** Temporary upstream compiler repairs distributed to smoo-managed Bun workspaces. */
|
|
9
9
|
export const managedTtscPatch = {
|
|
10
|
-
version: '0.
|
|
11
|
-
key: 'ttsc@0.
|
|
12
|
-
path: 'patches/ttsc@0.
|
|
10
|
+
version: '0.36.3',
|
|
11
|
+
key: 'ttsc@0.36.3',
|
|
12
|
+
path: 'patches/ttsc@0.36.3.patch',
|
|
13
13
|
};
|
|
14
14
|
/** Maintained Nx 24.0.3 repairs, applied as an ordinary Bun patchedDependency over the registry release. */
|
|
15
15
|
export const managedNxPatch = {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DependencyManifest } from './dependency-manifests.js';
|
|
1
2
|
/**
|
|
2
3
|
* What a package whose ttsc plugin lowers a dialect declares in its manifest, as `smoo.typecheck`: every project that
|
|
3
4
|
* depends on it directly compiles sources the stock checker refuses (a construct the plugin's ProgramPlugin rewrites
|
|
@@ -19,10 +20,8 @@ export interface TypecheckRoute {
|
|
|
19
20
|
readonly dependsOn: readonly string[];
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
|
-
* The typecheck route of
|
|
23
|
-
* discovers plugins on: `dependencies` and `devDependencies`). Each dependency's manifest is the one Node resolution
|
|
24
|
-
* reaches from the project, as ttsc reads it; a dependency that is not installed declares nothing. A manifest that
|
|
23
|
+
* The typecheck route of a project over its direct dependencies' manifests (dependency-manifests.ts). A manifest that
|
|
25
24
|
* declares `smoo.typecheck` in another shape refuses the inference by its path and the field it got wrong.
|
|
26
25
|
*/
|
|
27
|
-
export declare function typecheckRoute(
|
|
26
|
+
export declare function typecheckRoute(manifests: readonly DependencyManifest[]): TypecheckRoute;
|
|
28
27
|
//# sourceMappingURL=typecheck-route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typecheck-route.d.ts","sourceRoot":"","sources":["../src/typecheck-route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typecheck-route.d.ts","sourceRoot":"","sources":["../src/typecheck-route.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AASD,yHAAyH;AACzH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,GAAG,cAAc,CAkBvF"}
|
package/dist/typecheck-route.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import * as _validateReport_1 from "typia/lib/internal/_validateReport";
|
|
2
2
|
import * as _createStandardSchema_1 from "typia/lib/internal/_createStandardSchema";
|
|
3
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
4
|
-
import { createRequire } from 'node:module';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
3
|
import typia from 'typia';
|
|
7
4
|
const validateManifest = (() => {
|
|
8
5
|
let errors;
|
|
@@ -76,22 +73,14 @@ const validateManifest = (() => {
|
|
|
76
73
|
});
|
|
77
74
|
})();
|
|
78
75
|
/**
|
|
79
|
-
* The typecheck route of
|
|
80
|
-
* discovers plugins on: `dependencies` and `devDependencies`). Each dependency's manifest is the one Node resolution
|
|
81
|
-
* reaches from the project, as ttsc reads it; a dependency that is not installed declares nothing. A manifest that
|
|
76
|
+
* The typecheck route of a project over its direct dependencies' manifests (dependency-manifests.ts). A manifest that
|
|
82
77
|
* declares `smoo.typecheck` in another shape refuses the inference by its path and the field it got wrong.
|
|
83
78
|
*/
|
|
84
|
-
export function typecheckRoute(
|
|
79
|
+
export function typecheckRoute(manifests) {
|
|
85
80
|
const declaredBy = [];
|
|
86
81
|
const dependsOn = [];
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
const manifest = (lookup.resolve.paths(name) ?? [])
|
|
90
|
-
.map((root) => join(root, ...name.split('/'), 'package.json'))
|
|
91
|
-
.find((candidate) => existsSync(candidate));
|
|
92
|
-
if (manifest === undefined)
|
|
93
|
-
continue;
|
|
94
|
-
const checked = validateManifest(JSON.parse(readFileSync(manifest, 'utf-8')));
|
|
82
|
+
for (const { name, path: manifest, json } of manifests) {
|
|
83
|
+
const checked = validateManifest(json);
|
|
95
84
|
if (!checked.success) {
|
|
96
85
|
throw new Error(`${manifest}: smoo.typecheck must be { compiler: 'ttsc', dependsOn: ['<project>:<target>', ...] }: ${checked.errors
|
|
97
86
|
.map((error) => `${error.path} expected ${error.expected}`)
|