From bed97cff4766d6bd6f56713ed813b205bfbe3beb Mon Sep 17 00:00:00 2001 From: Danny McGee Date: Fri, 29 Sep 2023 18:33:00 -0400 Subject: [PATCH] Rename projects --- Cargo.lock | 18 +++++++------- Cargo.toml | 2 +- hello-world/src/main.rs | 3 --- {hello-web => studio-frontend}/.babelrc | 0 {hello-web => studio-frontend}/.swcrc | 0 {hello-web => studio-frontend}/index.html | 0 {hello-web => studio-frontend}/project.json | 22 +++++++++--------- .../public/favicon.ico | Bin .../src/app/app.element.scss | 0 .../src/app/app.element.ts | 4 ++-- .../src/assets/.gitkeep | 0 {hello-web => studio-frontend}/src/main.ts | 0 .../src/styles.scss | 0 .../tsconfig.app.json | 0 {hello-web => studio-frontend}/tsconfig.json | 0 .../vite-plugins/multiple-assets/build.ts | 0 .../vite-plugins/multiple-assets/index.ts | 0 .../vite-plugins/multiple-assets/server.ts | 0 {hello-web => studio-frontend}/vite.config.ts | 6 ++--- {hello-world => studio}/.env | 0 {hello-world => studio}/Cargo.toml | 6 ++--- .../assets/shaders/procedural_grid.wgsl | 0 {hello-world => studio}/project.json | 12 +++++----- .../scripts/copy-assets.mjs | 2 +- {hello-world => studio}/src/lib.rs | 0 studio/src/main.rs | 3 +++ {hello-world => studio}/src/orbit_cam.rs | 0 {hello-world => studio}/src/test_scene.rs | 0 {hello-world => studio}/src/ui.rs | 0 tsconfig.base.json | 2 +- 30 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 hello-world/src/main.rs rename {hello-web => studio-frontend}/.babelrc (100%) rename {hello-web => studio-frontend}/.swcrc (100%) rename {hello-web => studio-frontend}/index.html (100%) rename {hello-web => studio-frontend}/project.json (69%) rename {hello-web => studio-frontend}/public/favicon.ico (100%) rename {hello-web => studio-frontend}/src/app/app.element.scss (100%) rename {hello-web => studio-frontend}/src/app/app.element.ts (89%) rename {hello-web => studio-frontend}/src/assets/.gitkeep (100%) rename {hello-web => studio-frontend}/src/main.ts (100%) rename {hello-web => studio-frontend}/src/styles.scss (100%) rename {hello-web => studio-frontend}/tsconfig.app.json (100%) rename {hello-web => studio-frontend}/tsconfig.json (100%) rename {hello-web => studio-frontend}/vite-plugins/multiple-assets/build.ts (100%) rename {hello-web => studio-frontend}/vite-plugins/multiple-assets/index.ts (100%) rename {hello-web => studio-frontend}/vite-plugins/multiple-assets/server.ts (100%) rename {hello-web => studio-frontend}/vite.config.ts (83%) rename {hello-world => studio}/.env (100%) rename {hello-world => studio}/Cargo.toml (96%) rename {hello-world => studio}/assets/shaders/procedural_grid.wgsl (100%) rename {hello-world => studio}/project.json (78%) rename {hello-world => studio}/scripts/copy-assets.mjs (79%) rename {hello-world => studio}/src/lib.rs (100%) create mode 100644 studio/src/main.rs rename {hello-world => studio}/src/orbit_cam.rs (100%) rename {hello-world => studio}/src/test_scene.rs (100%) rename {hello-world => studio}/src/ui.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 02843d0..98318b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1798,15 +1798,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "hello-world" -version = "0.1.0" -dependencies = [ - "bevy", - "console_error_panic_hook", - "wasm-bindgen", -] - [[package]] name = "hexasphere" version = "9.1.0" @@ -2870,6 +2861,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "studio" +version = "0.1.0" +dependencies = [ + "bevy", + "console_error_panic_hook", + "wasm-bindgen", +] + [[package]] name = "svg_fmt" version = "0.4.1" diff --git a/Cargo.toml b/Cargo.toml index adc3f62..2f9c1c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] resolver = "2" members = [ - "./hello-world" + "./studio" ] [workspace.dependencies.bevy] diff --git a/hello-world/src/main.rs b/hello-world/src/main.rs deleted file mode 100644 index 6a5ad99..0000000 --- a/hello-world/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - hello_world::init(); -} diff --git a/hello-web/.babelrc b/studio-frontend/.babelrc similarity index 100% rename from hello-web/.babelrc rename to studio-frontend/.babelrc diff --git a/hello-web/.swcrc b/studio-frontend/.swcrc similarity index 100% rename from hello-web/.swcrc rename to studio-frontend/.swcrc diff --git a/hello-web/index.html b/studio-frontend/index.html similarity index 100% rename from hello-web/index.html rename to studio-frontend/index.html diff --git a/hello-web/project.json b/studio-frontend/project.json similarity index 69% rename from hello-web/project.json rename to studio-frontend/project.json index 5ce8ce0..d035894 100644 --- a/hello-web/project.json +++ b/studio-frontend/project.json @@ -1,15 +1,15 @@ { - "name": "hello-web", + "name": "studio-frontend", "$schema": "../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "sourceRoot": "hello-web/src", + "sourceRoot": "studio-frontend/src", "tags": [], "targets": { "build": { "executor": "@nx/vite:build", "dependsOn": [ { - "projects": ["hello-world"], + "projects": ["studio"], "target": "build:web" } ], @@ -18,7 +18,7 @@ ], "defaultConfiguration": "production", "options": { - "outputPath": "dist/hello-web" + "outputPath": "dist/studio-frontend" }, "configurations": { "development": { @@ -34,20 +34,20 @@ "defaultConfiguration": "development", "dependsOn": [ { - "projects": ["hello-world"], + "projects": ["studio"], "target": "build:web" } ], "options": { - "buildTarget": "hello-web:build" + "buildTarget": "studio-frontend:build" }, "configurations": { "development": { - "buildTarget": "hello-web:build:development", + "buildTarget": "studio-frontend:build:development", "hmr": true }, "production": { - "buildTarget": "hello-web:build:production", + "buildTarget": "studio-frontend:build:production", "hmr": false } } @@ -56,14 +56,14 @@ "executor": "@nx/vite:preview-server", "defaultConfiguration": "development", "options": { - "buildTarget": "hello-web:build" + "buildTarget": "studio-frontend:build" }, "configurations": { "development": { - "buildTarget": "hello-web:build:development" + "buildTarget": "studio-frontend:build:development" }, "production": { - "buildTarget": "hello-web:build:production" + "buildTarget": "studio-frontend:build:production" } } } diff --git a/hello-web/public/favicon.ico b/studio-frontend/public/favicon.ico similarity index 100% rename from hello-web/public/favicon.ico rename to studio-frontend/public/favicon.ico diff --git a/hello-web/src/app/app.element.scss b/studio-frontend/src/app/app.element.scss similarity index 100% rename from hello-web/src/app/app.element.scss rename to studio-frontend/src/app/app.element.scss diff --git a/hello-web/src/app/app.element.ts b/studio-frontend/src/app/app.element.ts similarity index 89% rename from hello-web/src/app/app.element.ts rename to studio-frontend/src/app/app.element.ts index 8392b51..1329853 100644 --- a/hello-web/src/app/app.element.ts +++ b/studio-frontend/src/app/app.element.ts @@ -1,4 +1,4 @@ -import * as helloWorld from "@storyteller/hello-world"; +import * as studio from "@storyteller/studio"; import "./app.element.scss"; @@ -13,7 +13,7 @@ export class AppElement extends HTMLElement { // CLI, we can craft our own JS API to interact with Bevy! \o/ As a start, // we should exploit this to pass an explicit canvas size to Bevy and keep // it up to date with the browser viewport size. - helloWorld.init(); + studio.init(); } } customElements.define("app-root", AppElement); diff --git a/hello-web/src/assets/.gitkeep b/studio-frontend/src/assets/.gitkeep similarity index 100% rename from hello-web/src/assets/.gitkeep rename to studio-frontend/src/assets/.gitkeep diff --git a/hello-web/src/main.ts b/studio-frontend/src/main.ts similarity index 100% rename from hello-web/src/main.ts rename to studio-frontend/src/main.ts diff --git a/hello-web/src/styles.scss b/studio-frontend/src/styles.scss similarity index 100% rename from hello-web/src/styles.scss rename to studio-frontend/src/styles.scss diff --git a/hello-web/tsconfig.app.json b/studio-frontend/tsconfig.app.json similarity index 100% rename from hello-web/tsconfig.app.json rename to studio-frontend/tsconfig.app.json diff --git a/hello-web/tsconfig.json b/studio-frontend/tsconfig.json similarity index 100% rename from hello-web/tsconfig.json rename to studio-frontend/tsconfig.json diff --git a/hello-web/vite-plugins/multiple-assets/build.ts b/studio-frontend/vite-plugins/multiple-assets/build.ts similarity index 100% rename from hello-web/vite-plugins/multiple-assets/build.ts rename to studio-frontend/vite-plugins/multiple-assets/build.ts diff --git a/hello-web/vite-plugins/multiple-assets/index.ts b/studio-frontend/vite-plugins/multiple-assets/index.ts similarity index 100% rename from hello-web/vite-plugins/multiple-assets/index.ts rename to studio-frontend/vite-plugins/multiple-assets/index.ts diff --git a/hello-web/vite-plugins/multiple-assets/server.ts b/studio-frontend/vite-plugins/multiple-assets/server.ts similarity index 100% rename from hello-web/vite-plugins/multiple-assets/server.ts rename to studio-frontend/vite-plugins/multiple-assets/server.ts diff --git a/hello-web/vite.config.ts b/studio-frontend/vite.config.ts similarity index 83% rename from hello-web/vite.config.ts rename to studio-frontend/vite.config.ts index b6c1f63..4ade41c 100644 --- a/hello-web/vite.config.ts +++ b/studio-frontend/vite.config.ts @@ -9,7 +9,7 @@ import topLevelAwait from "vite-plugin-top-level-await"; import mergeAssetsDirs from "./vite-plugins/multiple-assets"; export default defineConfig({ - cacheDir: "../node_modules/.vite/hello-web", + cacheDir: "../node_modules/.vite/studio-frontend", server:{ port: 4200, host: "localhost", @@ -23,8 +23,8 @@ export default defineConfig({ wasm(), topLevelAwait(), mergeAssetsDirs([ - "hello-web/public", - "dist/hello-world/public", + "studio-frontend/public", + "dist/studio/public", ]), ], }); diff --git a/hello-world/.env b/studio/.env similarity index 100% rename from hello-world/.env rename to studio/.env diff --git a/hello-world/Cargo.toml b/studio/Cargo.toml similarity index 96% rename from hello-world/Cargo.toml rename to studio/Cargo.toml index 7ddd74f..b3eaeb5 100644 --- a/hello-world/Cargo.toml +++ b/studio/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "hello-world" +name = "studio" version = "0.1.0" edition = "2021" [lib] -name = "hello_world" +name = "studio" crate-type = ["cdylib", "rlib"] path = "src/lib.rs" [[bin]] -name = "hello-world-standalone" +name = "studio-standalone" path = "src/main.rs" [dependencies] diff --git a/hello-world/assets/shaders/procedural_grid.wgsl b/studio/assets/shaders/procedural_grid.wgsl similarity index 100% rename from hello-world/assets/shaders/procedural_grid.wgsl rename to studio/assets/shaders/procedural_grid.wgsl diff --git a/hello-world/project.json b/studio/project.json similarity index 78% rename from hello-world/project.json rename to studio/project.json index 334cc7d..7525e9f 100644 --- a/hello-world/project.json +++ b/studio/project.json @@ -1,8 +1,8 @@ { - "name": "hello-world", + "name": "studio", "$schema": "../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "sourceRoot": "./hello-world/src", + "sourceRoot": "./studio/src", "targets": { "build": { "executor": "@nxrs/cargo:build", @@ -19,11 +19,11 @@ "executor": "nx:run-commands", "options": { "commands": [ - "wasm-pack build --out-dir ../dist/hello-world/ -- --features wasm", + "wasm-pack build --out-dir ../dist/studio/ -- --features wasm", "node scripts/copy-assets.mjs" ], - "cwd": "hello-world", - "envFile": "hello-world/.env", + "cwd": "studio", + "envFile": "studio/.env", "parallel": false } }, @@ -32,7 +32,7 @@ "options": { "release": false, "run": true, - "bin": "hello-world-standalone" + "bin": "studio-standalone" } }, "test": { diff --git a/hello-world/scripts/copy-assets.mjs b/studio/scripts/copy-assets.mjs similarity index 79% rename from hello-world/scripts/copy-assets.mjs rename to studio/scripts/copy-assets.mjs index fc7ecf2..f5ef0e4 100644 --- a/hello-world/scripts/copy-assets.mjs +++ b/studio/scripts/copy-assets.mjs @@ -5,7 +5,7 @@ import url from "node:url"; async function main() { const __dirname = url.fileURLToPath(new URL(".", import.meta.url)); const assetsSrc = path.resolve(__dirname, "../assets"); - const assetsDest = path.resolve(__dirname, "../../dist/hello-world/public/assets"); + const assetsDest = path.resolve(__dirname, "../../dist/studio/public/assets"); await fs.cp(assetsSrc, assetsDest, { recursive: true }); } diff --git a/hello-world/src/lib.rs b/studio/src/lib.rs similarity index 100% rename from hello-world/src/lib.rs rename to studio/src/lib.rs diff --git a/studio/src/main.rs b/studio/src/main.rs new file mode 100644 index 0000000..97f51bc --- /dev/null +++ b/studio/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + studio::init(); +} diff --git a/hello-world/src/orbit_cam.rs b/studio/src/orbit_cam.rs similarity index 100% rename from hello-world/src/orbit_cam.rs rename to studio/src/orbit_cam.rs diff --git a/hello-world/src/test_scene.rs b/studio/src/test_scene.rs similarity index 100% rename from hello-world/src/test_scene.rs rename to studio/src/test_scene.rs diff --git a/hello-world/src/ui.rs b/studio/src/ui.rs similarity index 100% rename from hello-world/src/ui.rs rename to studio/src/ui.rs diff --git a/tsconfig.base.json b/tsconfig.base.json index f44dd94..706b499 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,7 +15,7 @@ "skipDefaultLibCheck": true, "baseUrl": ".", "paths": { - "@storyteller/hello-world": ["dist/hello-world"] + "@storyteller/studio": ["dist/studio"] } }, "exclude": ["node_modules", "tmp"]