mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-05 22:19:46 -06:00
* chore: Add dtslint and Cypress static types * chore: Fix types location for cli build * chore: Removed api from api command paths * chore: Remove semicolons from type definitions * chore: Removed semicolons not caught by tslint * chore: Add type tests
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
const _ = require('lodash')
|
|
const path = require('path')
|
|
|
|
const fs = require('../lib/fs')
|
|
|
|
// grab the current version from the root monorepo package.json
|
|
const {
|
|
version,
|
|
description,
|
|
author,
|
|
homepage,
|
|
license,
|
|
bugs,
|
|
repository,
|
|
engines,
|
|
} = require('@packages/root')
|
|
|
|
const packageJsonSrc = path.join('package.json')
|
|
const packageJsonDest = path.join('build', 'package.json')
|
|
|
|
function preparePackageForNpmRelease (json) {
|
|
// modify the existing package.json
|
|
// to prepare it for releasing to npm
|
|
delete json.devDependencies
|
|
delete json['private']
|
|
|
|
_.extend(json, {
|
|
version,
|
|
description,
|
|
author,
|
|
homepage,
|
|
license,
|
|
bugs,
|
|
repository,
|
|
engines,
|
|
types: 'types', // typescript types
|
|
scripts: {
|
|
postinstall: 'node index.js --exec install',
|
|
size: 't=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";',
|
|
},
|
|
})
|
|
|
|
return json
|
|
}
|
|
|
|
fs.readJsonAsync(packageJsonSrc)
|
|
.then(preparePackageForNpmRelease)
|
|
.then((json) => {
|
|
return fs.outputJsonAsync(packageJsonDest, json, {
|
|
spaces: 2,
|
|
})
|
|
})
|