Skip to content

[core] Update release docs and scripts #1245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "rimraf ./export && cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=8192 next build",
"build:clean": "rimraf .next && pnpm build",
"dev": "next dev --port 3005",
"deploy": "git push -f material-ui-docs master:latest",
"deploy": "git push -f upstream master:docs-v1",
"serve": "serve ./export -l 3010",
"typescript": "tsc -b tsconfig.json",
"link-check": "tsx ./scripts/reportBrokenLinks.mts"
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
},
"type": "commonjs",
"scripts": {
"prebuild": "rimraf --glob build build-tests \"*.tsbuildinfo\"",
"build": "pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files && pnpm build:manifest",
"build:node": "node ../../scripts/build.mjs node",
"build:stable": "node ../../scripts/build.mjs stable",
"build:types": "tsx ../../scripts/buildTypes.mts --project tsconfig.build.json --copy build/cjs",
"build:copy-files": "node ../../scripts/copyFiles.mjs ./.npmignore:./.npmignore",
"build:types": "tsx ../../scripts/buildTypes.mjs --project tsconfig.build.json --copy build/cjs",
Copy link
Member Author

@oliviertassinari oliviertassinari Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file extension was wrong buildTypes.mjs -> buildTypes.mts. I'm amazed it still worked.

"build:manifest": "tsx ./scripts/createPackageManifest.mts",
"test:package": "publint ./build && attw --pack ./build",
"prebuild": "rimraf --glob build build-tests \"*.tsbuildinfo\"",
"release": "pnpm build && pnpm publish",
"test": "cross-env NODE_ENV=test VITEST_ENV=jsdom vitest",
"typescript": "tsc -b tsconfig.json"
Expand Down
13 changes: 7 additions & 6 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ A typical release goes like this:
- Set **Public Repositories (read-only)** in Repository access.
- Organization permissions are not required.

### Prepare
### Prepare the release of the packages

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

### Release
### Release the packages

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

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

### Publish the documentation

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

Push the working branch to the documentation release branch to deploy the documentation with the latest changes.

<!-- #default-branch-switch -->
Push the working branch to the documentation release branch to deploy the documentation with the latest changes:

```bash
git push -f upstream master:docs-v1
pnpm docs:deploy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes this resilient to docs versioning. We struggled a bit with this on X.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need for the default-branch-switch comment anymore after this change

```

You can follow the deployment process [on the Netlify Dashboard](https://app.netlify.com/sites/base-ui/deploys?filter=docs-v1)
Expand Down
4 changes: 2 additions & 2 deletions scripts/copyFiles.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-console */
import path from 'path';
import fse from 'fs-extra';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to use fs-extra anymore, we should remove it from the codebase.

import fs from 'fs/promises';
import { includeFileInBuild, prepend, typescriptCopy } from './copyFilesUtils.mjs';

const packagePath = process.cwd();
Expand Down Expand Up @@ -44,7 +44,7 @@ async function run() {
}),
);

const packageFile = await fse.readFile(path.resolve(packagePath, './package.json'), 'utf8');
const packageFile = await fs.readFile(path.resolve(packagePath, './package.json'), 'utf8');
const packageData = JSON.parse(packageFile);
await addLicense(packageData);
} catch (err) {
Expand Down