Skip to content

Commit

Permalink
Refactor the existing code (#6)
Browse files Browse the repository at this point in the history
* refactor the old code

* Refactor the code and make it more modular

---------

Co-authored-by: mostafa <mostafa.wael>
  • Loading branch information
Mostafa-wael authored Jun 11, 2024
1 parent f5e5871 commit abbf2bc
Show file tree
Hide file tree
Showing 55 changed files with 264 additions and 3,576 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ venv.bak/
# Custom
test/
node_modules/
__pycache__/
examples/
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions Notes.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
# MetaCall Project Notes

## Objective
The idea is to write a Js or py script that:
1. Downloads and installs metacall.
2. Clones each example repo.
3. Loads it with metacall cli.
4. Verifies that works.
5. Deploys it with metacall deploy cli.


## Helpful commands
1. Install Docker: `wget -O - https://gist.githubusercontent.com/fredhsu/f3d927d765727181767b3b13a3a23704/raw/3c2c55f185e23268f7fce399539cb6f1f3c45146/ubuntudocker.sh | bash`
2. Copy a file though ssh to the server: `sudo scp -i ./terraform/keys/gp.pem ./test.py user<>@<server IP>:~/`
3. To build the image: `docker build -t python-app .`.
4. To run and enter the container: `docker run -it python-app /bin/bash`.
5. Run the container and mount the current directory to the container: `docker run -it -v $(pwd):/app python-app /bin/bash` or `docker run -it -v .:/app python-app /bin/bash`
6. To list docker containers:` docker ps -a`.
7. To delete all containers: `docker container prune`.
8. Run the script: `python3 main.py`.

## Important Notes
1. We will install the cli anyway we don't need to check if it's installed.
2. This is a [test example](https://github.com/metacall/core/blob/develop/source/cli/metacallcli/test/commands/metacallcli-tsx-templating.txt). The code is **loading a template file** written in TypeScript, named "templating.tsx". It then **inspects the code to check for any errors or warnings**. Then it **calls a function named "hello" with the argument "metaprogrammer"**. Finally, **the code exits** the program.
Expand Down
90 changes: 0 additions & 90 deletions deprecated/main.py

This file was deleted.

63 changes: 0 additions & 63 deletions deprecated/runTest.py

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/cli-test-argv.py

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/cli-test-main.py

This file was deleted.

9 changes: 0 additions & 9 deletions deprecated/test-cases/cli-test-null-undefined.js

This file was deleted.

7 changes: 0 additions & 7 deletions deprecated/test-cases/cli-test-onload.js

This file was deleted.

26 changes: 0 additions & 26 deletions deprecated/test-cases/cli-test-rb.py.in

This file was deleted.

5 changes: 0 additions & 5 deletions deprecated/test-cases/cli-test-target.py

This file was deleted.

3 changes: 0 additions & 3 deletions deprecated/test-cases/cli-test.js

This file was deleted.

33 changes: 0 additions & 33 deletions deprecated/test-cases/cli-test.py.in

This file was deleted.

1 change: 0 additions & 1 deletion deprecated/test-cases/commands/command_runner.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-file.txt

This file was deleted.

2 changes: 0 additions & 2 deletions deprecated/test-cases/commands/metacallcli-inspect-leak.txt

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-node-null.txt

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions deprecated/test-cases/commands/metacallcli-node-port-py.txt

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-node.txt

This file was deleted.

5 changes: 0 additions & 5 deletions deprecated/test-cases/commands/metacallcli-py-exception.txt

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-py-port-rb.txt

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-py-port.txt

This file was deleted.

2 changes: 0 additions & 2 deletions deprecated/test-cases/commands/metacallcli-py-tsx.txt

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-ts.txt

This file was deleted.

4 changes: 0 additions & 4 deletions deprecated/test-cases/commands/metacallcli-tsx-templating.txt

This file was deleted.

3 changes: 0 additions & 3 deletions deprecated/test-cases/commands/metacallcli.txt

This file was deleted.

9 changes: 0 additions & 9 deletions deprecated/test-cases/test.py

This file was deleted.

8 changes: 0 additions & 8 deletions deprecated/test-ts/.editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion deprecated/test-ts/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions deprecated/test-ts/.eslintrc.json

This file was deleted.

Loading

0 comments on commit abbf2bc

Please sign in to comment.