diff --git a/README.md b/README.md index dc7ecd0cf6..f88af4697f 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,11 @@ This repository contains a set of **dev container definition** files such as `de ## Trying a definition -1. Check out the README under the definition folder in `definitions` to see if there are any manual steps -2. Clone this repository or copy the contents of the folder to your machine -3. Run the **Remote: Open Folder in Container...** command in VS Code -4. Select the definition folder in the folder open dialog +1. Open a folder in the `definitions` folder +2. Check out the README to see if there are any manual steps +3. Clone this repository or copy the contents of the folder to your machine +4. Run the **Remote: Open Folder in Container...** command in VS Code +5. Select the definition folder in the "open" dialog Many definitions come with a `test-project` that you can use to see everything working along with a `launch.json`. diff --git a/definitions/dart-web/.vscode/devContainer.json b/definitions/dart-web/.vscode/devContainer.json index ad5682d7a8..ea5cf328f2 100644 --- a/definitions/dart-web/.vscode/devContainer.json +++ b/definitions/dart-web/.vscode/devContainer.json @@ -1,8 +1,9 @@ { "name": "Dart", "dockerFile": "dev-container.dockerfile", + "appPort": 8080, "extensions": [ - "dart-code.dart-code" - ], - "appPort": 8080 + "dart-code.dart-code", + "msjsdiag.debugger-for-chrome" + ] } diff --git a/definitions/dart-web/.vscode/launch.json b/definitions/dart-web/.vscode/launch.json index 771bcc4e5c..d10ebd2b8d 100644 --- a/definitions/dart-web/.vscode/launch.json +++ b/definitions/dart-web/.vscode/launch.json @@ -13,7 +13,8 @@ "name": "Dart", "type": "dart", "request": "launch", - "program": "test-project/web/main.dart" + "program": "test-project/web/main.dart", + "preLaunchTask": "Serve" } ] } \ No newline at end of file diff --git a/definitions/dart-web/.vscode/tasks.json b/definitions/dart-web/.vscode/tasks.json new file mode 100644 index 0000000000..3cbc203a87 --- /dev/null +++ b/definitions/dart-web/.vscode/tasks.json @@ -0,0 +1,12 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Serve", + "type": "shell", + "command": "cd test-project && webdev serve --hostname 0.0.0.0 --live-reload" + } + ] +} \ No newline at end of file diff --git a/definitions/dart-web/Readme.md b/definitions/dart-web/Readme.md index 1938073bb7..a32968ce5d 100644 --- a/definitions/dart-web/Readme.md +++ b/definitions/dart-web/Readme.md @@ -1,9 +1 @@ -## Dart Dev Container Sample - -* `cd quickstart` -* `pub get` -* `webdev serve --hostname 0.0.0.0 --live-reload` - -* Open [localhost:8080](http://localhost:8080) - -* Make changes to `main.dart` \ No newline at end of file +# Dart Dev Container \ No newline at end of file diff --git a/definitions/dart-web/dev-container.dockerfile b/definitions/dart-web/dev-container.dockerfile index dacbd9b0e0..3801c839d9 100755 --- a/definitions/dart-web/dev-container.dockerfile +++ b/definitions/dart-web/dev-container.dockerfile @@ -1,5 +1,7 @@ -FROM google/dart +FROM google/dart:2 + ENV PATH="$PATH":"/root/.pub-cache/bin" + RUN pub global activate webdev # Install git diff --git a/definitions/dart-web/test-project/CHANGELOG.md b/definitions/dart-web/test-project/CHANGELOG.md deleted file mode 100644 index 687440bac9..0000000000 --- a/definitions/dart-web/test-project/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 1.0.0 - -- Initial version, created by Stagehand diff --git a/definitions/dart-web/test-project/analysis_options.yaml b/definitions/dart-web/test-project/analysis_options.yaml index a686c1b456..108d1058ac 100644 --- a/definitions/dart-web/test-project/analysis_options.yaml +++ b/definitions/dart-web/test-project/analysis_options.yaml @@ -1,14 +1 @@ -# Defines a default set of lint rules enforced for -# projects at Google. For details and rationale, -# see https://github.com/dart-lang/pedantic#enabled-lints. include: package:pedantic/analysis_options.yaml - -# For lint rules and documentation, see http://dart-lang.github.io/linter/lints. -# Uncomment to specify additional rules. -# linter: -# rules: -# - camel_case_types - -analyzer: -# exclude: -# - path/to/excluded/files/** diff --git a/definitions/dart-web/test-project/pubspec.yaml b/definitions/dart-web/test-project/pubspec.yaml index 4b58b3bbff..9ede9b9817 100644 --- a/definitions/dart-web/test-project/pubspec.yaml +++ b/definitions/dart-web/test-project/pubspec.yaml @@ -1,15 +1,9 @@ -name: quickstart -description: An absolute bare-bones web app. -# version: 1.0.0 -#homepage: https://www.example.com -#author: Your Name +name: testproject +description: A test project environment: sdk: '>=2.1.0 <3.0.0' -#dependencies: -# path: ^1.4.1 - dev_dependencies: build_runner: ^1.1.2 build_web_compilers: ^1.0.0 diff --git a/definitions/dart-web/test-project/web/favicon.ico b/definitions/dart-web/test-project/web/favicon.ico deleted file mode 100644 index 7ba349b3e6..0000000000 Binary files a/definitions/dart-web/test-project/web/favicon.ico and /dev/null differ diff --git a/definitions/dart-web/test-project/web/index.html b/definitions/dart-web/test-project/web/index.html index c198dd483d..28f0493177 100644 --- a/definitions/dart-web/test-project/web/index.html +++ b/definitions/dart-web/test-project/web/index.html @@ -5,10 +5,8 @@ - - quickstart + Test Project - diff --git a/definitions/dart-web/test-project/web/main.dart b/definitions/dart-web/test-project/web/main.dart index dd24d31df6..cf898cc689 100644 --- a/definitions/dart-web/test-project/web/main.dart +++ b/definitions/dart-web/test-project/web/main.dart @@ -1,5 +1,5 @@ import 'dart:html'; void main() { - querySelector('#output').text = 'Your Dartww111 app is running.'; + querySelector('#output').text = 'Everything worked!!'; } diff --git a/definitions/dart-web/test-project/web/styles.css b/definitions/dart-web/test-project/web/styles.css deleted file mode 100644 index cc035c95c9..0000000000 --- a/definitions/dart-web/test-project/web/styles.css +++ /dev/null @@ -1,14 +0,0 @@ -@import url(https://fonts.googleapis.com/css?family=Roboto); - -html, body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - font-family: 'Roboto', sans-serif; -} - -#output { - padding: 20px; - text-align: center; -}