Skip to content

Commit

Permalink
feat: desktop editor prototype (#210)
Browse files Browse the repository at this point in the history
* feat: narrat game running in tauri

* feat: editor kinda working

* chore: removed unnecessary files and updated readme
  • Loading branch information
liana-p committed Jan 22, 2024
1 parent a720b15 commit 0389bb8
Show file tree
Hide file tree
Showing 68 changed files with 8,361 additions and 77 deletions.
52 changes: 52 additions & 0 deletions ide.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"folders": [
{
"name": "root",
"path": "."
},
{
"name": "IDE",
"path": "packages/desktop-editor"
}
],
"settings": {
"vitest.enable": true,
"editor.tabSize": 2,
"files.exclude": {
"**/dist/*": true,
"**/lib/*": true,
"node_modules/": true,
"packages/": true,
"docs/": true,
"demo-template": true,
"**/*.rpyc": true,
"**/*.rpa": true,
"**/*.rpymc": true,
"**/cache/": true,
"**/lib.ts": true
},
"search.exclude": {
"dist/": true,
"lib/": true,
"node_modules/": true,
"**/lib.ts": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.preferences.autoImportFileExcludePatterns": [
"@/lib/**",
"@/lib**",
"@/lib",
"src/lib",
"**/node_modules/**",
"**/dist/**",
"**/lib/**"
]
}
}
7 changes: 7 additions & 0 deletions packages/desktop-editor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.build
build
web_modules
node_modules
out/
build/
dist/
1 change: 1 addition & 0 deletions packages/desktop-editor/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
7 changes: 7 additions & 0 deletions packages/desktop-editor/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

.build
build
web_modules
node_modules
out/
build/
1 change: 1 addition & 0 deletions packages/desktop-editor/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions packages/desktop-editor/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "NarratEngine.language-narrat"]
}
21 changes: 21 additions & 0 deletions packages/desktop-editor/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"editor.tabSize": 2,
"files.exclude": {
"dist/": true,
"lib/": true,
"node_modules/": true
},
"search.exclude": {
"dist/": true,
"lib/": true,
"node_modules/": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
21 changes: 21 additions & 0 deletions packages/desktop-editor/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Liana Pigeot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions packages/desktop-editor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Narrat Desktop Editor

WIP

Structure:

- vite project running the editor UI
- tauri app to run the editor in a desktop app
- monacco editor for text editing

## Installation

- Have [node.js](https://nodejs.org) installed
- Have rust installed: `curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh`
- Run `npm install`

## Running

Run `npm run dev` to start the IDE. Then use the menu to open a folder containing a narrat project.

## Building

Not implemented yet
Binary file added packages/desktop-editor/icon.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 packages/desktop-editor/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="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Narrat Demo Editor</title>
<script src="http://localhost:8098"></script>
</head>
<body>
<div id="app" class="w-full"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
93 changes: 93 additions & 0 deletions packages/desktop-editor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"name": "@narrat/desktop-editor",
"version": "3.9.2",
"private": true,
"description": "Desktop editor for narrat",
"main": "electron-main.js",
"engines": {
"node": ">=18.x"
},
"keywords": [
"game",
"vue.js",
"snowpack"
],
"author": "Liana Pigeot <[email protected]>",
"license": "MIT",
"scripts": {
"dev": "pnpm tauri dev",
"start": "pnpm tauri dev",
"ide:devtools": "./node_modules/.bin/vue-devtools",
"ide:start": "npm run ide:dev",
"ide:dev": "vite",
"ide:build": "cross-env VITE_BUILD=true vite build",
"ide:build-debug": "cross-env VITE_BUILD=true VITE_DEBUG=true vite build",
"ide:type-check": "tsc --noEmit"
},
"dependencies": {
"@tauri-apps/api": "^1.5.3",
"clone-deep": "^4.0.1",
"electron-squirrel-startup": "^1.0.0",
"es6-promise": "^4.2.8",
"monaco-editor": "0.44.0",
"monaco-yaml": "^5.1.0",
"narrat": "workspace:*",
"oh-vue-icons": "1.0.0-rc3",
"pinia": "^2.1.7",
"steamworks.js": "^0.2.0",
"vue": "^3.4.15",
"vue-router": "4"
},
"devDependencies": {
"@electron-forge/cli": "^6.1.1",
"@electron-forge/maker-deb": "^6.1.1",
"@electron-forge/maker-rpm": "^6.1.1",
"@electron-forge/maker-squirrel": "^6.1.1",
"@electron-forge/maker-zip": "^6.1.1",
"@electron/rebuild": "^3.2.13",
"@tauri-apps/cli": "^1.5.9",
"@types/clone-deep": "^4.0.1",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/devtools": "^7.0.11",
"cross-env": "^7.0.3",
"electron": "^25.1.0",
"electron-winstaller": "^5.1.0",
"prettier": "^3.0.0",
"shx": "^0.3.4",
"typescript": "^5.1.6",
"vite": "^4.4.2",
"vite-plugin-monaco-editor": "^1.1.0",
"vite-plugin-narrat": "3.6.0",
"vite-plugin-windicss": "^1.9.0",
"windicss": "^3.5.6"
},
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-squirrel",
"config": {
"name": "Your game name",
"authors": "Your name",
"description": "Your game description"
}
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
}
}
3 changes: 3 additions & 0 deletions packages/desktop-editor/src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/
Loading

0 comments on commit 0389bb8

Please sign in to comment.