redput 1.3.0 → 1.5.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 +12 -0
- package/lib/parse-link.js +8 -0
- package/lib/redput.js +1 -3
- package/lib/write/index.js +8 -2
- package/lib/write/nested/prepare-rule/prepare-rule.js +13 -0
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
2023.08.17, v1.5.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 4cebd14 redput: add support of Mobile Putout Editor
|
|
5
|
+
|
|
6
|
+
2023.08.16, v1.4.0
|
|
7
|
+
|
|
8
|
+
feature:
|
|
9
|
+
- 6812e73 redput: prepare rule before write
|
|
10
|
+
- 49939c1 write: nested: convert to commonjs
|
|
11
|
+
- 52145ff write: nested: optional
|
|
12
|
+
|
|
1
13
|
2023.08.16, v1.3.0
|
|
2
14
|
|
|
3
15
|
feature:
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const PUTOUT_EDITOR = 'https://putout.cloudcmd.io/#/gist/';
|
|
2
|
+
export const MOBILE_PUTOUT_EDITOR = 'https://putout.vercel.app/#/gist/';
|
|
3
|
+
|
|
4
|
+
export const parseLink = (link) => {
|
|
5
|
+
return link
|
|
6
|
+
.replace(PUTOUT_EDITOR, '')
|
|
7
|
+
.replace(MOBILE_PUTOUT_EDITOR, '');
|
|
8
|
+
};
|
package/lib/redput.js
CHANGED
|
@@ -5,10 +5,8 @@ import {writePlugin} from './write/index.js';
|
|
|
5
5
|
|
|
6
6
|
const SUCCESS = [null, 'Done'];
|
|
7
7
|
|
|
8
|
-
const URL = 'https://putout.cloudcmd.io/#/gist/';
|
|
9
|
-
|
|
10
8
|
export const redput = async (link, {token}) => {
|
|
11
|
-
const gistLink = link
|
|
9
|
+
const gistLink = parseLink(link);
|
|
12
10
|
const [error, result] = await tryToCatch(readGist, gistLink, {
|
|
13
11
|
token,
|
|
14
12
|
});
|
package/lib/write/index.js
CHANGED
|
@@ -17,13 +17,12 @@ import tryToCatch from 'try-to-catch';
|
|
|
17
17
|
export const writePlugin = async (name, {rule, fixture, report}) => {
|
|
18
18
|
const [isNested] = await tryToCatch(access, './package.json');
|
|
19
19
|
|
|
20
|
-
if (isNested)
|
|
20
|
+
if (isNested)
|
|
21
21
|
return await writeNested(name, {
|
|
22
22
|
rule,
|
|
23
23
|
fixture,
|
|
24
24
|
report,
|
|
25
25
|
});
|
|
26
|
-
}
|
|
27
26
|
|
|
28
27
|
await writeSimple(name, {
|
|
29
28
|
rule,
|
|
@@ -36,6 +35,13 @@ export const writeNested = async (name, {rule, fixture, report}) => {
|
|
|
36
35
|
await writeNestedRule(name, rule);
|
|
37
36
|
await writeNestedFixtures(name, fixture);
|
|
38
37
|
await writeNestedTests(name, report);
|
|
38
|
+
|
|
39
|
+
await tryToCatch(writeNestedOptional, name, {
|
|
40
|
+
fixture,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const writeNestedOptional = async (name, {fixture}) => {
|
|
39
45
|
await updateNestedIndex(name);
|
|
40
46
|
await updateOverallNestedFixtures(name, fixture);
|
|
41
47
|
await updateOverallNestedTest(name);
|