Conversation
b644fad to
d5b94d7
Compare
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "bootstrap-sha": "aea34d80b48583f36894eae89de0b90581201c6b", | ||
| "last-release-sha": "aea34d80b48583f36894eae89de0b90581201c6b", |
There was a problem hiding this comment.
last-release-sha only needed for very first publish - will need to remove this later
| // No package has its own LICENSE - lerna copied the root one into each package | ||
| // directory for the duration of the pack, so every published tarball has one. | ||
| // Keep doing that: npm includes LICENSE regardless of `files`/.npmignore. | ||
| function withRootLicenses(packages) { | ||
| const source = path.join(rootPath, `LICENSE`) | ||
| const copied = packages | ||
| .map(pkg => path.join(pkg.location, `LICENSE`)) | ||
| .filter(target => !fs.existsSync(target)) | ||
|
|
||
| copied.forEach(target => fs.copyFileSync(source, target)) | ||
|
|
||
| return () => copied.forEach(target => fs.rmSync(target, { force: true })) | ||
| } |
There was a problem hiding this comment.
this preserve handling that lerna publish was doing automatically. Without it move to npm publish would stop including LICENSE in released packages
| async function isPublished({ name, version }, attempt = 1) { | ||
| try { | ||
| const { stdout } = await run(`npm`, [ | ||
| `view`, | ||
| `${name}@${version}`, | ||
| `version`, | ||
| ]) | ||
| // Some npm versions answer an unknown version with an empty success | ||
| // rather than an error | ||
| return stdout.trim() !== `` | ||
| } catch (error) { | ||
| const output = `${error.stdout || ``}${error.stderr || ``}` | ||
| const isMissing = | ||
| output.includes(`E404`) || | ||
| output.includes(`No match found`) || | ||
| output.includes(`is not in this registry`) | ||
|
|
||
| if (isMissing) { | ||
| return false | ||
| } | ||
| if (attempt < REGISTRY_ATTEMPTS) { | ||
| console.log(` ${name}@${version}: lookup failed, retrying (${attempt})`) | ||
| await delay(attempt * 1000) | ||
| return isPublished({ name, version }, attempt + 1) | ||
| } | ||
| throw new Error( | ||
| `Could not determine whether ${name}@${version} is published:\n${output}` | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
This is replacement for lerna's --from-package (skip trying to publish version that already is on npm)
|
|
||
| # changelogs are generated by release-please, which formats them its own way | ||
| packages/*/CHANGELOG.md |
There was a problem hiding this comment.
CHANGELOG.md additions produced by release-please fail prettier, but as they are generated and not hand-written, it seems best to avoid linting them (instead of trying to format them after release-please which gets complicated and the more straight forward setup is the better)
d5b94d7 to
79d0ad6
Compare
79d0ad6 to
a781c98
Compare
Description
Relies on #39684
Documentation
Tests
Related Issues