Skip to content

Commit

Permalink
fixed Restructure folders #287
Browse files Browse the repository at this point in the history
  • Loading branch information
delaneyj committed Dec 5, 2024
1 parent 65ba3ca commit 5d6e933
Show file tree
Hide file tree
Showing 395 changed files with 136 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/code/go/cmd/tsbuild/main.go",
"program": "${workspaceFolder}/code/go/cmd/build/main.go",
"cwd": "${workspaceFolder}"
}
]
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Anything outside of this scope may not be accepted. If you have a need for a fea

Before submitting bug reports and feature requests, please search the [open issues](https://github.com/starfederation/datastar/issues) and the _#help_ channel in the [Discord server](https://discord.gg/bnRNgZjgPh) to see if it has already been addressed. When submitting a [new issue](https://github.com/starfederation/datastar/issues/new), please use a descriptive title and include a clear description and as much relevant information as possible.

## Documentation
## Documentation

Datastar’s documentation is under active development. All the markdown files live in [this folder](https://github.com/starfederation/datastar/tree/develop/code/go/site/static/md). Improvements to them can be submitted via pull requests.
Datastar’s documentation is under active development. All the markdown files live in [this folder](https://github.com/starfederation/datastar/tree/develop/site/static/md). Improvements to them can be submitted via pull requests.

## Pull Requests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Discord](https://img.shields.io/discord/1296224603642925098)
![GitHub Repo stars](https://img.shields.io/github/stars/starfederation/datastar?style=flat)

<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/code/go/site/static/images/rocket.gif"></p>
<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/site/static/images/rocket.gif"></p>

# Datastar

Expand Down
42 changes: 21 additions & 21 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ tasks:
cmds:
- go install github.com/go-task/task/v3/cmd/task@latest
- go install github.com/a-h/templ/cmd/templ@latest
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-x64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-x64
platforms: [linux/amd64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-linux-arm64
platforms: [linux/arm64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-arm64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-arm64
platforms: [darwin/arm64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-x64
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-macos-x64
platforms: [darwin/amd64]
- cmd: test -f code/go/site/tailwindcli || wget -O code/go/site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-windows-x64.exe
- cmd: test -f site/tailwindcli || wget -O site/tailwindcli https://github.com/dobicinaitis/tailwind-cli-extra/releases/download/v1.7.21/tailwindcss-extra-windows-x64.exe
platforms: [windows]
- chmod +x code/go/site/tailwindcli
- chmod +x site/tailwindcli
- go install github.com/valyala/quicktemplate/qtc@latest

version:
Expand All @@ -39,7 +39,7 @@ tasks:
cmds:
- qtc

tsbuild:
build:
deps:
- qtc
sources:
Expand All @@ -50,20 +50,20 @@ tasks:
generates:
- "bundles/**/*"
cmds:
- go run code/go/cmd/tsbuild/main.go
- cp -r bundles/* code/go/site/static/js/
- go run build/cmd/build/main.go
- cp -r bundles/* site/static/js/
- mkdir -p library/dist/
- cp -r bundles/* library/dist/
- mkdir -p code/go/site/static/librarySource
- rm -rf code/go/site/static/librarySource/*
- cp -r library/src/* code/go/site/static/librarySource/
- mkdir -p site/static/librarySource
- rm -rf site/static/librarySource/*
- cp -r library/src/* site/static/librarySource/

libpub:
dir: code/ts/library
requires:
vars: [VERSION]
deps:
- tsbuild
- build
cmds:
- git push origin
- git tag v{{.VERSION}}
Expand All @@ -77,7 +77,7 @@ tasks:
- task: deploy

css:
dir: code/go/site
dir: site
sources:
- "**/*.templ"
- "**/*.md"
Expand Down Expand Up @@ -105,15 +105,15 @@ tasks:

support:
sources:
- code/go/**/*.templ
- code/go/**/*.go
- code/go/**/*.md
- code/go/site/static/**/*
- "**/*.templ"
- "**/*.go"
- "**/*.md"
- site/static/**/*
generates:
- ./datastar-website
deps:
- kill
- tsbuild
- build
- templ
- css

Expand All @@ -124,7 +124,7 @@ tasks:
- support
cmds:
- go mod tidy
- go build -o ./datastar-website code/go/cmd/site/main.go
- go build -o ./datastar-website "site/cmd/site/main.go"

deploy:
method: none
Expand All @@ -134,7 +134,7 @@ tasks:
- fly deploy --local-only

test:
dir: code/go/site/smoketests
dir: site/smoketests
deps:
- support
cmds:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions code/go/cmd/tsbuild/main.go → build/cmd/build/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"
"time"

"github.com/starfederation/datastar/code/go/tsbuild"
build "github.com/starfederation/datastar/build"
)

func main() {
Expand All @@ -14,7 +14,7 @@ func main() {
log.Printf("Datastar built in %s", time.Since(start))
}()

if err := tsbuild.Build(); err != nil {
if err := build.Build(); err != nil {
log.Fatal(err)
}

Expand Down
2 changes: 1 addition & 1 deletion code/go/tsbuild/consts.go → build/consts.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tsbuild
package build

import (
"time"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
![Discord](https://img.shields.io/discord/1296224603642925098)
![GitHub Repo stars](https://img.shields.io/github/stars/starfederation/datastar?style=flat)

<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/code/go/site/static/images/rocket.gif"></p>
<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/site/static/images/rocket.gif"></p>

# Datastar

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions code/go/tsbuild/run.go → build/run.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tsbuild
package build

import (
"compress/gzip"
Expand Down Expand Up @@ -127,15 +127,15 @@ func writeOutConsts(version string) error {
})

templates := map[string]func(data *ConstTemplateData) string{
"README.md": datastarREADME,
"library/README.md": datastarREADME,
"library/src/engine/consts.ts": datastarClientConsts,
"library/package.json": datastarClientPackageJSON,
"sdk/go/consts.go": goConsts,
"code/dotnet/sdk/src/Consts.fs": dotnetConsts,
"code/php/sdk/src/Consts.php": phpConsts,
"code/php/sdk/src/enums/EventType.php": phpEventType,
"code/php/sdk/src/enums/FragmentMergeMode.php": phpFragmentMergeMode,
"README.md": datastarREADME,
"library/README.md": datastarREADME,
"library/src/engine/consts.ts": datastarClientConsts,
"library/package.json": datastarClientPackageJSON,
"sdk/go/consts.go": goConsts,
"sdk/dotnet/src/Consts.fs": dotnetConsts,
"sdk/php/src/Consts.php": phpConsts,
"sdk/php/src/enums/EventType.php": phpEventType,
"sdk/php/src/enums/FragmentMergeMode.php": phpFragmentMergeMode,
}

for path, tmplFn := range templates {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CsharpAspServer", "CsharpAs
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildFiles", "BuildFiles", "{01B23A4D-E3AD-4C90-A321-F8FE8D60F1BE}"
ProjectSection(SolutionItems) = preProject
..\..\go\tsbuild\consts_dotnet.qtpl = ..\..\go\tsbuild\consts_dotnet.qtpl
..\..\go\build\consts_dotnet.qtpl = ..\..\go\build\consts_dotnet.qtpl
..\Build.ps1 = ..\Build.ps1
EndProjectSection
EndProject
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![Discord](https://img.shields.io/discord/1296224603642925098)
![GitHub Repo stars](https://img.shields.io/github/stars/starfederation/datastar?style=flat)

<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/code/go/site/static/images/rocket.gif"></p>
<p align="center"><img width="200" src="https://media.githubusercontent.com/media/starfederation/datastar/refs/heads/main/site/static/images/rocket.gif"></p>

# Datastar

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"

"github.com/klauspost/compress/zstd"
"github.com/starfederation/datastar/code/go/site"
"github.com/starfederation/datastar/site"
"github.com/valyala/bytebufferpool"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion code/go/cmd/site/main.go → site/cmd/site/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/delaneyj/toolbelt"
"github.com/joho/godotenv"
"github.com/starfederation/datastar/code/go/site"
"github.com/starfederation/datastar/site"
)

const port = 8080
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
87 changes: 87 additions & 0 deletions site/routes_bundler.qtpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/go/site/routes_home.templ → site/routes_home.templ
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package site
import (
"fmt"
"github.com/dustin/go-humanize"
"github.com/starfederation/datastar/code/go/tsbuild"
build "github.com/starfederation/datastar/build"
datastar "github.com/starfederation/datastar/sdk/go"
)

Expand Down Expand Up @@ -55,7 +55,7 @@ templ Home() {
</span>
file and start adding reactivity to your frontend immediately. Write your backend in the language of your choice! Official SDKs are currently available to help you get up and running even faster. More languages are on the way now that we have a stable API!
<div class="flex justify-center gap-2">
for _, lang := range tsbuild.Consts.SDKLanguages {
for _, lang := range build.Consts.SDKLanguages {
<a href={ templ.SafeURL(lang.SdkUrl) } class="flex flex-col justify-center items-center">
@icon(lang.Icon, "class", "text-9xl")
<div class="uppercase text-sm font-bold">{ lang.Name }</div>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/go/site/shared_partials.go → site/shared_partials.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/gomarkdown/markdown/ast"
mdhtml "github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
"github.com/starfederation/datastar/code/go/tsbuild"
build "github.com/starfederation/datastar/build"
datastar "github.com/starfederation/datastar/sdk/go"
"github.com/valyala/bytebufferpool"
)
Expand Down Expand Up @@ -198,7 +198,7 @@ func markdownRenders(ctx context.Context, staticMdPath string) (MarkdownDataset,
}

icon := ""
for _, lang := range tsbuild.Consts.SDKLanguages {
for _, lang := range build.Consts.SDKLanguages {
if lang.FileExtension == ext {
icon = lang.Icon
break
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestExampleFileUpload(t *testing.T) {
t.Run("upload a file", func(t *testing.T) {
el := page.MustElement(`[type=file]`)
el.MustSetFiles(
filepath.FromSlash("code/go/site/smoketests/file_upload_test.go"),
filepath.FromSlash("site/smoketests/file_upload_test.go"),
)

list := el.MustEval("() => Array.from(this.files).map(f => f.name)").Arr()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/delaneyj/toolbelt"
"github.com/go-rod/rod"
"github.com/starfederation/datastar/code/go/site"
"github.com/starfederation/datastar/site"
"github.com/ysmood/got"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 5d6e933

Please sign in to comment.