From ce64d94a0ac8b4ef11c5784f82f932511e4ec040 Mon Sep 17 00:00:00 2001 From: Stephanie Hays Date: Fri, 12 Apr 2024 07:45:06 -0500 Subject: [PATCH] (#983) Simplify local development of choco-theme The changes here and the upgrade of choco-theme are needed in order to utilize new commands that will help the development of choco-theme. More information on changes can be found at: https://github.com/chocolatey/choco-theme/releases/tag/0.7.0 --- build.cake | 3 ++- package.json | 2 +- preview.ps1 | 10 ++++++++-- preview.sh | 14 +++++++++++++- yarn.lock | 10 +++++----- 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/build.cake b/build.cake index d0b68d1bc4..8a6f8a2cb5 100644 --- a/build.cake +++ b/build.cake @@ -24,6 +24,7 @@ var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); +var port = Argument("port", 5080); /////////////////////////////////////////////////////////////////////////////// // Setup @@ -96,7 +97,7 @@ Task("Statiq-Preview") Configuration = configuration }; - DotNetCoreRun(projectPath, new ProcessArgumentBuilder().Append(string.Format("preview --output \"{0}\"", buildData.OutputDirectory)), settings); + DotNetCoreRun(projectPath, new ProcessArgumentBuilder().Append(string.Format("preview --port {0} --output \"{1}\"", port, buildData.OutputDirectory)), settings); }); Task("Statiq-Build") diff --git a/package.json b/package.json index fca4dfc6f0..6b8d704f3a 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,6 @@ "choco-theme": "yarn dlx --quiet ts-node --skipIgnore node_modules/choco-theme/build/choco-theme.ts --repository=docs" }, "devDependencies": { - "choco-theme": "0.6.0" + "choco-theme": "0.7.0" } } diff --git a/preview.ps1 b/preview.ps1 index 63a24ea8ad..94e574e435 100644 --- a/preview.ps1 +++ b/preview.ps1 @@ -1,7 +1,13 @@ +param( + [Parameter(Position = 0)] + [int] + $Port = 5080 +) + try { Push-Location $PSScriptRoot dotnet tool restore - dotnet cake + dotnet cake --port $Port } finally { Pop-Location -} \ No newline at end of file +} diff --git a/preview.sh b/preview.sh index 2fcf66147d..1cb3e24d41 100755 --- a/preview.sh +++ b/preview.sh @@ -1,2 +1,14 @@ +# Default port +DEFAULT_PORT=5080 + +# Check if the first argument is present +if [ $# -ge 1 ]; then + # Use the first argument as the port + PORT="$1" +else + # Use the default port if no argument is provided + PORT="$DEFAULT_PORT" +fi + dotnet tool restore -dotnet cake \ No newline at end of file +dotnet cake --port="$PORT" diff --git a/yarn.lock b/yarn.lock index 5eb4cbdb09..1e90cddc20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1552,9 +1552,9 @@ __metadata: languageName: node linkType: hard -"choco-theme@npm:0.6.0": - version: 0.6.0 - resolution: "choco-theme@npm:0.6.0" +"choco-theme@npm:0.7.0": + version: 0.7.0 + resolution: "choco-theme@npm:0.7.0" dependencies: "@fortawesome/fontawesome-free": "npm:^6.1.2" "@playwright/test": "npm:1.35.1" @@ -1593,7 +1593,7 @@ __metadata: stylelint-config-twbs-bootstrap: "npm:^14.0.0" ts-node: "npm:^10.9.2" typescript: "npm:^5.4.2" - checksum: 10c0/c445671fe4cf0aeaa0211b1fcf538941e30cae6bcc6848600b361404a2af9cc41b6442e62cd401628d525b121f01dc9e62d85e0deb2c7b4e325a48b40a102af8 + checksum: 10c0/3e3e344860c6c3d55477525f63703826affb22359af4866deaf7292578d8c4ad398233031c63bb126094425e0d90e5481f58d78cb6abf3a5f0ce3923b924090c languageName: node linkType: hard @@ -2048,7 +2048,7 @@ __metadata: version: 0.0.0-use.local resolution: "docs@workspace:." dependencies: - choco-theme: "npm:0.6.0" + choco-theme: "npm:0.7.0" languageName: unknown linkType: soft