-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
768 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
{ | ||
"name": "Node.js & TypeScript", | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node:16-bullseye", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/implementors/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. | ||
"features": {}, | ||
"forwardPorts": [], | ||
"postCreateCommand": "yarn install", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["esbenp.prettier-vscode"] | ||
} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
pull_request: | ||
|
||
jobs: | ||
test: | ||
ci: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- main | ||
|
||
jobs: | ||
release: | ||
format-check: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,8 @@ | |
"lint-staged", | ||
"prettier", | ||
"semantic-release", | ||
"github-actions" | ||
"github-actions", | ||
"devcontainer" | ||
] | ||
}, | ||
"packageManager": "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { hasPlugin, PluginArgs, PluginType } from "@mokr/core"; | ||
import { | ||
removeDevcontainerJson, | ||
writeDevcontainerJson, | ||
} from "./devcontainerJson.js"; | ||
|
||
async function install({ directory }: PluginArgs) { | ||
await writeDevcontainerJson({ | ||
directory, | ||
data: { | ||
name: "Node.js & TypeScript", | ||
image: "mcr.microsoft.com/devcontainers/typescript-node:16-bullseye", | ||
features: {}, | ||
forwardPorts: [], | ||
postCreateCommand: "yarn install", | ||
customizations: {}, | ||
}, | ||
}); | ||
} | ||
|
||
async function remove({ directory }: PluginArgs) { | ||
await removeDevcontainerJson({ directory }); | ||
} | ||
|
||
async function load({ directory }: PluginArgs) { | ||
if (await hasPlugin({ directory, name: "prettier" })) { | ||
await writeDevcontainerJson({ | ||
directory, | ||
data: { | ||
customizations: { | ||
vscode: { | ||
extensions: ["esbenp.prettier-vscode"], | ||
}, | ||
}, | ||
}, | ||
}); | ||
} | ||
} | ||
|
||
export const devcontainer = { | ||
type: PluginType.Monorepo, | ||
install, | ||
remove, | ||
load, | ||
}; |
Oops, something went wrong.