1
00:00:01,230 --> 00:00:06,150
Onto our next task, the next thing we have to do if we are building a Seelie in this case, we are

2
00:00:06,330 --> 00:00:10,770
and we need to make sure that we can figure out which file we want to run when every user tries to run

3
00:00:10,770 --> 00:00:12,450
our package directly from the terminal.

4
00:00:12,990 --> 00:00:16,140
So for this, once again, we'll go back into our packages on file.

5
00:00:16,530 --> 00:00:21,210
Then anywhere inside of here, we will add in a bin S..

6
00:00:22,080 --> 00:00:27,550
And we'll specify exactly what file we want to run in this case, we do not want to run our index dots

7
00:00:27,600 --> 00:00:32,250
file because remember on the user's machine, whenever they install the package, they're not even going

8
00:00:32,250 --> 00:00:33,750
to get this Sarsae directory.

9
00:00:33,930 --> 00:00:37,950
They're only going to get everything inside the directory we'll put in here.

10
00:00:38,280 --> 00:00:40,340
Just index that.

11
00:00:42,580 --> 00:00:47,500
In addition to that, we also need to make sure that we can figure our index, not just file or in this

12
00:00:47,500 --> 00:00:52,270
case, we're going to add the configuration to index dots and that's going to get transcribed by typescript

13
00:00:52,690 --> 00:00:58,330
to make it very clear that this is a file that can be directly executed from the terminal inside of

14
00:00:58,330 --> 00:01:00,850
our index, not to file at the very top.

15
00:01:01,720 --> 00:01:02,560
We will add in.

16
00:01:05,470 --> 00:01:06,370
Exclamation.

17
00:01:09,060 --> 00:01:16,890
USAR been N.V. Noad, so this is what is going to allow us to directly execute this file rather than

18
00:01:16,890 --> 00:01:20,190
first writing out Noad Index or something like that.

19
00:01:22,100 --> 00:01:23,210
OK, let's save this file.

20
00:01:24,790 --> 00:01:25,840
Onto our next task.

21
00:01:26,050 --> 00:01:30,490
We're going to add in a pre published script, but some point in time in the future, whenever you want

22
00:01:30,490 --> 00:01:33,850
to publish our package, we're going to run the command and publish.

23
00:01:34,240 --> 00:01:39,400
When we run that command, if we have a published script to find, then MPM is going to automatically

24
00:01:39,400 --> 00:01:41,200
execute that republish script.

25
00:01:41,770 --> 00:01:46,450
So if we put together a pre published script, we can say inside there that we want to build our package

26
00:01:46,630 --> 00:01:50,740
that will make sure that we are always deploying the latest version of our package.

27
00:01:52,090 --> 00:01:55,810
So back inside of our package Jason file, I'm going to find my script section.

28
00:01:57,170 --> 00:02:02,600
And then inside there, I'm going to add in pre publish only and double check the capitalization here,

29
00:02:02,990 --> 00:02:05,930
there's a capital O republished is all lowercase.

30
00:02:06,590 --> 00:02:11,090
So we're going to say that just as we were about to publish our package right before we do so, we want

31
00:02:11,090 --> 00:02:15,860
to run NPM, Run, Build, which will build our project using our build script.

32
00:02:18,900 --> 00:02:19,820
All right, that looks good.

33
00:02:22,040 --> 00:02:26,300
Now, finally, this step is technically optional, but I'm going to assume that you are probably using

34
00:02:26,300 --> 00:02:31,730
it on your own professional projects, that we're going to create a new git repository for our project.

35
00:02:32,040 --> 00:02:33,800
We're then going to commit our code to it.

36
00:02:34,860 --> 00:02:39,240
Now, when I say commit to get I mean, specifically get at the command line, we do not have to push

37
00:02:39,240 --> 00:02:42,030
anything to GitHub or get lab or anything like that.

38
00:02:43,010 --> 00:02:43,940
The back at our terminal.

39
00:02:45,800 --> 00:02:50,360
Inside of our tiny deploy directory, I'll do a get in it.

40
00:02:51,680 --> 00:02:56,600
We could immediately commit all the files we have inside of here, but we probably do not want to commit

41
00:02:56,600 --> 00:03:00,080
anything inside of our node modules directory or the directory.

42
00:03:00,650 --> 00:03:03,800
So I'm going to create a dot get ignore file.

43
00:03:04,800 --> 00:03:06,660
Make sure you've got that leading on their.

44
00:03:08,500 --> 00:03:12,730
And then inside of this file, I'm going to list out the oddest and noad modules directories because

45
00:03:12,730 --> 00:03:15,370
again, I do not want to commit those two directories.

46
00:03:19,380 --> 00:03:22,530
Then back over at our terminal, we can do a quick get status.

47
00:03:23,650 --> 00:03:28,070
It looks like the only things we were about to commit are the Sarsae directory, and then the package

48
00:03:28,070 --> 00:03:30,730
dates on files and config, which is definitely correct.

49
00:03:31,360 --> 00:03:40,620
We can now do a get add dot a get permit, dash in with a message of initial permit, and that's it.

50
00:03:42,950 --> 00:03:47,010
OK, so those are all the steps we have to go through to get everything ready to be published.

51
00:03:47,420 --> 00:03:50,450
Now, the last thing we have to do is actually run and publish.

52
00:03:50,900 --> 00:03:52,580
Let's take care of that in the next video.

