chore: sync newest module updates to registry (#84)

## Changes made
- Copied over all changes to existing modules, making sure to preserve
all relative path updates made specifically for the Registry repo
- Copied over all modules that were created since the last sync
(Windsurf, Devcontainers-CLI)
- Copied over changes from the `test.ts` file

## Notes
- This PR does not cover https://github.com/coder/modules/pull/426,
which contains a few changes around updating the Bash scripts and the
contributing README file. @f0ssel tagging you so that you're aware, but
I'll be taking care of the `CONTRIBUTING.md` file

---------

Co-authored-by: M Atif Ali <me@matifali.dev>
This commit is contained in:
Michael Smith
2025-05-09 11:28:38 -04:00
committed by GitHub
parent 7ea1f305af
commit 496b09d93f
28 changed files with 1047 additions and 145 deletions
+15 -6
View File
@@ -30,6 +30,12 @@ export const runContainer = async (
return containerID.trim();
};
export interface scriptOutput {
exitCode: number;
stdout: string[];
stderr: string[];
}
/**
* Finds the only "coder_script" resource in the given state and runs it in a
* container.
@@ -38,13 +44,15 @@ export const executeScriptInContainer = async (
state: TerraformState,
image: string,
shell = "sh",
): Promise<{
exitCode: number;
stdout: string[];
stderr: string[];
}> => {
before?: string,
): Promise<scriptOutput> => {
const instance = findResourceInstance(state, "coder_script");
const id = await runContainer(image);
if (before) {
await execContainer(id, [shell, "-c", before]);
}
const resp = await execContainer(id, [shell, "-c", instance.script]);
const stdout = resp.stdout.trim().split("\n");
const stderr = resp.stderr.trim().split("\n");
@@ -58,12 +66,13 @@ export const executeScriptInContainer = async (
export const execContainer = async (
id: string,
cmd: string[],
args?: string[],
): Promise<{
exitCode: number;
stderr: string;
stdout: string;
}> => {
const proc = spawn(["docker", "exec", id, ...cmd], {
const proc = spawn(["docker", "exec", ...(args ?? []), id, ...cmd], {
stderr: "pipe",
stdout: "pipe",
});