Skip to content

Commit

Permalink
alpha version of ninja script, initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kmikzjh committed Sep 16, 2023
0 parents commit af46729
Show file tree
Hide file tree
Showing 46 changed files with 5,497 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
.cargo/*
dist-ssr
*.local
src-tauri/target/*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
}
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Ninja Script

A JS/TS playground write using Tauri + React + Vite + Rust, made for fun <3

![Ninja Script](docs/img/ninja-script-example-1.png "ninja script example")

## Pre-requisites

- [Bun](https://bun.sh/) (currently only `bun runtime` is available in windows)
- [Pnpm](https://pnpm.io/es/installation)
- [Rust](https://www.rust-lang.org/tools/install)
- [Tauri-cli](https://tauri.app/v1/guides/getting-started/setup/vite)

### Bun
Bun is the core of this project, is used to process JS/TS code.
You need to specified bun binary path in the app.

Example:

![bun binary path](docs/img/bun-binary-path.png "bun binary path")

### Pnpm
Pnpm is used for the installations of dependencies and build the React App components.

### Rust
Rust is used for compiling and building the app

## Usage

Install tauri-cli using `cargo`, use `cargo install tauri-cli`

To start the development build, use `cargo tauri dev`

To build the app, use `cargo tauri build`

## License
- MIT

## TODO
- [] Change default icon (right now is used the Tauri icon, hehe)
- [] Save bun binary path
- [] Re-structure app to improve clean code
- [] Write unit test, ups!
- [] Create new tabs
- [] Stylising the app to improve UI/UX
- [] Improve my english :P
- ... and more

### Enjoy ;)
Binary file added docs/img/bun-binary-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/ninja-script-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tauri + React + TS</title>
</head>

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "ninja-script",
"private": true,
"version": "0.1.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"@tauri-apps/api": "^1.4.0",
"@uiw/react-textarea-code-editor": "2.1.7",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@tauri-apps/cli": "^1.4.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react": "^4.0.3",
"typescript": "^5.0.2",
"vite": "^4.4.4"
}
}
Loading

0 comments on commit af46729

Please sign in to comment.