@@ -35,6 +35,17 @@ including `bower` publishing, for you - automatically.
35
35
_ Initial idea is got from ` React-Bootstrap ` release tools ` ./tools/release ` ,
36
36
that have been written by [ Matt Smith @mtscout6 ] ( https://github.com/mtscout6 ) _
37
37
38
+ #### Alternative npm package root folder
39
+
40
+ Say you want to publish to ` npmjs ` only the content of your ` lib ` folder.
41
+ Then you can do it as simple as adding this option to your ` package.json `
42
+ ``` json
43
+ "release-script" : {
44
+ "altPkgRootFolder" : " lib"
45
+ }
46
+ ```
47
+ and that's all.
48
+
38
49
#### Options
39
50
40
51
All options for this package are kept under ` 'release-script' ` node in your project's ` package.json `
@@ -44,6 +55,7 @@ All options for this package are kept under `'release-script'` node in your proj
44
55
- ` default ` value: ` 'amd' `
45
56
- ` tmpBowerRepo ` - the folder name for temporary files for bower pkg.
46
57
- ` default ` value: ` 'tmp-bower-repo' `
58
+ - ` altPkgRootFolder ` - the folder name for alternative npm package root folder
47
59
48
60
It is advised to add ` bowerRoot ` and ` tmpBowerRepo ` folders to your ` .gitignore ` file.
49
61
54
66
" release-script" : {
55
67
" bowerRepo" : " [email protected] :<org-author-name>/<name-of-project>-bower.git" ,
56
68
" bowerRoot" : " amd" ,
57
- " tmpBowerRepo" : " tmp-bower-repo"
69
+ " tmpBowerRepo" : " tmp-bower-repo" ,
70
+ " altPkgRootFolder" : " lib"
58
71
}
59
72
```
60
73
@@ -89,7 +102,11 @@ You can set a custom message for release via `--notes` CLI option:
89
102
- adds git tag with new version (and changelog message, if used)
90
103
- pushes changes to github repo
91
104
- if github token is present, publishes release to GitHub, named as ` <repo> vx.x.x `
92
- - releases npm package by ` npm publish ` command
105
+ - if ` altPkgRootFolder ` doesn't set it will just ` npm publish ` as usual
106
+ - otherwise if ` altPkgRootFolder ` set then this script
107
+ - will ` npm publish ` from the ` altPkgRootFolder ` folder
108
+ - with the custom version of ` package.json ` with removed ` scripts ` and ` devDependencies `
109
+ - also it will remove the ` altPkgRootFolder ` part from the ` main ` file path
93
110
- if ` bowerRepo ` field is present in the ` package.json ` , then it releases bower package:
94
111
- clones bower repo to local ` tmpBowerRepo ` temp folder. ` git clone bowerRepo tmpBowerRepo `
95
112
- then it cleans up all but ` .git ` files in the ` tmpBowerRepo `
0 commit comments