@rayul/kordis 0.9.1 → 0.9.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/assets/kordis-using/SKILL.md +1 -0
- package/dist/index.js +30 -8
- package/package.json +1 -1
|
@@ -111,6 +111,7 @@ Supported forms:
|
|
|
111
111
|
| `user/foo@1.0.0-beta.1` | exact prerelease (only matches if the literal exists) |
|
|
112
112
|
| `user/foo@^1.2` | caret — highest 1.x.y (x≥2). For 0.x.y, caret pins the minor |
|
|
113
113
|
| `user/foo@~1.2` | tilde — highest 1.2.y |
|
|
114
|
+
| `user/foo@0.1.x` | x-range — alias for `~0.1` (0.9.3+; semver-native) |
|
|
114
115
|
| `user/foo@*` | alias for `current_version` |
|
|
115
116
|
|
|
116
117
|
Comparator strings (`>=1 <2`, `||`) are NOT supported in 0.9.x —
|
package/dist/index.js
CHANGED
|
@@ -1101,6 +1101,8 @@ var init_client = __esm({
|
|
|
1101
1101
|
if (opts.body !== void 0) init.body = JSON.stringify(opts.body);
|
|
1102
1102
|
const method = (init.method ?? "GET").toUpperCase();
|
|
1103
1103
|
const retryable = method === "GET";
|
|
1104
|
+
const debug = typeof process !== "undefined" && process.env && (process.env["KORDIS_DEBUG"] === "1" || process.env["KORDIS_DEBUG"]?.toLowerCase() === "true");
|
|
1105
|
+
const debugStart = debug ? Date.now() : 0;
|
|
1104
1106
|
let lastErr;
|
|
1105
1107
|
for (let attempt = 0; attempt < (retryable ? 2 : 1); attempt++) {
|
|
1106
1108
|
try {
|
|
@@ -1110,12 +1112,22 @@ var init_client = __esm({
|
|
|
1110
1112
|
} catch (err) {
|
|
1111
1113
|
lastErr = err;
|
|
1112
1114
|
if (attempt === 0 && retryable) {
|
|
1115
|
+
if (debug) {
|
|
1116
|
+
console.error(
|
|
1117
|
+
`[kordis] api: ${method} ${url.pathname}${url.search} \u2192 fetch failed, retrying in 150ms (${err.message})`
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1113
1120
|
await new Promise((resolve2) => setTimeout(resolve2, 150));
|
|
1114
1121
|
continue;
|
|
1115
1122
|
}
|
|
1116
1123
|
}
|
|
1117
1124
|
}
|
|
1118
1125
|
if (lastErr !== void 0) {
|
|
1126
|
+
if (debug) {
|
|
1127
|
+
console.error(
|
|
1128
|
+
`[kordis] api: ${method} ${url.pathname}${url.search} \u2192 ${lastErr.message} (${Date.now() - debugStart}ms)`
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1119
1131
|
throw new KordisNetworkError(
|
|
1120
1132
|
`cannot reach ${url.hostname}: ${lastErr.message}`,
|
|
1121
1133
|
lastErr
|
|
@@ -1123,6 +1135,11 @@ var init_client = __esm({
|
|
|
1123
1135
|
}
|
|
1124
1136
|
res = res;
|
|
1125
1137
|
const requestId = res.headers.get("x-request-id") ?? void 0;
|
|
1138
|
+
if (debug) {
|
|
1139
|
+
console.error(
|
|
1140
|
+
`[kordis] api: ${method} ${url.pathname}${url.search} \u2192 ${res.status} (${Date.now() - debugStart}ms${requestId ? `, req-id=${requestId}` : ""})`
|
|
1141
|
+
);
|
|
1142
|
+
}
|
|
1126
1143
|
if (res.status === 204) return void 0;
|
|
1127
1144
|
const text = await res.text();
|
|
1128
1145
|
const parsed = text ? JSON.parse(text) : void 0;
|
|
@@ -2977,9 +2994,13 @@ function pushCommand() {
|
|
|
2977
2994
|
await bundle.api.getPackage(u, s2);
|
|
2978
2995
|
} catch (err) {
|
|
2979
2996
|
if (err && typeof err === "object" && "code" in err && err.code === "not_found") {
|
|
2980
|
-
throw new
|
|
2981
|
-
|
|
2982
|
-
|
|
2997
|
+
throw new KordisApiError(400, {
|
|
2998
|
+
error: {
|
|
2999
|
+
code: "usage_error",
|
|
3000
|
+
message: `--bump ${explicitBump} cannot apply to a first publish (no existing version to bump from)`,
|
|
3001
|
+
hint: 'First publish derives version from frontmatter `version:` or defaults to "0.1.0". Drop --bump (or set frontmatter version explicitly), then re-run.'
|
|
3002
|
+
}
|
|
3003
|
+
});
|
|
2983
3004
|
}
|
|
2984
3005
|
}
|
|
2985
3006
|
}
|
|
@@ -3852,10 +3873,10 @@ function pullCommand() {
|
|
|
3852
3873
|
).option(
|
|
3853
3874
|
"--no-with-required",
|
|
3854
3875
|
"skip transitive required dependencies (advanced; default is to install)"
|
|
3855
|
-
).action(
|
|
3876
|
+
).option("--pin <semver>", "pin to an exact version or range (overrides @suffix)").action(
|
|
3856
3877
|
async (fullSlugArg, opts) => {
|
|
3857
3878
|
const parsed = parseSlugAtVersion(fullSlugArg);
|
|
3858
|
-
const pin = parsed.version ?? parsed.range;
|
|
3879
|
+
const pin = opts.pin ?? parsed.version ?? parsed.range;
|
|
3859
3880
|
const userCwd = process.env["INIT_CWD"] ?? process.cwd();
|
|
3860
3881
|
const installRoot = opts.target ?? userCwd;
|
|
3861
3882
|
const detected = opts.tool ?? await detectTool(installRoot);
|
|
@@ -3972,13 +3993,14 @@ function readCommand() {
|
|
|
3972
3993
|
async (rawSlug, opts) => {
|
|
3973
3994
|
const parsed = parseSlugAtVersion(rawSlug);
|
|
3974
3995
|
const pin = opts.pin ?? parsed.version ?? parsed.range;
|
|
3996
|
+
const pinIsRange = pin ? /[\^~*]/.test(pin) : false;
|
|
3975
3997
|
const bundle = await useClient();
|
|
3976
3998
|
let resolvedVersion;
|
|
3977
|
-
if (
|
|
3999
|
+
if (pin && pinIsRange) {
|
|
3978
4000
|
const resolved = await bundle.api.resolveVersion(
|
|
3979
4001
|
parsed.username,
|
|
3980
4002
|
parsed.slug,
|
|
3981
|
-
|
|
4003
|
+
pin
|
|
3982
4004
|
);
|
|
3983
4005
|
resolvedVersion = resolved.resolved_version;
|
|
3984
4006
|
}
|
|
@@ -4004,7 +4026,7 @@ function readCommand() {
|
|
|
4004
4026
|
`);
|
|
4005
4027
|
}
|
|
4006
4028
|
}
|
|
4007
|
-
const resolvedNote =
|
|
4029
|
+
const resolvedNote = pinIsRange && resolvedVersion ? ` ${c.gray("(resolved")} ${c.gray("@" + pin)} ${c.gray("\u2192")} ${resolvedVersion}${c.gray(")")}` : "";
|
|
4008
4030
|
process.stderr.write(
|
|
4009
4031
|
`${c.gray("\u2014")} ${c.bold(res.full_slug)}${c.gray("@")}${res.version}${resolvedNote} ${c.gray("\xB7")} ${res.type} (tier ${res.tier}) ${c.gray("\xB7")} ${c.cyan(res.attribution)}
|
|
4010
4032
|
`
|