1
00:00:01,800 --> 00:00:06,480
Let's now take our very small package and a plate off to AMPM, we're going have to go through a very

2
00:00:06,480 --> 00:00:10,590
long list of very small items to make sure everything is set up just right before we try to publish

3
00:00:10,590 --> 00:00:11,420
it off to NPM.

4
00:00:11,970 --> 00:00:17,370
So this right here, this very long list is why I wanted to go through a very small side project if

5
00:00:17,370 --> 00:00:19,850
we tried to do all these steps inside of our main project.

6
00:00:20,190 --> 00:00:22,500
So hopefully the side project now makes a little bit more sense.

7
00:00:23,280 --> 00:00:28,020
The first thing we are going to do here is to make sure that our package name is unique back inside

8
00:00:28,020 --> 00:00:29,470
of our packages on file.

9
00:00:30,090 --> 00:00:31,790
We've got this name property right here.

10
00:00:32,130 --> 00:00:33,780
This is the name of our package.

11
00:00:34,110 --> 00:00:37,020
Every package deployed to NPM must have a unique name.

12
00:00:37,290 --> 00:00:41,370
So we need to make sure that nobody has already used the name of any NPM deploy.

13
00:00:42,740 --> 00:00:45,290
To do so, we can just very easily go back over to our Browsr.

14
00:00:46,530 --> 00:00:53,310
Go to dotcom and search for that package name so tiny NPM Diploid.

15
00:00:54,560 --> 00:00:58,950
So it looks like for me, nobody has already used this name before, but here's the catch.

16
00:00:59,760 --> 00:01:04,720
In this video or in the coming videos, I'm going to deploy a package called Tiny AMPM Deploy.

17
00:01:05,010 --> 00:01:10,110
So by the time you are watching this video, this name is probably already going to be in use because

18
00:01:10,110 --> 00:01:10,950
I am using it.

19
00:01:11,280 --> 00:01:16,380
So you cannot use the name Tiny AMPM deploy because someone else has already made use of it.

20
00:01:16,980 --> 00:01:19,320
So you are going to have to go back into your package.

21
00:01:19,550 --> 00:01:20,220
Jason file.

22
00:01:21,360 --> 00:01:25,830
And figure out some different name to use here, you can put in absolutely any name you want to put

23
00:01:25,830 --> 00:01:26,040
in.

24
00:01:26,250 --> 00:01:29,100
You just need to make sure that someone is not already using it.

25
00:01:29,580 --> 00:01:37,080
You might try something like very tiny and deploy or tiny and deploy deployed something or whatever

26
00:01:37,080 --> 00:01:37,770
you want to put in.

27
00:01:38,190 --> 00:01:43,710
But essentially, you need to make sure that you change this name property right here to something else.

28
00:01:44,040 --> 00:01:45,300
But please make sure you do that.

29
00:01:48,040 --> 00:01:48,890
That's step number one.

30
00:01:48,910 --> 00:01:53,020
So it looks like I have a unique name because I'm the first one to use this name, but again, you need

31
00:01:53,020 --> 00:01:55,500
to make sure that you get a different unique name put in there.

32
00:01:56,730 --> 00:02:02,310
Next up, we need to specify exactly which files we want to publish off to 9pm when we actually publish

33
00:02:02,310 --> 00:02:03,000
our project.

34
00:02:03,900 --> 00:02:08,310
The back inside of our package that Jason file anywhere inside of your we're going to add in a new section

35
00:02:08,310 --> 00:02:09,330
called Files.

36
00:02:11,070 --> 00:02:15,420
This is going to be an array and inside of here, we're going to list out all the different files or

37
00:02:15,420 --> 00:02:19,820
directories that we want to send off to NPM when we publish this package.

38
00:02:20,310 --> 00:02:24,730
So in our case, the only thing that we really want to publish to NPM is our disk directory.

39
00:02:25,050 --> 00:02:29,190
Those are the only files that are relevant to anyone who is making use of our project.

40
00:02:29,790 --> 00:02:36,150
We're going to add into files simply dist like so that means find everything inside the directory and

41
00:02:36,150 --> 00:02:37,830
try to publish it off to NPM.

42
00:02:43,300 --> 00:02:49,210
Next up, we're going to split our dependencies and dev dependencies out, so as you've worked on other

43
00:02:49,210 --> 00:02:54,130
projects, you might sometimes notice that you have a dependency section inside of your packages on

44
00:02:54,130 --> 00:02:58,960
file, and then you sometimes also have a second section called Dev Dependencies.

45
00:02:59,680 --> 00:03:01,060
And you might have been told in the past.

46
00:03:01,280 --> 00:03:05,070
Oh, yeah, will you put in things in the dev dependencies if they're only used during development.

47
00:03:05,230 --> 00:03:06,850
But what does that really mean?

48
00:03:07,570 --> 00:03:13,060
Well, whenever we publish our package, NPM is only going to assume that if someone else installs your

49
00:03:13,060 --> 00:03:19,270
package onto their machine, that you only need the things listed in dependencies and it's not going

50
00:03:19,270 --> 00:03:21,770
to install anything listed inside of dev dependencies.

51
00:03:22,030 --> 00:03:25,860
And again, this is when someone else installs your package onto their machine.

52
00:03:26,590 --> 00:03:31,390
So if someone else is making use of our package, they don't need typescript and they do not need our

53
00:03:31,390 --> 00:03:38,260
type definition file because those two are those two packages are only used while we are attempting

54
00:03:38,260 --> 00:03:42,120
to develop and build our project when we publish our package.

55
00:03:42,430 --> 00:03:43,840
We've already made use of typescript.

56
00:03:43,870 --> 00:03:48,820
We've got our built project files and we no longer need the type definition file or typescript at all.

57
00:03:49,800 --> 00:03:51,180
So we can move, but these.

58
00:03:52,950 --> 00:03:55,020
Into our dependency section.

59
00:03:57,490 --> 00:03:58,690
Make sure you clean up the Kama.

60
00:04:00,490 --> 00:04:02,470
And we'll end up with that right there.

61
00:04:07,280 --> 00:04:12,680
Next up, we're going to set our package to be publicly accessible for this by default, whenever you

62
00:04:12,680 --> 00:04:16,850
publish something off to NPM, it's generally sometimes going to assume that you want to publish a private

63
00:04:16,850 --> 00:04:17,300
package.

64
00:04:17,570 --> 00:04:23,240
That's not actually entirely true if you are not publishing a scope's or organization package.

65
00:04:23,250 --> 00:04:24,220
And we're not in this case.

66
00:04:24,440 --> 00:04:25,970
Nonetheless, we're going to do this anyway.

67
00:04:25,970 --> 00:04:27,920
So we're going to go through the stuff and just be very clear.

68
00:04:28,100 --> 00:04:31,250
We're going to say that we want to publish this as a public package.

69
00:04:32,470 --> 00:04:35,590
So, again, inside of our packages on file anywhere inside of here.

70
00:04:36,660 --> 00:04:42,090
We're going to add in a new section called Publish Fig that's going to be an object and inside of it

71
00:04:42,090 --> 00:04:43,620
will put in access.

72
00:04:44,480 --> 00:04:49,970
Public, again, this just means anyone can install our package onto their local machine.

73
00:04:52,110 --> 00:04:56,190
We still have a couple of items to go through, so let's take a pause right here and continue this deploy

74
00:04:56,190 --> 00:04:57,470
process in just a moment.

