Comparing version 8.3.0 to 8.3.4
#!/usr/bin/env node | ||
"use strict"; | ||
var _chunkJNR3R42Tjs = require('./chunk-JNR3R42T.js'); | ||
require('./chunk-PEPKMCEI.js'); | ||
var _chunkND3IV4E3js = require('./chunk-ND3IV4E3.js'); | ||
require('./chunk-AMCJ4M3V.js'); | ||
var _chunkLDLF4CLAjs = require('./chunk-LDLF4CLA.js'); | ||
require('./chunk-G22UJFQC.js'); | ||
var _chunkJZ25TPTYjs = require('./chunk-JZ25TPTY.js'); | ||
require('./chunk-TWFEYLU4.js'); | ||
// src/cli-default.ts | ||
_chunkJNR3R42Tjs.main.call(void 0, ).catch(_chunkLDLF4CLAjs.handleError); | ||
_chunkND3IV4E3js.main.call(void 0, ).catch(_chunkJZ25TPTYjs.handleError); |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkJNR3R42Tjs = require('./chunk-JNR3R42T.js'); | ||
require('./chunk-PEPKMCEI.js'); | ||
require('./chunk-G22UJFQC.js'); | ||
var _chunkND3IV4E3js = require('./chunk-ND3IV4E3.js'); | ||
require('./chunk-AMCJ4M3V.js'); | ||
require('./chunk-TWFEYLU4.js'); | ||
exports.main = _chunkJNR3R42Tjs.main; | ||
exports.main = _chunkND3IV4E3js.main; |
#!/usr/bin/env node | ||
"use strict"; | ||
var _chunkJNR3R42Tjs = require('./chunk-JNR3R42T.js'); | ||
require('./chunk-PEPKMCEI.js'); | ||
var _chunkND3IV4E3js = require('./chunk-ND3IV4E3.js'); | ||
require('./chunk-AMCJ4M3V.js'); | ||
var _chunkLDLF4CLAjs = require('./chunk-LDLF4CLA.js'); | ||
require('./chunk-G22UJFQC.js'); | ||
var _chunkJZ25TPTYjs = require('./chunk-JZ25TPTY.js'); | ||
require('./chunk-TWFEYLU4.js'); | ||
// src/cli-node.ts | ||
_chunkJNR3R42Tjs.main.call(void 0, { | ||
_chunkND3IV4E3js.main.call(void 0, { | ||
skipNodeModulesBundle: true | ||
}).catch(_chunkLDLF4CLAjs.handleError); | ||
}).catch(_chunkJZ25TPTYjs.handleError); |
@@ -390,4 +390,4 @@ import { BuildOptions, Metafile, Plugin as Plugin$1, Loader } from 'esbuild'; | ||
type BrowserTargetWithVersion = `${BrowserTarget}${number}` | `${BrowserTarget}${number}.${number}` | `${BrowserTarget}${number}.${number}.${number}`; | ||
type EsTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'esnext'; | ||
type Target = BrowserTarget | BrowserTargetWithVersion | EsTarget; | ||
type EsTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'esnext'; | ||
type Target = BrowserTarget | BrowserTargetWithVersion | EsTarget | (string & {}); | ||
type Entry = string[] | Record<string, string>; | ||
@@ -394,0 +394,0 @@ /** |
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; | ||
var _chunkPEPKMCEIjs = require('./chunk-PEPKMCEI.js'); | ||
var _chunkAMCJ4M3Vjs = require('./chunk-AMCJ4M3V.js'); | ||
@@ -13,7 +13,7 @@ | ||
var _chunkIZXFC3VYjs = require('./chunk-IZXFC3VY.js'); | ||
var _chunkVGC3FXLUjs = require('./chunk-VGC3FXLU.js'); | ||
var _chunkLDLF4CLAjs = require('./chunk-LDLF4CLA.js'); | ||
var _chunkJZ25TPTYjs = require('./chunk-JZ25TPTY.js'); | ||
@@ -34,4 +34,5 @@ | ||
var _chunkG22UJFQCjs = require('./chunk-G22UJFQC.js'); | ||
var _chunkTWFEYLU4js = require('./chunk-TWFEYLU4.js'); | ||
// src/index.ts | ||
@@ -42,3 +43,3 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path); | ||
var _bundlerequire = require('bundle-require'); | ||
var _execa = require('execa'); var _execa2 = _interopRequireDefault(_execa); | ||
var _tinyexec = require('tinyexec'); | ||
var _tinyglobby = require('tinyglobby'); | ||
@@ -135,3 +136,3 @@ var _treekill = require('tree-kill'); var _treekill2 = _interopRequireDefault(_treekill); | ||
const getPostcssConfig = async () => { | ||
const loadConfig = _chunkG22UJFQCjs.__require.call(void 0, "postcss-load-config"); | ||
const loadConfig = _chunkTWFEYLU4js.__require.call(void 0, "postcss-load-config"); | ||
if (configCache) { | ||
@@ -198,3 +199,3 @@ return configCache; | ||
if (plugins && plugins.length > 0) { | ||
const postcss = _chunkG22UJFQCjs.getPostcss.call(void 0, ); | ||
const postcss = _chunkTWFEYLU4js.getPostcss.call(void 0, ); | ||
if (!postcss) { | ||
@@ -221,3 +222,3 @@ return { | ||
})).code; | ||
contents = typeof inject === "function" ? await Promise.resolve(inject(JSON.stringify(contents), args.path)) : `import styleInject from '#style-inject';styleInject(${JSON.stringify( | ||
contents = typeof inject === "function" ? await inject(JSON.stringify(contents), args.path) : `import styleInject from '#style-inject';styleInject(${JSON.stringify( | ||
contents | ||
@@ -262,4 +263,4 @@ )})`; | ||
build2.onLoad({ filter: /\.svelte$/ }, async (args) => { | ||
svelte = svelte || _chunkG22UJFQCjs.localRequire.call(void 0, "svelte/compiler"); | ||
sveltePreprocessor = sveltePreprocessor || _chunkG22UJFQCjs.localRequire.call(void 0, "svelte-preprocess"); | ||
svelte = svelte || _chunkTWFEYLU4js.localRequire.call(void 0, "svelte/compiler"); | ||
sveltePreprocessor = sveltePreprocessor || _chunkTWFEYLU4js.localRequire.call(void 0, "svelte-preprocess"); | ||
if (!svelte) { | ||
@@ -294,3 +295,3 @@ return { | ||
compilerOptions: { | ||
preserveValueImports: true | ||
verbatimModuleSyntax: true | ||
} | ||
@@ -307,3 +308,3 @@ } | ||
compilerOptions: { | ||
preserveValueImports: true | ||
verbatimModuleSyntax: true | ||
} | ||
@@ -348,3 +349,3 @@ }, | ||
setup(build2) { | ||
const swc = _chunkG22UJFQCjs.localRequire.call(void 0, "@swc/core"); | ||
const swc = _chunkTWFEYLU4js.localRequire.call(void 0, "@swc/core"); | ||
if (!swc) { | ||
@@ -403,3 +404,3 @@ logger3.warn( | ||
build2.onResolve({ filter: /\.node$/, namespace: "file" }, (args) => { | ||
const resolvedId = _chunkG22UJFQCjs.__require.resolve(args.path, { | ||
const resolvedId = _chunkTWFEYLU4js.__require.resolve(args.path, { | ||
paths: [args.resolveDir] | ||
@@ -443,4 +444,4 @@ }); | ||
var getOutputExtensionMap = (options, format, pkgType) => { | ||
const outExtension = options.outExtension || _chunkG22UJFQCjs.defaultOutExtension; | ||
const defaultExtension = _chunkG22UJFQCjs.defaultOutExtension.call(void 0, { format, pkgType }); | ||
const outExtension = options.outExtension || _chunkTWFEYLU4js.defaultOutExtension; | ||
const defaultExtension = _chunkTWFEYLU4js.defaultOutExtension.call(void 0, { format, pkgType }); | ||
const extension = outExtension({ options, format, pkgType }); | ||
@@ -459,3 +460,3 @@ return { | ||
const pkgPath = _path2.default.isAbsolute(item) ? _path2.default.dirname(item) : _path2.default.dirname(_path2.default.resolve(process.cwd(), item)); | ||
const deps = await _chunkIZXFC3VYjs.getProductionDeps.call(void 0, pkgPath); | ||
const deps = await _chunkVGC3FXLUjs.getProductionDeps.call(void 0, pkgPath); | ||
result.push(...deps); | ||
@@ -472,4 +473,4 @@ } | ||
}) { | ||
const pkg = await _chunkIZXFC3VYjs.loadPkg.call(void 0, process.cwd()); | ||
const deps = await _chunkIZXFC3VYjs.getProductionDeps.call(void 0, process.cwd()); | ||
const pkg = await _chunkVGC3FXLUjs.loadPkg.call(void 0, process.cwd()); | ||
const deps = await _chunkVGC3FXLUjs.getProductionDeps.call(void 0, process.cwd()); | ||
const external = [ | ||
@@ -570,3 +571,3 @@ // Exclude dependencies, e.g. `lodash`, `lodash/get` | ||
mainFields: platform === "node" ? ["module", "main"] : ["browser", "module", "main"], | ||
plugins: esbuildPlugins.filter(_chunkG22UJFQCjs.truthy), | ||
plugins: esbuildPlugins.filter(_chunkTWFEYLU4js.truthy), | ||
define: { | ||
@@ -609,3 +610,3 @@ TSUP_FORMAT: JSON.stringify(format), | ||
} | ||
if (result && result.warnings && !_chunkIZXFC3VYjs.getSilent.call(void 0, )) { | ||
if (result && result.warnings && !_chunkVGC3FXLUjs.getSilent.call(void 0, )) { | ||
const messages = result.warnings.filter((warning) => { | ||
@@ -758,3 +759,3 @@ if (warning.text.includes( | ||
if (isJS(file.path) || isCSS(file.path)) { | ||
const relativePath = _chunkG22UJFQCjs.slash.call(void 0, _path2.default.relative(process.cwd(), file.path)); | ||
const relativePath = _chunkTWFEYLU4js.slash.call(void 0, _path2.default.relative(process.cwd(), file.path)); | ||
const meta = _optionalChain([metafile, 'optionalAccess', _6 => _6.outputs, 'access', _7 => _7[relativePath]]); | ||
@@ -871,5 +872,5 @@ return { | ||
} | ||
const swc = _chunkG22UJFQCjs.localRequire.call(void 0, "@swc/core"); | ||
const swc = _chunkTWFEYLU4js.localRequire.call(void 0, "@swc/core"); | ||
if (!swc) { | ||
throw new (0, _chunkLDLF4CLAjs.PrettyError)( | ||
throw new (0, _chunkJZ25TPTYjs.PrettyError)( | ||
`@swc/core is required for ${target} target. Please install it with \`npm install @swc/core -D\`` | ||
@@ -911,3 +912,3 @@ ); | ||
buildEnd({ writtenFiles }) { | ||
_chunkIZXFC3VYjs.reportSize.call(void 0, | ||
_chunkVGC3FXLUjs.reportSize.call(void 0, | ||
this.logger, | ||
@@ -963,2 +964,3 @@ this.format, | ||
sourcemap: !!this.options.sourcemap, | ||
compact: !!this.options.minify, | ||
name | ||
@@ -986,6 +988,6 @@ }); | ||
if (!publicDir) return false; | ||
const publicPath = _chunkG22UJFQCjs.slash.call(void 0, | ||
const publicPath = _chunkTWFEYLU4js.slash.call(void 0, | ||
_path2.default.resolve(publicDir === true ? "public" : publicDir) | ||
); | ||
return _chunkG22UJFQCjs.slash.call(void 0, _path2.default.resolve(filePath)).startsWith(`${publicPath}/`); | ||
return _chunkTWFEYLU4js.slash.call(void 0, _path2.default.resolve(filePath)).startsWith(`${publicPath}/`); | ||
}; | ||
@@ -1006,5 +1008,5 @@ | ||
return; | ||
const terser = _chunkG22UJFQCjs.localRequire.call(void 0, "terser"); | ||
const terser = _chunkTWFEYLU4js.localRequire.call(void 0, "terser"); | ||
if (!terser) { | ||
throw new (0, _chunkLDLF4CLAjs.PrettyError)( | ||
throw new (0, _chunkJZ25TPTYjs.PrettyError)( | ||
"terser is required for terser minification. Please install it with `npm install terser -D`" | ||
@@ -1044,3 +1046,3 @@ ); | ||
var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript); | ||
var logger = _chunkIZXFC3VYjs.createLogger.call(void 0, ); | ||
var logger = _chunkVGC3FXLUjs.createLogger.call(void 0, ); | ||
var AliasPool = (_class = class {constructor() { _class.prototype.__init.call(this); } | ||
@@ -1069,3 +1071,3 @@ __init() {this.seen = /* @__PURE__ */ new Set()} | ||
const cwd = program.getCurrentDirectory(); | ||
sourceFileName = _chunkG22UJFQCjs.toAbsolutePath.call(void 0, sourceFileName, cwd); | ||
sourceFileName = _chunkTWFEYLU4js.toAbsolutePath.call(void 0, sourceFileName, cwd); | ||
const sourceFile = program.getSourceFile(sourceFileName); | ||
@@ -1108,4 +1110,4 @@ if (!sourceFile) { | ||
fileMapping.set( | ||
_chunkG22UJFQCjs.toAbsolutePath.call(void 0, sourceFileName, cwd), | ||
_chunkG22UJFQCjs.toAbsolutePath.call(void 0, fileName, cwd) | ||
_chunkTWFEYLU4js.toAbsolutePath.call(void 0, sourceFileName, cwd), | ||
_chunkTWFEYLU4js.toAbsolutePath.call(void 0, fileName, cwd) | ||
); | ||
@@ -1164,3 +1166,3 @@ } | ||
} | ||
const declarationDir = _chunkG22UJFQCjs.ensureTempDeclarationDir.call(void 0, ); | ||
const declarationDir = _chunkTWFEYLU4js.ensureTempDeclarationDir.call(void 0, ); | ||
const parsedTsconfig = _typescript2.default.parseJsonConfigFileContent( | ||
@@ -1171,2 +1173,3 @@ { | ||
..._optionalChain([rawTsconfig, 'access', _16 => _16.data, 'optionalAccess', _17 => _17.compilerOptions]), | ||
...compilerOptions, | ||
// Enable declaration emit and disable javascript emit | ||
@@ -1205,3 +1208,3 @@ noEmit: false, | ||
} catch (error) { | ||
_chunkLDLF4CLAjs.handleError.call(void 0, error); | ||
_chunkJZ25TPTYjs.handleError.call(void 0, error); | ||
logger.error("tsc", "Build error"); | ||
@@ -1219,3 +1222,3 @@ } | ||
(declaration) => formatAggregationExport(declaration, declarationDirPath) | ||
).filter(_chunkG22UJFQCjs.truthy); | ||
).filter(_chunkTWFEYLU4js.truthy); | ||
if (lines.length === 0) { | ||
@@ -1228,5 +1231,5 @@ lines.push("export {};"); | ||
function formatAggregationExport(declaration, declarationDirPath) { | ||
const dest = _chunkG22UJFQCjs.trimDtsExtension.call(void 0, | ||
const dest = _chunkTWFEYLU4js.replaceDtsWithJsExtensions.call(void 0, | ||
`./${_path2.default.posix.normalize( | ||
_chunkG22UJFQCjs.slash.call(void 0, _path2.default.relative(declarationDirPath, declaration.destFileName)) | ||
_chunkTWFEYLU4js.slash.call(void 0, _path2.default.relative(declarationDirPath, declaration.destFileName)) | ||
)}` | ||
@@ -1245,3 +1248,3 @@ ); | ||
`'${dest}';` | ||
].filter(_chunkG22UJFQCjs.truthy).join(" "); | ||
].filter(_chunkTWFEYLU4js.truthy).join(" "); | ||
} else { | ||
@@ -1252,6 +1255,6 @@ throw new Error("Unknown declaration"); | ||
function formatDistributionExports(exports, fromFilePath, toFilePath) { | ||
let importPath = _chunkG22UJFQCjs.trimDtsExtension.call(void 0, | ||
let importPath = _chunkTWFEYLU4js.replaceDtsWithJsExtensions.call(void 0, | ||
_path2.default.posix.relative( | ||
_path2.default.posix.dirname(_path2.default.posix.normalize(_chunkG22UJFQCjs.slash.call(void 0, fromFilePath))), | ||
_path2.default.posix.normalize(_chunkG22UJFQCjs.slash.call(void 0, toFilePath)) | ||
_path2.default.posix.dirname(_path2.default.posix.normalize(_chunkTWFEYLU4js.slash.call(void 0, fromFilePath))), | ||
_path2.default.posix.normalize(_chunkTWFEYLU4js.slash.call(void 0, toFilePath)) | ||
) | ||
@@ -1282,3 +1285,3 @@ ); | ||
} | ||
}).map((declaration) => formatDistributionExport(declaration, importPath)).filter(_chunkG22UJFQCjs.truthy); | ||
}).map((declaration) => formatDistributionExport(declaration, importPath)).filter(_chunkTWFEYLU4js.truthy); | ||
if (lines.length === 0) { | ||
@@ -1300,3 +1303,3 @@ lines.push("export {};"); | ||
`'${dest}';` | ||
].filter(_chunkG22UJFQCjs.truthy).join(" "); | ||
].filter(_chunkTWFEYLU4js.truthy).join(" "); | ||
} else if (declaration.kind === "module") { | ||
@@ -1309,3 +1312,3 @@ return `export * from '${declaration.moduleName}';`; | ||
// src/api-extractor.ts | ||
var logger2 = _chunkIZXFC3VYjs.createLogger.call(void 0, ); | ||
var logger2 = _chunkVGC3FXLUjs.createLogger.call(void 0, ); | ||
function rollupDtsFile(inputFilePath, outputFilePath, tsconfigFilePath) { | ||
@@ -1330,3 +1333,4 @@ const cwd = process.cwd(); | ||
}, | ||
projectFolder: cwd | ||
projectFolder: cwd, | ||
newlineKind: "lf" | ||
}; | ||
@@ -1338,3 +1342,3 @@ const prepareOptions = { | ||
}; | ||
const imported = _chunkG22UJFQCjs.getApiExtractor.call(void 0, ); | ||
const imported = _chunkTWFEYLU4js.getApiExtractor.call(void 0, ); | ||
if (!imported) { | ||
@@ -1360,6 +1364,10 @@ throw new Error( | ||
async function rollupDtsFiles(options, exports, format) { | ||
const declarationDir = _chunkG22UJFQCjs.ensureTempDeclarationDir.call(void 0, ); | ||
if (!options.experimentalDts || !_optionalChain([options, 'access', _18 => _18.experimentalDts, 'optionalAccess', _19 => _19.entry])) { | ||
return; | ||
} | ||
const declarationDir = _chunkTWFEYLU4js.ensureTempDeclarationDir.call(void 0, ); | ||
const outDir = options.outDir || "dist"; | ||
const pkg = await _chunkIZXFC3VYjs.loadPkg.call(void 0, process.cwd()); | ||
const dtsExtension = _chunkG22UJFQCjs.defaultOutExtension.call(void 0, { format, pkgType: pkg.type }).dts; | ||
const pkg = await _chunkVGC3FXLUjs.loadPkg.call(void 0, process.cwd()); | ||
const dtsExtension = _chunkTWFEYLU4js.defaultOutExtension.call(void 0, { format, pkgType: pkg.type }).dts; | ||
const tsconfig = options.tsconfig || "tsconfig.json"; | ||
let dtsInputFilePath = _path2.default.join( | ||
@@ -1371,15 +1379,11 @@ declarationDir, | ||
const dtsOutputFilePath = _path2.default.join(outDir, `_tsup-dts-rollup${dtsExtension}`); | ||
_chunkG22UJFQCjs.writeFileSync.call(void 0, | ||
_chunkTWFEYLU4js.writeFileSync.call(void 0, | ||
dtsInputFilePath, | ||
formatAggregationExports(exports, declarationDir) | ||
); | ||
rollupDtsFile( | ||
dtsInputFilePath, | ||
dtsOutputFilePath, | ||
options.tsconfig || "tsconfig.json" | ||
); | ||
rollupDtsFile(dtsInputFilePath, dtsOutputFilePath, tsconfig); | ||
for (let [out, sourceFileName] of Object.entries( | ||
options.experimentalDts.entry | ||
)) { | ||
sourceFileName = _chunkG22UJFQCjs.toAbsolutePath.call(void 0, sourceFileName); | ||
sourceFileName = _chunkTWFEYLU4js.toAbsolutePath.call(void 0, sourceFileName); | ||
const outFileName = _path2.default.join(outDir, out + dtsExtension); | ||
@@ -1389,3 +1393,3 @@ const currentExports = exports.filter( | ||
); | ||
_chunkG22UJFQCjs.writeFileSync.call(void 0, | ||
_chunkTWFEYLU4js.writeFileSync.call(void 0, | ||
outFileName, | ||
@@ -1398,3 +1402,3 @@ formatDistributionExports(currentExports, outFileName, dtsOutputFilePath) | ||
if (options.clean) { | ||
await _chunkG22UJFQCjs.removeFiles.call(void 0, ["**/*.d.{ts,mts,cts}"], options.outDir); | ||
await _chunkTWFEYLU4js.removeFiles.call(void 0, ["**/*.d.{ts,mts,cts}"], options.outDir); | ||
} | ||
@@ -1418,3 +1422,3 @@ } | ||
} catch (error) { | ||
_chunkLDLF4CLAjs.handleError.call(void 0, error); | ||
_chunkJZ25TPTYjs.handleError.call(void 0, error); | ||
logger2.error("dts", "Build error"); | ||
@@ -1429,3 +1433,3 @@ } | ||
renderChunk(code, info) { | ||
if (!this.options.cjsInterop || this.format !== "cjs" || info.type !== "chunk" || !/\.(js|cjs)$/.test(info.path) || !info.entryPoint || _optionalChain([info, 'access', _18 => _18.exports, 'optionalAccess', _19 => _19.length]) !== 1 || info.exports[0] !== "default") { | ||
if (!this.options.cjsInterop || this.format !== "cjs" || info.type !== "chunk" || !/\.(js|cjs)$/.test(info.path) || !info.entryPoint || _optionalChain([info, 'access', _20 => _20.exports, 'optionalAccess', _21 => _21.length]) !== 1 || info.exports[0] !== "default") { | ||
return; | ||
@@ -1465,13 +1469,10 @@ } | ||
dts: typeof _options.dts === "boolean" ? _options.dts ? {} : void 0 : typeof _options.dts === "string" ? { entry: _options.dts } : _options.dts, | ||
experimentalDts: _options.experimentalDts ? typeof _options.experimentalDts === "boolean" ? _options.experimentalDts ? { entry: {} } : void 0 : typeof _options.experimentalDts === "string" ? { | ||
entry: _chunkG22UJFQCjs.toObjectEntry.call(void 0, _options.experimentalDts) | ||
} : { | ||
..._options.experimentalDts, | ||
entry: _chunkG22UJFQCjs.toObjectEntry.call(void 0, _options.experimentalDts.entry || {}) | ||
} : void 0 | ||
experimentalDts: await _chunkTWFEYLU4js.resolveInitialExperimentalDtsConfig.call(void 0, | ||
_options.experimentalDts | ||
) | ||
}; | ||
_chunkIZXFC3VYjs.setSilent.call(void 0, options.silent); | ||
_chunkVGC3FXLUjs.setSilent.call(void 0, options.silent); | ||
const entry = options.entry || options.entryPoints; | ||
if (!entry || Object.keys(entry).length === 0) { | ||
throw new (0, _chunkLDLF4CLAjs.PrettyError)(`No input files, try "tsup <your-file>" instead`); | ||
throw new (0, _chunkJZ25TPTYjs.PrettyError)(`No input files, try "tsup <your-file>" instead`); | ||
} | ||
@@ -1481,3 +1482,3 @@ if (Array.isArray(entry)) { | ||
if (!options.entry || options.entry.length === 0) { | ||
throw new (0, _chunkLDLF4CLAjs.PrettyError)(`Cannot find ${entry}`); | ||
throw new (0, _chunkJZ25TPTYjs.PrettyError)(`Cannot find ${entry}`); | ||
} else { | ||
@@ -1490,3 +1491,3 @@ logger3.info("CLI", `Building entry: ${options.entry.join(", ")}`); | ||
if (!_fs2.default.existsSync(filename)) { | ||
throw new (0, _chunkLDLF4CLAjs.PrettyError)(`Cannot find ${alias}: ${filename}`); | ||
throw new (0, _chunkJZ25TPTYjs.PrettyError)(`Cannot find ${alias}: ${filename}`); | ||
} | ||
@@ -1504,4 +1505,4 @@ }); | ||
options.tsconfig = tsconfig.path; | ||
options.tsconfigResolvePaths = _optionalChain([tsconfig, 'access', _20 => _20.data, 'optionalAccess', _21 => _21.compilerOptions, 'optionalAccess', _22 => _22.paths]) || {}; | ||
options.tsconfigDecoratorMetadata = _optionalChain([tsconfig, 'access', _23 => _23.data, 'optionalAccess', _24 => _24.compilerOptions, 'optionalAccess', _25 => _25.emitDecoratorMetadata]); | ||
options.tsconfigResolvePaths = _optionalChain([tsconfig, 'access', _22 => _22.data, 'optionalAccess', _23 => _23.compilerOptions, 'optionalAccess', _24 => _24.paths]) || {}; | ||
options.tsconfigDecoratorMetadata = _optionalChain([tsconfig, 'access', _25 => _25.data, 'optionalAccess', _26 => _26.compilerOptions, 'optionalAccess', _27 => _27.emitDecoratorMetadata]); | ||
if (options.dts) { | ||
@@ -1514,15 +1515,12 @@ options.dts.compilerOptions = { | ||
if (options.experimentalDts) { | ||
options.experimentalDts.compilerOptions = { | ||
...tsconfig.data.compilerOptions || {}, | ||
...options.experimentalDts.compilerOptions || {} | ||
}; | ||
options.experimentalDts.entry = _chunkG22UJFQCjs.toObjectEntry.call(void 0, | ||
Object.keys(options.experimentalDts.entry).length > 0 ? options.experimentalDts.entry : options.entry | ||
options.experimentalDts = await _chunkTWFEYLU4js.resolveExperimentalDtsConfig.call(void 0, | ||
options, | ||
tsconfig | ||
); | ||
} | ||
if (!options.target) { | ||
options.target = _optionalChain([tsconfig, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.compilerOptions, 'optionalAccess', _28 => _28.target, 'optionalAccess', _29 => _29.toLowerCase, 'call', _30 => _30()]); | ||
options.target = _optionalChain([tsconfig, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.compilerOptions, 'optionalAccess', _30 => _30.target, 'optionalAccess', _31 => _31.toLowerCase, 'call', _32 => _32()]); | ||
} | ||
} else if (options.tsconfig) { | ||
throw new (0, _chunkLDLF4CLAjs.PrettyError)(`Cannot find tsconfig: ${options.tsconfig}`); | ||
throw new (0, _chunkJZ25TPTYjs.PrettyError)(`Cannot find tsconfig: ${options.tsconfig}`); | ||
} | ||
@@ -1535,3 +1533,3 @@ if (!options.target) { | ||
async function build(_options) { | ||
const config = _options.config === false ? {} : await _chunkIZXFC3VYjs.loadTsupConfig.call(void 0, | ||
const config = _options.config === false ? {} : await _chunkVGC3FXLUjs.loadTsupConfig.call(void 0, | ||
process.cwd(), | ||
@@ -1544,5 +1542,5 @@ _options.config === true ? void 0 : _options.config | ||
async (item) => { | ||
const logger3 = _chunkIZXFC3VYjs.createLogger.call(void 0, _optionalChain([item, 'optionalAccess', _31 => _31.name])); | ||
const logger3 = _chunkVGC3FXLUjs.createLogger.call(void 0, _optionalChain([item, 'optionalAccess', _33 => _33.name])); | ||
const options = await normalizeOptions(logger3, item, _options); | ||
logger3.info("CLI", `tsup v${_chunkPEPKMCEIjs.version}`); | ||
logger3.info("CLI", `tsup v${_chunkAMCJ4M3Vjs.version}`); | ||
if (config.path) { | ||
@@ -1575,3 +1573,3 @@ logger3.info("CLI", `Using tsup config: ${config.path}`); | ||
worker.postMessage({ | ||
configName: _optionalChain([item, 'optionalAccess', _32 => _32.name]), | ||
configName: _optionalChain([item, 'optionalAccess', _34 => _34.name]), | ||
options: { | ||
@@ -1594,3 +1592,3 @@ ...options, | ||
terminateWorker(); | ||
reject(new Error("error occured in dts build")); | ||
reject(new Error("error occurred in dts build")); | ||
} else if (data === "success") { | ||
@@ -1612,7 +1610,7 @@ terminateWorker(); | ||
const mainTasks = async () => { | ||
if (!_optionalChain([options, 'access', _33 => _33.dts, 'optionalAccess', _34 => _34.only])) { | ||
if (!_optionalChain([options, 'access', _35 => _35.dts, 'optionalAccess', _36 => _36.only])) { | ||
let onSuccessProcess; | ||
let onSuccessCleanup; | ||
const buildDependencies = /* @__PURE__ */ new Set(); | ||
let depsHash = await _chunkIZXFC3VYjs.getAllDepsHash.call(void 0, process.cwd()); | ||
let depsHash = await _chunkVGC3FXLUjs.getAllDepsHash.call(void 0, process.cwd()); | ||
const doOnSuccessCleanup = async () => { | ||
@@ -1630,3 +1628,3 @@ if (onSuccessProcess) { | ||
}; | ||
const debouncedBuildAll = _chunkG22UJFQCjs.debouncePromise.call(void 0, | ||
const debouncedBuildAll = _chunkTWFEYLU4js.debouncePromise.call(void 0, | ||
() => { | ||
@@ -1636,3 +1634,3 @@ return buildAll(); | ||
100, | ||
_chunkLDLF4CLAjs.handleError | ||
_chunkJZ25TPTYjs.handleError | ||
); | ||
@@ -1648,3 +1646,3 @@ const buildAll = async () => { | ||
} | ||
await _chunkG22UJFQCjs.removeFiles.call(void 0, ["**/*", ...extraPatterns], options.outDir); | ||
await _chunkTWFEYLU4js.removeFiles.call(void 0, ["**/*", ...extraPatterns], options.outDir); | ||
logger3.info("CLI", "Cleaning output folder"); | ||
@@ -1694,11 +1692,9 @@ } | ||
} else { | ||
onSuccessProcess = _execa2.default.call(void 0, options.onSuccess, { | ||
shell: true, | ||
stdio: "inherit" | ||
onSuccessProcess = _tinyexec.exec.call(void 0, options.onSuccess, [], { | ||
nodeOptions: { shell: true, stdio: "inherit" } | ||
}); | ||
onSuccessProcess.on("exit", (code) => { | ||
if (code && code !== 0) { | ||
process.exitCode = code; | ||
} | ||
}); | ||
await onSuccessProcess; | ||
if (onSuccessProcess.exitCode && onSuccessProcess.exitCode !== 0) { | ||
process.exitCode = onSuccessProcess.exitCode; | ||
} | ||
} | ||
@@ -1716,5 +1712,3 @@ } | ||
]; | ||
const watchPaths = typeof options.watch === "boolean" ? "." : Array.isArray(options.watch) ? options.watch.filter( | ||
(path12) => typeof path12 === "string" | ||
) : options.watch; | ||
const watchPaths = typeof options.watch === "boolean" ? "." : Array.isArray(options.watch) ? options.watch.filter((path12) => typeof path12 === "string") : options.watch; | ||
logger3.info( | ||
@@ -1728,9 +1722,9 @@ "CLI", | ||
); | ||
const watcher = watch(watchPaths, { | ||
const watcher = watch(await _tinyglobby.glob.call(void 0, watchPaths), { | ||
ignoreInitial: true, | ||
ignorePermissionErrors: true, | ||
ignored | ||
ignored: (p) => _tinyglobby.globSync.call(void 0, p, { ignore: ignored }).length === 0 | ||
}); | ||
watcher.on("all", async (type, file) => { | ||
file = _chunkG22UJFQCjs.slash.call(void 0, file); | ||
file = _chunkTWFEYLU4js.slash.call(void 0, file); | ||
if (options.publicDir && isInPublicDir(options.publicDir, file)) { | ||
@@ -1744,3 +1738,3 @@ logger3.info("CLI", `Change in public dir: ${file}`); | ||
if (file === "package.json" && !buildDependencies.has(file)) { | ||
const currentHash = await _chunkIZXFC3VYjs.getAllDepsHash.call(void 0, process.cwd()); | ||
const currentHash = await _chunkVGC3FXLUjs.getAllDepsHash.call(void 0, process.cwd()); | ||
shouldSkipChange = currentHash === depsHash; | ||
@@ -1747,0 +1741,0 @@ depsHash = currentHash; |
{ | ||
"name": "tsup", | ||
"version": "8.3.0", | ||
"packageManager": "pnpm@9.5.0", | ||
"version": "8.3.4", | ||
"description": "Bundle your TypeScript library with no config, powered by esbuild", | ||
@@ -9,2 +8,3 @@ "license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/egoist/tsup.git" | ||
@@ -24,11 +24,2 @@ }, | ||
}, | ||
"scripts": { | ||
"dev": "npm run build-fast -- --watch", | ||
"build": "tsup src/cli-*.ts src/index.ts src/rollup.ts --clean --splitting", | ||
"prepublishOnly": "npm run build", | ||
"test": "npm run build && npm run test-only", | ||
"format": "prettier --write .", | ||
"test-only": "vitest run", | ||
"build-fast": "npm run build -- --no-dts" | ||
}, | ||
"peerDependencies": { | ||
@@ -57,28 +48,27 @@ "@microsoft/api-extractor": "^7.36.0", | ||
"cac": "^6.7.14", | ||
"chokidar": "^3.6.0", | ||
"chokidar": "^4.0.1", | ||
"consola": "^3.2.3", | ||
"debug": "^4.3.5", | ||
"esbuild": "^0.23.0", | ||
"execa": "^5.1.1", | ||
"debug": "^4.3.7", | ||
"esbuild": "^0.24.0", | ||
"joycon": "^3.1.1", | ||
"picocolors": "^1.0.1", | ||
"picocolors": "^1.1.1", | ||
"postcss-load-config": "^6.0.1", | ||
"resolve-from": "^5.0.0", | ||
"rollup": "^4.19.0", | ||
"rollup": "^4.24.0", | ||
"source-map": "0.8.0-beta.0", | ||
"sucrase": "^3.35.0", | ||
"tinyglobby": "^0.2.1", | ||
"tinyexec": "^0.3.1", | ||
"tinyglobby": "^0.2.9", | ||
"tree-kill": "^1.2.2" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.47.2", | ||
"@microsoft/api-extractor": "^7.47.11", | ||
"@rollup/plugin-json": "6.1.0", | ||
"@swc/core": "1.7.0", | ||
"@swc/core": "1.7.39", | ||
"@types/debug": "4.1.12", | ||
"@types/fs-extra": "11.0.4", | ||
"@types/node": "20.14.11", | ||
"@types/node": "22.7.8", | ||
"@types/resolve": "1.20.6", | ||
"bumpp": "^9.7.1", | ||
"flat": "6.0.1", | ||
"fs-extra": "11.2.0", | ||
"postcss": "8.4.39", | ||
"postcss": "8.4.47", | ||
"postcss-simple-vars": "7.0.1", | ||
@@ -88,11 +78,11 @@ "prettier": "3.3.3", | ||
"rollup-plugin-dts": "6.1.1", | ||
"sass": "1.77.8", | ||
"sass": "1.80.3", | ||
"strip-json-comments": "5.0.1", | ||
"svelte": "3.49.0", | ||
"svelte-preprocess": "5.0.3", | ||
"terser": "^5.31.3", | ||
"ts-essentials": "10.0.1", | ||
"tsup": "8.2.1", | ||
"typescript": "5.5.3", | ||
"vitest": "2.0.3", | ||
"svelte-preprocess": "5.1.4", | ||
"terser": "^5.36.0", | ||
"ts-essentials": "10.0.2", | ||
"tsup": "8.3.0", | ||
"typescript": "5.6.3", | ||
"vitest": "2.1.3", | ||
"wait-for-expect": "3.0.2" | ||
@@ -102,3 +92,12 @@ }, | ||
"node": ">=18" | ||
}, | ||
"scripts": { | ||
"dev": "pnpm run build-fast -- --watch", | ||
"build": "tsup src/cli-*.ts src/index.ts src/rollup.ts --clean --splitting", | ||
"test": "pnpm run build && pnpm run test-only", | ||
"format": "prettier --write .", | ||
"test-only": "vitest run", | ||
"build-fast": "pnpm run build -- --no-dts", | ||
"release": "bumpp" | ||
} | ||
} | ||
} |
@@ -101,4 +101,12 @@ { | ||
"minify": { | ||
"type": "boolean", | ||
"description": "When enabled, the generated code will be minified instead of pretty-printed." | ||
"description": "When enabled, the generated code will be minified instead of pretty-printed.", | ||
"oneOf": [ | ||
{ | ||
"type": "boolean" | ||
}, | ||
{ | ||
"type": "string", | ||
"enum": ["terser"] | ||
} | ||
] | ||
}, | ||
@@ -329,3 +337,3 @@ "minifyWhitespace": { | ||
"default": "node", | ||
"enum": ["node", "browser"] | ||
"enum": ["node", "browser", "neutral"] | ||
}, | ||
@@ -332,0 +340,0 @@ "config": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
440144
23
11776
27
+ Addedtinyexec@^0.3.1
+ Added@esbuild/aix-ppc64@0.24.0(transitive)
+ Added@esbuild/android-arm@0.24.0(transitive)
+ Added@esbuild/android-arm64@0.24.0(transitive)
+ Added@esbuild/android-x64@0.24.0(transitive)
+ Added@esbuild/darwin-arm64@0.24.0(transitive)
+ Added@esbuild/darwin-x64@0.24.0(transitive)
+ Added@esbuild/freebsd-arm64@0.24.0(transitive)
+ Added@esbuild/freebsd-x64@0.24.0(transitive)
+ Added@esbuild/linux-arm@0.24.0(transitive)
+ Added@esbuild/linux-arm64@0.24.0(transitive)
+ Added@esbuild/linux-ia32@0.24.0(transitive)
+ Added@esbuild/linux-loong64@0.24.0(transitive)
+ Added@esbuild/linux-mips64el@0.24.0(transitive)
+ Added@esbuild/linux-ppc64@0.24.0(transitive)
+ Added@esbuild/linux-riscv64@0.24.0(transitive)
+ Added@esbuild/linux-s390x@0.24.0(transitive)
+ Added@esbuild/linux-x64@0.24.0(transitive)
+ Added@esbuild/netbsd-x64@0.24.0(transitive)
+ Added@esbuild/openbsd-arm64@0.24.0(transitive)
+ Added@esbuild/openbsd-x64@0.24.0(transitive)
+ Added@esbuild/sunos-x64@0.24.0(transitive)
+ Added@esbuild/win32-arm64@0.24.0(transitive)
+ Added@esbuild/win32-ia32@0.24.0(transitive)
+ Added@esbuild/win32-x64@0.24.0(transitive)
+ Addedchokidar@4.0.1(transitive)
+ Addedesbuild@0.24.0(transitive)
+ Addedreaddirp@4.0.2(transitive)
+ Addedtinyexec@0.3.1(transitive)
- Removedexeca@^5.1.1
- Removed@esbuild/aix-ppc64@0.23.1(transitive)
- Removed@esbuild/android-arm@0.23.1(transitive)
- Removed@esbuild/android-arm64@0.23.1(transitive)
- Removed@esbuild/android-x64@0.23.1(transitive)
- Removed@esbuild/darwin-arm64@0.23.1(transitive)
- Removed@esbuild/darwin-x64@0.23.1(transitive)
- Removed@esbuild/freebsd-arm64@0.23.1(transitive)
- Removed@esbuild/freebsd-x64@0.23.1(transitive)
- Removed@esbuild/linux-arm@0.23.1(transitive)
- Removed@esbuild/linux-arm64@0.23.1(transitive)
- Removed@esbuild/linux-ia32@0.23.1(transitive)
- Removed@esbuild/linux-loong64@0.23.1(transitive)
- Removed@esbuild/linux-mips64el@0.23.1(transitive)
- Removed@esbuild/linux-ppc64@0.23.1(transitive)
- Removed@esbuild/linux-riscv64@0.23.1(transitive)
- Removed@esbuild/linux-s390x@0.23.1(transitive)
- Removed@esbuild/linux-x64@0.23.1(transitive)
- Removed@esbuild/netbsd-x64@0.23.1(transitive)
- Removed@esbuild/openbsd-arm64@0.23.1(transitive)
- Removed@esbuild/openbsd-x64@0.23.1(transitive)
- Removed@esbuild/sunos-x64@0.23.1(transitive)
- Removed@esbuild/win32-arm64@0.23.1(transitive)
- Removed@esbuild/win32-ia32@0.23.1(transitive)
- Removed@esbuild/win32-x64@0.23.1(transitive)
- Removedanymatch@3.1.3(transitive)
- Removedbinary-extensions@2.3.0(transitive)
- Removedbraces@3.0.3(transitive)
- Removedchokidar@3.6.0(transitive)
- Removedesbuild@0.23.1(transitive)
- Removedexeca@5.1.1(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedget-stream@6.0.1(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedhuman-signals@2.1.0(transitive)
- Removedis-binary-path@2.1.0(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedmerge-stream@2.0.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removednpm-run-path@4.0.1(transitive)
- Removedonetime@5.1.2(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedreaddirp@3.6.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-final-newline@2.0.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
Updatedchokidar@^4.0.1
Updateddebug@^4.3.7
Updatedesbuild@^0.24.0
Updatedpicocolors@^1.1.1
Updatedrollup@^4.24.0
Updatedtinyglobby@^0.2.9