Skip to content

chore: rename pglt in packages/ #241

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

Merged
merged 3 commits into from
Mar 18, 2025
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
8 changes: 4 additions & 4 deletions .github/workflows/publish.reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Generate Packages
id: generate-packages
run: node packages/@pglt/pglt/scripts/generate-packages.mjs
run: node packages/@postgrestools/postgrestools/scripts/generate-packages.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ inputs.release-tag }}
Expand All @@ -46,12 +46,12 @@ jobs:

- name: Print package.json
run: |
cat packages/@pglt/pglt/package.json
cat packages/@postgrestools/postgrestools/package.json

- name: Publish npm packages as nightly
if: inputs.is-prerelease == 'true'
run: |
for package in packages/@pglt/*; do
for package in packages/@postgrestools/*; do
npm publish "$package" --tag nightly --access public --provenance
done
env:
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Publish npm packages as latest
if: inputs.is-prerelease != 'true'
run: |
for package in packages/@pglt/*; do
for package in packages/@postgrestools/*; do
npm publish "$package" --tag latest --access public --provenance
done
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ jobs:
- name: Install toolchain
uses: moonrepo/setup-rust@v1
- name: Build main binary
run: cargo build -p pglt_cli --release
run: cargo build -p pgt_cli --release
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install JS dependencies
run: bun install
- name: Build TypeScript code
working-directory: packages/@pglt/backend-jsonrpc
working-directory: packages/@postgrestools/backend-jsonrpc
run: bun run build
- name: Run JS tests
working-directory: packages/@pglt/backend-jsonrpc
working-directory: packages/@postgrestools/backend-jsonrpc
run: bun run test

codegen:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,28 @@ jobs:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres

- name: 🛠️ Run Build
run: cargo build -p pglt_cli --release --target ${{ matrix.config.target }}
run: cargo build -p pgt_cli --release --target ${{ matrix.config.target }}

# windows is a special snowflake too, it saves binaries as .exe
- name: 👦 Name the Binary
if: matrix.config.os == 'windows-latest'
run: |
mkdir dist
cp target/${{ matrix.config.target }}/release/pglt.exe ./dist/pglt_${{ matrix.config.target }}
cp target/${{ matrix.config.target }}/release/postgrestools.exe ./dist/postgrestools_${{ matrix.config.target }}
- name: 👦 Name the Binary
if: matrix.config.os != 'windows-latest'
run: |
mkdir dist
cp target/${{ matrix.config.target }}/release/pglt ./dist/pglt_${{ matrix.config.target }}
cp target/${{ matrix.config.target }}/release/postgrestools ./dist/postgrestools_${{ matrix.config.target }}

# It is not possible to return the artifacts from the matrix jobs individually: Matrix outputs overwrite each other.
# A common workaround is to upload and download the resulting artifacts.
- name: 👆 Upload Artifacts
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: pglt_${{ matrix.config.target }}
path: ./dist/pglt_*
name: postgrestools_${{ matrix.config.target }}
path: ./dist/postgrestools_*
# The default compression level is 6; this took the binary down from 350 to 330MB.
# It is recommended to use a lower level for binaries, since the compressed result is not much smaller,
# and the higher levels of compression take much longer.
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
id: download
with:
merge-multiple: true
pattern: pglt_*
pattern: postgrestools_*

- name: 📂 Create Release
uses: softprops/action-gh-release@v2
Expand All @@ -125,7 +125,7 @@ jobs:
body: ${{ steps.create_changelog.outputs.content }}
tag_name: ${{ steps.create_changelog.outputs.version }}
files: |
pglt_*
postgrestools_*
docs/schemas/latest/schema.json
fail_on_unmatched_files: true
draft: true
Expand Down
74 changes: 37 additions & 37 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ unicode-width = "0.1.12"
pglt_analyse = { path = "./crates/pglt_analyse", version = "0.0.0" }
pglt_analyser = { path = "./crates/pglt_analyser", version = "0.0.0" }
pglt_base_db = { path = "./crates/pglt_base_db", version = "0.0.0" }
pglt_cli = { path = "./crates/pglt_cli", version = "0.0.0" }
pglt_commands = { path = "./crates/pglt_commands", version = "0.0.0" }
pglt_completions = { path = "./crates/pglt_completions", version = "0.0.0" }
pglt_configuration = { path = "./crates/pglt_configuration", version = "0.0.0" }
Expand All @@ -81,6 +80,7 @@ pglt_treesitter_queries = { path = "./crates/pglt_treesitter_queries", versi
pglt_type_resolver = { path = "./crates/pglt_type_resolver", version = "0.0.0" }
pglt_typecheck = { path = "./crates/pglt_typecheck", version = "0.0.0" }
pglt_workspace = { path = "./crates/pglt_workspace", version = "0.0.0" }
pgt_cli = { path = "./crates/pgt_cli", version = "0.0.0" }

pglt_test_macros = { path = "./crates/pglt_test_macros" }
pglt_test_utils = { path = "./crates/pglt_test_utils" }
Expand Down
40 changes: 19 additions & 21 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,29 @@
"typescript": "^5",
},
},
"packages/@pglt/backend-jsonrpc": {
"name": "@pglt/backend-jsonrpc",
"packages/@postgrestools/backend-jsonrpc": {
"name": "@postgrestools/backend-jsonrpc",
"optionalDependencies": {
"@pglt/cli-darwin-arm64": "<placeholder>",
"@pglt/cli-darwin-x64": "<placeholder>",
"@pglt/cli-linux-arm64": "<placeholder>",
"@pglt/cli-linux-arm64-musl": "<placeholder>",
"@pglt/cli-linux-x64": "<placeholder>",
"@pglt/cli-linux-x64-musl": "<placeholder>",
"@pglt/cli-win32-arm64": "<placeholder>",
"@pglt/cli-win32-x64": "<placeholder>",
"@postgrestools/cli-darwin-arm64": "<placeholder>",
"@postgrestools/cli-darwin-x64": "<placeholder>",
"@postgrestools/cli-linux-arm64": "<placeholder>",
"@postgrestools/cli-linux-x64": "<placeholder>",
"@postgrestools/cli-win32-arm64": "<placeholder>",
"@postgrestools/cli-win32-x64": "<placeholder>",
},
},
"packages/@pglt/pglt": {
"name": "pglt",
"packages/@postgrestools/postgrestools": {
"name": "postgrestools",
"bin": {
"pglt": "bin/pglt",
"postgrestools": "bin/postgrestools",
},
"optionalDependencies": {
"pglt-aarch64-apple-darwin": "<placeholder>",
"pglt-aarch64-linux-gnu": "<placeholder>",
"pglt-aarch64-windows-msvc": "<placeholder>",
"pglt-x86_64-apple-darwin": "<placeholder>",
"pglt-x86_64-linux-gnu": "<placeholder>",
"pglt-x86_64-windows-msvc": "<placeholder>",
"postgrestools-aarch64-apple-darwin": "<placeholder>",
"postgrestools-aarch64-linux-gnu": "<placeholder>",
"postgrestools-aarch64-windows-msvc": "<placeholder>",
"postgrestools-x86_64-apple-darwin": "<placeholder>",
"postgrestools-x86_64-linux-gnu": "<placeholder>",
"postgrestools-x86_64-windows-msvc": "<placeholder>",
},
},
},
Expand All @@ -58,7 +56,7 @@

"@biomejs/cli-win32-x64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA=="],

"@pglt/backend-jsonrpc": ["@pglt/backend-jsonrpc@workspace:packages/@pglt/backend-jsonrpc"],
"@postgrestools/backend-jsonrpc": ["@postgrestools/backend-jsonrpc@workspace:packages/@postgrestools/backend-jsonrpc"],

"@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.2.5" } }, "sha512-w2OZTzrZTVtbnJew1pdFmgV99H0/L+Pvw+z1P67HaR18MHOzYnTYOi6qzErhK8HyT+DB782ADVPPE92Xu2/Opg=="],

Expand All @@ -68,7 +66,7 @@

"bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-3oO6LVGGRRKI4kHINx5PIdIgnLRb7l/SprhzqXapmoYkFl5m4j6EvALvbDVuuBFaamB46Ap6HCUxIXNLCGy+tg=="],

"pglt": ["pglt@workspace:packages/@pglt/pglt"],
"postgrestools": ["postgrestools@workspace:packages/@postgrestools/postgrestools"],

"typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],

Expand Down
4 changes: 2 additions & 2 deletions crates/pglt_cli/Cargo.toml → crates/pgt_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
name = "pglt_cli"
name = "pgt_cli"
repository.workspace = true
version = "0.0.0"

Expand Down Expand Up @@ -56,5 +56,5 @@ tikv-jemallocator = "0.6.0"
doctest = false

[[bin]]
name = "pglt"
name = "postgrestools"
path = "src/main.rs"
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub enum PgltCommand {
///
/// The file doesn't need to exist on disk, what matters is the extension of the file. Based on the extension, we know how to check the code.
///
/// Example: `echo 'let a;' | pglt_cli check --stdin-file-path=test.sql`
/// Example: `echo 'let a;' | pgt_cli check --stdin-file-path=test.sql`
#[bpaf(long("stdin-file-path"), argument("PATH"), hide_usage)]
stdin_file_path: Option<String>,

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions crates/pglt_cli/src/main.rs → crates/pgt_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! This is the main binary

use pglt_cli::{
CliDiagnostic, CliSession, PgltCommand, open_transport, pglt_command, setup_panic_handler,
to_color_mode,
};
use pglt_console::{ConsoleExt, EnvConsole, markup};
use pglt_diagnostics::{Diagnostic, PrintDiagnostic, set_bottom_frame};
use pglt_workspace::workspace;
use pgt_cli::{
CliDiagnostic, CliSession, PgltCommand, open_transport, pglt_command, setup_panic_handler,
to_color_mode,
};
use std::process::{ExitCode, Termination};
use tokio::runtime::Runtime;

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