pgpm 4.26.4 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/commands/init/index.js +55 -0
- package/esm/commands/init/index.js +55 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -455,6 +455,20 @@ Most commands support these global options:
|
|
|
455
455
|
- `--version, -v` - Show version information
|
|
456
456
|
- `--cwd <dir>` - Set working directory
|
|
457
457
|
|
|
458
|
+
## AI Agent Skills
|
|
459
|
+
|
|
460
|
+
Install the pgpm skill for AI coding agents (Devin, Claude Code, Cursor, Copilot):
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
npx skills add https://github.com/constructive-io/constructive --skill pgpm
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
For the full Constructive platform skills (security, blueprints, codegen, billing, etc.):
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
npx skills add constructive-io/constructive-skills
|
|
470
|
+
```
|
|
471
|
+
|
|
458
472
|
---
|
|
459
473
|
|
|
460
474
|
## Education and Tutorials
|
|
@@ -507,6 +521,17 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
|
507
521
|
|
|
508
522
|
* [constructive-skills](https://github.com/constructive-io/constructive-skills): **📖 Platform documentation and AI agent skills** — feature catalog, blueprint reference, SDK guides (i18n, billing, limits, events, uploads, security, entities, search, AI), and deployment guides.
|
|
509
523
|
|
|
524
|
+
Install skills for AI coding agents:
|
|
525
|
+
|
|
526
|
+
```bash
|
|
527
|
+
# All platform skills (security, blueprints, codegen, billing, etc.)
|
|
528
|
+
npx skills add constructive-io/constructive-skills
|
|
529
|
+
|
|
530
|
+
# Individual repo skills (pgpm, testing, CLI, search, etc.)
|
|
531
|
+
npx skills add https://github.com/constructive-io/constructive --skill pgpm
|
|
532
|
+
npx skills add https://github.com/constructive-io/constructive --skill constructive-testing
|
|
533
|
+
```
|
|
534
|
+
|
|
510
535
|
## Credits
|
|
511
536
|
|
|
512
537
|
**🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
|
package/commands/init/index.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createInitUsageText = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const path_1 = __importDefault(require("path"));
|
|
9
10
|
const core_1 = require("@pgpmjs/core");
|
|
@@ -208,6 +209,35 @@ async function handleBoilerplateInit(argv, prompter, ctx) {
|
|
|
208
209
|
requiresWorkspace: inspection.config?.requiresWorkspace,
|
|
209
210
|
}, true);
|
|
210
211
|
}
|
|
212
|
+
function installSkills(skills, cwd) {
|
|
213
|
+
const failed = [];
|
|
214
|
+
for (const entry of skills) {
|
|
215
|
+
const source = entry.source.includes('://')
|
|
216
|
+
? entry.source
|
|
217
|
+
: `https://github.com/${entry.source}`;
|
|
218
|
+
for (const skill of entry.skills) {
|
|
219
|
+
const cmd = `npx --yes skills add ${source} --skill ${skill} --yes`;
|
|
220
|
+
try {
|
|
221
|
+
(0, child_process_1.execSync)(cmd, {
|
|
222
|
+
cwd,
|
|
223
|
+
stdio: ['pipe', 'inherit', 'inherit'],
|
|
224
|
+
timeout: 120_000,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
failed.push(` npx skills add ${source} --skill ${skill}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (failed.length > 0) {
|
|
233
|
+
process.stdout.write('\n⚠️ Some skills could not be installed automatically.\n');
|
|
234
|
+
process.stdout.write('Run the following commands manually:\n\n');
|
|
235
|
+
for (const cmd of failed) {
|
|
236
|
+
process.stdout.write(`${cmd}\n`);
|
|
237
|
+
}
|
|
238
|
+
process.stdout.write('\n');
|
|
239
|
+
}
|
|
240
|
+
}
|
|
211
241
|
async function handleWorkspaceInit(argv, prompter, ctx) {
|
|
212
242
|
const workspaceQuestions = [
|
|
213
243
|
{
|
|
@@ -254,6 +284,18 @@ async function handleWorkspaceInit(argv, prompter, ctx) {
|
|
|
254
284
|
if (!motd.endsWith('\n')) {
|
|
255
285
|
process.stdout.write('\n');
|
|
256
286
|
}
|
|
287
|
+
// Install skills declared in .boilerplate.json
|
|
288
|
+
const templateInfo = (0, core_1.inspectTemplate)({
|
|
289
|
+
fromPath: ctx.fromPath,
|
|
290
|
+
templateRepo: ctx.templateRepo,
|
|
291
|
+
branch: ctx.branch,
|
|
292
|
+
dir: ctx.dir,
|
|
293
|
+
cwd: ctx.cwd,
|
|
294
|
+
});
|
|
295
|
+
if (templateInfo.config?.skills?.length) {
|
|
296
|
+
process.stdout.write('\n📦 Installing skills...\n\n');
|
|
297
|
+
installSkills(templateInfo.config.skills, targetPath);
|
|
298
|
+
}
|
|
257
299
|
const relPath = path_1.default.relative(process.cwd(), targetPath);
|
|
258
300
|
process.stdout.write(`\n✨ Enjoy!\n\ncd ./${relPath}\n`);
|
|
259
301
|
return { ...argv, ...answers, cwd: targetPath };
|
|
@@ -502,6 +544,19 @@ async function handleModuleInit(argv, prompter, ctx, wasExplicitModuleRequest =
|
|
|
502
544
|
if (!motd.endsWith('\n')) {
|
|
503
545
|
process.stdout.write('\n');
|
|
504
546
|
}
|
|
547
|
+
// Install skills declared in .boilerplate.json
|
|
548
|
+
const moduleTemplateInfo = (0, core_1.inspectTemplate)({
|
|
549
|
+
fromPath: ctx.fromPath,
|
|
550
|
+
templateRepo: ctx.templateRepo,
|
|
551
|
+
branch: ctx.branch,
|
|
552
|
+
dir: ctx.dir,
|
|
553
|
+
cwd: ctx.cwd,
|
|
554
|
+
});
|
|
555
|
+
if (moduleTemplateInfo.config?.skills?.length) {
|
|
556
|
+
const skillsCwd = project.workspacePath || modulePath;
|
|
557
|
+
process.stdout.write('\n📦 Installing skills...\n\n');
|
|
558
|
+
installSkills(moduleTemplateInfo.config.skills, skillsCwd);
|
|
559
|
+
}
|
|
505
560
|
const relPath = path_1.default.relative(process.cwd(), modulePath);
|
|
506
561
|
process.stdout.write(`\n✨ Enjoy!\n\ncd ./${relPath}\n`);
|
|
507
562
|
return { ...argv, ...answers };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
1
2
|
import fs from 'fs';
|
|
2
3
|
import path from 'path';
|
|
3
4
|
import { DEFAULT_TEMPLATE_REPO, DEFAULT_TEMPLATE_TOOL_NAME, inspectTemplate, PgpmPackage, resolveBoilerplateBaseDir, scaffoldTemplate, scanBoilerplates, sluggify, } from '@pgpmjs/core';
|
|
@@ -201,6 +202,35 @@ async function handleBoilerplateInit(argv, prompter, ctx) {
|
|
|
201
202
|
requiresWorkspace: inspection.config?.requiresWorkspace,
|
|
202
203
|
}, true);
|
|
203
204
|
}
|
|
205
|
+
function installSkills(skills, cwd) {
|
|
206
|
+
const failed = [];
|
|
207
|
+
for (const entry of skills) {
|
|
208
|
+
const source = entry.source.includes('://')
|
|
209
|
+
? entry.source
|
|
210
|
+
: `https://github.com/${entry.source}`;
|
|
211
|
+
for (const skill of entry.skills) {
|
|
212
|
+
const cmd = `npx --yes skills add ${source} --skill ${skill} --yes`;
|
|
213
|
+
try {
|
|
214
|
+
execSync(cmd, {
|
|
215
|
+
cwd,
|
|
216
|
+
stdio: ['pipe', 'inherit', 'inherit'],
|
|
217
|
+
timeout: 120_000,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
failed.push(` npx skills add ${source} --skill ${skill}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (failed.length > 0) {
|
|
226
|
+
process.stdout.write('\n⚠️ Some skills could not be installed automatically.\n');
|
|
227
|
+
process.stdout.write('Run the following commands manually:\n\n');
|
|
228
|
+
for (const cmd of failed) {
|
|
229
|
+
process.stdout.write(`${cmd}\n`);
|
|
230
|
+
}
|
|
231
|
+
process.stdout.write('\n');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
204
234
|
async function handleWorkspaceInit(argv, prompter, ctx) {
|
|
205
235
|
const workspaceQuestions = [
|
|
206
236
|
{
|
|
@@ -247,6 +277,18 @@ async function handleWorkspaceInit(argv, prompter, ctx) {
|
|
|
247
277
|
if (!motd.endsWith('\n')) {
|
|
248
278
|
process.stdout.write('\n');
|
|
249
279
|
}
|
|
280
|
+
// Install skills declared in .boilerplate.json
|
|
281
|
+
const templateInfo = inspectTemplate({
|
|
282
|
+
fromPath: ctx.fromPath,
|
|
283
|
+
templateRepo: ctx.templateRepo,
|
|
284
|
+
branch: ctx.branch,
|
|
285
|
+
dir: ctx.dir,
|
|
286
|
+
cwd: ctx.cwd,
|
|
287
|
+
});
|
|
288
|
+
if (templateInfo.config?.skills?.length) {
|
|
289
|
+
process.stdout.write('\n📦 Installing skills...\n\n');
|
|
290
|
+
installSkills(templateInfo.config.skills, targetPath);
|
|
291
|
+
}
|
|
250
292
|
const relPath = path.relative(process.cwd(), targetPath);
|
|
251
293
|
process.stdout.write(`\n✨ Enjoy!\n\ncd ./${relPath}\n`);
|
|
252
294
|
return { ...argv, ...answers, cwd: targetPath };
|
|
@@ -495,6 +537,19 @@ async function handleModuleInit(argv, prompter, ctx, wasExplicitModuleRequest =
|
|
|
495
537
|
if (!motd.endsWith('\n')) {
|
|
496
538
|
process.stdout.write('\n');
|
|
497
539
|
}
|
|
540
|
+
// Install skills declared in .boilerplate.json
|
|
541
|
+
const moduleTemplateInfo = inspectTemplate({
|
|
542
|
+
fromPath: ctx.fromPath,
|
|
543
|
+
templateRepo: ctx.templateRepo,
|
|
544
|
+
branch: ctx.branch,
|
|
545
|
+
dir: ctx.dir,
|
|
546
|
+
cwd: ctx.cwd,
|
|
547
|
+
});
|
|
548
|
+
if (moduleTemplateInfo.config?.skills?.length) {
|
|
549
|
+
const skillsCwd = project.workspacePath || modulePath;
|
|
550
|
+
process.stdout.write('\n📦 Installing skills...\n\n');
|
|
551
|
+
installSkills(moduleTemplateInfo.config.skills, skillsCwd);
|
|
552
|
+
}
|
|
498
553
|
const relPath = path.relative(process.cwd(), modulePath);
|
|
499
554
|
process.stdout.write(`\n✨ Enjoy!\n\ncd ./${relPath}\n`);
|
|
500
555
|
return { ...argv, ...answers };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgpm",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.27.0",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PostgreSQL Package Manager - Database migration and package management CLI",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@inquirerer/utils": "^3.3.7",
|
|
49
|
-
"@pgpmjs/core": "^6.
|
|
49
|
+
"@pgpmjs/core": "^6.23.0",
|
|
50
50
|
"@pgpmjs/env": "^2.25.0",
|
|
51
|
-
"@pgpmjs/export": "^0.21.
|
|
51
|
+
"@pgpmjs/export": "^0.21.2",
|
|
52
52
|
"@pgpmjs/logger": "^2.12.0",
|
|
53
53
|
"@pgpmjs/types": "^2.29.0",
|
|
54
54
|
"@pgsql/quotes": "^17.1.0",
|
|
55
55
|
"appstash": "^0.7.0",
|
|
56
56
|
"find-and-require-package-json": "^0.9.1",
|
|
57
|
-
"genomic": "^5.
|
|
57
|
+
"genomic": "^5.5.0",
|
|
58
58
|
"inquirerer": "^4.8.1",
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
60
|
"pg-cache": "^3.12.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"pg",
|
|
77
77
|
"pgsql"
|
|
78
78
|
],
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "30fdaaacfc61f86b3e466f0c4c3768550fd77a55"
|
|
80
80
|
}
|