@hs-web-team/adblocker-detect
Advanced tools
Comparing version 1.0.3 to 1.1.0
{ | ||
"name": "@hs-web-team/adblocker-detect", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "Script to detect the presence of AdBlockers", | ||
@@ -18,3 +18,3 @@ "repository": "https://github.com/HubSpotWebTeam/adblock-detect", | ||
"dev": "webpack --config webpack.config.js --watch", | ||
"eslint": "eslint --ext .js,.ts src" | ||
"lint": "eslint --ext .js,.ts src" | ||
}, | ||
@@ -21,0 +21,0 @@ "keywords": [ |
@@ -12,8 +12,2 @@ <!-- preset:npm --> | ||
- [A global variable](#a-global-variable) | ||
- [How to publish an npm package](#how-to-publish-an-npm-package) | ||
- [Before you start](#before-you-start) | ||
- [Login into npm](#login-into-npm) | ||
- [Publish the package](#publish-the-package) | ||
- [Multiple npm accounts](#multiple-npm-accounts) | ||
- [Maintain this docs](#maintain-this-docs) | ||
<!-- index-end --> | ||
@@ -65,49 +59,1 @@ ## Development | ||
Once called for the first time, a global variable is created, which is used to store the state of the results of the checks. You can invoke the state by calling `window.hs_hasAdBlocker`. | ||
<!-- deployment/npm-start --> | ||
## How to publish an npm package | ||
### Before you start | ||
Before you can publish anything, you must have an npm account associated with your Hubspot account. | ||
You also must be included in the `hs-web-team` organization. | ||
We also assume that you have Node.js and `npm` installed, possibly to a stable version at the very least. | ||
### Login into npm | ||
Once your account is setup, you need to login in `npm`, and this is as simple as running: | ||
```bash | ||
npm login | ||
``` | ||
### Publish the package | ||
Once you have logged in successfully, you must cd into the project root folder, then run the following commands: | ||
```bash | ||
# If you have tests, run them before publishing anything | ||
npm test | ||
# If you have a linter script, run it before publishing anything | ||
npm run eslint | ||
# Check if the package can be published | ||
npm publish --dry-run | ||
# Publish the package to npmjs.com | ||
npm publish | ||
``` | ||
#### Multiple npm accounts | ||
If you have a personal account, what you can do is to login with npm with the Hubspot account, copy the `.npmrc` file into the project folder, and you can find it in your home folder. | ||
When you will publish the package, the npm command will look at that file first, and fallback to the global file if not found. | ||
<!-- deployment/npm-end --> | ||
<!-- wt-docs/maintain-docs-start --> | ||
## Maintain this docs | ||
This docs are maintained by the WebTeam Documentation CLI, to keep this document up to date, you can run `npx @hs-web-team/wt-docs update README.md`. | ||
<!-- wt-docs/maintain-docs-end --> | ||
5246
58