@pgpmjs/core 4.0.0 → 4.0.1
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.
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { BoilerplateConfig } from 'create-gen-app';
|
|
2
2
|
import type { Inquirerer, Question } from 'inquirerer';
|
|
3
3
|
export interface InspectTemplateOptions {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The boilerplate path to inspect. When omitted, inspects the template
|
|
6
|
+
* repository root and returns the templateDir for scanning available boilerplates.
|
|
7
|
+
*/
|
|
8
|
+
fromPath?: string;
|
|
5
9
|
templateRepo?: string;
|
|
6
10
|
branch?: string;
|
|
7
11
|
cacheTtlMs?: number;
|
|
@@ -31,9 +31,14 @@ function inspectTemplate(options) {
|
|
|
31
31
|
ttlMs: cacheTtlMs,
|
|
32
32
|
cacheBaseDir: resolveCacheBaseDir(cacheBaseDir),
|
|
33
33
|
});
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
34
|
+
// Compute effective fromPath:
|
|
35
|
+
// - If dir is provided, join it with fromPath and bypass .boilerplates.json
|
|
36
|
+
// - If dir is NOT provided, let create-gen-app use .boilerplates.json
|
|
37
|
+
const effectiveFromPath = dir
|
|
38
|
+
? fromPath
|
|
39
|
+
? path_1.default.join(dir, fromPath)
|
|
40
|
+
: dir
|
|
41
|
+
: fromPath;
|
|
37
42
|
const template = templateRepo.startsWith('.') ||
|
|
38
43
|
templateRepo.startsWith('/') ||
|
|
39
44
|
templateRepo.startsWith('~')
|
|
@@ -43,6 +48,8 @@ function inspectTemplate(options) {
|
|
|
43
48
|
template,
|
|
44
49
|
branch,
|
|
45
50
|
fromPath: effectiveFromPath,
|
|
51
|
+
// When dir is specified, bypass .boilerplates.json resolution entirely
|
|
52
|
+
useBoilerplatesConfig: !dir,
|
|
46
53
|
});
|
|
47
54
|
return {
|
|
48
55
|
templateDir: result.templateDir,
|
|
@@ -60,7 +67,7 @@ async function scaffoldTemplate(options) {
|
|
|
60
67
|
ttlMs: cacheTtlMs,
|
|
61
68
|
cacheBaseDir: resolveCacheBaseDir(cacheBaseDir),
|
|
62
69
|
});
|
|
63
|
-
// If dir is provided,
|
|
70
|
+
// If dir is provided, join it with fromPath and bypass .boilerplates.json
|
|
64
71
|
// Otherwise, let create-gen-app resolve via .boilerplates.json
|
|
65
72
|
const effectiveFromPath = dir ? path_1.default.join(dir, fromPath) : fromPath;
|
|
66
73
|
const template = templateRepo.startsWith('.') ||
|
|
@@ -76,6 +83,8 @@ async function scaffoldTemplate(options) {
|
|
|
76
83
|
answers,
|
|
77
84
|
noTty,
|
|
78
85
|
prompter,
|
|
86
|
+
// When dir is specified, bypass .boilerplates.json resolution entirely
|
|
87
|
+
useBoilerplatesConfig: !dir,
|
|
79
88
|
});
|
|
80
89
|
return {
|
|
81
90
|
cacheUsed: result.cacheUsed,
|
|
@@ -23,9 +23,14 @@ export function inspectTemplate(options) {
|
|
|
23
23
|
ttlMs: cacheTtlMs,
|
|
24
24
|
cacheBaseDir: resolveCacheBaseDir(cacheBaseDir),
|
|
25
25
|
});
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
|
|
26
|
+
// Compute effective fromPath:
|
|
27
|
+
// - If dir is provided, join it with fromPath and bypass .boilerplates.json
|
|
28
|
+
// - If dir is NOT provided, let create-gen-app use .boilerplates.json
|
|
29
|
+
const effectiveFromPath = dir
|
|
30
|
+
? fromPath
|
|
31
|
+
? path.join(dir, fromPath)
|
|
32
|
+
: dir
|
|
33
|
+
: fromPath;
|
|
29
34
|
const template = templateRepo.startsWith('.') ||
|
|
30
35
|
templateRepo.startsWith('/') ||
|
|
31
36
|
templateRepo.startsWith('~')
|
|
@@ -35,6 +40,8 @@ export function inspectTemplate(options) {
|
|
|
35
40
|
template,
|
|
36
41
|
branch,
|
|
37
42
|
fromPath: effectiveFromPath,
|
|
43
|
+
// When dir is specified, bypass .boilerplates.json resolution entirely
|
|
44
|
+
useBoilerplatesConfig: !dir,
|
|
38
45
|
});
|
|
39
46
|
return {
|
|
40
47
|
templateDir: result.templateDir,
|
|
@@ -52,7 +59,7 @@ export async function scaffoldTemplate(options) {
|
|
|
52
59
|
ttlMs: cacheTtlMs,
|
|
53
60
|
cacheBaseDir: resolveCacheBaseDir(cacheBaseDir),
|
|
54
61
|
});
|
|
55
|
-
// If dir is provided,
|
|
62
|
+
// If dir is provided, join it with fromPath and bypass .boilerplates.json
|
|
56
63
|
// Otherwise, let create-gen-app resolve via .boilerplates.json
|
|
57
64
|
const effectiveFromPath = dir ? path.join(dir, fromPath) : fromPath;
|
|
58
65
|
const template = templateRepo.startsWith('.') ||
|
|
@@ -68,6 +75,8 @@ export async function scaffoldTemplate(options) {
|
|
|
68
75
|
answers,
|
|
69
76
|
noTty,
|
|
70
77
|
prompter,
|
|
78
|
+
// When dir is specified, bypass .boilerplates.json resolution entirely
|
|
79
|
+
useBoilerplatesConfig: !dir,
|
|
71
80
|
});
|
|
72
81
|
return {
|
|
73
82
|
cacheUsed: result.cacheUsed,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "PGPM Package and Migration Tools",
|
|
6
6
|
"main": "index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@pgpmjs/logger": "^1.3.5",
|
|
53
53
|
"@pgpmjs/server-utils": "^2.8.9",
|
|
54
54
|
"@pgpmjs/types": "^2.12.6",
|
|
55
|
-
"create-gen-app": "^0.
|
|
55
|
+
"create-gen-app": "^0.9.0",
|
|
56
56
|
"csv-to-pg": "^2.0.10",
|
|
57
57
|
"glob": "^13.0.0",
|
|
58
58
|
"komoji": "^0.7.11",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"pgsql-parser": "^17.9.4",
|
|
65
65
|
"yanse": "^0.1.8"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "b4dd6e24bd84d79f3057d8555b850481b7d4e19a"
|
|
68
68
|
}
|