@pgpmjs/core 3.0.6 → 3.0.8
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.
|
@@ -17,22 +17,6 @@ const templatizer = new create_gen_app_1.Templatizer();
|
|
|
17
17
|
const looksLikePath = (value) => {
|
|
18
18
|
return (value.startsWith('.') || value.startsWith('/') || value.startsWith('~'));
|
|
19
19
|
};
|
|
20
|
-
const normalizeQuestions = (questions) => questions?.map((q) => ({
|
|
21
|
-
...q,
|
|
22
|
-
type: q.type || 'text',
|
|
23
|
-
}));
|
|
24
|
-
const attachQuestionsToTemplatizer = (templ, questions) => {
|
|
25
|
-
if (!questions?.length || typeof templ?.extract !== 'function')
|
|
26
|
-
return;
|
|
27
|
-
const originalExtract = templ.extract.bind(templ);
|
|
28
|
-
templ.extract = async (templateDir) => {
|
|
29
|
-
const extracted = await originalExtract(templateDir);
|
|
30
|
-
extracted.projectQuestions = {
|
|
31
|
-
questions: normalizeQuestions(questions),
|
|
32
|
-
};
|
|
33
|
-
return extracted;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
20
|
/**
|
|
37
21
|
* Resolve the template path using the new metadata-driven resolution.
|
|
38
22
|
*
|
|
@@ -98,10 +82,8 @@ async function scaffoldTemplate(options) {
|
|
|
98
82
|
fs_1.default.existsSync(resolvedRepo) &&
|
|
99
83
|
fs_1.default.statSync(resolvedRepo).isDirectory()) {
|
|
100
84
|
const { fromPath, resolvedTemplatePath } = resolveFromPath(resolvedRepo, templatePath, type, dir);
|
|
101
|
-
// Read boilerplate config for questions
|
|
85
|
+
// Read boilerplate config for questions (create-gen-app now handles .boilerplate.json natively)
|
|
102
86
|
const boilerplateConfig = (0, boilerplate_scanner_1.readBoilerplateConfig)(resolvedTemplatePath);
|
|
103
|
-
// Inject questions into the templatizer pipeline so prompt types and defaults are applied
|
|
104
|
-
attachQuestionsToTemplatizer(templatizer, boilerplateConfig?.questions);
|
|
105
87
|
await templatizer.process(resolvedRepo, outputDir, {
|
|
106
88
|
argv: answers,
|
|
107
89
|
noTty,
|
|
@@ -149,10 +131,8 @@ async function scaffoldTemplate(options) {
|
|
|
149
131
|
templateDir = tempDest;
|
|
150
132
|
}
|
|
151
133
|
const { fromPath, resolvedTemplatePath } = resolveFromPath(templateDir, templatePath, type, dir);
|
|
152
|
-
// Read boilerplate config for questions
|
|
134
|
+
// Read boilerplate config for questions (create-gen-app now handles .boilerplate.json natively)
|
|
153
135
|
const boilerplateConfig = (0, boilerplate_scanner_1.readBoilerplateConfig)(resolvedTemplatePath);
|
|
154
|
-
// Inject questions into the templatizer pipeline so prompt types and defaults are applied
|
|
155
|
-
attachQuestionsToTemplatizer(templatizer, boilerplateConfig?.questions);
|
|
156
136
|
await templatizer.process(templateDir, outputDir, {
|
|
157
137
|
argv: answers,
|
|
158
138
|
noTty,
|
|
@@ -10,22 +10,6 @@ const templatizer = new Templatizer();
|
|
|
10
10
|
const looksLikePath = (value) => {
|
|
11
11
|
return (value.startsWith('.') || value.startsWith('/') || value.startsWith('~'));
|
|
12
12
|
};
|
|
13
|
-
const normalizeQuestions = (questions) => questions?.map((q) => ({
|
|
14
|
-
...q,
|
|
15
|
-
type: q.type || 'text',
|
|
16
|
-
}));
|
|
17
|
-
const attachQuestionsToTemplatizer = (templ, questions) => {
|
|
18
|
-
if (!questions?.length || typeof templ?.extract !== 'function')
|
|
19
|
-
return;
|
|
20
|
-
const originalExtract = templ.extract.bind(templ);
|
|
21
|
-
templ.extract = async (templateDir) => {
|
|
22
|
-
const extracted = await originalExtract(templateDir);
|
|
23
|
-
extracted.projectQuestions = {
|
|
24
|
-
questions: normalizeQuestions(questions),
|
|
25
|
-
};
|
|
26
|
-
return extracted;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
13
|
/**
|
|
30
14
|
* Resolve the template path using the new metadata-driven resolution.
|
|
31
15
|
*
|
|
@@ -91,10 +75,8 @@ export async function scaffoldTemplate(options) {
|
|
|
91
75
|
fs.existsSync(resolvedRepo) &&
|
|
92
76
|
fs.statSync(resolvedRepo).isDirectory()) {
|
|
93
77
|
const { fromPath, resolvedTemplatePath } = resolveFromPath(resolvedRepo, templatePath, type, dir);
|
|
94
|
-
// Read boilerplate config for questions
|
|
78
|
+
// Read boilerplate config for questions (create-gen-app now handles .boilerplate.json natively)
|
|
95
79
|
const boilerplateConfig = readBoilerplateConfig(resolvedTemplatePath);
|
|
96
|
-
// Inject questions into the templatizer pipeline so prompt types and defaults are applied
|
|
97
|
-
attachQuestionsToTemplatizer(templatizer, boilerplateConfig?.questions);
|
|
98
80
|
await templatizer.process(resolvedRepo, outputDir, {
|
|
99
81
|
argv: answers,
|
|
100
82
|
noTty,
|
|
@@ -142,10 +124,8 @@ export async function scaffoldTemplate(options) {
|
|
|
142
124
|
templateDir = tempDest;
|
|
143
125
|
}
|
|
144
126
|
const { fromPath, resolvedTemplatePath } = resolveFromPath(templateDir, templatePath, type, dir);
|
|
145
|
-
// Read boilerplate config for questions
|
|
127
|
+
// Read boilerplate config for questions (create-gen-app now handles .boilerplate.json natively)
|
|
146
128
|
const boilerplateConfig = readBoilerplateConfig(resolvedTemplatePath);
|
|
147
|
-
// Inject questions into the templatizer pipeline so prompt types and defaults are applied
|
|
148
|
-
attachQuestionsToTemplatizer(templatizer, boilerplateConfig?.questions);
|
|
149
129
|
await templatizer.process(templateDir, outputDir, {
|
|
150
130
|
argv: answers,
|
|
151
131
|
noTty,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PGPM Package and Migration Tools",
|
|
6
6
|
"main": "index.js",
|
|
@@ -41,30 +41,27 @@
|
|
|
41
41
|
"sqitch"
|
|
42
42
|
],
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@pgsql/types": "^17.6.2",
|
|
44
45
|
"@types/pg": "^8.16.0",
|
|
45
46
|
"copyfiles": "^2.4.1",
|
|
46
|
-
"makage": "^0.1.
|
|
47
|
+
"makage": "^0.1.9"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@pgpmjs/env": "^2.8.
|
|
50
|
-
"@pgpmjs/logger": "^1.3.
|
|
51
|
-
"@pgpmjs/server-utils": "^2.8.
|
|
52
|
-
"@pgpmjs/types": "^2.12.
|
|
53
|
-
"
|
|
54
|
-
"create-gen-app": "^0.3.6",
|
|
50
|
+
"@pgpmjs/env": "^2.8.5",
|
|
51
|
+
"@pgpmjs/logger": "^1.3.5",
|
|
52
|
+
"@pgpmjs/server-utils": "^2.8.7",
|
|
53
|
+
"@pgpmjs/types": "^2.12.5",
|
|
54
|
+
"create-gen-app": "^0.5.0",
|
|
55
55
|
"csv-to-pg": "^2.0.10",
|
|
56
56
|
"glob": "^13.0.0",
|
|
57
57
|
"komoji": "^0.7.11",
|
|
58
58
|
"parse-package-name": "^1.0.0",
|
|
59
59
|
"pg": "^8.16.3",
|
|
60
|
-
"pg-cache": "^1.6.
|
|
61
|
-
"pg-env": "^1.2.
|
|
60
|
+
"pg-cache": "^1.6.7",
|
|
61
|
+
"pg-env": "^1.2.4",
|
|
62
62
|
"pgsql-deparser": "^17.12.2",
|
|
63
63
|
"pgsql-parser": "^17.9.2",
|
|
64
64
|
"yanse": "^0.1.8"
|
|
65
65
|
},
|
|
66
|
-
"
|
|
67
|
-
"@pgsql/types": "^17.6.1"
|
|
68
|
-
},
|
|
69
|
-
"gitHead": "22cfe32e994e26a6490e04e28bab26d1e7e6345c"
|
|
66
|
+
"gitHead": "53a949da2ca3b929c7124b71c8a728f547f1e927"
|
|
70
67
|
}
|