@@ -77,6 +77,10 @@ cd packages/parser/versions/17
7777# Build the package
7878npm run build
7979
80+ # cd to dist/
81+
82+ cd dist/
83+
8084# Publish with the correct tag
8185npm publish --tag pg17
8286```
@@ -128,6 +132,9 @@ cd packages/deparser/versions/17
128132# Build the package
129133npm run build
130134
135+ # dist
136+ cd dist/
137+
131138# Publish with the correct tag
132139npm publish --tag pg17
133140```
@@ -143,127 +150,8 @@ npm run prepare-versions
143150for version in versions/* /; do
144151 cd " $version "
145152 npm run build
153+ cd dist/
146154 npm run publish:pkg # Uses the npmTag from config
147155 cd ..
148156done
149- ```
150-
151- ### 3. Other Packages
152-
153- For packages without multi-version publishing (utils, traverse, cli, etc.):
154-
155- ``` bash
156- cd packages/{package-name}
157- npm run build
158- npm publish
159- ```
160-
161- ## Lerna Publishing
162-
163- For coordinated publishing across the entire monorepo:
164-
165- ``` bash
166- # Publish all packages that have changed
167- lerna publish
168-
169- # Publish with a specific version bump
170- lerna publish major| minor| patch
171-
172- # Publish from a specific branch (main only by default)
173- lerna publish --allow-branch main
174- ```
175-
176- The Lerna configuration (` lerna.json ` ) is set up with:
177- - Independent versioning for each package
178- - Conventional commits for automatic changelog generation
179- - Restricted to publishing from the ` main ` branch
180-
181- ## Complete Publishing Procedure
182-
183- ### For a New Release
184-
185- 1 . ** Update version configuration** in ` config/versions.json ` if needed
186- 2 . ** Build the monorepo** :
187- ``` bash
188- yarn && yarn build
189- ```
190-
191- 3 . ** Prepare multi-version packages** :
192- ``` bash
193- # Parser versions
194- cd packages/parser && npm run prepare-versions && cd ../..
195-
196- # Deparser versions
197- cd packages/deparser && npm run prepare-versions && cd ../..
198- ```
199-
200- 4 . ** Publish packages** (choose one approach):
201-
202- ** Option A: Individual package publishing**
203- ``` bash
204- # Publish parser versions
205- cd packages/parser
206- for version in versions/* /; do
207- cd " $version " && npm run build && npm run publish:pkg && cd ..
208- done
209- cd ../..
210-
211- # Publish deparser versions
212- cd packages/deparser
213- for version in versions/* /; do
214- cd " $version " && npm run build && npm run publish:pkg && cd ..
215- done
216- cd ../..
217-
218- # Publish other packages
219- cd packages/utils && npm run build && npm publish && cd ../..
220- cd packages/traverse && npm run build && npm publish && cd ../..
221- # ... repeat for other packages
222- ```
223-
224- ** Option B: Lerna coordinated publishing**
225- ``` bash
226- lerna publish
227- ```
228-
229- ### For Emergency Patches
230-
231- 1 . ** Create a patch branch** from the target version
232- 2 . ** Apply fixes** to the relevant packages
233- 3 . ** Update version numbers** in ` config/versions.json `
234- 4 . ** Follow the complete publishing procedure** above
235-
236- ## Troubleshooting
237-
238- ### Common Issues
239-
240- ** Build failures** : Ensure you've run ` yarn && yarn build ` in the root directory first.
241-
242- ** Version conflicts** : Check that ` config/versions.json ` has consistent version numbers across all packages.
243-
244- ** npm tag issues** : Verify that the npmTag in the configuration matches what you're publishing with.
245-
246- ** Permission errors** : Ensure you're logged into npm with an account that has publish permissions for the ` @pgsql ` scope and ` pgsql-* ` packages.
247-
248- ### Verification
249-
250- After publishing, verify the packages are available:
251-
252- ``` bash
253- # Check latest versions
254- npm view pgsql-parser dist-tags
255- npm view pgsql-deparser dist-tags
256-
257- # Check specific version tags
258- npm view pgsql-parser@pg17
259- npm view pgsql-deparser@pg17
260- ```
261-
262- ## Package Dependencies
263-
264- The multi-version system maintains these relationships:
265- - ` pgsql-parser ` depends on ` libpg-query ` , ` pgsql-deparser ` , and ` @pgsql/types `
266- - ` pgsql-deparser ` depends only on ` @pgsql/types `
267- - All versions must be compatible within the same PostgreSQL version
268-
269- When updating versions, ensure all related packages are updated together to maintain compatibility.
157+ ```
0 commit comments