@sanity/pkg-utils 5.1.1-canary.0 → 5.1.1

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.cjs CHANGED
@@ -3,7 +3,7 @@ var cac = require("cac");
3
3
  function _interopDefaultCompat(e) {
4
4
  return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
6
- var cac__default = /* @__PURE__ */ _interopDefaultCompat(cac), version = "5.1.1-canary.0";
6
+ var cac__default = /* @__PURE__ */ _interopDefaultCompat(cac), version = "5.1.1";
7
7
  const cli = cac__default.default();
8
8
  cli.command("", "Check").alias("check").option("--strict", "Strict mode").option("--tsconfig [tsconfig]", "[string] tsconfig.json").action(async (options) => {
9
9
  const { checkAction } = await Promise.resolve().then(function() {
package/dist/index.js CHANGED
@@ -544,15 +544,16 @@ function resolveBuildTasks(ctx) {
544
544
  targetPaths: getTargetPaths(pkg.type, exp.node)
545
545
  });
546
546
  }
547
- for (const bundle of bundles) {
548
- const exportPath = (bundle.import || bundle.require).replace(/\.[mc]?js$/, ""), importId = path$1.join(pkg.name, exportPath);
549
- dtsTask2.entries.push({
550
- importId,
551
- exportPath,
552
- sourcePath: bundle.source,
553
- targetPaths: getTargetPaths(pkg.type, bundle)
554
- });
555
- }
547
+ for (const bundle of bundles)
548
+ if (bundle.source?.endsWith(".ts")) {
549
+ const exportPath = (bundle.import || bundle.require).replace(/\.[mc]?js$/, ""), importId = path$1.join(pkg.name, exportPath);
550
+ dtsTask2.entries.push({
551
+ importId,
552
+ exportPath,
553
+ sourcePath: bundle.source,
554
+ targetPaths: getTargetPaths(pkg.type, bundle)
555
+ });
556
+ }
556
557
  if (dtsTask2.entries.length && tasks.push(dtsTask2), !ctx.emitDeclarationOnly) {
557
558
  for (const exp of exports) {
558
559
  const output = exp.require;
@@ -20266,7 +20267,7 @@ async function extractTypes(options2) {
20266
20267
  path: expTypesPath
20267
20268
  });
20268
20269
  }
20269
- return shouldCleanUpDts && (console.warn("Cleaning up .d.ts file", typesPath), await fs.unlink(typesPath)), { extractorResult, messages };
20270
+ return shouldCleanUpDts && await fs.unlink(typesPath), { extractorResult, messages };
20270
20271
  }
20271
20272
  async function doExtract(ctx, task) {
20272
20273
  const { config: config2, cwd, files, logger, strict, ts: ts2 } = ctx;