wisdom 12.0.0 → 12.2.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/ChangeLog CHANGED
@@ -1,3 +1,32 @@
1
+ 2022.05.24, v12.2.0
2
+
3
+ feature:
4
+ - wisdom: build
5
+ - wisdom: improve messages
6
+
7
+
8
+ 2022.05.18, v12.1.1
9
+
10
+ feature:
11
+ - wisdom: improve messages
12
+
13
+
14
+ 2022.05.18, v12.1.0
15
+
16
+ feature:
17
+ - wisdom: add ability to check for 'repository' field of 'package.json'
18
+ - package: putout v26
19
+ - package: eslint-plugin-putout v15.1.1
20
+
21
+
22
+ 2022.04.22, v12.0.1
23
+
24
+ feature:
25
+ - package: eslint-plugin-putout v14.11.0
26
+ - package: madrun v9.0.2
27
+ - package: changelog-io v7.0.0
28
+
29
+
1
30
  2022.02.17, v12.0.0
2
31
 
3
32
  feature:
@@ -171,7 +200,7 @@ fix:
171
200
  2020.04.28, v10.3.3
172
201
 
173
202
  feature:
174
- - (wisdom) vesion-io v4.0.0
203
+ - (wisdom) version-io v4.0.0
175
204
  - (package) version-io v4.0.0
176
205
 
177
206
 
@@ -568,7 +597,7 @@ fix:
568
597
  2017.05.30, v5.1.1
569
598
 
570
599
  feature:
571
- - (wisdom) rm tag: has no sence, becouse of private
600
+ - (wisdom) rm tag: has no sense, because of private
572
601
  - (travis) node_js: 7 -> 8
573
602
 
574
603
 
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.0",
3
+ "version": "12.2.0",
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",
@@ -32,7 +33,7 @@
32
33
  },
33
34
  "dependencies": {
34
35
  "async": "^3.1.0",
35
- "changelog-io": "^6.0.2",
36
+ "changelog-io": "^7.0.0",
36
37
  "currify": "^4.0.0",
37
38
  "envir": "^2.0.0",
38
39
  "fullstore": "^3.0.0",
@@ -54,12 +55,14 @@
54
55
  },
55
56
  "devDependencies": {
56
57
  "c8": "^7.8.0",
58
+ "escover": "^2.1.2",
57
59
  "eslint": "^8.1.0",
58
60
  "eslint-plugin-node": "^11.0.0",
59
- "eslint-plugin-putout": "^13.0.1",
60
- "madrun": "^8.0.1",
61
+ "eslint-plugin-putout": "^15.1.1",
62
+ "madrun": "^9.0.2",
63
+ "mock-import": "^3.0.2",
61
64
  "montag": "^1.2.1",
62
- "putout": "^25.0.0",
65
+ "putout": "^26.0.0",
63
66
  "supertape": "^7.0.1"
64
67
  }
65
68
  }