Skip to content
Open
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
15 changes: 9 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# tableauio/loader devcontainer
#
# Single-stage, multi-arch (amd64 + arm64) image bringing the full
# C++/Go/.NET toolchain plus protobuf at the exact versions CI uses.
# C++/Go/.NET/Node toolchain plus protobuf at the exact versions CI uses.
#
# All version pins are read from ./versions.env (the single source of
# truth shared with make.py and the CI workflows). To bump Go / buf /
# protobuf / .NET / vcpkg-baseline, edit that file — not this one.
# protobuf / .NET / Node / vcpkg-baseline, edit that file — not this one.
#
# Build context is .devcontainer/ (the directory containing this file),
# so `COPY versions.env ...` resolves directly.
Expand Down Expand Up @@ -209,8 +209,8 @@ ln -s /opt/vcpkg/active/tools/protobuf/protoc /usr/local/bin/protoc
EOF

# ---------------------------------------------------------------------------
# .NET SDK — apt-based install from the official Microsoft repository.
# Version is read from /opt/versions.env.
# .NET SDK + Node.js — apt-based installs from the official Microsoft and
# NodeSource repositories. Versions are read from /opt/versions.env.
# apt-get clean + rm /var/lib/apt/lists at the end keeps the layer small.
# ---------------------------------------------------------------------------
RUN <<EOF
Expand All @@ -220,9 +220,12 @@ curl -fsSL https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft
-o /tmp/ms.deb
dpkg -i /tmp/ms.deb
rm /tmp/ms.deb
apt-get update
# NodeSource repo for Node.js (its setup script also runs `apt-get update`,
# so the MS repo added above is picked up by the install below too).
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash -
apt-get install -y --no-install-recommends \
"dotnet-sdk-${DOTNET_VERSION}"
"dotnet-sdk-${DOTNET_VERSION}" \
nodejs
apt-get clean
rm -rf /var/lib/apt/lists/*
EOF
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/postcreate-banner.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/sh
# Post-create banner for the Linux devcontainer.
# Pure echo — no installs, no version-pinning at runtime, no surprises.
# Four-line summary that prints when the container becomes ready, so the
# Five-line summary that prints when the container becomes ready, so the
# developer can confirm at a glance which toolchain versions landed.
set -e
printf 'tableauio/loader devcontainer ready (linux).\n'
printf ' go: %s\n' "$(go version | cut -d' ' -f3)"
printf ' buf: %s\n' "$(buf --version 2>&1)"
printf ' protoc: %s\n' "$(protoc --version)"
printf ' dotnet: %s\n' "$(dotnet --version)"
printf ' node: %s\n' "$(node --version)"
3 changes: 3 additions & 0 deletions .devcontainer/versions.env
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ LEGACY_V3_VCPKG_BASELINE_COMMIT=6245ce44a03f04d19be125ab1bbab578d0933e85
# CI uses `${DOTNET_VERSION}.x` with actions/setup-dotnet.
DOTNET_VERSION=8.0

# Node.js LTS major. NodeSource apt repo is `setup_${NODE_VERSION}.x`.
NODE_VERSION=20

# CMake version installed by `make.py setup` on Windows (the devcontainer
# base image already ships a recent cmake; macOS/Linux use system cmake).
CMAKE_VERSION=3.31.8
64 changes: 64 additions & 0 deletions .github/workflows/release-ts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release TypeScript

on:
release:
types: [published]
workflow_dispatch:

jobs:
release:
name: Release cmd/protoc-gen-ts-tableau-loader
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name,
'cmd/protoc-gen-ts-tableau-loader/')
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
exclude:
- goos: linux
goarch: arm64
- goos: windows
goarch: arm64

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Download dependencies
run: |
cd cmd/protoc-gen-ts-tableau-loader
go mod download
- name: Prepare build directory
run: |
mkdir -p build/
cp README.md build/
cp LICENSE build/
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
cd cmd/protoc-gen-ts-tableau-loader
go build -trimpath -o $GITHUB_WORKSPACE/build
- name: Create package
id: package
run: |
PACKAGE_NAME=protoc-gen-ts-tableau-loader.${GITHUB_REF#refs/tags/cmd/protoc-gen-ts-tableau-loader/}.${{ matrix.goos }}.${{ matrix.goarch }}.tar.gz
tar -czvf $PACKAGE_NAME -C build .
echo ::set-output name=name::${PACKAGE_NAME}
- name: Upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.package.outputs.name }}
asset_name: ${{ steps.package.outputs.name }}
asset_content_type: application/gzip
58 changes: 58 additions & 0 deletions .github/workflows/testing-ts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Testing TypeScript

# Trigger on pushes, PRs (excluding documentation changes), and nightly.
on:
push:
branches: [master, main]
pull_request:
schedule:
- cron: 0 0 * * * # daily at 00:00
workflow_dispatch:

permissions:
contents: read

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 10

steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
submodules: recursive

- name: Read pinned versions
uses: ./.github/actions/load-versions

- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
cache: true

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: test/ts-tableau-loader/package-lock.json

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install Buf
run: python3 make.py setup --lang go

- name: Test
run: python3 make.py test --lang ts
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ cmd/protoc-gen-go-tableau-loader/protoc-gen-go-tableau-loader
cmd/protoc-gen-csharp-tableau-loader/protoc-gen-csharp-tableau-loader

test/go-tableau-loader/go-tableau-loader
_lab/ts/src/protoconf
coverage.txt
!test/testdata/bin/
test/csharp-tableau-loader/protoconf
test/ts-tableau-loader/protoconf

# C# Dev Kit language service cache (VS Code)
*.lscache
Expand Down
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ python3 make.py test --lang cpp --protobuf-version 3.21.12 # legacy v
# C#
python3 make.py test --lang csharp # full
python3 make.py test --lang csharp -k HubTest.Load # FullyQualifiedName~HubTest.Load

# TypeScript
python3 make.py test --lang ts # npm install + generate + test
```

GoogleTest is fetched via CMake `FetchContent` — no manual install.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,26 @@
<td>
<a href="https://github.com/tableauio/loader/releases?q=protoc-gen-csharp-tableau-loader"><img src="https://img.shields.io/github/v/release/tableauio/loader?filter=*protoc-gen-csharp-tableau-loader*&display_name=release&style=flat-square" alt="Release C# version"></a>
</td>
</tr><tr>
<td align="center"><b>TypeScript</b></td>
<td>
<a href="https://github.com/tableauio/loader/releases?q=protoc-gen-ts-tableau-loader"><img src="https://img.shields.io/github/v/release/tableauio/loader?filter=*protoc-gen-ts-tableau-loader*&display_name=release&style=flat-square" alt="Release TypeScript version"></a>
</td>
</tr><tr>
<td align="center"><b>Release</b></td>
<td>
<a href="https://github.com/tableauio/loader/actions/workflows/release-go.yml"><img src="https://github.com/tableauio/loader/actions/workflows/release-go.yml/badge.svg" alt="Release Go"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/release-cpp.yml"><img src="https://github.com/tableauio/loader/actions/workflows/release-cpp.yml/badge.svg" alt="Release C++"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/release-csharp.yml"><img src="https://github.com/tableauio/loader/actions/workflows/release-csharp.yml/badge.svg" alt="Release C#"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/release-ts.yml"><img src="https://github.com/tableauio/loader/actions/workflows/release-ts.yml/badge.svg" alt="Release TypeScript"></a>
</td>
</tr><tr>
<td align="center"><b>Testing</b></td>
<td>
<a href="https://github.com/tableauio/loader/actions/workflows/testing-go.yml"><img src="https://github.com/tableauio/loader/actions/workflows/testing-go.yml/badge.svg" alt="Testing Go"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/testing-cpp.yml"><img src="https://github.com/tableauio/loader/actions/workflows/testing-cpp.yml/badge.svg" alt="Testing C++"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/testing-csharp.yml"><img src="https://github.com/tableauio/loader/actions/workflows/testing-csharp.yml/badge.svg" alt="Testing C#"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/testing-ts.yml"><img src="https://github.com/tableauio/loader/actions/workflows/testing-ts.yml/badge.svg" alt="Testing TypeScript"></a>
<a href="https://github.com/tableauio/loader/actions/workflows/testing-make.yml"><img src="https://github.com/tableauio/loader/actions/workflows/testing-make.yml/badge.svg" alt="Testing make.py"></a>
</td>
</tr><tr>
Expand All @@ -54,6 +61,7 @@
| `protoc-gen-go-tableau-loader` | Go | `*.pc.go` |
| `protoc-gen-cpp-tableau-loader` | C++17 | `*.pc.h` / `*.pc.cc` |
| `protoc-gen-csharp-tableau-loader` | C# (Unity 2022.3 LTS / .NET 8) | `*.pc.cs` |
| `protoc-gen-ts-tableau-loader` | TypeScript (ESM, protobuf-es) | `*.pc.ts` |

## Quick start

Expand Down
25 changes: 0 additions & 25 deletions _lab/ts/buf.gen.yaml

This file was deleted.

121 changes: 0 additions & 121 deletions _lab/ts/src/poc.ts

This file was deleted.

Loading
Loading