From 9df84c29e3f2d4129bc52efb54b087d0da83ed54 Mon Sep 17 00:00:00 2001 From: Chuck Lantz Date: Tue, 30 Jul 2019 16:06:43 -0700 Subject: [PATCH 1/3] 0.25.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 21d1482bb3..b17735ec60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vscode-dev-containers", - "version": "0.24.0", + "version": "0.25.0", "description": "VS Code Dev Containers: Definitions and Templates", "repository": { "type": "git", From 449d324427202abdf141d32f37794fa256d20ab2 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 1 Aug 2019 16:06:15 -0700 Subject: [PATCH 2/3] Don't run `pip install -r requirements.txt` in the Dockerfile Instead, make it a suggested postCreateCommand. --- containers/python-3/.devcontainer/Dockerfile | 15 +++++++-------- .../python-3/.devcontainer/devcontainer.json | 2 +- containers/python-3/.devcontainer/noop.txt | 3 --- containers/python-3/README.md | 6 +++--- 4 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 containers/python-3/.devcontainer/noop.txt diff --git a/containers/python-3/.devcontainer/Dockerfile b/containers/python-3/.devcontainer/Dockerfile index ba6d22a290..6dd7da52a5 100644 --- a/containers/python-3/.devcontainer/Dockerfile +++ b/containers/python-3/.devcontainer/Dockerfile @@ -13,11 +13,10 @@ ARG USERNAME=vscode ARG USER_UID=1000 ARG USER_GID=$USER_UID -# Copy requirements.txt (if found) to a temp location so we can install it. The `*` -# is required so COPY doesn't think that part of the command should fail is nothing is -# found. Also copy "noop.txt" so the COPY instruction copies _something_ to guarantee -# success somehow. -COPY *requirements.txt .devcontainer/noop.txt /tmp/pip-tmp/ +# Uncomment the following COPY line and the corresponding lines in the `RUN` command if you wish to +# include your requirements in the image itself. It is suggested that you only do this if your +# requirements rarely (if ever) change. +# COPY requirements.txt /tmp/pip-tmp/ # Configure apt and install packages RUN apt-get update \ @@ -29,9 +28,9 @@ RUN apt-get update \ # Install pylint && pip --disable-pip-version-check --no-cache-dir install pylint \ # - # Update Python environment based on requirements.txt (if presenet) - && if [ -f "/tmp/pip-tmp/requirements.txt" ]; then pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt; fi \ - && rm -rf /tmp/pip-tmp \ + # Update Python environment based on requirements.txt + # && pip --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ + # && rm -rf /tmp/pip-tmp \ # # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user. && groupadd --gid $USER_GID $USERNAME \ diff --git a/containers/python-3/.devcontainer/devcontainer.json b/containers/python-3/.devcontainer/devcontainer.json index 473993657a..e3f9f41f65 100644 --- a/containers/python-3/.devcontainer/devcontainer.json +++ b/containers/python-3/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ // "appPort": [], // Uncomment the next line to run commands after the container is created. - // "postCreateCommand": "python --version", + // "postCreateCommand": "pip install -r requirements.txt", // Uncomment the next line to use a non-root user. See https://aka.ms/vscode-remote/containers/non-root-user. // "runArgs": [ "-u", "1000" ], diff --git a/containers/python-3/.devcontainer/noop.txt b/containers/python-3/.devcontainer/noop.txt deleted file mode 100644 index 6d257995ff..0000000000 --- a/containers/python-3/.devcontainer/noop.txt +++ /dev/null @@ -1,3 +0,0 @@ -This file is copied into the container along with requirements.txt* from the -parent folder. This is done to prevent the Dockerfile COPY instruction from -failing if no requirements.txt is found. \ No newline at end of file diff --git a/containers/python-3/README.md b/containers/python-3/README.md index c598fc2c7b..5d78812d11 100644 --- a/containers/python-3/README.md +++ b/containers/python-3/README.md @@ -2,9 +2,9 @@ ## Summary -*Develop Python 3 applications. Installs dependencies from your requirements.txt file and the Python extension.* +*Develop Python 3 applications.* -| Metadata | Value | +| Metadata | Value | |----------|-------| | *Contributors* | The [VS Code Python extension](https://marketplace.visualstudio.com/itemdetails?itemName=ms-python.python) team | | *Definition type* | Dockerfile | @@ -12,7 +12,7 @@ ## Using this definition with an existing folder -For convenience, this definition will automatically install dependencies from your `requirements.txt` file when the container is built. Also note that only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used. +Note that only the integrated terminal is supported by the Remote - Containers extension. You may need to modify `launch.json` configurations to include the following value if an external console is used. ```json "console": "integratedTerminal" From 304ab0beb0856e8b6c85eb3be66bfccb36976f8b Mon Sep 17 00:00:00 2001 From: William Bergeron-Drouin Date: Sun, 4 Aug 2019 21:53:22 +0000 Subject: [PATCH 3/3] Removed architecture examples for simpler hello-world file --- containers/elm/test-project/LICENSE | 27 ---- containers/elm/test-project/README.md | 28 ----- .../elm/test-project/examples/02-field.elm | 53 -------- .../elm/test-project/examples/03-form.elm | 78 ------------ .../elm/test-project/examples/04-maybe.elm | 65 ---------- .../elm/test-project/examples/05-http.elm | 82 ------------- .../elm/test-project/examples/06-json.elm | 115 ------------------ .../elm/test-project/examples/07-random.elm | 77 ------------ .../elm/test-project/examples/08-time.elm | 81 ------------ .../{01-button.elm => hello-world.elm} | 20 ++- 10 files changed, 7 insertions(+), 619 deletions(-) delete mode 100644 containers/elm/test-project/LICENSE delete mode 100644 containers/elm/test-project/README.md delete mode 100644 containers/elm/test-project/examples/02-field.elm delete mode 100644 containers/elm/test-project/examples/03-form.elm delete mode 100644 containers/elm/test-project/examples/04-maybe.elm delete mode 100644 containers/elm/test-project/examples/05-http.elm delete mode 100644 containers/elm/test-project/examples/06-json.elm delete mode 100644 containers/elm/test-project/examples/07-random.elm delete mode 100644 containers/elm/test-project/examples/08-time.elm rename containers/elm/test-project/examples/{01-button.elm => hello-world.elm} (55%) diff --git a/containers/elm/test-project/LICENSE b/containers/elm/test-project/LICENSE deleted file mode 100644 index 2377b9c65f..0000000000 --- a/containers/elm/test-project/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2014-2016, Evan Czaplicki -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the {organization} nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/containers/elm/test-project/README.md b/containers/elm/test-project/README.md deleted file mode 100644 index 53ea50e4e4..0000000000 --- a/containers/elm/test-project/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# Elm - -[Elm](https://elm-lang.org/) is a programming language that compiles to JavaScript. It is known for its friendly error messages, helping you find issues quickly and refactor large projects with confidence. Elm is also [very fast](https://elm-lang.org/blog/blazing-fast-html-round-two) and [very small](https://elm-lang.org/blog/small-assets-without-the-headache) when compared with React, Angular, Ember, etc. - -This repo focuses on **The Elm Architecture**, an architecture pattern you see in all Elm programs. It has influenced projects like Redux that borrow core concepts but add many JS-focused ideas. - - -## The Elm Architecture - -The Elm Architecture is a simple pattern for architecting webapps. The core idea is that your code is built around a `Model` of your application state, a way to `update` your model, and a way to `view` your model. - -To learn more about this, read the [the official guide][guide] and check out [this section][arch] which is all about The Elm Architecture. This repo is a collection of all the examples in that section, so you can follow along and compile things on your computer as you read through. - -[guide]: https://guide.elm-lang.org/ -[arch]: https://guide.elm-lang.org/architecture/ - - -## Run The Examples - -After you [install](https://guide.elm-lang.org/install.html), run the following commands in your terminal to download this repo and start a server that compiles Elm for you: - -```bash -git clone https://github.com/evancz/elm-architecture-tutorial.git -cd elm-architecture-tutorial -elm reactor -``` - -Now go to [http://localhost:8000/](http://localhost:8000/) and start looking at the `examples/` directory. When you edit an Elm file, just refresh the corresponding page in your browser and it will recompile! diff --git a/containers/elm/test-project/examples/02-field.elm b/containers/elm/test-project/examples/02-field.elm deleted file mode 100644 index 3041f29fbc..0000000000 --- a/containers/elm/test-project/examples/02-field.elm +++ /dev/null @@ -1,53 +0,0 @@ -import Browser -import Html exposing (Html, Attribute, div, input, text) -import Html.Attributes exposing (..) -import Html.Events exposing (onInput) - - - --- MAIN - - -main = - Browser.sandbox { init = init, update = update, view = view } - - - --- MODEL - - -type alias Model = - { content : String - } - - -init : Model -init = - { content = "" } - - - --- UPDATE - - -type Msg - = Change String - - -update : Msg -> Model -> Model -update msg model = - case msg of - Change newContent -> - { model | content = newContent } - - - --- VIEW - - -view : Model -> Html Msg -view model = - div [] - [ input [ placeholder "Text to reverse", value model.content, onInput Change ] [] - , div [] [ text (String.reverse model.content) ] - ] diff --git a/containers/elm/test-project/examples/03-form.elm b/containers/elm/test-project/examples/03-form.elm deleted file mode 100644 index 3126715620..0000000000 --- a/containers/elm/test-project/examples/03-form.elm +++ /dev/null @@ -1,78 +0,0 @@ -import Browser -import Html exposing (..) -import Html.Attributes exposing (..) -import Html.Events exposing (onInput) - - - --- MAIN - - -main = - Browser.sandbox { init = init, update = update, view = view } - - - --- MODEL - - -type alias Model = - { name : String - , password : String - , passwordAgain : String - } - - -init : Model -init = - Model "" "" "" - - - --- UPDATE - - -type Msg - = Name String - | Password String - | PasswordAgain String - - -update : Msg -> Model -> Model -update msg model = - case msg of - Name name -> - { model | name = name } - - Password password -> - { model | password = password } - - PasswordAgain password -> - { model | passwordAgain = password } - - - --- VIEW - - -view : Model -> Html Msg -view model = - div [] - [ viewInput "text" "Name" model.name Name - , viewInput "password" "Password" model.password Password - , viewInput "password" "Re-enter Password" model.passwordAgain PasswordAgain - , viewValidation model - ] - - -viewInput : String -> String -> String -> (String -> msg) -> Html msg -viewInput t p v toMsg = - input [ type_ t, placeholder p, value v, onInput toMsg ] [] - - -viewValidation : Model -> Html msg -viewValidation model = - if model.password == model.passwordAgain then - div [ style "color" "green" ] [ text "OK" ] - else - div [ style "color" "red" ] [ text "Passwords do not match!" ] diff --git a/containers/elm/test-project/examples/04-maybe.elm b/containers/elm/test-project/examples/04-maybe.elm deleted file mode 100644 index fd41c74d75..0000000000 --- a/containers/elm/test-project/examples/04-maybe.elm +++ /dev/null @@ -1,65 +0,0 @@ -import Browser -import Html exposing (Html, Attribute, span, input, text) -import Html.Attributes exposing (..) -import Html.Events exposing (onInput) - - - --- MAIN - - -main = - Browser.sandbox { init = init, update = update, view = view } - - - --- MODEL - - -type alias Model = - { input : String - } - - -init : Model -init = - { input = "" } - - - --- UPDATE - - -type Msg - = Change String - - -update : Msg -> Model -> Model -update msg model = - case msg of - Change newInput -> - { model | input = newInput } - - - --- VIEW - - -view : Model -> Html Msg -view model = - case String.toFloat model.input of - Just celsius -> - viewConverter model.input "blue" (String.fromFloat (celsius * 1.8 + 32)) - - Nothing -> - viewConverter model.input "red" "???" - - -viewConverter : String -> String -> String -> Html Msg -viewConverter userInput color equivalentTemp = - span [] - [ input [ value userInput, onInput Change, style "width" "40px" ] [] - , text "°C = " - , span [ style "color" color ] [ text equivalentTemp ] - , text "°F" - ] diff --git a/containers/elm/test-project/examples/05-http.elm b/containers/elm/test-project/examples/05-http.elm deleted file mode 100644 index 1483834eba..0000000000 --- a/containers/elm/test-project/examples/05-http.elm +++ /dev/null @@ -1,82 +0,0 @@ -import Browser -import Html exposing (Html, text, pre) -import Http - - - --- MAIN - - -main = - Browser.element - { init = init - , update = update - , subscriptions = subscriptions - , view = view - } - - - --- MODEL - - -type Model - = Failure - | Loading - | Success String - - -init : () -> (Model, Cmd Msg) -init _ = - ( Loading - , Http.get - { url = "https://elm-lang.org/assets/public-opinion.txt" - , expect = Http.expectString GotText - } - ) - - - --- UPDATE - - -type Msg - = GotText (Result Http.Error String) - - -update : Msg -> Model -> (Model, Cmd Msg) -update msg model = - case msg of - GotText result -> - case result of - Ok fullText -> - (Success fullText, Cmd.none) - - Err _ -> - (Failure, Cmd.none) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - Sub.none - - - --- VIEW - - -view : Model -> Html Msg -view model = - case model of - Failure -> - text "I was unable to load your book." - - Loading -> - text "Loading..." - - Success fullText -> - pre [] [ text fullText ] diff --git a/containers/elm/test-project/examples/06-json.elm b/containers/elm/test-project/examples/06-json.elm deleted file mode 100644 index d4824865b8..0000000000 --- a/containers/elm/test-project/examples/06-json.elm +++ /dev/null @@ -1,115 +0,0 @@ -import Browser -import Html exposing (..) -import Html.Attributes exposing (..) -import Html.Events exposing (..) -import Http -import Json.Decode exposing (Decoder, field, string) - - - --- MAIN - - -main = - Browser.element - { init = init - , update = update - , subscriptions = subscriptions - , view = view - } - - - --- MODEL - - -type Model - = Failure - | Loading - | Success String - - -init : () -> (Model, Cmd Msg) -init _ = - (Loading, getRandomCatGif) - - - --- UPDATE - - -type Msg - = MorePlease - | GotGif (Result Http.Error String) - - -update : Msg -> Model -> (Model, Cmd Msg) -update msg model = - case msg of - MorePlease -> - (Loading, getRandomCatGif) - - GotGif result -> - case result of - Ok url -> - (Success url, Cmd.none) - - Err _ -> - (Failure, Cmd.none) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - Sub.none - - - --- VIEW - - -view : Model -> Html Msg -view model = - div [] - [ h2 [] [ text "Random Cats" ] - , viewGif model - ] - - -viewGif : Model -> Html Msg -viewGif model = - case model of - Failure -> - div [] - [ text "I could not load a random cat for some reason. " - , button [ onClick MorePlease ] [ text "Try Again!" ] - ] - - Loading -> - text "Loading..." - - Success url -> - div [] - [ button [ onClick MorePlease, style "display" "block" ] [ text "More Please!" ] - , img [ src url ] [] - ] - - - --- HTTP - - -getRandomCatGif : Cmd Msg -getRandomCatGif = - Http.get - { url = "https://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cat" - , expect = Http.expectJson GotGif gifDecoder - } - - -gifDecoder : Decoder String -gifDecoder = - field "data" (field "image_url" string) diff --git a/containers/elm/test-project/examples/07-random.elm b/containers/elm/test-project/examples/07-random.elm deleted file mode 100644 index b11f637685..0000000000 --- a/containers/elm/test-project/examples/07-random.elm +++ /dev/null @@ -1,77 +0,0 @@ -import Browser -import Html exposing (..) -import Html.Events exposing (..) -import Random - - - --- MAIN - - -main = - Browser.element - { init = init - , update = update - , subscriptions = subscriptions - , view = view - } - - - --- MODEL - - -type alias Model = - { dieFace : Int - } - - -init : () -> (Model, Cmd Msg) -init _ = - ( Model 1 - , Cmd.none - ) - - - --- UPDATE - - -type Msg - = Roll - | NewFace Int - - -update : Msg -> Model -> (Model, Cmd Msg) -update msg model = - case msg of - Roll -> - ( model - , Random.generate NewFace (Random.int 1 6) - ) - - NewFace newFace -> - ( Model newFace - , Cmd.none - ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - Sub.none - - - --- VIEW - - -view : Model -> Html Msg -view model = - div [] - [ h1 [] [ text (String.fromInt model.dieFace) ] - , button [ onClick Roll ] [ text "Roll" ] - ] \ No newline at end of file diff --git a/containers/elm/test-project/examples/08-time.elm b/containers/elm/test-project/examples/08-time.elm deleted file mode 100644 index 9f6ed6bad5..0000000000 --- a/containers/elm/test-project/examples/08-time.elm +++ /dev/null @@ -1,81 +0,0 @@ -import Browser -import Html exposing (..) -import Task -import Time - - - --- MAIN - - -main = - Browser.element - { init = init - , view = view - , update = update - , subscriptions = subscriptions - } - - - --- MODEL - - -type alias Model = - { zone : Time.Zone - , time : Time.Posix - } - - -init : () -> (Model, Cmd Msg) -init _ = - ( Model Time.utc (Time.millisToPosix 0) - , Task.perform AdjustTimeZone Time.here - ) - - - --- UPDATE - - -type Msg - = Tick Time.Posix - | AdjustTimeZone Time.Zone - - - -update : Msg -> Model -> (Model, Cmd Msg) -update msg model = - case msg of - Tick newTime -> - ( { model | time = newTime } - , Cmd.none - ) - - AdjustTimeZone newZone -> - ( { model | zone = newZone } - , Cmd.none - ) - - - --- SUBSCRIPTIONS - - -subscriptions : Model -> Sub Msg -subscriptions model = - Time.every 1000 Tick - - - --- VIEW - - -view : Model -> Html Msg -view model = - let - hour = String.fromInt (Time.toHour model.zone model.time) - minute = String.fromInt (Time.toMinute model.zone model.time) - second = String.fromInt (Time.toSecond model.zone model.time) - in - h1 [] [ text (hour ++ ":" ++ minute ++ ":" ++ second) ] \ No newline at end of file diff --git a/containers/elm/test-project/examples/01-button.elm b/containers/elm/test-project/examples/hello-world.elm similarity index 55% rename from containers/elm/test-project/examples/01-button.elm rename to containers/elm/test-project/examples/hello-world.elm index 2599444620..7a3006c75d 100644 --- a/containers/elm/test-project/examples/01-button.elm +++ b/containers/elm/test-project/examples/hello-world.elm @@ -9,33 +9,27 @@ main = -- MODEL -type alias Model = Int +type alias Model = String init : Model init = - 0 - + "" -- UPDATE -type Msg = Increment | Decrement +type Msg = ToggleText update : Msg -> Model -> Model update msg model = case msg of - Increment -> - model + 1 - - Decrement -> - model - 1 - + ToggleText -> + if model == "" then "Hello World!" else "" -- VIEW view : Model -> Html Msg view model = div [] - [ button [ onClick Decrement ] [ text "-" ] - , div [] [ text (String.fromInt model) ] - , button [ onClick Increment ] [ text "+" ] + [ button [ onClick ToggleText ] [ text "Toggle text" ] + , div [] [ text (model) ] ] \ No newline at end of file