diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4e3a013..278fe9a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,14 +26,8 @@ jobs: targets: wasm32-unknown-unknown - name: Install wasm-bindgen-cli uses: jetli/wasm-bindgen-action@v0.2.0 - - name: Build wasm - run: | - cd src/wasm/webcompiler && - cargo build --release && - wasm-bindgen --target web --out-dir ./pkg/ --out-name webcompiler ./target/wasm32-unknown-unknown/release/webcompiler.wasm && - cd ../../.. - name: Install, build, and upload your site output - uses: withastro/action@v1 + uses: withastro/action@v2 with: # path: . # The root location of your Astro project inside the repository. (optional) # node-version: 18 # The specific version of Node that should be used to build your site. Defaults to 18. (optional) diff --git a/.gitignore b/.gitignore index 6240da8..b22bb67 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,10 @@ pnpm-debug.log* # environment variables .env .env.production +*.env # macOS-specific files .DS_Store + +# wasm build files +/target_rust \ No newline at end of file diff --git a/README.md b/README.md index 3333f01..3ef5338 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,31 @@ # Documentation for ShulkerScript + This is the documentation for ShulkerScript. It is a work in progress and will be updated as the language evolves. ## Getting Started + This documentation is created using Astro and Starlight. To get started, you need to install the dependencies and start the development server. +## Requirements + +Required tools: + +- [Node.js](https://nodejs.org) +- [pnpm](https://pnpm.io) +- [Cargo](https://rustup.rs) + - with `wasm32-unknown-unknown` target installed +- [`wasm-bindgen-cli`](https://crates.io/crates/wasm-bindgen-cli) + ## 🧞 Commands All commands are run from the root of the project, from a terminal: -| Command | Action | -| :------------------------ | :----------------------------------------------- | +| Command | Action | +| :------------------------- | :----------------------------------------------- | | `pnpm install` | Installs dependencies | | `pnpm run dev` | Starts local dev server at `localhost:4321` | | `pnpm run build` | Build your production site to `./dist/` | +| `pnpm run build-wasm` | Build your wasm modules | | `pnpm run preview` | Preview your build locally, before deploying | | `pnpm run astro ...` | Run CLI commands like `astro add`, `astro check` | -| `pnpm run astro -- --help` | Get help using the Astro CLI | \ No newline at end of file +| `pnpm run astro -- --help` | Get help using the Astro CLI | diff --git a/package.json b/package.json index 5bc2931..3f9797d 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,10 @@ "type": "module", "version": "0.0.1", "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro check && astro build", + "dev": "pnpm build-wasm && astro dev", + "start": "pnpm build-wasm && astro dev", + "build-wasm": "cargo build --manifest-path ./src/wasm/webcompiler/Cargo.toml --release --target wasm32-unknown-unknown --target-dir ./target_rust && wasm-bindgen --target web --out-dir ./src/wasm/webcompiler/pkg/ --out-name webcompiler ./target_rust/wasm32-unknown-unknown/release/webcompiler.wasm", + "build": "pnpm build-wasm && astro check && astro build", "preview": "astro preview", "astro": "astro" },