Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into sea-test
Browse files Browse the repository at this point in the history
  • Loading branch information
anacierdem committed Sep 24, 2024
2 parents 97cb111 + c0a6089 commit 70e2b0f
Show file tree
Hide file tree
Showing 25 changed files with 3,562 additions and 14,886 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

25 changes: 15 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
jobs:
staticAnalysis:
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

Expand All @@ -22,15 +24,18 @@ jobs:
npm run tsc
integrationTests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

Expand All @@ -49,10 +54,10 @@ jobs:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: '22'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ jobs:

release:
name: Release
runs-on: ubuntu-latest
needs: verify
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Prepare
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
# Do not include registy url here, it creates a .npmrc which prevents
# semantic-release from authenticating with npm
node-version: '20'
node-version: '22'
cache: 'npm'

- name: Install
Expand Down
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
# [11.2.0](https://github.com/anacierdem/libdragon-docker/compare/v11.1.3...v11.2.0) (2024-09-23)


### Bug Fixes

* enable CVE-2024-27980 compatibility ([73bd360](https://github.com/anacierdem/libdragon-docker/commit/73bd360820236fdcbd70f3ce275e415c22b1e0d3))
* fix --branch flag wasn't working on a non-Windows system ([dfc4be0](https://github.com/anacierdem/libdragon-docker/commit/dfc4be0bbfc9e9f667724528f20a94b86a465f73))
* fix a potential condition causing an empty branch name ([ff86777](https://github.com/anacierdem/libdragon-docker/commit/ff8677748f679aa2cdbbc250c505980f46b5cf97))
* output stderr of a command failure for better context for submodule creation ([17867e6](https://github.com/anacierdem/libdragon-docker/commit/17867e69a1bea517d8c3c5c1b6ea061117130a4b))
* recover the branch only if the new project is initiated as a submodule ([c8cfd7a](https://github.com/anacierdem/libdragon-docker/commit/c8cfd7add01a70b658c49ff0deed5f3480f2ef29))


### Features

* **init.js:** add a new --branch flag to override the libdragon branch ([20cd675](https://github.com/anacierdem/libdragon-docker/commit/20cd675621c8e57668dc4330db7cc7964d0dd1fa)), closes [#75](https://github.com/anacierdem/libdragon-docker/issues/75)

## [11.1.3](https://github.com/anacierdem/libdragon-docker/compare/v11.1.2...v11.1.3) (2024-09-17)


### Bug Fixes

* streamline dependencies ([49aa08e](https://github.com/anacierdem/libdragon-docker/commit/49aa08e827febb612189989ba99fa5683a6f927b))

## [11.1.2](https://github.com/anacierdem/libdragon-docker/compare/v11.1.1...v11.1.2) (2024-09-17)


### Bug Fixes

* include the installer in the release ([46299ba](https://github.com/anacierdem/libdragon-docker/commit/46299ba0c635227e363c23b3b58738ca8b01bad4))

## [11.1.1](https://github.com/anacierdem/libdragon-docker/compare/v11.1.0...v11.1.1) (2024-09-17)


### Bug Fixes

* include the cli with the correct version in the installer ([a8a9804](https://github.com/anacierdem/libdragon-docker/commit/a8a9804e3d882f3f8435205f236c7ff8b2c17950))

# [11.1.0](https://github.com/anacierdem/libdragon-docker/compare/v11.0.3...v11.1.0) (2024-09-16)


### Features

* add experimental Windows installer ([83aab64](https://github.com/anacierdem/libdragon-docker/commit/83aab64f040eafc48f27c282e95de7477362f53c))

## [11.0.3](https://github.com/anacierdem/libdragon-docker/compare/v11.0.2...v11.0.3) (2024-02-16)


Expand Down
52 changes: 38 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,29 @@ This is a wrapper for a docker container to make managing the libdragon toolchai

## Prerequisites

You should have [docker](https://www.docker.com/products/docker-desktop) (`>= 24`) installed on your system.
You should have [docker](https://www.docker.com/products/docker-desktop) (`>= 27.2.0`) installed on your system.

`git` is not strictly required to use the tool. Still, it is highly recommended to have git on your host machine as it will be used instead of the one in the container.

## Installation

This is primarily a node.js script which is also packaged as an executable. You have two options:
This is primarily a node.js script which is also packaged as an executable. You have a few options:

### pre-built
### installer

Download the [windows installer](https://github.com/anacierdem/libdragon-docker/releases/latest) and run it. This option is currently only available on Windows.

<details>
<summary>Detailed instructions</summary>

- Download the Windows installer and run it
- It can show a "Windows protected your PC" warning. Click "More info" and "Run anyway".
- You should now be able to use the `libdragon` on a command line or PowerShell.
- To update it with a new version, download a newer installer and repeat the steps above.

</details>

### pre-built executable

Download the [pre-built executable](https://github.com/anacierdem/libdragon-docker/releases/latest) for your system and put it somewhere on your PATH. It is discouraged to put it in your project folder.

Expand Down Expand Up @@ -91,15 +105,19 @@ Run `libdragon help [action]` for more details on individual actions.

## Recipes

### Using a different branch of libdragon
### Using a different libdragon branch

Initialize your project as usual:
Use the `--branch` flag to set up a custom libdragon branch when initializing your project:

```bash
libdragon init
libdragon init --branch unstable
```

Then switch the submodule to the desired branch:
This will use the `unstable` toolchain and code.

### Switching to a different branch of libdragon

On an already initialized project, switch the submodule to the desired branch:

```bash
git -C ./libdragon checkout opengl
Expand Down Expand Up @@ -147,7 +165,7 @@ To be able to share your project with the library change, you just commit your c

## Working on this repository

After cloning this repository on a system with node.js (`>= 18`) & docker (`>= 24`), in this repository's root do;
After cloning this repository on a system with node.js (`>= 18`) & docker (`>= 27.2.0`), in this repository's root do;

```bash
npm install
Expand Down Expand Up @@ -190,7 +208,9 @@ Similarly to run the `clean` recipe, run;
npm run libdragon -- make clean
```

Keep in mind that `--` is necessary for actual arguments when using npm scripts.
> [!IMPORTANT]
> Keep in mind that `--` is necessary for actual arguments when using npm scripts.

To update the submodule and re-build everything;

Expand All @@ -204,7 +224,8 @@ The root `bench` recipe is for building the code in root `src` folder. This is a

There are also vscode launch configurations to quickly build the examples, tests and the bench. If you have the `N64_EMU` environment variable set pointing at your favourite emulator ([ares](https://ares-emu.net/) is highly recommended), the launch configurations ending in `(emu)` will kick your emulator with the selected example/code. You can also just hit F5 to launch the selected configuration.

This repository also uses [ed64](https://github.com/anacierdem/ed64), so you can use the launch configurations without `(emu)` to run the code if you have an everdrive plugged in and your active configuration will just boot up.
> [!NOTE]
> This repository also uses [ed64](https://github.com/anacierdem/ed64), so you can use the launch configurations without `(emu)` to run the code if you have an everdrive plugged in and your active configuration will just boot up.
You can clean everything with the `clean` recipe/task (open the command palette and choose `Run Task -> clean`).

Expand Down Expand Up @@ -268,7 +289,12 @@ To create your own dev container backed project, you can use the contents of the
- It will prepare the container and open it in the editor.
</details>

## As an NPM dependency
## Dependency management

> [!WARNING]
> This is an experimental feature.
### As an NPM dependency

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 intallation is provided that can be used in your NPM scripts as follows;

Expand All @@ -282,7 +308,7 @@ You can install libdragon as an NPM dependency by `npm install libdragon --save`

See [here](https://github.com/anacierdem/ed64-example) for a full example.

## Developing a dependency
### Developing a dependency

You can make an NPM package that a `libdragon` project can depend on. Just include a `Makefile` on the repository root with a default recipe and an `install` recipe. On the depending project, after installing libdragon and the dependency with `npm install <dep name> --save`, one can install libdragon dependencies on the current docker container using `package.json` scripts.

Expand All @@ -307,8 +333,6 @@ For example this `package.json` in the dependent project;

will init the container for this project and run `make && make install` for `ed64` upon running `npm install`. To develop a dependency [this](https://github.com/anacierdem/libdragon-dependency) is a good starting point.

This is an experimental dependency management.

## Funding

If this tool helped you, consider supporting its development by sponsoring it!
Expand Down
20 changes: 20 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import globals from 'globals';
import js from '@eslint/js';

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
globals: {
...globals.node,
...globals['2021'],
myCustomGlobal: 'readonly',
},
},
rules: {
'no-console': 2,
},
},
];
4 changes: 1 addition & 3 deletions globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export {};

declare global {
var PACKAGED: boolean | undefined;
}
declare global {}
2 changes: 1 addition & 1 deletion libdragon
Submodule libdragon updated 246 files
Binary file added libdragon.ico
Binary file not shown.
Loading

0 comments on commit 70e2b0f

Please sign in to comment.