MCPcopy Create free account
hub / github.com/formkit/formkit / updateFKCoreVersionExport

Function updateFKCoreVersionExport

scripts/utils.mjs:378–398  ·  view source on GitHub ↗
(newVersion)

Source from the content-addressed store, hash-verified

376 * version that is about to be published
377 */
378export function updateFKCoreVersionExport(newVersion) {
379 const fileNames = ['index.cjs', 'index.d.cts', 'index.mjs']
380 const coreBuiltFiles = {}
381 fileNames.forEach((fileName) => {
382 coreBuiltFiles[fileName] = fs.readFileSync(
383 `${packagesDir}/core/dist/${fileName}`,
384 'utf8'
385 )
386 })
387 Object.keys(coreBuiltFiles).forEach((fileName) => {
388 coreBuiltFiles[fileName] = coreBuiltFiles[fileName].replace(
389 '__FKV__',
390 newVersion
391 )
392 fs.writeFileSync(
393 `${packagesDir}/core/dist/${fileName}`,
394 coreBuiltFiles[fileName],
395 { encoding: 'utf8' }
396 )
397 })
398}
399
400/**
401 * Get all the inputs declared in the inputs/index.ts file.

Callers 4

preparePublishFunction · 0.90
ciPublishFunction · 0.90
publishPackagesFunction · 0.90
publishPackagesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected