Skip to content

Commit d8c8771

Browse files
[core] Update release docs and scripts (#1245)
Co-authored-by: Michał Dudak <[email protected]>
1 parent 8c80f79 commit d8c8771

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "rimraf ./export && cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=8192 next build",
99
"build:clean": "rimraf .next && pnpm build",
1010
"dev": "next dev --port 3005",
11-
"deploy": "git push -f material-ui-docs master:latest",
11+
"deploy": "git push -f upstream master:docs-v1",
1212
"serve": "serve ./export -l 3010",
1313
"typescript": "tsc -b tsconfig.json",
1414
"link-check": "tsx ./scripts/reportBrokenLinks.mts"

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@
6565
},
6666
"type": "commonjs",
6767
"scripts": {
68+
"prebuild": "rimraf --glob build build-tests \"*.tsbuildinfo\"",
6869
"build": "pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files && pnpm build:manifest",
6970
"build:node": "node ../../scripts/build.mjs node",
7071
"build:stable": "node ../../scripts/build.mjs stable",
72+
"build:types": "tsx ../../scripts/buildTypes.mts --project tsconfig.build.json --copy build/cjs",
7173
"build:copy-files": "node ../../scripts/copyFiles.mjs ./.npmignore:./.npmignore",
72-
"build:types": "tsx ../../scripts/buildTypes.mjs --project tsconfig.build.json --copy build/cjs",
7374
"build:manifest": "tsx ./scripts/createPackageManifest.mts",
7475
"test:package": "publint ./build && attw --pack ./build",
75-
"prebuild": "rimraf --glob build build-tests \"*.tsbuildinfo\"",
7676
"release": "pnpm build && pnpm publish",
7777
"test": "cross-env NODE_ENV=test VITEST_ENV=jsdom vitest",
7878
"typescript": "tsc -b tsconfig.json"

scripts/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A typical release goes like this:
1717
- Set **Public Repositories (read-only)** in Repository access.
1818
- Organization permissions are not required.
1919

20-
### Prepare
20+
### Prepare the release of the packages
2121

2222
1. Generate the changelog with `pnpm release:changelog`
2323
The output must be prepended to the top level `CHANGELOG.md`
@@ -30,23 +30,24 @@ A typical release goes like this:
3030
6. Open a PR with changes and wait for review and green CI.
3131
7. Merge the PR once the CI is green and it has been approved.
3232

33-
### Release
33+
### Release the packages
3434

3535
1. Checkout the last version of the release branch.
3636
2. `pnpm install && pnpm release:build` (make sure you have the latest dependencies installed, and build the packages).
3737
3. `pnpm release:publish` (release the versions on npm, you need your 2FA device).
3838
4. `pnpm release:tag` (push the newly created tag).
3939

40+
> Tip: You can use `release:publish:dry-run` to test the release process without actually publishing the packages.
41+
> Make sure to have [verdaccio](https://verdaccio.org/) (local npm registry) installed before doing it.
42+
4043
### Publish the documentation
4144

4245
The documentation must be updated on the `docs-vX` branch (`docs-v1` for `v1.X` releases, `docs-v2` for `v2.X` releases, etc.)
4346

44-
Push the working branch to the documentation release branch to deploy the documentation with the latest changes.
45-
46-
<!-- #default-branch-switch -->
47+
Push the working branch to the documentation release branch to deploy the documentation with the latest changes:
4748

4849
```bash
49-
git push -f upstream master:docs-v1
50+
pnpm docs:deploy
5051
```
5152

5253
You can follow the deployment process [on the Netlify Dashboard](https://app.netlify.com/sites/base-ui/deploys?filter=docs-v1)

scripts/copyFiles.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable no-console */
22
import path from 'path';
3-
import fse from 'fs-extra';
3+
import fs from 'fs/promises';
44
import { includeFileInBuild, prepend, typescriptCopy } from './copyFilesUtils.mjs';
55

66
const packagePath = process.cwd();
@@ -44,7 +44,7 @@ async function run() {
4444
}),
4545
);
4646

47-
const packageFile = await fse.readFile(path.resolve(packagePath, './package.json'), 'utf8');
47+
const packageFile = await fs.readFile(path.resolve(packagePath, './package.json'), 'utf8');
4848
const packageData = JSON.parse(packageFile);
4949
await addLicense(packageData);
5050
} catch (err) {

0 commit comments

Comments
 (0)