pgpm 5.8.2 → 5.8.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pgpm",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.3",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PostgreSQL Package Manager - Database migration and package management CLI",
|
|
6
6
|
"main": "index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@inquirerer/utils": "^3.3.9",
|
|
49
49
|
"@pgpmjs/core": "^7.9.1",
|
|
50
50
|
"@pgpmjs/env": "^2.33.0",
|
|
51
|
-
"@pgpmjs/export": "^1.8.
|
|
51
|
+
"@pgpmjs/export": "^1.8.4",
|
|
52
52
|
"@pgpmjs/logger": "^2.18.0",
|
|
53
53
|
"@pgpmjs/slice": "^0.5.0",
|
|
54
54
|
"@pgpmjs/types": "^2.40.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"pg",
|
|
78
78
|
"pgsql"
|
|
79
79
|
],
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "31f7cd3d3cc28cf069056eae5b2a0d4198d154a1"
|
|
81
81
|
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.default = runWorkspaceSetup;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const core_1 = require("@pgpmjs/core");
|
|
10
|
-
const inquirerer_1 = require("inquirerer");
|
|
11
|
-
const utils_1 = require("../../utils");
|
|
12
|
-
const DEFAULT_MOTD = `
|
|
13
|
-
| _ _
|
|
14
|
-
=== |.===. '\\-//\`
|
|
15
|
-
(o o) {}o o{} (o o)
|
|
16
|
-
ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-
|
|
17
|
-
`;
|
|
18
|
-
async function runWorkspaceSetup(argv, prompter) {
|
|
19
|
-
const workspaceQuestions = [
|
|
20
|
-
{
|
|
21
|
-
name: 'name',
|
|
22
|
-
message: 'Enter workspace name',
|
|
23
|
-
required: true,
|
|
24
|
-
type: 'text'
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
const answers = await prompter.prompt(argv, workspaceQuestions);
|
|
28
|
-
const { cwd = process.cwd() } = argv;
|
|
29
|
-
const targetPath = path_1.default.join(cwd, (0, core_1.sluggify)(answers.name));
|
|
30
|
-
// Prevent double-echoed keystrokes by closing our prompter before template prompts.
|
|
31
|
-
prompter.close();
|
|
32
|
-
const templateRepo = argv.repo ?? core_1.DEFAULT_TEMPLATE_REPO;
|
|
33
|
-
// Don't set default template - let scaffoldTemplate use metadata-driven resolution
|
|
34
|
-
const template = (argv.template);
|
|
35
|
-
// Register workspace.dirname resolver so boilerplate templates can use it via defaultFrom/setFrom
|
|
36
|
-
// This provides the intended workspace directory name before the folder is created
|
|
37
|
-
const dirName = path_1.default.basename(targetPath);
|
|
38
|
-
(0, inquirerer_1.registerDefaultResolver)('workspace.dirname', () => dirName);
|
|
39
|
-
const dir = argv.dir;
|
|
40
|
-
await (0, core_1.scaffoldTemplate)({
|
|
41
|
-
fromPath: template ?? 'workspace',
|
|
42
|
-
outputDir: targetPath,
|
|
43
|
-
templateRepo,
|
|
44
|
-
branch: argv.fromBranch,
|
|
45
|
-
dir,
|
|
46
|
-
answers: {
|
|
47
|
-
...argv,
|
|
48
|
-
...answers,
|
|
49
|
-
workspaceName: answers.name
|
|
50
|
-
},
|
|
51
|
-
toolName: core_1.DEFAULT_TEMPLATE_TOOL_NAME,
|
|
52
|
-
noTty: (0, utils_1.isNoTtyRequested)(argv),
|
|
53
|
-
cwd,
|
|
54
|
-
prompter
|
|
55
|
-
});
|
|
56
|
-
// Check for .motd file and print it, or use default ASCII art
|
|
57
|
-
const motdPath = path_1.default.join(targetPath, '.motd');
|
|
58
|
-
let motd = DEFAULT_MOTD;
|
|
59
|
-
if (fs_1.default.existsSync(motdPath)) {
|
|
60
|
-
try {
|
|
61
|
-
motd = fs_1.default.readFileSync(motdPath, 'utf8');
|
|
62
|
-
fs_1.default.unlinkSync(motdPath);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
// Ignore errors reading/deleting .motd
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
process.stdout.write(motd);
|
|
69
|
-
if (!motd.endsWith('\n')) {
|
|
70
|
-
process.stdout.write('\n');
|
|
71
|
-
}
|
|
72
|
-
const relPath = path_1.default.relative(process.cwd(), targetPath);
|
|
73
|
-
process.stdout.write(`\n✨ Enjoy!\n\ncd ./${relPath}\n`);
|
|
74
|
-
return { ...argv, ...answers, cwd: targetPath };
|
|
75
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { DEFAULT_TEMPLATE_REPO, DEFAULT_TEMPLATE_TOOL_NAME, scaffoldTemplate, sluggify } from '@pgpmjs/core';
|
|
4
|
-
import { registerDefaultResolver } from 'inquirerer';
|
|
5
|
-
import { isNoTtyRequested } from '../../utils';
|
|
6
|
-
const DEFAULT_MOTD = `
|
|
7
|
-
| _ _
|
|
8
|
-
=== |.===. '\\-//\`
|
|
9
|
-
(o o) {}o o{} (o o)
|
|
10
|
-
ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-
|
|
11
|
-
`;
|
|
12
|
-
export default async function runWorkspaceSetup(argv, prompter) {
|
|
13
|
-
const workspaceQuestions = [
|
|
14
|
-
{
|
|
15
|
-
name: 'name',
|
|
16
|
-
message: 'Enter workspace name',
|
|
17
|
-
required: true,
|
|
18
|
-
type: 'text'
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
const answers = await prompter.prompt(argv, workspaceQuestions);
|
|
22
|
-
const { cwd = process.cwd() } = argv;
|
|
23
|
-
const targetPath = path.join(cwd, sluggify(answers.name));
|
|
24
|
-
// Prevent double-echoed keystrokes by closing our prompter before template prompts.
|
|
25
|
-
prompter.close();
|
|
26
|
-
const templateRepo = argv.repo ?? DEFAULT_TEMPLATE_REPO;
|
|
27
|
-
// Don't set default template - let scaffoldTemplate use metadata-driven resolution
|
|
28
|
-
const template = (argv.template);
|
|
29
|
-
// Register workspace.dirname resolver so boilerplate templates can use it via defaultFrom/setFrom
|
|
30
|
-
// This provides the intended workspace directory name before the folder is created
|
|
31
|
-
const dirName = path.basename(targetPath);
|
|
32
|
-
registerDefaultResolver('workspace.dirname', () => dirName);
|
|
33
|
-
const dir = argv.dir;
|
|
34
|
-
await scaffoldTemplate({
|
|
35
|
-
fromPath: template ?? 'workspace',
|
|
36
|
-
outputDir: targetPath,
|
|
37
|
-
templateRepo,
|
|
38
|
-
branch: argv.fromBranch,
|
|
39
|
-
dir,
|
|
40
|
-
answers: {
|
|
41
|
-
...argv,
|
|
42
|
-
...answers,
|
|
43
|
-
workspaceName: answers.name
|
|
44
|
-
},
|
|
45
|
-
toolName: DEFAULT_TEMPLATE_TOOL_NAME,
|
|
46
|
-
noTty: isNoTtyRequested(argv),
|
|
47
|
-
cwd,
|
|
48
|
-
prompter
|
|
49
|
-
});
|
|
50
|
-
// Check for .motd file and print it, or use default ASCII art
|
|
51
|
-
const motdPath = path.join(targetPath, '.motd');
|
|
52
|
-
let motd = DEFAULT_MOTD;
|
|
53
|
-
if (fs.existsSync(motdPath)) {
|
|
54
|
-
try {
|
|
55
|
-
motd = fs.readFileSync(motdPath, 'utf8');
|
|
56
|
-
fs.unlinkSync(motdPath);
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
// Ignore errors reading/deleting .motd
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
process.stdout.write(motd);
|
|
63
|
-
if (!motd.endsWith('\n')) {
|
|
64
|
-
process.stdout.write('\n');
|
|
65
|
-
}
|
|
66
|
-
const relPath = path.relative(process.cwd(), targetPath);
|
|
67
|
-
process.stdout.write(`\n✨ Enjoy!\n\ncd ./${relPath}\n`);
|
|
68
|
-
return { ...argv, ...answers, cwd: targetPath };
|
|
69
|
-
}
|