Um TanStack Config programmatisch zu verwenden, können Sie die Funktion publish importieren
import { publish } from '@tanstack/config/publish'
// OR
import { publish } from '@tanstack/publish-config'
publish({
branchConfigs: configOpts.branchConfigs,
packages: configOpts.packages,
rootDir: configOpts.rootDir,
branch: process.env.BRANCH,
tag: process.env.TAG,
ghToken: process.env.GH_TOKEN,
})
.then(() => {
console.log('Successfully published packages!')
})
.catch(console.error)
import { publish } from '@tanstack/config/publish'
// OR
import { publish } from '@tanstack/publish-config'
publish({
branchConfigs: configOpts.branchConfigs,
packages: configOpts.packages,
rootDir: configOpts.rootDir,
branch: process.env.BRANCH,
tag: process.env.TAG,
ghToken: process.env.GH_TOKEN,
})
.then(() => {
console.log('Successfully published packages!')
})
.catch(console.error)
Die programmatische Verwendung ist nur für ESM-Pakete verfügbar. Um dies zu unterstützen, müssen Sie
json{ "type": "module" }{ "type": "module" }in Ihrer package.json-Datei haben und import anstelle von require verwenden.
Ihre wöchentliche Dosis JavaScript-Nachrichten. Jeden Montag kostenlos an über 100.000 Entwickler geliefert.