Skip to content

Commit b2caafc

Browse files
committed
updates
1 parent d7523e3 commit b2caafc

File tree

15 files changed

+42
-22
lines changed

15 files changed

+42
-22
lines changed

β€ŽPUBLISH.mdβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ This interactive script will:
1212
- Let you select which versions to publish (or all)
1313
- Also includes the full package (@libpg-query/parser)
1414
- Ask for version bump type (patch or minor only)
15-
- Build, test, and publish each selected version
15+
- Ask if you want to skip the build step (useful if already built)
16+
- Always run tests (even if build is skipped)
17+
- Publish each selected version
1618
- Optionally promote pg17 to latest
1719

1820
### Types Packages

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Built to power [pgsql-parser](https://github.com/pyramation/pgsql-parser), this
3535
## πŸš€ For Round-trip Codegen
3636

3737
> 🎯 **Want to parse + deparse (full round trip)?**
38-
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 21,000+ SQL statements and is built on top of libpg-query.
38+
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query.
3939
4040
## Installation
4141

β€Žfull/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Built to power [pgsql-parser](https://github.com/pyramation/pgsql-parser), this
3535
## πŸš€ For Round-trip Codegen
3636

3737
> 🎯 **Want to parse + deparse (full round trip)?**
38-
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 21,000+ SQL statements and is built on top of libpg-query.
38+
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query.
3939
4040
## Installation
4141

β€Žscripts/publish-single-version.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const modified = { ...original, name: publishName };
2727
try {
2828
console.log(`πŸ“¦ Publishing ${publishName}@${original.version} with tag '${distTag}'...`);
2929
fs.writeFileSync(pkgPath, JSON.stringify(modified, null, 2));
30+
// npm OK here since it's version, not dist/ package...
3031
execSync(`npm publish --tag ${distTag}`, { stdio: 'inherit' });
3132
console.log('βœ… Publish complete.');
3233
} catch (err) {

β€Žscripts/publish-versions.jsβ€Ž

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ async function main() {
8282
console.log(` - Full package (${bump} bump)`);
8383
}
8484

85+
// Ask about building
86+
const skipBuild = await question('\nSkip build step? (y/N): ');
87+
const shouldBuild = skipBuild.toLowerCase() !== 'y';
88+
89+
if (!shouldBuild) {
90+
console.log('⚠️ Build step will be skipped. Make sure packages are already built!');
91+
}
92+
8593
const confirm = await question('\nProceed? (y/N): ');
8694
if (confirm.toLowerCase() !== 'y') {
8795
console.log('❌ Publishing cancelled.');
@@ -106,11 +114,15 @@ async function main() {
106114
execSync(`git add package.json`, { cwd: versionPath });
107115
execSync(`git commit -m "release: bump libpg-query v${version} version"`, { stdio: 'inherit' });
108116

109-
// Build
110-
console.log(` πŸ”¨ Building...`);
111-
execSync('pnpm build', { cwd: versionPath, stdio: 'inherit' });
117+
// Build (if not skipped)
118+
if (shouldBuild) {
119+
console.log(` πŸ”¨ Building...`);
120+
execSync('pnpm build', { cwd: versionPath, stdio: 'inherit' });
121+
} else {
122+
console.log(` ⏭️ Skipping build step`);
123+
}
112124

113-
// Test
125+
// Test (always run)
114126
console.log(` πŸ§ͺ Running tests...`);
115127
execSync('pnpm test', { cwd: versionPath, stdio: 'inherit' });
116128

@@ -144,17 +156,22 @@ async function main() {
144156
execSync(`git add package.json`, { cwd: fullPath });
145157
execSync(`git commit -m "release: bump @libpg-query/parser version"`, { stdio: 'inherit' });
146158

147-
// Build
148-
console.log(` πŸ”¨ Building...`);
149-
execSync('pnpm build', { cwd: fullPath, stdio: 'inherit' });
159+
// Build (if not skipped)
160+
if (shouldBuild) {
161+
console.log(` πŸ”¨ Building...`);
162+
execSync('pnpm build', { cwd: fullPath, stdio: 'inherit' });
163+
} else {
164+
console.log(` ⏭️ Skipping build step`);
165+
}
150166

151-
// Test
167+
// Test (always run)
152168
console.log(` πŸ§ͺ Running tests...`);
153169
execSync('pnpm test', { cwd: fullPath, stdio: 'inherit' });
154170

155171
// Publish with pg17 tag
156172
console.log(` πŸ“€ Publishing to npm with pg17 tag...`);
157-
execSync('pnpm publish --tag pg17', { cwd: fullPath, stdio: 'inherit' });
173+
// use npm so staged changes are OK
174+
execSync('npm publish --tag pg17', { cwd: fullPath, stdio: 'inherit' });
158175

159176
console.log(` βœ… Full package published successfully with pg17 tag!`);
160177
} catch (error) {

β€Žversions/13/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Built to power [pgsql-parser](https://github.com/pyramation/pgsql-parser), this
3535
## πŸš€ For Round-trip Codegen
3636

3737
> 🎯 **Want to parse + deparse (full round trip)?**
38-
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 21,000+ SQL statements and is built on top of libpg-query.
38+
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query.
3939
4040
## Installation
4141

β€Žversions/13/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
"plpgsql",
5050
"database"
5151
]
52-
}
52+
}

β€Žversions/14/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Built to power [pgsql-parser](https://github.com/pyramation/pgsql-parser), this
3535
## πŸš€ For Round-trip Codegen
3636

3737
> 🎯 **Want to parse + deparse (full round trip)?**
38-
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 21,000+ SQL statements and is built on top of libpg-query.
38+
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query.
3939
4040
## Installation
4141

β€Žversions/14/package.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@
4949
"plpgsql",
5050
"database"
5151
]
52-
}
52+
}

β€Žversions/15/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Built to power [pgsql-parser](https://github.com/pyramation/pgsql-parser), this
3535
## πŸš€ For Round-trip Codegen
3636

3737
> 🎯 **Want to parse + deparse (full round trip)?**
38-
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 21,000+ SQL statements and is built on top of libpg-query.
38+
> We highly recommend using [`pgsql-parser`](https://github.com/launchql/pgsql-parser) which leverages a pure TypeScript deparser that has been battle-tested against 23,000+ SQL statements and is built on top of libpg-query.
3939
4040
## Installation
4141

0 commit comments

Comments
Β (0)