@palantir/pack.sdkgen.pack-versioned-template 0.1.0 → 0.3.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/build/browser/index.js +0 -21
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +0 -21
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +0 -5
- package/build/esm/config.js +0 -5
- package/build/esm/hooks/afterGenerate.js +1 -18
- package/build/types/config.d.ts +0 -4
- package/build/types/config.d.ts.map +1 -1
- package/build/types/hooks/afterGenerate.d.ts +0 -1
- package/build/types/hooks/afterGenerate.d.ts.map +1 -1
- package/package.json +5 -5
package/build/browser/index.js
CHANGED
|
@@ -22,10 +22,6 @@ var config = {
|
|
|
22
22
|
name: "author",
|
|
23
23
|
message: "Author:",
|
|
24
24
|
default: ""
|
|
25
|
-
}, {
|
|
26
|
-
type: "number",
|
|
27
|
-
name: "minVersion",
|
|
28
|
-
message: "Minimum supported schema version (leave blank to track latest):"
|
|
29
25
|
}],
|
|
30
26
|
hooks: {
|
|
31
27
|
afterGenerate: "./build/esm/hooks/afterGenerate.js"
|
|
@@ -1122,23 +1118,10 @@ async function syncModelTypesVersion(outputPath, typeGenPackageJsonPath) {
|
|
|
1122
1118
|
consola.log(`Updated model-types dependency to ${modelTypesVersion}`);
|
|
1123
1119
|
}
|
|
1124
1120
|
}
|
|
1125
|
-
function readMinVersion(answers) {
|
|
1126
|
-
const raw = answers?.minVersion;
|
|
1127
|
-
if (raw == null || raw === "") return void 0;
|
|
1128
|
-
if (typeof raw !== "number" && typeof raw !== "string") {
|
|
1129
|
-
throw new Error(`minVersion answer must be a number or numeric string`);
|
|
1130
|
-
}
|
|
1131
|
-
const value = typeof raw === "number" ? raw : Number(raw);
|
|
1132
|
-
if (!Number.isInteger(value)) {
|
|
1133
|
-
throw new Error(`minVersion answer must be an integer, got: ${raw}`);
|
|
1134
|
-
}
|
|
1135
|
-
return value;
|
|
1136
|
-
}
|
|
1137
1121
|
async function afterGenerate(context) {
|
|
1138
1122
|
const {
|
|
1139
1123
|
outputPath,
|
|
1140
1124
|
schemaPath,
|
|
1141
|
-
answers,
|
|
1142
1125
|
options
|
|
1143
1126
|
} = context;
|
|
1144
1127
|
if (options.dryRun) return;
|
|
@@ -1154,12 +1137,8 @@ async function afterGenerate(context) {
|
|
|
1154
1137
|
cli: typeGenCli,
|
|
1155
1138
|
packageJsonPath: typeGenPackageJsonPath
|
|
1156
1139
|
} = resolveTypeGenCli();
|
|
1157
|
-
const minVersion = readMinVersion(answers);
|
|
1158
1140
|
consola.log("Generating versioned SDK files from IR...");
|
|
1159
1141
|
const genArgs = ["ir", "gen-types", "-s", resolvedIr, "-o", path.join(outputPath, "src")];
|
|
1160
|
-
if (minVersion != null) {
|
|
1161
|
-
genArgs.push("--min-version", String(minVersion));
|
|
1162
|
-
}
|
|
1163
1142
|
const genResult = spawnSync(typeGenCli, genArgs, {
|
|
1164
1143
|
stdio: "inherit",
|
|
1165
1144
|
cwd: outputPath
|