@sanity/pkg-utils 7.7.1 → 7.7.2-canary.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.
@@ -454,7 +454,8 @@ const toggle = zod.z.union([zod.z.literal("error"), zod.z.literal("warn"), zod.z
454
454
  noImplicitBrowsersList: toggle.default("warn"),
455
455
  alwaysPackageJsonTypes: toggle.default("error"),
456
456
  alwaysPackageJsonMain: toggle.default("error"),
457
- alwaysPackageJsonFiles: toggle.default("error")
457
+ alwaysPackageJsonFiles: toggle.default("error"),
458
+ noCheckTypes: toggle.default("warn")
458
459
  }).strict(), validationSchema = zod.z.object({
459
460
  strictOptions: strictOptions.default({})
460
461
  });
@@ -471,6 +472,15 @@ async function resolveBuildContext(options) {
471
472
  strict,
472
473
  tsconfig: tsconfigPath
473
474
  } = options, tsconfig = await loadTSConfig({ cwd, tsconfigPath }), strictOptions2 = parseStrictOptions(config2?.strictOptions ?? {});
475
+ if (strictOptions2.noCheckTypes !== "off" && tsconfig?.options && config2?.dts !== "rolldown" && tsconfig.options.noCheck !== !1 && !tsconfig.options.noCheck) {
476
+ if (strictOptions2.noCheckTypes === "error")
477
+ throw new Error(
478
+ "`noCheck` is not set to `true` in the tsconfig.json file used by `package.config.ts`. This makes generating dts files slower than it needs to be, as it will perform type checking on the dts files while at it."
479
+ );
480
+ logger.warn(
481
+ "`noCheck` is not set to `true` in the tsconfig.json file used by `package.config.ts`. This makes generating dts files slower than it needs to be, as it will perform type checking on the dts files while at it."
482
+ );
483
+ }
474
484
  let browserslist2 = pkg.browserslist;
475
485
  if (!browserslist2) {
476
486
  if (strict && strictOptions2.noImplicitBrowsersList !== "off") {
@@ -739,6 +749,7 @@ async function buildTypes(options) {
739
749
  emitDeclarationOnly: !0,
740
750
  noEmit: !1,
741
751
  noEmitOnError: strict ? !0 : tsconfig.options.noEmitOnError ?? !0,
752
+ noCheck: tsconfig.options.noCheck ?? tsconfig.options.isolatedDeclarations,
742
753
  outDir
743
754
  }, program = ts__default.default.createProgram(tsconfig.fileNames, compilerOptions), emitResult = program.emit(), allDiagnostics = ts__default.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
744
755
  for (const diagnostic of allDiagnostics)
@@ -2393,7 +2404,5 @@ exports.loadPkgWithReporting = loadPkgWithReporting;
2393
2404
  exports.parseExports = parseExports;
2394
2405
  exports.parseStrictOptions = parseStrictOptions;
2395
2406
  exports.pkgExtMap = pkgExtMap;
2396
- exports.strictOptions = strictOptions;
2397
- exports.toggle = toggle;
2398
2407
  exports.watch = watch;
2399
2408
  //# sourceMappingURL=index.cjs.map