# Basic Steps

> If not logged in yet, run the following: `npm login`

1. Build the project:

```bash
npm run build
```

2. Update the version in `package.json`.

3. Publish the package to NPM.

```bash
npm publish
```

# Automated Package Update and Publishing (Custom)

> We can Steps 1, 2, and 3 all at once by running one of the following commands in the terminal:

```bash
# For patch version update (e.g. 1.0.5 -> 1.0.6)
npm run publish -- patch

# For minor version update (e.g. 1.0.5 -> 1.1.5)
npm run publish -- minor

# For major version update (e.g. 1.0.5 -> 2.0.5)
npm run publish -- major
```

Or you could build the package, then do the version change, and publishing separately:

```bash
# build
npm run build

# Update version in preparation for publishing
npm run publish -- patch
# or npm run publish -- minor
# or npm run publish -- major

# Publish the package
npm publish

```

<br />

---

## Check Current `noob-ethereum` version published online

```bash
npm view noob-ethereum --latest
```

## TLDR

```bash
# minor or major can be substituted
npm run publish -- patch

# publish to NPM
npm publish
```

## Latest method to do this (Jan 2023)

1. Delete `dist` folder and run:

```bash
npm run build
```

2. Update version number in `package.json`.

```bash
npm publish
```

3. Just correct the version number after publishing to the version number actually published (for some reason it keeps
   incrementing after the publish)
