Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating dev container and vscode tasks #449

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "freyr-js-dev",
"image": "mcr.microsoft.com/devcontainers/javascript-node",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": {
"yarn install": "yarn global add freyr",
"install build tools": "sudo apt-get update && sudo apt install cmake -y"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never dealt with devcontainers before, but does it presuppose a debian-based environment? what if apt-get is unavailable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea it is a debian container with some basic dependencies installed. The image details are here:
https://hub.docker.com/_/microsoft-devcontainers-javascript-node?tab=description

},
"postStartCommand": "git clone --branch 20210715.151551.e7ad03a --depth 1 https://github.com/wez/atomicparsley $HOME/atomicparsley && cmake -S $HOME/atomicparsley -B $HOME/atomicparsley && cmake --build $HOME/atomicparsley --config Release && sudo ln -s $HOME/atomicparsley/AtomicParsley /usr/bin/AtomicParsley"
}
61 changes: 61 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Short Query (Spotify)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [
"spotify:artist:6M2wZ9GZgrQXHCFfjv46we",
"--no-auth"
],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's substitute this for npm test spotify.track or npm test spotify.artist

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Replaced the launch configurations with the npm test ... calls.

The console isn't showing the full output for this, which makes debugging a bit trickier. I think there is a launch setting in vscode that will attach it to stdout so I'm gonna try to find that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added flag to capture stdout in the vscode debug console.

"preLaunchTask": "npm: install"
},
{
"type": "node",
"request": "launch",
"name": "Short Query (MusicBrainz)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [
"mb:release:be580d1c-181f-4ad9-9bfd-172c3960979e"
],
"preLaunchTask": "npm: install"
},
{
"type": "node",
"request": "launch",
"name": "Short Query (Deezer)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [
"deezer:artist:182"
],
"preLaunchTask": "npm: install"
},
{
"type": "node",
"request": "launch",
"name": "URI Query (Apple Music)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [
"https://music.apple.com/us/artist/red-hot-chili-peppers/889780"
],
"preLaunchTask": "npm: install"
}
]
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "install",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"label": "npm: install",
"detail": "install dependencies from package"
}
]
}