From e2c4613e70d7bdaeebe24b25cbf69f9812d28d88 Mon Sep 17 00:00:00 2001 From: ikudrickiy <139219793+ikudrickiy@users.noreply.github.com> Date: Sat, 6 Apr 2024 20:12:00 +0500 Subject: [PATCH] docs: Web docs corrections (#3004) - 03-bundlers.mdx corrections: - `npm install parcel-bundler` must be called with `--save-dev` - `` - `npx` should be infront of `parcel index.html --no-autoinstall` for better compatibility - added proposed file structure for clearer understanding - changed file structure to the common one - 02-conventions.mdx minor correction: - fixed typo --- site/docs/01-getting-started/03-bundlers.mdx | 30 +++++++++++++++++--- site/docs/02-fundamentals/02-conventions.mdx | 4 +-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/site/docs/01-getting-started/03-bundlers.mdx b/site/docs/01-getting-started/03-bundlers.mdx index b409052fe..2a7723846 100644 --- a/site/docs/01-getting-started/03-bundlers.mdx +++ b/site/docs/01-getting-started/03-bundlers.mdx @@ -79,10 +79,16 @@ Adding an `import "regenerator-runtime/runtime";` in your entry file is needed t ::: -Using npm to install Parcel, Excalibur, and TypeScript: +Using npm to install Parcel: ```bash - npm install parcel-bundler excalibur typescript + npm install parcel-bundler --save-dev + ``` + +Using npm to install Excalibur and TypeScript: + + ```bash + npm install excalibur typescript ``` Configure your tsconfig.json: @@ -91,6 +97,22 @@ Configure your tsconfig.json: tsc --init ``` +The suggested file structure is as follows: + +``` +/project_folder + /node_modules + ... + + /src + index.html + index.ts + + package-lock.json + package.json + tsconfig.json +``` + Create your game script: ```typescript @@ -109,7 +131,7 @@ Include the **TypeScript** file in your html:
- + ``` @@ -117,7 +139,7 @@ Include the **TypeScript** file in your html: Build and run with Parcel! ```bash - parcel index.html --no-autoinstall + npx parcel src/index.html --no-autoinstall ``` ### Webpack diff --git a/site/docs/02-fundamentals/02-conventions.mdx b/site/docs/02-fundamentals/02-conventions.mdx index bb84c1071..42337a86f 100644 --- a/site/docs/02-fundamentals/02-conventions.mdx +++ b/site/docs/02-fundamentals/02-conventions.mdx @@ -17,11 +17,11 @@ There are a few things that Excalibur does that are good to know before you star 3. Rotation units are in radians. -4. All elapsed times and durations in Excalibur in are milliseconds. +4. All elapsed times and durations in Excalibur are in milliseconds. 5. Actor z-index's follow the browser way of doing things. * Things with larger positive numbers are on top of lower numbers. 6. Excalibur handles offscreen draw culling for you! No need to manage that! -7. Excalibur uses pre-multiplied alphas when drawing which is important to know if you use [Material](/docs/materials) \ No newline at end of file +7. Excalibur uses pre-multiplied alphas when drawing which is important to know if you use [Material](/docs/materials)