Skip to content

Commit c2cb4f1

Browse files
committed
Upgrade dependencies
1 parent 6eab2b7 commit c2cb4f1

9 files changed

Lines changed: 1574 additions & 1955 deletions

File tree

docs/advanced/functions-and-the-self-parameter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class MyClass {
3636
}
3737
}
3838

39-
let myFunction = function(arg: string) {
39+
let myFunction = function (arg: string) {
4040
console.log("myFunction", arg);
4141
};
4242

@@ -207,7 +207,7 @@ This throws an error because if `takesCallback` called `myCallback`, it would do
207207
<SideBySide>
208208

209209
```typescript
210-
takesCallback(arg => myCallback(arg));
210+
takesCallback((arg) => myCallback(arg));
211211
```
212212

213213
```lua

docusaurus-plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
44
// Not used directly in playground, because it imports typescript
55
const { SyntaxKind: LuaSyntaxKind } = require("typescript-to-lua/dist/LuaAST");
66

7-
const resolve = query => path.resolve(__dirname, query);
7+
const resolve = (query) => path.resolve(__dirname, query);
88

99
/** @returns {import('@docusaurus/types').Plugin<any>} */
1010
module.exports = () => ({
@@ -32,12 +32,12 @@ module.exports = () => ({
3232
{
3333
test: /\.scss$/,
3434
exclude: /\.module\.scss$/,
35-
use: [...config.module.rules.find(r => String(r.test) === "/\\.css$/").use, "sass-loader"],
35+
use: [...config.module.rules.find((r) => String(r.test) === "/\\.css$/").use, "sass-loader"],
3636
},
3737
{
3838
test: /\.module\.scss$/,
3939
use: [
40-
...config.module.rules.find(r => String(r.test) === "/\\.module\\.css$/").use,
40+
...config.module.rules.find((r) => String(r.test) === "/\\.module\\.css$/").use,
4141
"sass-loader",
4242
],
4343
},

package-lock.json

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

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@
44
"start": "docusaurus start",
55
"build": "docusaurus build",
66
"lint": "npm run lint:prettier",
7-
"lint:prettier": "prettier --check \"**/*.{js,ts,yml,json,md,html,scss,webmanifest}\""
7+
"lint:prettier": "prettier --check ."
88
},
99
"prettier": {
1010
"printWidth": 120,
1111
"trailingComma": "all"
1212
},
1313
"dependencies": {
14-
"@types/lz-string": "^1.3.33",
15-
"@types/react": "^16.9.23",
16-
"@types/react-dom": "^16.9.5",
14+
"@types/lz-string": "^1.3.34",
15+
"@types/react": "^16.9.34",
16+
"@types/react-dom": "^16.9.6",
1717
"@types/react-json-tree": "^0.6.11",
1818
"@types/webpack-env": "^1.15.1",
1919
"clsx": "^1.1.0",
2020
"fengari-web": "^0.1.4",
2121
"lua-types": "^2.7.0",
2222
"lz-string": "^1.4.4",
2323
"monaco-editor": "^0.20.0",
24-
"react": "^16.13.0",
25-
"react-dom": "^16.13.0",
24+
"react": "^16.13.1",
25+
"react-dom": "^16.13.1",
2626
"react-json-tree": "^0.11.2",
27-
"react-monaco-editor": "^0.34.0",
28-
"typescript-to-lua": "^0.32.0"
27+
"react-monaco-editor": "^0.36.0",
28+
"typescript-to-lua": "^0.32.2"
2929
},
3030
"devDependencies": {
3131
"@ark120202/typescript-config": "^2.1.0",
32-
"@docusaurus/core": "^2.0.0-alpha.48",
33-
"@docusaurus/preset-classic": "^2.0.0-alpha.48",
34-
"@types/node": "^13.9.1",
35-
"file-loader": "^5.1.0",
36-
"fork-ts-checker-webpack-plugin": "^4.1.0",
37-
"null-loader": "^3.0.0",
38-
"prettier": "^1.19.1",
39-
"raw-loader": "^4.0.0",
32+
"@docusaurus/core": "^2.0.0-alpha.50",
33+
"@docusaurus/preset-classic": "^2.0.0-alpha.50",
34+
"@types/node": "^13.11.1",
35+
"file-loader": "^6.0.0",
36+
"fork-ts-checker-webpack-plugin": "^4.1.3",
37+
"null-loader": "^4.0.0",
38+
"prettier": "^2.0.4",
39+
"raw-loader": "^4.0.1",
4040
"sass": "^1.26.3",
4141
"sass-loader": "^8.0.2",
4242
"typescript": "^3.8.3",

src/pages/play/Playground.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ type CustomTypeScriptWorker = import("./ts.worker").CustomTypeScriptWorker;
1919

2020
let fengariWorker = new FengariWorker();
2121
async function executeLua(code: string) {
22-
return new Promise<LuaMessage[]>(resolve => {
22+
return new Promise<LuaMessage[]>((resolve) => {
2323
const timeout = setTimeout(() => {
2424
resolve([{ type: "print", text: "Lua code execution timed out" }]);
2525
fengariWorker.terminate();
2626
fengariWorker = new FengariWorker();
2727
}, 2500);
2828

2929
fengariWorker.postMessage({ code });
30-
fengariWorker.addEventListener("message", event => {
30+
fengariWorker.addEventListener("message", (event) => {
3131
clearTimeout(timeout);
3232
resolve(event.data.messages);
3333
});
@@ -49,7 +49,7 @@ interface EditorContext extends EditorState {
4949

5050
function EditorContextProvider({ children }: { children: React.ReactNode }) {
5151
const [state, setState] = useState<EditorState>({ source: "", lua: "", ast: {}, sourceMap: "", results: [] });
52-
const updateModel = useCallback<EditorContext["updateModel"]>(async model => {
52+
const updateModel = useCallback<EditorContext["updateModel"]>(async (model) => {
5353
const getWorker = await monaco.languages.typescript.getTypeScriptWorker();
5454
const client = (await getWorker(model.uri)) as CustomTypeScriptWorker;
5555
const { lua, ast, sourceMap } = await client.getTranspileOutput(model.uri.toString());
@@ -145,11 +145,11 @@ function OutputPane() {
145145
const theme = useMonacoTheme();
146146
const { source, lua, sourceMap, ast, results } = useContext(EditorContext);
147147
const [isAstView, setAstView] = useState(false);
148-
const toggleAstView = useCallback(() => setAstView(x => !x), []);
148+
const toggleAstView = useCallback(() => setAstView((x) => !x), []);
149149
const sourceMapUrl = useMemo(() => {
150150
const inputs = [lua, sourceMap, source]
151151
// Replace non-ASCII characters, because btoa not supports them
152-
.map(s => btoa(s.replace(/[^\x00-\x7F]/g, "?")))
152+
.map((s) => btoa(s.replace(/[^\x00-\x7F]/g, "?")))
153153
.join(",");
154154
return `https://sokra.github.io/source-map-visualization#base64,${inputs}`;
155155
}, [lua, sourceMap, source]);

src/pages/play/code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function getInitialCode() {
2929

3030
if (window.location.hash.startsWith("#code/")) {
3131
const code = window.location.hash.replace("#code/", "").trim();
32-
return lzstring.decompressFromEncodedURIComponent(code);
32+
return lzstring.decompressFromEncodedURIComponent(code) ?? "";
3333
}
3434

3535
return example;

src/pages/play/fengari.worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function executeLua(code: string): LuaMessage[] {
5555
const messageType = status === lua.LUA_OK ? "Module" : "Error";
5656
const value = transformLuaValue(interop.tojs(L, -1));
5757

58-
const messages: LuaMessage[] = workerContext.printStream.map(text => ({ type: "print", text }));
58+
const messages: LuaMessage[] = workerContext.printStream.map((text) => ({ type: "print", text }));
5959
if (value !== undefined || messageType === "Error") {
6060
const formattedValue = inspect(value);
6161
messages.push({ type: "print", text: `${messageType}: ${formattedValue}` });

src/pages/play/ts.worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class CustomTypeScriptWorker extends TypeScriptWorker {
3232
const { diagnostics: transpileDiagnostics } = this.transpileLua(fileName);
3333
return [
3434
...diagnostics,
35-
...TypeScriptWorker.clearFiles(transpileDiagnostics.map(diag => ({ ...diag, code: diag.source as any }))),
35+
...TypeScriptWorker.clearFiles(transpileDiagnostics.map((diag) => ({ ...diag, code: diag.source as any }))),
3636
];
3737
}
3838

src/theme/CodeBlock/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ export default ({ children, className: languageClassName, metastring = "" }) =>
7575
const [, title] = metastring.match(/title=(.+)( |$)/) ?? [];
7676

7777
const [, highlightLinesRange] = metastring.match(/{([\d,-]+)}/) ?? [];
78-
const highlightLines = highlightLinesRange != null ? rangeParser.parse(highlightLinesRange).filter(n => n > 0) : [];
78+
const highlightLines =
79+
highlightLinesRange != null ? rangeParser.parse(highlightLinesRange).filter((n) => n > 0) : [];
7980

8081
let language = languageClassName && languageClassName.replace(/language-/, "");
8182
if (!language && prism.defaultLanguage) {

0 commit comments

Comments
 (0)