Skip to content

Commit 4bcb431

Browse files
authored
fix: Reuse the pglite build for changeset release (#168)
* Reuse the pglite build * Fix stylecheck issue * Fix style issue in docs
1 parent 9ce66f3 commit 4bcb431

File tree

6 files changed

+85
-87
lines changed

6 files changed

+85
-87
lines changed

.github/workflows/build_and_test.yml

+38
Original file line numberDiff line numberDiff line change
@@ -222,3 +222,41 @@ jobs:
222222
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
223223
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
224224
timeout-minutes: 1
225+
226+
changesets-release:
227+
if: github.event_name == 'push'
228+
permissions:
229+
contents: write # to create release (changesets/action)
230+
issues: write # to post issue comments (changesets/action)
231+
pull-requests: write # to create pull request (changesets/action)
232+
name: Make a PR or publish
233+
runs-on: ubuntu-latest
234+
needs: [build-wasm-postgres]
235+
steps:
236+
- uses: actions/checkout@v4
237+
with:
238+
fetch-depth: 0
239+
- name: Download PGlite WASM build artifacts
240+
uses: actions/download-artifact@v4
241+
with:
242+
name: pglite-interim-build-files
243+
path: ./packages/pglite/release
244+
- uses: pnpm/action-setup@v4
245+
with:
246+
version: 8
247+
- uses: actions/setup-node@v4
248+
with:
249+
node-version: 20
250+
cache: pnpm
251+
- run: pnpm install --frozen-lockfile
252+
- run: pnpm -r build
253+
- name: Create Release Pull Request or Publish
254+
id: changesets
255+
uses: changesets/action@v1
256+
with:
257+
version: pnpm ci:version
258+
publish: pnpm ci:publish
259+
title: 'chore: publish new package versions'
260+
env:
261+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
262+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/changesets_release.yml

-41
This file was deleted.

docs/.vitepress/config.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default defineConfig({
4848
{ text: 'Docs', link: '/docs/' },
4949
{ text: 'Extensions', link: '/extensions/' },
5050
{ text: 'REPL', link: '/repl/' },
51-
{ text: 'ElectricSQL', link: 'https://www.electric-sql.com' }
51+
{ text: 'ElectricSQL', link: 'https://www.electric-sql.com' },
5252
],
5353
sidebar: [
5454
{

docs/extensions/extensions.data.ts

+23-22
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const baseExtensions: Extension[] = [
99
- single-precision, half-precision, binary, and sparse vectors
1010
- L2 distance, inner product, cosine distance, L1 distance, Hamming distance, and Jaccard distance
1111
`,
12-
shortDescription: "Open-source vector similarity search for Postgres.",
12+
shortDescription: 'Open-source vector similarity search for Postgres.',
1313
featured: true,
1414
repo: 'https://github.com/pgvector/pgvector',
1515
tags: ['postgres extension'],
@@ -40,7 +40,8 @@ const baseExtensions: Extension[] = [
4040
adminpack provides a number of support functions which pgAdmin and other
4141
administration and management tools can use to provide additional functionality
4242
`,
43-
shortDescription: "Support functions for pgAdmin and other administration tools.",
43+
shortDescription:
44+
'Support functions for pgAdmin and other administration tools.',
4445
docs: 'https://www.postgresql.org/docs/current/adminpack.html',
4546
tags: ['postgres extension', 'postgres/contrib'],
4647
importPath: '@electric-sql/pglite/contrib/adminpack',
@@ -54,7 +55,7 @@ const baseExtensions: Extension[] = [
5455
The amcheck module provides functions that allow you to verify the logical
5556
consistency of the structure of relations.
5657
`,
57-
shortDescription: "Verify the logical consistency of relations.",
58+
shortDescription: 'Verify the logical consistency of relations.',
5859
docs: 'https://www.postgresql.org/docs/current/amcheck.html',
5960
tags: ['postgres extension', 'postgres/contrib'],
6061
importPath: '@electric-sql/pglite/contrib/amcheck',
@@ -68,7 +69,7 @@ const baseExtensions: Extension[] = [
6869
The auto_explain module provides a means for logging execution plans of slow
6970
statements automatically, without having to run EXPLAIN by hand.
7071
`,
71-
shortDescription: "Log execution plans of slow statements automatically.",
72+
shortDescription: 'Log execution plans of slow statements automatically.',
7273
docs: 'https://www.postgresql.org/docs/current/auto-explain.html',
7374
tags: ['postgres extension', 'postgres/contrib'],
7475
importPath: '@electric-sql/pglite/contrib/auto_explain',
@@ -85,7 +86,7 @@ const baseExtensions: Extension[] = [
8586
allows fast exclusion of non-matching tuples via signatures whose size is
8687
determined at index creation.
8788
`,
88-
shortDescription: "Index access method based on Bloom filters.",
89+
shortDescription: 'Index access method based on Bloom filters.',
8990
repo: 'https://www.postgresql.org/docs/current/bloom.html',
9091
tags: ['postgres extension', 'postgres/contrib'],
9192
importPath: '@electric-sql/pglite/contrib/bloom',
@@ -99,7 +100,7 @@ const baseExtensions: Extension[] = [
99100
btree_gin provides GIN operator classes that implement B-tree equivalent
100101
behavior for many built in data types.
101102
`,
102-
shortDescription: "GIN operator classes that implement B-tree behavior.",
103+
shortDescription: 'GIN operator classes that implement B-tree behavior.',
103104
docs: 'https://www.postgresql.org/docs/current/btree-gin.html',
104105
tags: ['postgres extension', 'postgres/contrib'],
105106
importPath: '@electric-sql/pglite/contrib/btree_gin',
@@ -113,7 +114,7 @@ const baseExtensions: Extension[] = [
113114
btree_gist provides GiST operator classes that implement B-tree equivalent
114115
behavior for many built in data types.
115116
`,
116-
shortDescription: "GiST operator classes that implement B-tree behavior.",
117+
shortDescription: 'GiST operator classes that implement B-tree behavior.',
117118
docs: 'https://www.postgresql.org/docs/current/btree-gist.html',
118119
tags: ['postgres extension', 'postgres/contrib'],
119120
importPath: '@electric-sql/pglite/contrib/btree_gist',
@@ -128,7 +129,7 @@ const baseExtensions: Extension[] = [
128129
it internally calls lower when comparing values. Otherwise, it behaves almost
129130
the same as text.
130131
`,
131-
shortDescription: "Case-insensitive character string type.",
132+
shortDescription: 'Case-insensitive character string type.',
132133
docs: 'https://www.postgresql.org/docs/current/citext.html',
133134
tags: ['postgres extension', 'postgres/contrib'],
134135
importPath: '@electric-sql/pglite/contrib/citext',
@@ -141,7 +142,7 @@ const baseExtensions: Extension[] = [
141142
description: `
142143
cube provides a data type cube for representing multidimensional cubes.
143144
`,
144-
shortDescription: "Multidimensional cubes data type.",
145+
shortDescription: 'Multidimensional cubes data type.',
145146
docs: 'https://www.postgresql.org/docs/current/cube.html',
146147
tags: ['postgres extension', 'postgres/contrib'],
147148
importPath: '@electric-sql/pglite/contrib/cube',
@@ -155,7 +156,7 @@ const baseExtensions: Extension[] = [
155156
The earthdistance module provides tools for calculating great circle distances
156157
on the surface of the Earth.
157158
`,
158-
shortDescription: "Calculate great circle distances on the Earth.",
159+
shortDescription: 'Calculate great circle distances on the Earth.',
159160
docs: 'https://www.postgresql.org/docs/current/earthdistance.html',
160161
tags: ['postgres extension', 'postgres/contrib'],
161162
importPath: '@electric-sql/pglite/contrib/earthdistance',
@@ -169,7 +170,7 @@ const baseExtensions: Extension[] = [
169170
fuzzystrmatch provides functions to determine similarities and distance
170171
between strings.
171172
`,
172-
shortDescription: "Determine similarities and distance between strings.",
173+
shortDescription: 'Determine similarities and distance between strings.',
173174
docs: 'https://www.postgresql.org/docs/current/fuzzystrmatch.html',
174175
tags: ['postgres extension', 'postgres/contrib'],
175176
importPath: '@electric-sql/pglite/contrib/fuzzystrmatch',
@@ -185,7 +186,7 @@ const baseExtensions: Extension[] = [
185186
such as rows with many attributes that are rarely examined, or semi-structured
186187
data. Keys and values are simply text strings.
187188
`,
188-
shortDescription: "Key/value pairs data type.",
189+
shortDescription: 'Key/value pairs data type.',
189190
docs: 'https://www.postgresql.org/docs/current/hstore.html',
190191
tags: ['postgres extension', 'postgres/contrib'],
191192
importPath: '@electric-sql/pglite/contrib/hstore',
@@ -199,7 +200,7 @@ const baseExtensions: Extension[] = [
199200
The isn module provides data types for the following international product
200201
numbering standards: EAN13, UPC, ISBN (books), ISMN (music), and ISSN (serials).
201202
`,
202-
shortDescription: "International product numbering standards data types.",
203+
shortDescription: 'International product numbering standards data types.',
203204
docs: 'https://www.postgresql.org/docs/current/isn.html',
204205
tags: ['postgres extension', 'postgres/contrib'],
205206
importPath: '@electric-sql/pglite/contrib/isn',
@@ -213,7 +214,7 @@ const baseExtensions: Extension[] = [
213214
The lo module provides support for managing Large Objects (also called LOs
214215
or BLOBs). This includes a data type lo and a trigger lo_manage.
215216
`,
216-
shortDescription: "Support for managing Large Objects.",
217+
shortDescription: 'Support for managing Large Objects.',
217218
docs: 'https://www.postgresql.org/docs/current/lo.html',
218219
tags: ['postgres extension', 'postgres/contrib'],
219220
importPath: '@electric-sql/pglite/contrib/lo',
@@ -228,7 +229,7 @@ const baseExtensions: Extension[] = [
228229
in a hierarchical tree-like structure. Extensive facilities for searching through
229230
label trees are provided.
230231
`,
231-
shortDescription: "Hierarchical tree-like structure data type.",
232+
shortDescription: 'Hierarchical tree-like structure data type.',
232233
docs: 'https://www.postgresql.org/docs/current/ltree.html',
233234
tags: ['postgres extension', 'postgres/contrib'],
234235
importPath: '@electric-sql/pglite/contrib/ltree',
@@ -243,7 +244,7 @@ const baseExtensions: Extension[] = [
243244
of alphanumeric text based on trigram matching, as well as index operator classes
244245
that support fast searching for similar strings.
245246
`,
246-
shortDescription: "Text similarity functions and operators.",
247+
shortDescription: 'Text similarity functions and operators.',
247248
docs: 'https://www.postgresql.org/docs/current/pgtrgm.html',
248249
tags: ['postgres extension', 'postgres/contrib'],
249250
importPath: '@electric-sql/pglite/contrib/pg_trgm',
@@ -258,7 +259,7 @@ const baseExtensions: Extension[] = [
258259
floating point intervals. seg can represent uncertainty in the interval endpoints,
259260
making it especially useful for representing laboratory measurements.
260261
`,
261-
shortDescription: "Line segments data types.",
262+
shortDescription: 'Line segments data types.',
262263
docs: 'https://www.postgresql.org/docs/current/seg.html',
263264
tags: ['postgres extension', 'postgres/contrib'],
264265
importPath: '@electric-sql/pglite/contrib/seg',
@@ -273,7 +274,7 @@ const baseExtensions: Extension[] = [
273274
multiple rows). These functions are useful both in their own right and as
274275
examples of how to write C functions that return multiple rows.
275276
`,
276-
shortDescription: "Functions that return tables.",
277+
shortDescription: 'Functions that return tables.',
277278
docs: 'https://www.postgresql.org/docs/current/tablefunc.html',
278279
tags: ['postgres extension', 'postgres/contrib'],
279280
importPath: '@electric-sql/pglite/contrib/tablefunc',
@@ -288,7 +289,7 @@ const baseExtensions: Extension[] = [
288289
any table on which it is attached. It must be used as an AFTER trigger
289290
FOR EACH ROW.
290291
`,
291-
shortDescription: "Trigger function that notifies listeners of changes.",
292+
shortDescription: 'Trigger function that notifies listeners of changes.',
292293
docs: 'https://www.postgresql.org/docs/current/tcn.html',
293294
tags: ['postgres extension', 'postgres/contrib'],
294295
importPath: '@electric-sql/pglite/contrib/tcn',
@@ -302,7 +303,7 @@ const baseExtensions: Extension[] = [
302303
The tsm_system_rows module provides the table sampling method SYSTEM_ROWS, which
303304
can be used in the TABLESAMPLE clause of a SELECT command.
304305
`,
305-
shortDescription: "Table sampling method SYSTEM_ROWS.",
306+
shortDescription: 'Table sampling method SYSTEM_ROWS.',
306307
docs: 'https://www.postgresql.org/docs/current/tsm-system-rows.html',
307308
tags: ['postgres extension', 'postgres/contrib'],
308309
importPath: '@electric-sql/pglite/contrib/tsm_system_rows',
@@ -316,7 +317,7 @@ const baseExtensions: Extension[] = [
316317
The tsm_system_time module provides the table sampling method SYSTEM_TIME, which
317318
can be used in the TABLESAMPLE clause of a SELECT command.
318319
`,
319-
shortDescription: "Table sampling method SYSTEM_TIME.",
320+
shortDescription: 'Table sampling method SYSTEM_TIME.',
320321
docs: 'https://www.postgresql.org/docs/current/tsm-system-time.html',
321322
tags: ['postgres extension', 'postgres/contrib'],
322323
importPath: '@electric-sql/pglite/contrib/tsm_system_time',
@@ -331,7 +332,7 @@ const baseExtensions: Extension[] = [
331332
functions to produce certain special UUID constants. This module is only
332333
necessary for special requirements beyond what is available in core PostgreSQL.
333334
`,
334-
shortDescription: "Aditional functions for generating UUIDs.",
335+
shortDescription: 'Aditional functions for generating UUIDs.',
335336
docs: 'https://www.postgresql.org/docs/current/uuid-ossp.html',
336337
tags: ['postgres extension', 'postgres/contrib'],
337338
importPath: '@electric-sql/pglite/contrib/uuid_ossp',

docs/repl/allExtensions.ts

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
export { vector } from "../../packages/pglite/dist/vector";
2-
export { adminpack } from "../../packages/pglite/dist/contrib/adminpack";
3-
export { amcheck } from "../../packages/pglite/dist/contrib/amcheck";
4-
export { auto_explain } from "../../packages/pglite/dist/contrib/auto_explain";
5-
export { bloom } from "../../packages/pglite/dist/contrib/bloom";
6-
export { btree_gin } from "../../packages/pglite/dist/contrib/btree_gin";
7-
export { btree_gist } from "../../packages/pglite/dist/contrib/btree_gist";
8-
export { citext } from "../../packages/pglite/dist/contrib/citext";
9-
export { cube } from "../../packages/pglite/dist/contrib/cube";
10-
export { earthdistance } from "../../packages/pglite/dist/contrib/earthdistance";
11-
export { fuzzystrmatch } from "../../packages/pglite/dist/contrib/fuzzystrmatch";
12-
export { hstore } from "../../packages/pglite/dist/contrib/hstore";
13-
export { isn } from "../../packages/pglite/dist/contrib/isn";
14-
export { lo } from "../../packages/pglite/dist/contrib/lo";
15-
export { ltree } from "../../packages/pglite/dist/contrib/ltree";
16-
export { pg_trgm } from "../../packages/pglite/dist/contrib/pg_trgm";
17-
export { seg } from "../../packages/pglite/dist/contrib/seg";
18-
export { tablefunc } from "../../packages/pglite/dist/contrib/tablefunc";
19-
export { tcn } from "../../packages/pglite/dist/contrib/tcn";
20-
export { tsm_system_rows } from "../../packages/pglite/dist/contrib/tsm_system_rows";
21-
export { tsm_system_time } from "../../packages/pglite/dist/contrib/tsm_system_time";
22-
export { uuid_ossp } from "../../packages/pglite/dist/contrib/uuid_ossp";
1+
export { vector } from '../../packages/pglite/dist/vector'
2+
export { adminpack } from '../../packages/pglite/dist/contrib/adminpack'
3+
export { amcheck } from '../../packages/pglite/dist/contrib/amcheck'
4+
export { auto_explain } from '../../packages/pglite/dist/contrib/auto_explain'
5+
export { bloom } from '../../packages/pglite/dist/contrib/bloom'
6+
export { btree_gin } from '../../packages/pglite/dist/contrib/btree_gin'
7+
export { btree_gist } from '../../packages/pglite/dist/contrib/btree_gist'
8+
export { citext } from '../../packages/pglite/dist/contrib/citext'
9+
export { cube } from '../../packages/pglite/dist/contrib/cube'
10+
export { earthdistance } from '../../packages/pglite/dist/contrib/earthdistance'
11+
export { fuzzystrmatch } from '../../packages/pglite/dist/contrib/fuzzystrmatch'
12+
export { hstore } from '../../packages/pglite/dist/contrib/hstore'
13+
export { isn } from '../../packages/pglite/dist/contrib/isn'
14+
export { lo } from '../../packages/pglite/dist/contrib/lo'
15+
export { ltree } from '../../packages/pglite/dist/contrib/ltree'
16+
export { pg_trgm } from '../../packages/pglite/dist/contrib/pg_trgm'
17+
export { seg } from '../../packages/pglite/dist/contrib/seg'
18+
export { tablefunc } from '../../packages/pglite/dist/contrib/tablefunc'
19+
export { tcn } from '../../packages/pglite/dist/contrib/tcn'
20+
export { tsm_system_rows } from '../../packages/pglite/dist/contrib/tsm_system_rows'
21+
export { tsm_system_time } from '../../packages/pglite/dist/contrib/tsm_system_time'
22+
export { uuid_ossp } from '../../packages/pglite/dist/contrib/uuid_ossp'

packages/pglite/src/pglite.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export class PGlite implements PGliteInterface, AsyncDisposable {
212212
if (!buf) {
213213
throw new Error('No /dev/blob File or Blob provided to llseek')
214214
}
215-
var position = offset
215+
let position = offset
216216
if (whence === 1) {
217217
position += stream.position
218218
} else if (whence === 2) {

0 commit comments

Comments
 (0)