libdragon 12.0.4 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,9 @@
4
4
 
5
5
  This is a wrapper for a docker container to make managing the libdragon toolchain easier. It has the additional advantage that libdragon toolchain and library can be installed on a per-project basis instead of managing system-wide installations.
6
6
 
7
+ > [!NOTE]
8
+ > I've started this project a few years before [devcontainers](https://containers.dev/) were a thing. The cli still works and provides minor additional functionality, but if you already have a containerized environment, I suggest using a devcontainer instead. It is doing essentially the same thing. You can find more info in [`libdragon` devcontainer](#libdragon-configuration) section. I'll continue to improve that configuration to make it a compelling alternative.
9
+
7
10
  ## Prerequisites
8
11
 
9
12
  You should have [docker](https://www.docker.com/products/docker-desktop) (`>= 27.2.0`) and [git](https://git-scm.com/downloads) installed on your system.
@@ -33,7 +36,7 @@ Download the [pre-built executable](https://github.com/anacierdem/libdragon-dock
33
36
  <details>
34
37
  <summary>Windows instructions</summary>
35
38
 
36
- - Download the Windows executable and copy it to `C:\bin`
39
+ - Download Windows executable and copy it to `C:\bin`
37
40
  - Press `Windows + R` key combination and then enter `rundll32 sysdm.cpl,EditEnvironmentVariables`
38
41
  - In the `Environment Variables` window find the `Path` variable under `User variables for <your user name>`
39
42
  - Double click it and add a new entry as `C:\bin`
@@ -46,7 +49,7 @@ Download the [pre-built executable](https://github.com/anacierdem/libdragon-dock
46
49
  <details>
47
50
  <summary>MacOS instructions</summary>
48
51
 
49
- - Download the MacOS executable and copy it to `/usr/local/bin`
52
+ - Download MacOS executable and copy it to `/usr/local/bin`
50
53
  - Right click it and choose `Open`.
51
54
  - It will show a warning, approve it by clicking `Open` again. You can close the newly opened terminal window.
52
55
  - You should now be able to use the `libdragon` command.
@@ -57,7 +60,10 @@ Download the [pre-built executable](https://github.com/anacierdem/libdragon-dock
57
60
  <details>
58
61
  <summary>Linux instructions</summary>
59
62
 
60
- - You should already know this :)
63
+ - Download Linux executable and copy it to `~/.local/bin`, or somewhere convenient on your `PATH`.
64
+ - Run `chmod u+x ~/.local/bin/libdragon`
65
+ - You should now be able to use the `libdragon` command on new shell sessions.
66
+ - To update it with a new version, replace the file and repeat the other steps.
61
67
 
62
68
  </details>
63
69
 
@@ -163,6 +169,9 @@ To be able to share your project with the library change, you just commit your c
163
169
 
164
170
  ## Working on this repository
165
171
 
172
+ > [!TIP]
173
+ > You can simply use [`development` devcontainer](#development-configuration) support to get up an running quickly if your development environment supports it.
174
+
166
175
  After cloning this repository on a system with node.js (`>= 18`) & docker (`>= 27.2.0`), in this repository's root do;
167
176
 
168
177
  ```bash
@@ -237,7 +246,7 @@ For a quick development loop it really helps linking the code in this repository
237
246
  npm link
238
247
  ```
239
248
 
240
- in the root of the repository. Once you do this, running `libdragon` will use the code here rather than the actual npm installation. Then you can test your changes in the libdragon project here or elsewhere on your computer. This setup is automatically done if you use the [devcontainer](#experimental-devcontainer-support).
249
+ in the root of the repository. Once you do this, running `libdragon` will use the code here rather than the actual npm installation. Then you can test your changes in the libdragon project here or elsewhere on your computer.
241
250
 
242
251
  When you are happy with your changes, you can verify you conform to the coding standards via:
243
252
 
@@ -261,34 +270,46 @@ npm run test
261
270
  This repository uses [`semantic-release`](https://github.com/semantic-release/semantic-release) and manages releases from specially formatted commit messages. To simplify creating them you can use:
262
271
 
263
272
  ```bash
264
- npx cz
273
+ npm run cz
265
274
  ```
266
275
 
267
276
  It will create a `semantic-release` compatible commit from your current staged changes.
268
277
 
269
- ### Experimental devcontainer support
270
-
271
- The repository provides a configuration (in `.devcontainer`) so that IDEs that support it can create and run the Docker container for you. Then, you can start working on it as if you are working on a machine with libdragon installed.
272
-
273
- With the provided setup, you can continue using the cli in the container and it will work for non-container specific actions like `install`, `disasm` etc. You don't have to use the cli in the container, but you can. In general it will be easier and faster to just run `make` in the container but this setup is included to ease developing the cli as well.
278
+ ### Devcontainer support
274
279
 
275
- To create your own dev container backed project, you can use the contents of the `.devcontainer` folder as reference. You don't need to include nodejs or the cli and you can just run `build.sh` as `postCreateCommand`. See the `devcontainer.json` for more details. As long as your container have the `DOCKER_CONTAINER` environment variable, the tool can work inside a container.
276
-
277
- #### Caveats
278
-
279
- - In the devcontainer, uploading via USB will not work.
280
- - Error matching is not yet tested.
281
- - Ideally the necessary extensions should be automatically installed. This is not configured yet.
280
+ The repository provides two devcontainer configurations (`development` and `libdragon`) for supported IDEs. If you have docker and a compatible IDE, you can quickly start working on this project.
281
+ To create your own dev container backed project, you can use the contents of the `.devcontainer` folder as reference.
282
282
 
283
283
  <details>
284
284
  <summary>vscode instructions</summary>
285
285
 
286
286
  - Make sure you have the [Dev container extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed and you fulfill its [requirements](https://code.visualstudio.com/docs/devcontainers/containers).
287
- - Clone this repository with `--recurse-submodules` or run `git submodule update --init`.
288
287
  - Open command palette and run `Dev Containers: Reopen in container`.
288
+ - Pick `development` or `libdragon` configuration.
289
289
  - It will prepare the container and open it in the editor.
290
290
  </details>
291
291
 
292
+ #### `development` configuration
293
+
294
+ This has everything required to develop the tool itself. Just follow "Working on this repository" section inside the devcontainer.
295
+
296
+ #### `libdragon` configuration
297
+
298
+ This is an example devcontainer setup for using the libdragon toolchain to build n64 ROMs. To start building with libdragon:
299
+
300
+ - Clone this repository with `--recurse-submodules` or run `git submodule update --init` in the devcontainer.
301
+ - Run `cd libdragon && ./build.sh && cd ..` to build and install the library.
302
+ - Run `make bench` to build the [test bench](#local-test-bench). You'll see the rom in `src` folder.
303
+
304
+ If you setup a similar devcontainer for your project, you can immediately start building n64 ROMs using libdragon.
305
+
306
+ #### Future direction
307
+
308
+ - The cli is not enabled on `libdragon` devcontainer, so you cannot currently use actions like `install` or `disasm`. This is supported by the cli (via `DOCKER_CONTAINER`) but not yet enabled on the devcontainer.
309
+ - In the devcontainer, uploading via USB is not yet implemented.
310
+ - Error matching is not yet tested.
311
+ - Ideally the necessary extensions should be automatically installed. This is not configured yet.
312
+
292
313
  ## As an NPM dependency
293
314
 
294
315
  You can install libdragon as an NPM dependency by `npm install libdragon --save` in order to use docker in your N64 projects. A `libdragon` command similar to global installation is provided that can be used in your NPM scripts as follows;
@@ -39,6 +39,7 @@ const initContainer = async (libdragonInfo) => {
39
39
  ',target=' +
40
40
  CONTAINER_TARGET_PATH, // Mount files
41
41
  '-w=' + CONTAINER_TARGET_PATH, // Set working directory
42
+ "--add-host=host.docker.internal:host-gateway",
42
43
  libdragonInfo.imageName,
43
44
  'tail',
44
45
  '-f',
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "libdragon",
3
- "version": "12.0.4",
3
+ "version": "12.1.0",
4
4
  "description": "This is a docker wrapper for libdragon",
5
5
  "main": "index.js",
6
6
  "engines": {
7
- "node": ">=22",
7
+ "node": ">=24",
8
8
  "npm": ">=10"
9
9
  },
10
10
  "bin": {
@@ -22,7 +22,8 @@
22
22
  "format-check": "prettier **/*.js **/*.mjs **/*.cjs --check",
23
23
  "lint": "eslint --fix modules/**/*.js *.js *.mjs *.cjs",
24
24
  "lint-check": "eslint modules/**/*.js *.js *.mjs *.cjs",
25
- "tsc": "tsc"
25
+ "tsc": "tsc",
26
+ "cz": "cz"
26
27
  },
27
28
  "repository": {
28
29
  "type": "git",
@@ -39,29 +40,24 @@
39
40
  },
40
41
  "homepage": "https://github.com/anacierdem/libdragon-docker#readme",
41
42
  "dependencies": {
42
- "chalk": "^4.1.0",
43
- "command-line-usage": "^6.1.1",
44
- "zx": "^8.1.8"
43
+ "chalk": "^4.1.2",
44
+ "command-line-usage": "^6.1.3",
45
+ "zx": "^8.8.5"
45
46
  },
46
47
  "devDependencies": {
47
- "@semantic-release/changelog": "^6.0.1",
48
- "@semantic-release/exec": "^6.0.3",
48
+ "@semantic-release/changelog": "^6.0.3",
49
+ "@semantic-release/exec": "^7.1.0",
49
50
  "@semantic-release/git": "^10.0.1",
50
- "@types/command-line-usage": "^5.0.2",
51
- "commitizen": "^4.2.4",
51
+ "@types/command-line-usage": "^5.0.4",
52
52
  "cz-conventional-changelog": "^3.3.0",
53
- "esbuild": "^0.20.0",
54
- "eslint": "^9.11.0",
55
- "jest": "^29.5.0",
53
+ "esbuild": "^0.25.12",
54
+ "eslint": "^9.39.2",
55
+ "jest": "^29.7.0",
56
56
  "postject": "^1.0.0-alpha.6",
57
- "prettier": "^2.4.0",
58
- "ref-napi": "^3.0.3",
59
- "semantic-release": "^24.0.0",
60
- "typescript": "^4.7.4",
61
- "zx": "^8.1.8"
62
- },
63
- "overrides": {
64
- "minimist": "1.2.6"
57
+ "prettier": "^2.8.8",
58
+ "semantic-release": "^25.0.3",
59
+ "typescript": "^4.9.5",
60
+ "zx": "^8.8.5"
65
61
  },
66
62
  "release": {
67
63
  "plugins": [