@bigbinary/neeto-playwright-commons 3.0.0 → 3.0.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/configs/eslint/common.js +128 -0
- package/configs/eslint/host.js +42 -0
- package/configs/scripts/jsdoc-builder/constants.mjs +41 -0
- package/configs/scripts/jsdoc-builder/utils.mjs +257 -0
- package/package.json +3 -4
- package/build/compiled/constants/selectors/index.d.ts +0 -28
- package/build/compiled/constants/selectors/index.js +0 -29
- package/build/compiled/constants/selectors/index.js.map +0 -1
- package/build/compiled/fixtures/index.d.ts +0 -5
- package/build/compiled/fixtures/index.js +0 -6
- package/build/compiled/fixtures/index.js.map +0 -1
- package/build/compiled/index.d.ts +0 -74
- package/build/compiled/index.js +0 -80
- package/build/compiled/index.js.map +0 -1
- package/src/constants/selectors/index.ts +0 -28
- package/src/fixtures/index.ts +0 -12
- package/src/index.ts +0 -145
- package/typeTemplates/index.d.ts +0 -3061
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import neeto from "@bigbinary/eslint-plugin-neeto";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import tsEslint from "@typescript-eslint/eslint-plugin";
|
|
4
|
+
import tsParser from "@typescript-eslint/parser";
|
|
5
|
+
import playwrightPlugin from "eslint-plugin-playwright";
|
|
6
|
+
import importPlugin from "eslint-plugin-import";
|
|
7
|
+
import globals from "globals";
|
|
8
|
+
import path from "path";
|
|
9
|
+
|
|
10
|
+
const commonEslintConfig = ({
|
|
11
|
+
ignores = [],
|
|
12
|
+
extendsOverrides = [],
|
|
13
|
+
overrideRules = {},
|
|
14
|
+
tsconfigRootDir = "",
|
|
15
|
+
}) => {
|
|
16
|
+
const configs = [
|
|
17
|
+
js.configs.recommended,
|
|
18
|
+
{
|
|
19
|
+
ignores: [...ignores],
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
files: ["**/*.ts", "**/*.spec.ts"],
|
|
24
|
+
ignores: ["**/*.d.ts"],
|
|
25
|
+
languageOptions: {
|
|
26
|
+
parser: tsParser,
|
|
27
|
+
parserOptions: {
|
|
28
|
+
ecmaVersion: "latest",
|
|
29
|
+
sourceType: "module",
|
|
30
|
+
tsconfigRootDir,
|
|
31
|
+
project: ["./tsconfig.json"],
|
|
32
|
+
},
|
|
33
|
+
globals: {
|
|
34
|
+
...globals.browser,
|
|
35
|
+
...globals.es2021,
|
|
36
|
+
...globals.node,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
plugins: {
|
|
40
|
+
"@typescript-eslint": tsEslint,
|
|
41
|
+
playwright: playwrightPlugin,
|
|
42
|
+
import: importPlugin,
|
|
43
|
+
"@bigbinary/neeto": neeto,
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
...tsEslint.configs.recommended.rules,
|
|
47
|
+
...playwrightPlugin.configs.recommended.rules,
|
|
48
|
+
|
|
49
|
+
"@bigbinary/neeto/use-dayjs-from-neeto-commons-fronted": "off",
|
|
50
|
+
"@bigbinary/neeto/use-array-methods": "off",
|
|
51
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
52
|
+
"no-unused-vars": "off",
|
|
53
|
+
"@typescript-eslint/no-unused-vars": [
|
|
54
|
+
"error",
|
|
55
|
+
{ destructuredArrayIgnorePattern: "^_" },
|
|
56
|
+
],
|
|
57
|
+
"@typescript-eslint/no-explicit-any": [
|
|
58
|
+
"error",
|
|
59
|
+
{ ignoreRestArgs: true },
|
|
60
|
+
],
|
|
61
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
62
|
+
"error",
|
|
63
|
+
{ allowShortCircuit: true, allowTernary: true },
|
|
64
|
+
],
|
|
65
|
+
|
|
66
|
+
"playwright/expect-expect": "off",
|
|
67
|
+
"playwright/no-conditional-in-test": "warn",
|
|
68
|
+
"playwright/no-nth-methods": "error",
|
|
69
|
+
"playwright/no-page-pause": "error",
|
|
70
|
+
"playwright/no-raw-locators": "warn",
|
|
71
|
+
"playwright/no-useless-await": "error",
|
|
72
|
+
"playwright/no-useless-not": "error",
|
|
73
|
+
"playwright/no-wait-for-timeout": "error",
|
|
74
|
+
"playwright/prefer-strict-equal": "warn",
|
|
75
|
+
"playwright/prefer-to-be": "warn",
|
|
76
|
+
"playwright/prefer-to-contain": "error",
|
|
77
|
+
"playwright/prefer-to-have-count": "error",
|
|
78
|
+
"playwright/prefer-to-have-length": "error",
|
|
79
|
+
"playwright/prefer-web-first-assertions": "error",
|
|
80
|
+
"playwright/require-top-level-describe": "error",
|
|
81
|
+
"playwright/require-soft-assertions": "off",
|
|
82
|
+
"playwright/valid-expect": "error",
|
|
83
|
+
"playwright/no-standalone-expect": "warn",
|
|
84
|
+
"playwright/valid-title": [
|
|
85
|
+
"warn",
|
|
86
|
+
{ mustMatch: { test: "^(must|should)" }, ignoreTypeOfStepName: true },
|
|
87
|
+
],
|
|
88
|
+
"playwright/prefer-lowercase-title": [
|
|
89
|
+
"error",
|
|
90
|
+
{ ignoreTopLevelDescribe: true, allowedPrefixes: ["Step"] },
|
|
91
|
+
],
|
|
92
|
+
"import/order": [
|
|
93
|
+
"error",
|
|
94
|
+
{
|
|
95
|
+
"newlines-between": "always",
|
|
96
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
97
|
+
warnOnUnassignedImports: true,
|
|
98
|
+
groups: [
|
|
99
|
+
"builtin",
|
|
100
|
+
"external",
|
|
101
|
+
"internal",
|
|
102
|
+
"index",
|
|
103
|
+
"sibling",
|
|
104
|
+
"parent",
|
|
105
|
+
"object",
|
|
106
|
+
"type",
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
...overrideRules,
|
|
111
|
+
},
|
|
112
|
+
settings: {
|
|
113
|
+
"import/resolver": {
|
|
114
|
+
typescript: {
|
|
115
|
+
alwaysTryTypes: true,
|
|
116
|
+
project: path.join(tsconfigRootDir, "tsconfig.json"),
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
...extendsOverrides,
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
return configs;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default commonEslintConfig;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import eslintConfig from "./common.js";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
|
+
import { dirname } from "path";
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const hostEslintConfig = ({ rules = {}, tsconfigRootDir = "", ignores }) => {
|
|
10
|
+
return eslintConfig({
|
|
11
|
+
tsconfigRootDir,
|
|
12
|
+
overrideRules: {
|
|
13
|
+
"import/named": "off",
|
|
14
|
+
"react-hooks/rules-of-hooks": "off",
|
|
15
|
+
"@bigbinary/neeto/no-missing-localization": [
|
|
16
|
+
"warn",
|
|
17
|
+
{
|
|
18
|
+
translationsDir: path.resolve(
|
|
19
|
+
__dirname,
|
|
20
|
+
"../../../../../..",
|
|
21
|
+
"app/javascript/src/translations"
|
|
22
|
+
),
|
|
23
|
+
languages: ["en"],
|
|
24
|
+
nanosTranslationDir: [
|
|
25
|
+
path.resolve(
|
|
26
|
+
__dirname,
|
|
27
|
+
"../../../../../..",
|
|
28
|
+
"node_modules/@bigbinary/neeto-commons-frontend/translations"
|
|
29
|
+
),
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
"@bigbinary/neeto/use-standard-date-time-formats": "warn",
|
|
34
|
+
"@bigbinary/neeto/no-dangling-constants": "off",
|
|
35
|
+
"@bigbinary/neeto/use-webpack-alias": "off",
|
|
36
|
+
...rules,
|
|
37
|
+
},
|
|
38
|
+
ignores,
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default hostEslintConfig;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { complement, startsWith } from "ramda";
|
|
2
|
+
|
|
3
|
+
export const REMARK_NODE_TYPES = {
|
|
4
|
+
HTML: "html",
|
|
5
|
+
PARAGRAPH: "paragraph",
|
|
6
|
+
CODE: "code",
|
|
7
|
+
HEADING: "heading",
|
|
8
|
+
TEXT: "text",
|
|
9
|
+
INLINE_CODE: "inlineCode",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const BABEL_NODE_TYPES = { IDENTIFIER: "Identifier" };
|
|
13
|
+
|
|
14
|
+
export const SUBHEADING_PATTERN = { type: REMARK_NODE_TYPES.HEADING, depth: 2 };
|
|
15
|
+
export const HTML_PATTERN = { type: REMARK_NODE_TYPES.HTML };
|
|
16
|
+
export const IMG_PATTERN = {
|
|
17
|
+
type: REMARK_NODE_TYPES.HTML,
|
|
18
|
+
value: startsWith("<img"),
|
|
19
|
+
};
|
|
20
|
+
export const CODE_PATTERN = { type: REMARK_NODE_TYPES.CODE };
|
|
21
|
+
export const PARAGRAPH_PATTERN = { type: REMARK_NODE_TYPES.PARAGRAPH };
|
|
22
|
+
export const HTML_EXCEPT_IMG_PATTERN = {
|
|
23
|
+
type: REMARK_NODE_TYPES.HTML,
|
|
24
|
+
value: complement(startsWith("<img")),
|
|
25
|
+
};
|
|
26
|
+
export const INLINE_CODE_PATTERN = { type: REMARK_NODE_TYPES.INLINE_CODE };
|
|
27
|
+
export const TEXT_PATTERN = { type: REMARK_NODE_TYPES.TEXT };
|
|
28
|
+
export const DOCS_FOLDER_NAME = "docs";
|
|
29
|
+
export const TYPES_FOLDER_NAME = "typeTemplates";
|
|
30
|
+
export const EXPORTED_TYPES_FOLDER_NAME = "."; // root
|
|
31
|
+
|
|
32
|
+
export const JSDOC_IMG_HEIGHT = "200";
|
|
33
|
+
export const JSDOC_IMG_WIDTH = "300";
|
|
34
|
+
|
|
35
|
+
export const DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT = "\n *\n";
|
|
36
|
+
export const LINE_BREAK = "\n";
|
|
37
|
+
export const JSDOC_EXAMPLE_TAG = "@example ";
|
|
38
|
+
export const JSDOC_END_EXAMPLE_TAG = "@endexample";
|
|
39
|
+
export const ASTERISK = "*";
|
|
40
|
+
export const ASTERISK_WITH_SPACES = " * ";
|
|
41
|
+
export const WHITESPACE_PARENTHESIS_REGEX = /[\s()]/g;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
import * as babelParser from "@babel/parser";
|
|
5
|
+
import { mergeLeft } from "ramda";
|
|
6
|
+
import remarkParse from "remark-parse";
|
|
7
|
+
import { unified } from "unified";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
ASTERISK,
|
|
11
|
+
ASTERISK_WITH_SPACES,
|
|
12
|
+
CODE_PATTERN,
|
|
13
|
+
DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT,
|
|
14
|
+
HTML_EXCEPT_IMG_PATTERN,
|
|
15
|
+
IMG_PATTERN,
|
|
16
|
+
JSDOC_EXAMPLE_TAG,
|
|
17
|
+
JSDOC_END_EXAMPLE_TAG,
|
|
18
|
+
JSDOC_IMG_HEIGHT,
|
|
19
|
+
JSDOC_IMG_WIDTH,
|
|
20
|
+
LINE_BREAK,
|
|
21
|
+
PARAGRAPH_PATTERN,
|
|
22
|
+
SUBHEADING_PATTERN,
|
|
23
|
+
TYPES_FOLDER_NAME,
|
|
24
|
+
WHITESPACE_PARENTHESIS_REGEX,
|
|
25
|
+
} from "./constants.mjs";
|
|
26
|
+
import * as babelTypes from "@babel/types";
|
|
27
|
+
import _traverse from "@babel/traverse";
|
|
28
|
+
import _generate from "@babel/generator";
|
|
29
|
+
|
|
30
|
+
import { matches } from "@bigbinary/neeto-cist";
|
|
31
|
+
import { endsWith } from "ramda";
|
|
32
|
+
|
|
33
|
+
const traverse = _traverse.default;
|
|
34
|
+
const generate = _generate.default;
|
|
35
|
+
|
|
36
|
+
const removeWhiteSpaceAndParentheses = string =>
|
|
37
|
+
string.replace(WHITESPACE_PARENTHESIS_REGEX, "");
|
|
38
|
+
|
|
39
|
+
const addLeadingCommentForTextWithLineBreaks = ({
|
|
40
|
+
text,
|
|
41
|
+
addCommentForFirstItem = true,
|
|
42
|
+
addDoubleLineBreaks = true,
|
|
43
|
+
}) => {
|
|
44
|
+
if (!hasLineBreaks(text)) return addLeadingComment(text);
|
|
45
|
+
const joinString = addDoubleLineBreaks
|
|
46
|
+
? DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT
|
|
47
|
+
: LINE_BREAK;
|
|
48
|
+
|
|
49
|
+
return text
|
|
50
|
+
.split(LINE_BREAK)
|
|
51
|
+
.map((item, idx) => {
|
|
52
|
+
if (!addCommentForFirstItem && idx === 0) return item;
|
|
53
|
+
|
|
54
|
+
return addLeadingComment(item);
|
|
55
|
+
})
|
|
56
|
+
.join(joinString);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const addLeadingComment = (text, trimWhiteSpace = false) =>
|
|
60
|
+
(trimWhiteSpace ? ASTERISK : ASTERISK_WITH_SPACES) + text;
|
|
61
|
+
|
|
62
|
+
const transformCode = node => {
|
|
63
|
+
let text = "";
|
|
64
|
+
text += addLeadingComment(JSDOC_EXAMPLE_TAG);
|
|
65
|
+
text += DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT;
|
|
66
|
+
text += addLeadingCommentForTextWithLineBreaks({
|
|
67
|
+
text: removeCommentTags(node.value),
|
|
68
|
+
addDoubleLineBreaks: false,
|
|
69
|
+
});
|
|
70
|
+
text += LINE_BREAK;
|
|
71
|
+
text += addLeadingComment(JSDOC_END_EXAMPLE_TAG);
|
|
72
|
+
text += LINE_BREAK;
|
|
73
|
+
|
|
74
|
+
return text;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const hasLineBreaks = text => text?.includes(LINE_BREAK);
|
|
78
|
+
|
|
79
|
+
const getParagraphChildrenText = node => {
|
|
80
|
+
const children = node.children;
|
|
81
|
+
if (children.length === 1) return children[0].value;
|
|
82
|
+
|
|
83
|
+
return children
|
|
84
|
+
.map(child => child.value || child.children?.[0]?.value)
|
|
85
|
+
.join("");
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const transformParagraph = node => {
|
|
89
|
+
let text = "";
|
|
90
|
+
text += ASTERISK_WITH_SPACES;
|
|
91
|
+
const childrenText = getParagraphChildrenText(node);
|
|
92
|
+
|
|
93
|
+
if (hasLineBreaks(childrenText)) {
|
|
94
|
+
text += addLeadingCommentForTextWithLineBreaks({
|
|
95
|
+
text: childrenText,
|
|
96
|
+
addCommentForFirstItem: false,
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
text += childrenText;
|
|
100
|
+
}
|
|
101
|
+
text += DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT;
|
|
102
|
+
|
|
103
|
+
return text;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const transformImg = node => {
|
|
107
|
+
const { src, alt } = parseImgTag(node.value);
|
|
108
|
+
let text = ASTERISK_WITH_SPACES;
|
|
109
|
+
text += ``;
|
|
110
|
+
text += DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT;
|
|
111
|
+
|
|
112
|
+
return text;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const transformNodesToText = nodes => {
|
|
116
|
+
let text = DOUBLE_LINE_BREAK_WITH_LEADING_COMMENT;
|
|
117
|
+
|
|
118
|
+
nodes.forEach(node => {
|
|
119
|
+
if (matches(CODE_PATTERN, node)) {
|
|
120
|
+
text += transformCode(node);
|
|
121
|
+
} else if (matches(IMG_PATTERN, node)) {
|
|
122
|
+
text += transformImg(node);
|
|
123
|
+
} else if (matches(PARAGRAPH_PATTERN, node)) {
|
|
124
|
+
text += transformParagraph(node);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return addLeadingComment(text, true);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const parseImgTag = imgTagStr =>
|
|
132
|
+
imgTagStr.split(" ").reduce((acc, item) => {
|
|
133
|
+
let [attrName, attrValue] = item.split("=");
|
|
134
|
+
attrValue = attrValue?.replaceAll(">", "").replaceAll('"', "");
|
|
135
|
+
|
|
136
|
+
return mergeLeft({ [attrName]: attrValue }, acc);
|
|
137
|
+
}, {});
|
|
138
|
+
|
|
139
|
+
const removeCommentTags = str => str.replaceAll("/*", "").replaceAll("*/", "");
|
|
140
|
+
|
|
141
|
+
export const parseTypeFile = typeFileContent =>
|
|
142
|
+
babelParser.parse(typeFileContent, {
|
|
143
|
+
sourceType: "module",
|
|
144
|
+
plugins: [["typescript", { dts: true }]],
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export const buildEntityTitleToEntityDescMap = (nodes, map) => {
|
|
148
|
+
nodes.forEach((node, idx) => {
|
|
149
|
+
if (!matches(SUBHEADING_PATTERN, node)) return;
|
|
150
|
+
|
|
151
|
+
const entityName = removeWhiteSpaceAndParentheses(node.children[0].value);
|
|
152
|
+
const entityRightSiblings = [];
|
|
153
|
+
|
|
154
|
+
for (let i = idx + 1; i < nodes.length; i++) {
|
|
155
|
+
const siblingNode = nodes[i];
|
|
156
|
+
|
|
157
|
+
if (matches(HTML_EXCEPT_IMG_PATTERN, siblingNode)) continue;
|
|
158
|
+
|
|
159
|
+
if (matches(SUBHEADING_PATTERN, siblingNode)) break;
|
|
160
|
+
|
|
161
|
+
entityRightSiblings.push(siblingNode);
|
|
162
|
+
}
|
|
163
|
+
const entityRightSiblingsText = transformNodesToText(entityRightSiblings);
|
|
164
|
+
map[entityName] = entityRightSiblingsText;
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const syncTypeFiles = exportedTypesFolderName => {
|
|
169
|
+
const sourceDir = path.resolve(TYPES_FOLDER_NAME);
|
|
170
|
+
const destDir = path.resolve(exportedTypesFolderName);
|
|
171
|
+
|
|
172
|
+
fs.cpSync(sourceDir, destDir, { recursive: true });
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const getFileNameList = dirPath => {
|
|
176
|
+
let files = [];
|
|
177
|
+
const items = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
178
|
+
|
|
179
|
+
for (const item of items) {
|
|
180
|
+
if (item.isDirectory()) {
|
|
181
|
+
files = [...files, ...getFileNameList(path.join(dirPath, item.name))];
|
|
182
|
+
} else {
|
|
183
|
+
files.push(path.join(dirPath, item.name));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return files;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export const getFileContent = fileName =>
|
|
191
|
+
fs.readFileSync(path.resolve(fileName), "utf8").toString();
|
|
192
|
+
|
|
193
|
+
export const parseMarkdown = fileContent =>
|
|
194
|
+
unified().use(remarkParse).parse(fileContent);
|
|
195
|
+
|
|
196
|
+
export const defaultTypeFileTraverser = options => {
|
|
197
|
+
traverse(options.typeFileAST, {
|
|
198
|
+
VariableDeclaration: ({ node }) =>
|
|
199
|
+
handleNode({
|
|
200
|
+
node,
|
|
201
|
+
options,
|
|
202
|
+
extractEntityName: findVariableDeclarationName,
|
|
203
|
+
}),
|
|
204
|
+
ClassProperty: ({ node }) =>
|
|
205
|
+
handleNode({ node, options, extractEntityName: findClassPropertyName }),
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const findVariableDeclarationName = node =>
|
|
210
|
+
node?.declarations?.[0]?.id?.name || node?.declaration?.id?.name;
|
|
211
|
+
|
|
212
|
+
export const isUtil = entityName => endsWith("Utils", entityName);
|
|
213
|
+
|
|
214
|
+
export const findClassPropertyName = node => node?.key?.name;
|
|
215
|
+
|
|
216
|
+
export const handleEntity = (
|
|
217
|
+
node,
|
|
218
|
+
entityTitleToDescMapOfAllFiles,
|
|
219
|
+
entityName
|
|
220
|
+
) => {
|
|
221
|
+
const entityDesc = entityTitleToDescMapOfAllFiles[entityName];
|
|
222
|
+
|
|
223
|
+
if (!entityName || !entityDesc) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
babelTypes.addComment(node, "leading", entityDesc);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const handleUtilityMethods = (node, entityTitleToDescMapOfAllFiles) => {
|
|
231
|
+
const members =
|
|
232
|
+
node?.declarations?.[0]?.id?.typeAnnotation?.typeAnnotation?.members;
|
|
233
|
+
|
|
234
|
+
members?.map(methodNode => {
|
|
235
|
+
handleEntity(
|
|
236
|
+
methodNode,
|
|
237
|
+
entityTitleToDescMapOfAllFiles,
|
|
238
|
+
methodNode.key.name
|
|
239
|
+
);
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export const handleNode = ({
|
|
244
|
+
node,
|
|
245
|
+
extractEntityName,
|
|
246
|
+
options: { entityTitleToDescMapOfAllFiles, typeFileName, typeFileAST },
|
|
247
|
+
}) => {
|
|
248
|
+
const entityName = extractEntityName(node);
|
|
249
|
+
|
|
250
|
+
isUtil(entityName)
|
|
251
|
+
? handleUtilityMethods(node, entityTitleToDescMapOfAllFiles)
|
|
252
|
+
: handleEntity(node, entityTitleToDescMapOfAllFiles, entityName);
|
|
253
|
+
|
|
254
|
+
const { code } = generate(typeFileAST, {});
|
|
255
|
+
|
|
256
|
+
fs.writeFileSync(path.resolve(typeFileName), code);
|
|
257
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-playwright-commons",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A package encapsulating common playwright code across neeto projects.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-playwright-commons.git",
|
|
6
6
|
"license": "apache-2.0",
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
"yarn": ">=1.22"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
|
-
"index.*",
|
|
24
|
-
"
|
|
25
|
-
"configs/*",
|
|
23
|
+
"/index.*",
|
|
24
|
+
"configs/**",
|
|
26
25
|
"scripts/**"
|
|
27
26
|
],
|
|
28
27
|
"lint-staged": {
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export * from "./common";
|
|
2
|
-
export * from "./configure";
|
|
3
|
-
export * from "./editor";
|
|
4
|
-
export * from "./embed";
|
|
5
|
-
export * from "./filters";
|
|
6
|
-
export * from "./helpCenter";
|
|
7
|
-
export * from "./imageUploader";
|
|
8
|
-
export * from "./login";
|
|
9
|
-
export * from "./members";
|
|
10
|
-
export * from "./profileSection";
|
|
11
|
-
export * from "./roles";
|
|
12
|
-
export * from "./signup";
|
|
13
|
-
export * from "./tab";
|
|
14
|
-
export * from "./tags";
|
|
15
|
-
export * from "./widgets";
|
|
16
|
-
export * from "./integrations/common";
|
|
17
|
-
export * from "./integrations/google";
|
|
18
|
-
export * from "./integrations/slack";
|
|
19
|
-
export * from "./integrations/webhooks";
|
|
20
|
-
export * from "./integrations/zapier";
|
|
21
|
-
export * from "./integrations/twilio";
|
|
22
|
-
export * from "./table";
|
|
23
|
-
export * from "./themes";
|
|
24
|
-
export * from "./adminPanel";
|
|
25
|
-
export * from "./datePicker";
|
|
26
|
-
export * from "./onboarding";
|
|
27
|
-
export * from "./seo";
|
|
28
|
-
export * from "./integrations/microsoft";
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export * from "./common";
|
|
2
|
-
export * from "./configure";
|
|
3
|
-
export * from "./editor";
|
|
4
|
-
export * from "./embed";
|
|
5
|
-
export * from "./filters";
|
|
6
|
-
export * from "./helpCenter";
|
|
7
|
-
export * from "./imageUploader";
|
|
8
|
-
export * from "./login";
|
|
9
|
-
export * from "./members";
|
|
10
|
-
export * from "./profileSection";
|
|
11
|
-
export * from "./roles";
|
|
12
|
-
export * from "./signup";
|
|
13
|
-
export * from "./tab";
|
|
14
|
-
export * from "./tags";
|
|
15
|
-
export * from "./widgets";
|
|
16
|
-
export * from "./integrations/common";
|
|
17
|
-
export * from "./integrations/google";
|
|
18
|
-
export * from "./integrations/slack";
|
|
19
|
-
export * from "./integrations/webhooks";
|
|
20
|
-
export * from "./integrations/zapier";
|
|
21
|
-
export * from "./integrations/twilio";
|
|
22
|
-
export * from "./table";
|
|
23
|
-
export * from "./themes";
|
|
24
|
-
export * from "./adminPanel";
|
|
25
|
-
export * from "./datePicker";
|
|
26
|
-
export * from "./onboarding";
|
|
27
|
-
export * from "./seo";
|
|
28
|
-
export * from "./integrations/microsoft";
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/constants/selectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC;AACtB,cAAc,0BAA0B,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { CustomFixture, commands } from "./commands";
|
|
2
|
-
import { generateStagingData } from "./stagingData";
|
|
3
|
-
import stealthTest from "./stealth";
|
|
4
|
-
import { i18nFixture } from "./translations";
|
|
5
|
-
export { i18nFixture, generateStagingData, CustomFixture, commands, stealthTest, };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { commands } from "./commands";
|
|
2
|
-
import { generateStagingData } from "./stagingData";
|
|
3
|
-
import stealthTest from "./stealth";
|
|
4
|
-
import { i18nFixture } from "./translations";
|
|
5
|
-
export { i18nFixture, generateStagingData, commands, stealthTest, };
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fixtures/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,QAAQ,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,WAAW,EACX,mBAAmB,EAEnB,QAAQ,EACR,WAAW,GACZ,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { ApiKeysApi } from "@apis/apiKeys";
|
|
2
|
-
import { CustomDomainApi } from "@apis/customDomain";
|
|
3
|
-
import { IpRestrictionsApi } from "@apis/ipRestrictions";
|
|
4
|
-
import { MemberApis } from "@apis/members";
|
|
5
|
-
import { NeetoEmailDeliveryApi } from "@apis/neetoEmailDelivery";
|
|
6
|
-
import { RailsEmailApiClient } from "@apis/railsEmailApi";
|
|
7
|
-
import { RoleApis } from "@apis/roles";
|
|
8
|
-
import { SecurityApi } from "@apis/security";
|
|
9
|
-
import { TagsApi } from "@apis/tags";
|
|
10
|
-
import { ThankYouApi } from "@apis/thankYou";
|
|
11
|
-
import { NeetoTowerApi } from "@apis/thirdParty/neetoTower";
|
|
12
|
-
import { SlackApi } from "@apis/thirdParty/slack";
|
|
13
|
-
import { WebhookSiteApi } from "@apis/thirdParty/webhookSite";
|
|
14
|
-
import { TwilioApi } from "@apis/twilio";
|
|
15
|
-
import { i18nFixture, generateStagingData, CustomFixture, commands, stealthTest } from "@fixtures";
|
|
16
|
-
import ThankYouPage from "@poms/configure/thankYou";
|
|
17
|
-
import EmbedBase from "@poms/embedBase";
|
|
18
|
-
import HelpAndProfilePage from "@poms/helpAndProfile";
|
|
19
|
-
import GooglePage from "@poms/integrations/google";
|
|
20
|
-
import IntegrationBase from "@poms/integrations/integrationBase";
|
|
21
|
-
import MicrosoftPage from "@poms/integrations/microsoft";
|
|
22
|
-
import SlackPage from "@poms/integrations/slack";
|
|
23
|
-
import WebhooksPage from "@poms/integrations/webhooks";
|
|
24
|
-
import ZapierPage from "@poms/integrations/zapier";
|
|
25
|
-
import Member from "@poms/members";
|
|
26
|
-
import EditorPage from "@poms/neeto/editor";
|
|
27
|
-
import ImageUploader from "@poms/neeto/imageUploader";
|
|
28
|
-
import TeamMembers from "@poms/neeto/teamMembers";
|
|
29
|
-
import OrganizationPage from "@poms/organizations";
|
|
30
|
-
import ApiKeysPage from "@poms/settings/apiKeys";
|
|
31
|
-
import AuditLogsPage from "@poms/settings/auditLogs";
|
|
32
|
-
import CustomDomainPage from "@poms/settings/customDomain";
|
|
33
|
-
import IPRestrictionsPage from "@poms/settings/ipRestrictions";
|
|
34
|
-
import RolesPage from "@poms/settings/roles";
|
|
35
|
-
import SidebarSection from "@poms/sidebar";
|
|
36
|
-
import TagsPage from "@poms/tags";
|
|
37
|
-
import CustomCommands from "@utils/commands";
|
|
38
|
-
import { EmailDeliveryUtils } from "@utils/emailDeliveryUtils";
|
|
39
|
-
import MailerUtils from "@utils/mailerUtils";
|
|
40
|
-
import { RailsEmailUtils } from "@utils/railsEmailUtils";
|
|
41
|
-
export * from "@constants/common";
|
|
42
|
-
export * from "@constants/userAgents";
|
|
43
|
-
export * from "@routes";
|
|
44
|
-
export * from "@constants/networkConditions";
|
|
45
|
-
export * from "@constants/fileFormats";
|
|
46
|
-
export * from "@constants/members";
|
|
47
|
-
export * from "@constants/auditLogs";
|
|
48
|
-
export * from "@constants/keyboardShortcuts";
|
|
49
|
-
export * from "@texts";
|
|
50
|
-
export * from "@constants/editorTexts";
|
|
51
|
-
export * from "@constants/phoneNumberFormats";
|
|
52
|
-
export * from "@selectors";
|
|
53
|
-
export * from "@utils/authentication";
|
|
54
|
-
export * from "@utils/common";
|
|
55
|
-
export * from "@utils/login";
|
|
56
|
-
export * from "@utils/organization";
|
|
57
|
-
export * from "@utils/table";
|
|
58
|
-
export * from "@utils/qrcode";
|
|
59
|
-
export * from "@utils/totp";
|
|
60
|
-
export * from "@utils/throttle";
|
|
61
|
-
export * from "@utils/embed";
|
|
62
|
-
export * from "@utils/filters";
|
|
63
|
-
export * from "@utils/imageUploader";
|
|
64
|
-
export * from "@utils/currencyFormat";
|
|
65
|
-
export * from "@utils/isGithubIssueOpen";
|
|
66
|
-
export * from "@utils/themes";
|
|
67
|
-
export * from "@utils/interactionUtils";
|
|
68
|
-
export * from "@utils/fileUtils";
|
|
69
|
-
export * from "@utils/phoneNumbers";
|
|
70
|
-
export { warmup } from "@utils/warmup";
|
|
71
|
-
export { default as NeetoAuthServer } from "@utils/neetoAuthServer";
|
|
72
|
-
export * from "./initializer";
|
|
73
|
-
export type { EmailDeliveryProvider, EmailDeliveryConnectParams, EmailDeliveryVerifyEmailParams, EmailDeliveryVerifiedEmail, EmailDeliveryVerifyEmailResponse, } from "@apis/neetoEmailDelivery";
|
|
74
|
-
export { CustomCommands, CustomFixture, commands, generateStagingData, i18nFixture, stealthTest, WebhooksPage, HelpAndProfilePage, OrganizationPage, MailerUtils, IntegrationBase, SlackPage, ZapierPage, EmbedBase, SidebarSection, TagsPage, ImageUploader, EditorPage, TeamMembers, ThankYouPage, GooglePage, Member, AuditLogsPage, RolesPage, ApiKeysPage, CustomDomainPage, MemberApis, RoleApis, TagsApi, SecurityApi, ThankYouApi, TwilioApi, NeetoTowerApi, SlackApi, ApiKeysApi, CustomDomainApi, IpRestrictionsApi, IPRestrictionsPage, MicrosoftPage, RailsEmailApiClient, RailsEmailUtils, WebhookSiteApi, NeetoEmailDeliveryApi, EmailDeliveryUtils, };
|