libdragon 12.1.0 → 12.2.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
@@ -69,7 +69,7 @@ Download the [pre-built executable](https://github.com/anacierdem/libdragon-dock
69
69
 
70
70
  ### via NPM
71
71
 
72
- Install [node.js](https://nodejs.org/en/download/) (`>= 22`) and install `libdragon` as a global NPM package;
72
+ Install [node.js](https://nodejs.org/en/download/) (`>= 24`) and install `libdragon` as a global NPM package;
73
73
 
74
74
  ```bash
75
75
  npm install -g libdragon
@@ -172,7 +172,7 @@ To be able to share your project with the library change, you just commit your c
172
172
  > [!TIP]
173
173
  > You can simply use [`development` devcontainer](#development-configuration) support to get up an running quickly if your development environment supports it.
174
174
 
175
- After cloning this repository on a system with node.js (`>= 18`) & docker (`>= 27.2.0`), in this repository's root do;
175
+ After cloning this repository on a system with node.js (`>= 24`) & docker (`>= 27.2.0`), in this repository's root do;
176
176
 
177
177
  ```bash
178
178
  npm install
@@ -293,6 +293,9 @@ To create your own dev container backed project, you can use the contents of the
293
293
 
294
294
  This has everything required to develop the tool itself. Just follow "Working on this repository" section inside the devcontainer.
295
295
 
296
+ > [!NOTE]
297
+ > When working in this devcontainer on a Linux host, you can build and install the latest executable in `${HOME}/.local/bin` by running `npm run install-host` (in the container) to test it on your host.
298
+
296
299
  #### `libdragon` configuration
297
300
 
298
301
  This is an example devcontainer setup for using the libdragon toolchain to build n64 ROMs. To start building with libdragon:
@@ -20,6 +20,7 @@ const { globals } = require('./globals');
20
20
  * VENDOR_STRAT?: VendorStrategy;
21
21
  * FILE?: string;
22
22
  * BRANCH?: string;
23
+ * CWD?: string;
23
24
  * }} CommandlineOptions
24
25
  */
25
26
 
@@ -33,6 +34,9 @@ const parseParameters = async (argv) => {
33
34
  CURRENT_ACTION: undefined,
34
35
  };
35
36
 
37
+ /** @type string[] */
38
+ let potentialExtraFlags = [];
39
+
36
40
  for (let i = 2; i < argv.length; i++) {
37
41
  const val = argv[i];
38
42
 
@@ -90,9 +94,15 @@ const parseParameters = async (argv) => {
90
94
  continue;
91
95
  }
92
96
 
97
+ if (['-C'].includes(val)) {
98
+ options.CWD = argv[++i];
99
+ continue;
100
+ }
101
+
102
+ // Collect unknown flags
93
103
  if (val.indexOf('-') == 0) {
94
- log(chalk.red(`Invalid flag \`${val}\``));
95
- process.exit(STATUS_BAD_PARAM);
104
+ potentialExtraFlags.push(val);
105
+ continue;
96
106
  }
97
107
 
98
108
  if (options.CURRENT_ACTION) {
@@ -126,6 +136,20 @@ const parseParameters = async (argv) => {
126
136
  process.exit(STATUS_BAD_PARAM);
127
137
  }
128
138
 
139
+ // Because of https://github.com/microsoft/vscode-cpptools/issues/14169
140
+ // move any unkown flags before the action to the end of the container command
141
+ if (
142
+ options.CURRENT_ACTION !== actions.exec &&
143
+ potentialExtraFlags.length > 0
144
+ ) {
145
+ log(chalk.red(`Invalid flag \`${potentialExtraFlags[0]}\``));
146
+ process.exit(STATUS_BAD_PARAM);
147
+ }
148
+
149
+ if (options.CURRENT_ACTION === actions.exec) {
150
+ options.EXTRA_PARAMS = [...options.EXTRA_PARAMS, ...potentialExtraFlags];
151
+ }
152
+
129
153
  if (
130
154
  !(
131
155
  /** @type {typeof actions[keyof actions][]} */ ([
@@ -165,6 +165,8 @@ const readProjectInfo = async function (optionInfo) {
165
165
  return /** @type {NoProjectInfo} */ (optionInfo);
166
166
  }
167
167
 
168
+ optionInfo.options.CWD && process.chdir(optionInfo.options.CWD);
169
+
168
170
  const projectRoot = await findLibdragonRoot();
169
171
 
170
172
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libdragon",
3
- "version": "12.1.0",
3
+ "version": "12.2.0",
4
4
  "description": "This is a docker wrapper for libdragon",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -17,6 +17,7 @@
17
17
  "start": "node index.js start",
18
18
  "stop": "node index.js stop",
19
19
  "pack": "node pack.mjs",
20
+ "install-host": "node pack.mjs --install",
20
21
  "bundle": "node bundle.mjs",
21
22
  "format": "prettier **/*.js **/*.mjs **/*.cjs --write",
22
23
  "format-check": "prettier **/*.js **/*.mjs **/*.cjs --check",