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

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 = "6.6.4-canary.0";
6
+ var cac__default = /* @__PURE__ */ _interopDefaultCompat(cac), version = "6.6.4";
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
@@ -828,6 +828,7 @@ async function buildTypes(options2) {
828
828
  declarationDir: outDir,
829
829
  emitDeclarationOnly: !0,
830
830
  noEmit: !1,
831
+ noEmitOnError: strict ? !0 : tsconfig.options.noEmitOnError ?? !0,
831
832
  outDir
832
833
  }, program = ts.createProgram(tsconfig.fileNames, compilerOptions), emitResult = program.emit(), allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
833
834
  for (const diagnostic of allDiagnostics)
@@ -851,30 +852,27 @@ function createApiExtractorConfig(options2) {
851
852
  mainEntryPointFilePath,
852
853
  tsconfig,
853
854
  tsconfigPath
854
- } = options2;
855
- return {
855
+ } = options2, workaroundModulePreserve = tsconfig.options.module === ts.ModuleKind.Preserve, workaroundPaths = !!tsconfig.options.paths, overrideTsconfig = {
856
+ extends: tsconfigPath,
857
+ compilerOptions: {}
858
+ };
859
+ return workaroundModulePreserve && Object.assign(overrideTsconfig.compilerOptions, {
860
+ // Set the equivalent options to `module: 'Preserve'`
861
+ // https://github.com/microsoft/TypeScript/pull/56785/files?file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.symbols&file-filters%5B%5D=.ts&file-filters%5B%5D=.types&show-viewed-files=true#diff-31d3c12bafea26bc9e8c8a77920c41af0c593206442add70c45a06c063767445
862
+ module: "ESNext",
863
+ moduleResolution: "Bundler",
864
+ esModuleInterop: !0,
865
+ resolveJsonModule: !0
866
+ }), workaroundPaths && Object.assign(overrideTsconfig.compilerOptions, {
867
+ // An empty object replaces whatever is in the original tsconfig file
868
+ paths: {}
869
+ }), {
856
870
  apiReport: {
857
871
  enabled: !1,
858
872
  reportFileName: "<unscopedPackageName>.api.md"
859
873
  },
860
874
  bundledPackages,
861
- compiler: tsconfig.options.module === ts.ModuleKind.Preserve ? {
862
- // When the module is 'preserve' it's necessary to override the tsconfig file as api-extractor doesn't handle it out of the box
863
- overrideTsconfig: {
864
- extends: tsconfigPath,
865
- compilerOptions: {
866
- // Set the equivalent options to `module: 'Preserve'`
867
- // https://github.com/microsoft/TypeScript/pull/56785/files?file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.symbols&file-filters%5B%5D=.ts&file-filters%5B%5D=.types&show-viewed-files=true#diff-31d3c12bafea26bc9e8c8a77920c41af0c593206442add70c45a06c063767445
868
- module: "ESNext",
869
- moduleResolution: "Bundler",
870
- esModuleInterop: !0,
871
- resolveJsonModule: !0
872
- }
873
- }
874
- } : {
875
- // If the module is not 'preserve', use the tsconfig file directly
876
- tsconfigFilePath: tsconfigPath
877
- },
875
+ compiler: workaroundModulePreserve || workaroundPaths ? { overrideTsconfig } : { tsconfigFilePath: tsconfigPath },
878
876
  docModel: {
879
877
  enabled: !1,
880
878
  apiJsonFilePath: path$1.resolve(distPath, `${exportPath}.api.json`)