Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes from main #1

Merged
merged 6 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
lib
5 changes: 4 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# https://jstools.dev/eslint-config/

root: true
extends: "@jsdevtools"

extends:
- "@jsdevtools"
- "prettier"

env:
node: true
11 changes: 3 additions & 8 deletions .github/workflows/CI-CD.yaml → .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ jobs:
os:
- ubuntu-latest
- macos-latest
- windows-latest
# TODO(mc, 2023-04-07): investigate and fix coverage-related failures on Windows
# - windows-latest
node:
- 14
- 16
- 18

steps:
- name: Checkout source
Expand All @@ -50,15 +51,9 @@ jobs:
run: npm run build

- name: Run tests
if: ${{ !startsWith(matrix.os, 'windows') }}
run: npm run coverage

- name: Run tests without coverage
if: ${{ startsWith(matrix.os, 'windows') }}
run: npm test

- name: Send code coverage results to Coveralls
if: ${{ !startsWith(matrix.os, 'windows') }}
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ spec:
# Test specs
- test/specs/**/*.spec.js

bail: true
recursive: true
timeout: 30000 # Allow time for multiple process spawning
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
lib
package-lock.json
Empty file added .prettierrc.yml
Empty file.
15 changes: 4 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@
"request": "launch",
"name": "Run Mocha",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": [
"--timeout=60000",
"--retries=0",
],
"outFiles": [
"${workspaceFolder}/lib/**/*.js"
],
"args": ["--timeout=60000", "--retries=0"],
"outFiles": ["${workspaceFolder}/lib/**/*.js"],
"smartStep": true,
"skipFiles": [
"<node_internals>/**/*.js"
],
"skipFiles": ["<node_internals>/**/*.js"],
"outputCapture": "std"
},
}
]
}
3 changes: 1 addition & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"problemMatcher": "$tsc"
},


{
"type": "npm",
"script": "test",
Expand All @@ -32,6 +31,6 @@
"isDefault": true
},
"problemMatcher": "$eslint-stylish"
},
}
]
}
29 changes: 7 additions & 22 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
Change Log
====================================================================================================
# Change Log

All notable changes will be documented in this file.
NPM Publish adheres to [Semantic Versioning](http://semver.org/).



[v1.4.0](https://github.com/JS-DevTools/npm-publish/tree/v1.4.0) (2020-10-02)
----------------------------------------------------------------------------------------------------
## [v1.4.0](https://github.com/JS-DevTools/npm-publish/tree/v1.4.0) (2020-10-02)

- Added support NPM's `--tag` argument, which allows packages to be published to a named tag that can then be installed using `npm install <package-name>@<tag>`

- Added support for NPM's `--access` argument, which controls whether scoped packages are publicly accessible, or restricted to members of your NPM organization

[Full Changelog](https://github.com/JS-DevTools/npm-publish/compare/v1.3.0...v1.4.0)



[v1.3.0](https://github.com/JS-DevTools/npm-publish/tree/v1.3.0) (2020-10-01)
----------------------------------------------------------------------------------------------------
## [v1.3.0](https://github.com/JS-DevTools/npm-publish/tree/v1.3.0) (2020-10-01)

- NPM-Publish can now successfully publish a brand-new package to NPM. Previously it failed because it couldn't determine the previous package version. ([PR #12](https://github.com/JS-DevTools/npm-publish/pull/12) from [@ZitRos](https://github.com/ZitRos))

[Full Changelog](https://github.com/JS-DevTools/npm-publish/compare/v1.2.0...v1.3.0)



[v1.2.0](https://github.com/JS-DevTools/npm-publish/tree/v1.2.0) (2020-07-23)
----------------------------------------------------------------------------------------------------
## [v1.2.0](https://github.com/JS-DevTools/npm-publish/tree/v1.2.0) (2020-07-23)

- Added support for running NPM in "dry run" mode, which doesn't actually publish, but reports details of what _would_ have been published.

[Full Changelog](https://github.com/JS-DevTools/npm-publish/compare/v1.1.2...v1.2.0)



[v1.1.0](https://github.com/JS-DevTools/npm-publish/tree/v1.1.0) (2020-03-29)
----------------------------------------------------------------------------------------------------
## [v1.1.0](https://github.com/JS-DevTools/npm-publish/tree/v1.1.0) (2020-03-29)

- FIX: The configured NPM registry and token are now used _all_ NPM commands, not just for publishing. This ensures that npm-publish works with private packages and custom registries

[Full Changelog](https://github.com/JS-DevTools/npm-publish/compare/v1.0.13...v1.1.0)



[v1.0.0](https://github.com/JS-DevTools/npm-publish/tree/v1.0.0) (2020-01-21)
----------------------------------------------------------------------------------------------------
## [v1.0.0](https://github.com/JS-DevTools/npm-publish/tree/v1.0.0) (2020-01-21)

Initial release 🎉
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing Guide

Contributions, enhancements, and bug-fixes are welcome! [Open an issue](https://github.com/JS-DevTools/npm-publish/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/npm-publish/pulls).

## Building Locally

You should be using Node.js v16 or later to build this project locally

```shell
# Clone this repository
git clone https://github.com/JS-DevTools/npm-publish.git

# Install dependencies*
npm install

# Build the code
npm run build

# Run the tests
npm test
```

There are also various code quality checks and tests you can run:

```shell
# Autoformat the code
npm run format

# Lint the code
npm run lint
```
44 changes: 11 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
[![Build Status](https://github.com/JS-DevTools/npm-publish/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/npm-publish/actions)

[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/npm-publish/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/npm-publish)
[![Dependencies](https://david-dm.org/JS-DevTools/npm-publish/status.svg)](https://david-dm.org/JS-DevTools/npm-publish)

[![npm](https://img.shields.io/npm/v/@jsdevtools/npm-publish.svg)](https://www.npmjs.com/package/@jsdevtools/npm-publish)
[![License](https://img.shields.io/npm/l/@jsdevtools/npm-publish.svg)](LICENSE)
Expand Down Expand Up @@ -52,7 +51,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 12
- run: npm install
- run: npm ci
- run: npm test
- uses: JS-DevTools/npm-publish@v1
with:
Expand All @@ -63,17 +62,16 @@ jobs:

You can set any or all of the following input parameters:

|Name |Type |Default |Description
|----------------------|-------- |----------------------------|------------------------------------
|`token` |string |**required** |The NPM auth token to use for publishing
|`registry` |string |https://registry.npmjs.org/ |The NPM registry URL to use
|`package` |string |./package.json |The path of your package.json file
|`tag` |string |"latest" |The tag to publish to. This allows people to install the package using `npm install <package-name>@<tag>`.
|`access` |string |"public" for non-scoped packages. "restricted" for scoped packages.|Determines whether the published package should be publicly visible, or restricted to members of your NPM organization.
|`dry-run` |boolean |false |Run NPM publish with the `--dry-run` flag to prevent publication
|`check-version` |boolean |true |Only publish to NPM if the version number in `package.json` differs from the latest on NPM
|`greater-version-only`|boolean |false |Only publish to NPM if the version number in `package.json` is greater than the latest on NPM |

| Name | Type | Default | Description |
| ---------------------- | ------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `token` | string | **required** | The NPM auth token to use for publishing |
| `registry` | string | https://registry.npmjs.org/ | The NPM registry URL to use |
| `package` | string | ./package.json | The path of your package.json file |
| `tag` | string | "latest" | The tag to publish to. This allows people to install the package using `npm install <package-name>@<tag>`. |
| `access` | string | "public" for non-scoped packages. "restricted" for scoped packages. | Determines whether the published package should be publicly visible, or restricted to members of your NPM organization. |
| `dry-run` | boolean | false | Run NPM publish with the `--dry-run` flag to prevent publication |
| `check-version` | boolean | true | Only publish to NPM if the version number in `package.json` differs from the latest on NPM |
| `greater-version-only` | boolean | false | Only publish to NPM if the version number in `package.json` is greater than the latest on NPM |

## Output Variables

Expand Down Expand Up @@ -211,26 +209,6 @@ package_path The absolute or relative path of the NPM package to publis
Defaults to the current directory.
```

## Contributing

Contributions, enhancements, and bug-fixes are welcome! [Open an issue](https://github.com/JS-DevTools/npm-publish/issues) on GitHub and [submit a pull request](https://github.com/JS-DevTools/npm-publish/pulls).

#### Building

To build the project locally on your computer:

1. **Clone this repo**<br>
`git clone https://github.com/JS-DevTools/npm-publish.git`

2. **Install dependencies**<br>
`npm install`

3. **Build the code**<br>
`npm run build`

4. **Run the tests**<br>
`npm test`

## License

npm-publish is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want.
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ inputs:
required: false
default: "true"

greater-version-only:
description: Only publish to NPM if the version number in package.json is greater than the latest on NPM
required: false
default: "false"

outputs:
type:
description: The type of version change that occurred ("none", "major", "minor", "patch", etc.)
Expand Down
Loading