milkee 2.1.3 → 2.2.0-dev.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.
package/README.md CHANGED
@@ -119,7 +119,7 @@ Example:
119
119
  const myPlugin = require('./plugins/my-plugin.js');
120
120
 
121
121
  module.exports = {
122
- // ...
122
+ // ...
123
123
  milkee: {
124
124
  plugins: [
125
125
  // This call returns the PluginExecutor
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  (function() {
3
- var CONFIG_FILE, CONFIG_PATH, CWD, argv, checkCoffee, compile, consola, crypto, exec, executePlugins, fs, getCompiledFiles, hideBin, path, pkg, runPlugins, setup, spawn, yargs;
3
+ var CONFIG_FILE, CONFIG_PATH, CWD, argv, checkCoffee, checkLatest, compile, consola, crypto, exec, executePlugins, fs, getCompiledFiles, hideBin, isPackageLatest, path, pkg, runPlugins, setup, spawn, yargs;
4
4
 
5
5
  yargs = require('yargs');
6
6
 
@@ -8,6 +8,8 @@
8
8
 
9
9
  consola = require('consola');
10
10
 
11
+ ({isPackageLatest} = require('is-package-latest'));
12
+
11
13
  fs = require('fs');
12
14
 
13
15
  path = require('path');
@@ -24,6 +26,19 @@
24
26
 
25
27
  CONFIG_PATH = path.join(CWD, CONFIG_FILE);
26
28
 
29
+ // async
30
+ checkLatest = async function() {
31
+ var res;
32
+ try {
33
+ res = (await isPackageLatest(pkg));
34
+ if (res.success && res.isLatest) {
35
+ return consola.box(`A new version is available!\n\n${res.currentVersion} --> \`${res.latestVersion}\``);
36
+ }
37
+ } catch (error1) {
38
+ return null;
39
+ }
40
+ };
41
+
27
42
  checkCoffee = function() {
28
43
  var PKG_PATH, error, pkgData, pkgFile, ref, ref1;
29
44
  PKG_PATH = path.join(CWD, 'package.json');
@@ -121,7 +136,7 @@
121
136
  return;
122
137
  }
123
138
  consola.start(`Running ${plugins.length} plugin(s)...`);
124
- return (async function() {
139
+ return (async function() { // async
125
140
  var error, i, len, pluginFn;
126
141
  try {
127
142
  for (i = 0, len = plugins.length; i < len; i++) {
@@ -161,6 +176,7 @@
161
176
 
162
177
  compile = async function() {
163
178
  var backupFiles, backupName, backupPath, clearBackups, compilerProcess, config, debounceTimeout, dirName, enabledOptions, enabledOptionsList, error, execCommand, execCommandParts, execOtherOptionStrings, fileName, hash, i, item, items, lastError, len, milkee, milkeeOptions, options, originalPath, restoreBackups, spawnArgs, stat, summary, targetDir, toContinue;
179
+ checkLatest();
164
180
  checkCoffee();
165
181
  if (!fs.existsSync(CONFIG_PATH)) {
166
182
  consola.error(`\`${CONFIG_FILE}\` not found in this directory: ${CWD}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "milkee",
3
- "version": "2.1.3",
3
+ "version": "2.2.0-dev.0",
4
4
  "description": "A simple CoffeeScript build tool with coffee.config.cjs",
5
5
  "main": "dist/main.js",
6
6
  "bin": {
@@ -34,6 +34,7 @@
34
34
  "dependencies": {
35
35
  "@milkee/d": "^0.2.0",
36
36
  "consola": "^3.4.2",
37
+ "is-package-latest": "^1.0.0",
37
38
  "yargs": "^18.0.0"
38
39
  },
39
40
  "devDependencies": {
package/.gitattributes DELETED
@@ -1,2 +0,0 @@
1
- *.coffee linguist-language=CoffeeScript
2
- dist/* linguist-generated