Expose the new type definition along with the current one (#1440)

This commit is contained in:
Tomas Della Vedova
2021-04-07 14:08:18 +02:00
committed by delvedor
parent cba4affb82
commit e198511327
20 changed files with 4505 additions and 594 deletions

View File

@ -30,6 +30,7 @@ async function release (opts) {
const originalName = packageJson.name
const originalVersion = packageJson.version
const currentCanaryVersion = packageJson.versionCanary
const originalTypes = packageJson.types
const originalNpmIgnore = await readFile(join(__dirname, '..', '.npmignore'), 'utf8')
const newCanaryInteger = opts.reset ? 1 : (Number(currentCanaryVersion.split('-')[1].split('.')[1]) + 1)
@ -39,12 +40,13 @@ async function release (opts) {
packageJson.name = '@elastic/elasticsearch-canary'
packageJson.version = newCanaryVersion
packageJson.versionCanary = newCanaryVersion
packageJson.types = './api/new.d.ts'
packageJson.commitHash = execSync('git log -1 --pretty=format:%h').toString()
// update the package.json
await writeFile(
join(__dirname, '..', 'package.json'),
JSON.stringify(packageJson, null, 2),
JSON.stringify(packageJson, null, 2) + '\n',
'utf8'
)
@ -72,11 +74,12 @@ async function release (opts) {
// restore the package.json to the original values
packageJson.name = originalName
packageJson.version = originalVersion
packageJson.types = originalTypes
delete packageJson.commitHash
await writeFile(
join(__dirname, '..', 'package.json'),
JSON.stringify(packageJson, null, 2),
JSON.stringify(packageJson, null, 2) + '\n',
'utf8'
)