@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/_chunks-cjs/index.cjs +17 -19
- package/dist/_chunks-cjs/index.cjs.map +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/index.js +17 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/node/tasks/dts/buildTypes.ts +1 -0
- package/src/node/tasks/dts/createApiExtractorConfig.ts +32 -19
|
@@ -79,6 +79,7 @@ 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
|
}, program = ts__default.default.createProgram(tsconfig.fileNames, compilerOptions), emitResult = program.emit(), allDiagnostics = ts__default.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
84
85
|
for (const diagnostic of allDiagnostics)
|
|
@@ -102,30 +103,27 @@ function createApiExtractorConfig(options2) {
|
|
|
102
103
|
mainEntryPointFilePath,
|
|
103
104
|
tsconfig,
|
|
104
105
|
tsconfigPath
|
|
105
|
-
} = options2
|
|
106
|
-
|
|
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
|
+
}), {
|
|
107
121
|
apiReport: {
|
|
108
122
|
enabled: !1,
|
|
109
123
|
reportFileName: "<unscopedPackageName>.api.md"
|
|
110
124
|
},
|
|
111
125
|
bundledPackages,
|
|
112
|
-
compiler:
|
|
113
|
-
// When the module is 'preserve' it's necessary to override the tsconfig file as api-extractor doesn't handle it out of the box
|
|
114
|
-
overrideTsconfig: {
|
|
115
|
-
extends: tsconfigPath,
|
|
116
|
-
compilerOptions: {
|
|
117
|
-
// Set the equivalent options to `module: 'Preserve'`
|
|
118
|
-
// 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
|
|
119
|
-
module: "ESNext",
|
|
120
|
-
moduleResolution: "Bundler",
|
|
121
|
-
esModuleInterop: !0,
|
|
122
|
-
resolveJsonModule: !0
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
} : {
|
|
126
|
-
// If the module is not 'preserve', use the tsconfig file directly
|
|
127
|
-
tsconfigFilePath: tsconfigPath
|
|
128
|
-
},
|
|
126
|
+
compiler: workaroundModulePreserve || workaroundPaths ? { overrideTsconfig } : { tsconfigFilePath: tsconfigPath },
|
|
129
127
|
docModel: {
|
|
130
128
|
enabled: !1,
|
|
131
129
|
apiJsonFilePath: path__default.default.resolve(distPath, `${exportPath}.api.json`)
|