Skip to content

Commit 0f13bde

Browse files
committed
package-lock, deps, prettier
1 parent ba68cbb commit 0f13bde

File tree

8 files changed

+25191
-20842
lines changed

8 files changed

+25191
-20842
lines changed

package-lock.json

Lines changed: 25129 additions & 20802 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"release": "npm run package && dojo-release"
1414
},
1515
"peerDependencies": {
16-
"@dojo/framework": "~7.0.0"
16+
"@dojo/framework": "8.0.0-rc.1"
1717
},
1818
"dependencies": {
1919
"@fortawesome/fontawesome-free": "5.15.3",
@@ -31,17 +31,17 @@
3131
"unified": "8.4.1"
3232
},
3333
"devDependencies": {
34-
"@dojo/cli": "~7.0.0",
35-
"@dojo/cli-build-app": "~7.0.0",
36-
"@dojo/cli-build-widget": "~7.0.0",
37-
"@dojo/framework": "~7.0.0",
34+
"@dojo/cli": "8.0.0-rc.1",
35+
"@dojo/cli-build-app": "8.0.0-rc.1",
36+
"@dojo/cli-build-widget": "8.0.0-rc.1",
37+
"@dojo/framework": "8.0.0-rc.1",
3838
"@dojo/scripts": "^4.0.2",
3939
"@types/node": "~9.6.5",
4040
"intern": "^4.6.0",
4141
"prettier": "^1.19.1",
4242
"shx": "^0.3.2",
4343
"tailwindcss": "^1.1.4",
44-
"typescript": "~3.4.5"
44+
"typescript": "~3.5.3"
4545
},
4646
"prettier": {
4747
"singleQuote": true,

src/InterfaceTable.tsx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ export default factory(function InterfaceTable({ properties }) {
3535
<th classes="px-4 py-2 border-r border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100 rounded-tl-lg">
3636
Name
3737
</th>
38-
{showTypes &&
39-
<th classes="px-4 py-2 border-r border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100">
40-
Type
41-
</th>
42-
}
43-
{showComments &&
38+
{showTypes && (
39+
<th classes="px-4 py-2 border-r border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100">
40+
Type
41+
</th>
42+
)}
43+
{showComments && (
4444
<th classes="px-4 py-2 border-b border-gray-400 text-sm font-semibold text-gray-700 p-2 bg-gray-100 rounded-tr-lg">
4545
{descriptionLabel}
4646
</th>
47-
}
47+
)}
4848
</tr>
4949
</thead>
5050
<tbody>
@@ -55,7 +55,9 @@ export default factory(function InterfaceTable({ properties }) {
5555
prop.optional ? '?' : ''
5656
}`}</td>
5757
{showTypes && <td classes="px-4 py-2 text-sm">{prop.type}</td>}
58-
{showComments && <td classes="px-4 py-2 text-sm">{prop.description}</td>}
58+
{showComments && (
59+
<td classes="px-4 py-2 text-sm">{prop.description}</td>
60+
)}
5961
</tr>
6062
);
6163
})}

src/SideMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export default factory(function SideBar({ properties, middleware: { theme } }) {
8585
<div classes="inline-block relative w-4/5">
8686
<select
8787
onchange={(e) => {
88-
const themeName = (e.target as HTMLInputElement).value;
88+
const themeName = (e.target as HTMLSelectElement).value;
8989
onThemeChange(themeName);
9090
}}
9191
classes="select block appearance-none w-full bg-white border border-gray-400 hover:border-gray-500 px-4 py-2 pr-8 rounded shadow leading-tight focus:outline-none focus:shadow-outline"

src/example/NamedButton/NamedButton.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ export interface FunctionChild {
1515
}
1616

1717
const factory = create({ theme, i18n }).children<ButtonChildren | RenderResult | FunctionChild>();
18-
export const NamedButton = factory(function NamedButton({ properties, children, middleware: { theme, i18n } }) {
18+
export const NamedButton = factory(function NamedButton({
19+
properties,
20+
children,
21+
middleware: { theme, i18n }
22+
}) {
1923
const [labelChild] = children();
20-
const label = (labelChild && (labelChild as any).label) ? (labelChild as any).label : labelChild;
24+
const label = labelChild && (labelChild as any).label ? (labelChild as any).label : labelChild;
2125
const { messages } = i18n.localize(bundle);
2226
const themedCss = theme.classes(css);
2327
return <button classes={[themedCss.root]}>{`${label} - ${messages.message}`}</button>;

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface Config {
4242
}
4343

4444
export default ({ config }: { config: Config }) => {
45-
const { themes, tests } = config;
45+
const { tests } = config;
4646
if (global.intern && tests && tests.keys) {
4747
const url = new URL(window.location.href);
4848
const params = url.searchParams;

src/interfaces.block.ts

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,19 @@ function format(prop: MethodSignature | PropertySignature | PropertyAssignment):
3434
name: prop.getName(),
3535
type: prop.getType().getText(prop),
3636
optional: prop.hasQuestionToken() || false,
37-
description: (prop as PropertySignature).getJsDocs ? (
38-
(prop as PropertySignature).getJsDocs()[0] && (prop as PropertySignature).getJsDocs()[0].getComment()
39-
) : (
40-
(prop as PropertyAssignment).getInitializerIfKind(SyntaxKind.StringLiteral) &&
41-
(prop as PropertyAssignment).getInitializerIfKind(SyntaxKind.StringLiteral)!.getLiteralValue()
42-
)
37+
description: (prop as PropertySignature).getJsDocs
38+
? (prop as PropertySignature).getJsDocs()[0] &&
39+
(prop as PropertySignature).getJsDocs()[0].getComment()
40+
: (prop as PropertyAssignment).getInitializerIfKind(SyntaxKind.StringLiteral) &&
41+
(prop as PropertyAssignment)
42+
.getInitializerIfKind(SyntaxKind.StringLiteral)!
43+
.getLiteralValue()
4344
};
4445
}
4546

46-
function isSignatureOrAssignment(node: any): node is MethodSignature | PropertySignature | PropertyAssignment {
47+
function isSignatureOrAssignment(
48+
node: any
49+
): node is MethodSignature | PropertySignature | PropertyAssignment {
4750
return Boolean(node && node.getName && node.getType && node.hasQuestionToken);
4851
}
4952

@@ -80,27 +83,33 @@ function getTypeFromFactory(factory: CallExpression, children = false) {
8083

8184
function parseI18n(node: CallExpression) {
8285
const propertyAccess = node.getChildAtIndex(0);
83-
const functionSymbol = propertyAccess &&
86+
const functionSymbol =
87+
propertyAccess &&
8488
propertyAccess.getKind() === SyntaxKind.PropertyAccessExpression &&
8589
propertyAccess.getSymbol();
8690
const functionType = functionSymbol && functionSymbol.getTypeAtLocation(node);
8791
const callType = functionType && functionType.getCallSignatures()[0];
88-
const argument = callType && callType.getParameters()[0]
92+
const argument = callType && callType.getParameters()[0];
8993
const parameterType = argument && argument.getTypeAtLocation(node);
9094
const parameterSymbol = parameterType && parameterType.getSymbol();
9195
const parameterSymbolName = parameterSymbol && parameterSymbol.getName();
9296
const returnType = callType && callType.getReturnType();
9397
const returnAliasSymbol = returnType && returnType.getAliasSymbol();
9498
const returnAliasName = returnAliasSymbol && returnAliasSymbol.getName();
95-
if (parameterType && parameterSymbolName === 'Bundle' && returnAliasName === 'LocalizedMessages') {
96-
const argument = node.getArguments()[0]
99+
if (
100+
parameterType &&
101+
parameterSymbolName === 'Bundle' &&
102+
returnAliasName === 'LocalizedMessages'
103+
) {
104+
const argument = node.getArguments()[0];
97105
const argumentType = argument && argument.getType();
98106
const messages = argumentType && argumentType.getProperty('messages');
99107
const locales = argumentType && argumentType.getProperty('locales');
100108
const messageProps = messages && messages.getTypeAtLocation(node);
101109
const localeProps = locales && locales.getTypeAtLocation(node);
102110
return {
103-
messages: messageProps && getPropertyDetails(messageProps), locales: localeProps && getPropertyDetails(localeProps)
111+
messages: messageProps && getPropertyDetails(messageProps),
112+
locales: localeProps && getPropertyDetails(localeProps)
104113
};
105114
}
106115

@@ -164,7 +173,8 @@ export default function(config: { [index: string]: string }) {
164173

165174
if (typeArguments.length) {
166175
const widgetSymbol = typeArguments[0].getChildAtIndex(0).getSymbol();
167-
const widgetChildrenSymbol = typeArguments[1] && typeArguments[1].getChildAtIndex(0).getSymbol();
176+
const widgetChildrenSymbol =
177+
typeArguments[1] && typeArguments[1].getChildAtIndex(0).getSymbol();
168178

169179
if (widgetSymbol) {
170180
propsType = widgetSymbol.getDeclaredType();
@@ -179,19 +189,19 @@ export default function(config: { [index: string]: string }) {
179189
} else if (node.getKind() === SyntaxKind.ExportAssignment) {
180190
initializer = (node as ExportAssignment).getExpression();
181191
} else if (node.getKind() === SyntaxKind.CallExpression) {
182-
const parsedI18n = parseI18n(node as CallExpression)
192+
const parsedI18n = parseI18n(node as CallExpression);
183193
if (parsedI18n.messages) {
184194
messages.push(...parsedI18n.messages);
185195
}
186196

187-
if(parsedI18n.locales) {
197+
if (parsedI18n.locales) {
188198
locales = parsedI18n.locales;
189199
}
190200
}
191201

192202
if (initializer && initializer.getKind() === SyntaxKind.CallExpression) {
193203
propsType = getTypeFromFactory(initializer);
194-
childrenType = getTypeFromFactory(initializer, true);
204+
childrenType = getTypeFromFactory(initializer, true);
195205
}
196206
});
197207

@@ -247,30 +257,35 @@ export default function(config: { [index: string]: string }) {
247257
if (unionTypes && unionTypes.length) {
248258
unionTypes.forEach((unionType) => {
249259
const unionProperties = getPropertyDetails(unionType);
250-
unionProperties.forEach(type => parseUnionType(type, properties));
260+
unionProperties.forEach((type) => parseUnionType(type, properties));
251261
});
252262
}
253263
childUnionTypes.forEach((unionType) => {
254264
const text = unionType.getText(undefined, TypeFormatFlags.None);
255-
if (unionType.isArray() || !unionType.isObject() || (
256-
text && (text.startsWith('WNode') || text.startsWith('VNode') || text.startsWith('DNode'))
257-
)) {
265+
if (
266+
unionType.isArray() ||
267+
!unionType.isObject() ||
268+
(text &&
269+
(text.startsWith('WNode') ||
270+
text.startsWith('VNode') ||
271+
text.startsWith('DNode')))
272+
) {
258273
children.push({
259274
name: '----',
260275
type: text,
261276
optional: false
262277
});
263278
} else {
264279
const callSignatures = unionType.getCallSignatures();
265-
callSignatures.forEach(signature => {
280+
callSignatures.forEach((signature) => {
266281
children.push({
267282
name: '----',
268283
type: signature.getDeclaration().getFullText(),
269284
optional: false
270285
});
271286
});
272287
const unionProperties = getPropertyDetails(unionType);
273-
unionProperties.forEach(type => parseUnionType(type, children));
288+
unionProperties.forEach((type) => parseUnionType(type, children));
274289
}
275290
});
276291

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"es2015.symbol",
1414
"es2015.symbol.wellknown"
1515
],
16+
"skipLibCheck": true,
1617
"module": "commonjs",
1718
"moduleResolution": "node",
1819
"noUnusedLocals": true,

0 commit comments

Comments
 (0)