initial commit
Some checks failed
CodeQL / Analyze (push) Failing after 1m32s

This commit is contained in:
Ludwig Lehnert
2026-01-11 11:08:48 +01:00
commit 0efd3d954b
58 changed files with 19390 additions and 0 deletions

58
tsup.config.ts Normal file
View File

@@ -0,0 +1,58 @@
import { defineConfig } from 'tsup'
import * as preset from 'tsup-preset-solid'
const preset_options: preset.PresetOptions = {
// array or single object
entries: [
// default entry (index)
{
// entries with '.tsx' extension will have `solid` export condition generated
entry: 'src/index.ts',
// will generate a separate development entry
dev_entry: true,
},
],
// Set to `true` to remove all `console.*` calls and `debugger` statements in prod builds
drop_console: true,
// Set to `true` to generate a CommonJS build alongside ESM
// cjs: true,
}
const CI =
process.env['CI'] === 'true' ||
process.env['GITHUB_ACTIONS'] === 'true' ||
process.env['CI'] === '"1"' ||
process.env['GITHUB_ACTIONS'] === '"1"'
export default defineConfig(config => {
const watching = !!config.watch
const parsed_options = preset.parsePresetOptions(preset_options, watching)
if (!watching && !CI) {
const package_fields = preset.generatePackageExports(parsed_options)
const export_keys = Object.keys(package_fields.exports || {})
const is_condition_exports = export_keys.length > 0 && export_keys.every(key => !key.startsWith('.'))
if (is_condition_exports) {
package_fields.exports = {
'.': package_fields.exports,
'./styles/*': './dist/styles/*',
}
} else {
package_fields.exports = {
...package_fields.exports,
'./styles/*': './dist/styles/*',
}
}
console.log(`package.json: \n\n${JSON.stringify(package_fields, null, 2)}\n\n`)
// will update ./package.json with the correct export fields
preset.writePackageJson(package_fields)
}
return preset.generateTsupOptions(parsed_options).map(opts => ({
...opts,
// minify: !watching,
}));
})