@automattic/vip 4.0.13 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/RELEASING.md +9 -3
- package/helpers/sync-shrinkwrap.js +32 -0
- package/npm-shrinkwrap.json +15470 -0
- package/package.json +5 -2
package/docs/RELEASING.md
CHANGED
|
@@ -76,6 +76,12 @@ You can release either using GitHub Actions or locally.
|
|
|
76
76
|
|
|
77
77
|
This is the preferred method for pushing out the latest release. The workflow runs a bunch of validations, generates a build, bump versions + tags, pushes out to npm, and bumps to the next dev version.
|
|
78
78
|
|
|
79
|
+
The repository uses `package-lock.json` for npm 12 development and CI installs. An identical
|
|
80
|
+
`npm-shrinkwrap.json` is published with npm 11 so npm 11 and older consumers retain a locked CLI
|
|
81
|
+
dependency tree. Run `npm run sync:shrinkwrap` after changing `package-lock.json`; CI rejects drift
|
|
82
|
+
between the two files. The publish workflows intentionally use npm 11 because npm 12 excludes
|
|
83
|
+
`npm-shrinkwrap.json` from package tarballs.
|
|
84
|
+
|
|
79
85
|
Please keep in mind internal guidelines before releasing.
|
|
80
86
|
|
|
81
87
|
To release, follow these steps:
|
|
@@ -119,7 +125,7 @@ To publish locally, follow these steps:
|
|
|
119
125
|
1. Push the tag to GitHub (`git push --tags`)
|
|
120
126
|
1. Push the trunk branch `git push`
|
|
121
127
|
1. Make sure you're part of the Automattic organization in npm
|
|
122
|
-
1.
|
|
128
|
+
1. Use npm 11 and publish the release (`npx --yes --package=npm@11 npm publish --access public`). The script will do some extra checks (
|
|
123
129
|
node version, branch, etc) to ensure everything is correct. If all looks good, the new version
|
|
124
130
|
will be published and you can proceed.
|
|
125
131
|
1. Edit [the release on GitHub](https://github.com/Automattic/vip-cli/releases) to include a description
|
|
@@ -137,8 +143,8 @@ In order to do that, please follow this:
|
|
|
137
143
|
|
|
138
144
|
<summary><details>
|
|
139
145
|
|
|
140
|
-
1.
|
|
141
|
-
1. Run `npm publish --tag next` (When `--tag` is specified, we bypass the usual branch protection that doesn't allow you to publish form a brunch other than `trunk`).
|
|
146
|
+
1. Set the dev version with npm 11 so both lockfiles remain synchronized. Example: `npx --yes --package=npm@11 npm version --no-git-tag-version 1.4.0-dev1`.
|
|
147
|
+
1. Run `npx --yes --package=npm@11 npm publish --tag next` (When `--tag` is specified, we bypass the usual branch protection that doesn't allow you to publish form a brunch other than `trunk`).
|
|
142
148
|
|
|
143
149
|
You can repeat this with every new version until you're happy with your version and ready to a public release. We currently don't support multiple branches for multiple versions. When it's the case, this process needs to be done for every version in every branch.
|
|
144
150
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const { copyFileSync, readFileSync } = require( 'node:fs' );
|
|
2
|
+
const path = require( 'node:path' );
|
|
3
|
+
|
|
4
|
+
const PACKAGE_LOCK = 'package-lock.json';
|
|
5
|
+
const NPM_SHRINKWRAP = 'npm-shrinkwrap.json';
|
|
6
|
+
|
|
7
|
+
function syncShrinkwrap( { cwd = process.cwd(), check = false } = {} ) {
|
|
8
|
+
const packageLockPath = path.join( cwd, PACKAGE_LOCK );
|
|
9
|
+
const shrinkwrapPath = path.join( cwd, NPM_SHRINKWRAP );
|
|
10
|
+
|
|
11
|
+
if ( check ) {
|
|
12
|
+
const packageLock = readFileSync( packageLockPath );
|
|
13
|
+
const shrinkwrap = readFileSync( shrinkwrapPath );
|
|
14
|
+
if ( ! packageLock.equals( shrinkwrap ) ) {
|
|
15
|
+
throw new Error( `${ NPM_SHRINKWRAP } is out of sync with ${ PACKAGE_LOCK }` );
|
|
16
|
+
}
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
copyFileSync( packageLockPath, shrinkwrapPath );
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if ( require.main === module ) {
|
|
24
|
+
try {
|
|
25
|
+
syncShrinkwrap( { check: process.argv.includes( '--check' ) } );
|
|
26
|
+
} catch ( error ) {
|
|
27
|
+
console.error( error.message );
|
|
28
|
+
process.exitCode = 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
module.exports = { syncShrinkwrap };
|