@smoothbricks/nx-plugin 0.7.12 → 0.7.14

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.
Files changed (89) hide show
  1. package/README.md +91 -27
  2. package/dist/.build-inputs.json +20 -12
  3. package/dist/built-output-packages.d.ts +27 -0
  4. package/dist/built-output-packages.d.ts.map +1 -0
  5. package/dist/built-output-packages.js +97 -0
  6. package/dist/cross-check-policy.d.ts +13 -1
  7. package/dist/cross-check-policy.d.ts.map +1 -1
  8. package/dist/cross-check-policy.js +13 -1
  9. package/dist/executors/bounded-exec/admission-queue.d.ts +68 -0
  10. package/dist/executors/bounded-exec/admission-queue.d.ts.map +1 -0
  11. package/dist/executors/bounded-exec/admission-queue.js +131 -0
  12. package/dist/executors/bounded-exec/cpu-grant.d.ts +14 -0
  13. package/dist/executors/bounded-exec/cpu-grant.d.ts.map +1 -0
  14. package/dist/executors/bounded-exec/cpu-grant.js +18 -0
  15. package/dist/executors/bounded-exec/cpu-pool.d.ts +1 -14
  16. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  17. package/dist/executors/bounded-exec/cpu-pool.js +2 -49
  18. package/dist/executors/bounded-exec/executor.d.ts +5 -12
  19. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  20. package/dist/executors/bounded-exec/executor.js +51 -154
  21. package/dist/executors/bounded-exec/memory-retry.d.ts +39 -0
  22. package/dist/executors/bounded-exec/memory-retry.d.ts.map +1 -0
  23. package/dist/executors/bounded-exec/memory-retry.js +33 -0
  24. package/dist/executors/bounded-exec/parent-grant.d.ts +43 -0
  25. package/dist/executors/bounded-exec/parent-grant.d.ts.map +1 -0
  26. package/dist/executors/bounded-exec/parent-grant.js +37 -0
  27. package/dist/executors/bounded-exec/peak-charge.d.ts +17 -0
  28. package/dist/executors/bounded-exec/peak-charge.d.ts.map +1 -0
  29. package/dist/executors/bounded-exec/peak-charge.js +20 -0
  30. package/dist/executors/bounded-exec/pool-environment.d.ts +25 -0
  31. package/dist/executors/bounded-exec/pool-environment.d.ts.map +1 -0
  32. package/dist/executors/bounded-exec/pool-environment.js +34 -0
  33. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  34. package/dist/executors/bounded-exec/run-cpu-pool.js +1 -1
  35. package/dist/executors/bounded-exec/verdict.d.ts +3 -18
  36. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  37. package/dist/executors/bounded-exec/verdict.js +4 -25
  38. package/dist/index.d.ts +4 -1
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +97 -31
  41. package/dist/managed-files/ci-workflow.d.ts +29 -5
  42. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  43. package/dist/managed-files/ci-workflow.js +111 -16
  44. package/dist/managed-files/context.d.ts.map +1 -1
  45. package/dist/managed-files/context.js +1 -0
  46. package/dist/managed-files/files.d.ts +3 -1
  47. package/dist/managed-files/files.d.ts.map +1 -1
  48. package/dist/managed-files/files.js +2 -0
  49. package/dist/managed-files/publish-workflow.d.ts +6 -1
  50. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  51. package/dist/managed-files/publish-workflow.js +16 -11
  52. package/dist/owned-installation.d.ts.map +1 -1
  53. package/dist/owned-installation.js +48 -14
  54. package/dist/typecheck-route.d.ts +28 -0
  55. package/dist/typecheck-route.d.ts.map +1 -0
  56. package/dist/typecheck-route.js +109 -0
  57. package/dist/workspace-manifest.d.ts +50 -5
  58. package/dist/workspace-manifest.d.ts.map +1 -1
  59. package/executors.json +10 -0
  60. package/managed/raw/patches/ttsc@0.34.1.patch +93 -8
  61. package/managed/raw/tooling/direnv/apple-developer.sh +8 -1
  62. package/managed/raw/tooling/direnv/compiler-variables.sh +1 -1
  63. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +4 -2
  64. package/managed/raw/tooling/direnv/secret-references.ts +19 -5
  65. package/managed/raw/tooling/git-hooks/pre-push.sh +20 -10
  66. package/managed/templates/github/actions/forgejo-artifact.cjs +9 -9
  67. package/managed/templates/github/actions/setup-devenv/action.yml +53 -0
  68. package/package.json +2 -2
  69. package/src/built-output-packages.ts +125 -0
  70. package/src/cross-check-policy.ts +14 -1
  71. package/src/executors/bounded-exec/admission-queue.ts +163 -0
  72. package/src/executors/bounded-exec/cpu-grant.ts +32 -0
  73. package/src/executors/bounded-exec/cpu-pool.ts +2 -33
  74. package/src/executors/bounded-exec/executor.ts +60 -201
  75. package/src/executors/bounded-exec/memory-retry.ts +63 -0
  76. package/src/executors/bounded-exec/parent-grant.ts +75 -0
  77. package/src/executors/bounded-exec/peak-charge.ts +25 -0
  78. package/src/executors/bounded-exec/pool-environment.ts +45 -0
  79. package/src/executors/bounded-exec/run-cpu-pool.ts +2 -1
  80. package/src/executors/bounded-exec/verdict.ts +7 -35
  81. package/src/index.ts +105 -31
  82. package/src/managed-files/ci-workflow.ts +143 -16
  83. package/src/managed-files/context.ts +1 -0
  84. package/src/managed-files/files.ts +5 -0
  85. package/src/managed-files/publish-workflow.ts +26 -10
  86. package/src/owned-installation.ts +63 -14
  87. package/src/typecheck-route.ts +64 -0
  88. package/src/workspace-manifest.ts +56 -5
  89. package/test-timings.json +141 -139
@@ -153,7 +153,10 @@ jobs:
153
153
  name: Validate
154
154
  ${renderRunsOnLine(options.runsOn)}
155
155
  timeout-minutes: 45
156
- ${options.privateNpm?.readTokenEnv || options.cargoCredentials !== undefined || options.remoteCache !== undefined
156
+ ${options.privateNpm?.readTokenEnv ||
157
+ options.cargoCredentials !== undefined ||
158
+ options.remoteCache !== undefined ||
159
+ options.mbxRemote !== undefined
157
160
  ? ` # Fork PRs receive no secrets, so neither a private dependency install nor an
158
161
  # authenticated remote cache read can run there.
159
162
  if: \${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
@@ -164,7 +167,7 @@ ${options.privateNpm?.readTokenEnv || options.cargoCredentials !== undefined ||
164
167
  `
165
168
  : ''} env:
166
169
  GH_TOKEN: ${githubExpression('github.token')}
167
- ${remoteCacheJobEnvLines(options.remoteCache)}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
170
+ ${remoteCacheJobEnvLines(options.remoteCache, 'internal')}${mbxRemoteJobEnvLines(options.mbxRemote, 'internal')}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
168
171
  `;
169
172
  }
170
173
  function githubExpression(expression) {
@@ -486,28 +489,46 @@ export function normalizeSourceCheckout(config) {
486
489
  * fail every task on 401, which is why the job carries the same fork-PR gate
487
490
  * as a private dependency install (see `renderCiWorkflowHeader`).
488
491
  *
489
- * A declared `internalServer` is the address managed runners use, exactly as a
490
- * git origin's `internalMirror` is: both say this repository's runners sit
491
- * inside that network, and shells outside it keep the public origin.
492
+ * A declared `internalServer` is the address the repository's own runners use, exactly as a git origin's
493
+ * `internalMirror` is: both say those runners sit inside that network. A job on any other runner — a GitHub-hosted
494
+ * one, a macOS label — sits outside it and reaches the public `server`, as a developer shell does. Each job names
495
+ * its reach, so no job is pointed at an address its runner cannot route to.
492
496
  * Mechanism errors surface at managed-file render time, never inside CI.
493
497
  */
494
- export function remoteCacheJobEnvLines(config) {
498
+ export function remoteCacheJobEnvLines(config, reach) {
495
499
  if (config === undefined) {
496
500
  return '';
497
501
  }
498
502
  const normalized = normalizeRemoteCache(config);
503
+ const server = reach === 'internal' ? (normalized.internalServer ?? publicCacheOrigin(normalized)) : publicCacheOrigin(normalized);
499
504
  return [
500
- ` NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${normalized.internalServer ?? normalized.server}\n`,
505
+ ` NX_SELF_HOSTED_REMOTE_CACHE_SERVER: ${server}\n`,
501
506
  ` NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN: ${githubExpression(`secrets.${normalized.tokenSecret}`)}\n`,
502
507
  ].join('');
503
508
  }
509
+ /**
510
+ * The public origin as a job env value: the declared origin, or the expression that reads the repository variable
511
+ * naming it.
512
+ */
513
+ function publicCacheOrigin(config) {
514
+ return 'serverVariable' in config ? githubExpression(`vars.${config.serverVariable}`) : config.server;
515
+ }
504
516
  /** Mechanism errors surface at managed-file render time, never inside CI. */
505
517
  export function normalizeRemoteCache(config) {
506
- assertCacheOrigin('server', config.server);
518
+ const literal = 'server' in config ? config.server : undefined;
519
+ if ('server' in config && 'serverVariable' in config) {
520
+ throw new Error('smoo.remoteCache names its public origin twice; declare server or serverVariable, not both');
521
+ }
522
+ if (literal !== undefined) {
523
+ assertCacheOrigin('smoo.remoteCache', 'server', literal);
524
+ }
525
+ else if (!('serverVariable' in config) || !/^[A-Z_][A-Z0-9_]*$/.test(config.serverVariable)) {
526
+ throw new Error(`smoo.remoteCache needs server, or an upper-case repository variable name for serverVariable, got ${JSON.stringify(config)}`);
527
+ }
507
528
  if (config.internalServer !== undefined) {
508
- assertCacheOrigin('internalServer', config.internalServer);
509
- if (config.internalServer === config.server) {
510
- throw new Error(`smoo.remoteCache internalServer repeats server ${config.server}; drop internalServer or point it at the address internal runners reach`);
529
+ assertCacheOrigin('smoo.remoteCache', 'internalServer', config.internalServer);
530
+ if (config.internalServer === literal) {
531
+ throw new Error(`smoo.remoteCache internalServer repeats server ${literal}; drop internalServer or point it at the address internal runners reach`);
511
532
  }
512
533
  }
513
534
  if (!/^[A-Z_][A-Z0-9_]*$/.test(config.tokenSecret)) {
@@ -521,7 +542,7 @@ export function normalizeRemoteCache(config) {
521
542
  * slash the server routes nowhere, and a path or credential would be dropped
522
543
  * or leaked rather than honored.
523
544
  */
524
- function assertCacheOrigin(field, value) {
545
+ function assertCacheOrigin(declaration, field, value) {
525
546
  let url = null;
526
547
  try {
527
548
  url = new URL(value);
@@ -537,7 +558,81 @@ function assertCacheOrigin(field, value) {
537
558
  url.password !== '' ||
538
559
  url.search !== '' ||
539
560
  url.hash !== '') {
540
- throw new Error(`smoo.remoteCache ${field} needs a credential-free http(s) origin with no path and no trailing slash, got ${JSON.stringify(value)}`);
561
+ throw new Error(`${declaration} ${field} needs a credential-free http(s) origin with no path and no trailing slash, got ${JSON.stringify(value)}`);
562
+ }
563
+ }
564
+ /**
565
+ * The default branch's own runs: a push to it, or a workflow dispatched on it (a release). These are the only lanes
566
+ * given the mbx write token. A pull request's ref is never the default branch, and `pull_request_target` is left out
567
+ * because its ref is the base branch while the code it runs is not.
568
+ */
569
+ const DEFAULT_BRANCH_LANE = "(github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)";
570
+ /**
571
+ * Job env lines carrying the declared mbx remote cache (`smoo.mbxRemote`). setup-devenv routes Cargo through mbx's
572
+ * Cargo shim when `MBX_REMOTE_URL` is set, so these lines are what turn mbx on for the job; `reach` picks the origin
573
+ * exactly as for the Nx cache. The token is chosen by lane: the write token and `MBX_REMOTE_TRUST_WRITES` on the
574
+ * default branch's own runs, the read-only token everywhere else. mbx's own write policy cannot make that call here:
575
+ * it requires `GITHUB_REF_PROTECTED`, which Forgejo Actions never sets, and it reads a release's `workflow_dispatch`
576
+ * as untrusted. The server's grant on the token is what stops any other job publishing.
577
+ * Mechanism errors surface at managed-file render time, never inside CI.
578
+ */
579
+ export function mbxRemoteJobEnvLines(config, reach) {
580
+ if (config === undefined) {
581
+ return '';
582
+ }
583
+ const normalized = normalizeMbxRemote(config);
584
+ const server = reach === 'internal' ? (normalized.internalServer ?? publicCacheOrigin(normalized)) : publicCacheOrigin(normalized);
585
+ const token = `${DEFAULT_BRANCH_LANE} && secrets.${normalized.writeTokenSecret} || secrets.${normalized.readTokenSecret}`;
586
+ return [
587
+ ` MBX_REMOTE_URL: ${server}\n`,
588
+ ` MBX_REMOTE_NAMESPACE: ${normalized.namespace}\n`,
589
+ // One expression per line: a folded scalar would split the lane condition, and Prettier refolds it otherwise.
590
+ ' # prettier-ignore\n',
591
+ ` MBX_REMOTE_TOKEN: ${githubExpression(token)}\n`,
592
+ ' # prettier-ignore\n',
593
+ ` MBX_REMOTE_TRUST_WRITES: ${githubExpression(DEFAULT_BRANCH_LANE)}\n`,
594
+ ].join('');
595
+ }
596
+ /** Mechanism errors surface at managed-file render time, never inside CI. */
597
+ export function normalizeMbxRemote(config) {
598
+ if ('server' in config && 'serverVariable' in config) {
599
+ throw new Error('smoo.mbxRemote names its public origin twice; declare server or serverVariable, not both');
600
+ }
601
+ if ('server' in config) {
602
+ assertMbxOrigin('server', config.server);
603
+ }
604
+ else if (!/^[A-Z_][A-Z0-9_]*$/.test(config.serverVariable)) {
605
+ throw new Error(`smoo.mbxRemote needs server, or an upper-case repository variable name for serverVariable, got ${JSON.stringify(config)}`);
606
+ }
607
+ if (config.internalServer !== undefined) {
608
+ assertMbxOrigin('internalServer', config.internalServer);
609
+ }
610
+ if (!/^[A-Za-z0-9][A-Za-z0-9._-]*(\/[A-Za-z0-9][A-Za-z0-9._-]*)*$/.test(config.namespace)) {
611
+ throw new Error(`smoo.mbxRemote namespace must be slash-separated segments of letters, digits, '.', '_' and '-', got ${JSON.stringify(config.namespace)}`);
612
+ }
613
+ for (const [field, name] of [
614
+ ['writeTokenSecret', config.writeTokenSecret],
615
+ ['readTokenSecret', config.readTokenSecret],
616
+ ]) {
617
+ if (!/^[A-Z_][A-Z0-9_]*$/.test(name)) {
618
+ throw new Error(`smoo.mbxRemote needs an upper-case secret name for ${field}, got ${JSON.stringify(name)}`);
619
+ }
620
+ }
621
+ if (config.writeTokenSecret === config.readTokenSecret) {
622
+ throw new Error(`smoo.mbxRemote writeTokenSecret and readTokenSecret both name ${config.writeTokenSecret}; untrusted jobs would hold the write token`);
623
+ }
624
+ return config;
625
+ }
626
+ /**
627
+ * An mbx origin is a cache origin mbx will send its token to: HTTPS, or plain HTTP to a loopback address only, which
628
+ * is mbx's own rule (it refuses the remote otherwise), checked here so a bad declaration fails at render time.
629
+ */
630
+ function assertMbxOrigin(field, value) {
631
+ assertCacheOrigin('smoo.mbxRemote', field, value);
632
+ const url = new URL(value);
633
+ const loopback = url.hostname === 'localhost' || url.hostname === '[::1]' || /^127\.\d+\.\d+\.\d+$/.test(url.hostname);
634
+ if (url.protocol === 'http:' && !loopback) {
635
+ throw new Error(`smoo.mbxRemote ${field} ${JSON.stringify(value)} is plain HTTP to a non-loopback host; mbx sends its token only over HTTPS or to loopback`);
541
636
  }
542
637
  }
543
638
  /**
@@ -993,7 +1088,7 @@ ${options.macosRunsOn === undefined ? ' runs-on: macos-latest' : renderRunsOn
993
1088
  if: \${{ needs.main.result == 'success' }}
994
1089
  env:
995
1090
  GH_TOKEN: \${{ github.token }}
996
- ${remoteCacheJobEnvLines(options.remoteCache)}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
1091
+ ${remoteCacheJobEnvLines(options.remoteCache, 'public')}${mbxRemoteJobEnvLines(options.mbxRemote, 'public')}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
997
1092
  ${renderCiWorkflowSteps(followUpSetupSteps(options, numbers), options)}
998
1093
  ${renderCiWorkflowSteps(middleSteps, options)}
999
1094
  ${renderCiWorkflowSteps(followUpCleanupStep(numbers), options)}`;
@@ -1079,7 +1174,7 @@ ${renderRunsOnLine(options.runsOn)}
1079
1174
  ${environmentLine(options.environments?.staging)} if: \${{ needs.main.result == 'success' && needs.main.outputs.deployment-stage != '' }}
1080
1175
  env:
1081
1176
  GH_TOKEN: \${{ github.token }}
1082
- ${remoteCacheJobEnvLines(options.remoteCache)}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
1177
+ ${remoteCacheJobEnvLines(options.remoteCache, 'internal')}${mbxRemoteJobEnvLines(options.mbxRemote, 'internal')}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
1083
1178
  ${renderCiWorkflowSteps(followUpSetupSteps(options, numbers), options)}
1084
1179
  # Step ${numbers.middle}
1085
1180
  - name: E2E Tests (Deployed Stage)
@@ -1111,7 +1206,7 @@ ${renderRunsOnLine(options.runsOn)}
1111
1206
  if: \${{ !cancelled() && github.event_name == 'push' && github.ref == ${stagingRefLiteral(options)} && needs.main.result == 'success'${e2eGate} }}
1112
1207
  ${environmentLine(options.environments?.production)} env:
1113
1208
  GH_TOKEN: \${{ github.token }}
1114
- ${remoteCacheJobEnvLines(options.remoteCache)}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
1209
+ ${remoteCacheJobEnvLines(options.remoteCache, 'internal')}${mbxRemoteJobEnvLines(options.mbxRemote, 'internal')}${cargoCredentialJobEnvLines(options.cargoCredentials)}${privateNpmReadTokenJobEnv(options)} steps:
1115
1210
  ${renderCiWorkflowSteps(followUpSetupSteps(options, numbers), options)}
1116
1211
  # Step ${numbers.middle}
1117
1212
  - name: 🚀 Deploy Production
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/managed-files/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAmD,MAAM,qBAAqB,CAAC;AAE5G,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAExH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGrD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC9D,UAAU,gBAAgB;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,MAAM,GACZ,kBAAkB,CA+DpB;AAED,wBAAgB,qBAAqB,CAAC,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Y,CAAC;CACzB;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,UAAU,EAAE,iBAAiB,EAC7B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,MAAM,GACZ,kBAAkB,CAgEpB;AAED,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,kBAAkB,EAAE,CAiB1F;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,mBAAmB,EAAE,SAAS,MAAM,EAAE,EACtC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACtC,MAAM,EAAE,CAIV;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAMlF;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAezF;AAED,yFAAyF;AACzF,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAYlH;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAEzF"}
@@ -56,6 +56,7 @@ export function deriveManagedFileContext(manifest, packages, nxProjects, hasBunL
56
56
  sourceCheckouts,
57
57
  cargoCredentials,
58
58
  remoteCache: manifest?.smoo?.remoteCache,
59
+ mbxRemote: manifest?.smoo?.mbxRemote,
59
60
  macosPlatformArchitectures: MACOS_PLATFORM_TARGET_GLOBS.some((glob) => releasePlatformTargetGlobs.includes(glob))
60
61
  ? macosPlatformArchitecturesForTest(targetNames)
61
62
  : [],
@@ -1,4 +1,4 @@
1
- import type { NonEmptyArray, PackageCargoCredentialsConfig, PackagePrivateNpmConfig, PackageRemoteCacheConfig, PackageSmooGithub, PackageSmooGithubEnvironments, PackageSourceCheckoutConfig } from '../workspace-manifest.js';
1
+ import type { NonEmptyArray, PackageCargoCredentialsConfig, PackageMbxRemoteConfig, PackagePrivateNpmConfig, PackageRemoteCacheConfig, PackageSmooGithub, PackageSmooGithubEnvironments, PackageSourceCheckoutConfig } from '../workspace-manifest.js';
2
2
  import { type CiCrossTestArchive } from './ci-workflow.js';
3
3
  import type { ManagedFile } from './tree.js';
4
4
  export interface ManagedFileContext {
@@ -33,6 +33,8 @@ export interface ManagedFileContext {
33
33
  cargoCredentials?: PackageCargoCredentialsConfig;
34
34
  /** Declared self-hosted Nx remote cache from the root smoo config; absent means local caching only. */
35
35
  remoteCache?: PackageRemoteCacheConfig;
36
+ /** Declared mbx remote cache from the root smoo config; absent means Cargo builds without mbx. */
37
+ mbxRemote?: PackageMbxRemoteConfig;
36
38
  /**
37
39
  * Cross-built test archives the graph can produce, one per foreign target
38
40
  * triple the cargo workspace declares. Empty for a repository that declares
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/managed-files/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAmD,MAAM,kBAAkB,CAAC;AAI5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAa7C,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,0BAA0B,EAAE,OAAO,CAAC;IACpC,qBA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AAkB,GAAG,MAAM,EAAE,CAElF;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CAM7E;AAED,+GAA+G;AAC/G,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,GAAG,kBAAkB,GAAG,6BAA6B,GAAG,yBAAyB,EACtG,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAMR"}
@@ -307,6 +307,7 @@ function getManagedContent(file, context) {
307
307
  sourceCheckouts: context.sourceCheckouts,
308
308
  cargoCredentials: context.cargoCredentials,
309
309
  remoteCache: context.remoteCache,
310
+ mbxRemote: context.mbxRemote,
310
311
  environments: context.ciEnvironments,
311
312
  deploySecrets: context.ciDeploySecrets,
312
313
  e2eSecrets: context.ciE2eSecrets,
@@ -334,6 +335,7 @@ function getManagedContent(file, context) {
334
335
  sourceCheckouts: context.sourceCheckouts,
335
336
  cargoCredentials: context.cargoCredentials,
336
337
  remoteCache: context.remoteCache,
338
+ mbxRemote: context.mbxRemote,
337
339
  deploySecrets: context.ciDeploySecrets,
338
340
  });
339
341
  }
@@ -1,4 +1,4 @@
1
- import type { PackageCargoCredentialsConfig, PackagePrivateNpmConfig, PackageRemoteCacheConfig, PackageSmooGithub, PackageSourceCheckoutConfig } from '../workspace-manifest.js';
1
+ import type { PackageCargoCredentialsConfig, PackageMbxRemoteConfig, PackagePrivateNpmConfig, PackageRemoteCacheConfig, PackageSmooGithub, PackageSourceCheckoutConfig } from '../workspace-manifest.js';
2
2
  import { type DeployStepSecretConfig } from './ci-workflow.js';
3
3
  import { type WorkflowRunsOn } from './github-runs-on.js';
4
4
  export type PublishWorkflowBump = 'auto' | 'patch' | 'minor' | 'major' | 'prerelease';
@@ -80,6 +80,11 @@ export interface PublishWorkflowDefinitionOptions extends DeployStepSecretConfig
80
80
  * built for the same hashes.
81
81
  */
82
82
  remoteCache?: PackageRemoteCacheConfig;
83
+ /**
84
+ * Declared mbx remote cache. Every job here may build Cargo, so each carries mbx's remote settings; a release
85
+ * dispatched on the default branch publishes what it compiles.
86
+ */
87
+ mbxRemote?: PackageMbxRemoteConfig;
83
88
  }
84
89
  export interface PublishWorkflowInputs {
85
90
  bump: PublishWorkflowBump;
@@ -1 +1 @@
1
- {"version":3,"file":"publish-workflow.d.ts","sourceRoot":"","sources":["../../src/managed-files/publish-workflow.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAOL,KAAK,sBAAsB,EAM5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAgD,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AASxG,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,YAAY,CAAC;AACtF,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,GACnB,8BAA8B,GAC9B,SAAS,GACT,QAAQ,CAAC;AACb,MAAM,MAAM,uBAAuB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAChE,MAAM,MAAM,0BAA0B,GAAG,MAAM,GAAG,YAAY,CAAC;AAE/D,oBAAY,uBAAuB;IACjC,QAAQ,aAAa;IACrB,eAAe,qBAAqB;IACpC,gBAAgB,sBAAsB;IACtC,WAAW,iBAAiB;IAC5B,sBAAsB,6BAA6B;IACnD,qBAAqB,6BAA6B;IAClD,qBAAqB,4BAA4B;IACjD,WAAW,iBAAiB;IAC5B,cAAc,oBAAoB;IAClC,yBAAyB,iCAAiC;IAC1D,KAAK,UAAU;IACf,IAAI,SAAS;IACb,SAAS,eAAe;IACxB,cAAc,qBAAqB;IACnC,sBAAsB,6BAA6B;IACnD,UAAU,gBAAgB;IAC1B,cAAc,oBAAoB;IAClC,gBAAgB,sBAAsB;IACtC,aAAa,o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,EACnC,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAwFnC;AA2BD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,gCAAqC,GAAG,MAAM,CA2BhG"}
@@ -2,7 +2,7 @@
2
2
  import { isMap, isScalar, parseDocument } from 'yaml';
3
3
  import { LINUX_PLATFORM_TARGET_GLOBS, MACOS_PLATFORM_TARGET_GLOBS, RELEASE_CONFIGURATION, } from '../platform-targets.js';
4
4
  import { isSmoothBricksCodebasePackageName } from '../workspace-package-policy.js';
5
- import { artifactStepLines, CI_JOB_ID, CI_WORKFLOW_NAME, CiWorkflowStepKind, cargoCredentialJobEnvLines, cargoCredentialStepLines, deployStepSecretEnvLines, githubActionPins, remoteCacheJobEnvLines, sourceCheckoutsStepLines, TRACE_DB_ARTIFACT_GLOB, } from './ci-workflow.js';
5
+ import { artifactStepLines, CI_JOB_ID, CI_WORKFLOW_NAME, CiWorkflowStepKind, cargoCredentialJobEnvLines, cargoCredentialStepLines, deployStepSecretEnvLines, githubActionPins, mbxRemoteJobEnvLines, remoteCacheJobEnvLines, sourceCheckoutsStepLines, TRACE_DB_ARTIFACT_GLOB, } from './ci-workflow.js';
6
6
  import { GITHUB_HOSTED_LINUX_RUNNER, renderRunsOnLine } from './github-runs-on.js';
7
7
  /**
8
8
  * Carried by every step that builds what ships: the build aggregate and each
@@ -345,7 +345,7 @@ ${options.release === false ? renderRunsOnLine(options.runsOn) : publishJobRunsO
345
345
  timeout-minutes: ${options.platformTargetGlobs?.length ? 90 : 45}
346
346
  env:
347
347
  LMAO_GIT_REVISION: ${githubExpression('github.sha')}
348
- GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options)}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
348
+ GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options, options.release === false ? 'internal' : publisherReach(options))}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
349
349
  steps:
350
350
  `;
351
351
  }
@@ -601,13 +601,14 @@ function cargoCredentialsJobEnv(options) {
601
601
  return rendered === '' ? '' : `\n${rendered}`;
602
602
  }
603
603
  /**
604
- * The remote cache is job env for the same reason: every Nx target in the job
605
- * reads it, and a release build that missed the cache would rebuild what CI
606
- * already built for the identical hashes. Only `${{ secrets.NAME }}` is
607
- * rendered for the token. Malformed declarations throw here, not in CI.
604
+ * The remote caches are job env for the same reason: every Nx target in the job
605
+ * reads the Nx cache and every Cargo build the mbx one, and a release build
606
+ * that missed them would rebuild what CI already built for the identical
607
+ * inputs. Only `${{ secrets.NAME }}` is rendered for a token. Malformed
608
+ * declarations throw here, not in CI.
608
609
  */
609
- function remoteCacheJobEnv(options) {
610
- const rendered = remoteCacheJobEnvLines(options.remoteCache).trimEnd();
610
+ function remoteCacheJobEnv(options, reach) {
611
+ const rendered = (remoteCacheJobEnvLines(options.remoteCache, reach) + mbxRemoteJobEnvLines(options.mbxRemote, reach)).trimEnd();
611
612
  return rendered === '' ? '' : `\n${rendered}`;
612
613
  }
613
614
  function renderSingleJobPublishWorkflowSteps(steps, options) {
@@ -704,7 +705,7 @@ ${renderRunsOnLine(options.runsOn)}
704
705
  release-sha: ${githubExpression('steps.release-state.outputs.sha')}
705
706
  env:
706
707
  LMAO_GIT_REVISION: ${githubExpression('github.sha')}
707
- GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options)}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
708
+ GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options, 'internal')}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
708
709
  steps:
709
710
  ${renderLinuxReleaseCandidateSteps(steps, options)}
710
711
 
@@ -716,7 +717,7 @@ ${renderMacosJobHeaderLines(options)}
716
717
  id-token: none
717
718
  env:
718
719
  LMAO_GIT_REVISION: ${githubExpression('github.sha')}
719
- GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options)}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
720
+ GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options, options.platformProducer?.kind === 'linux-cross' ? 'internal' : 'public')}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
720
721
  steps:
721
722
  ${renderMacosPlatformSteps(options)}
722
723
 
@@ -730,7 +731,7 @@ ${publishJobRunsOnLine(options)}
730
731
  env:
731
732
  LMAO_GIT_REVISION: ${githubExpression('github.sha')}
732
733
  TTSC_TSGO_BINARY: ${githubExpression('github.workspace')}/node_modules/@typescript/native/bin/tsc
733
- GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options)}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
734
+ GH_TOKEN: ${githubExpression('github.token')}${remoteCacheJobEnv(options, publisherReach(options))}${cargoCredentialsJobEnv(options)}${privateNpmInstallJobEnv(options)}
734
735
  steps:
735
736
  ${renderFinalLinuxPublishSteps(options)}
736
737
  `;
@@ -994,6 +995,10 @@ function hasLinuxPlatformTargets(options) {
994
995
  function publishJobRunsOnLine(options) {
995
996
  return renderRunsOnLine(options.actionsProvider === 'forgejo' ? options.runsOn : GITHUB_HOSTED_LINUX_RUNNER);
996
997
  }
998
+ /** The remote-cache reach of the runner publishJobRunsOnLine picks: Forgejo's own runners, or a GitHub-hosted one. */
999
+ function publisherReach(options) {
1000
+ return options.actionsProvider === 'forgejo' ? 'internal' : 'public';
1001
+ }
997
1002
  function githubExpression(expression) {
998
1003
  return ['$', '{{ ', expression, ' }}'].join('');
999
1004
  }
@@ -1 +1 @@
1
- {"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"AA6fA,wHAAwH;AACxH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAoBxF"}
1
+ {"version":3,"file":"owned-installation.d.ts","sourceRoot":"","sources":["../src/owned-installation.ts"],"names":[],"mappings":"AA8iBA,wHAAwH;AACxH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5C,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,oBAAoB,CAoBxF"}
@@ -12,7 +12,8 @@ const __typia_transform__accessExpressionAsString = _accessExpressionAsString_1.
12
12
  * test reads it. A fixture must not take an input it does not own.
13
13
  *
14
14
  * So the closure is copied, exactly as the witness's own census resolves it from the workspace that names it: each
15
- * package once, without its `node_modules` and `.git`, each dependency edge relinked beside
15
+ * package once, as the nodes the census holds of it (what it publishes, never its tools' state beside it), each
16
+ * dependency edge relinked beside
16
17
  * its copy as Bun's isolated layout does, the top-level packages' bins in `.bin`. Every copy is a new inode, cloned
17
18
  * where the volume allows and written otherwise, so no link count is shared with anything outside its owner.
18
19
  *
@@ -38,7 +39,7 @@ const __typia_transform__accessExpressionAsString = _accessExpressionAsString_1.
38
39
  import { spawn } from 'node:child_process';
39
40
  import { randomUUID } from 'node:crypto';
40
41
  import { constants, rmSync } from 'node:fs';
41
- import { cp, mkdir, readdir, readFile, realpath, rename, rm, symlink, writeFile } from 'node:fs/promises';
42
+ import { chmod, copyFile, cp, lstat, mkdir, readdir, readFile, readlink, realpath, rename, rm, symlink, writeFile, } from 'node:fs/promises';
42
43
  import { basename, dirname, join, relative, resolve } from 'node:path';
43
44
  import { expandOutputs } from 'nx/src/native';
44
45
  import { readModulePackageJson } from 'nx/src/utils/package-json';
@@ -359,16 +360,48 @@ async function sweep(kept, keep) {
359
360
  }
360
361
  }
361
362
  }
362
- /** Copy the host package root `source` to its place under `root`, with the census's own exclusions. */
363
- function copyPackage(source, root, { place }) {
364
- return cp(source, join(root, place), {
365
- recursive: true,
366
- verbatimSymlinks: true,
367
- mode: constants.COPYFILE_FICLONE,
368
- // A package's own .nx is content, not Nx state: @nx/workspace 24.0.3 ships templates under one, and the census
369
- // selects their directories through the package's `files` (expandOutputs), so a copy without them holds less.
370
- filter: (path) => path === source || !['node_modules', '.git'].includes(basename(path)),
371
- });
363
+ /**
364
+ * Make the copy of the host package root `source` at its place under `root` from exactly the nodes the host census
365
+ * holds for it (`censused`, every node of the closure in the census's walk order, a directory before what it holds):
366
+ * for a package declaring `files`, what it publishes, never `node_modules` or `.git`. A censused directory's `.nx` is
367
+ * copied whole: @nx/workspace 24.0.3 ships templates under one, which the census does not walk, but what its `files`
368
+ * select there (expandOutputs) selects the directory that holds it, so a copy without it censuses less. Nothing else of the package root
369
+ * is content of the closure, and a workspace package's root also holds its own tools' state (a `.cache/` its tests
370
+ * write and remove while this copy reads), which a copy of the whole root would race. A link is copied as it reads;
371
+ * the nodes it reaches are the census's own. A file is cloned where the volume allows.
372
+ */
373
+ async function copyPackage(source, root, { place }, censused) {
374
+ const target = join(root, place);
375
+ for (const path of censused) {
376
+ if (path !== source && !path.startsWith(`${source}/`))
377
+ continue;
378
+ const destination = join(target, relative(source, path));
379
+ const stats = await lstat(path);
380
+ if (stats.isSymbolicLink()) {
381
+ await symlink(await readlink(path), destination);
382
+ }
383
+ else if (stats.isDirectory()) {
384
+ await mkdir(destination, { recursive: true });
385
+ await chmod(destination, stats.mode & 0o7777);
386
+ // The one absence expected here: most directories hold no .nx.
387
+ const dotNx = join(path, '.nx');
388
+ const held = await lstat(dotNx).catch((error) => {
389
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
390
+ return null;
391
+ throw error;
392
+ });
393
+ if (held?.isDirectory()) {
394
+ await cp(dotNx, join(destination, '.nx'), {
395
+ recursive: true,
396
+ verbatimSymlinks: true,
397
+ mode: constants.COPYFILE_FICLONE,
398
+ });
399
+ }
400
+ }
401
+ else {
402
+ await copyFile(path, destination, constants.COPYFILE_FICLONE);
403
+ }
404
+ }
372
405
  }
373
406
  /** Link every resolution edge of `host` beside its copy under `root`, and the top-level packages' bins in `.bin`. */
374
407
  async function linkCopies(censusRoot, root, { resolutions }, placed) {
@@ -432,6 +465,7 @@ async function proveOrCopy(censusRoot, kept, inUse) {
432
465
  if (host === null)
433
466
  throw new Error(`the Nx installation closure of ${censusRoot} cannot be read: ${unread}`);
434
467
  const placed = await placements(host);
468
+ const censused = host.nodes.map(({ path }) => path);
435
469
  const wanted = holdings(host, censusRoot, new Map([...placed].map(([source, { place }]) => [source, place])));
436
470
  const placesIn = (root) => new Map([...placed.values()].map(({ place }) => [join(root, place), place]));
437
471
  // Only a recorded copy is censused: a census of none would resolve the host's packages through the ancestor lookup.
@@ -472,11 +506,11 @@ async function proveOrCopy(censusRoot, kept, inUse) {
472
506
  if (root === current && stale !== null) {
473
507
  for (const [, { place }] of stale)
474
508
  await rm(join(root, place), { recursive: true, force: true });
475
- await Promise.all(stale.map(([source, placement]) => copyPackage(source, root, placement)));
509
+ await Promise.all(stale.map(([source, placement]) => copyPackage(source, root, placement, censused)));
476
510
  }
477
511
  else {
478
512
  await sweep(kept, inUse);
479
- await Promise.all([...placed].map(([source, placement]) => copyPackage(source, root, placement)));
513
+ await Promise.all([...placed].map(([source, placement]) => copyPackage(source, root, placement, censused)));
480
514
  await linkCopies(censusRoot, root, host, placed);
481
515
  }
482
516
  const census = copyCensus(root, root === current ? (found ?? undefined) : undefined, (detail) => {
@@ -0,0 +1,28 @@
1
+ /**
2
+ * What a package whose ttsc plugin lowers a dialect declares in its manifest, as `smoo.typecheck`: every project that
3
+ * depends on it directly compiles sources the stock checker refuses (a construct the plugin's ProgramPlugin rewrites
4
+ * before emit, its refusal withdrawn through the driver's DiagnosticPlugin seam), so that project's typecheck runs
5
+ * through ttsc, never the pinned native compiler, which cannot judge the dialect.
6
+ */
7
+ export interface DialectTypecheck {
8
+ /** The compiler a dependent project's typecheck runs. */
9
+ readonly compiler: 'ttsc';
10
+ /**
11
+ * The Nx targets (`project:target`) that prepare the plugin binaries ttsc loads, so a typecheck loads built bytes
12
+ * and never compiles the plugin inside the check. The declaring package names them; the inference guesses none.
13
+ */
14
+ readonly dependsOn: readonly string[];
15
+ }
16
+ /** A project's typecheck route: the direct dependencies that declare a dialect, and the targets they name, once each. */
17
+ export interface TypecheckRoute {
18
+ readonly declaredBy: readonly string[];
19
+ readonly dependsOn: readonly string[];
20
+ }
21
+ /**
22
+ * The typecheck route of the project whose manifest is `packageJsonPath`, over its direct dependencies (the ones ttsc
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
25
+ * declares `smoo.typecheck` in another shape refuses the inference by its path and the field it got wrong.
26
+ */
27
+ export declare function typecheckRoute(packageJsonPath: string, dependencies: readonly string[]): TypecheckRoute;
28
+ //# sourceMappingURL=typecheck-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typecheck-route.d.ts","sourceRoot":"","sources":["../src/typecheck-route.ts"],"names":[],"mappings":"AAKA;;;;;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;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,CAuBvG"}
@@ -0,0 +1,109 @@
1
+ import * as _validateReport_1 from "typia/lib/internal/_validateReport";
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
+ import typia from 'typia';
7
+ const validateManifest = (() => {
8
+ let errors;
9
+ let _report;
10
+ const _io0 = input => undefined === input.smoo || "object" === typeof input.smoo && null !== input.smoo && false === Array.isArray(input.smoo) && _io1(input.smoo);
11
+ const _io1 = input => undefined === input.typecheck || "object" === typeof input.typecheck && null !== input.typecheck && _io2(input.typecheck);
12
+ const _io2 = input => "ttsc" === input.compiler && (Array.isArray(input.dependsOn) && input.dependsOn.every(elem => "string" === typeof elem));
13
+ const _vo0 = (input, _path, _exceptionable = true) => [undefined === input.smoo || ("object" === typeof input.smoo && null !== input.smoo && false === Array.isArray(input.smoo) || _report(_exceptionable, {
14
+ path: _path + ".smoo",
15
+ expected: "(undefined | { readonly typecheck?: DialectTypecheck | undefined; })",
16
+ value: input.smoo
17
+ })) && _vo1(input.smoo, _path + ".smoo", true && _exceptionable) || _report(_exceptionable, {
18
+ path: _path + ".smoo",
19
+ expected: "(undefined | { readonly typecheck?: DialectTypecheck | undefined; })",
20
+ value: input.smoo
21
+ })].every(flag => flag);
22
+ const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.typecheck || ("object" === typeof input.typecheck && null !== input.typecheck || _report(_exceptionable, {
23
+ path: _path + ".typecheck",
24
+ expected: "(DialectTypecheck | undefined)",
25
+ value: input.typecheck
26
+ })) && _vo2(input.typecheck, _path + ".typecheck", true && _exceptionable) || _report(_exceptionable, {
27
+ path: _path + ".typecheck",
28
+ expected: "(DialectTypecheck | undefined)",
29
+ value: input.typecheck
30
+ })].every(flag => flag);
31
+ const _vo2 = (input, _path, _exceptionable = true) => ["ttsc" === input.compiler || _report(_exceptionable, {
32
+ path: _path + ".compiler",
33
+ expected: "\"ttsc\"",
34
+ value: input.compiler
35
+ }), (Array.isArray(input.dependsOn) || _report(_exceptionable, {
36
+ path: _path + ".dependsOn",
37
+ expected: "ReadonlyArray<string>",
38
+ value: input.dependsOn
39
+ })) && input.dependsOn.map((elem, _index2) => "string" === typeof elem || _report(_exceptionable, {
40
+ path: _path + ".dependsOn[" + _index2 + "]",
41
+ expected: "string",
42
+ value: elem
43
+ })).every(flag => flag) || _report(_exceptionable, {
44
+ path: _path + ".dependsOn",
45
+ expected: "ReadonlyArray<string>",
46
+ value: input.dependsOn
47
+ })].every(flag => flag);
48
+ const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
49
+ return _createStandardSchema_1._createStandardSchema(input => {
50
+ if (false === __is(input)) {
51
+ errors = [];
52
+ _report = _validateReport_1._validateReport(errors);
53
+ ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
54
+ path: _path + "",
55
+ expected: "DeclaringManifest",
56
+ value: input
57
+ })) && _vo0(input, _path + "", true) || _report(true, {
58
+ path: _path + "",
59
+ expected: "DeclaringManifest",
60
+ value: input
61
+ }))(input, "$input", true);
62
+ const success = 0 === errors.length;
63
+ return success ? {
64
+ success,
65
+ data: input
66
+ } : {
67
+ success,
68
+ errors,
69
+ data: input
70
+ };
71
+ }
72
+ return {
73
+ success: true,
74
+ data: input
75
+ };
76
+ });
77
+ })();
78
+ /**
79
+ * The typecheck route of the project whose manifest is `packageJsonPath`, over its direct dependencies (the ones ttsc
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
82
+ * declares `smoo.typecheck` in another shape refuses the inference by its path and the field it got wrong.
83
+ */
84
+ export function typecheckRoute(packageJsonPath, dependencies) {
85
+ const declaredBy = [];
86
+ const dependsOn = [];
87
+ const lookup = createRequire(packageJsonPath);
88
+ for (const name of new Set(dependencies)) {
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')));
95
+ if (!checked.success) {
96
+ throw new Error(`${manifest}: smoo.typecheck must be { compiler: 'ttsc', dependsOn: ['<project>:<target>', ...] }: ${checked.errors
97
+ .map((error) => `${error.path} expected ${error.expected}`)
98
+ .join('; ')}`);
99
+ }
100
+ const declared = checked.data.smoo?.typecheck;
101
+ if (declared === undefined)
102
+ continue;
103
+ declaredBy.push(name);
104
+ for (const target of declared.dependsOn)
105
+ if (!dependsOn.includes(target))
106
+ dependsOn.push(target);
107
+ }
108
+ return { declaredBy, dependsOn };
109
+ }