Skip to content

Commit c05029b

Browse files
authored
Upgrade dependencies (#834)
* Upgrade dependencies * Fix TypeScript errors * Use V8 code coverage * Revert "Use V8 code coverage" This reverts commit ac39a6b. * Add changelog * Add workaround for changed symbol ids * Upgrade codecov-action
1 parent 1703170 commit c05029b

File tree

13 files changed

+1632
-1937
lines changed

13 files changed

+1632
-1937
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,4 @@ jobs:
3737
env:
3838
CI: true
3939
- if: matrix.os == 'ubuntu-latest'
40-
continue-on-error: true
41-
uses: codecov/codecov-action@v1.0.0
42-
with:
43-
token: ${{ secrets.CODECOV_TOKEN }}
40+
uses: codecov/codecov-action@v1

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- TypeScript has been updated to 3.8. See [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) for details.
6+
37
## 0.31.0
48

59
- **Breaking:** The old annotation syntax (`/* !varArg */`) **no longer works**, the only currently supported syntax is:

package-lock.json

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

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@
3939
"node": ">=12.13.0"
4040
},
4141
"dependencies": {
42-
"resolve": "^1.13.1",
42+
"resolve": "^1.15.1",
4343
"source-map": "^0.7.3",
44-
"typescript": "^3.7.3"
44+
"typescript": "^3.8.3"
4545
},
4646
"devDependencies": {
47-
"@types/fs-extra": "^8.0.1",
47+
"@types/fs-extra": "^8.1.0",
4848
"@types/glob": "^7.1.1",
49-
"@types/jest": "^24.0.23",
50-
"@types/node": "^12.12.14",
51-
"@types/resolve": "0.0.8",
49+
"@types/jest": "^25.1.3",
50+
"@types/node": "^13.7.7",
51+
"@types/resolve": "1.14.0",
5252
"fengari": "^0.1.4",
5353
"fs-extra": "^8.1.0",
5454
"javascript-stringify": "^2.0.1",
55-
"jest": "^24.9.0",
56-
"jest-circus": "^24.9.0",
55+
"jest": "^25.1.0",
56+
"jest-circus": "^25.1.0",
5757
"prettier": "^1.19.1",
58-
"ts-jest": "^24.2.0",
59-
"ts-node": "^8.5.4",
60-
"tslint": "^5.20.1"
58+
"ts-jest": "^25.2.1",
59+
"ts-node": "^8.6.2",
60+
"tslint": "^6.0.0"
6161
}
6262
}

src/CompilerOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export type CompilerOptions = OmitIndexSignature<ts.CompilerOptions> & {
2626
luaLibImport?: LuaLibImportKind;
2727
sourceMapTraceback?: boolean;
2828
plugins?: Array<ts.PluginImport | TransformerImport>;
29-
[option: string]: ts.CompilerOptions[string] | Array<ts.PluginImport | TransformerImport>;
29+
[option: string]: any;
3030
};
3131

3232
export enum LuaLibImportKind {

src/transformation/visitors/binary-expression/destructuring-assignments.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ function transformSpreadAssignment(
252252
for (const property of properties) {
253253
if (
254254
(ts.isShorthandPropertyAssignment(property) || ts.isPropertyAssignment(property)) &&
255-
!ts.isComputedPropertyName(property.name)
255+
!ts.isComputedPropertyName(property.name) &&
256+
!ts.isPrivateIdentifier(property.name)
256257
) {
257258
const name = ts.isIdentifier(property.name)
258259
? lua.createStringLiteral(property.name.text)

src/transformation/visitors/call.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function transformContextualCallExpression(
4949
const left = ts.isCallExpression(node) ? node.expression : node.tag;
5050
if (
5151
ts.isPropertyAccessExpression(left) &&
52+
ts.isIdentifier(left.name) &&
5253
!luaKeywords.has(left.name.text) &&
5354
isValidLuaIdentifier(left.name.text)
5455
) {

src/transformation/visitors/function.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
wrapInTable,
1414
} from "../utils/lua-ast";
1515
import { peekScope, performHoisting, popScope, pushScope, Scope, ScopeType } from "../utils/scope";
16-
import { getSymbolIdOfSymbol } from "../utils/symbols";
1716
import { transformGeneratorFunctionBody } from "./generator";
1817
import { transformIdentifier } from "./identifier";
1918
import { transformBindingPattern } from "./variable-declaration";
@@ -215,9 +214,13 @@ export function transformFunctionLikeDeclaration(
215214
if (ts.isFunctionExpression(node) && node.name && scope.referencedSymbols) {
216215
const symbol = context.checker.getSymbolAtLocation(node.name);
217216
if (symbol) {
218-
const symbolId = getSymbolIdOfSymbol(context, symbol);
217+
// TODO: Not using symbol ids because of https://github.com/microsoft/TypeScript/issues/37131
218+
const isReferenced = [...scope.referencedSymbols].some(([, nodes]) =>
219+
nodes.some(n => context.checker.getSymbolAtLocation(n)?.valueDeclaration === symbol.valueDeclaration)
220+
);
221+
219222
// Only wrap if the name is actually referenced inside the function
220-
if (symbolId !== undefined && scope.referencedSymbols.has(symbolId)) {
223+
if (isReferenced) {
221224
const nameIdentifier = transformIdentifier(context, node.name);
222225
return createImmediatelyInvokedFunctionExpression(
223226
[lua.createVariableDeclarationStatement(nameIdentifier, functionExpression)],

src/transformation/visitors/literal.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export function transformPropertyName(context: TransformationContext, node: ts.P
2121
return context.transformExpression(node.expression);
2222
} else if (ts.isIdentifier(node)) {
2323
return lua.createStringLiteral(node.text);
24+
} else if (ts.isPrivateIdentifier(node)) {
25+
throw new Error("PrivateIdentifier is not supported");
2426
} else {
2527
return context.transformExpression(node);
2628
}

src/transformation/visitors/modules/export.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ export const transformExportDeclaration: FunctionVisitor<ts.ExportDeclaration> =
136136
return undefined;
137137
}
138138

139+
if (ts.isNamespaceExport(node.exportClause)) {
140+
// export * as ns from "...";
141+
throw new Error("NamespaceExport is not supported");
142+
}
143+
139144
const exportSpecifiers = getExported(context, node.exportClause);
140145

141146
// export { ... };

0 commit comments

Comments
 (0)