From d8df3b1a7384b299cf724ccc62c98f0fa084dc1a Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:08:02 +0000 Subject: [PATCH 1/7] add a devcontainer.json file --- .devcontainer/devcontainer.json | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..fb4f83c0 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", + + // Configure tool-specific properties. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": true, + "source.organizeImports": true + }, + "typescript.tsdk": "node_modules\\typescript\\lib" + }, + "extensions": [ + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "ms-vsliveshare.vsliveshare", + "svelte.svelte-vscode", + "usernamehw.errorlens" + ], + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} From 87ae42bd48066ba5fd50581be31ca0e17fe6c834 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:10:05 +0000 Subject: [PATCH 2/7] fix JSON formatting error --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fb4f83c0..f777cc6e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -35,7 +35,7 @@ "ms-vsliveshare.vsliveshare", "svelte.svelte-vscode", "usernamehw.errorlens" - ], + ] } // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root" From 813eb0377e63005dad39d7f99614220d2b981cb0 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:15:29 +0000 Subject: [PATCH 3/7] fix devcontainer.json --- .devcontainer/devcontainer.json | 67 +++++++++++++++++---------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f777cc6e..6d9090e4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,42 +1,45 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node { - "name": "Node.js & TypeScript", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye" + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "yarn install", + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", - // Configure tool-specific properties. + // Configure tool-specific properties. + "customizations": { "vscode": { - // Set *default* container specific settings.json values on container create. - "settings": { - "[svelte]": { - "editor.defaultFormatter": "svelte.svelte-vscode" - }, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.fixAll": true, - "source.organizeImports": true - }, - "typescript.tsdk": "node_modules\\typescript\\lib" - }, - "extensions": [ - "esbenp.prettier-vscode", - "github.vscode-github-actions", - "ms-vsliveshare.vsliveshare", - "svelte.svelte-vscode", - "usernamehw.errorlens" - ] + // Set *default* container specific settings.json values on container create. + "settings": { + "[svelte]": { + "editor.defaultFormatter": "svelte.svelte-vscode" + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": true, + "source.organizeImports": true + }, + "typescript.tsdk": "node_modules\\typescript\\lib" + }, + "extensions": [ + "esbenp.prettier-vscode", + "github.vscode-github-actions", + "ms-vsliveshare.vsliveshare", + "svelte.svelte-vscode", + "usernamehw.errorlens" + ] } - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } From d078e3cfe9bd535065e50012b6a1044d20c457b7 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:24:10 +0000 Subject: [PATCH 4/7] set "svelte.enable-ts-plugin": true" --- .devcontainer/devcontainer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6d9090e4..bc395660 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -28,6 +28,7 @@ "source.fixAll": true, "source.organizeImports": true }, + "svelte.enable-ts-plugin": true, "typescript.tsdk": "node_modules\\typescript\\lib" }, "extensions": [ From c7b3ff2e868cc5c1ccc230f4890b5cbce30f6dca Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:24:59 +0000 Subject: [PATCH 5/7] set postCreateCommand --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bc395660..9aef3870 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "yarn install", + "postCreateCommand": "npm install && npm run build", // Configure tool-specific properties. "customizations": { From eaa39589e54cce6935a95ca0d9637de92d17c6a5 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:33:38 +0000 Subject: [PATCH 6/7] change base container tag to default (which is already downloaded) --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9aef3870..ff83fe5a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ { "name": "Node.js & TypeScript", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", + "image": "mcr.microsoft.com/devcontainers/typescript-node:20-bullseye", // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, From 065d1fe64c7e7caf8de70f218da1bf5f031bc597 Mon Sep 17 00:00:00 2001 From: James Scott-Brown Date: Mon, 16 Oct 2023 16:36:36 +0000 Subject: [PATCH 7/7] add github cli and common utilities --- .devcontainer/devcontainer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ff83fe5a..4c8655ca 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -39,7 +39,11 @@ "usernamehw.errorlens" ] } - } +}, +"features": { + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} +} // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. // "remoteUser": "root"