Use swc as compiler for tsc-watch - ts-node

I'm trying to use the lightning fast swc compiler in tsc-watch, but it does not seem to parse it properly. I've tried various locations in #swc/cli and #swc/core, but to no avail.
I've also tried using ts-node, which has a configuration option for swc, but this also doesn't appear to work.
Here's the script I'm trying to run:
When running this, it prints the command and then stops.

Related

go-swagger restapi/configure_todo_list.go - api.TodoGetHandler undefined error

I am a newbie in go and go-swagger. I am following steps in Simple Server tutorial in goswagger.io.
I am using Ubuntu 18.04, swagger v0.25.0 and go 1.15.6.
Following the same steps, there are a few differences of the files generated. For instance, goswagger.io's has find_todos_okbody.go and get_okbody.go in models but mine does not. Why is that so?
Link to screenshot of my generated files vs
Link to screenshot of generated files by swagger.io
Starting the server as written in the tutorial go install ./cmd/todo-list-server/ gives me the following error. Can anyone please help with this?
# my_folder/swagger-todo-list/restapi
restapi/configure_todo_list.go:41:8: api.TodosGetHandler undefined (type *operations.TodoListAPI has no field or method TodosGetHandler)
restapi/configure_todo_list.go:42:6: api.TodosGetHandler undefined (type *operations.TodoListAPI has no field or method TodosGetHandler)
The first step in goswagger.io todo-list is swagger init spec .... Which directory should I run this command in? I ran it in a newly created folder in my home directory. However, from the page, it shows the path to be ~/go/src/github.com/go-swagger/go-swagger/examples/tutorials/todo-list. I am not sure whether I should use go get ..., git clone ... or create those folders. Can someone advise me?
Thanks.
This is likely the documentation lagging behind the version of the code that you are running. As long as it compiles, the specific files the tool generates isn't so crucial.
This is a compilation error. When you do go install foo it will try to build the foo package as an executable and then move that to your GOPATH/bin directory. It seems that the generated code in restapi/configure_todo_list.go isn't correct for the operations code generated.
All you need to run this tutorial yourself is an empty directory and the swagger tool (not its source code). You run the commands from the root of this empty project. In order not to run into GOPATH problems I would initialise a module with go mod init todo-list-example before doing anything else.
Note that while the todo-list example code exists inside the go-swagger source, it's there just for documenting example usage and output.
What I would advice for #2 is to make sure you're using a properly released version of go-swagger, rather than installing from the latest commit (which happens when you just do a go get), as I have found that to be occasionally unstable.
Next, re-generate the entire server, but make sure you also regenerate restapi/configure_todo_list.go by passing --regenerate-configureapi to your swagger generate call. This file isn't always refreshed because you're meant to modify it to configure your app, and if you changed versions of the tool it may be different and incompatible.
If after that you still get the compilation error, it may be worth submitting a bug report at https://github.com/go-swagger/go-swagger/issues.
Thanks #EzequielMuns. The errors in #2 went away after I ran go get - u -f ./... as stated in
...
For this generation to compile you need to have some packages in your GOPATH:
* github.com/go-openapi/runtime
* github.com/jessevdk/go-flags
You can get these now with: go get -u -f ./...
I think it's an error of swagger code generation. You can do as folloing to fix this:
delete file configure_todo_list.go;
regenerate code.
# swagger generate server -A todo-list -f ./swagger.yml
Then, you can run command go install ./cmd/todo-list-server/, it will succeed.

How to run and debug AzerothCore using CLion

CLion is a powerful multi-platform IDE that allows to run and debug C++ applications.
I tried to use it with an AzerothCore core project.
It is smart enough to detect all the processes:
Mostly I'm interested in running the worldserver.
However when I try to run or debug it, it correctly compile and runs but it will look for the worldserver.conf.dist configuration file in the directory /usr/local/etc/, giving error because that file is not there.
I would like to manually specify the path of such configuration file, as well as passing other CMake parameters.
I made it work by opening File -> Settings and looking for "CMake" under "Build, Execution, Deployment".
From that window I could pass my CMake options, which in my case where:
-G "Unix Makefiles" -DTOOLS=0 -DSCRIPTS=static -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_INSTALL_PREFIX=/path/to/the/main/server/dir
The /path/to/the/main/server/dir is where my etc, data, etc... folders are and the worldserver.config.dist is inside this etc folder. So doing this everything worked fine.
I also changed the "Build options" to better use my processor, passing -j 10.
For macOS users, you'll probably need to add these CMake options as well:
-DMYSQL_ADD_INCLUDE_PATH=/usr/local/include
-DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient.dylib
-DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include
-DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib
-DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
-DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib
-DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl/lib/libcrypto.dylib

Running a command line for groovy from XCode after unit testing

I edited my target scheme to run a script action after testing as below
Target Scheme -> Test (Debug) -> Post Actions
The script hw.sh had a simple command line call:
open /Applications/Safari.app/
It worked fine for the above script. When I changed it to the following
groovy http://frankencover.it/with -s /Users/sasokan/Downloads/MyProject
Nothing happened. How can I call this groovy application using a script.
I am also trying to run frankencover.it and had the same problem you did. I eventually found this answer on SO that lead me to a solution. I added the following before calling frankencover.it and it fixed the issue.
PATH=${PATH}:/usr/local/bin
I will further note that even if you use the full path to groovy in the command frankencover.it will fail internally because it cannot find 'lcov' for the same reason.

appledoc Exception: at least one directory

After wasting some time to figure out what goes wrong, I finally have to ask for help. I want to use appledocs from Gentle Bytes. I followed every step of the quick install guide, but I´m not able to compile the project.
Here is what I´ve done:
1. cloned it from git://github.com/tomaz/appledoc.git
2. installed the templates to ~/Library/Application Support/appledoc
3. tried to compile the project
Everytime I try to compile, I get following error:
ERROR: AppledocException: At least one directory or file name path is required, use 'appledoc --help'
What do I have to do now?
Sounds like you've compiled it just fine and are now running the program. If it's a command-line program try command-option-R in Xcode to provide some arguments (i.e. names of files that you want to process).
The error means you didn't give it source paths: after all switches, you must give it at least one path to your source files. Can be either file or directory. In later case it will recursively scan the dir. Here's example
appledoc <options> ~/MyProject
Above example will use ~/MyProject directory as a source. You can also add multiple source paths. Note that you need to give the tool few options, see this page for minimum command line and other usage examples.
You either have to copy appledoc executable to one of directories in your path, as suggested by Caleb, or use full path to it when invoking (for example: /path/to/appledoc)

Path Error running CakePHP's "cake" console utility in Windows

A while ago when I started with Cake, I managed to get the console running in my Windows environment, and I have no idea how. I'm now having problems to make it work again in another computer.
This is what I've done in the new machine:
Downloaded my Cake code from source control (so all the files are exactly the same as the computer where it worked, including the configuration files)
Added PHP and "c:\my_cake_path\cake\console" to the path
If I run "cake OneOfMyShells", either standing on the /app, or in /cake/console directories, I get the following error:
Warning: get_object_vars() expects parameter 1 to be object, null given in C:\my_cake_path\cake\libs\model\connection_manager.php on line 199
Error: Missing Database Connection. Try 'cake bake'
"cake Bake", if run normally, when I try to get it to do the DB config ends up throwing another error (which is not that relevant to this)
However, if I run: cake bake -app "c:\my_cake_path\app"
Then bake works, I can do the database config, and it writes the DB config file (which is useless at this point, since I already had one)
Then, of course: cake OneOfMyShells -app "c:\my_cake_path\app"
does work perfectly well.
So, everything's working fine, I just need to manually specify the path to "app" every single time, which is very annoying.
How can I get around this? Where is Cake looking for to find the path to app?
Thanks!
Daniel
Not much of a difference in the sense you still need to type but you can run cake from the app dir like this: C:\XXX\project\app> ..\cake\console\cake.bat
To make it smaller you can put that line on a .bat or just add the \cake\console dir the windows path

Resources