Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"es6": true,
"browser": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"no-mixed-spaces-and-tabs": "error",
"indent": ["error", 4, {
Expand Down
4,052 changes: 1,704 additions & 2,348 deletions npm-shrinkwrap.json

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint src/",
"dev": "webpack --progress --color --watch --env dev",
"build": "webpack --env dev && webpack --env build"
},
Expand All @@ -28,7 +29,7 @@
"@babel/preset-env": "7.11.0",
"babel-loader": "8.1.0",
"css-loader": "4.2.0",
"eslint": "5.0.0",
"eslint": "^8.57.1",
"eslint-loader": "4.0.2",
"jquery": "3.5.1",
"knockout": "3.5.1",
Expand All @@ -37,5 +38,13 @@
"webpack": "4.44.1",
"webpack-cli": "^4.2.0",
"yargs": "15.4.1"
},
"dependencies": {
"@types/jquery": "^4.0.1",
"@types/knockout": "^3.4.79",
"@typescript-eslint/eslint-plugin": "^8.62.1",
"@typescript-eslint/parser": "^8.62.1",
"ts-loader": "^8.4.0",
"typescript": "^6.0.3"
}
}
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions src/blockpy.js → src/blockpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import $ from "jquery";
import {$builtinmodule as imageModule} from "skulpt_modules/image";
import {$builtinmodule as weakrefModule} from "skulpt_modules/weakref";
//import {$builtinmodule as matplotlibModule} from "skulpt_modules/matplotlib2";
import {LocalStorageWrapper} from "storage.js";
import {EditorsEnum} from "editors.js";
import {DisplayModes} from "editor/python.js";
import {StatusState} from "server.js";
import {makeInterface, makeExtraInterfaceSubscriptions, SecondRowSecondPanelOptions} from "interface.js";
import {Editors} from "editors.js";
import {LocalStorageWrapper} from "storage";
import {EditorsEnum} from "editors";
import {DisplayModes} from "editor/python";
import {StatusState} from "server";
import {makeInterface, makeExtraInterfaceSubscriptions, SecondRowSecondPanelOptions} from "interface";
import {Editors} from "editors";
import {
BlockPyFileSystem,
loadConcatenatedFile,
Expand All @@ -23,10 +23,10 @@ import {
UNRENAMABLE_FILES
} from "./files";
import {uploadFile, downloadFile} from "./editor/abstract_editor";
import {BlockPyEngine} from "engine.js";
import {BlockPyEngine} from "engine";
import {AST_DESCRIPTIONS, BlockPyTrace} from "./trace";
import {BlockPyConsole} from "./console";
import {BlockPyFeedback} from "feedback.js";
import {BlockPyFeedback} from "feedback";
import {BlockPyServer} from "./server";
import {BlockPyDialog} from "./dialog";
import {AssigmentType, loadAssignmentSettings, makeAssignmentSettingsModel} from "./editor/assignment_settings";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/engine/instructor.js → src/engine/instructor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Configuration, EMPTY_MODULE} from "./configurations.js";
import {Configuration, EMPTY_MODULE} from "./configurations";
import {$sk_mod_instructor} from "../skulpt_modules/sk_mod_instructor";
import {$sk_mod_coverage} from "../skulpt_modules/coverage";
import {$pedal_tracer} from "../skulpt_modules/pedal_tracer";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/files.js → src/files.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {firstDefinedValue} from "utilities.js";
import {firstDefinedValue} from "utilities";

// ${makeTab("?mock_urls.blockpy", "URL Data", true)}

Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Global declarations for external libraries that are loaded outside of the
* module bundler (e.g., via <script> tags in the host page).
*/

/** Skulpt – client-side Python-to-JavaScript compiler */
declare var Sk: any;

/** Blockly – visual blocks programming editor */
declare var Blockly: any;

/** FilePond – file upload library */
declare var FilePond: any;
File renamed without changes.
14 changes: 7 additions & 7 deletions src/interface.js → src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* Row 5: Footer Row
*/

import {TRACE_HTML} from "trace.js";
import {DIALOG_HTML} from "dialog.js";
import {FEEDBACK_HTML} from "feedback.js";
import {FILES_HTML} from "files.js";
import {FOOTER_HTML} from "footer.js";
import {EDITORS_HTML} from "editors.js";
import {CONSOLE_HTML} from "console.js";
import {TRACE_HTML} from "trace";
import {DIALOG_HTML} from "dialog";
import {FEEDBACK_HTML} from "feedback";
import {FILES_HTML} from "files";
import {FOOTER_HTML} from "footer";
import {EDITORS_HTML} from "editors";
import {CONSOLE_HTML} from "console";

/**
* The different layout options of the panes in the second row of the layout.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ES6",
"module": "ES6",
"lib": ["ES6", "DOM"],
"moduleResolution": "bundler",
"baseUrl": "./src",
"rootDir": "./src",
"noEmit": true,
"strict": false,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"ignoreDeprecations": "6.0"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
26 changes: 14 additions & 12 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (env === "build") {
let config = {
mode: mode,
entry: {
blockpy: __dirname + "/src/blockpy.js"
blockpy: __dirname + "/src/blockpy.ts"
},
devtool: "inline-source-map",
output: {
Expand All @@ -31,18 +31,20 @@ let config = {
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
/*loader: "babel-loader",*/
use: {
loader: "babel-loader"
},
test: /\.tsx?$/,
use: [
{
loader: "babel-loader"
},
{
loader: "ts-loader",
options: {
transpileOnly: true
}
}
],
exclude: /(node_modules|bower_components)/
},
{
test: /(\.jsx|\.js)$/,
loader: "eslint-loader",
exclude: /node_modules/
},
{
test: /\.css$/,
use: [
Expand All @@ -62,7 +64,7 @@ let config = {
},
resolve: {
modules: [path.resolve("./node_modules"), path.resolve("./src")],
extensions: [".json", ".js"]
extensions: [".ts", ".tsx", ".json", ".js"]
},
plugins: [
new MiniCssExtractPlugin({
Expand Down
Loading