wisdom 12.0.1 → 12.2.1

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/ChangeLog CHANGED
@@ -1,3 +1,30 @@
1
+ 2022.05.24, v12.2.1
2
+
3
+ fix:
4
+ - wisdom: add script
5
+
6
+
7
+ 2022.05.24, v12.2.0
8
+
9
+ feature:
10
+ - wisdom: build
11
+ - wisdom: improve messages
12
+
13
+
14
+ 2022.05.18, v12.1.1
15
+
16
+ feature:
17
+ - wisdom: improve messages
18
+
19
+
20
+ 2022.05.18, v12.1.0
21
+
22
+ feature:
23
+ - wisdom: add ability to check for 'repository' field of 'package.json'
24
+ - package: putout v26
25
+ - package: eslint-plugin-putout v15.1.1
26
+
27
+
1
28
  2022.04.22, v12.0.1
2
29
 
3
30
  feature:
@@ -179,7 +206,7 @@ fix:
179
206
  2020.04.28, v10.3.3
180
207
 
181
208
  feature:
182
- - (wisdom) vesion-io v4.0.0
209
+ - (wisdom) version-io v4.0.0
183
210
  - (package) version-io v4.0.0
184
211
 
185
212
 
@@ -576,7 +603,7 @@ fix:
576
603
  2017.05.30, v5.1.1
577
604
 
578
605
  feature:
579
- - (wisdom) rm tag: has no sence, becouse of private
606
+ - (wisdom) rm tag: has no sense, because of private
580
607
  - (travis) node_js: 7 -> 8
581
608
 
582
609
 
package/README.md CHANGED
@@ -22,7 +22,7 @@ One command do next things:
22
22
  - publish to npm;
23
23
  - run command from `scripts.wisdom:done` of `package.json` (if exist);
24
24
 
25
- `package.json` should contan next properties,
25
+ `package.json` should contain next properties,
26
26
 
27
27
  **when publish enabled:**
28
28
 
@@ -94,8 +94,9 @@ When you need configure `wisdom` you could declare them in `package.json` (**wit
94
94
  "private": false,
95
95
  "branch": "master",
96
96
  "scripts": {
97
- "wisdom": "echo 'do something before publish'",
98
- "wisdom:type": "echo 'do something before publish and add --patch, --minor or --major argument'",
97
+ "wisdom": "echo 'do something before starting'",
98
+ "wisdom:type": "echo 'do something before starting and add --patch, --minor or --major argument'",
99
+ "wisdom:build": "echo 'do something before publish'",
99
100
  "wisdom:done": "echo 'do something after publish'"
100
101
  }
101
102
  }
package/lib/release.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import grizzly from 'grizzly';
2
2
  import tryToCatch from 'try-to-catch';
3
+
3
4
  import {markdown} from './markdown.js';
4
5
 
5
6
  const isUndefined = (a) => typeof a === 'undefined';
6
-
7
7
  const rmScope = (a) => a.replace(/^@.*\//, '');
8
8
 
9
9
  export async function release({version, info, chlog, emitter, count}) {
@@ -13,13 +13,21 @@ export async function release({version, info, chlog, emitter, count}) {
13
13
  }
14
14
 
15
15
  const tag = 'v' + version;
16
+
17
+ if (!info.repository) {
18
+ emitter.emit('data', `Error releasing on github: no 'repository' field found in 'package.json'\n`);
19
+ return;
20
+ }
21
+
16
22
  const user = getUser(info);
17
23
  const repo = getRepoName(info);
24
+
25
+ emitter.emit('data', `${user}/${repo}@${tag}\n`);
26
+
18
27
  const name = rmScope(info.name) + ' ' + tag;
19
28
  const rawBody = chlog() || '';
20
29
  const body = markdown(rawBody);
21
30
 
22
- emitter.emit('data', `${user}/${repo}@${tag}\n`);
23
31
  emitter.emit('data', rawBody);
24
32
 
25
33
  const data = {
@@ -38,13 +46,13 @@ export async function release({version, info, chlog, emitter, count}) {
38
46
  }
39
47
 
40
48
  if (count <= 0) {
41
- emitter.emit('data', `Error releasing on github : ${error.message}`);
49
+ emitter.emit('data', `Error releasing on github: ${error.message}`);
42
50
  return;
43
51
  }
44
52
 
45
53
  --count;
46
54
 
47
- emitter.emit('data', `Error releasing on github : ${error.message}. ${count} tries left.\n`);
55
+ emitter.emit('data', `Error releasing on github: ${error.message}. ${count} tries left.\n`);
48
56
 
49
57
  return await release({
50
58
  version,
@@ -3,13 +3,13 @@ import checkAccess from './check-access.js';
3
3
 
4
4
  export const validatePackage = ({info, version, emitter}) => {
5
5
  if (!jessy('repository.url', info))
6
- return emitter.emit('data', '"repository.url" should be defined"');
6
+ return emitter.emit('data', `'repository.url' should be defined`);
7
7
 
8
8
  if (info.name.includes('@') && checkAccess(info))
9
9
  return emitter.emit(
10
10
  'data',
11
- `looks like ${info.name} has no access property\n` +
12
- `packages should have "access" property set to "public" or "restricted" inside "publishConfig"\n`,
11
+ `looks like '${info.name}' has no 'access' property\n` +
12
+ `packages should have 'access' property set to 'public' or 'restricted' inside 'publishConfig'\n`,
13
13
  );
14
14
 
15
15
  if (!version)
package/lib/wisdom.js CHANGED
@@ -97,7 +97,7 @@ function publish(version, info, emitter) {
97
97
  });
98
98
 
99
99
  series([
100
- async function beforePublish() {
100
+ async function beforeStart() {
101
101
  const cmd = jessy('scripts.wisdom', info);
102
102
 
103
103
  if (!cmd)
@@ -106,7 +106,7 @@ function publish(version, info, emitter) {
106
106
  await runWisdom('wisdom', '', version, info, emitter);
107
107
  },
108
108
 
109
- async function beforePublishType() {
109
+ async function beforeStartType() {
110
110
  const cmd = jessy('scripts.wisdom:type', info);
111
111
 
112
112
  if (!cmd)
@@ -165,6 +165,15 @@ function publish(version, info, emitter) {
165
165
  });
166
166
  },
167
167
 
168
+ async function build() {
169
+ const cmd = jessy('scripts.wisdom:build', info);
170
+
171
+ if (!cmd)
172
+ return;
173
+
174
+ await runWisdom('wisdom:build', '', version, info, emitter);
175
+ },
176
+
168
177
  function npmPublish(callback) {
169
178
  if (info.private)
170
179
  return callback();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wisdom",
3
- "version": "12.0.1",
3
+ "version": "12.2.1",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "configurable publish releases to github and npm",
6
6
  "homepage": "http://github.com/coderaiser/wisdom",
@@ -16,6 +16,7 @@
16
16
  "scripts": {
17
17
  "test": "madrun test",
18
18
  "coverage": "madrun coverage",
19
+ "coverage:old": "madrun coverage:old",
19
20
  "report": "madrun report",
20
21
  "wisdom": "madrun wisdom",
21
22
  "patch": "madrun patch",
@@ -23,6 +24,7 @@
23
24
  "major": "madrun major",
24
25
  "wisdom:type": "madrun wisdom:type",
25
26
  "wisdom:done": "madrun wisdom:done",
27
+ "wisdom:build": "madrun wisdom:build",
26
28
  "lint": "madrun lint",
27
29
  "fix:lint": "madrun fix:lint"
28
30
  },
@@ -54,12 +56,14 @@
54
56
  },
55
57
  "devDependencies": {
56
58
  "c8": "^7.8.0",
59
+ "escover": "^2.1.2",
57
60
  "eslint": "^8.1.0",
58
61
  "eslint-plugin-node": "^11.0.0",
59
- "eslint-plugin-putout": "^14.11.0",
62
+ "eslint-plugin-putout": "^15.1.1",
60
63
  "madrun": "^9.0.2",
64
+ "mock-import": "^3.0.2",
61
65
  "montag": "^1.2.1",
62
- "putout": "^25.0.0",
66
+ "putout": "^26.0.0",
63
67
  "supertape": "^7.0.1"
64
68
  }
65
69
  }