git-publish 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +9 -6
  2. package/dist/index.js +63 -63
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,20 +8,22 @@ Publish your npm package to a Git branch.
8
8
 
9
9
  To test a package without publishing to npm.
10
10
 
11
- When using `npm publish` to make a pre-release, you have the following drawbacks:
11
+ #### Why not use `npm publish` to make a pre-release?
12
+
13
+ Because of the following drawbacks:
12
14
 
13
15
  - **Versioning concerns:** even though you're just testing, you still need to version bump
14
16
  - **Undeleteable:** releases are hard to remove due to npm's [strict unpublish policy](https://docs.npmjs.com/policies/unpublish)
15
17
  - **Unverifyable:** npm does not offer a great way to browse the contents of a package
16
18
  - **Risky:** Publishing tests to a production environment can be dangerous (eg. accidentally publish as stable)
17
19
 
18
- When using `npm link`, you have the following drawbacks:
20
+ #### What about `npm link`?
19
21
  - No [npm life cycle scripts](https://docs.npmjs.com/cli/v8/using-npm/scripts#life-cycle-scripts)
20
22
  - Includes non-publishable assets
21
23
  - Doesn't install dependencies
22
24
 
23
25
 
24
- In contrast, `git-publish` has the following benefits:
26
+ #### So why `git-publish`?
25
27
 
26
28
  - **No versions:** Instead of versions, branch names are used. Branches can be updated to reflect latest change.
27
29
 
@@ -41,7 +43,7 @@ Publish your npm package to a branch on the Git repository:
41
43
  npx git-publish
42
44
  ```
43
45
 
44
- > **⚠️ Warning:** This command will force-push to the remote branch `npm/<current branch>`. Make sure there are no unsaved changes there.
46
+ This command will publish to the remote branch `npm/<current branch>`.
45
47
 
46
48
 
47
49
  ### Global install
@@ -61,6 +63,7 @@ git-publish
61
63
  | - | - |
62
64
  | `-b, --branch <branch name>` | The branch to publish the package to. Defaults to prefixing "npm/" to the current branch or tag name. |
63
65
  | `-r, --remote <remote>` | The remote to push to. (default: `origin`) |
66
+ | `-o, --fresh` | Publish without a commit history. Warning: Force-pushes to remote |
64
67
  | `-d, --dry` | Dry run mode. Will not commit or push to the remote. |
65
68
  | `-h, --help` | Show help |
66
69
  | `--version` | Show version |
@@ -85,8 +88,8 @@ Like `npm publish`, you can call the build command it in the [`prepack` script](
85
88
 
86
89
  1. Run [npm hooks](https://docs.npmjs.com/cli/v8/using-npm/scripts) `prepare` & `prepack`
87
90
  2. Create a temporary branch by prefixing the current branch with the `npm/` namespace
88
- 3. Detect and commit the [npm publish files](https://github.com/npm/npm-packlist)
89
- 4. Force push the branch to remote
91
+ 3. Detect and commit only the [npm publish files](https://github.com/npm/npm-packlist)
92
+ 4. Push the branch to remote
90
93
  5. Delete local branch from Step 2
91
94
  6. Print the installation command for the branch
92
95