Skip to content
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

Init Changelog Sync Script #5776

Merged
merged 33 commits into from
Feb 2, 2023
Merged

Init Changelog Sync Script #5776

merged 33 commits into from
Feb 2, 2023

Conversation

spacesailor24
Copy link
Contributor

@spacesailor24 spacesailor24 commented Jan 25, 2023

Supersedes #5769 and closes #5451

What This PR Does

This PR introduces the script-pseudo-package changelog (found under scripts/changelog). It currently supports the following commands:

  • sync: Takes the changes from the ## [Unreleased] sections of each package's CHANGELOG.md and adds it to the root CHANGELOG.md

The following commands will add an entry to a specific package's CHANGELOG.md under the provided header:

  • added
  • changed
  • deprecated
  • removed
  • fixed
  • security

Any other command will display the help table;

Invalid command, please refer to below table for expected commands:
┌─────────┬──────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────────┬────────────────────────────────────────────────────────────┬───────────────────────────────┐
│ (index) │     name     │                                             description                                             │              arguments              │                          example                           │        commandFunction        │
├─────────┼──────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────────┼────────────────────────────────────────────────────────────┼───────────────────────────────┤
│    0    │    'sync''Checks CHANGELOG.md for each package in ./packages/ for entries not included in root CHANGELOG.md' │                 []                  │                           'sync'                           │  [Function: syncChangelogs]   │
│    1    │   'added'"Adds changelogEntry to packageName's CHANGELOG.md under Added header"                │ [ 'packageName', 'changelogEntry' ] │   'yarn changelog added [packageName] [changelogEntry]'    │ [Function: addChangelogEntry] │
│    2    │  'changed'"Adds changelogEntry to packageName's CHANGELOG.md under Changed header"               │ [ 'packageName', 'changelogEntry' ] │  'yarn changelog changed [packageName] [changelogEntry]'   │ [Function: addChangelogEntry] │
│    3    │ 'deprecated'"Adds changelogEntry to packageName's CHANGELOG.md under Deprecated header"             │ [ 'packageName', 'changelogEntry' ] │ 'yarn changelog deprecated [packageName] [changelogEntry]' │ [Function: addChangelogEntry] │
│    4    │  'removed'"Adds changelogEntry to packageName's CHANGELOG.md under Removed header"               │ [ 'packageName', 'changelogEntry' ] │  'yarn changelog removed [packageName] [changelogEntry]'   │ [Function: addChangelogEntry] │
│    5    │   'fixed'"Adds changelogEntry to packageName's CHANGELOG.md under Fixed header"                │ [ 'packageName', 'changelogEntry' ] │   'yarn changelog fixed [packageName] [changelogEntry]'    │ [Function: addChangelogEntry] │
│    6    │  'security'"Adds changelogEntry to packageName's CHANGELOG.md under Security header"              │ [ 'packageName', 'changelogEntry' ] │  'yarn changelog security [packageName] [changelogEntry]'  │ [Function: addChangelogEntry] │
└─────────┴──────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────┴────────────────────────────────────────────────────────────┴───────────────────────────────┘

Usage

To use the script, in the project root, run yarn changelog <command> <arguments> e.g.:

  • yarn changelog sync
  • yarn changelog added web3 "I added this change (#1234)"
  • yarn changelog removed web3 "I removed something (#1235)"

@spacesailor24 spacesailor24 added the 4.x 4.0 related label Jan 25, 2023
@spacesailor24 spacesailor24 self-assigned this Jan 25, 2023
Comment on lines +1140 to +1143
### Added

#### web3-core

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ran yarn changelog sync to make this change as current 4.x CHANGELOG.md is missing these headers

image

bool
)
{
function getValues() public view returns (uint256, string memory, bool) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These file changes are a result of running yarn format

@@ -3,29 +3,29 @@
pragma solidity ^0.8.13;

contract Greeter {
uint256 counter;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These file changes are a result of running yarn format

Comment on lines +26 to +27
id,
sub,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This error was reported after running yarn lint:fix

@@ -18,17 +18,16 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.8.7;

contract SampleStorageContract {
uint256 uintNum;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These file changes are a result of running yarn format

@@ -28,7 +28,7 @@ import { isAbiParameterSchema } from './validation/abi';
import { isHexStrict } from './validation/string';
// import { abiToJsonSchemaCases } from '../test/fixtures/abi_to_json_schema';

export const parseBaseType = <T = typeof VALID_ETH_BASE_TYPES[number]>(
export const parseBaseType = <T = (typeof VALID_ETH_BASE_TYPES)[number]>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These file changes are a result of running yarn format

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 25, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: bb5afb8
Status: ✅  Deploy successful!
Preview URL: https://94d75eff.web3-js-docs.pages.dev
Branch Preview URL: https://wyatt-4-x-5451-refactor.web3-js-docs.pages.dev

View logs

@github-actions github-actions bot temporarily deployed to Preview: (wyatt/4.x/5451-refactor) January 26, 2023 05:52 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (wyatt/4.x/5451-refactor) January 26, 2023 05:52 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (wyatt/4.x/5451-refactor) January 26, 2023 08:25 Inactive
@github-actions github-actions bot temporarily deployed to Preview: (wyatt/4.x/5451-refactor) January 26, 2023 08:25 Inactive
@spacesailor24 spacesailor24 marked this pull request as ready for review January 26, 2023 08:25
@github-actions github-actions bot temporarily deployed to Preview: (wyatt/4.x/5451-refactor) February 1, 2023 17:44 Inactive
@github-actions
Copy link

github-actions bot commented Feb 2, 2023

Bundle Stats

Hey there, this message comes from a github action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Asset Old size New size Diff Diff %
Total 1.18 MB 1.18 MB 0 0.00%
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset Old size New size Diff Diff %
web3.min.js 1.17 MB 1.17 MB 0 0.00%
../lib/accounts.d.ts 3.42 KB 3.42 KB 0 0.00%
../lib/types.d.ts 1.92 KB 1.92 KB 0 0.00%
../lib/types.d.ts.map 1.75 KB 1.75 KB 0 0.00%
../lib/abi.d.ts 1020 bytes 1020 bytes 0 0.00%
../lib/web3.d.ts 842 bytes 842 bytes 0 0.00%
../lib/web3.d.ts.map 693 bytes 693 bytes 0 0.00%
../lib/accounts.d.ts.map 528 bytes 528 bytes 0 0.00%
../lib/index.d.ts.map 155 bytes 155 bytes 0 0.00%
../lib/version.d.ts.map 140 bytes 140 bytes 0 0.00%
../lib/abi.d.ts.map 124 bytes 124 bytes 0 0.00%
../lib/version.d.ts 97 bytes 97 bytes 0 0.00%
../lib/index.d.ts 77 bytes 77 bytes 0 0.00%

@Muhammad-Altabba
Copy link
Contributor

Muhammad-Altabba commented Feb 2, 2023

What This PR Does

This PR introduces the script-pseudo-package changelog (found under scripts/changelog). It currently supports the following commands:

  • sync: Takes the changes from the ## [Unreleased] sections of each package's CHANGELOG.md and adds it to the root CHANGELOG.md

The following commands will add an entry to a specific package's CHANGELOG.md under the provided header:

  • added
  • changed
  • deprecated
  • removed
  • fixed
  • security

Any other command will display the help table;

Invalid command, please refer to below table for expected commands:
┌─────────┬──────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────────┬────────────────────────────────────────────────────────────┬───────────────────────────────┐
│ (index) │     name     │                                             description                                             │              arguments              │                          example                           │        commandFunction        │
├─────────┼──────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────────┼────────────────────────────────────────────────────────────┼───────────────────────────────┤
│    0    │    'sync''Checks CHANGELOG.md for each package in ./packages/ for entries not included in root CHANGELOG.md' │                 []                  │                           'sync'                           │  [Function: syncChangelogs]   │
│    1    │   'added'"Adds changelogEntry to packageName's CHANGELOG.md under Added header"                │ [ 'packageName', 'changelogEntry' ] │   'yarn changelog added [packageName] [changelogEntry]'    │ [Function: addChangelogEntry] │
│    2    │  'changed'"Adds changelogEntry to packageName's CHANGELOG.md under Changed header"               │ [ 'packageName', 'changelogEntry' ] │  'yarn changelog changed [packageName] [changelogEntry]'   │ [Function: addChangelogEntry] │
│    3    │ 'deprecated'"Adds changelogEntry to packageName's CHANGELOG.md under Deprecated header"             │ [ 'packageName', 'changelogEntry' ] │ 'yarn changelog deprecated [packageName] [changelogEntry]' │ [Function: addChangelogEntry] │
│    4    │  'removed'"Adds changelogEntry to packageName's CHANGELOG.md under Removed header"               │ [ 'packageName', 'changelogEntry' ] │  'yarn changelog removed [packageName] [changelogEntry]'   │ [Function: addChangelogEntry] │
│    5    │   'fixed'"Adds changelogEntry to packageName's CHANGELOG.md under Fixed header"                │ [ 'packageName', 'changelogEntry' ] │   'yarn changelog fixed [packageName] [changelogEntry]'    │ [Function: addChangelogEntry] │
│    6    │  'security'"Adds changelogEntry to packageName's CHANGELOG.md under Security header"              │ [ 'packageName', 'changelogEntry' ] │  'yarn changelog security [packageName] [changelogEntry]'  │ [Function: addChangelogEntry] │
└─────────┴──────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────┴────────────────────────────────────────────────────────────┴───────────────────────────────┘

Usage

To use the script, in the project root, run yarn changelog <command> <arguments> e.g.:

  • yarn changelog sync
  • yarn changelog added web3 "I added this change (#1234)"
  • yarn changelog removed web3 "I removed something (#1235)"

Great work @spacesailor24 ,
Could you please add this description to a README.md file inside scripts/changelog. And also add a summary of the usage to the main README.md file (with a link to the README.md file inside scripts/changelog)?
Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants