Let's now take our very small package and a plate off to AMPM, we're going have to go through a very
long list of very small items to make sure everything is set up just right before we try to publish
it off to NPM.
So this right here, this very long list is why I wanted to go through a very small side project if
we tried to do all these steps inside of our main project.
So hopefully the side project now makes a little bit more sense.
The first thing we are going to do here is to make sure that our package name is unique back inside
of our packages on file.
We've got this name property right here.
This is the name of our package.
Every package deployed to NPM must have a unique name.
So we need to make sure that nobody has already used the name of any NPM deploy.
To do so, we can just very easily go back over to our Browsr.
Go to dotcom and search for that package name so tiny NPM Diploid.
So it looks like for me, nobody has already used this name before, but here's the catch.
In this video or in the coming videos, I'm going to deploy a package called Tiny AMPM Deploy.
So by the time you are watching this video, this name is probably already going to be in use because
I am using it.
So you cannot use the name Tiny AMPM deploy because someone else has already made use of it.
So you are going to have to go back into your package.
Jason file.
And figure out some different name to use here, you can put in absolutely any name you want to put
in.
You just need to make sure that someone is not already using it.
You might try something like very tiny and deploy or tiny and deploy deployed something or whatever
you want to put in.
But essentially, you need to make sure that you change this name property right here to something else.
But please make sure you do that.
That's step number one.
So it looks like I have a unique name because I'm the first one to use this name, but again, you need
to make sure that you get a different unique name put in there.
Next up, we need to specify exactly which files we want to publish off to 9pm when we actually publish
our project.
The back inside of our package that Jason file anywhere inside of your we're going to add in a new section
called Files.
This is going to be an array and inside of here, we're going to list out all the different files or
directories that we want to send off to NPM when we publish this package.
So in our case, the only thing that we really want to publish to NPM is our disk directory.
Those are the only files that are relevant to anyone who is making use of our project.
We're going to add into files simply dist like so that means find everything inside the directory and
try to publish it off to NPM.
Next up, we're going to split our dependencies and dev dependencies out, so as you've worked on other
projects, you might sometimes notice that you have a dependency section inside of your packages on
file, and then you sometimes also have a second section called Dev Dependencies.
And you might have been told in the past.
Oh, yeah, will you put in things in the dev dependencies if they're only used during development.
But what does that really mean?
Well, whenever we publish our package, NPM is only going to assume that if someone else installs your
package onto their machine, that you only need the things listed in dependencies and it's not going
to install anything listed inside of dev dependencies.
And again, this is when someone else installs your package onto their machine.
So if someone else is making use of our package, they don't need typescript and they do not need our
type definition file because those two are those two packages are only used while we are attempting
to develop and build our project when we publish our package.
We've already made use of typescript.
We've got our built project files and we no longer need the type definition file or typescript at all.
So we can move, but these.
Into our dependency section.
Make sure you clean up the Kama.
And we'll end up with that right there.
Next up, we're going to set our package to be publicly accessible for this by default, whenever you
publish something off to NPM, it's generally sometimes going to assume that you want to publish a private
package.
That's not actually entirely true if you are not publishing a scope's or organization package.
And we're not in this case.
Nonetheless, we're going to do this anyway.
So we're going to go through the stuff and just be very clear.
We're going to say that we want to publish this as a public package.
So, again, inside of our packages on file anywhere inside of here.
We're going to add in a new section called Publish Fig that's going to be an object and inside of it
will put in access.
Public, again, this just means anyone can install our package onto their local machine.
We still have a couple of items to go through, so let's take a pause right here and continue this deploy
process in just a moment.