// This project depends on the `@jsr/denotest__add` npm-compat package directly
// (via `npm:`) but does NOT enable `jsrDepsInNodeModules`. The package still
// installs into node_modules under its `@jsr/...` name, but Deno must not add
// the `@scope/name` alias symlink or write a `.npmrc` (those are reserved for
// the opt-in `jsrDepsInNodeModules` mode), so existing `npm:@jsr/...` users are
// left untouched.
import { add } from "@denotest/add";

console.log("add:", add(1, 2));

// The package is materialized under its npm-compat name as usual.
console.log(
  "@jsr package in node_modules:",
  Deno.statSync("node_modules/@jsr/denotest__add").isDirectory,
);

// ...but no `@scope/name` alias is created.
let aliasExists = false;
try {
  Deno.statSync("node_modules/@denotest/add");
  aliasExists = true;
} catch {
  // expected: the alias is not created
}
console.log("alias in node_modules:", aliasExists);

// ...and no `.npmrc` is written into the project directory.
let npmrcExists = false;
try {
  Deno.statSync(".npmrc");
  npmrcExists = true;
} catch {
  // expected: no .npmrc is written
}
console.log(".npmrc exists:", npmrcExists);
