Commit Graph
43 Commits
Author SHA1 Message Date
Phil ScottandPatrik Svensson 170901f584 Adds additional check that analyzer is within a method
Resolve #487
2021-07-19 22:31:25 +02:00
Phil ScottandPatrik Svensson c2b25eea8a Using browser context for social cards
Scott Hanselman recommended using the context instead of the browser object. Browser object creates a new context on each call which is a new process. Obviously we don't want that. 

Also added an extra check for a load based on network idle. This will not only ensure things are loaded, but there is a built in 500ms timeout looking for inactivity which will let the font rendering process do it's thing which seems to lag a tad with Chromium.

And while we are at it, preloading the font can't hurt.
2021-07-18 11:23:23 +02:00
Phil ScottandGitHub 223642b797 Add blog to docs (#484)
* Adding social card infrastructure
* Upgrades doc project to .NET 6
* Adds Playwright
* Changes the console to a web project for Playwright
* Adds social card template
* Added blog content
* Parallelized social image processing
* Updating CI to use .NET 6 for docs build
2021-07-15 19:53:01 +02:00
Phil ScottandPatrik Svensson fa553fd72e Adds documentation for analyzers 2021-06-25 09:56:20 +02:00
Phil ScottandPatrik Svensson 721d73e9eb Renames BaseAnalyzer to SpectreAnalyzer 2021-06-23 16:36:48 +02:00
Phil ScottandPatrik Svensson 8b058d6342 Renaming analyzer test project to sandbox 2021-06-23 16:36:48 +02:00
Phil ScottandPatrik Svensson d1048260cc Making the project ready for deployment
Analyzer package needs all the dependencies to be private assets, and it's output pushed to teh analyzers/dotnet/cs folder. 

We don't want anything in the lib folder, so it also disables the auto build output and warnings that there are no files for the target framework in the lib folder
2021-06-23 16:36:48 +02:00
Phil ScottandPatrik Svensson bdcc01ea68 Adding analyzers for common mistakes with live renderables 2021-06-23 16:36:48 +02:00
Phil ScottandPatrik Svensson 4f293d887d Adding analyzer project
Contains two analyzers with fixes

* Use AnsiConsole over System.Console
* Favor local instance over static implementation
2021-06-23 16:36:48 +02:00
Phil ScottandPatrik Svensson 0bf97cb666 Adding additional tests for property binding with value types 2021-06-08 21:21:35 +02:00
Phil ScottandPatrik Svensson ebb1076dd0 Check for default value before writing property values
Previous version was overwriting values that might have been set via a property initializer.

Closes #422
2021-06-08 21:21:35 +02:00
Phil ScottandPatrik Svensson 21f731ebd5 Using Statiq processes for tailwind commands
Tweaks tailwind to use jit mode and misc content tweaks


Changes point in which tailwind is built
2021-05-28 14:31:57 +02:00
Phil ScottandPatrik Svensson adb600c430 Tweaks tailwind to use jit mode and misc content tweaks 2021-05-26 10:31:15 +02:00
Phil ScottandPatrik Svensson 0d2a75aeee Add Cascadia Code as a webfont for fallback
This is only for Android (hopefully) which has a system font that doesn't have standard width box drawing characters. 

Other systems should still use their defaults.
2021-05-24 15:42:12 +02:00
Phil ScottandPatrik Svensson cb8dc97847 Removes inline-block from console output in docs
This was causing the output to wrap in chrome on ipad and only the ipad. Not quite sure why it was needed in the first place so it's gone.
2021-05-24 09:44:27 +02:00
Phil ScottandPatrik Svensson 46abadaccb Add AsciiCast demos for docs 2021-05-23 23:30:14 +02:00
Phil ScottandPatrik Svensson 69fdae70c0 Fixes non-interactive progress bars from rendering little info
If any task was not-started or finishes then everything stops rendering. I suspect this worked ok but wasn't noticed until we introduced the indeterminate progress task that starts off not-started which caused everything to bail early in the demos.
2021-05-22 09:17:34 +02:00
Phil ScottandPatrik Svensson 9a68b27b31 Shrinks PNGs and converts large gif to webm
PNGs were ran through TinyPng. Table.gif was weighing in at over 1.7mb
on my machine. Converted to webm and it's down to 80kb which is pretty
nice for something on the home page. Other gifs didn't have that much of
an improvement so I just left them as GIFs.
2021-04-25 02:52:36 +02:00
Phil ScottandGitHub 2a9fbb1ee9 New doc theme (#387) 2021-04-24 22:20:59 +02:00
Phil ScottandPatrik Svensson 01f707c78d Exposes Pretty property of CommandAppException
If a user is propagating the exceptions we aren't going to automatically display them. They might still want to get this exception message and use it, so we'll make it publicly available.
2021-04-23 16:44:41 +02:00
Phil ScottandPatrik Svensson 8d67c0a6b4 Removes printing of error messages when propagating 2021-04-23 16:44:41 +02:00
Phil ScottandPatrik Svensson 79af013bf2 Expanding CLI docs
Adding new pages for commandApp, commands and settings.
2021-04-21 17:51:59 +02:00
Phil ScottandPatrik Svensson f5a9c0ca26 Removes automatic registration of settings
Original intention was to register Settings automatically for DI. This ran into problem when the container verifies the configuration is valid for a settings using the constructor for initialization. It tries to resolve the parameters and fails.

This removes the automatic registration and falls back ActivatorCreateInstance when no Setting is registered.
2021-04-18 22:41:05 +02:00
Phil ScottandPatrik Svensson f2b8afffb3 Marks Spectre.Console.Testing as not a test project
Probably something that only bothers me, but I'm in a habit of running dotnet test at the solution level. It was discovering this project as a test project even though it isn't. This produces an error complaining about not having a testhost.dll. I'm pretty sure this comes in via a props when xunit is referenced. 

This attribute in the csproj marks the project explicitly as not a test project
2021-04-17 09:30:33 +02:00
Phil ScottandPatrik Svensson bc9f610258 Added "--hidden" param to explain feature
Probably shouldn't include the hidden commands by default. This lets the user show them if needed.
2021-04-13 17:40:55 +02:00
Phil ScottandPatrik Svensson ae96606ab7 Adds default command to explain feature 2021-04-13 17:40:55 +02:00
Phil ScottandPatrik Svensson 41ccc0b464 Adds CLI explain command
Wanted a command to break down how Spectre views the command model. This outputs all the relevant settings in a tree. You can get a short explanation for all the commands, or a detailed explanation for all commands (there is a flag to go vice versa on the detailed view if you want)

app cli explain
app cli explain myappcommand
app cli explain -d
2021-04-12 17:40:31 +02:00
Phil ScottandPatrik Svensson 36ec3d1fd3 Adds rune width caching for cell length calculations 2021-04-07 23:59:23 +02:00
Phil ScottandPatrik Svensson 8cf7794852 Adding unit tests for settings constructor 2021-04-06 22:48:51 +02:00
Phil ScottandPatrik Svensson 4edc647fdd Falls back to null for settings constructor 2021-04-06 22:48:51 +02:00
Phil ScottandPatrik Svensson a690ce4955 Marks nullable bools as flags too 2021-04-05 16:14:13 +02:00
Phil ScottandPatrik Svensson 254880e93a Replaces emoji regex with ReadOnlySpan implementation
The RegEx runtime perf was never anything noticeable - it was the startup time that was eating over a third of time during initialization.

This shaves 200ms off the startup time.
2021-04-04 04:10:25 +02:00
Phil ScottandPatrik Svensson 9204671b27 Uses Environment.TickCount for seed instead of DateTime.Now 2021-04-02 18:52:18 +02:00
Phil ScottandPatrik Svensson c765bbd0dd Uses OSVersion instead of RegEx to detect Windows Build info
Perf improvement.
2021-04-02 18:51:30 +02:00
Phil ScottandPatrik Svensson b17eabaa1f Adds helper overloads for Markup calls without args
Without specific overloads without the args string.format will get called even if it's not needed. 

This closes #309
2021-03-22 19:14:59 +01:00
Phil ScottandPatrik Svensson e4dda283bb Adds overloads for MarkUp methods without args
These methods don't require a string.format call so we'll directly call the Render method without a call to string.format.

Added bonus of a a couple fewer allocations too.
2021-03-08 15:04:55 +01:00
Phil ScottandPatrik Svensson da9c6ee4c2 Add IProgress<double> to ProgressTask.cs
Makes the Report method an explicit implementation to allow for better interoperability with standard .NET progress functionality while keeping backwards compatibility with existing ProgressTask functionality.

Closes #285
2021-03-07 09:24:44 +01:00
Phil ScottandPatrik Svensson 855127f32a Changes progress task IsFinished to account for stopped tasks
Previous behavior was that the only way to get a task to a finished state was to artificially set the Value to MaxValue.

With this change StopTask() will also complete the task with the change that a task cannot be restarted.
2021-03-07 09:24:21 +01:00
Phil ScottandGitHub 1cd335e785 Serilog example for logging 2021-03-04 08:39:53 +01:00
Phil ScottandPatrik Svensson bff3438a5a using loop instead of linq
In both of these loops context is captured preventing caching of the lambda. this results in a pretty significant amount of allocations especially with progress bars that constantly are remeasuring
2021-03-01 08:22:45 +01:00
Phil ScottandPatrik Svensson 3a42c0a119 Adds DotSettings and tweaks editoconfigs for tests
R# and Rider have quite a bit of noise related to documentation in the testing projects so this disables those warnings.

In the main projects, R# and Rider complain loudly about the namespaces not matching the file structure. The DotSettings file disables that warning.

Once you get rid of that noise there are quite a few opportunities for trimming out redundant code that R# points out especially with the nullable support enabled, plus there are some bugs related to multiple enumerations worth looking into I think.
2021-02-23 22:34:33 +01:00
Phil ScottandPatrik Svensson 04d0e663d5 Extends maximum size of remaining and elapsed time displayed, plus a failsafe
Elapsed and remaining now support > 9 hours, and if a timespan can't be rendered in that size **:**:** will be displayed
2021-02-16 23:31:55 +01:00
Phil ScottandGitHub 9312663bde Adds text and Progress bar spinner column for tasks yet to be started 2021-02-14 18:03:57 +01:00