@r_masseater/msch 0.88.0 → 0.89.0

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/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { C as valueKey, S as schemaTypeOf, _ as formatValues, a as nearestManifestDirectory, b as literalValuesOf, c as listConfigFiles, d as withProject, f as declarationKey, g as finiteValuesOf, h as locationOf, i as installedPackages, l as mentions$1, m as isObjectType, n as keepOnly, o as projectInputs, p as describeLibraryType, r as recordsIn, t as contentKey, u as typeScriptCompiler, v as isSubsetOf, w as vocabularyOf, x as sameValues, y as literalUnionOf } from "./pass-records-CBvMwfN3.mjs";
3
3
  import { n as NODE_MODULES, o as TOOL_NAME, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-B6PEvKWe.mjs";
4
4
  import { t as workspaceManifest } from "./workspace-manifest-BAVyPzbA.mjs";
5
- import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-CNhs9_g2.mjs";
5
+ import { a as workspaceDeviations, c as tomlSourceComments, d as problemAtIndex, i as cargoDeviations, l as yamlSourceComments, o as collectNodes, r as WORKSPACE_SECTIONS, s as isRecord, t as checkUpstreamExits, u as positionOf } from "./upstream-exits-DtxgldU3.mjs";
6
6
  import { a as parent, i as join, n as isInside, t as baseName } from "./path-DUttmo2s.mjs";
7
7
  import { i as workspaceProjects, n as unmatchedWorkspacePatterns, o as installedManifest, r as workspaceDirectories, s as readManifest, t as publishedProjects } from "./workspace-projects-B-vCr6bx.mjs";
8
8
  import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, k as symbolAtLocation, l as childrenOf$1, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$3, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-CUIz4TEI.mjs";
@@ -12275,6 +12275,7 @@ const checkPlacement = Effect.fn("checkPlacement")(function* checkPlacement(root
12275
12275
  const OUTSIDE_BIN = "command-outside-bin";
12276
12276
  const UNRUN = "unrun-command";
12277
12277
  const SCRIPTS = "scripts-directory";
12278
+ const CODE_IN_BIN = "code-in-bin";
12278
12279
  const BIN = "bin";
12279
12280
  const SCRIPTS_DIRECTORY = "scripts";
12280
12281
  const WORKFLOW_DIRECTORY$1 = ".github/";
@@ -12284,6 +12285,7 @@ const READ_CONCURRENCY$22 = 8;
12284
12285
  const FIRST$14 = 1;
12285
12286
  const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
12286
12287
  const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
12288
+ const COMMAND_FILE = /^bin\/[^/]+$/u;
12287
12289
  const NOT_COMMAND = /\.(?:test|d|test\.support)\.[cm]?ts$/u;
12288
12290
  const NO_ENTRIES = {
12289
12291
  all: [],
@@ -12367,13 +12369,31 @@ const scriptsProblem = Effect.fn("scriptsProblem")(function* scriptsProblem(root
12367
12369
  message: `${workspacePath(directory, SCRIPTS_DIRECTORY)} is a scripts directory. Put each command at ${BIN}/<name>.ts and the code that it shares in the package's own source, so that every workspace runs its commands the same way.`
12368
12370
  })));
12369
12371
  });
12372
+ const isCommandFile = (path) => isCommand$1(path) || COMMAND_FILE.test(path) && NOT_COMMAND.test(path);
12373
+ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProblems(root, directory) {
12374
+ const files = yield* RepositoryFiles;
12375
+ const listed = yield* files.listedFiles(root);
12376
+ const prefix = workspacePath(directory, `${BIN}${SEPARATOR$15}`);
12377
+ return pipe(listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.filter((file) => !isCommandFile(`${BIN}${SEPARATOR$15}${String$1.slice(prefix.length)(file)}`)), Array$1.map((file) => ({
12378
+ file: files.join(root, file),
12379
+ line: FIRST$14,
12380
+ column: FIRST$14,
12381
+ rule: CODE_IN_BIN,
12382
+ message: `${file} is in ${BIN}/ but is not a command. Put only commands at ${BIN}/<name>.ts and the code that they share in the package own source, in a slice under src/, so that fallow judges it as ordinary code instead of as an entry point that is never reported unused.`
12383
+ })));
12384
+ });
12370
12385
  /** @internal */
12371
12386
  const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
12372
12387
  const all = ["", ...yield* workspaceDirectories(root)];
12373
12388
  const workflows = yield* workflowText(root);
12374
12389
  const found = yield* Effect.forEach(all, (directory) => problemsIn$19(root, directory, workflows), { concurrency: READ_CONCURRENCY$22 });
12375
12390
  const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$22 });
12376
- return [...Array$1.flatten(found), ...Array$1.getSomes(scripts)];
12391
+ const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$22 });
12392
+ return [
12393
+ ...Array$1.flatten(found),
12394
+ ...Array$1.getSomes(scripts),
12395
+ ...Array$1.flatten(code)
12396
+ ];
12377
12397
  });
12378
12398
  // src/features/check-repository-layout/model/path-mention.ts
12379
12399
  const START$26 = 0;