@sanity/pkg-utils 5.1.3 → 5.1.5

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.
@@ -9,10 +9,10 @@ var path = require("path");
9
9
  require("prompts");
10
10
  require("typescript");
11
11
  var fs = require("fs"), chalk = require("chalk"), index = require("./index.cjs");
12
- function _interopDefault(e) {
13
- return e && e.__esModule ? e : { default: e };
12
+ function _interopDefaultCompat(e) {
13
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
14
14
  }
15
- var path__default = /* @__PURE__ */ _interopDefault(path), fs__default = /* @__PURE__ */ _interopDefault(fs), chalk__default = /* @__PURE__ */ _interopDefault(chalk);
15
+ var path__default = /* @__PURE__ */ _interopDefaultCompat(path), fs__default = /* @__PURE__ */ _interopDefaultCompat(fs), chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk);
16
16
  function resolveBuildTasks(ctx) {
17
17
  const { config, cwd, pkg, target } = ctx, bundles = config?.bundles || [], tasks = [], exports2 = Object.entries(ctx.exports || {}).map(
18
18
  ([_path, exp]) => ({ _path, ...exp })
@@ -8,10 +8,10 @@ require("mkdirp");
8
8
  require("prompts");
9
9
  require("typescript");
10
10
  var chalk = require("chalk"), treeify = require("treeify"), fs = require("fs"), prettyBytes = require("pretty-bytes");
11
- function _interopDefault(e) {
12
- return e && e.__esModule ? e : { default: e };
11
+ function _interopDefaultCompat(e) {
12
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
13
13
  }
14
- var esbuild__default = /* @__PURE__ */ _interopDefault(esbuild), path__default = /* @__PURE__ */ _interopDefault(path), chalk__default = /* @__PURE__ */ _interopDefault(chalk), treeify__default = /* @__PURE__ */ _interopDefault(treeify), prettyBytes__default = /* @__PURE__ */ _interopDefault(prettyBytes);
14
+ var esbuild__default = /* @__PURE__ */ _interopDefaultCompat(esbuild), path__default = /* @__PURE__ */ _interopDefaultCompat(path), chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk), treeify__default = /* @__PURE__ */ _interopDefaultCompat(treeify), prettyBytes__default = /* @__PURE__ */ _interopDefaultCompat(prettyBytes);
15
15
  function getFilesize(file) {
16
16
  const stats = fs.statSync(file);
17
17
  return prettyBytes__default.default(stats.size);
@@ -5,10 +5,10 @@ var config = require("@sanity/browserslist-config");
5
5
  require("mkdirp");
6
6
  require("prompts");
7
7
  var ts = require("typescript");
8
- function _interopDefault(e) {
9
- return e && e.__esModule ? e : { default: e };
8
+ function _interopDefaultCompat(e) {
9
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
10
10
  }
11
- var path__default = /* @__PURE__ */ _interopDefault(path), pkgUp__default = /* @__PURE__ */ _interopDefault(pkgUp), findConfig__default = /* @__PURE__ */ _interopDefault(findConfig), chalk__default = /* @__PURE__ */ _interopDefault(chalk), fs__default = /* @__PURE__ */ _interopDefault(fs), browserslist__default = /* @__PURE__ */ _interopDefault(browserslist), config__default = /* @__PURE__ */ _interopDefault(config), ts__default = /* @__PURE__ */ _interopDefault(ts);
11
+ var path__default = /* @__PURE__ */ _interopDefaultCompat(path), pkgUp__default = /* @__PURE__ */ _interopDefaultCompat(pkgUp), findConfig__default = /* @__PURE__ */ _interopDefaultCompat(findConfig), chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk), fs__default = /* @__PURE__ */ _interopDefaultCompat(fs), browserslist__default = /* @__PURE__ */ _interopDefaultCompat(browserslist), config__default = /* @__PURE__ */ _interopDefaultCompat(config), ts__default = /* @__PURE__ */ _interopDefaultCompat(ts);
12
12
  const CONFIG_FILE_NAMES = [
13
13
  "package.config.ts",
14
14
  "package.config.js",
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  var chalk = require("chalk");
3
- function _interopDefault(e) {
4
- return e && e.__esModule ? e : { default: e };
3
+ function _interopDefaultCompat(e) {
4
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
5
5
  }
6
- var chalk__default = /* @__PURE__ */ _interopDefault(chalk);
6
+ var chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk);
7
7
  function handleError(err) {
8
8
  err instanceof Error ? console.error(chalk__default.default.red("error"), err.message) : console.error(err), process.exit(1);
9
9
  }
@@ -26,10 +26,10 @@ require("@sanity/browserslist-config");
26
26
  require("./logger.cjs");
27
27
  require("zod");
28
28
  require("prompts");
29
- function _interopDefault(e) {
30
- return e && e.__esModule ? e : { default: e };
29
+ function _interopDefaultCompat(e) {
30
+ return e && typeof e == "object" && "default" in e ? e : { default: e };
31
31
  }
32
- var chalk__default = /* @__PURE__ */ _interopDefault(chalk), path__default = /* @__PURE__ */ _interopDefault(path$1), rimraf__default = /* @__PURE__ */ _interopDefault(rimraf), ts__default = /* @__PURE__ */ _interopDefault(ts), fs__default$1 = /* @__PURE__ */ _interopDefault(fs), prettier__default = /* @__PURE__ */ _interopDefault(prettier), fs__default = /* @__PURE__ */ _interopDefault(fs$1), require$$4__default = /* @__PURE__ */ _interopDefault(require$$4), alias__default = /* @__PURE__ */ _interopDefault(alias), commonjs__default = /* @__PURE__ */ _interopDefault(commonjs), json__default = /* @__PURE__ */ _interopDefault(json), replace__default = /* @__PURE__ */ _interopDefault(replace), terser__default = /* @__PURE__ */ _interopDefault(terser), esbuild__default = /* @__PURE__ */ _interopDefault(esbuild);
32
+ var chalk__default = /* @__PURE__ */ _interopDefaultCompat(chalk), path__default = /* @__PURE__ */ _interopDefaultCompat(path$1), rimraf__default = /* @__PURE__ */ _interopDefaultCompat(rimraf), ts__default = /* @__PURE__ */ _interopDefaultCompat(ts), fs__default$1 = /* @__PURE__ */ _interopDefaultCompat(fs), prettier__default = /* @__PURE__ */ _interopDefaultCompat(prettier), fs__default = /* @__PURE__ */ _interopDefaultCompat(fs$1), require$$4__default = /* @__PURE__ */ _interopDefaultCompat(require$$4), alias__default = /* @__PURE__ */ _interopDefaultCompat(alias), commonjs__default = /* @__PURE__ */ _interopDefaultCompat(commonjs), json__default = /* @__PURE__ */ _interopDefaultCompat(json), replace__default = /* @__PURE__ */ _interopDefaultCompat(replace), terser__default = /* @__PURE__ */ _interopDefaultCompat(terser), esbuild__default = /* @__PURE__ */ _interopDefaultCompat(esbuild);
33
33
  function printExtractMessages(ctx, messages) {
34
34
  const { cwd, logger } = ctx, warnings = messages.filter((msg) => msg.logLevel === "warning");
35
35
  warnings.length && logger.log();
@@ -19858,7 +19858,7 @@ function resolveRollupConfig(ctx, buildTask) {
19858
19858
  entryFileNames,
19859
19859
  esModule: !0,
19860
19860
  format,
19861
- interop: "auto",
19861
+ interop: "compat",
19862
19862
  sourcemap: config?.sourcemap ?? !0,
19863
19863
  hoistTransitiveImports: !1,
19864
19864
  ...config?.rollup?.output