diff --git a/.editorconfig b/.editorconfig index 7d35b2a5..75fb6065 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,7 @@ # https://editorconfig.org root = true -[*.{js,ts,css,less,scss}] +[*.{js,ts,tsx,css,less,scss}] charset = utf-8 end_of_line = lf indent_size = 2 diff --git a/Makefile b/Makefile index a9a7a44f..0f1d1471 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +GO ?= go +GOROOT ?= $(shell go env GOROOT) +GOPATH ?= $(shell go env GOPATH) + PKG := ./cmd/playground UI := ./web TARGET := ./target @@ -13,7 +17,7 @@ include docker.mk .PHONY:run run: - @go run $(PKG) -f ./data/packages.json -debug=$(DEBUG) -addr $(LISTEN_ADDR) + @GOROOT=$(GOROOT) $(GO) run $(PKG) -f ./data/packages.json -debug=$(DEBUG) -addr $(LISTEN_ADDR) .PHONY:ui ui: diff --git a/web/craco.config.js b/web/craco.config.js index 99bc1068..4eb78cae 100644 --- a/web/craco.config.js +++ b/web/craco.config.js @@ -1,5 +1,6 @@ const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); const CircularDependencyPlugin = require('circular-dependency-plugin'); +const CracoAlias = require("craco-alias"); module.exports = { webpack: { @@ -18,8 +19,22 @@ module.exports = { allowAsyncCycles: false, // set the current working directory for displaying module paths cwd: process.cwd(), - }) + }), ] } - } + }, + plugins: [ + { + plugin: CracoAlias, + options: { + source: "tsconfig", + // baseUrl SHOULD be specified + // plugin does not take it from tsconfig + baseUrl: "./src", + /* tsConfigPath should point to the file where "baseUrl" and "paths" + are specified*/ + tsConfigPath: "./tsconfig.paths.json" + } + } + ] }; diff --git a/web/package.json b/web/package.json index ec84f6bc..6e3138b3 100644 --- a/web/package.json +++ b/web/package.json @@ -13,10 +13,12 @@ "axios": "^0.21.1", "circular-dependency-plugin": "^5.2.2", "connected-react-router": "^6.9.2", + "craco-alias": "^3.0.1", "file-saver": "^2.0.5", "monaco-editor": "^0.32.1", "monaco-editor-webpack-plugin": "^7.0.1", "office-ui-fabric-react": "^7.82.1", + "re-resizable": "^6.9.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-monaco-editor": "^0.47.0", @@ -26,6 +28,7 @@ "redux": "^4.1.2", "redux-thunk": "^2.4.1", "typescript": "^4.5.5", + "util": "^0.12.4", "uuid": "^3.4.0", "web-vitals": "^2.1.4" }, diff --git a/web/public/index.html b/web/public/index.html index 3d95f26b..1581d411 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -1,51 +1,39 @@ -
- - - - - - - - - - -