Onto our next task, the next thing we have to do if we are building a Seelie in this case, we are
and we need to make sure that we can figure out which file we want to run when every user tries to run
our package directly from the terminal.
So for this, once again, we'll go back into our packages on file.
Then anywhere inside of here, we will add in a bin S..
And we'll specify exactly what file we want to run in this case, we do not want to run our index dots
file because remember on the user's machine, whenever they install the package, they're not even going
to get this Sarsae directory.
They're only going to get everything inside the directory we'll put in here.
Just index that.
In addition to that, we also need to make sure that we can figure our index, not just file or in this
case, we're going to add the configuration to index dots and that's going to get transcribed by typescript
to make it very clear that this is a file that can be directly executed from the terminal inside of
our index, not to file at the very top.
We will add in.
Exclamation.
USAR been N.V. Noad, so this is what is going to allow us to directly execute this file rather than
first writing out Noad Index or something like that.
OK, let's save this file.
Onto our next task.
We're going to add in a pre published script, but some point in time in the future, whenever you want
to publish our package, we're going to run the command and publish.
When we run that command, if we have a published script to find, then MPM is going to automatically
execute that republish script.
So if we put together a pre published script, we can say inside there that we want to build our package
that will make sure that we are always deploying the latest version of our package.
So back inside of our package Jason file, I'm going to find my script section.
And then inside there, I'm going to add in pre publish only and double check the capitalization here,
there's a capital O republished is all lowercase.
So we're going to say that just as we were about to publish our package right before we do so, we want
to run NPM, Run, Build, which will build our project using our build script.
All right, that looks good.
Now, finally, this step is technically optional, but I'm going to assume that you are probably using
it on your own professional projects, that we're going to create a new git repository for our project.
We're then going to commit our code to it.
Now, when I say commit to get I mean, specifically get at the command line, we do not have to push
anything to GitHub or get lab or anything like that.
The back at our terminal.
Inside of our tiny deploy directory, I'll do a get in it.
We could immediately commit all the files we have inside of here, but we probably do not want to commit
anything inside of our node modules directory or the directory.
So I'm going to create a dot get ignore file.
Make sure you've got that leading on their.
And then inside of this file, I'm going to list out the oddest and noad modules directories because
again, I do not want to commit those two directories.
Then back over at our terminal, we can do a quick get status.
It looks like the only things we were about to commit are the Sarsae directory, and then the package
dates on files and config, which is definitely correct.
We can now do a get add dot a get permit, dash in with a message of initial permit, and that's it.
OK, so those are all the steps we have to go through to get everything ready to be published.
Now, the last thing we have to do is actually run and publish.
Let's take care of that in the next video.