@hero-design/snowflake-guard 1.0.7-alpha0
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/.dockerignore +12 -0
- package/.env.example +9 -0
- package/.eslintrc.js +8 -0
- package/CHANGELOG.md +47 -0
- package/Dockerfile +8 -0
- package/LICENSE +15 -0
- package/README.md +33 -0
- package/app.yml +137 -0
- package/jest.config.js +9 -0
- package/lib/netlify/functions/snowflake.d.ts +2 -0
- package/lib/netlify/functions/snowflake.js +10 -0
- package/lib/src/__mocks__/sourceSample.d.ts +2 -0
- package/lib/src/__mocks__/sourceSample.js +27 -0
- package/lib/src/__tests__/parseSource.spec.d.ts +1 -0
- package/lib/src/__tests__/parseSource.spec.js +41 -0
- package/lib/src/index.d.ts +3 -0
- package/lib/src/index.js +142 -0
- package/lib/src/parseSource.d.ts +7 -0
- package/lib/src/parseSource.js +102 -0
- package/lib/src/parsers/typescript.d.ts +3 -0
- package/lib/src/parsers/typescript.js +37 -0
- package/lib/src/reports/constants.d.ts +215 -0
- package/lib/src/reports/constants.js +848 -0
- package/lib/src/reports/reportClassName.d.ts +3 -0
- package/lib/src/reports/reportClassName.js +15 -0
- package/lib/src/reports/reportCustomStyleProperties.d.ts +10 -0
- package/lib/src/reports/reportCustomStyleProperties.js +109 -0
- package/lib/src/reports/reportInlineStyle.d.ts +7 -0
- package/lib/src/reports/reportInlineStyle.js +179 -0
- package/lib/src/reports/reportStyledComponents.d.ts +6 -0
- package/lib/src/reports/reportStyledComponents.js +95 -0
- package/lib/src/reports/types.d.ts +3 -0
- package/lib/src/reports/types.js +2 -0
- package/lib/src/test.tsx +123 -0
- package/netlify/functions/snowflake.ts +9 -0
- package/netlify.toml +21 -0
- package/package.json +44 -0
- package/src/__mocks__/sourceSample.tsx +67 -0
- package/src/__tests__/parseSource.spec.ts +15 -0
- package/src/index.ts +201 -0
- package/src/parseSource.ts +97 -0
- package/src/parsers/typescript.ts +8 -0
- package/src/reports/constants.ts +965 -0
- package/src/reports/reportClassName.ts +20 -0
- package/src/reports/reportCustomStyleProperties.ts +125 -0
- package/src/reports/reportInlineStyle.ts +221 -0
- package/src/reports/reportStyledComponents.ts +109 -0
- package/src/reports/types.ts +5 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.parse = void 0;
|
|
30
|
+
const babelParser = __importStar(require("@babel/parser"));
|
|
31
|
+
const _babel_options_1 = __importDefault(require("recast/parsers/_babel_options"));
|
|
32
|
+
const parse = (source, options) => {
|
|
33
|
+
const babelOptions = (0, _babel_options_1.default)(options);
|
|
34
|
+
babelOptions.plugins.push('jsx', 'typescript');
|
|
35
|
+
return babelParser.parse(source, babelOptions);
|
|
36
|
+
};
|
|
37
|
+
exports.parse = parse;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
declare const RULESET_MAP: {
|
|
2
|
+
Alert: string[];
|
|
3
|
+
Badge: string[];
|
|
4
|
+
'Badge.Count': string[];
|
|
5
|
+
'Badge.Status': string[];
|
|
6
|
+
Banner: string[];
|
|
7
|
+
Breadcrumb: string[];
|
|
8
|
+
Button: string[];
|
|
9
|
+
'Button.Link': string[];
|
|
10
|
+
'Button.Icon': string[];
|
|
11
|
+
Card: string[];
|
|
12
|
+
'Card.Header': string[];
|
|
13
|
+
'Card.Content': string[];
|
|
14
|
+
Carousel: string[];
|
|
15
|
+
'Chart.Bar': string[];
|
|
16
|
+
'Chart.HorizontalBar': string[];
|
|
17
|
+
'Chart.Column': string[];
|
|
18
|
+
'Chart.Line': string[];
|
|
19
|
+
'Chart.Pie': string[];
|
|
20
|
+
'Chart.MultiplePie': string[];
|
|
21
|
+
Checkbox: string[];
|
|
22
|
+
'Checkbox.Group': string[];
|
|
23
|
+
'Checkbox.Button': string[];
|
|
24
|
+
'Checkbox.ButtonGroup': string[];
|
|
25
|
+
Collapse: string[];
|
|
26
|
+
Comment: string[];
|
|
27
|
+
'Comment.Editor': string[];
|
|
28
|
+
ContextPanel: string[];
|
|
29
|
+
'ContextPanel.Header': string[];
|
|
30
|
+
'ContextPanel.Body': string[];
|
|
31
|
+
'ContextPanel.Footer': string[];
|
|
32
|
+
'ContextPanel.CloseButton': string[];
|
|
33
|
+
DatePicker: string[];
|
|
34
|
+
'DatePicker.Range': string[];
|
|
35
|
+
'DatePicker.Month': string[];
|
|
36
|
+
'DatePicker.MonthRange': string[];
|
|
37
|
+
'DatePicker.Week': string[];
|
|
38
|
+
'DatePicker.Fortnightly': string[];
|
|
39
|
+
'DatePicker.SingleMonth': string[];
|
|
40
|
+
'DatePicker.SingleYear': string[];
|
|
41
|
+
Divider: string[];
|
|
42
|
+
Dropdown: string[];
|
|
43
|
+
Empty: string[];
|
|
44
|
+
'File.DragAndDrop': string[];
|
|
45
|
+
'File.UploadButton': string[];
|
|
46
|
+
Filters: string[];
|
|
47
|
+
'Filters.Label': string[];
|
|
48
|
+
'Filters.Filter': string[];
|
|
49
|
+
'Filters.Group': string[];
|
|
50
|
+
'Filters.Group.Filter': string[];
|
|
51
|
+
'Form.Field': string[];
|
|
52
|
+
Grid: string[];
|
|
53
|
+
'Grid.Row': string[];
|
|
54
|
+
'Grid.Col': string[];
|
|
55
|
+
Icon: string[];
|
|
56
|
+
InPageNavigation: string[];
|
|
57
|
+
Input: string[];
|
|
58
|
+
'Input.TextArea': string[];
|
|
59
|
+
MediaQuery: string[];
|
|
60
|
+
Menu: string[];
|
|
61
|
+
'Menu.Item': string[];
|
|
62
|
+
Modal: string[];
|
|
63
|
+
'Modal.PopUp': string[];
|
|
64
|
+
'Modal.Header': string[];
|
|
65
|
+
'Modal.Body': string[];
|
|
66
|
+
'Modal.Footer': string[];
|
|
67
|
+
'Modal.CloseButton': string[];
|
|
68
|
+
Notification: string[];
|
|
69
|
+
PageHeader: string[];
|
|
70
|
+
Pagination: string[];
|
|
71
|
+
Portlet: string[];
|
|
72
|
+
Progress: string[];
|
|
73
|
+
'Progress.Circle': string[];
|
|
74
|
+
Radio: string[];
|
|
75
|
+
'Radio.Group': string[];
|
|
76
|
+
'Radio.Button': string[];
|
|
77
|
+
'Radio.ButtonGroup': string[];
|
|
78
|
+
Rate: string[];
|
|
79
|
+
Result: string[];
|
|
80
|
+
Select: string[];
|
|
81
|
+
'Select.Multi': string[];
|
|
82
|
+
SelectButton: string[];
|
|
83
|
+
'SelectButton.Group': string[];
|
|
84
|
+
SideBar: string[];
|
|
85
|
+
'SideBar.Panel': string[];
|
|
86
|
+
Slider: string[];
|
|
87
|
+
Spinner: string[];
|
|
88
|
+
Statistic: string[];
|
|
89
|
+
Steps: string[];
|
|
90
|
+
Switch: string[];
|
|
91
|
+
Table: string[];
|
|
92
|
+
'Table.ActionButtons': string[];
|
|
93
|
+
'Table.BulkActions': string[];
|
|
94
|
+
'Table.RowAction': string[];
|
|
95
|
+
'Table.Filters': string[];
|
|
96
|
+
'Table.Filter': string[];
|
|
97
|
+
Tabs: string[];
|
|
98
|
+
'Tabs.Sub': string[];
|
|
99
|
+
Tag: string[];
|
|
100
|
+
TimePicker: string[];
|
|
101
|
+
Timeline: string[];
|
|
102
|
+
Tooltip: string[];
|
|
103
|
+
'Typography.Title': string[];
|
|
104
|
+
'Typography.Text': string[];
|
|
105
|
+
Widget: string[];
|
|
106
|
+
};
|
|
107
|
+
declare const SX_RULESET_MAP: {
|
|
108
|
+
Alert: string[];
|
|
109
|
+
Badge: string[];
|
|
110
|
+
'Badge.Count': string[];
|
|
111
|
+
'Badge.Status': string[];
|
|
112
|
+
Banner: string[];
|
|
113
|
+
Breadcrumb: string[];
|
|
114
|
+
Button: string[];
|
|
115
|
+
'Button.Link': string[];
|
|
116
|
+
'Button.Icon': string[];
|
|
117
|
+
Card: string[];
|
|
118
|
+
'Card.Header': string[];
|
|
119
|
+
'Card.Content': string[];
|
|
120
|
+
Carousel: string[];
|
|
121
|
+
'Chart.Bar': string[];
|
|
122
|
+
'Chart.HorizontalBar': string[];
|
|
123
|
+
'Chart.Column': string[];
|
|
124
|
+
'Chart.Line': string[];
|
|
125
|
+
'Chart.Pie': string[];
|
|
126
|
+
'Chart.MultiplePie': string[];
|
|
127
|
+
Checkbox: string[];
|
|
128
|
+
'Checkbox.Group': string[];
|
|
129
|
+
'Checkbox.Button': string[];
|
|
130
|
+
'Checkbox.ButtonGroup': string[];
|
|
131
|
+
Collapse: string[];
|
|
132
|
+
Comment: string[];
|
|
133
|
+
'Comment.Editor': string[];
|
|
134
|
+
ContextPanel: string[];
|
|
135
|
+
'ContextPanel.Header': string[];
|
|
136
|
+
'ContextPanel.Body': string[];
|
|
137
|
+
'ContextPanel.Footer': string[];
|
|
138
|
+
'ContextPanel.CloseButton': string[];
|
|
139
|
+
DatePicker: string[];
|
|
140
|
+
'DatePicker.Range': string[];
|
|
141
|
+
'DatePicker.Month': string[];
|
|
142
|
+
'DatePicker.MonthRange': string[];
|
|
143
|
+
'DatePicker.Week': string[];
|
|
144
|
+
'DatePicker.Fortnightly': string[];
|
|
145
|
+
'DatePicker.SingleMonth': string[];
|
|
146
|
+
'DatePicker.SingleYear': string[];
|
|
147
|
+
Divider: string[];
|
|
148
|
+
Dropdown: string[];
|
|
149
|
+
Empty: string[];
|
|
150
|
+
'File.DragAndDrop': string[];
|
|
151
|
+
'File.UploadButton': string[];
|
|
152
|
+
Filters: string[];
|
|
153
|
+
'Filters.Label': string[];
|
|
154
|
+
'Filters.Filter': string[];
|
|
155
|
+
'Filters.Group': string[];
|
|
156
|
+
'Filters.Group.Filter': string[];
|
|
157
|
+
'Form.Field': string[];
|
|
158
|
+
Grid: string[];
|
|
159
|
+
'Grid.Row': string[];
|
|
160
|
+
'Grid.Col': string[];
|
|
161
|
+
Icon: string[];
|
|
162
|
+
InPageNavigation: string[];
|
|
163
|
+
Input: string[];
|
|
164
|
+
'Input.TextArea': string[];
|
|
165
|
+
MediaQuery: string[];
|
|
166
|
+
Menu: string[];
|
|
167
|
+
'Menu.Item': string[];
|
|
168
|
+
Modal: string[];
|
|
169
|
+
'Modal.PopUp': string[];
|
|
170
|
+
'Modal.Header': string[];
|
|
171
|
+
'Modal.Body': string[];
|
|
172
|
+
'Modal.Footer': string[];
|
|
173
|
+
'Modal.CloseButton': string[];
|
|
174
|
+
Notification: string[];
|
|
175
|
+
PageHeader: string[];
|
|
176
|
+
Pagination: string[];
|
|
177
|
+
Portlet: string[];
|
|
178
|
+
Progress: string[];
|
|
179
|
+
'Progress.Circle': string[];
|
|
180
|
+
Radio: string[];
|
|
181
|
+
'Radio.Group': string[];
|
|
182
|
+
'Radio.Button': string[];
|
|
183
|
+
'Radio.ButtonGroup': string[];
|
|
184
|
+
Rate: string[];
|
|
185
|
+
Result: string[];
|
|
186
|
+
Select: string[];
|
|
187
|
+
'Select.Multi': string[];
|
|
188
|
+
SelectButton: string[];
|
|
189
|
+
'SelectButton.Group': string[];
|
|
190
|
+
SideBar: string[];
|
|
191
|
+
'SideBar.Panel': string[];
|
|
192
|
+
Slider: string[];
|
|
193
|
+
Spinner: string[];
|
|
194
|
+
Statistic: string[];
|
|
195
|
+
Steps: string[];
|
|
196
|
+
Switch: string[];
|
|
197
|
+
Table: string[];
|
|
198
|
+
'Table.ActionButtons': string[];
|
|
199
|
+
'Table.BulkActions': string[];
|
|
200
|
+
'Table.RowAction': string[];
|
|
201
|
+
'Table.Filters': string[];
|
|
202
|
+
'Table.Filter': string[];
|
|
203
|
+
Tabs: string[];
|
|
204
|
+
'Tabs.Sub': string[];
|
|
205
|
+
Tag: string[];
|
|
206
|
+
TimePicker: string[];
|
|
207
|
+
Timeline: string[];
|
|
208
|
+
Tooltip: string[];
|
|
209
|
+
'Typography.Title': string[];
|
|
210
|
+
'Typography.Text': string[];
|
|
211
|
+
Widget: string[];
|
|
212
|
+
};
|
|
213
|
+
declare const HD_COMPONENTS: readonly ["Alert", "Badge", "Banner", "Breadcrumb", "Button", "Card", "Carousel", "Chart", "Checkbox", "Collapse", "Comment", "ContextPanel", "DatePicker", "Divider", "Dropdown", "Empty", "File", "Filters", "Form", "Grid", "Icon", "InPageNavigation", "Input", "MediaQuery", "Menu", "Modal", "Notification", "PageHeader", "Pagination", "Portal", "Portlet", "Progress", "Radio", "Rate", "Result", "Select", "SelectButton", "SideBar", "Slider", "Spinner", "Statistic", "Steps", "Switch", "Table", "Tabs", "Tag", "TagInput", "TimePicker", "Timeline", "Tooltip", "Typography", "Widget"];
|
|
214
|
+
declare const APPROVED_COMMENT = "@snowflake-guard/snowflake-approved-by-andromeda";
|
|
215
|
+
export { HD_COMPONENTS, RULESET_MAP, SX_RULESET_MAP, APPROVED_COMMENT };
|