Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docusaurus v3 #1432

Merged
merged 6 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Added
[Any Variables experiment](https://taskfile.dev/experiments/any_variables)
(#1415, #1421 by @pd93).
- Updated Docusaurus to v3 (#1432 by @pd93).
- Added `aliases` to `--json` flag output (#1430, #1431 by @pd93)

## v3.32.0 - 2023-11-29
Expand Down Expand Up @@ -529,8 +530,8 @@ it a go and let us know what you think via a

- On `v3`, all CLI variables will be considered global variables (#336, #341)
- Add support to `.env` like files (#324, #356).
- Add `label:` to task so you can override the task name in the logs
([#321](https://github.com/go-task/task/issues/321]), #337).
- Add `label:` to task so you can override the task name in the logs (#321,
#337).
- Refactor how variables work on version 3 (#311).
- Disallow `expansions` on v3 since it has no effect.
- `Taskvars.yml` is not automatically included anymore.
Expand Down
31 changes: 17 additions & 14 deletions cmd/release/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@ import (

const (
changelogSource = "CHANGELOG.md"
changelogTarget = "docs/docs/changelog.md"
changelogTarget = "docs/docs/changelog.mdx"
)

const changelogTemplate = `---
slug: /changelog/
sidebar_position: 14
---`

var (
changelogReleaseRegex = regexp.MustCompile(`## Unreleased`)
changelogUserRegex = regexp.MustCompile(`@(\w+)`)
changelogIssueRegex = regexp.MustCompile(`#(\d+)`)
versionRegex = regexp.MustCompile(`(?m)^ "version": "\d+\.\d+\.\d+",$`)
)

Expand Down Expand Up @@ -92,8 +85,22 @@ func bumpVersion(version *semver.Version, verb string) error {
}

func changelog(version *semver.Version) error {
// Open changelog target file
b, err := os.ReadFile(changelogTarget)
if err != nil {
return err
}

// Get the current frontmatter
currentChangelog := string(b)
sections := strings.SplitN(currentChangelog, "---", 3)
if len(sections) != 3 {
return errors.New("error: invalid frontmatter")
}
frontmatter := strings.TrimSpace(sections[1])

// Open changelog source file
b, err := os.ReadFile(changelogSource)
b, err = os.ReadFile(changelogSource)
if err != nil {
return err
}
Expand All @@ -109,11 +116,7 @@ func changelog(version *semver.Version) error {
}

// Add the frontmatter to the changelog
changelog = fmt.Sprintf("%s\n\n%s", changelogTemplate, changelog)

// Replace @user and #issue with full links
changelog = changelogUserRegex.ReplaceAllString(changelog, "[@$1](https://github.com/$1)")
changelog = changelogIssueRegex.ReplaceAllString(changelog, "[#$1](https://github.com/go-task/task/issues/$1)")
changelog = fmt.Sprintf("---\n%s\n---\n\n%s", frontmatter, changelog)

// Write the changelog to the target file
return os.WriteFile(changelogTarget, []byte(changelog), 0o644)
Expand Down
1 change: 0 additions & 1 deletion docs/.prettierignore

This file was deleted.

3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

3 changes: 3 additions & 0 deletions docs/babel.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
presets: ['@docusaurus/core/lib/babel/preset'],
};
6 changes: 3 additions & 3 deletions docs/blog/2023-09-02-introducing-experiments.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ accelerate. We can't thank you all enough for your help and support! :rocket:

[![Star History Chart](https://api.star-history.com/svg?repos=go-task/task&type=Date)](https://star-history.com/#go-task/task&Date)

## What's next? :thinking_face:
## What's next? :thinking:

It's extremely motivating to see so many people using and loving Task. However,
in this time we've also seen an increase in the number of issues and feature
Expand All @@ -71,7 +71,7 @@ commitment to make. Smaller, more frequent major releases are also a significant
inconvenience for users as they have to constantly keep up-to-date with our
breaking changes. Fortunately, there is a better way.

## What's going to change? :face_with_monocle:
## What's going to change? :monocle:

Going forwards, breaking changes will be allowed into _minor_ versions of Task
as "experimental features". To access these features users will need opt-in by
Expand Down Expand Up @@ -102,7 +102,7 @@ with v3**.

## v4 When? :eyes:

:shrug: When it's ready.
:man_shrugging: When it's ready.

In all seriousness, we don't have a timeline for this yet. We'll be working on
the most serious deficiencies of the v3 API first and regularly evaluating the
Expand Down
11 changes: 0 additions & 11 deletions docs/constants.js

This file was deleted.

4 changes: 4 additions & 0 deletions docs/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const GITHUB_URL = 'https://github.com/go-task/task';
export const TWITTER_URL = 'https://twitter.com/taskfiledev';
export const MASTODON_URL = 'https://fosstodon.org/@task';
export const DISCORD_URL = 'https://discord.gg/6TY36E39UK';
File renamed without changes.
Loading