-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove popover tooling and update CLI tutorial (#5271)
Continuing the goal of reducing site maintenance costs, removes the unmaintained popover support and updates the one remaining use to no longer be reliant on it. This will also slightly reduce site loading time with less JS and CSS downloaded on every page :) We can revisit popover support in code snippets in the future if desired. Browsers are currently implementing [standardized popovers](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) that are more accessible and easier to implement. They have shipped in WebKit and Chromium based browsers and are set to be enabled in Firefox soon. Closes #2316 Fixes #4987 Contributes to #5177 **Staged:** https://dart-dev--pr5271-feature-remove-popup-farcxcqp.web.app/tutorials/server/cmdline
- Loading branch information
Showing
19 changed files
with
288 additions
and
653 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
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 @@ | ||
include: ../analysis_options.yaml |
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,7 @@ | ||
import 'dart:io'; | ||
|
||
void main() { | ||
stdout.writeln('Type something'); | ||
final input = stdin.readLineSync(); | ||
stdout.writeln('You typed: $input'); | ||
} |
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 @@ | ||
include: ../dart_test_base.yaml |
File renamed without changes.
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,12 @@ | ||
name: cli_examples | ||
description: Examples for CLI tutorials on dart.dev | ||
|
||
environment: | ||
sdk: ^3.1.0 | ||
|
||
dependencies: | ||
args: ^2.4.2 | ||
|
||
dev_dependencies: | ||
lints: ^3.0.0 | ||
test: ^1.24.8 |
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,42 @@ | ||
import 'dart:convert'; | ||
import 'dart:io'; | ||
|
||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
const pathToQuotes = 'test_data/quote.txt'; | ||
|
||
test('dcat', () async { | ||
final procResult = await Process.run('dart', [ | ||
'run', | ||
'--enable-asserts', | ||
'bin/dcat.dart', | ||
'-n', | ||
pathToQuotes, | ||
]); | ||
expect( | ||
procResult.stdout, | ||
allOf( | ||
startsWith('1'), // Line number | ||
contains('Dr. Seuss'), | ||
endsWith('Nietzsche\n'), | ||
), | ||
); | ||
}); | ||
|
||
test('dcat1', () async { | ||
const greeting = '¡Hola Dash!'; | ||
final process = await Process.start('dart', [ | ||
'run', | ||
'--enable-asserts', | ||
'bin/dcat_stdin.dart', | ||
]); | ||
process.stdin.writeln(greeting); | ||
final output = await process.stdout.transform(const Utf8Decoder()).join(''); | ||
final errors = await process.stderr.transform(const Utf8Decoder()).join(''); | ||
|
||
expect(await process.exitCode, 0); | ||
expect(output, contains('You typed: $greeting')); | ||
expect(errors, isEmpty); | ||
}); | ||
} |
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,5 @@ | ||
Be yourself. Everyone else is taken. -Oscar Wilde | ||
Don't cry because it's over, smile because it happened. -Dr. Seuss | ||
You only live once, but if you do it right, once is enough. -Mae West | ||
# This is a comment line. | ||
That which does not kill us makes us stronger. -Nietzsche |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.