Skip to content

Commit 69aa528

Browse files
committed
Add webpack support
1 parent 71a3f19 commit 69aa528

File tree

3 files changed

+35
-53
lines changed

3 files changed

+35
-53
lines changed

index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
const {spawn} = require('child_process');
33
const path = require('path');
44
const {format} = require('util');
5-
const importLazy = require('import-lazy')(require);
6-
7-
const configstore = importLazy('configstore');
8-
const chalk = importLazy('chalk');
9-
const semverDiff = importLazy('semver-diff');
10-
const latestVersion = importLazy('latest-version');
11-
const isNpm = importLazy('is-npm');
12-
const isInstalledGlobally = importLazy('is-installed-globally');
13-
const isYarnGlobal = importLazy('is-yarn-global');
14-
const hasYarn = importLazy('has-yarn');
15-
const boxen = importLazy('boxen');
16-
const xdgBasedir = importLazy('xdg-basedir');
17-
const isCi = importLazy('is-ci');
18-
const pupa = importLazy('pupa');
5+
const importLazy = require('import-lazy');
6+
7+
const configstore = importLazy(() => require('configstore'))();
8+
const chalk = importLazy(() => require('chalk'))();
9+
const semverDiff = importLazy(() => require('semver-diff'))();
10+
const latestVersion = importLazy(() => require('latest-version'))();
11+
const isNpm = importLazy(() => require('is-npm'))();
12+
const isInstalledGlobally = importLazy(() => require('is-installed-globally'))();
13+
const isYarnGlobal = importLazy(() => require('is-yarn-global'))();
14+
const hasYarn = importLazy(() => require('has-yarn'))();
15+
const boxen = importLazy(() => require('boxen'))();
16+
const xdgBasedir = importLazy(() => require('xdg-basedir'))();
17+
const isCi = importLazy(() => require('is-ci'))();
18+
const pupa = importLazy(() => require('pupa'))();
1919

2020
const ONE_DAY = 1000 * 60 * 60 * 24;
2121

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"name": "update-notifier",
2+
"name": "update-notifier-webpack",
33
"version": "4.1.0",
44
"description": "Update notifications for your CLI app",
55
"license": "BSD-2-Clause",
6-
"repository": "yeoman/update-notifier",
6+
"repository": "datacrafts-io/update-notifier-webpack",
77
"funding": "https://github.com/yeoman/update-notifier?sponsor=1",
88
"author": {
9-
"name": "Sindre Sorhus",
10-
"email": "sindresorhus@gmail.com",
11-
"url": "https://sindresorhus.com"
9+
"name": "Yaroslav Casper",
10+
"email": "ilovewindows96@gmail.com",
11+
"url": "https://github.com/cxsper"
1212
},
1313
"engines": {
1414
"node": ">=8"

readme.md

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# update-notifier [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier)
1+
# update-notifier-webpack [![Build Status](https://travis-ci.org/yeoman/update-notifier.svg?branch=master)](https://travis-ci.org/yeoman/update-notifier)
22

3-
> Update notifications for your CLI app
3+
> [webpack-compliant](https://github.com/yeoman/update-notifier/issues/123) update notifications for your CLI app
44
55
![](screenshot.png)
66

7-
Inform users of your package of updates in a non-intrusive way.
7+
Not limited to but including [webpack](https://github.com/webpack/webpack) support
8+
among other bundlers.
89

910
#### Contents
1011

@@ -13,20 +14,28 @@ Inform users of your package of updates in a non-intrusive way.
1314
- [How](#how)
1415
- [API](#api)
1516
- [About](#about)
16-
- [Users](#users)
17+
18+
## About
19+
20+
It's a fork of [update-notifier](https://github.com/yeoman/update-notifier) that has been created
21+
due to original package current and future [incompatibility](https://github.com/yeoman/update-notifier/issues/123)
22+
with bundlers such as [webpack](https://github.com/webpack/webpack).
23+
24+
[Who uses it](https://www.npmjs.org/browse/depended/update-notifier-webpack)
25+
1726

1827
## Install
1928

2029
```
21-
$ npm install update-notifier
30+
$ npm install update-notifier-webpack
2231
```
2332

2433
## Usage
2534

2635
### Simple
2736

2837
```js
29-
const updateNotifier = require('update-notifier');
38+
const updateNotifier = require('update-notifier-webpack');
3039
const pkg = require('./package.json');
3140

3241
updateNotifier({pkg}).notify();
@@ -35,7 +44,7 @@ updateNotifier({pkg}).notify();
3544
### Comprehensive
3645

3746
```js
38-
const updateNotifier = require('update-notifier');
47+
const updateNotifier = require('update-notifier-webpack');
3948
const pkg = require('./package.json');
4049

4150
// Checks for available update and returns an instance
@@ -194,31 +203,4 @@ The check is also skipped automatically:
194203
- on CI
195204
- in unit tests (when the `NODE_ENV` environment variable is `test`)
196205

197-
## About
198-
199-
The idea for this module came from the desire to apply the browser update strategy to CLI tools, where everyone is always on the latest version. We first tried automatic updating, which we discovered wasn't popular. This is the second iteration of that idea, but limited to just update notifications.
200-
201-
## Users
202-
203-
There are a bunch projects using it:
204-
205-
- [npm](https://github.com/npm/npm) - Package manager for JavaScript
206-
- [Yeoman](https://yeoman.io) - Modern workflows for modern webapps
207-
- [AVA](https://ava.li) - Simple concurrent test runner
208-
- [XO](https://github.com/xojs/xo) - JavaScript happiness style linter
209-
- [Pageres](https://github.com/sindresorhus/pageres) - Capture website screenshots
210-
- [Node GH](https://github.com/node-gh/gh) - GitHub command line tool
211-
212-
[And 2700+ more…](https://www.npmjs.org/browse/depended/update-notifier)
213-
214206
---
215-
216-
<div align="center">
217-
<b>
218-
<a href="https://tidelift.com/subscription/pkg/npm-update_notifier?utm_source=npm-update-notifier&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
219-
</b>
220-
<br>
221-
<sub>
222-
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
223-
</sub>
224-
</div>

0 commit comments

Comments
 (0)