@sanity/pkg-utils 6.6.3 → 6.6.4-canary.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.
@@ -79,20 +79,8 @@ async function buildTypes(options2) {
79
79
  declarationDir: outDir,
80
80
  emitDeclarationOnly: !0,
81
81
  noEmit: !1,
82
+ noEmitOnError: strict ? !0 : tsconfig.options.noEmitOnError ?? !0,
82
83
  outDir
83
- /*
84
- // Support the new `module: 'preserve'` option in TypeScript 5.4
85
- ...(tsconfig.options.module === ts.ModuleKind.Preserve
86
- ? {
87
- // Set the equivalent options to `module: 'Preserve'`
88
- // 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
89
- module: ts.ModuleKind.ESNext,
90
- moduleResolution: ts.ModuleResolutionKind.Bundler,
91
- esModuleInterop: true,
92
- resolveJsonModule: true,
93
- }
94
- : {}),
95
- // */
96
84
  }, program = ts__default.default.createProgram(tsconfig.fileNames, compilerOptions), emitResult = program.emit(), allDiagnostics = ts__default.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
97
85
  for (const diagnostic of allDiagnostics)
98
86
  printDiagnostic({ cwd, logger, diagnostic });
@@ -115,30 +103,27 @@ function createApiExtractorConfig(options2) {
115
103
  mainEntryPointFilePath,
116
104
  tsconfig,
117
105
  tsconfigPath
118
- } = options2;
119
- return {
106
+ } = options2, workaroundModulePreserve = tsconfig.options.module === ts__default.default.ModuleKind.Preserve, workaroundPaths = !!tsconfig.options.paths, overrideTsconfig = {
107
+ extends: tsconfigPath,
108
+ compilerOptions: {}
109
+ };
110
+ return workaroundModulePreserve && Object.assign(overrideTsconfig.compilerOptions, {
111
+ // Set the equivalent options to `module: 'Preserve'`
112
+ // 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
113
+ module: "ESNext",
114
+ moduleResolution: "Bundler",
115
+ esModuleInterop: !0,
116
+ resolveJsonModule: !0
117
+ }), workaroundPaths && Object.assign(overrideTsconfig.compilerOptions, {
118
+ // An empty object replaces whatever is in the original tsconfig file
119
+ paths: {}
120
+ }), {
120
121
  apiReport: {
121
122
  enabled: !1,
122
123
  reportFileName: "<unscopedPackageName>.api.md"
123
124
  },
124
125
  bundledPackages,
125
- compiler: tsconfig.options.module === ts__default.default.ModuleKind.Preserve ? {
126
- // When the module is 'preserve' it's necessary to override the tsconfig file as api-extractor doesn't handle it out of the box
127
- overrideTsconfig: {
128
- extends: tsconfigPath,
129
- compilerOptions: {
130
- // Set the equivalent options to `module: 'Preserve'`
131
- // 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
132
- module: "ESNext",
133
- moduleResolution: "Bundler",
134
- esModuleInterop: !0,
135
- resolveJsonModule: !0
136
- }
137
- }
138
- } : {
139
- // If the module is not 'preserve', use the tsconfig file directly
140
- tsconfigFilePath: tsconfigPath
141
- },
126
+ compiler: workaroundModulePreserve || workaroundPaths ? { overrideTsconfig } : { tsconfigFilePath: tsconfigPath },
142
127
  docModel: {
143
128
  enabled: !1,
144
129
  apiJsonFilePath: path__default.default.resolve(distPath, `${exportPath}.api.json`)