@absolutejs/absolute 0.19.0-beta.1014 → 0.19.0-beta.1015
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/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/cli/config/client.js +57 -11
- package/dist/cli/config/server.js +1722 -1430
- package/dist/index.js +20 -3
- package/dist/index.js.map +3 -3
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +4 -4
- package/dist/src/cli/config/packageJson/resolvePackageJson.d.ts +2 -3
- package/dist/src/cli/config/page/ConfigShell.d.ts +1 -11
- package/dist/src/cli/config/page/FieldEditor.d.ts +9 -0
- package/dist/src/cli/config/page/PanelHost.d.ts +6 -0
- package/dist/src/cli/config/page/configStyles.d.ts +1 -1
- package/dist/src/cli/config/schema/fromJsonSchema.d.ts +3 -0
- package/dist/src/cli/config/schema/fromType.d.ts +2 -0
- package/dist/src/cli/config/schema/serialize.d.ts +1 -0
- package/dist/src/cli/config/server.d.ts +3 -4
- package/dist/src/core/prepare.d.ts +52 -2
- package/dist/types/absoluteConfig.d.ts +6 -5
- package/dist/types/config.d.ts +36 -9
- package/dist/types/packageJsonPanel.d.ts +4 -6
- package/package.json +2 -2
- package/dist/src/cli/config/introspectType.d.ts +0 -2
|
@@ -22014,9 +22014,451 @@ import { Elysia as Elysia2 } from "elysia";
|
|
|
22014
22014
|
import { existsSync as existsSync10, readFileSync as readFileSync14 } from "fs";
|
|
22015
22015
|
import { resolve as resolve9 } from "path";
|
|
22016
22016
|
|
|
22017
|
+
// src/cli/config/page/PanelHost.tsx
|
|
22018
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
22019
|
+
|
|
22017
22020
|
// src/cli/config/eslint/EslintPanel.tsx
|
|
22021
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
22022
|
+
|
|
22023
|
+
// src/cli/config/page/FieldEditor.tsx
|
|
22018
22024
|
var import_react = __toESM(require_react(), 1);
|
|
22025
|
+
|
|
22026
|
+
// src/cli/config/guards.ts
|
|
22027
|
+
var getRecord = (value, key) => {
|
|
22028
|
+
if (!isRecord(value))
|
|
22029
|
+
return null;
|
|
22030
|
+
const found = value[key];
|
|
22031
|
+
return isRecord(found) ? found : null;
|
|
22032
|
+
};
|
|
22033
|
+
var getString = (value, key) => {
|
|
22034
|
+
if (!isRecord(value))
|
|
22035
|
+
return null;
|
|
22036
|
+
const found = value[key];
|
|
22037
|
+
return typeof found === "string" ? found : null;
|
|
22038
|
+
};
|
|
22039
|
+
var isMap = (value) => value instanceof Map;
|
|
22040
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22041
|
+
|
|
22042
|
+
// src/cli/config/page/FieldEditor.tsx
|
|
22019
22043
|
var jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
|
|
22044
|
+
var emptyValue = (schema) => {
|
|
22045
|
+
switch (schema.kind) {
|
|
22046
|
+
case "string":
|
|
22047
|
+
return "";
|
|
22048
|
+
case "number":
|
|
22049
|
+
return 0;
|
|
22050
|
+
case "boolean":
|
|
22051
|
+
return false;
|
|
22052
|
+
case "enum":
|
|
22053
|
+
return schema.choices[0] ?? "";
|
|
22054
|
+
case "array":
|
|
22055
|
+
return [];
|
|
22056
|
+
case "tuple":
|
|
22057
|
+
return schema.items.map(emptyValue);
|
|
22058
|
+
case "record":
|
|
22059
|
+
return {};
|
|
22060
|
+
case "object":
|
|
22061
|
+
return {};
|
|
22062
|
+
case "union":
|
|
22063
|
+
return schema.variants[0] ? emptyValue(schema.variants[0]) : null;
|
|
22064
|
+
default:
|
|
22065
|
+
return null;
|
|
22066
|
+
}
|
|
22067
|
+
};
|
|
22068
|
+
var StringField = ({ onChange, value }) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("input", {
|
|
22069
|
+
className: "ts-input",
|
|
22070
|
+
onChange: (event) => onChange(event.target.value),
|
|
22071
|
+
spellCheck: false,
|
|
22072
|
+
value: typeof value === "string" ? value : ""
|
|
22073
|
+
}, undefined, false, undefined, this);
|
|
22074
|
+
var NumberField = ({ onChange, value }) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("input", {
|
|
22075
|
+
className: "ts-input",
|
|
22076
|
+
onChange: (event) => onChange(event.target.value === "" ? "" : Number(event.target.value)),
|
|
22077
|
+
type: "number",
|
|
22078
|
+
value: typeof value === "number" ? value : ""
|
|
22079
|
+
}, undefined, false, undefined, this);
|
|
22080
|
+
var BooleanField = ({ onChange, value }) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22081
|
+
className: "seg",
|
|
22082
|
+
children: [
|
|
22083
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22084
|
+
"data-on": value === false,
|
|
22085
|
+
onClick: () => onChange(false),
|
|
22086
|
+
type: "button",
|
|
22087
|
+
children: "false"
|
|
22088
|
+
}, undefined, false, undefined, this),
|
|
22089
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22090
|
+
"data-on": value === true,
|
|
22091
|
+
onClick: () => onChange(true),
|
|
22092
|
+
type: "button",
|
|
22093
|
+
children: "true"
|
|
22094
|
+
}, undefined, false, undefined, this)
|
|
22095
|
+
]
|
|
22096
|
+
}, undefined, true, undefined, this);
|
|
22097
|
+
var EnumField = ({ onChange, schema, value }) => {
|
|
22098
|
+
if (schema.kind !== "enum")
|
|
22099
|
+
return null;
|
|
22100
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("select", {
|
|
22101
|
+
className: "ts-select",
|
|
22102
|
+
onChange: (event) => {
|
|
22103
|
+
const next = schema.choices.find((choice) => String(choice) === event.target.value);
|
|
22104
|
+
onChange(next ?? event.target.value);
|
|
22105
|
+
},
|
|
22106
|
+
value: String(value ?? ""),
|
|
22107
|
+
children: schema.choices.map((choice) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("option", {
|
|
22108
|
+
value: String(choice),
|
|
22109
|
+
children: String(choice)
|
|
22110
|
+
}, String(choice), false, undefined, this))
|
|
22111
|
+
}, undefined, false, undefined, this);
|
|
22112
|
+
};
|
|
22113
|
+
var RawField = ({ onChange, schema, value }) => {
|
|
22114
|
+
const [draft, setDraft] = import_react.useState(value === undefined ? "" : JSON.stringify(value, null, 2));
|
|
22115
|
+
const [error, setError] = import_react.useState(null);
|
|
22116
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22117
|
+
className: "fe-raw",
|
|
22118
|
+
children: [
|
|
22119
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("textarea", {
|
|
22120
|
+
className: error ? "opts-input err" : "opts-input",
|
|
22121
|
+
onChange: (event) => {
|
|
22122
|
+
setDraft(event.target.value);
|
|
22123
|
+
try {
|
|
22124
|
+
onChange(event.target.value === "" ? undefined : JSON.parse(event.target.value));
|
|
22125
|
+
setError(null);
|
|
22126
|
+
} catch (parseError) {
|
|
22127
|
+
setError(String(parseError));
|
|
22128
|
+
}
|
|
22129
|
+
},
|
|
22130
|
+
rows: 4,
|
|
22131
|
+
spellCheck: false,
|
|
22132
|
+
value: draft
|
|
22133
|
+
}, undefined, false, undefined, this),
|
|
22134
|
+
schema.kind === "opaque" && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22135
|
+
className: "fe-type",
|
|
22136
|
+
children: schema.typeText
|
|
22137
|
+
}, undefined, false, undefined, this),
|
|
22138
|
+
error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22139
|
+
className: "ts-err",
|
|
22140
|
+
children: error
|
|
22141
|
+
}, undefined, false, undefined, this)
|
|
22142
|
+
]
|
|
22143
|
+
}, undefined, true, undefined, this);
|
|
22144
|
+
};
|
|
22145
|
+
var ArrayField = ({ onChange, schema, value }) => {
|
|
22146
|
+
if (schema.kind !== "array")
|
|
22147
|
+
return null;
|
|
22148
|
+
const items = Array.isArray(value) ? value : [];
|
|
22149
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22150
|
+
className: "fe-array",
|
|
22151
|
+
children: [
|
|
22152
|
+
items.map((item, index) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22153
|
+
className: "fe-item",
|
|
22154
|
+
children: [
|
|
22155
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(FieldEditor, {
|
|
22156
|
+
onChange: (next) => onChange(items.map((existing, i) => i === index ? next : existing)),
|
|
22157
|
+
schema: schema.item,
|
|
22158
|
+
value: item
|
|
22159
|
+
}, undefined, false, undefined, this),
|
|
22160
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22161
|
+
className: "fe-remove",
|
|
22162
|
+
onClick: () => onChange(items.filter((_, i) => i !== index)),
|
|
22163
|
+
type: "button",
|
|
22164
|
+
children: "\xD7"
|
|
22165
|
+
}, undefined, false, undefined, this)
|
|
22166
|
+
]
|
|
22167
|
+
}, index, true, undefined, this)),
|
|
22168
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22169
|
+
className: "fe-add",
|
|
22170
|
+
onClick: () => onChange([...items, emptyValue(schema.item)]),
|
|
22171
|
+
type: "button",
|
|
22172
|
+
children: "+ add"
|
|
22173
|
+
}, undefined, false, undefined, this)
|
|
22174
|
+
]
|
|
22175
|
+
}, undefined, true, undefined, this);
|
|
22176
|
+
};
|
|
22177
|
+
var TupleField = ({ onChange, schema, value }) => {
|
|
22178
|
+
if (schema.kind !== "tuple")
|
|
22179
|
+
return null;
|
|
22180
|
+
const items = Array.isArray(value) ? value : [];
|
|
22181
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22182
|
+
className: "fe-array",
|
|
22183
|
+
children: schema.items.map((itemSchema, index) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22184
|
+
className: "fe-item",
|
|
22185
|
+
children: /* @__PURE__ */ jsx_dev_runtime.jsxDEV(FieldEditor, {
|
|
22186
|
+
onChange: (next) => onChange(schema.items.map((_, i) => i === index ? next : items[i])),
|
|
22187
|
+
schema: itemSchema,
|
|
22188
|
+
value: items[index]
|
|
22189
|
+
}, undefined, false, undefined, this)
|
|
22190
|
+
}, index, false, undefined, this))
|
|
22191
|
+
}, undefined, false, undefined, this);
|
|
22192
|
+
};
|
|
22193
|
+
var RecordField = ({ onChange, schema, value }) => {
|
|
22194
|
+
if (schema.kind !== "record")
|
|
22195
|
+
return null;
|
|
22196
|
+
const entries = isRecord(value) ? Object.entries(value) : [];
|
|
22197
|
+
const rename = (from, to) => {
|
|
22198
|
+
const next = {};
|
|
22199
|
+
for (const [key, val] of entries)
|
|
22200
|
+
next[key === from ? to : key] = val;
|
|
22201
|
+
onChange(next);
|
|
22202
|
+
};
|
|
22203
|
+
const setValue = (key, val) => onChange(Object.fromEntries(entries.map((e) => e[0] === key ? [key, val] : e)));
|
|
22204
|
+
const remove = (key) => onChange(Object.fromEntries(entries.filter((e) => e[0] !== key)));
|
|
22205
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22206
|
+
className: "fe-record",
|
|
22207
|
+
children: [
|
|
22208
|
+
entries.map(([key, val]) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22209
|
+
className: "fe-entry",
|
|
22210
|
+
children: [
|
|
22211
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("input", {
|
|
22212
|
+
className: "ts-input fe-key",
|
|
22213
|
+
onChange: (event) => rename(key, event.target.value),
|
|
22214
|
+
spellCheck: false,
|
|
22215
|
+
value: key
|
|
22216
|
+
}, undefined, false, undefined, this),
|
|
22217
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV(FieldEditor, {
|
|
22218
|
+
onChange: (next) => setValue(key, next),
|
|
22219
|
+
schema: schema.value,
|
|
22220
|
+
value: val
|
|
22221
|
+
}, undefined, false, undefined, this),
|
|
22222
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22223
|
+
className: "fe-remove",
|
|
22224
|
+
onClick: () => remove(key),
|
|
22225
|
+
type: "button",
|
|
22226
|
+
children: "\xD7"
|
|
22227
|
+
}, undefined, false, undefined, this)
|
|
22228
|
+
]
|
|
22229
|
+
}, key, true, undefined, this)),
|
|
22230
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22231
|
+
className: "fe-add",
|
|
22232
|
+
onClick: () => onChange({
|
|
22233
|
+
...Object.fromEntries(entries),
|
|
22234
|
+
"": emptyValue(schema.value)
|
|
22235
|
+
}),
|
|
22236
|
+
type: "button",
|
|
22237
|
+
children: "+ add key"
|
|
22238
|
+
}, undefined, false, undefined, this)
|
|
22239
|
+
]
|
|
22240
|
+
}, undefined, true, undefined, this);
|
|
22241
|
+
};
|
|
22242
|
+
var ObjectField = ({ onChange, schema, value }) => {
|
|
22243
|
+
if (schema.kind !== "object")
|
|
22244
|
+
return null;
|
|
22245
|
+
const current = isRecord(value) ? value : {};
|
|
22246
|
+
const setField = (name, next) => {
|
|
22247
|
+
if (next === undefined) {
|
|
22248
|
+
const rest = { ...current };
|
|
22249
|
+
delete rest[name];
|
|
22250
|
+
onChange(rest);
|
|
22251
|
+
return;
|
|
22252
|
+
}
|
|
22253
|
+
onChange({ ...current, [name]: next });
|
|
22254
|
+
};
|
|
22255
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22256
|
+
className: "fe-object",
|
|
22257
|
+
children: schema.fields.map((field) => {
|
|
22258
|
+
const present = Object.prototype.hasOwnProperty.call(current, field.name);
|
|
22259
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22260
|
+
className: "fe-field",
|
|
22261
|
+
children: [
|
|
22262
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22263
|
+
className: "fe-label",
|
|
22264
|
+
children: [
|
|
22265
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("span", {
|
|
22266
|
+
className: "fe-name",
|
|
22267
|
+
children: field.name
|
|
22268
|
+
}, undefined, false, undefined, this),
|
|
22269
|
+
field.optional && present && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22270
|
+
className: "fe-remove",
|
|
22271
|
+
onClick: () => setField(field.name, undefined),
|
|
22272
|
+
type: "button",
|
|
22273
|
+
children: "unset"
|
|
22274
|
+
}, undefined, false, undefined, this)
|
|
22275
|
+
]
|
|
22276
|
+
}, undefined, true, undefined, this),
|
|
22277
|
+
field.optional && !present ? /* @__PURE__ */ jsx_dev_runtime.jsxDEV("button", {
|
|
22278
|
+
className: "fe-add",
|
|
22279
|
+
onClick: () => setField(field.name, emptyValue(field.schema)),
|
|
22280
|
+
type: "button",
|
|
22281
|
+
children: [
|
|
22282
|
+
"+ set ",
|
|
22283
|
+
field.name
|
|
22284
|
+
]
|
|
22285
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime.jsxDEV(FieldEditor, {
|
|
22286
|
+
onChange: (next) => setField(field.name, next),
|
|
22287
|
+
schema: field.schema,
|
|
22288
|
+
value: current[field.name]
|
|
22289
|
+
}, undefined, false, undefined, this)
|
|
22290
|
+
]
|
|
22291
|
+
}, field.name, true, undefined, this);
|
|
22292
|
+
})
|
|
22293
|
+
}, undefined, false, undefined, this);
|
|
22294
|
+
};
|
|
22295
|
+
var UnionField = ({ onChange, schema, value }) => {
|
|
22296
|
+
if (schema.kind !== "union")
|
|
22297
|
+
return null;
|
|
22298
|
+
const matches = (variant) => {
|
|
22299
|
+
if (variant.kind === "string" || variant.kind === "enum")
|
|
22300
|
+
return typeof value === "string";
|
|
22301
|
+
if (variant.kind === "number")
|
|
22302
|
+
return typeof value === "number";
|
|
22303
|
+
if (variant.kind === "boolean")
|
|
22304
|
+
return typeof value === "boolean";
|
|
22305
|
+
if (variant.kind === "array")
|
|
22306
|
+
return Array.isArray(value);
|
|
22307
|
+
if (variant.kind === "object" || variant.kind === "record")
|
|
22308
|
+
return isRecord(value);
|
|
22309
|
+
return false;
|
|
22310
|
+
};
|
|
22311
|
+
const activeIndex = Math.max(0, schema.variants.findIndex(matches));
|
|
22312
|
+
const active = schema.variants[activeIndex];
|
|
22313
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22314
|
+
className: "fe-union",
|
|
22315
|
+
children: [
|
|
22316
|
+
/* @__PURE__ */ jsx_dev_runtime.jsxDEV("select", {
|
|
22317
|
+
className: "ts-select",
|
|
22318
|
+
onChange: (event) => {
|
|
22319
|
+
const variant = schema.variants[Number(event.target.value)];
|
|
22320
|
+
if (variant)
|
|
22321
|
+
onChange(emptyValue(variant));
|
|
22322
|
+
},
|
|
22323
|
+
value: String(activeIndex),
|
|
22324
|
+
children: schema.variants.map((variant, index) => /* @__PURE__ */ jsx_dev_runtime.jsxDEV("option", {
|
|
22325
|
+
value: String(index),
|
|
22326
|
+
children: variant.kind
|
|
22327
|
+
}, index, false, undefined, this))
|
|
22328
|
+
}, undefined, false, undefined, this),
|
|
22329
|
+
active && /* @__PURE__ */ jsx_dev_runtime.jsxDEV(FieldEditor, {
|
|
22330
|
+
onChange,
|
|
22331
|
+
schema: active,
|
|
22332
|
+
value
|
|
22333
|
+
}, undefined, false, undefined, this)
|
|
22334
|
+
]
|
|
22335
|
+
}, undefined, true, undefined, this);
|
|
22336
|
+
};
|
|
22337
|
+
var FieldEditor = (props) => {
|
|
22338
|
+
switch (props.schema.kind) {
|
|
22339
|
+
case "string":
|
|
22340
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(StringField, {
|
|
22341
|
+
...props
|
|
22342
|
+
}, undefined, false, undefined, this);
|
|
22343
|
+
case "number":
|
|
22344
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(NumberField, {
|
|
22345
|
+
...props
|
|
22346
|
+
}, undefined, false, undefined, this);
|
|
22347
|
+
case "boolean":
|
|
22348
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(BooleanField, {
|
|
22349
|
+
...props
|
|
22350
|
+
}, undefined, false, undefined, this);
|
|
22351
|
+
case "enum":
|
|
22352
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(EnumField, {
|
|
22353
|
+
...props
|
|
22354
|
+
}, undefined, false, undefined, this);
|
|
22355
|
+
case "array":
|
|
22356
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ArrayField, {
|
|
22357
|
+
...props
|
|
22358
|
+
}, undefined, false, undefined, this);
|
|
22359
|
+
case "tuple":
|
|
22360
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(TupleField, {
|
|
22361
|
+
...props
|
|
22362
|
+
}, undefined, false, undefined, this);
|
|
22363
|
+
case "record":
|
|
22364
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RecordField, {
|
|
22365
|
+
...props
|
|
22366
|
+
}, undefined, false, undefined, this);
|
|
22367
|
+
case "object":
|
|
22368
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(ObjectField, {
|
|
22369
|
+
...props
|
|
22370
|
+
}, undefined, false, undefined, this);
|
|
22371
|
+
case "union":
|
|
22372
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(UnionField, {
|
|
22373
|
+
...props
|
|
22374
|
+
}, undefined, false, undefined, this);
|
|
22375
|
+
default:
|
|
22376
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV(RawField, {
|
|
22377
|
+
...props
|
|
22378
|
+
}, undefined, false, undefined, this);
|
|
22379
|
+
}
|
|
22380
|
+
};
|
|
22381
|
+
|
|
22382
|
+
// src/cli/config/schema/fromJsonSchema.ts
|
|
22383
|
+
var MAX_DEPTH = 6;
|
|
22384
|
+
var opaque = () => ({ kind: "opaque", typeText: "json" });
|
|
22385
|
+
var fromJsonSchema = (schema, depth = 0) => {
|
|
22386
|
+
if (depth > MAX_DEPTH || !isRecord(schema))
|
|
22387
|
+
return opaque();
|
|
22388
|
+
if (Array.isArray(schema.enum)) {
|
|
22389
|
+
const choices = schema.enum.filter((value) => typeof value === "string" || typeof value === "number");
|
|
22390
|
+
if (choices.length > 0)
|
|
22391
|
+
return { choices, kind: "enum" };
|
|
22392
|
+
}
|
|
22393
|
+
const variants = schema.oneOf ?? schema.anyOf;
|
|
22394
|
+
if (Array.isArray(variants) && variants.length > 0) {
|
|
22395
|
+
return {
|
|
22396
|
+
kind: "union",
|
|
22397
|
+
variants: variants.map((variant) => fromJsonSchema(variant, depth + 1))
|
|
22398
|
+
};
|
|
22399
|
+
}
|
|
22400
|
+
const declared = schema.type;
|
|
22401
|
+
const type = Array.isArray(declared) ? declared.find((entry) => entry !== "null") : declared;
|
|
22402
|
+
if (type === "string")
|
|
22403
|
+
return { kind: "string" };
|
|
22404
|
+
if (type === "number" || type === "integer")
|
|
22405
|
+
return { kind: "number" };
|
|
22406
|
+
if (type === "boolean")
|
|
22407
|
+
return { kind: "boolean" };
|
|
22408
|
+
if (type === "array") {
|
|
22409
|
+
const items = schema.items;
|
|
22410
|
+
if (Array.isArray(items)) {
|
|
22411
|
+
return {
|
|
22412
|
+
items: items.map((item) => fromJsonSchema(item, depth + 1)),
|
|
22413
|
+
kind: "tuple"
|
|
22414
|
+
};
|
|
22415
|
+
}
|
|
22416
|
+
return {
|
|
22417
|
+
item: items ? fromJsonSchema(items, depth + 1) : opaque(),
|
|
22418
|
+
kind: "array"
|
|
22419
|
+
};
|
|
22420
|
+
}
|
|
22421
|
+
if (type === "object" || isRecord(schema.properties)) {
|
|
22422
|
+
const properties = isRecord(schema.properties) ? schema.properties : {};
|
|
22423
|
+
const required = Array.isArray(schema.required) ? schema.required : [];
|
|
22424
|
+
const fields = Object.entries(properties).map(([name, sub]) => ({
|
|
22425
|
+
description: isRecord(sub) && typeof sub.description === "string" ? sub.description : "",
|
|
22426
|
+
name,
|
|
22427
|
+
optional: !required.includes(name),
|
|
22428
|
+
schema: fromJsonSchema(sub, depth + 1)
|
|
22429
|
+
}));
|
|
22430
|
+
if (fields.length > 0)
|
|
22431
|
+
return { fields, kind: "object" };
|
|
22432
|
+
const additional = schema.additionalProperties;
|
|
22433
|
+
if (isRecord(additional)) {
|
|
22434
|
+
return { kind: "record", value: fromJsonSchema(additional, depth + 1) };
|
|
22435
|
+
}
|
|
22436
|
+
if (additional !== false) {
|
|
22437
|
+
return { kind: "record", value: opaque() };
|
|
22438
|
+
}
|
|
22439
|
+
return { fields: [], kind: "object" };
|
|
22440
|
+
}
|
|
22441
|
+
return opaque();
|
|
22442
|
+
};
|
|
22443
|
+
var eslintOptionsSchema = (metaSchema) => {
|
|
22444
|
+
if (Array.isArray(metaSchema)) {
|
|
22445
|
+
if (metaSchema.length === 0)
|
|
22446
|
+
return { kind: "opaque", typeText: "options" };
|
|
22447
|
+
return {
|
|
22448
|
+
items: metaSchema.map((entry) => fromJsonSchema(entry)),
|
|
22449
|
+
kind: "tuple"
|
|
22450
|
+
};
|
|
22451
|
+
}
|
|
22452
|
+
if (isRecord(metaSchema)) {
|
|
22453
|
+
if (metaSchema.type === "array")
|
|
22454
|
+
return fromJsonSchema(metaSchema);
|
|
22455
|
+
return { items: [fromJsonSchema(metaSchema)], kind: "tuple" };
|
|
22456
|
+
}
|
|
22457
|
+
return { kind: "opaque", typeText: "options" };
|
|
22458
|
+
};
|
|
22459
|
+
|
|
22460
|
+
// src/cli/config/eslint/EslintPanel.tsx
|
|
22461
|
+
var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
|
|
22020
22462
|
var SEVERITIES = ["off", "warn", "error"];
|
|
22021
22463
|
var CATALOG_RENDER_CAP = 250;
|
|
22022
22464
|
var splitName = (name) => {
|
|
@@ -22026,9 +22468,9 @@ var splitName = (name) => {
|
|
|
22026
22468
|
return { prefix: name.slice(0, slash + 1), short: name.slice(slash + 1) };
|
|
22027
22469
|
};
|
|
22028
22470
|
var formatOptions = (options) => options.map((option) => JSON.stringify(option)).join(", ");
|
|
22029
|
-
var SeveritySegment = ({ busy, onChange, value }) => /* @__PURE__ */
|
|
22471
|
+
var SeveritySegment = ({ busy, onChange, value }) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22030
22472
|
className: busy ? "seg busy" : "seg",
|
|
22031
|
-
children: SEVERITIES.map((severity) => /* @__PURE__ */
|
|
22473
|
+
children: SEVERITIES.map((severity) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22032
22474
|
"data-on": value === severity,
|
|
22033
22475
|
"data-sev": severity,
|
|
22034
22476
|
onClick: () => onChange(severity),
|
|
@@ -22038,32 +22480,32 @@ var SeveritySegment = ({ busy, onChange, value }) => /* @__PURE__ */ jsx_dev_run
|
|
|
22038
22480
|
}, undefined, false, undefined, this);
|
|
22039
22481
|
var RuleName = ({ meta, name }) => {
|
|
22040
22482
|
const parts = splitName(name);
|
|
22041
|
-
return /* @__PURE__ */
|
|
22483
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22042
22484
|
className: "rule-name-row",
|
|
22043
22485
|
children: [
|
|
22044
|
-
/* @__PURE__ */
|
|
22486
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22045
22487
|
className: "rule-name",
|
|
22046
22488
|
children: [
|
|
22047
|
-
/* @__PURE__ */
|
|
22489
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22048
22490
|
className: "pfx",
|
|
22049
22491
|
children: parts.prefix
|
|
22050
22492
|
}, undefined, false, undefined, this),
|
|
22051
22493
|
parts.short
|
|
22052
22494
|
]
|
|
22053
22495
|
}, undefined, true, undefined, this),
|
|
22054
|
-
meta && /* @__PURE__ */
|
|
22496
|
+
meta && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22055
22497
|
className: "badge src",
|
|
22056
22498
|
children: meta.source
|
|
22057
22499
|
}, undefined, false, undefined, this),
|
|
22058
|
-
meta?.fixable && /* @__PURE__ */
|
|
22500
|
+
meta?.fixable && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22059
22501
|
className: "badge fix",
|
|
22060
22502
|
children: "fixable"
|
|
22061
22503
|
}, undefined, false, undefined, this),
|
|
22062
|
-
meta?.deprecated && /* @__PURE__ */
|
|
22504
|
+
meta?.deprecated && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22063
22505
|
className: "badge dep",
|
|
22064
22506
|
children: "deprecated"
|
|
22065
22507
|
}, undefined, false, undefined, this),
|
|
22066
|
-
meta?.docsUrl && /* @__PURE__ */
|
|
22508
|
+
meta?.docsUrl && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("a", {
|
|
22067
22509
|
className: "docs",
|
|
22068
22510
|
href: meta.docsUrl,
|
|
22069
22511
|
rel: "noreferrer",
|
|
@@ -22081,70 +22523,55 @@ var ConfigRow = ({
|
|
|
22081
22523
|
options,
|
|
22082
22524
|
severity
|
|
22083
22525
|
}) => {
|
|
22084
|
-
const [editing, setEditing] =
|
|
22085
|
-
const [draft, setDraft] =
|
|
22086
|
-
const
|
|
22526
|
+
const [editing, setEditing] = import_react2.useState(false);
|
|
22527
|
+
const [draft, setDraft] = import_react2.useState(options);
|
|
22528
|
+
const optionsSchema = import_react2.useMemo(() => eslintOptionsSchema(meta?.schema), [meta]);
|
|
22087
22529
|
const openEditor = () => {
|
|
22088
|
-
setDraft(
|
|
22089
|
-
setError(null);
|
|
22530
|
+
setDraft(options);
|
|
22090
22531
|
setEditing(true);
|
|
22091
22532
|
};
|
|
22092
|
-
|
|
22093
|
-
const text = draft.trim();
|
|
22094
|
-
try {
|
|
22095
|
-
const parsed = text === "" ? [] : JSON.parse(text);
|
|
22096
|
-
if (!Array.isArray(parsed)) {
|
|
22097
|
-
setError('Options must be a JSON array, e.g. [{ "minLength": 3 }]');
|
|
22098
|
-
return;
|
|
22099
|
-
}
|
|
22100
|
-
onSave(severity, parsed);
|
|
22101
|
-
setEditing(false);
|
|
22102
|
-
} catch (parseError) {
|
|
22103
|
-
setError(String(parseError));
|
|
22104
|
-
}
|
|
22105
|
-
};
|
|
22106
|
-
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22533
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22107
22534
|
className: "rule",
|
|
22108
22535
|
children: [
|
|
22109
|
-
/* @__PURE__ */
|
|
22536
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22110
22537
|
className: "rule-main",
|
|
22111
22538
|
children: [
|
|
22112
|
-
/* @__PURE__ */
|
|
22539
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(RuleName, {
|
|
22113
22540
|
meta,
|
|
22114
22541
|
name
|
|
22115
22542
|
}, undefined, false, undefined, this),
|
|
22116
|
-
meta?.description && /* @__PURE__ */
|
|
22543
|
+
meta?.description && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("p", {
|
|
22117
22544
|
className: "rule-desc",
|
|
22118
22545
|
children: meta.description
|
|
22119
22546
|
}, undefined, false, undefined, this),
|
|
22120
|
-
options.length > 0 && !editing && /* @__PURE__ */
|
|
22547
|
+
options.length > 0 && !editing && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("code", {
|
|
22121
22548
|
className: "rule-opts",
|
|
22122
22549
|
children: formatOptions(options)
|
|
22123
22550
|
}, undefined, false, undefined, this),
|
|
22124
|
-
editing && /* @__PURE__ */
|
|
22551
|
+
editing && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22125
22552
|
className: "opts-editor",
|
|
22126
22553
|
children: [
|
|
22127
|
-
/* @__PURE__ */
|
|
22128
|
-
className: "
|
|
22129
|
-
|
|
22130
|
-
|
|
22131
|
-
|
|
22132
|
-
|
|
22133
|
-
|
|
22134
|
-
error && /* @__PURE__ */ jsx_dev_runtime.jsxDEV("div", {
|
|
22135
|
-
className: "opts-error",
|
|
22136
|
-
children: error
|
|
22554
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22555
|
+
className: "fe-root",
|
|
22556
|
+
children: /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(FieldEditor, {
|
|
22557
|
+
onChange: (value) => setDraft(Array.isArray(value) ? value : []),
|
|
22558
|
+
schema: optionsSchema,
|
|
22559
|
+
value: draft
|
|
22560
|
+
}, undefined, false, undefined, this)
|
|
22137
22561
|
}, undefined, false, undefined, this),
|
|
22138
|
-
/* @__PURE__ */
|
|
22562
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22139
22563
|
className: "opts-actions",
|
|
22140
22564
|
children: [
|
|
22141
|
-
/* @__PURE__ */
|
|
22565
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22142
22566
|
className: "opts-btn save",
|
|
22143
|
-
onClick:
|
|
22567
|
+
onClick: () => {
|
|
22568
|
+
onSave(severity, draft);
|
|
22569
|
+
setEditing(false);
|
|
22570
|
+
},
|
|
22144
22571
|
type: "button",
|
|
22145
22572
|
children: "Save options"
|
|
22146
22573
|
}, undefined, false, undefined, this),
|
|
22147
|
-
/* @__PURE__ */
|
|
22574
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22148
22575
|
className: "opts-btn",
|
|
22149
22576
|
onClick: () => setEditing(false),
|
|
22150
22577
|
type: "button",
|
|
@@ -22156,17 +22583,17 @@ var ConfigRow = ({
|
|
|
22156
22583
|
}, undefined, true, undefined, this)
|
|
22157
22584
|
]
|
|
22158
22585
|
}, undefined, true, undefined, this),
|
|
22159
|
-
/* @__PURE__ */
|
|
22586
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22160
22587
|
className: "rule-controls",
|
|
22161
22588
|
children: [
|
|
22162
|
-
/* @__PURE__ */
|
|
22589
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22163
22590
|
className: "opts-toggle",
|
|
22164
22591
|
"data-on": editing,
|
|
22165
22592
|
onClick: () => editing ? setEditing(false) : openEditor(),
|
|
22166
22593
|
type: "button",
|
|
22167
22594
|
children: "options"
|
|
22168
22595
|
}, undefined, false, undefined, this),
|
|
22169
|
-
/* @__PURE__ */
|
|
22596
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(SeveritySegment, {
|
|
22170
22597
|
busy,
|
|
22171
22598
|
onChange: (next) => onSave(next),
|
|
22172
22599
|
value: severity
|
|
@@ -22183,39 +22610,39 @@ var CatalogCard = ({
|
|
|
22183
22610
|
meta,
|
|
22184
22611
|
name,
|
|
22185
22612
|
onChange
|
|
22186
|
-
}) => /* @__PURE__ */
|
|
22613
|
+
}) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22187
22614
|
className: "rule",
|
|
22188
22615
|
children: [
|
|
22189
|
-
/* @__PURE__ */
|
|
22616
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22190
22617
|
className: "rule-main",
|
|
22191
22618
|
children: [
|
|
22192
|
-
/* @__PURE__ */
|
|
22619
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(RuleName, {
|
|
22193
22620
|
meta,
|
|
22194
22621
|
name
|
|
22195
22622
|
}, undefined, false, undefined, this),
|
|
22196
|
-
meta?.description && /* @__PURE__ */
|
|
22623
|
+
meta?.description && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("p", {
|
|
22197
22624
|
className: "rule-desc",
|
|
22198
22625
|
children: meta.description
|
|
22199
22626
|
}, undefined, false, undefined, this)
|
|
22200
22627
|
]
|
|
22201
22628
|
}, undefined, true, undefined, this),
|
|
22202
|
-
/* @__PURE__ */
|
|
22629
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22203
22630
|
className: "cat-control",
|
|
22204
22631
|
children: [
|
|
22205
|
-
/* @__PURE__ */
|
|
22632
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22206
22633
|
className: "effective",
|
|
22207
|
-
children: configuredLabel ? /* @__PURE__ */
|
|
22634
|
+
children: configuredLabel ? /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
|
|
22208
22635
|
children: [
|
|
22209
22636
|
"in ",
|
|
22210
|
-
/* @__PURE__ */
|
|
22637
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("b", {
|
|
22211
22638
|
children: configuredLabel
|
|
22212
22639
|
}, undefined, false, undefined, this)
|
|
22213
22640
|
]
|
|
22214
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
22641
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(jsx_dev_runtime2.Fragment, {
|
|
22215
22642
|
children: "inherited"
|
|
22216
22643
|
}, undefined, false, undefined, this)
|
|
22217
22644
|
}, undefined, false, undefined, this),
|
|
22218
|
-
/* @__PURE__ */
|
|
22645
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV(SeveritySegment, {
|
|
22219
22646
|
busy,
|
|
22220
22647
|
onChange,
|
|
22221
22648
|
value: effective
|
|
@@ -22265,24 +22692,24 @@ var matchesQuery = (query, name, description) => {
|
|
|
22265
22692
|
return name.toLowerCase().includes(needle) || (description ?? "").toLowerCase().includes(needle);
|
|
22266
22693
|
};
|
|
22267
22694
|
var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
22268
|
-
const [catalog, setCatalog] =
|
|
22269
|
-
const [tab, setTab] =
|
|
22270
|
-
const [query, setQuery] =
|
|
22271
|
-
const [source, setSource] =
|
|
22272
|
-
const [busyRule, setBusyRule] =
|
|
22273
|
-
const [notice, setNotice] =
|
|
22274
|
-
const [scopeFile, setScopeFile] =
|
|
22275
|
-
const [scopeDraft, setScopeDraft] =
|
|
22276
|
-
const metaByName =
|
|
22277
|
-
const configuredByName =
|
|
22278
|
-
const effectiveByName =
|
|
22695
|
+
const [catalog, setCatalog] = import_react2.useState(initialCatalog);
|
|
22696
|
+
const [tab, setTab] = import_react2.useState("config");
|
|
22697
|
+
const [query, setQuery] = import_react2.useState("");
|
|
22698
|
+
const [source, setSource] = import_react2.useState("all");
|
|
22699
|
+
const [busyRule, setBusyRule] = import_react2.useState(null);
|
|
22700
|
+
const [notice, setNotice] = import_react2.useState(null);
|
|
22701
|
+
const [scopeFile, setScopeFile] = import_react2.useState("");
|
|
22702
|
+
const [scopeDraft, setScopeDraft] = import_react2.useState("");
|
|
22703
|
+
const metaByName = import_react2.useMemo(() => buildMetaIndex(catalog.meta), [catalog.meta]);
|
|
22704
|
+
const configuredByName = import_react2.useMemo(() => buildConfiguredIndex(catalog.blocks), [catalog.blocks]);
|
|
22705
|
+
const effectiveByName = import_react2.useMemo(() => {
|
|
22279
22706
|
const byName = new Map;
|
|
22280
22707
|
for (const rule of catalog.effective)
|
|
22281
22708
|
byName.set(rule.name, rule.severity);
|
|
22282
22709
|
return byName;
|
|
22283
22710
|
}, [catalog.effective]);
|
|
22284
|
-
const defaultBlock =
|
|
22285
|
-
const sources =
|
|
22711
|
+
const defaultBlock = import_react2.useMemo(() => pickDefaultBlock(catalog.blocks), [catalog.blocks]);
|
|
22712
|
+
const sources = import_react2.useMemo(() => sourceCounts(catalog.meta), [catalog.meta]);
|
|
22286
22713
|
const configuredCount = configuredByName.size;
|
|
22287
22714
|
const save = async (request) => {
|
|
22288
22715
|
setBusyRule(request.name);
|
|
@@ -22324,28 +22751,28 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22324
22751
|
};
|
|
22325
22752
|
const matchesSource = (ruleSource) => source === "all" || ruleSource === source;
|
|
22326
22753
|
const visibleBlocks = catalog.blocks.filter((block) => block.rules.length > 0);
|
|
22327
|
-
return /* @__PURE__ */
|
|
22754
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22328
22755
|
className: "shell",
|
|
22329
22756
|
children: [
|
|
22330
|
-
/* @__PURE__ */
|
|
22757
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("header", {
|
|
22331
22758
|
className: "topbar",
|
|
22332
22759
|
children: [
|
|
22333
|
-
/* @__PURE__ */
|
|
22760
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22334
22761
|
className: "brand",
|
|
22335
22762
|
children: [
|
|
22336
|
-
/* @__PURE__ */
|
|
22763
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("h1", {
|
|
22337
22764
|
className: "wordmark",
|
|
22338
22765
|
children: [
|
|
22339
22766
|
"ESLint ",
|
|
22340
|
-
/* @__PURE__ */
|
|
22767
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("em", {
|
|
22341
22768
|
children: "rules"
|
|
22342
22769
|
}, undefined, false, undefined, this)
|
|
22343
22770
|
]
|
|
22344
22771
|
}, undefined, true, undefined, this),
|
|
22345
|
-
/* @__PURE__ */
|
|
22772
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22346
22773
|
className: "subpath",
|
|
22347
22774
|
children: [
|
|
22348
|
-
/* @__PURE__ */
|
|
22775
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22349
22776
|
className: "dot"
|
|
22350
22777
|
}, undefined, false, undefined, this),
|
|
22351
22778
|
catalog.configPath
|
|
@@ -22353,27 +22780,27 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22353
22780
|
}, undefined, true, undefined, this)
|
|
22354
22781
|
]
|
|
22355
22782
|
}, undefined, true, undefined, this),
|
|
22356
|
-
/* @__PURE__ */
|
|
22783
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22357
22784
|
className: "counts",
|
|
22358
22785
|
children: [
|
|
22359
|
-
/* @__PURE__ */
|
|
22786
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22360
22787
|
className: "count",
|
|
22361
22788
|
children: [
|
|
22362
|
-
/* @__PURE__ */
|
|
22789
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("b", {
|
|
22363
22790
|
children: configuredCount
|
|
22364
22791
|
}, undefined, false, undefined, this),
|
|
22365
|
-
/* @__PURE__ */
|
|
22792
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22366
22793
|
children: "configured"
|
|
22367
22794
|
}, undefined, false, undefined, this)
|
|
22368
22795
|
]
|
|
22369
22796
|
}, undefined, true, undefined, this),
|
|
22370
|
-
/* @__PURE__ */
|
|
22797
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22371
22798
|
className: "count",
|
|
22372
22799
|
children: [
|
|
22373
|
-
/* @__PURE__ */
|
|
22800
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("b", {
|
|
22374
22801
|
children: catalog.meta.length
|
|
22375
22802
|
}, undefined, false, undefined, this),
|
|
22376
|
-
/* @__PURE__ */
|
|
22803
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22377
22804
|
children: "available"
|
|
22378
22805
|
}, undefined, false, undefined, this)
|
|
22379
22806
|
]
|
|
@@ -22382,27 +22809,27 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22382
22809
|
}, undefined, true, undefined, this)
|
|
22383
22810
|
]
|
|
22384
22811
|
}, undefined, true, undefined, this),
|
|
22385
|
-
/* @__PURE__ */
|
|
22812
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22386
22813
|
className: "controls",
|
|
22387
22814
|
children: [
|
|
22388
|
-
/* @__PURE__ */
|
|
22815
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22389
22816
|
className: "tabs",
|
|
22390
22817
|
children: [
|
|
22391
|
-
/* @__PURE__ */
|
|
22818
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22392
22819
|
className: "tab",
|
|
22393
22820
|
"data-active": tab === "config",
|
|
22394
22821
|
onClick: () => setTab("config"),
|
|
22395
22822
|
type: "button",
|
|
22396
22823
|
children: "Your config"
|
|
22397
22824
|
}, undefined, false, undefined, this),
|
|
22398
|
-
/* @__PURE__ */
|
|
22825
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22399
22826
|
className: "tab",
|
|
22400
22827
|
"data-active": tab === "catalog",
|
|
22401
22828
|
onClick: () => setTab("catalog"),
|
|
22402
22829
|
type: "button",
|
|
22403
22830
|
children: "Browse all rules"
|
|
22404
22831
|
}, undefined, false, undefined, this),
|
|
22405
|
-
/* @__PURE__ */
|
|
22832
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22406
22833
|
className: "tab",
|
|
22407
22834
|
"data-active": tab === "effective",
|
|
22408
22835
|
onClick: () => setTab("effective"),
|
|
@@ -22411,13 +22838,13 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22411
22838
|
}, undefined, false, undefined, this)
|
|
22412
22839
|
]
|
|
22413
22840
|
}, undefined, true, undefined, this),
|
|
22414
|
-
/* @__PURE__ */
|
|
22841
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("input", {
|
|
22415
22842
|
className: "search",
|
|
22416
22843
|
onChange: (event) => setQuery(event.target.value),
|
|
22417
22844
|
placeholder: "Search rules or descriptions\u2026",
|
|
22418
22845
|
value: query
|
|
22419
22846
|
}, undefined, false, undefined, this),
|
|
22420
|
-
/* @__PURE__ */
|
|
22847
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("input", {
|
|
22421
22848
|
className: "scope",
|
|
22422
22849
|
onChange: (event) => setScopeDraft(event.target.value),
|
|
22423
22850
|
onKeyDown: (event) => {
|
|
@@ -22427,7 +22854,7 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22427
22854
|
placeholder: "Scope to a file, e.g. src/app.ts \u21B5",
|
|
22428
22855
|
value: scopeDraft
|
|
22429
22856
|
}, undefined, false, undefined, this),
|
|
22430
|
-
scopeFile !== "" && /* @__PURE__ */
|
|
22857
|
+
scopeFile !== "" && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22431
22858
|
className: "scope-clear",
|
|
22432
22859
|
onClick: () => {
|
|
22433
22860
|
setScopeDraft("");
|
|
@@ -22438,41 +22865,41 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22438
22865
|
}, undefined, false, undefined, this)
|
|
22439
22866
|
]
|
|
22440
22867
|
}, undefined, true, undefined, this),
|
|
22441
|
-
/* @__PURE__ */
|
|
22868
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22442
22869
|
className: "layout",
|
|
22443
22870
|
children: [
|
|
22444
|
-
/* @__PURE__ */
|
|
22871
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("nav", {
|
|
22445
22872
|
className: "rail",
|
|
22446
22873
|
children: [
|
|
22447
|
-
/* @__PURE__ */
|
|
22874
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22448
22875
|
className: "rail-label",
|
|
22449
22876
|
children: "Source"
|
|
22450
22877
|
}, undefined, false, undefined, this),
|
|
22451
|
-
/* @__PURE__ */
|
|
22878
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22452
22879
|
className: "source-btn",
|
|
22453
22880
|
"data-active": source === "all",
|
|
22454
22881
|
onClick: () => setSource("all"),
|
|
22455
22882
|
type: "button",
|
|
22456
22883
|
children: [
|
|
22457
|
-
/* @__PURE__ */
|
|
22884
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22458
22885
|
children: "all"
|
|
22459
22886
|
}, undefined, false, undefined, this),
|
|
22460
|
-
/* @__PURE__ */
|
|
22887
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22461
22888
|
className: "n",
|
|
22462
22889
|
children: catalog.meta.length
|
|
22463
22890
|
}, undefined, false, undefined, this)
|
|
22464
22891
|
]
|
|
22465
22892
|
}, undefined, true, undefined, this),
|
|
22466
|
-
sources.map(([name, count]) => /* @__PURE__ */
|
|
22893
|
+
sources.map(([name, count]) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("button", {
|
|
22467
22894
|
className: "source-btn",
|
|
22468
22895
|
"data-active": source === name,
|
|
22469
22896
|
onClick: () => setSource(name),
|
|
22470
22897
|
type: "button",
|
|
22471
22898
|
children: [
|
|
22472
|
-
/* @__PURE__ */
|
|
22899
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22473
22900
|
children: name
|
|
22474
22901
|
}, undefined, false, undefined, this),
|
|
22475
|
-
/* @__PURE__ */
|
|
22902
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22476
22903
|
className: "n",
|
|
22477
22904
|
children: count
|
|
22478
22905
|
}, undefined, false, undefined, this)
|
|
@@ -22480,7 +22907,7 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22480
22907
|
}, name, true, undefined, this))
|
|
22481
22908
|
]
|
|
22482
22909
|
}, undefined, true, undefined, this),
|
|
22483
|
-
/* @__PURE__ */
|
|
22910
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("main", {
|
|
22484
22911
|
children: [
|
|
22485
22912
|
tab === "config" && renderConfig(visibleBlocks, metaByName, busyRule, matchesSource, query, save),
|
|
22486
22913
|
tab === "catalog" && renderCatalog(catalog.meta, configuredByName, effectiveByName, defaultBlock, busyRule, matchesSource, query, save),
|
|
@@ -22489,10 +22916,10 @@ var EslintPanel = ({ catalog: initialCatalog }) => {
|
|
|
22489
22916
|
}, undefined, true, undefined, this)
|
|
22490
22917
|
]
|
|
22491
22918
|
}, undefined, true, undefined, this),
|
|
22492
|
-
notice && /* @__PURE__ */
|
|
22919
|
+
notice && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22493
22920
|
className: `toast ${notice.kind}`,
|
|
22494
22921
|
children: [
|
|
22495
|
-
/* @__PURE__ */
|
|
22922
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("b", {
|
|
22496
22923
|
children: notice.kind === "ok" ? "\u2713" : "\u2715"
|
|
22497
22924
|
}, undefined, false, undefined, this),
|
|
22498
22925
|
notice.text
|
|
@@ -22511,22 +22938,22 @@ var renderConfig = (blocks, metaByName, busyRule, matchesSource, query, save) =>
|
|
|
22511
22938
|
return { block, rules };
|
|
22512
22939
|
}).filter((section) => section.rules.length > 0);
|
|
22513
22940
|
if (sections.length === 0) {
|
|
22514
|
-
return /* @__PURE__ */
|
|
22941
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22515
22942
|
className: "empty",
|
|
22516
22943
|
children: "No configured rules match this filter."
|
|
22517
22944
|
}, undefined, false, undefined, this);
|
|
22518
22945
|
}
|
|
22519
|
-
return sections.map(({ block, rules }) => /* @__PURE__ */
|
|
22946
|
+
return sections.map(({ block, rules }) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("section", {
|
|
22520
22947
|
className: "section",
|
|
22521
22948
|
children: [
|
|
22522
|
-
/* @__PURE__ */
|
|
22949
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22523
22950
|
className: "section-head",
|
|
22524
22951
|
children: [
|
|
22525
|
-
/* @__PURE__ */
|
|
22952
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("h2", {
|
|
22526
22953
|
className: "section-title",
|
|
22527
22954
|
children: block.label
|
|
22528
22955
|
}, undefined, false, undefined, this),
|
|
22529
|
-
/* @__PURE__ */
|
|
22956
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22530
22957
|
className: "section-files",
|
|
22531
22958
|
children: [
|
|
22532
22959
|
"block #",
|
|
@@ -22538,7 +22965,7 @@ var renderConfig = (blocks, metaByName, busyRule, matchesSource, query, save) =>
|
|
|
22538
22965
|
}, undefined, true, undefined, this)
|
|
22539
22966
|
]
|
|
22540
22967
|
}, undefined, true, undefined, this),
|
|
22541
|
-
rules.map((rule) => /* @__PURE__ */
|
|
22968
|
+
rules.map((rule) => /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(ConfigRow, {
|
|
22542
22969
|
busy: busyRule === rule.name,
|
|
22543
22970
|
meta: metaByName.get(rule.name) ?? null,
|
|
22544
22971
|
name: rule.name,
|
|
@@ -22557,20 +22984,20 @@ var renderConfig = (blocks, metaByName, busyRule, matchesSource, query, save) =>
|
|
|
22557
22984
|
var renderCatalog = (meta, configuredByName, effectiveByName, defaultBlock, busyRule, matchesSource, query, save) => {
|
|
22558
22985
|
const matches = meta.filter((entry) => matchesSource(entry.source) && matchesQuery(query, entry.name, entry.description));
|
|
22559
22986
|
if (matches.length === 0) {
|
|
22560
|
-
return /* @__PURE__ */
|
|
22987
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22561
22988
|
className: "empty",
|
|
22562
22989
|
children: "No rules match this filter."
|
|
22563
22990
|
}, undefined, false, undefined, this);
|
|
22564
22991
|
}
|
|
22565
22992
|
const shown = matches.slice(0, CATALOG_RENDER_CAP);
|
|
22566
|
-
return /* @__PURE__ */
|
|
22993
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("section", {
|
|
22567
22994
|
className: "section",
|
|
22568
22995
|
children: [
|
|
22569
22996
|
shown.map((entry) => {
|
|
22570
22997
|
const configured = configuredByName.get(entry.name) ?? null;
|
|
22571
22998
|
const effective = configured === null ? effectiveByName.get(entry.name) ?? "off" : effectiveSeverity(entry.name, effectiveByName);
|
|
22572
22999
|
const target = configured?.sourceIndex ?? defaultBlock;
|
|
22573
|
-
return /* @__PURE__ */
|
|
23000
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(CatalogCard, {
|
|
22574
23001
|
busy: busyRule === entry.name,
|
|
22575
23002
|
configuredLabel: configured?.label ?? null,
|
|
22576
23003
|
effective,
|
|
@@ -22583,7 +23010,7 @@ var renderCatalog = (meta, configuredByName, effectiveByName, defaultBlock, busy
|
|
|
22583
23010
|
})
|
|
22584
23011
|
}, entry.name, false, undefined, this);
|
|
22585
23012
|
}),
|
|
22586
|
-
matches.length > shown.length && /* @__PURE__ */
|
|
23013
|
+
matches.length > shown.length && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22587
23014
|
className: "more",
|
|
22588
23015
|
children: [
|
|
22589
23016
|
"+",
|
|
@@ -22601,23 +23028,23 @@ var renderEffective = (effective, representativeFile, metaByName, configuredByNa
|
|
|
22601
23028
|
return matchesSource(ruleSource) && matchesQuery(query, rule.name, meta?.description ?? null);
|
|
22602
23029
|
});
|
|
22603
23030
|
if (rows.length === 0) {
|
|
22604
|
-
return /* @__PURE__ */
|
|
23031
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22605
23032
|
className: "empty",
|
|
22606
23033
|
children: "No effective rules for this file match the filter."
|
|
22607
23034
|
}, undefined, false, undefined, this);
|
|
22608
23035
|
}
|
|
22609
23036
|
const shown = rows.slice(0, CATALOG_RENDER_CAP);
|
|
22610
|
-
return /* @__PURE__ */
|
|
23037
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("section", {
|
|
22611
23038
|
className: "section",
|
|
22612
23039
|
children: [
|
|
22613
|
-
/* @__PURE__ */
|
|
23040
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22614
23041
|
className: "section-head",
|
|
22615
23042
|
children: [
|
|
22616
|
-
/* @__PURE__ */
|
|
23043
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("h2", {
|
|
22617
23044
|
className: "section-title",
|
|
22618
23045
|
children: "Effective ruleset"
|
|
22619
23046
|
}, undefined, false, undefined, this),
|
|
22620
|
-
/* @__PURE__ */
|
|
23047
|
+
/* @__PURE__ */ jsx_dev_runtime2.jsxDEV("span", {
|
|
22621
23048
|
className: "section-files",
|
|
22622
23049
|
children: [
|
|
22623
23050
|
representativeFile,
|
|
@@ -22631,7 +23058,7 @@ var renderEffective = (effective, representativeFile, metaByName, configuredByNa
|
|
|
22631
23058
|
shown.map((rule) => {
|
|
22632
23059
|
const configured = configuredByName.get(rule.name) ?? null;
|
|
22633
23060
|
const target = configured?.sourceIndex ?? defaultBlock;
|
|
22634
|
-
return /* @__PURE__ */
|
|
23061
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(CatalogCard, {
|
|
22635
23062
|
busy: busyRule === rule.name,
|
|
22636
23063
|
configuredLabel: configured?.label ?? null,
|
|
22637
23064
|
effective: rule.severity,
|
|
@@ -22644,7 +23071,7 @@ var renderEffective = (effective, representativeFile, metaByName, configuredByNa
|
|
|
22644
23071
|
})
|
|
22645
23072
|
}, rule.name, false, undefined, this);
|
|
22646
23073
|
}),
|
|
22647
|
-
rows.length > shown.length && /* @__PURE__ */
|
|
23074
|
+
rows.length > shown.length && /* @__PURE__ */ jsx_dev_runtime2.jsxDEV("div", {
|
|
22648
23075
|
className: "more",
|
|
22649
23076
|
children: [
|
|
22650
23077
|
"+",
|
|
@@ -22657,323 +23084,9 @@ var renderEffective = (effective, representativeFile, metaByName, configuredByNa
|
|
|
22657
23084
|
};
|
|
22658
23085
|
var effectiveSeverity = (name, effectiveByName) => effectiveByName.get(name) ?? "off";
|
|
22659
23086
|
|
|
22660
|
-
// src/cli/config/eslint/eslintStyles.ts
|
|
22661
|
-
var ESLINT_CSS = `
|
|
22662
|
-
:root {
|
|
22663
|
-
--bg: #0b0c0e;
|
|
22664
|
-
--bg-grid: #14161a;
|
|
22665
|
-
--panel: #111317;
|
|
22666
|
-
--panel-2: #15181d;
|
|
22667
|
-
--border: #23262d;
|
|
22668
|
-
--border-soft: #1b1e23;
|
|
22669
|
-
--text: #e7e9ec;
|
|
22670
|
-
--dim: #82888f;
|
|
22671
|
-
--faint: #565c64;
|
|
22672
|
-
--accent: #cdf25b;
|
|
22673
|
-
--accent-dim: #8ea53a;
|
|
22674
|
-
--off: #565c64;
|
|
22675
|
-
--warn: #f0b429;
|
|
22676
|
-
--error: #ff5d5d;
|
|
22677
|
-
--mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
22678
|
-
--serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
|
|
22679
|
-
}
|
|
22680
|
-
|
|
22681
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
22682
|
-
|
|
22683
|
-
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
|
|
22684
|
-
|
|
22685
|
-
body {
|
|
22686
|
-
background-color: var(--bg);
|
|
22687
|
-
background-image:
|
|
22688
|
-
linear-gradient(var(--bg-grid) 1px, transparent 1px),
|
|
22689
|
-
linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
|
|
22690
|
-
background-size: 44px 44px;
|
|
22691
|
-
background-position: center top;
|
|
22692
|
-
color: var(--text);
|
|
22693
|
-
font-family: var(--mono);
|
|
22694
|
-
font-size: 13px;
|
|
22695
|
-
line-height: 1.5;
|
|
22696
|
-
min-height: 100vh;
|
|
22697
|
-
}
|
|
22698
|
-
|
|
22699
|
-
body::before {
|
|
22700
|
-
content: '';
|
|
22701
|
-
position: fixed;
|
|
22702
|
-
inset: 0;
|
|
22703
|
-
background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(205, 242, 91, 0.06), transparent 70%);
|
|
22704
|
-
pointer-events: none;
|
|
22705
|
-
z-index: 0;
|
|
22706
|
-
}
|
|
22707
|
-
|
|
22708
|
-
.shell { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 28px 80px; }
|
|
22709
|
-
|
|
22710
|
-
/* ---- header ---- */
|
|
22711
|
-
.topbar {
|
|
22712
|
-
display: flex;
|
|
22713
|
-
align-items: flex-end;
|
|
22714
|
-
justify-content: space-between;
|
|
22715
|
-
gap: 24px;
|
|
22716
|
-
padding: 34px 0 22px;
|
|
22717
|
-
border-bottom: 1px solid var(--border);
|
|
22718
|
-
flex-wrap: wrap;
|
|
22719
|
-
}
|
|
22720
|
-
.brand { display: flex; flex-direction: column; gap: 2px; }
|
|
22721
|
-
.wordmark {
|
|
22722
|
-
font-family: var(--serif);
|
|
22723
|
-
font-size: 42px;
|
|
22724
|
-
line-height: 0.9;
|
|
22725
|
-
letter-spacing: -0.01em;
|
|
22726
|
-
font-weight: 400;
|
|
22727
|
-
}
|
|
22728
|
-
.wordmark em { color: var(--accent); font-style: italic; }
|
|
22729
|
-
.subpath {
|
|
22730
|
-
font-size: 11px;
|
|
22731
|
-
color: var(--dim);
|
|
22732
|
-
letter-spacing: 0.02em;
|
|
22733
|
-
display: flex;
|
|
22734
|
-
align-items: center;
|
|
22735
|
-
gap: 8px;
|
|
22736
|
-
}
|
|
22737
|
-
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
|
|
22738
|
-
.counts { display: flex; gap: 26px; }
|
|
22739
|
-
.count { text-align: right; }
|
|
22740
|
-
.count b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
|
|
22741
|
-
.count span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
|
|
22742
|
-
|
|
22743
|
-
/* ---- controls row ---- */
|
|
22744
|
-
.controls { display: flex; gap: 12px; align-items: center; padding: 18px 0; flex-wrap: wrap; }
|
|
22745
|
-
.tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
|
|
22746
|
-
.tab {
|
|
22747
|
-
font-family: var(--mono);
|
|
22748
|
-
font-size: 12px;
|
|
22749
|
-
color: var(--dim);
|
|
22750
|
-
background: transparent;
|
|
22751
|
-
border: 0;
|
|
22752
|
-
padding: 7px 16px;
|
|
22753
|
-
border-radius: 6px;
|
|
22754
|
-
cursor: pointer;
|
|
22755
|
-
transition: color 0.15s, background 0.15s;
|
|
22756
|
-
letter-spacing: 0.01em;
|
|
22757
|
-
}
|
|
22758
|
-
.tab:hover { color: var(--text); }
|
|
22759
|
-
.tab[data-active='true'] { background: var(--panel-2); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }
|
|
22760
|
-
.search {
|
|
22761
|
-
flex: 1;
|
|
22762
|
-
min-width: 220px;
|
|
22763
|
-
font-family: var(--mono);
|
|
22764
|
-
font-size: 13px;
|
|
22765
|
-
color: var(--text);
|
|
22766
|
-
background: var(--panel);
|
|
22767
|
-
border: 1px solid var(--border);
|
|
22768
|
-
border-radius: 9px;
|
|
22769
|
-
padding: 10px 14px;
|
|
22770
|
-
outline: none;
|
|
22771
|
-
transition: border-color 0.15s, box-shadow 0.15s;
|
|
22772
|
-
}
|
|
22773
|
-
.search:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(205, 242, 91, 0.08); }
|
|
22774
|
-
.search::placeholder { color: var(--faint); }
|
|
22775
|
-
.scope {
|
|
22776
|
-
min-width: 250px;
|
|
22777
|
-
font-family: var(--mono);
|
|
22778
|
-
font-size: 12.5px;
|
|
22779
|
-
color: var(--accent);
|
|
22780
|
-
background: var(--bg);
|
|
22781
|
-
border: 1px solid var(--border);
|
|
22782
|
-
border-radius: 9px;
|
|
22783
|
-
padding: 10px 14px;
|
|
22784
|
-
outline: none;
|
|
22785
|
-
transition: border-color 0.15s, box-shadow 0.15s;
|
|
22786
|
-
}
|
|
22787
|
-
.scope:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(205, 242, 91, 0.08); }
|
|
22788
|
-
.scope::placeholder { color: var(--faint); }
|
|
22789
|
-
.scope-clear {
|
|
22790
|
-
font-family: var(--mono);
|
|
22791
|
-
font-size: 11px;
|
|
22792
|
-
color: var(--dim);
|
|
22793
|
-
background: var(--panel);
|
|
22794
|
-
border: 1px solid var(--border);
|
|
22795
|
-
border-radius: 8px;
|
|
22796
|
-
padding: 9px 12px;
|
|
22797
|
-
cursor: pointer;
|
|
22798
|
-
transition: color 0.15s, border-color 0.15s;
|
|
22799
|
-
}
|
|
22800
|
-
.scope-clear:hover { color: var(--error); border-color: rgba(255, 93, 93, 0.4); }
|
|
22801
|
-
|
|
22802
|
-
/* ---- rule controls + options editor ---- */
|
|
22803
|
-
.rule-controls { display: flex; align-items: center; gap: 8px; }
|
|
22804
|
-
.opts-toggle {
|
|
22805
|
-
font-family: var(--mono);
|
|
22806
|
-
font-size: 11px;
|
|
22807
|
-
color: var(--faint);
|
|
22808
|
-
background: transparent;
|
|
22809
|
-
border: 1px solid var(--border);
|
|
22810
|
-
border-radius: 7px;
|
|
22811
|
-
padding: 6px 10px;
|
|
22812
|
-
cursor: pointer;
|
|
22813
|
-
transition: color 0.13s, border-color 0.13s, background 0.13s;
|
|
22814
|
-
}
|
|
22815
|
-
.opts-toggle:hover { color: var(--text); }
|
|
22816
|
-
.opts-toggle[data-on='true'] { color: var(--accent); border-color: var(--accent-dim); background: rgba(205, 242, 91, 0.06); }
|
|
22817
|
-
.opts-editor { margin-top: 10px; max-width: 70ch; }
|
|
22818
|
-
.opts-input {
|
|
22819
|
-
width: 100%;
|
|
22820
|
-
font-family: var(--mono);
|
|
22821
|
-
font-size: 12px;
|
|
22822
|
-
line-height: 1.5;
|
|
22823
|
-
color: var(--text);
|
|
22824
|
-
background: var(--bg);
|
|
22825
|
-
border: 1px solid var(--border);
|
|
22826
|
-
border-radius: 8px;
|
|
22827
|
-
padding: 10px 12px;
|
|
22828
|
-
resize: vertical;
|
|
22829
|
-
outline: none;
|
|
22830
|
-
}
|
|
22831
|
-
.opts-input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(205, 242, 91, 0.08); }
|
|
22832
|
-
.opts-error { color: var(--error); font-size: 11px; margin-top: 6px; white-space: pre-wrap; }
|
|
22833
|
-
.opts-actions { display: flex; gap: 8px; margin-top: 8px; }
|
|
22834
|
-
.opts-btn {
|
|
22835
|
-
font-family: var(--mono);
|
|
22836
|
-
font-size: 11px;
|
|
22837
|
-
color: var(--dim);
|
|
22838
|
-
background: var(--panel);
|
|
22839
|
-
border: 1px solid var(--border);
|
|
22840
|
-
border-radius: 7px;
|
|
22841
|
-
padding: 7px 13px;
|
|
22842
|
-
cursor: pointer;
|
|
22843
|
-
transition: color 0.13s, border-color 0.13s;
|
|
22844
|
-
}
|
|
22845
|
-
.opts-btn:hover { color: var(--text); }
|
|
22846
|
-
.opts-btn.save { color: var(--accent); border-color: var(--accent-dim); }
|
|
22847
|
-
.opts-btn.save:hover { background: rgba(205, 242, 91, 0.08); }
|
|
22848
|
-
|
|
22849
|
-
/* ---- layout ---- */
|
|
22850
|
-
.layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; margin-top: 20px; align-items: start; }
|
|
22851
|
-
.rail { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 3px; }
|
|
22852
|
-
.rail-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); padding: 4px 10px 8px; }
|
|
22853
|
-
.source-btn {
|
|
22854
|
-
display: flex;
|
|
22855
|
-
align-items: center;
|
|
22856
|
-
justify-content: space-between;
|
|
22857
|
-
gap: 8px;
|
|
22858
|
-
font-family: var(--mono);
|
|
22859
|
-
font-size: 12px;
|
|
22860
|
-
color: var(--dim);
|
|
22861
|
-
background: transparent;
|
|
22862
|
-
border: 0;
|
|
22863
|
-
border-left: 2px solid transparent;
|
|
22864
|
-
padding: 7px 10px;
|
|
22865
|
-
cursor: pointer;
|
|
22866
|
-
text-align: left;
|
|
22867
|
-
transition: color 0.15s, background 0.12s, border-color 0.15s;
|
|
22868
|
-
border-radius: 0 6px 6px 0;
|
|
22869
|
-
}
|
|
22870
|
-
.source-btn:hover { color: var(--text); background: var(--panel); }
|
|
22871
|
-
.source-btn[data-active='true'] { color: var(--accent); border-left-color: var(--accent); background: var(--panel); }
|
|
22872
|
-
.source-btn .n { font-size: 11px; color: var(--faint); }
|
|
22873
|
-
.source-btn[data-active='true'] .n { color: var(--accent-dim); }
|
|
22874
|
-
|
|
22875
|
-
/* ---- rule list ---- */
|
|
22876
|
-
.section { margin-bottom: 30px; animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
|
|
22877
|
-
.section-head { display: flex; align-items: baseline; gap: 12px; padding: 0 2px 10px; border-bottom: 1px dashed var(--border-soft); margin-bottom: 4px; }
|
|
22878
|
-
.section-title { font-family: var(--serif); font-size: 22px; font-style: italic; }
|
|
22879
|
-
.section-files { font-size: 11px; color: var(--faint); }
|
|
22880
|
-
|
|
22881
|
-
.rule {
|
|
22882
|
-
display: grid;
|
|
22883
|
-
grid-template-columns: 1fr auto;
|
|
22884
|
-
gap: 14px;
|
|
22885
|
-
align-items: center;
|
|
22886
|
-
padding: 13px 14px;
|
|
22887
|
-
border: 1px solid transparent;
|
|
22888
|
-
border-radius: 10px;
|
|
22889
|
-
transition: background 0.14s, border-color 0.14s;
|
|
22890
|
-
position: relative;
|
|
22891
|
-
}
|
|
22892
|
-
.rule:hover { background: var(--panel); border-color: var(--border-soft); }
|
|
22893
|
-
.rule-main { min-width: 0; }
|
|
22894
|
-
.rule-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
|
|
22895
|
-
.rule-name { font-size: 13.5px; color: var(--text); letter-spacing: -0.01em; }
|
|
22896
|
-
.rule-name .pfx { color: var(--faint); }
|
|
22897
|
-
.badge {
|
|
22898
|
-
font-size: 9.5px;
|
|
22899
|
-
text-transform: uppercase;
|
|
22900
|
-
letter-spacing: 0.08em;
|
|
22901
|
-
padding: 2px 6px;
|
|
22902
|
-
border-radius: 4px;
|
|
22903
|
-
border: 1px solid var(--border);
|
|
22904
|
-
color: var(--dim);
|
|
22905
|
-
background: var(--panel-2);
|
|
22906
|
-
}
|
|
22907
|
-
.badge.src { color: var(--accent-dim); border-color: rgba(205, 242, 91, 0.2); }
|
|
22908
|
-
.badge.fix { color: #6cc6ff; border-color: rgba(108, 198, 255, 0.22); }
|
|
22909
|
-
.badge.dep { color: var(--warn); border-color: rgba(240, 180, 41, 0.25); }
|
|
22910
|
-
.rule-desc { font-size: 11.5px; color: var(--dim); margin-top: 4px; max-width: 64ch; line-height: 1.45; }
|
|
22911
|
-
.rule-opts { font-size: 11px; color: var(--accent-dim); margin-top: 5px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 5px; padding: 3px 7px; display: inline-block; white-space: pre-wrap; word-break: break-word; }
|
|
22912
|
-
.docs { color: var(--faint); text-decoration: none; transition: color 0.15s; font-size: 11px; }
|
|
22913
|
-
.docs:hover { color: var(--accent); }
|
|
22914
|
-
|
|
22915
|
-
/* ---- severity segmented control ---- */
|
|
22916
|
-
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
|
|
22917
|
-
.seg button {
|
|
22918
|
-
font-family: var(--mono);
|
|
22919
|
-
font-size: 11px;
|
|
22920
|
-
letter-spacing: 0.02em;
|
|
22921
|
-
color: var(--faint);
|
|
22922
|
-
background: transparent;
|
|
22923
|
-
border: 0;
|
|
22924
|
-
padding: 5px 11px;
|
|
22925
|
-
border-radius: 6px;
|
|
22926
|
-
cursor: pointer;
|
|
22927
|
-
transition: color 0.13s, background 0.13s, box-shadow 0.13s;
|
|
22928
|
-
}
|
|
22929
|
-
.seg button:hover:not([data-on='true']) { color: var(--text); }
|
|
22930
|
-
.seg button[data-sev='off'][data-on='true'] { background: rgba(86, 92, 100, 0.22); color: #c2c7cd; box-shadow: inset 0 0 0 1px rgba(130,136,143,0.4); }
|
|
22931
|
-
.seg button[data-sev='warn'][data-on='true'] { background: rgba(240, 180, 41, 0.16); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(240,180,41,0.45); }
|
|
22932
|
-
.seg button[data-sev='error'][data-on='true'] { background: rgba(255, 93, 93, 0.15); color: var(--error); box-shadow: inset 0 0 0 1px rgba(255,93,93,0.45); }
|
|
22933
|
-
.seg.busy { opacity: 0.45; pointer-events: none; }
|
|
22934
|
-
|
|
22935
|
-
.cat-control { display: flex; align-items: center; }
|
|
22936
|
-
.effective { font-size: 10px; color: var(--faint); margin-right: 10px; letter-spacing: 0.04em; }
|
|
22937
|
-
.effective b { color: var(--dim); }
|
|
22938
|
-
|
|
22939
|
-
/* ---- toast ---- */
|
|
22940
|
-
.toast {
|
|
22941
|
-
position: fixed;
|
|
22942
|
-
bottom: 22px;
|
|
22943
|
-
left: 50%;
|
|
22944
|
-
transform: translateX(-50%);
|
|
22945
|
-
z-index: 50;
|
|
22946
|
-
font-family: var(--mono);
|
|
22947
|
-
font-size: 12px;
|
|
22948
|
-
padding: 11px 18px;
|
|
22949
|
-
border-radius: 10px;
|
|
22950
|
-
border: 1px solid var(--border);
|
|
22951
|
-
background: var(--panel-2);
|
|
22952
|
-
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
|
|
22953
|
-
animation: rise 0.3s ease both;
|
|
22954
|
-
display: flex;
|
|
22955
|
-
align-items: center;
|
|
22956
|
-
gap: 10px;
|
|
22957
|
-
}
|
|
22958
|
-
.toast b { font-size: 14px; }
|
|
22959
|
-
.toast.ok b { color: var(--accent); }
|
|
22960
|
-
.toast.err b { color: var(--error); }
|
|
22961
|
-
|
|
22962
|
-
.empty { padding: 60px 20px; text-align: center; color: var(--faint); font-size: 13px; }
|
|
22963
|
-
.more { padding: 18px 4px; font-size: 11px; color: var(--faint); text-align: center; }
|
|
22964
|
-
|
|
22965
|
-
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
|
|
22966
|
-
|
|
22967
|
-
@media (max-width: 820px) {
|
|
22968
|
-
.layout { grid-template-columns: 1fr; }
|
|
22969
|
-
.rail { position: static; flex-direction: row; flex-wrap: wrap; }
|
|
22970
|
-
.wordmark { font-size: 34px; }
|
|
22971
|
-
}
|
|
22972
|
-
`;
|
|
22973
|
-
|
|
22974
23087
|
// src/cli/config/tsconfig/TsconfigPanel.tsx
|
|
22975
|
-
var
|
|
22976
|
-
var
|
|
23088
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
23089
|
+
var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
22977
23090
|
var matchesQuery2 = (query, name, description) => {
|
|
22978
23091
|
if (query === "")
|
|
22979
23092
|
return true;
|
|
@@ -22999,19 +23112,19 @@ var BooleanControl = ({
|
|
|
22999
23112
|
isSet,
|
|
23000
23113
|
onSave,
|
|
23001
23114
|
value
|
|
23002
|
-
}) => /* @__PURE__ */
|
|
23115
|
+
}) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23003
23116
|
className: "ts-control",
|
|
23004
23117
|
children: [
|
|
23005
|
-
/* @__PURE__ */
|
|
23118
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23006
23119
|
className: busy ? "seg busy" : "seg",
|
|
23007
23120
|
children: [
|
|
23008
|
-
/* @__PURE__ */
|
|
23121
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23009
23122
|
"data-on": value === false,
|
|
23010
23123
|
onClick: () => onSave(false),
|
|
23011
23124
|
type: "button",
|
|
23012
23125
|
children: "false"
|
|
23013
23126
|
}, undefined, false, undefined, this),
|
|
23014
|
-
/* @__PURE__ */
|
|
23127
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23015
23128
|
"data-on": value === true,
|
|
23016
23129
|
onClick: () => onSave(true),
|
|
23017
23130
|
type: "button",
|
|
@@ -23019,7 +23132,7 @@ var BooleanControl = ({
|
|
|
23019
23132
|
}, undefined, false, undefined, this)
|
|
23020
23133
|
]
|
|
23021
23134
|
}, undefined, true, undefined, this),
|
|
23022
|
-
isSet && /* @__PURE__ */
|
|
23135
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23023
23136
|
className: "ts-clear",
|
|
23024
23137
|
onClick: () => onSave(undefined, true),
|
|
23025
23138
|
type: "button",
|
|
@@ -23027,24 +23140,24 @@ var BooleanControl = ({
|
|
|
23027
23140
|
}, undefined, false, undefined, this)
|
|
23028
23141
|
]
|
|
23029
23142
|
}, undefined, true, undefined, this);
|
|
23030
|
-
var EnumControl = ({ isSet, onSave, option, value }) => /* @__PURE__ */
|
|
23143
|
+
var EnumControl = ({ isSet, onSave, option, value }) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("select", {
|
|
23031
23144
|
className: "ts-select",
|
|
23032
23145
|
onChange: (event) => event.target.value === "" ? onSave(undefined, true) : onSave(event.target.value),
|
|
23033
23146
|
value: isSet ? String(value) : "",
|
|
23034
23147
|
children: [
|
|
23035
|
-
/* @__PURE__ */
|
|
23148
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("option", {
|
|
23036
23149
|
value: "",
|
|
23037
23150
|
children: "\u2014 unset \u2014"
|
|
23038
23151
|
}, undefined, false, undefined, this),
|
|
23039
|
-
option.enumValues.map((choice) => /* @__PURE__ */
|
|
23152
|
+
option.enumValues.map((choice) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("option", {
|
|
23040
23153
|
value: choice,
|
|
23041
23154
|
children: choice
|
|
23042
23155
|
}, choice, false, undefined, this))
|
|
23043
23156
|
]
|
|
23044
23157
|
}, undefined, true, undefined, this);
|
|
23045
23158
|
var TextControl = ({ kind, onSave, value }) => {
|
|
23046
|
-
const [draft, setDraft] =
|
|
23047
|
-
const [error, setError] =
|
|
23159
|
+
const [draft, setDraft] = import_react3.useState(seedText(kind, value));
|
|
23160
|
+
const [error, setError] = import_react3.useState(null);
|
|
23048
23161
|
const commit = () => {
|
|
23049
23162
|
const text = draft.trim();
|
|
23050
23163
|
if (text === "") {
|
|
@@ -23079,12 +23192,12 @@ var TextControl = ({ kind, onSave, value }) => {
|
|
|
23079
23192
|
onSave(text);
|
|
23080
23193
|
setError(null);
|
|
23081
23194
|
};
|
|
23082
|
-
return /* @__PURE__ */
|
|
23195
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23083
23196
|
children: [
|
|
23084
|
-
/* @__PURE__ */
|
|
23197
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23085
23198
|
className: "ts-control",
|
|
23086
23199
|
children: [
|
|
23087
|
-
/* @__PURE__ */
|
|
23200
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("input", {
|
|
23088
23201
|
className: error ? "ts-input err" : "ts-input",
|
|
23089
23202
|
onChange: (event) => setDraft(event.target.value),
|
|
23090
23203
|
onKeyDown: (event) => {
|
|
@@ -23095,7 +23208,7 @@ var TextControl = ({ kind, onSave, value }) => {
|
|
|
23095
23208
|
spellCheck: false,
|
|
23096
23209
|
value: draft
|
|
23097
23210
|
}, undefined, false, undefined, this),
|
|
23098
|
-
/* @__PURE__ */
|
|
23211
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23099
23212
|
className: "ts-btn",
|
|
23100
23213
|
onClick: commit,
|
|
23101
23214
|
type: "button",
|
|
@@ -23103,16 +23216,42 @@ var TextControl = ({ kind, onSave, value }) => {
|
|
|
23103
23216
|
}, undefined, false, undefined, this)
|
|
23104
23217
|
]
|
|
23105
23218
|
}, undefined, true, undefined, this),
|
|
23106
|
-
error && /* @__PURE__ */
|
|
23219
|
+
error && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23107
23220
|
className: "ts-err",
|
|
23108
23221
|
children: error
|
|
23109
23222
|
}, undefined, false, undefined, this)
|
|
23110
23223
|
]
|
|
23111
23224
|
}, undefined, true, undefined, this);
|
|
23112
23225
|
};
|
|
23226
|
+
var ListControl = ({ onSave, option, value }) => {
|
|
23227
|
+
const [draft, setDraft] = import_react3.useState(Array.isArray(value) ? value : []);
|
|
23228
|
+
const schema = {
|
|
23229
|
+
item: option.enumValues.length > 0 ? { choices: option.enumValues, kind: "enum" } : { kind: "string" },
|
|
23230
|
+
kind: "array"
|
|
23231
|
+
};
|
|
23232
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23233
|
+
className: "ts-control",
|
|
23234
|
+
children: [
|
|
23235
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23236
|
+
className: "fe-root",
|
|
23237
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(FieldEditor, {
|
|
23238
|
+
onChange: setDraft,
|
|
23239
|
+
schema,
|
|
23240
|
+
value: draft
|
|
23241
|
+
}, undefined, false, undefined, this)
|
|
23242
|
+
}, undefined, false, undefined, this),
|
|
23243
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23244
|
+
className: "ts-btn",
|
|
23245
|
+
onClick: () => onSave(draft),
|
|
23246
|
+
type: "button",
|
|
23247
|
+
children: "save"
|
|
23248
|
+
}, undefined, false, undefined, this)
|
|
23249
|
+
]
|
|
23250
|
+
}, undefined, true, undefined, this);
|
|
23251
|
+
};
|
|
23113
23252
|
var Control = ({ busy, isSet, onSave, option, value }) => {
|
|
23114
23253
|
if (option.kind === "boolean") {
|
|
23115
|
-
return /* @__PURE__ */
|
|
23254
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(BooleanControl, {
|
|
23116
23255
|
busy,
|
|
23117
23256
|
isSet,
|
|
23118
23257
|
onSave,
|
|
@@ -23120,14 +23259,21 @@ var Control = ({ busy, isSet, onSave, option, value }) => {
|
|
|
23120
23259
|
}, undefined, false, undefined, this);
|
|
23121
23260
|
}
|
|
23122
23261
|
if (option.kind === "enum") {
|
|
23123
|
-
return /* @__PURE__ */
|
|
23262
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(EnumControl, {
|
|
23124
23263
|
isSet,
|
|
23125
23264
|
onSave,
|
|
23126
23265
|
option,
|
|
23127
23266
|
value
|
|
23128
23267
|
}, undefined, false, undefined, this);
|
|
23129
23268
|
}
|
|
23130
|
-
|
|
23269
|
+
if (option.kind === "list") {
|
|
23270
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(ListControl, {
|
|
23271
|
+
onSave,
|
|
23272
|
+
option,
|
|
23273
|
+
value
|
|
23274
|
+
}, undefined, false, undefined, this);
|
|
23275
|
+
}
|
|
23276
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(TextControl, {
|
|
23131
23277
|
kind: option.kind,
|
|
23132
23278
|
onSave,
|
|
23133
23279
|
value
|
|
@@ -23136,24 +23282,24 @@ var Control = ({ busy, isSet, onSave, option, value }) => {
|
|
|
23136
23282
|
var OptionRow = ({ busy, current, onSave, option }) => {
|
|
23137
23283
|
const isSet = Object.prototype.hasOwnProperty.call(current, option.name);
|
|
23138
23284
|
const value = current[option.name];
|
|
23139
|
-
return /* @__PURE__ */
|
|
23285
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23140
23286
|
className: "rule",
|
|
23141
23287
|
children: [
|
|
23142
|
-
/* @__PURE__ */
|
|
23288
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23143
23289
|
className: "rule-main",
|
|
23144
23290
|
children: [
|
|
23145
|
-
/* @__PURE__ */
|
|
23291
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23146
23292
|
className: "rule-name-row",
|
|
23147
23293
|
children: [
|
|
23148
|
-
/* @__PURE__ */
|
|
23294
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23149
23295
|
className: "rule-name",
|
|
23150
23296
|
children: option.name
|
|
23151
23297
|
}, undefined, false, undefined, this),
|
|
23152
|
-
isSet && /* @__PURE__ */
|
|
23298
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23153
23299
|
className: "badge src",
|
|
23154
23300
|
children: "set"
|
|
23155
23301
|
}, undefined, false, undefined, this),
|
|
23156
|
-
option.defaultLabel !== "" && /* @__PURE__ */
|
|
23302
|
+
option.defaultLabel !== "" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23157
23303
|
className: "ts-default",
|
|
23158
23304
|
children: [
|
|
23159
23305
|
"default: ",
|
|
@@ -23162,15 +23308,15 @@ var OptionRow = ({ busy, current, onSave, option }) => {
|
|
|
23162
23308
|
}, undefined, true, undefined, this)
|
|
23163
23309
|
]
|
|
23164
23310
|
}, undefined, true, undefined, this),
|
|
23165
|
-
option.description !== "" && /* @__PURE__ */
|
|
23311
|
+
option.description !== "" && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("p", {
|
|
23166
23312
|
className: "rule-desc",
|
|
23167
23313
|
children: option.description
|
|
23168
23314
|
}, undefined, false, undefined, this)
|
|
23169
23315
|
]
|
|
23170
23316
|
}, undefined, true, undefined, this),
|
|
23171
|
-
/* @__PURE__ */
|
|
23317
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23172
23318
|
className: "rule-controls",
|
|
23173
|
-
children: /* @__PURE__ */
|
|
23319
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Control, {
|
|
23174
23320
|
busy,
|
|
23175
23321
|
isSet,
|
|
23176
23322
|
onSave,
|
|
@@ -23182,12 +23328,12 @@ var OptionRow = ({ busy, current, onSave, option }) => {
|
|
|
23182
23328
|
}, undefined, true, undefined, this);
|
|
23183
23329
|
};
|
|
23184
23330
|
var TsconfigPanel = ({ state: initial }) => {
|
|
23185
|
-
const [state, setState] =
|
|
23186
|
-
const [query, setQuery] =
|
|
23187
|
-
const [category, setCategory] =
|
|
23188
|
-
const [busy, setBusy] =
|
|
23189
|
-
const [notice, setNotice] =
|
|
23190
|
-
const categoryCounts =
|
|
23331
|
+
const [state, setState] = import_react3.useState(initial);
|
|
23332
|
+
const [query, setQuery] = import_react3.useState("");
|
|
23333
|
+
const [category, setCategory] = import_react3.useState("all");
|
|
23334
|
+
const [busy, setBusy] = import_react3.useState(null);
|
|
23335
|
+
const [notice, setNotice] = import_react3.useState(null);
|
|
23336
|
+
const categoryCounts = import_react3.useMemo(() => {
|
|
23191
23337
|
const counts = new Map;
|
|
23192
23338
|
for (const option of state.options) {
|
|
23193
23339
|
counts.set(option.category, (counts.get(option.category) ?? 0) + 1);
|
|
@@ -23223,28 +23369,28 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23223
23369
|
setBusy(null);
|
|
23224
23370
|
}
|
|
23225
23371
|
};
|
|
23226
|
-
return /* @__PURE__ */
|
|
23372
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23227
23373
|
className: "shell",
|
|
23228
23374
|
children: [
|
|
23229
|
-
/* @__PURE__ */
|
|
23375
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("header", {
|
|
23230
23376
|
className: "topbar",
|
|
23231
23377
|
children: [
|
|
23232
|
-
/* @__PURE__ */
|
|
23378
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23233
23379
|
className: "brand",
|
|
23234
23380
|
children: [
|
|
23235
|
-
/* @__PURE__ */
|
|
23381
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("h1", {
|
|
23236
23382
|
className: "wordmark",
|
|
23237
23383
|
children: [
|
|
23238
23384
|
"tsconfig ",
|
|
23239
|
-
/* @__PURE__ */
|
|
23385
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("em", {
|
|
23240
23386
|
children: "options"
|
|
23241
23387
|
}, undefined, false, undefined, this)
|
|
23242
23388
|
]
|
|
23243
23389
|
}, undefined, true, undefined, this),
|
|
23244
|
-
/* @__PURE__ */
|
|
23390
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23245
23391
|
className: "subpath",
|
|
23246
23392
|
children: [
|
|
23247
|
-
/* @__PURE__ */
|
|
23393
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23248
23394
|
className: "dot"
|
|
23249
23395
|
}, undefined, false, undefined, this),
|
|
23250
23396
|
state.configPath
|
|
@@ -23252,27 +23398,27 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23252
23398
|
}, undefined, true, undefined, this)
|
|
23253
23399
|
]
|
|
23254
23400
|
}, undefined, true, undefined, this),
|
|
23255
|
-
/* @__PURE__ */
|
|
23401
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23256
23402
|
className: "counts",
|
|
23257
23403
|
children: [
|
|
23258
|
-
/* @__PURE__ */
|
|
23404
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23259
23405
|
className: "count",
|
|
23260
23406
|
children: [
|
|
23261
|
-
/* @__PURE__ */
|
|
23407
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("b", {
|
|
23262
23408
|
children: Object.keys(state.current).length
|
|
23263
23409
|
}, undefined, false, undefined, this),
|
|
23264
|
-
/* @__PURE__ */
|
|
23410
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23265
23411
|
children: "set"
|
|
23266
23412
|
}, undefined, false, undefined, this)
|
|
23267
23413
|
]
|
|
23268
23414
|
}, undefined, true, undefined, this),
|
|
23269
|
-
/* @__PURE__ */
|
|
23415
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23270
23416
|
className: "count",
|
|
23271
23417
|
children: [
|
|
23272
|
-
/* @__PURE__ */
|
|
23418
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("b", {
|
|
23273
23419
|
children: state.options.length
|
|
23274
23420
|
}, undefined, false, undefined, this),
|
|
23275
|
-
/* @__PURE__ */
|
|
23421
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23276
23422
|
children: "available"
|
|
23277
23423
|
}, undefined, false, undefined, this)
|
|
23278
23424
|
]
|
|
@@ -23281,50 +23427,50 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23281
23427
|
}, undefined, true, undefined, this)
|
|
23282
23428
|
]
|
|
23283
23429
|
}, undefined, true, undefined, this),
|
|
23284
|
-
/* @__PURE__ */
|
|
23430
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23285
23431
|
className: "controls",
|
|
23286
|
-
children: /* @__PURE__ */
|
|
23432
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("input", {
|
|
23287
23433
|
className: "search",
|
|
23288
23434
|
onChange: (event) => setQuery(event.target.value),
|
|
23289
23435
|
placeholder: "Search options or descriptions\u2026",
|
|
23290
23436
|
value: query
|
|
23291
23437
|
}, undefined, false, undefined, this)
|
|
23292
23438
|
}, undefined, false, undefined, this),
|
|
23293
|
-
/* @__PURE__ */
|
|
23439
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23294
23440
|
className: "layout",
|
|
23295
23441
|
children: [
|
|
23296
|
-
/* @__PURE__ */
|
|
23442
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("nav", {
|
|
23297
23443
|
className: "rail",
|
|
23298
23444
|
children: [
|
|
23299
|
-
/* @__PURE__ */
|
|
23445
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23300
23446
|
className: "rail-label",
|
|
23301
23447
|
children: "Category"
|
|
23302
23448
|
}, undefined, false, undefined, this),
|
|
23303
|
-
/* @__PURE__ */
|
|
23449
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23304
23450
|
className: "source-btn",
|
|
23305
23451
|
"data-active": category === "all",
|
|
23306
23452
|
onClick: () => setCategory("all"),
|
|
23307
23453
|
type: "button",
|
|
23308
23454
|
children: [
|
|
23309
|
-
/* @__PURE__ */
|
|
23455
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23310
23456
|
children: "all"
|
|
23311
23457
|
}, undefined, false, undefined, this),
|
|
23312
|
-
/* @__PURE__ */
|
|
23458
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23313
23459
|
className: "n",
|
|
23314
23460
|
children: state.options.length
|
|
23315
23461
|
}, undefined, false, undefined, this)
|
|
23316
23462
|
]
|
|
23317
23463
|
}, undefined, true, undefined, this),
|
|
23318
|
-
state.categories.map((entry) => /* @__PURE__ */
|
|
23464
|
+
state.categories.map((entry) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("button", {
|
|
23319
23465
|
className: "source-btn",
|
|
23320
23466
|
"data-active": category === entry,
|
|
23321
23467
|
onClick: () => setCategory(entry),
|
|
23322
23468
|
type: "button",
|
|
23323
23469
|
children: [
|
|
23324
|
-
/* @__PURE__ */
|
|
23470
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23325
23471
|
children: entry
|
|
23326
23472
|
}, undefined, false, undefined, this),
|
|
23327
|
-
/* @__PURE__ */
|
|
23473
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23328
23474
|
className: "n",
|
|
23329
23475
|
children: categoryCounts.get(entry)
|
|
23330
23476
|
}, undefined, false, undefined, this)
|
|
@@ -23332,21 +23478,21 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23332
23478
|
}, entry, true, undefined, this))
|
|
23333
23479
|
]
|
|
23334
23480
|
}, undefined, true, undefined, this),
|
|
23335
|
-
/* @__PURE__ */
|
|
23336
|
-
children: sections.length === 0 ? /* @__PURE__ */
|
|
23481
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("main", {
|
|
23482
|
+
children: sections.length === 0 ? /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23337
23483
|
className: "empty",
|
|
23338
23484
|
children: "No options match this filter."
|
|
23339
|
-
}, undefined, false, undefined, this) : sections.map((section) => /* @__PURE__ */
|
|
23485
|
+
}, undefined, false, undefined, this) : sections.map((section) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("section", {
|
|
23340
23486
|
className: "section",
|
|
23341
23487
|
children: [
|
|
23342
|
-
/* @__PURE__ */
|
|
23488
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23343
23489
|
className: "section-head",
|
|
23344
23490
|
children: [
|
|
23345
|
-
/* @__PURE__ */
|
|
23491
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("h2", {
|
|
23346
23492
|
className: "section-title",
|
|
23347
23493
|
children: section.label
|
|
23348
23494
|
}, undefined, false, undefined, this),
|
|
23349
|
-
/* @__PURE__ */
|
|
23495
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("span", {
|
|
23350
23496
|
className: "section-files",
|
|
23351
23497
|
children: [
|
|
23352
23498
|
section.items.length,
|
|
@@ -23355,7 +23501,7 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23355
23501
|
}, undefined, true, undefined, this)
|
|
23356
23502
|
]
|
|
23357
23503
|
}, undefined, true, undefined, this),
|
|
23358
|
-
section.items.map((option) => /* @__PURE__ */
|
|
23504
|
+
section.items.map((option) => /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(OptionRow, {
|
|
23359
23505
|
busy: busy === option.name,
|
|
23360
23506
|
current: state.current,
|
|
23361
23507
|
onSave: save(option.name),
|
|
@@ -23366,10 +23512,10 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23366
23512
|
}, undefined, false, undefined, this)
|
|
23367
23513
|
]
|
|
23368
23514
|
}, undefined, true, undefined, this),
|
|
23369
|
-
notice && /* @__PURE__ */
|
|
23515
|
+
notice && /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("div", {
|
|
23370
23516
|
className: `toast ${notice.kind}`,
|
|
23371
23517
|
children: [
|
|
23372
|
-
/* @__PURE__ */
|
|
23518
|
+
/* @__PURE__ */ jsx_dev_runtime3.jsxDEV("b", {
|
|
23373
23519
|
children: notice.kind === "ok" ? "\u2713" : "\u2715"
|
|
23374
23520
|
}, undefined, false, undefined, this),
|
|
23375
23521
|
notice.text
|
|
@@ -23379,78 +23525,9 @@ var TsconfigPanel = ({ state: initial }) => {
|
|
|
23379
23525
|
}, undefined, true, undefined, this);
|
|
23380
23526
|
};
|
|
23381
23527
|
|
|
23382
|
-
// src/cli/config/tsconfig/tsconfigStyles.ts
|
|
23383
|
-
var TSCONFIG_CSS = `
|
|
23384
|
-
.ts-control { display: flex; align-items: center; gap: 8px; }
|
|
23385
|
-
|
|
23386
|
-
.ts-select {
|
|
23387
|
-
appearance: none;
|
|
23388
|
-
font-family: var(--mono);
|
|
23389
|
-
font-size: 12px;
|
|
23390
|
-
color: var(--text);
|
|
23391
|
-
background: var(--panel-2);
|
|
23392
|
-
border: 1px solid var(--border);
|
|
23393
|
-
border-radius: 7px;
|
|
23394
|
-
padding: 6px 28px 6px 10px;
|
|
23395
|
-
background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
|
|
23396
|
-
linear-gradient(135deg, var(--dim) 50%, transparent 50%);
|
|
23397
|
-
background-position: right 12px center, right 7px center;
|
|
23398
|
-
background-size: 5px 5px, 5px 5px;
|
|
23399
|
-
background-repeat: no-repeat;
|
|
23400
|
-
cursor: pointer;
|
|
23401
|
-
}
|
|
23402
|
-
.ts-select:hover { border-color: var(--accent-dim); }
|
|
23403
|
-
|
|
23404
|
-
.ts-input {
|
|
23405
|
-
font-family: var(--mono);
|
|
23406
|
-
font-size: 12px;
|
|
23407
|
-
color: var(--text);
|
|
23408
|
-
background: var(--panel-2);
|
|
23409
|
-
border: 1px solid var(--border);
|
|
23410
|
-
border-radius: 7px;
|
|
23411
|
-
padding: 6px 10px;
|
|
23412
|
-
min-width: 220px;
|
|
23413
|
-
}
|
|
23414
|
-
.ts-input:focus { outline: none; border-color: var(--accent); }
|
|
23415
|
-
.ts-input.err { border-color: var(--error); }
|
|
23416
|
-
.ts-input.wide { flex: 1; min-width: 320px; }
|
|
23417
|
-
|
|
23418
|
-
.ts-btn {
|
|
23419
|
-
font-family: var(--mono);
|
|
23420
|
-
font-size: 11px;
|
|
23421
|
-
color: var(--bg);
|
|
23422
|
-
background: var(--accent);
|
|
23423
|
-
border: none;
|
|
23424
|
-
border-radius: 7px;
|
|
23425
|
-
padding: 6px 12px;
|
|
23426
|
-
cursor: pointer;
|
|
23427
|
-
}
|
|
23428
|
-
.ts-btn:hover { background: var(--accent-dim); }
|
|
23429
|
-
|
|
23430
|
-
.ts-clear {
|
|
23431
|
-
font-family: var(--mono);
|
|
23432
|
-
font-size: 11px;
|
|
23433
|
-
color: var(--dim);
|
|
23434
|
-
background: transparent;
|
|
23435
|
-
border: 1px solid var(--border);
|
|
23436
|
-
border-radius: 7px;
|
|
23437
|
-
padding: 6px 10px;
|
|
23438
|
-
cursor: pointer;
|
|
23439
|
-
}
|
|
23440
|
-
.ts-clear:hover { color: var(--error); border-color: var(--error); }
|
|
23441
|
-
|
|
23442
|
-
.ts-current {
|
|
23443
|
-
font-family: var(--mono);
|
|
23444
|
-
font-size: 11px;
|
|
23445
|
-
color: var(--accent);
|
|
23446
|
-
}
|
|
23447
|
-
.ts-default { color: var(--faint); font-size: 11px; }
|
|
23448
|
-
.ts-err { color: var(--error); font-size: 11px; margin-top: 6px; }
|
|
23449
|
-
`;
|
|
23450
|
-
|
|
23451
23528
|
// src/cli/config/prettier/PrettierPanel.tsx
|
|
23452
|
-
var
|
|
23453
|
-
var
|
|
23529
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
23530
|
+
var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
|
|
23454
23531
|
var formatDefault = (value) => typeof value === "string" ? value : JSON.stringify(value);
|
|
23455
23532
|
var matchesQuery3 = (query, name, description) => {
|
|
23456
23533
|
if (query === "")
|
|
@@ -23463,19 +23540,19 @@ var BooleanControl2 = ({
|
|
|
23463
23540
|
isSet,
|
|
23464
23541
|
onSave,
|
|
23465
23542
|
value
|
|
23466
|
-
}) => /* @__PURE__ */
|
|
23543
|
+
}) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23467
23544
|
className: "ts-control",
|
|
23468
23545
|
children: [
|
|
23469
|
-
/* @__PURE__ */
|
|
23546
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23470
23547
|
className: busy ? "seg busy" : "seg",
|
|
23471
23548
|
children: [
|
|
23472
|
-
/* @__PURE__ */
|
|
23549
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23473
23550
|
"data-on": value === false,
|
|
23474
23551
|
onClick: () => onSave(false),
|
|
23475
23552
|
type: "button",
|
|
23476
23553
|
children: "false"
|
|
23477
23554
|
}, undefined, false, undefined, this),
|
|
23478
|
-
/* @__PURE__ */
|
|
23555
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23479
23556
|
"data-on": value === true,
|
|
23480
23557
|
onClick: () => onSave(true),
|
|
23481
23558
|
type: "button",
|
|
@@ -23483,7 +23560,7 @@ var BooleanControl2 = ({
|
|
|
23483
23560
|
}, undefined, false, undefined, this)
|
|
23484
23561
|
]
|
|
23485
23562
|
}, undefined, true, undefined, this),
|
|
23486
|
-
isSet && /* @__PURE__ */
|
|
23563
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23487
23564
|
className: "ts-clear",
|
|
23488
23565
|
onClick: () => onSave(undefined, true),
|
|
23489
23566
|
type: "button",
|
|
@@ -23496,24 +23573,24 @@ var ChoiceControl = ({
|
|
|
23496
23573
|
isSet,
|
|
23497
23574
|
onSave,
|
|
23498
23575
|
value
|
|
23499
|
-
}) => /* @__PURE__ */
|
|
23576
|
+
}) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("select", {
|
|
23500
23577
|
className: "ts-select",
|
|
23501
23578
|
onChange: (event) => event.target.value === "" ? onSave(undefined, true) : onSave(event.target.value),
|
|
23502
23579
|
value: isSet ? String(value) : "",
|
|
23503
23580
|
children: [
|
|
23504
|
-
/* @__PURE__ */
|
|
23581
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("option", {
|
|
23505
23582
|
value: "",
|
|
23506
23583
|
children: "\u2014 unset \u2014"
|
|
23507
23584
|
}, undefined, false, undefined, this),
|
|
23508
|
-
choices.map((choice) => /* @__PURE__ */
|
|
23585
|
+
choices.map((choice) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("option", {
|
|
23509
23586
|
value: choice,
|
|
23510
23587
|
children: choice
|
|
23511
23588
|
}, choice, false, undefined, this))
|
|
23512
23589
|
]
|
|
23513
23590
|
}, undefined, true, undefined, this);
|
|
23514
23591
|
var TextControl2 = ({ numeric, onSave, value }) => {
|
|
23515
|
-
const [draft, setDraft] =
|
|
23516
|
-
const [error, setError] =
|
|
23592
|
+
const [draft, setDraft] = import_react4.useState(value === undefined ? "" : String(value));
|
|
23593
|
+
const [error, setError] = import_react4.useState(null);
|
|
23517
23594
|
const commit = () => {
|
|
23518
23595
|
const text = draft.trim();
|
|
23519
23596
|
if (text === "") {
|
|
@@ -23534,12 +23611,12 @@ var TextControl2 = ({ numeric, onSave, value }) => {
|
|
|
23534
23611
|
onSave(text);
|
|
23535
23612
|
setError(null);
|
|
23536
23613
|
};
|
|
23537
|
-
return /* @__PURE__ */
|
|
23614
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23538
23615
|
children: [
|
|
23539
|
-
/* @__PURE__ */
|
|
23616
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23540
23617
|
className: "ts-control",
|
|
23541
23618
|
children: [
|
|
23542
|
-
/* @__PURE__ */
|
|
23619
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("input", {
|
|
23543
23620
|
className: error ? "ts-input err" : "ts-input",
|
|
23544
23621
|
onChange: (event) => setDraft(event.target.value),
|
|
23545
23622
|
onKeyDown: (event) => {
|
|
@@ -23550,7 +23627,7 @@ var TextControl2 = ({ numeric, onSave, value }) => {
|
|
|
23550
23627
|
spellCheck: false,
|
|
23551
23628
|
value: draft
|
|
23552
23629
|
}, undefined, false, undefined, this),
|
|
23553
|
-
/* @__PURE__ */
|
|
23630
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23554
23631
|
className: "ts-btn",
|
|
23555
23632
|
onClick: commit,
|
|
23556
23633
|
type: "button",
|
|
@@ -23558,7 +23635,7 @@ var TextControl2 = ({ numeric, onSave, value }) => {
|
|
|
23558
23635
|
}, undefined, false, undefined, this)
|
|
23559
23636
|
]
|
|
23560
23637
|
}, undefined, true, undefined, this),
|
|
23561
|
-
error && /* @__PURE__ */
|
|
23638
|
+
error && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23562
23639
|
className: "ts-err",
|
|
23563
23640
|
children: error
|
|
23564
23641
|
}, undefined, false, undefined, this)
|
|
@@ -23567,7 +23644,7 @@ var TextControl2 = ({ numeric, onSave, value }) => {
|
|
|
23567
23644
|
};
|
|
23568
23645
|
var Control2 = ({ busy, isSet, onSave, option, value }) => {
|
|
23569
23646
|
if (option.type === "boolean") {
|
|
23570
|
-
return /* @__PURE__ */
|
|
23647
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(BooleanControl2, {
|
|
23571
23648
|
busy,
|
|
23572
23649
|
isSet,
|
|
23573
23650
|
onSave,
|
|
@@ -23575,14 +23652,14 @@ var Control2 = ({ busy, isSet, onSave, option, value }) => {
|
|
|
23575
23652
|
}, undefined, false, undefined, this);
|
|
23576
23653
|
}
|
|
23577
23654
|
if (option.type === "choice") {
|
|
23578
|
-
return /* @__PURE__ */
|
|
23655
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(ChoiceControl, {
|
|
23579
23656
|
choices: option.choices.map((choice) => String(choice.value)),
|
|
23580
23657
|
isSet,
|
|
23581
23658
|
onSave,
|
|
23582
23659
|
value
|
|
23583
23660
|
}, undefined, false, undefined, this);
|
|
23584
23661
|
}
|
|
23585
|
-
return /* @__PURE__ */
|
|
23662
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextControl2, {
|
|
23586
23663
|
numeric: option.type === "int",
|
|
23587
23664
|
onSave,
|
|
23588
23665
|
value
|
|
@@ -23593,24 +23670,24 @@ var OptionRow2 = ({ busy, current, onSave, option }) => {
|
|
|
23593
23670
|
if (name === undefined)
|
|
23594
23671
|
return null;
|
|
23595
23672
|
const isSet = Object.prototype.hasOwnProperty.call(current, name);
|
|
23596
|
-
return /* @__PURE__ */
|
|
23673
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23597
23674
|
className: "rule",
|
|
23598
23675
|
children: [
|
|
23599
|
-
/* @__PURE__ */
|
|
23676
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23600
23677
|
className: "rule-main",
|
|
23601
23678
|
children: [
|
|
23602
|
-
/* @__PURE__ */
|
|
23679
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23603
23680
|
className: "rule-name-row",
|
|
23604
23681
|
children: [
|
|
23605
|
-
/* @__PURE__ */
|
|
23682
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23606
23683
|
className: "rule-name",
|
|
23607
23684
|
children: name
|
|
23608
23685
|
}, undefined, false, undefined, this),
|
|
23609
|
-
isSet && /* @__PURE__ */
|
|
23686
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23610
23687
|
className: "badge src",
|
|
23611
23688
|
children: "set"
|
|
23612
23689
|
}, undefined, false, undefined, this),
|
|
23613
|
-
option.default !== undefined && /* @__PURE__ */
|
|
23690
|
+
option.default !== undefined && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23614
23691
|
className: "ts-default",
|
|
23615
23692
|
children: [
|
|
23616
23693
|
"default: ",
|
|
@@ -23619,15 +23696,15 @@ var OptionRow2 = ({ busy, current, onSave, option }) => {
|
|
|
23619
23696
|
}, undefined, true, undefined, this)
|
|
23620
23697
|
]
|
|
23621
23698
|
}, undefined, true, undefined, this),
|
|
23622
|
-
option.description !== undefined && /* @__PURE__ */
|
|
23699
|
+
option.description !== undefined && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("p", {
|
|
23623
23700
|
className: "rule-desc",
|
|
23624
23701
|
children: option.description
|
|
23625
23702
|
}, undefined, false, undefined, this)
|
|
23626
23703
|
]
|
|
23627
23704
|
}, undefined, true, undefined, this),
|
|
23628
|
-
/* @__PURE__ */
|
|
23705
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23629
23706
|
className: "rule-controls",
|
|
23630
|
-
children: /* @__PURE__ */
|
|
23707
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Control2, {
|
|
23631
23708
|
busy: busy === name,
|
|
23632
23709
|
isSet,
|
|
23633
23710
|
onSave: onSave(name),
|
|
@@ -23639,12 +23716,12 @@ var OptionRow2 = ({ busy, current, onSave, option }) => {
|
|
|
23639
23716
|
}, undefined, true, undefined, this);
|
|
23640
23717
|
};
|
|
23641
23718
|
var PrettierPanel = ({ state: initial }) => {
|
|
23642
|
-
const [state, setState] =
|
|
23643
|
-
const [query, setQuery] =
|
|
23644
|
-
const [category, setCategory] =
|
|
23645
|
-
const [busy, setBusy] =
|
|
23646
|
-
const [notice, setNotice] =
|
|
23647
|
-
const categoryCounts =
|
|
23719
|
+
const [state, setState] = import_react4.useState(initial);
|
|
23720
|
+
const [query, setQuery] = import_react4.useState("");
|
|
23721
|
+
const [category, setCategory] = import_react4.useState("all");
|
|
23722
|
+
const [busy, setBusy] = import_react4.useState(null);
|
|
23723
|
+
const [notice, setNotice] = import_react4.useState(null);
|
|
23724
|
+
const categoryCounts = import_react4.useMemo(() => {
|
|
23648
23725
|
const counts = new Map;
|
|
23649
23726
|
for (const option of state.options) {
|
|
23650
23727
|
counts.set(option.category, (counts.get(option.category) ?? 0) + 1);
|
|
@@ -23680,28 +23757,28 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23680
23757
|
setBusy(null);
|
|
23681
23758
|
}
|
|
23682
23759
|
};
|
|
23683
|
-
return /* @__PURE__ */
|
|
23760
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23684
23761
|
className: "shell",
|
|
23685
23762
|
children: [
|
|
23686
|
-
/* @__PURE__ */
|
|
23763
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("header", {
|
|
23687
23764
|
className: "topbar",
|
|
23688
23765
|
children: [
|
|
23689
|
-
/* @__PURE__ */
|
|
23766
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23690
23767
|
className: "brand",
|
|
23691
23768
|
children: [
|
|
23692
|
-
/* @__PURE__ */
|
|
23769
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("h1", {
|
|
23693
23770
|
className: "wordmark",
|
|
23694
23771
|
children: [
|
|
23695
23772
|
"prettier ",
|
|
23696
|
-
/* @__PURE__ */
|
|
23773
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("em", {
|
|
23697
23774
|
children: "options"
|
|
23698
23775
|
}, undefined, false, undefined, this)
|
|
23699
23776
|
]
|
|
23700
23777
|
}, undefined, true, undefined, this),
|
|
23701
|
-
/* @__PURE__ */
|
|
23778
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23702
23779
|
className: "subpath",
|
|
23703
23780
|
children: [
|
|
23704
|
-
/* @__PURE__ */
|
|
23781
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23705
23782
|
className: "dot"
|
|
23706
23783
|
}, undefined, false, undefined, this),
|
|
23707
23784
|
state.configPath ?? "no config yet \u2014 edits create .prettierrc.json"
|
|
@@ -23709,27 +23786,27 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23709
23786
|
}, undefined, true, undefined, this)
|
|
23710
23787
|
]
|
|
23711
23788
|
}, undefined, true, undefined, this),
|
|
23712
|
-
/* @__PURE__ */
|
|
23789
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23713
23790
|
className: "counts",
|
|
23714
23791
|
children: [
|
|
23715
|
-
/* @__PURE__ */
|
|
23792
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23716
23793
|
className: "count",
|
|
23717
23794
|
children: [
|
|
23718
|
-
/* @__PURE__ */
|
|
23795
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("b", {
|
|
23719
23796
|
children: Object.keys(state.current).length
|
|
23720
23797
|
}, undefined, false, undefined, this),
|
|
23721
|
-
/* @__PURE__ */
|
|
23798
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23722
23799
|
children: "set"
|
|
23723
23800
|
}, undefined, false, undefined, this)
|
|
23724
23801
|
]
|
|
23725
23802
|
}, undefined, true, undefined, this),
|
|
23726
|
-
/* @__PURE__ */
|
|
23803
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23727
23804
|
className: "count",
|
|
23728
23805
|
children: [
|
|
23729
|
-
/* @__PURE__ */
|
|
23806
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("b", {
|
|
23730
23807
|
children: state.options.length
|
|
23731
23808
|
}, undefined, false, undefined, this),
|
|
23732
|
-
/* @__PURE__ */
|
|
23809
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23733
23810
|
children: "available"
|
|
23734
23811
|
}, undefined, false, undefined, this)
|
|
23735
23812
|
]
|
|
@@ -23738,50 +23815,50 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23738
23815
|
}, undefined, true, undefined, this)
|
|
23739
23816
|
]
|
|
23740
23817
|
}, undefined, true, undefined, this),
|
|
23741
|
-
/* @__PURE__ */
|
|
23818
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23742
23819
|
className: "controls",
|
|
23743
|
-
children: /* @__PURE__ */
|
|
23820
|
+
children: /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("input", {
|
|
23744
23821
|
className: "search",
|
|
23745
23822
|
onChange: (event) => setQuery(event.target.value),
|
|
23746
23823
|
placeholder: "Search options or descriptions\u2026",
|
|
23747
23824
|
value: query
|
|
23748
23825
|
}, undefined, false, undefined, this)
|
|
23749
23826
|
}, undefined, false, undefined, this),
|
|
23750
|
-
/* @__PURE__ */
|
|
23827
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23751
23828
|
className: "layout",
|
|
23752
23829
|
children: [
|
|
23753
|
-
/* @__PURE__ */
|
|
23830
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("nav", {
|
|
23754
23831
|
className: "rail",
|
|
23755
23832
|
children: [
|
|
23756
|
-
/* @__PURE__ */
|
|
23833
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23757
23834
|
className: "rail-label",
|
|
23758
23835
|
children: "Category"
|
|
23759
23836
|
}, undefined, false, undefined, this),
|
|
23760
|
-
/* @__PURE__ */
|
|
23837
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23761
23838
|
className: "source-btn",
|
|
23762
23839
|
"data-active": category === "all",
|
|
23763
23840
|
onClick: () => setCategory("all"),
|
|
23764
23841
|
type: "button",
|
|
23765
23842
|
children: [
|
|
23766
|
-
/* @__PURE__ */
|
|
23843
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23767
23844
|
children: "all"
|
|
23768
23845
|
}, undefined, false, undefined, this),
|
|
23769
|
-
/* @__PURE__ */
|
|
23846
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23770
23847
|
className: "n",
|
|
23771
23848
|
children: state.options.length
|
|
23772
23849
|
}, undefined, false, undefined, this)
|
|
23773
23850
|
]
|
|
23774
23851
|
}, undefined, true, undefined, this),
|
|
23775
|
-
state.categories.map((entry) => /* @__PURE__ */
|
|
23852
|
+
state.categories.map((entry) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23776
23853
|
className: "source-btn",
|
|
23777
23854
|
"data-active": category === entry,
|
|
23778
23855
|
onClick: () => setCategory(entry),
|
|
23779
23856
|
type: "button",
|
|
23780
23857
|
children: [
|
|
23781
|
-
/* @__PURE__ */
|
|
23858
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23782
23859
|
children: entry
|
|
23783
23860
|
}, undefined, false, undefined, this),
|
|
23784
|
-
/* @__PURE__ */
|
|
23861
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23785
23862
|
className: "n",
|
|
23786
23863
|
children: categoryCounts.get(entry)
|
|
23787
23864
|
}, undefined, false, undefined, this)
|
|
@@ -23789,21 +23866,21 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23789
23866
|
}, entry, true, undefined, this))
|
|
23790
23867
|
]
|
|
23791
23868
|
}, undefined, true, undefined, this),
|
|
23792
|
-
/* @__PURE__ */
|
|
23793
|
-
children: sections.length === 0 ? /* @__PURE__ */
|
|
23869
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("main", {
|
|
23870
|
+
children: sections.length === 0 ? /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23794
23871
|
className: "empty",
|
|
23795
23872
|
children: "No options match this filter."
|
|
23796
|
-
}, undefined, false, undefined, this) : sections.map((section) => /* @__PURE__ */
|
|
23873
|
+
}, undefined, false, undefined, this) : sections.map((section) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("section", {
|
|
23797
23874
|
className: "section",
|
|
23798
23875
|
children: [
|
|
23799
|
-
/* @__PURE__ */
|
|
23876
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23800
23877
|
className: "section-head",
|
|
23801
23878
|
children: [
|
|
23802
|
-
/* @__PURE__ */
|
|
23879
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("h2", {
|
|
23803
23880
|
className: "section-title",
|
|
23804
23881
|
children: section.label
|
|
23805
23882
|
}, undefined, false, undefined, this),
|
|
23806
|
-
/* @__PURE__ */
|
|
23883
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23807
23884
|
className: "section-files",
|
|
23808
23885
|
children: [
|
|
23809
23886
|
section.items.length,
|
|
@@ -23812,7 +23889,7 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23812
23889
|
}, undefined, true, undefined, this)
|
|
23813
23890
|
]
|
|
23814
23891
|
}, undefined, true, undefined, this),
|
|
23815
|
-
section.items.map((option) => /* @__PURE__ */
|
|
23892
|
+
section.items.map((option) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(OptionRow2, {
|
|
23816
23893
|
busy,
|
|
23817
23894
|
current: state.current,
|
|
23818
23895
|
onSave: save,
|
|
@@ -23823,10 +23900,10 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23823
23900
|
}, undefined, false, undefined, this)
|
|
23824
23901
|
]
|
|
23825
23902
|
}, undefined, true, undefined, this),
|
|
23826
|
-
notice && /* @__PURE__ */
|
|
23903
|
+
notice && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23827
23904
|
className: `toast ${notice.kind}`,
|
|
23828
23905
|
children: [
|
|
23829
|
-
/* @__PURE__ */
|
|
23906
|
+
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("b", {
|
|
23830
23907
|
children: notice.kind === "ok" ? "\u2713" : "\u2715"
|
|
23831
23908
|
}, undefined, false, undefined, this),
|
|
23832
23909
|
notice.text
|
|
@@ -23837,198 +23914,77 @@ var PrettierPanel = ({ state: initial }) => {
|
|
|
23837
23914
|
};
|
|
23838
23915
|
|
|
23839
23916
|
// src/cli/config/absolute/AbsoluteConfigPanel.tsx
|
|
23840
|
-
var
|
|
23841
|
-
var
|
|
23917
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
23918
|
+
var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
23842
23919
|
var matchesQuery4 = (query, name, description) => {
|
|
23843
23920
|
if (query === "")
|
|
23844
23921
|
return true;
|
|
23845
23922
|
const needle = query.toLowerCase();
|
|
23846
23923
|
return name.toLowerCase().includes(needle) || description.toLowerCase().includes(needle);
|
|
23847
23924
|
};
|
|
23848
|
-
var
|
|
23849
|
-
|
|
23850
|
-
|
|
23851
|
-
|
|
23852
|
-
value
|
|
23853
|
-
}) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23854
|
-
className: "ts-control",
|
|
23855
|
-
children: [
|
|
23856
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23857
|
-
className: busy ? "seg busy" : "seg",
|
|
23858
|
-
children: [
|
|
23859
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23860
|
-
"data-on": value === false,
|
|
23861
|
-
onClick: () => onSave(false),
|
|
23862
|
-
type: "button",
|
|
23863
|
-
children: "false"
|
|
23864
|
-
}, undefined, false, undefined, this),
|
|
23865
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23866
|
-
"data-on": value === true,
|
|
23867
|
-
onClick: () => onSave(true),
|
|
23868
|
-
type: "button",
|
|
23869
|
-
children: "true"
|
|
23870
|
-
}, undefined, false, undefined, this)
|
|
23871
|
-
]
|
|
23872
|
-
}, undefined, true, undefined, this),
|
|
23873
|
-
isSet && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23874
|
-
className: "ts-clear",
|
|
23875
|
-
onClick: () => onSave(undefined, true),
|
|
23876
|
-
type: "button",
|
|
23877
|
-
children: "unset"
|
|
23878
|
-
}, undefined, false, undefined, this)
|
|
23879
|
-
]
|
|
23880
|
-
}, undefined, true, undefined, this);
|
|
23881
|
-
var EnumControl2 = ({ choices, isSet, onSave, value }) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("select", {
|
|
23882
|
-
className: "ts-select",
|
|
23883
|
-
onChange: (event) => event.target.value === "" ? onSave(undefined, true) : onSave(event.target.value),
|
|
23884
|
-
value: isSet ? String(value) : "",
|
|
23885
|
-
children: [
|
|
23886
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("option", {
|
|
23887
|
-
value: "",
|
|
23888
|
-
children: "\u2014 unset \u2014"
|
|
23889
|
-
}, undefined, false, undefined, this),
|
|
23890
|
-
choices.map((choice) => /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("option", {
|
|
23891
|
-
value: choice,
|
|
23892
|
-
children: choice
|
|
23893
|
-
}, choice, false, undefined, this))
|
|
23894
|
-
]
|
|
23895
|
-
}, undefined, true, undefined, this);
|
|
23896
|
-
var TextControl3 = ({ numeric, onSave, value }) => {
|
|
23897
|
-
const [draft, setDraft] = import_react4.useState(value === undefined ? "" : String(value));
|
|
23898
|
-
const [error, setError] = import_react4.useState(null);
|
|
23899
|
-
const commit = () => {
|
|
23900
|
-
const text = draft.trim();
|
|
23901
|
-
if (text === "") {
|
|
23902
|
-
onSave(undefined, true);
|
|
23903
|
-
setError(null);
|
|
23904
|
-
return;
|
|
23905
|
-
}
|
|
23906
|
-
if (numeric) {
|
|
23907
|
-
const parsed = Number(text);
|
|
23908
|
-
if (Number.isNaN(parsed)) {
|
|
23909
|
-
setError("Must be a number");
|
|
23910
|
-
return;
|
|
23911
|
-
}
|
|
23912
|
-
onSave(parsed);
|
|
23913
|
-
setError(null);
|
|
23914
|
-
return;
|
|
23915
|
-
}
|
|
23916
|
-
onSave(text);
|
|
23917
|
-
setError(null);
|
|
23918
|
-
};
|
|
23919
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23920
|
-
children: [
|
|
23921
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23922
|
-
className: "ts-control",
|
|
23923
|
-
children: [
|
|
23924
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("input", {
|
|
23925
|
-
className: error ? "ts-input err" : "ts-input",
|
|
23926
|
-
onChange: (event) => setDraft(event.target.value),
|
|
23927
|
-
onKeyDown: (event) => {
|
|
23928
|
-
if (event.key === "Enter")
|
|
23929
|
-
commit();
|
|
23930
|
-
},
|
|
23931
|
-
placeholder: numeric ? "e.g. 3000" : "value",
|
|
23932
|
-
spellCheck: false,
|
|
23933
|
-
value: draft
|
|
23934
|
-
}, undefined, false, undefined, this),
|
|
23935
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("button", {
|
|
23936
|
-
className: "ts-btn",
|
|
23937
|
-
onClick: commit,
|
|
23938
|
-
type: "button",
|
|
23939
|
-
children: "save"
|
|
23940
|
-
}, undefined, false, undefined, this)
|
|
23941
|
-
]
|
|
23942
|
-
}, undefined, true, undefined, this),
|
|
23943
|
-
error && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23944
|
-
className: "ts-err",
|
|
23945
|
-
children: error
|
|
23946
|
-
}, undefined, false, undefined, this)
|
|
23947
|
-
]
|
|
23948
|
-
}, undefined, true, undefined, this);
|
|
23949
|
-
};
|
|
23950
|
-
var Control3 = ({ busy, field, isSet, onSave, value }) => {
|
|
23951
|
-
if (field.kind === "boolean") {
|
|
23952
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(BooleanControl3, {
|
|
23953
|
-
busy,
|
|
23954
|
-
isSet,
|
|
23955
|
-
onSave,
|
|
23956
|
-
value
|
|
23957
|
-
}, undefined, false, undefined, this);
|
|
23958
|
-
}
|
|
23959
|
-
if (field.kind === "enum") {
|
|
23960
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(EnumControl2, {
|
|
23961
|
-
choices: field.choices,
|
|
23962
|
-
isSet,
|
|
23963
|
-
onSave,
|
|
23964
|
-
value
|
|
23965
|
-
}, undefined, false, undefined, this);
|
|
23966
|
-
}
|
|
23967
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(TextControl3, {
|
|
23968
|
-
numeric: field.kind === "number",
|
|
23969
|
-
onSave,
|
|
23970
|
-
value
|
|
23971
|
-
}, undefined, false, undefined, this);
|
|
23972
|
-
};
|
|
23973
|
-
var FieldRow = ({ busy, complexKeys, current, onSave, field }) => {
|
|
23974
|
-
const editable = field.kind !== "complex";
|
|
23975
|
-
const isSet = editable ? Object.prototype.hasOwnProperty.call(current, field.name) : complexKeys.includes(field.name);
|
|
23976
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
23977
|
-
className: "rule",
|
|
23925
|
+
var FieldRow = ({ busy, field, isSet, onSave, value }) => {
|
|
23926
|
+
const [draft, setDraft] = import_react5.useState(value);
|
|
23927
|
+
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
23928
|
+
className: "rule fe-block",
|
|
23978
23929
|
children: [
|
|
23979
|
-
/* @__PURE__ */
|
|
23930
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
23980
23931
|
className: "rule-main",
|
|
23981
23932
|
children: [
|
|
23982
|
-
/* @__PURE__ */
|
|
23933
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
23983
23934
|
className: "rule-name-row",
|
|
23984
23935
|
children: [
|
|
23985
|
-
/* @__PURE__ */
|
|
23936
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
23986
23937
|
className: "rule-name",
|
|
23987
23938
|
children: field.name
|
|
23988
23939
|
}, undefined, false, undefined, this),
|
|
23989
|
-
isSet && /* @__PURE__ */
|
|
23940
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
23990
23941
|
className: "badge src",
|
|
23991
23942
|
children: "set"
|
|
23992
|
-
}, undefined, false, undefined, this),
|
|
23993
|
-
!editable && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23994
|
-
className: "badge dep",
|
|
23995
|
-
children: "edit in file"
|
|
23996
|
-
}, undefined, false, undefined, this),
|
|
23997
|
-
/* @__PURE__ */ jsx_dev_runtime4.jsxDEV("span", {
|
|
23998
|
-
className: "ts-default",
|
|
23999
|
-
children: field.typeText
|
|
24000
23943
|
}, undefined, false, undefined, this)
|
|
24001
23944
|
]
|
|
24002
23945
|
}, undefined, true, undefined, this),
|
|
24003
|
-
field.description !== "" && /* @__PURE__ */
|
|
23946
|
+
field.description !== "" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("p", {
|
|
24004
23947
|
className: "rule-desc",
|
|
24005
23948
|
children: field.description
|
|
23949
|
+
}, undefined, false, undefined, this),
|
|
23950
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
23951
|
+
className: "fe-root",
|
|
23952
|
+
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldEditor, {
|
|
23953
|
+
onChange: setDraft,
|
|
23954
|
+
schema: field.schema,
|
|
23955
|
+
value: draft
|
|
23956
|
+
}, undefined, false, undefined, this)
|
|
24006
23957
|
}, undefined, false, undefined, this)
|
|
24007
23958
|
]
|
|
24008
23959
|
}, undefined, true, undefined, this),
|
|
24009
|
-
|
|
24010
|
-
className: "rule-controls",
|
|
24011
|
-
children:
|
|
24012
|
-
|
|
24013
|
-
|
|
24014
|
-
|
|
24015
|
-
|
|
24016
|
-
|
|
24017
|
-
|
|
24018
|
-
|
|
23960
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
23961
|
+
className: "rule-controls fe-actions",
|
|
23962
|
+
children: [
|
|
23963
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("button", {
|
|
23964
|
+
className: "ts-btn",
|
|
23965
|
+
disabled: busy,
|
|
23966
|
+
onClick: () => onSave(draft),
|
|
23967
|
+
type: "button",
|
|
23968
|
+
children: "save"
|
|
23969
|
+
}, undefined, false, undefined, this),
|
|
23970
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("button", {
|
|
23971
|
+
className: "ts-clear",
|
|
23972
|
+
onClick: () => onSave(undefined, true),
|
|
23973
|
+
type: "button",
|
|
23974
|
+
children: "unset"
|
|
23975
|
+
}, undefined, false, undefined, this)
|
|
23976
|
+
]
|
|
23977
|
+
}, undefined, true, undefined, this)
|
|
24019
23978
|
]
|
|
24020
23979
|
}, undefined, true, undefined, this);
|
|
24021
23980
|
};
|
|
24022
23981
|
var AbsoluteConfigPanel = ({
|
|
24023
23982
|
state: initial
|
|
24024
23983
|
}) => {
|
|
24025
|
-
const [state, setState] =
|
|
24026
|
-
const [query, setQuery] =
|
|
24027
|
-
const [busy, setBusy] =
|
|
24028
|
-
const [notice, setNotice] =
|
|
24029
|
-
const visible = state.fields.filter((field) => matchesQuery4(query, field.name, field.description));
|
|
24030
|
-
const editable = visible.filter((field) => field.kind !== "complex");
|
|
24031
|
-
const advanced = visible.filter((field) => field.kind === "complex");
|
|
23984
|
+
const [state, setState] = import_react5.useState(initial);
|
|
23985
|
+
const [query, setQuery] = import_react5.useState("");
|
|
23986
|
+
const [busy, setBusy] = import_react5.useState(null);
|
|
23987
|
+
const [notice, setNotice] = import_react5.useState(null);
|
|
24032
23988
|
const save = (name) => async (value, remove) => {
|
|
24033
23989
|
setBusy(name);
|
|
24034
23990
|
setNotice(null);
|
|
@@ -24054,35 +24010,32 @@ var AbsoluteConfigPanel = ({
|
|
|
24054
24010
|
setBusy(null);
|
|
24055
24011
|
}
|
|
24056
24012
|
};
|
|
24057
|
-
const
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
onSave: save
|
|
24063
|
-
}, field.name, false, undefined, this));
|
|
24064
|
-
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("div", {
|
|
24013
|
+
const opaque2 = new Set(state.opaqueKeys);
|
|
24014
|
+
const visible = state.fields.filter((field) => matchesQuery4(query, field.name, field.description));
|
|
24015
|
+
const editable = visible.filter((field) => !opaque2.has(field.name));
|
|
24016
|
+
const advanced = visible.filter((field) => opaque2.has(field.name));
|
|
24017
|
+
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24065
24018
|
className: "shell",
|
|
24066
24019
|
children: [
|
|
24067
|
-
/* @__PURE__ */
|
|
24020
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("header", {
|
|
24068
24021
|
className: "topbar",
|
|
24069
24022
|
children: [
|
|
24070
|
-
/* @__PURE__ */
|
|
24023
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24071
24024
|
className: "brand",
|
|
24072
24025
|
children: [
|
|
24073
|
-
/* @__PURE__ */
|
|
24026
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("h1", {
|
|
24074
24027
|
className: "wordmark",
|
|
24075
24028
|
children: [
|
|
24076
24029
|
"absolute.config ",
|
|
24077
|
-
/* @__PURE__ */
|
|
24030
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("em", {
|
|
24078
24031
|
children: "\xB7ts"
|
|
24079
24032
|
}, undefined, false, undefined, this)
|
|
24080
24033
|
]
|
|
24081
24034
|
}, undefined, true, undefined, this),
|
|
24082
|
-
/* @__PURE__ */
|
|
24035
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24083
24036
|
className: "subpath",
|
|
24084
24037
|
children: [
|
|
24085
|
-
/* @__PURE__ */
|
|
24038
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24086
24039
|
className: "dot"
|
|
24087
24040
|
}, undefined, false, undefined, this),
|
|
24088
24041
|
state.configPath ?? "no absolute.config.ts found"
|
|
@@ -24090,27 +24043,27 @@ var AbsoluteConfigPanel = ({
|
|
|
24090
24043
|
}, undefined, true, undefined, this)
|
|
24091
24044
|
]
|
|
24092
24045
|
}, undefined, true, undefined, this),
|
|
24093
|
-
/* @__PURE__ */
|
|
24046
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24094
24047
|
className: "counts",
|
|
24095
24048
|
children: [
|
|
24096
|
-
/* @__PURE__ */
|
|
24049
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24097
24050
|
className: "count",
|
|
24098
24051
|
children: [
|
|
24099
|
-
/* @__PURE__ */
|
|
24052
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("b", {
|
|
24100
24053
|
children: Object.keys(state.current).length
|
|
24101
24054
|
}, undefined, false, undefined, this),
|
|
24102
|
-
/* @__PURE__ */
|
|
24055
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24103
24056
|
children: "set"
|
|
24104
24057
|
}, undefined, false, undefined, this)
|
|
24105
24058
|
]
|
|
24106
24059
|
}, undefined, true, undefined, this),
|
|
24107
|
-
/* @__PURE__ */
|
|
24060
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24108
24061
|
className: "count",
|
|
24109
24062
|
children: [
|
|
24110
|
-
/* @__PURE__ */
|
|
24063
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("b", {
|
|
24111
24064
|
children: editable.length
|
|
24112
24065
|
}, undefined, false, undefined, this),
|
|
24113
|
-
/* @__PURE__ */
|
|
24066
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24114
24067
|
children: "editable"
|
|
24115
24068
|
}, undefined, false, undefined, this)
|
|
24116
24069
|
]
|
|
@@ -24119,32 +24072,28 @@ var AbsoluteConfigPanel = ({
|
|
|
24119
24072
|
}, undefined, true, undefined, this)
|
|
24120
24073
|
]
|
|
24121
24074
|
}, undefined, true, undefined, this),
|
|
24122
|
-
/* @__PURE__ */
|
|
24075
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24123
24076
|
className: "controls",
|
|
24124
|
-
children: /* @__PURE__ */
|
|
24077
|
+
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("input", {
|
|
24125
24078
|
className: "search",
|
|
24126
24079
|
onChange: (event) => setQuery(event.target.value),
|
|
24127
24080
|
placeholder: "Search config fields\u2026",
|
|
24128
24081
|
value: query
|
|
24129
24082
|
}, undefined, false, undefined, this)
|
|
24130
24083
|
}, undefined, false, undefined, this),
|
|
24131
|
-
/* @__PURE__ */
|
|
24084
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("main", {
|
|
24132
24085
|
children: [
|
|
24133
|
-
editable.length
|
|
24134
|
-
className: "empty",
|
|
24135
|
-
children: "No config fields match this filter."
|
|
24136
|
-
}, undefined, false, undefined, this),
|
|
24137
|
-
editable.length > 0 && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("section", {
|
|
24086
|
+
editable.length > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("section", {
|
|
24138
24087
|
className: "section",
|
|
24139
24088
|
children: [
|
|
24140
|
-
/* @__PURE__ */
|
|
24089
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24141
24090
|
className: "section-head",
|
|
24142
24091
|
children: [
|
|
24143
|
-
/* @__PURE__ */
|
|
24092
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("h2", {
|
|
24144
24093
|
className: "section-title",
|
|
24145
24094
|
children: "Fields"
|
|
24146
24095
|
}, undefined, false, undefined, this),
|
|
24147
|
-
/* @__PURE__ */
|
|
24096
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24148
24097
|
className: "section-files",
|
|
24149
24098
|
children: [
|
|
24150
24099
|
editable.length,
|
|
@@ -24153,34 +24102,64 @@ var AbsoluteConfigPanel = ({
|
|
|
24153
24102
|
}, undefined, true, undefined, this)
|
|
24154
24103
|
]
|
|
24155
24104
|
}, undefined, true, undefined, this),
|
|
24156
|
-
|
|
24105
|
+
editable.map((field) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow, {
|
|
24106
|
+
busy: busy === field.name,
|
|
24107
|
+
field,
|
|
24108
|
+
isSet: Object.prototype.hasOwnProperty.call(state.current, field.name),
|
|
24109
|
+
onSave: save(field.name),
|
|
24110
|
+
value: state.current[field.name]
|
|
24111
|
+
}, field.name, false, undefined, this))
|
|
24157
24112
|
]
|
|
24158
24113
|
}, undefined, true, undefined, this),
|
|
24159
|
-
advanced.length > 0 && /* @__PURE__ */
|
|
24114
|
+
advanced.length > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("section", {
|
|
24160
24115
|
className: "section",
|
|
24161
24116
|
children: [
|
|
24162
|
-
/* @__PURE__ */
|
|
24117
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24163
24118
|
className: "section-head",
|
|
24164
24119
|
children: [
|
|
24165
|
-
/* @__PURE__ */
|
|
24120
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("h2", {
|
|
24166
24121
|
className: "section-title",
|
|
24167
24122
|
children: "Advanced"
|
|
24168
24123
|
}, undefined, false, undefined, this),
|
|
24169
|
-
/* @__PURE__ */
|
|
24124
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24170
24125
|
className: "section-files",
|
|
24171
|
-
children: "
|
|
24126
|
+
children: "values reference code \u2014 edit in the file"
|
|
24172
24127
|
}, undefined, false, undefined, this)
|
|
24173
24128
|
]
|
|
24174
24129
|
}, undefined, true, undefined, this),
|
|
24175
|
-
|
|
24130
|
+
advanced.map((field) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24131
|
+
className: "rule",
|
|
24132
|
+
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24133
|
+
className: "rule-main",
|
|
24134
|
+
children: [
|
|
24135
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24136
|
+
className: "rule-name-row",
|
|
24137
|
+
children: [
|
|
24138
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24139
|
+
className: "rule-name",
|
|
24140
|
+
children: field.name
|
|
24141
|
+
}, undefined, false, undefined, this),
|
|
24142
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24143
|
+
className: "badge dep",
|
|
24144
|
+
children: "edit in file"
|
|
24145
|
+
}, undefined, false, undefined, this)
|
|
24146
|
+
]
|
|
24147
|
+
}, undefined, true, undefined, this),
|
|
24148
|
+
field.description !== "" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("p", {
|
|
24149
|
+
className: "rule-desc",
|
|
24150
|
+
children: field.description
|
|
24151
|
+
}, undefined, false, undefined, this)
|
|
24152
|
+
]
|
|
24153
|
+
}, undefined, true, undefined, this)
|
|
24154
|
+
}, field.name, false, undefined, this))
|
|
24176
24155
|
]
|
|
24177
24156
|
}, undefined, true, undefined, this)
|
|
24178
24157
|
]
|
|
24179
24158
|
}, undefined, true, undefined, this),
|
|
24180
|
-
notice && /* @__PURE__ */
|
|
24159
|
+
notice && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24181
24160
|
className: `toast ${notice.kind}`,
|
|
24182
24161
|
children: [
|
|
24183
|
-
/* @__PURE__ */
|
|
24162
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("b", {
|
|
24184
24163
|
children: notice.kind === "ok" ? "\u2713" : "\u2715"
|
|
24185
24164
|
}, undefined, false, undefined, this),
|
|
24186
24165
|
notice.text
|
|
@@ -24191,188 +24170,78 @@ var AbsoluteConfigPanel = ({
|
|
|
24191
24170
|
};
|
|
24192
24171
|
|
|
24193
24172
|
// src/cli/config/packageJson/PackageJsonPanel.tsx
|
|
24194
|
-
var
|
|
24195
|
-
var
|
|
24173
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
24174
|
+
var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
|
|
24196
24175
|
var matchesQuery5 = (query, text) => query === "" || text.toLowerCase().includes(query.toLowerCase());
|
|
24197
|
-
var
|
|
24198
|
-
|
|
24199
|
-
|
|
24200
|
-
|
|
24201
|
-
className: "seg",
|
|
24202
|
-
children: [
|
|
24203
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("button", {
|
|
24204
|
-
"data-on": value === false,
|
|
24205
|
-
onClick: () => onSave(false),
|
|
24206
|
-
type: "button",
|
|
24207
|
-
children: "false"
|
|
24208
|
-
}, undefined, false, undefined, this),
|
|
24209
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("button", {
|
|
24210
|
-
"data-on": value === true,
|
|
24211
|
-
onClick: () => onSave(true),
|
|
24212
|
-
type: "button",
|
|
24213
|
-
children: "true"
|
|
24214
|
-
}, undefined, false, undefined, this)
|
|
24215
|
-
]
|
|
24216
|
-
}, undefined, true, undefined, this),
|
|
24217
|
-
isSet && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("button", {
|
|
24218
|
-
className: "ts-clear",
|
|
24219
|
-
onClick: () => onSave(undefined, true),
|
|
24220
|
-
type: "button",
|
|
24221
|
-
children: "unset"
|
|
24222
|
-
}, undefined, false, undefined, this)
|
|
24223
|
-
]
|
|
24224
|
-
}, undefined, true, undefined, this);
|
|
24225
|
-
var ChoiceControl2 = ({
|
|
24226
|
-
choices,
|
|
24227
|
-
isSet,
|
|
24228
|
-
onSave,
|
|
24229
|
-
value
|
|
24230
|
-
}) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("select", {
|
|
24231
|
-
className: "ts-select",
|
|
24232
|
-
onChange: (event) => event.target.value === "" ? onSave(undefined, true) : onSave(event.target.value),
|
|
24233
|
-
value: isSet ? String(value) : "",
|
|
24234
|
-
children: [
|
|
24235
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("option", {
|
|
24236
|
-
value: "",
|
|
24237
|
-
children: "\u2014 unset \u2014"
|
|
24238
|
-
}, undefined, false, undefined, this),
|
|
24239
|
-
choices.map((choice) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("option", {
|
|
24240
|
-
value: choice,
|
|
24241
|
-
children: choice
|
|
24242
|
-
}, choice, false, undefined, this))
|
|
24243
|
-
]
|
|
24244
|
-
}, undefined, true, undefined, this);
|
|
24245
|
-
var TextControl4 = ({ numeric, onSave, value }) => {
|
|
24246
|
-
const [draft, setDraft] = import_react5.useState(value === undefined ? "" : String(value));
|
|
24247
|
-
const [error, setError] = import_react5.useState(null);
|
|
24248
|
-
const commit = () => {
|
|
24249
|
-
const text = draft.trim();
|
|
24250
|
-
if (text === "") {
|
|
24251
|
-
onSave(undefined, true);
|
|
24252
|
-
setError(null);
|
|
24253
|
-
return;
|
|
24254
|
-
}
|
|
24255
|
-
if (numeric) {
|
|
24256
|
-
const parsed = Number(text);
|
|
24257
|
-
if (Number.isNaN(parsed)) {
|
|
24258
|
-
setError("Must be a number");
|
|
24259
|
-
return;
|
|
24260
|
-
}
|
|
24261
|
-
onSave(parsed);
|
|
24262
|
-
setError(null);
|
|
24263
|
-
return;
|
|
24264
|
-
}
|
|
24265
|
-
onSave(text);
|
|
24266
|
-
setError(null);
|
|
24267
|
-
};
|
|
24268
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24176
|
+
var FieldRow2 = ({ field, isSet, onSave, value }) => {
|
|
24177
|
+
const [draft, setDraft] = import_react6.useState(value);
|
|
24178
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24179
|
+
className: "rule fe-block",
|
|
24269
24180
|
children: [
|
|
24270
|
-
/* @__PURE__ */
|
|
24271
|
-
className: "
|
|
24181
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24182
|
+
className: "rule-main",
|
|
24272
24183
|
children: [
|
|
24273
|
-
/* @__PURE__ */
|
|
24274
|
-
className:
|
|
24275
|
-
|
|
24276
|
-
|
|
24277
|
-
|
|
24278
|
-
|
|
24279
|
-
|
|
24280
|
-
|
|
24281
|
-
|
|
24282
|
-
|
|
24283
|
-
|
|
24184
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24185
|
+
className: "rule-name-row",
|
|
24186
|
+
children: [
|
|
24187
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24188
|
+
className: "rule-name",
|
|
24189
|
+
children: field.name
|
|
24190
|
+
}, undefined, false, undefined, this),
|
|
24191
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24192
|
+
className: "badge src",
|
|
24193
|
+
children: "set"
|
|
24194
|
+
}, undefined, false, undefined, this)
|
|
24195
|
+
]
|
|
24196
|
+
}, undefined, true, undefined, this),
|
|
24197
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24198
|
+
className: "fe-root",
|
|
24199
|
+
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(FieldEditor, {
|
|
24200
|
+
onChange: setDraft,
|
|
24201
|
+
schema: field.schema,
|
|
24202
|
+
value: draft
|
|
24203
|
+
}, undefined, false, undefined, this)
|
|
24204
|
+
}, undefined, false, undefined, this)
|
|
24205
|
+
]
|
|
24206
|
+
}, undefined, true, undefined, this),
|
|
24207
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24208
|
+
className: "rule-controls fe-actions",
|
|
24209
|
+
children: [
|
|
24210
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("button", {
|
|
24284
24211
|
className: "ts-btn",
|
|
24285
|
-
onClick:
|
|
24212
|
+
onClick: () => onSave(draft),
|
|
24286
24213
|
type: "button",
|
|
24287
24214
|
children: "save"
|
|
24215
|
+
}, undefined, false, undefined, this),
|
|
24216
|
+
isSet && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("button", {
|
|
24217
|
+
className: "ts-clear",
|
|
24218
|
+
onClick: () => onSave(undefined, true),
|
|
24219
|
+
type: "button",
|
|
24220
|
+
children: "unset"
|
|
24288
24221
|
}, undefined, false, undefined, this)
|
|
24289
24222
|
]
|
|
24290
|
-
}, undefined, true, undefined, this)
|
|
24291
|
-
error && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24292
|
-
className: "ts-err",
|
|
24293
|
-
children: error
|
|
24294
|
-
}, undefined, false, undefined, this)
|
|
24295
|
-
]
|
|
24296
|
-
}, undefined, true, undefined, this);
|
|
24297
|
-
};
|
|
24298
|
-
var FieldRow2 = ({ complexKeys, current, field, onSave }) => {
|
|
24299
|
-
const editable = field.kind !== "complex";
|
|
24300
|
-
const isSet = editable ? Object.prototype.hasOwnProperty.call(current, field.name) : complexKeys.includes(field.name);
|
|
24301
|
-
const value = current[field.name];
|
|
24302
|
-
const control = () => {
|
|
24303
|
-
if (field.kind === "boolean") {
|
|
24304
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(BooleanControl4, {
|
|
24305
|
-
isSet,
|
|
24306
|
-
onSave: onSave(field.name),
|
|
24307
|
-
value
|
|
24308
|
-
}, undefined, false, undefined, this);
|
|
24309
|
-
}
|
|
24310
|
-
if (field.kind === "enum") {
|
|
24311
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(ChoiceControl2, {
|
|
24312
|
-
choices: field.choices,
|
|
24313
|
-
isSet,
|
|
24314
|
-
onSave: onSave(field.name),
|
|
24315
|
-
value
|
|
24316
|
-
}, undefined, false, undefined, this);
|
|
24317
|
-
}
|
|
24318
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(TextControl4, {
|
|
24319
|
-
numeric: field.kind === "number",
|
|
24320
|
-
onSave: onSave(field.name),
|
|
24321
|
-
value
|
|
24322
|
-
}, undefined, false, undefined, this);
|
|
24323
|
-
};
|
|
24324
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24325
|
-
className: "rule",
|
|
24326
|
-
children: [
|
|
24327
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24328
|
-
className: "rule-main",
|
|
24329
|
-
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24330
|
-
className: "rule-name-row",
|
|
24331
|
-
children: [
|
|
24332
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24333
|
-
className: "rule-name",
|
|
24334
|
-
children: field.name
|
|
24335
|
-
}, undefined, false, undefined, this),
|
|
24336
|
-
isSet && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24337
|
-
className: "badge src",
|
|
24338
|
-
children: "set"
|
|
24339
|
-
}, undefined, false, undefined, this),
|
|
24340
|
-
!editable && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24341
|
-
className: "badge dep",
|
|
24342
|
-
children: "edit in file"
|
|
24343
|
-
}, undefined, false, undefined, this),
|
|
24344
|
-
field.description !== "" && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24345
|
-
className: "ts-default",
|
|
24346
|
-
children: field.description
|
|
24347
|
-
}, undefined, false, undefined, this)
|
|
24348
|
-
]
|
|
24349
|
-
}, undefined, true, undefined, this)
|
|
24350
|
-
}, undefined, false, undefined, this),
|
|
24351
|
-
editable && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24352
|
-
className: "rule-controls",
|
|
24353
|
-
children: control()
|
|
24354
|
-
}, undefined, false, undefined, this)
|
|
24223
|
+
}, undefined, true, undefined, this)
|
|
24355
24224
|
]
|
|
24356
24225
|
}, undefined, true, undefined, this);
|
|
24357
24226
|
};
|
|
24358
24227
|
var ScriptRow = ({ onRemove, onSave, script }) => {
|
|
24359
|
-
const [draft, setDraft] =
|
|
24360
|
-
return /* @__PURE__ */
|
|
24228
|
+
const [draft, setDraft] = import_react6.useState(script.command);
|
|
24229
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24361
24230
|
className: "rule",
|
|
24362
|
-
children: /* @__PURE__ */
|
|
24231
|
+
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24363
24232
|
className: "rule-main",
|
|
24364
24233
|
children: [
|
|
24365
|
-
/* @__PURE__ */
|
|
24234
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24366
24235
|
className: "rule-name-row",
|
|
24367
|
-
children: /* @__PURE__ */
|
|
24236
|
+
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24368
24237
|
className: "rule-name",
|
|
24369
24238
|
children: script.name
|
|
24370
24239
|
}, undefined, false, undefined, this)
|
|
24371
24240
|
}, undefined, false, undefined, this),
|
|
24372
|
-
/* @__PURE__ */
|
|
24241
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24373
24242
|
className: "ts-control",
|
|
24374
24243
|
children: [
|
|
24375
|
-
/* @__PURE__ */
|
|
24244
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("input", {
|
|
24376
24245
|
className: "ts-input wide",
|
|
24377
24246
|
onChange: (event) => setDraft(event.target.value),
|
|
24378
24247
|
onKeyDown: (event) => {
|
|
@@ -24382,13 +24251,13 @@ var ScriptRow = ({ onRemove, onSave, script }) => {
|
|
|
24382
24251
|
spellCheck: false,
|
|
24383
24252
|
value: draft
|
|
24384
24253
|
}, undefined, false, undefined, this),
|
|
24385
|
-
/* @__PURE__ */
|
|
24254
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("button", {
|
|
24386
24255
|
className: "ts-btn",
|
|
24387
24256
|
onClick: () => onSave(draft),
|
|
24388
24257
|
type: "button",
|
|
24389
24258
|
children: "save"
|
|
24390
24259
|
}, undefined, false, undefined, this),
|
|
24391
|
-
/* @__PURE__ */
|
|
24260
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("button", {
|
|
24392
24261
|
className: "ts-clear",
|
|
24393
24262
|
onClick: onRemove,
|
|
24394
24263
|
type: "button",
|
|
@@ -24401,8 +24270,8 @@ var ScriptRow = ({ onRemove, onSave, script }) => {
|
|
|
24401
24270
|
}, undefined, false, undefined, this);
|
|
24402
24271
|
};
|
|
24403
24272
|
var AddScript = ({ onAdd }) => {
|
|
24404
|
-
const [name, setName] =
|
|
24405
|
-
const [command, setCommand] =
|
|
24273
|
+
const [name, setName] = import_react6.useState("");
|
|
24274
|
+
const [command, setCommand] = import_react6.useState("");
|
|
24406
24275
|
const add = () => {
|
|
24407
24276
|
if (name.trim() === "")
|
|
24408
24277
|
return;
|
|
@@ -24410,21 +24279,21 @@ var AddScript = ({ onAdd }) => {
|
|
|
24410
24279
|
setName("");
|
|
24411
24280
|
setCommand("");
|
|
24412
24281
|
};
|
|
24413
|
-
return /* @__PURE__ */
|
|
24282
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24414
24283
|
className: "rule",
|
|
24415
|
-
children: /* @__PURE__ */
|
|
24284
|
+
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24416
24285
|
className: "rule-main",
|
|
24417
|
-
children: /* @__PURE__ */
|
|
24286
|
+
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24418
24287
|
className: "ts-control",
|
|
24419
24288
|
children: [
|
|
24420
|
-
/* @__PURE__ */
|
|
24289
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("input", {
|
|
24421
24290
|
className: "ts-input",
|
|
24422
24291
|
onChange: (event) => setName(event.target.value),
|
|
24423
24292
|
placeholder: "script name",
|
|
24424
24293
|
spellCheck: false,
|
|
24425
24294
|
value: name
|
|
24426
24295
|
}, undefined, false, undefined, this),
|
|
24427
|
-
/* @__PURE__ */
|
|
24296
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("input", {
|
|
24428
24297
|
className: "ts-input wide",
|
|
24429
24298
|
onChange: (event) => setCommand(event.target.value),
|
|
24430
24299
|
onKeyDown: (event) => {
|
|
@@ -24435,7 +24304,7 @@ var AddScript = ({ onAdd }) => {
|
|
|
24435
24304
|
spellCheck: false,
|
|
24436
24305
|
value: command
|
|
24437
24306
|
}, undefined, false, undefined, this),
|
|
24438
|
-
/* @__PURE__ */
|
|
24307
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("button", {
|
|
24439
24308
|
className: "ts-btn",
|
|
24440
24309
|
onClick: add,
|
|
24441
24310
|
type: "button",
|
|
@@ -24447,9 +24316,9 @@ var AddScript = ({ onAdd }) => {
|
|
|
24447
24316
|
}, undefined, false, undefined, this);
|
|
24448
24317
|
};
|
|
24449
24318
|
var PackageJsonPanel = ({ state: initial }) => {
|
|
24450
|
-
const [state, setState] =
|
|
24451
|
-
const [query, setQuery] =
|
|
24452
|
-
const [notice, setNotice] =
|
|
24319
|
+
const [state, setState] = import_react6.useState(initial);
|
|
24320
|
+
const [query, setQuery] = import_react6.useState("");
|
|
24321
|
+
const [notice, setNotice] = import_react6.useState(null);
|
|
24453
24322
|
const post = async (path, body) => {
|
|
24454
24323
|
setNotice(null);
|
|
24455
24324
|
try {
|
|
@@ -24474,31 +24343,29 @@ var PackageJsonPanel = ({ state: initial }) => {
|
|
|
24474
24343
|
};
|
|
24475
24344
|
const saveField = (name) => (value, remove) => post("/api/package/field", { name, remove, value });
|
|
24476
24345
|
const scripts = state.scripts.filter((script) => matchesQuery5(query, script.name) || matchesQuery5(query, script.command));
|
|
24477
|
-
const
|
|
24478
|
-
|
|
24479
|
-
const advanced = visible.filter((field) => field.kind === "complex");
|
|
24480
|
-
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24346
|
+
const fields = state.fields.filter((field) => matchesQuery5(query, field.name));
|
|
24347
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24481
24348
|
className: "shell",
|
|
24482
24349
|
children: [
|
|
24483
|
-
/* @__PURE__ */
|
|
24350
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("header", {
|
|
24484
24351
|
className: "topbar",
|
|
24485
24352
|
children: [
|
|
24486
|
-
/* @__PURE__ */
|
|
24353
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24487
24354
|
className: "brand",
|
|
24488
24355
|
children: [
|
|
24489
|
-
/* @__PURE__ */
|
|
24356
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h1", {
|
|
24490
24357
|
className: "wordmark",
|
|
24491
24358
|
children: [
|
|
24492
24359
|
"package ",
|
|
24493
|
-
/* @__PURE__ */
|
|
24360
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24494
24361
|
children: ".json"
|
|
24495
24362
|
}, undefined, false, undefined, this)
|
|
24496
24363
|
]
|
|
24497
24364
|
}, undefined, true, undefined, this),
|
|
24498
|
-
/* @__PURE__ */
|
|
24365
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24499
24366
|
className: "subpath",
|
|
24500
24367
|
children: [
|
|
24501
|
-
/* @__PURE__ */
|
|
24368
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24502
24369
|
className: "dot"
|
|
24503
24370
|
}, undefined, false, undefined, this),
|
|
24504
24371
|
state.configPath ?? "no package.json found"
|
|
@@ -24506,27 +24373,27 @@ var PackageJsonPanel = ({ state: initial }) => {
|
|
|
24506
24373
|
}, undefined, true, undefined, this)
|
|
24507
24374
|
]
|
|
24508
24375
|
}, undefined, true, undefined, this),
|
|
24509
|
-
/* @__PURE__ */
|
|
24376
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24510
24377
|
className: "counts",
|
|
24511
24378
|
children: [
|
|
24512
|
-
/* @__PURE__ */
|
|
24379
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24513
24380
|
className: "count",
|
|
24514
24381
|
children: [
|
|
24515
|
-
/* @__PURE__ */
|
|
24382
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("b", {
|
|
24516
24383
|
children: state.scripts.length
|
|
24517
24384
|
}, undefined, false, undefined, this),
|
|
24518
|
-
/* @__PURE__ */
|
|
24385
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24519
24386
|
children: "scripts"
|
|
24520
24387
|
}, undefined, false, undefined, this)
|
|
24521
24388
|
]
|
|
24522
24389
|
}, undefined, true, undefined, this),
|
|
24523
|
-
/* @__PURE__ */
|
|
24390
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24524
24391
|
className: "count",
|
|
24525
24392
|
children: [
|
|
24526
|
-
/* @__PURE__ */
|
|
24527
|
-
children:
|
|
24393
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("b", {
|
|
24394
|
+
children: state.fields.length
|
|
24528
24395
|
}, undefined, false, undefined, this),
|
|
24529
|
-
/* @__PURE__ */
|
|
24396
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24530
24397
|
children: "fields"
|
|
24531
24398
|
}, undefined, false, undefined, this)
|
|
24532
24399
|
]
|
|
@@ -24535,28 +24402,28 @@ var PackageJsonPanel = ({ state: initial }) => {
|
|
|
24535
24402
|
}, undefined, true, undefined, this)
|
|
24536
24403
|
]
|
|
24537
24404
|
}, undefined, true, undefined, this),
|
|
24538
|
-
/* @__PURE__ */
|
|
24405
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24539
24406
|
className: "controls",
|
|
24540
|
-
children: /* @__PURE__ */
|
|
24407
|
+
children: /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("input", {
|
|
24541
24408
|
className: "search",
|
|
24542
24409
|
onChange: (event) => setQuery(event.target.value),
|
|
24543
24410
|
placeholder: "Search scripts or fields\u2026",
|
|
24544
24411
|
value: query
|
|
24545
24412
|
}, undefined, false, undefined, this)
|
|
24546
24413
|
}, undefined, false, undefined, this),
|
|
24547
|
-
/* @__PURE__ */
|
|
24414
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("main", {
|
|
24548
24415
|
children: [
|
|
24549
|
-
/* @__PURE__ */
|
|
24416
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("section", {
|
|
24550
24417
|
className: "section",
|
|
24551
24418
|
children: [
|
|
24552
|
-
/* @__PURE__ */
|
|
24419
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24553
24420
|
className: "section-head",
|
|
24554
24421
|
children: [
|
|
24555
|
-
/* @__PURE__ */
|
|
24422
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24556
24423
|
className: "section-title",
|
|
24557
24424
|
children: "Scripts"
|
|
24558
24425
|
}, undefined, false, undefined, this),
|
|
24559
|
-
/* @__PURE__ */
|
|
24426
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24560
24427
|
className: "section-files",
|
|
24561
24428
|
children: [
|
|
24562
24429
|
state.scripts.length,
|
|
@@ -24565,7 +24432,7 @@ var PackageJsonPanel = ({ state: initial }) => {
|
|
|
24565
24432
|
}, undefined, true, undefined, this)
|
|
24566
24433
|
]
|
|
24567
24434
|
}, undefined, true, undefined, this),
|
|
24568
|
-
scripts.map((script) => /* @__PURE__ */
|
|
24435
|
+
scripts.map((script) => /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(ScriptRow, {
|
|
24569
24436
|
onRemove: () => post("/api/package/script", {
|
|
24570
24437
|
name: script.name,
|
|
24571
24438
|
remove: true
|
|
@@ -24576,68 +24443,44 @@ var PackageJsonPanel = ({ state: initial }) => {
|
|
|
24576
24443
|
}),
|
|
24577
24444
|
script
|
|
24578
24445
|
}, script.name, false, undefined, this)),
|
|
24579
|
-
query === "" && /* @__PURE__ */
|
|
24446
|
+
query === "" && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(AddScript, {
|
|
24580
24447
|
onAdd: (name, command) => post("/api/package/script", { command, name })
|
|
24581
24448
|
}, undefined, false, undefined, this)
|
|
24582
24449
|
]
|
|
24583
24450
|
}, undefined, true, undefined, this),
|
|
24584
|
-
|
|
24451
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("section", {
|
|
24585
24452
|
className: "section",
|
|
24586
24453
|
children: [
|
|
24587
|
-
/* @__PURE__ */
|
|
24454
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24588
24455
|
className: "section-head",
|
|
24589
24456
|
children: [
|
|
24590
|
-
/* @__PURE__ */
|
|
24457
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24591
24458
|
className: "section-title",
|
|
24592
24459
|
children: "Fields"
|
|
24593
24460
|
}, undefined, false, undefined, this),
|
|
24594
|
-
/* @__PURE__ */
|
|
24461
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("span", {
|
|
24595
24462
|
className: "section-files",
|
|
24596
24463
|
children: [
|
|
24597
|
-
|
|
24598
|
-
"
|
|
24464
|
+
state.fields.length,
|
|
24465
|
+
" fields"
|
|
24599
24466
|
]
|
|
24600
24467
|
}, undefined, true, undefined, this)
|
|
24601
24468
|
]
|
|
24602
24469
|
}, undefined, true, undefined, this),
|
|
24603
|
-
|
|
24604
|
-
complexKeys: state.complexKeys,
|
|
24605
|
-
current: state.current,
|
|
24606
|
-
field,
|
|
24607
|
-
onSave: saveField
|
|
24608
|
-
}, field.name, false, undefined, this))
|
|
24609
|
-
]
|
|
24610
|
-
}, undefined, true, undefined, this),
|
|
24611
|
-
advanced.length > 0 && /* @__PURE__ */ jsx_dev_runtime5.jsxDEV("section", {
|
|
24612
|
-
className: "section",
|
|
24613
|
-
children: [
|
|
24614
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("div", {
|
|
24615
|
-
className: "section-head",
|
|
24616
|
-
children: [
|
|
24617
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("h2", {
|
|
24618
|
-
className: "section-title",
|
|
24619
|
-
children: "Advanced"
|
|
24620
|
-
}, undefined, false, undefined, this),
|
|
24621
|
-
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV("span", {
|
|
24622
|
-
className: "section-files",
|
|
24623
|
-
children: "object/array fields \u2014 edit in the file"
|
|
24624
|
-
}, undefined, false, undefined, this)
|
|
24625
|
-
]
|
|
24626
|
-
}, undefined, true, undefined, this),
|
|
24627
|
-
advanced.map((field) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FieldRow2, {
|
|
24628
|
-
complexKeys: state.complexKeys,
|
|
24629
|
-
current: state.current,
|
|
24470
|
+
fields.map((field) => /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(FieldRow2, {
|
|
24630
24471
|
field,
|
|
24631
|
-
|
|
24472
|
+
isSet: Object.prototype.hasOwnProperty.call(state.current, field.name),
|
|
24473
|
+
onSave: saveField(field.name),
|
|
24474
|
+
value: state.current[field.name]
|
|
24632
24475
|
}, field.name, false, undefined, this))
|
|
24633
24476
|
]
|
|
24634
24477
|
}, undefined, true, undefined, this)
|
|
24635
24478
|
]
|
|
24636
24479
|
}, undefined, true, undefined, this),
|
|
24637
|
-
notice && /* @__PURE__ */
|
|
24480
|
+
notice && /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24638
24481
|
className: `toast ${notice.kind}`,
|
|
24639
24482
|
children: [
|
|
24640
|
-
/* @__PURE__ */
|
|
24483
|
+
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("b", {
|
|
24641
24484
|
children: notice.kind === "ok" ? "\u2713" : "\u2715"
|
|
24642
24485
|
}, undefined, false, undefined, this),
|
|
24643
24486
|
notice.text
|
|
@@ -24647,6 +24490,515 @@ var PackageJsonPanel = ({ state: initial }) => {
|
|
|
24647
24490
|
}, undefined, true, undefined, this);
|
|
24648
24491
|
};
|
|
24649
24492
|
|
|
24493
|
+
// src/cli/config/page/PanelHost.tsx
|
|
24494
|
+
var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
|
|
24495
|
+
var ENDPOINTS = {
|
|
24496
|
+
absolute: "/api/absolute",
|
|
24497
|
+
eslint: "/api/rules",
|
|
24498
|
+
package: "/api/package",
|
|
24499
|
+
prettier: "/api/prettier",
|
|
24500
|
+
tsconfig: "/api/tsconfig"
|
|
24501
|
+
};
|
|
24502
|
+
var LABELS = {
|
|
24503
|
+
absolute: "absolute.config",
|
|
24504
|
+
eslint: "ESLint",
|
|
24505
|
+
package: "package.json",
|
|
24506
|
+
prettier: "Prettier",
|
|
24507
|
+
tsconfig: "tsconfig"
|
|
24508
|
+
};
|
|
24509
|
+
var Message = ({ body, title }) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("div", {
|
|
24510
|
+
className: "cfg-placeholder",
|
|
24511
|
+
children: [
|
|
24512
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV("h2", {
|
|
24513
|
+
className: "cfg-placeholder-title",
|
|
24514
|
+
children: title
|
|
24515
|
+
}, undefined, false, undefined, this),
|
|
24516
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV("p", {
|
|
24517
|
+
className: "cfg-placeholder-text",
|
|
24518
|
+
children: body
|
|
24519
|
+
}, undefined, false, undefined, this)
|
|
24520
|
+
]
|
|
24521
|
+
}, undefined, true, undefined, this);
|
|
24522
|
+
var Skeleton = ({ label }) => /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("div", {
|
|
24523
|
+
className: "cfg-placeholder",
|
|
24524
|
+
children: [
|
|
24525
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV("h2", {
|
|
24526
|
+
className: "cfg-placeholder-title cfg-loading",
|
|
24527
|
+
children: [
|
|
24528
|
+
"Loading ",
|
|
24529
|
+
label,
|
|
24530
|
+
"\u2026"
|
|
24531
|
+
]
|
|
24532
|
+
}, undefined, true, undefined, this),
|
|
24533
|
+
/* @__PURE__ */ jsx_dev_runtime7.jsxDEV("p", {
|
|
24534
|
+
className: "cfg-placeholder-text",
|
|
24535
|
+
children: "Reading your configuration."
|
|
24536
|
+
}, undefined, false, undefined, this)
|
|
24537
|
+
]
|
|
24538
|
+
}, undefined, true, undefined, this);
|
|
24539
|
+
var isCatalog = (value) => isRecord(value) && Array.isArray(value.meta) && Array.isArray(value.blocks);
|
|
24540
|
+
var isTsState = (value) => isRecord(value) && Array.isArray(value.options);
|
|
24541
|
+
var isPrettierState = (value) => isRecord(value) && Array.isArray(value.options);
|
|
24542
|
+
var isAbsoluteState = (value) => isRecord(value) && Array.isArray(value.fields);
|
|
24543
|
+
var isPackageState = (value) => isRecord(value) && Array.isArray(value.scripts) && Array.isArray(value.fields);
|
|
24544
|
+
var renderPanel = (panel, data) => {
|
|
24545
|
+
if (panel === "eslint") {
|
|
24546
|
+
return isCatalog(data) && data.configPath ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(EslintPanel, {
|
|
24547
|
+
catalog: data
|
|
24548
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Message, {
|
|
24549
|
+
body: "No flat ESLint config (eslint.config.{js,mjs,cjs,ts}) was found in this project.",
|
|
24550
|
+
title: "No ESLint config"
|
|
24551
|
+
}, undefined, false, undefined, this);
|
|
24552
|
+
}
|
|
24553
|
+
if (panel === "tsconfig") {
|
|
24554
|
+
return isTsState(data) && data.configPath ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(TsconfigPanel, {
|
|
24555
|
+
state: data
|
|
24556
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Message, {
|
|
24557
|
+
body: "No tsconfig.json or jsconfig.json was found in this project.",
|
|
24558
|
+
title: "No tsconfig found"
|
|
24559
|
+
}, undefined, false, undefined, this);
|
|
24560
|
+
}
|
|
24561
|
+
if (panel === "prettier") {
|
|
24562
|
+
return isPrettierState(data) && data.editable ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PrettierPanel, {
|
|
24563
|
+
state: data
|
|
24564
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Message, {
|
|
24565
|
+
body: "Prettier isn't installed, or your config uses a JS/YAML format this editor can't rewrite. Switch to .prettierrc.json to edit it here.",
|
|
24566
|
+
title: "Prettier unavailable"
|
|
24567
|
+
}, undefined, false, undefined, this);
|
|
24568
|
+
}
|
|
24569
|
+
if (panel === "absolute") {
|
|
24570
|
+
return isAbsoluteState(data) && data.configPath ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(AbsoluteConfigPanel, {
|
|
24571
|
+
state: data
|
|
24572
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Message, {
|
|
24573
|
+
body: "No absolute.config.ts was found. Run with --config <path> to point at one.",
|
|
24574
|
+
title: "No absolute.config"
|
|
24575
|
+
}, undefined, false, undefined, this);
|
|
24576
|
+
}
|
|
24577
|
+
if (panel === "package") {
|
|
24578
|
+
return isPackageState(data) && data.configPath ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(PackageJsonPanel, {
|
|
24579
|
+
state: data
|
|
24580
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Message, {
|
|
24581
|
+
body: "No package.json was found in this project.",
|
|
24582
|
+
title: "No package.json"
|
|
24583
|
+
}, undefined, false, undefined, this);
|
|
24584
|
+
}
|
|
24585
|
+
return null;
|
|
24586
|
+
};
|
|
24587
|
+
var PanelHost = ({ panel }) => {
|
|
24588
|
+
const [data, setData] = import_react7.useState(null);
|
|
24589
|
+
const [phase, setPhase] = import_react7.useState("loading");
|
|
24590
|
+
import_react7.useEffect(() => {
|
|
24591
|
+
let active = true;
|
|
24592
|
+
setPhase("loading");
|
|
24593
|
+
fetch(ENDPOINTS[panel]).then((response) => response.json()).then((result) => {
|
|
24594
|
+
if (!active)
|
|
24595
|
+
return;
|
|
24596
|
+
setData(result);
|
|
24597
|
+
setPhase("ready");
|
|
24598
|
+
}).catch(() => {
|
|
24599
|
+
if (active)
|
|
24600
|
+
setPhase("error");
|
|
24601
|
+
});
|
|
24602
|
+
return () => {
|
|
24603
|
+
active = false;
|
|
24604
|
+
};
|
|
24605
|
+
}, [panel]);
|
|
24606
|
+
if (phase === "loading")
|
|
24607
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Skeleton, {
|
|
24608
|
+
label: LABELS[panel]
|
|
24609
|
+
}, undefined, false, undefined, this);
|
|
24610
|
+
if (phase === "error") {
|
|
24611
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV(Message, {
|
|
24612
|
+
body: "The config server didn't respond \u2014 check the terminal where it's running.",
|
|
24613
|
+
title: "Couldn't load"
|
|
24614
|
+
}, undefined, false, undefined, this);
|
|
24615
|
+
}
|
|
24616
|
+
return renderPanel(panel, data);
|
|
24617
|
+
};
|
|
24618
|
+
|
|
24619
|
+
// src/cli/config/eslint/eslintStyles.ts
|
|
24620
|
+
var ESLINT_CSS = `
|
|
24621
|
+
:root {
|
|
24622
|
+
--bg: #0b0c0e;
|
|
24623
|
+
--bg-grid: #14161a;
|
|
24624
|
+
--panel: #111317;
|
|
24625
|
+
--panel-2: #15181d;
|
|
24626
|
+
--border: #23262d;
|
|
24627
|
+
--border-soft: #1b1e23;
|
|
24628
|
+
--text: #e7e9ec;
|
|
24629
|
+
--dim: #82888f;
|
|
24630
|
+
--faint: #565c64;
|
|
24631
|
+
--accent: #cdf25b;
|
|
24632
|
+
--accent-dim: #8ea53a;
|
|
24633
|
+
--off: #565c64;
|
|
24634
|
+
--warn: #f0b429;
|
|
24635
|
+
--error: #ff5d5d;
|
|
24636
|
+
--mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
24637
|
+
--serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
|
|
24638
|
+
}
|
|
24639
|
+
|
|
24640
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
24641
|
+
|
|
24642
|
+
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
|
|
24643
|
+
|
|
24644
|
+
body {
|
|
24645
|
+
background-color: var(--bg);
|
|
24646
|
+
background-image:
|
|
24647
|
+
linear-gradient(var(--bg-grid) 1px, transparent 1px),
|
|
24648
|
+
linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
|
|
24649
|
+
background-size: 44px 44px;
|
|
24650
|
+
background-position: center top;
|
|
24651
|
+
color: var(--text);
|
|
24652
|
+
font-family: var(--mono);
|
|
24653
|
+
font-size: 13px;
|
|
24654
|
+
line-height: 1.5;
|
|
24655
|
+
min-height: 100vh;
|
|
24656
|
+
}
|
|
24657
|
+
|
|
24658
|
+
body::before {
|
|
24659
|
+
content: '';
|
|
24660
|
+
position: fixed;
|
|
24661
|
+
inset: 0;
|
|
24662
|
+
background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(205, 242, 91, 0.06), transparent 70%);
|
|
24663
|
+
pointer-events: none;
|
|
24664
|
+
z-index: 0;
|
|
24665
|
+
}
|
|
24666
|
+
|
|
24667
|
+
.shell { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 28px 80px; }
|
|
24668
|
+
|
|
24669
|
+
/* ---- header ---- */
|
|
24670
|
+
.topbar {
|
|
24671
|
+
display: flex;
|
|
24672
|
+
align-items: flex-end;
|
|
24673
|
+
justify-content: space-between;
|
|
24674
|
+
gap: 24px;
|
|
24675
|
+
padding: 34px 0 22px;
|
|
24676
|
+
border-bottom: 1px solid var(--border);
|
|
24677
|
+
flex-wrap: wrap;
|
|
24678
|
+
}
|
|
24679
|
+
.brand { display: flex; flex-direction: column; gap: 2px; }
|
|
24680
|
+
.wordmark {
|
|
24681
|
+
font-family: var(--serif);
|
|
24682
|
+
font-size: 42px;
|
|
24683
|
+
line-height: 0.9;
|
|
24684
|
+
letter-spacing: -0.01em;
|
|
24685
|
+
font-weight: 400;
|
|
24686
|
+
}
|
|
24687
|
+
.wordmark em { color: var(--accent); font-style: italic; }
|
|
24688
|
+
.subpath {
|
|
24689
|
+
font-size: 11px;
|
|
24690
|
+
color: var(--dim);
|
|
24691
|
+
letter-spacing: 0.02em;
|
|
24692
|
+
display: flex;
|
|
24693
|
+
align-items: center;
|
|
24694
|
+
gap: 8px;
|
|
24695
|
+
}
|
|
24696
|
+
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
|
|
24697
|
+
.counts { display: flex; gap: 26px; }
|
|
24698
|
+
.count { text-align: right; }
|
|
24699
|
+
.count b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
|
|
24700
|
+
.count span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
|
|
24701
|
+
|
|
24702
|
+
/* ---- controls row ---- */
|
|
24703
|
+
.controls { display: flex; gap: 12px; align-items: center; padding: 18px 0; flex-wrap: wrap; }
|
|
24704
|
+
.tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
|
|
24705
|
+
.tab {
|
|
24706
|
+
font-family: var(--mono);
|
|
24707
|
+
font-size: 12px;
|
|
24708
|
+
color: var(--dim);
|
|
24709
|
+
background: transparent;
|
|
24710
|
+
border: 0;
|
|
24711
|
+
padding: 7px 16px;
|
|
24712
|
+
border-radius: 6px;
|
|
24713
|
+
cursor: pointer;
|
|
24714
|
+
transition: color 0.15s, background 0.15s;
|
|
24715
|
+
letter-spacing: 0.01em;
|
|
24716
|
+
}
|
|
24717
|
+
.tab:hover { color: var(--text); }
|
|
24718
|
+
.tab[data-active='true'] { background: var(--panel-2); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }
|
|
24719
|
+
.search {
|
|
24720
|
+
flex: 1;
|
|
24721
|
+
min-width: 220px;
|
|
24722
|
+
font-family: var(--mono);
|
|
24723
|
+
font-size: 13px;
|
|
24724
|
+
color: var(--text);
|
|
24725
|
+
background: var(--panel);
|
|
24726
|
+
border: 1px solid var(--border);
|
|
24727
|
+
border-radius: 9px;
|
|
24728
|
+
padding: 10px 14px;
|
|
24729
|
+
outline: none;
|
|
24730
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
24731
|
+
}
|
|
24732
|
+
.search:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(205, 242, 91, 0.08); }
|
|
24733
|
+
.search::placeholder { color: var(--faint); }
|
|
24734
|
+
.scope {
|
|
24735
|
+
min-width: 250px;
|
|
24736
|
+
font-family: var(--mono);
|
|
24737
|
+
font-size: 12.5px;
|
|
24738
|
+
color: var(--accent);
|
|
24739
|
+
background: var(--bg);
|
|
24740
|
+
border: 1px solid var(--border);
|
|
24741
|
+
border-radius: 9px;
|
|
24742
|
+
padding: 10px 14px;
|
|
24743
|
+
outline: none;
|
|
24744
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
24745
|
+
}
|
|
24746
|
+
.scope:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(205, 242, 91, 0.08); }
|
|
24747
|
+
.scope::placeholder { color: var(--faint); }
|
|
24748
|
+
.scope-clear {
|
|
24749
|
+
font-family: var(--mono);
|
|
24750
|
+
font-size: 11px;
|
|
24751
|
+
color: var(--dim);
|
|
24752
|
+
background: var(--panel);
|
|
24753
|
+
border: 1px solid var(--border);
|
|
24754
|
+
border-radius: 8px;
|
|
24755
|
+
padding: 9px 12px;
|
|
24756
|
+
cursor: pointer;
|
|
24757
|
+
transition: color 0.15s, border-color 0.15s;
|
|
24758
|
+
}
|
|
24759
|
+
.scope-clear:hover { color: var(--error); border-color: rgba(255, 93, 93, 0.4); }
|
|
24760
|
+
|
|
24761
|
+
/* ---- rule controls + options editor ---- */
|
|
24762
|
+
.rule-controls { display: flex; align-items: center; gap: 8px; }
|
|
24763
|
+
.opts-toggle {
|
|
24764
|
+
font-family: var(--mono);
|
|
24765
|
+
font-size: 11px;
|
|
24766
|
+
color: var(--faint);
|
|
24767
|
+
background: transparent;
|
|
24768
|
+
border: 1px solid var(--border);
|
|
24769
|
+
border-radius: 7px;
|
|
24770
|
+
padding: 6px 10px;
|
|
24771
|
+
cursor: pointer;
|
|
24772
|
+
transition: color 0.13s, border-color 0.13s, background 0.13s;
|
|
24773
|
+
}
|
|
24774
|
+
.opts-toggle:hover { color: var(--text); }
|
|
24775
|
+
.opts-toggle[data-on='true'] { color: var(--accent); border-color: var(--accent-dim); background: rgba(205, 242, 91, 0.06); }
|
|
24776
|
+
.opts-editor { margin-top: 10px; max-width: 70ch; }
|
|
24777
|
+
.opts-input {
|
|
24778
|
+
width: 100%;
|
|
24779
|
+
font-family: var(--mono);
|
|
24780
|
+
font-size: 12px;
|
|
24781
|
+
line-height: 1.5;
|
|
24782
|
+
color: var(--text);
|
|
24783
|
+
background: var(--bg);
|
|
24784
|
+
border: 1px solid var(--border);
|
|
24785
|
+
border-radius: 8px;
|
|
24786
|
+
padding: 10px 12px;
|
|
24787
|
+
resize: vertical;
|
|
24788
|
+
outline: none;
|
|
24789
|
+
}
|
|
24790
|
+
.opts-input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(205, 242, 91, 0.08); }
|
|
24791
|
+
.opts-error { color: var(--error); font-size: 11px; margin-top: 6px; white-space: pre-wrap; }
|
|
24792
|
+
.opts-actions { display: flex; gap: 8px; margin-top: 8px; }
|
|
24793
|
+
.opts-btn {
|
|
24794
|
+
font-family: var(--mono);
|
|
24795
|
+
font-size: 11px;
|
|
24796
|
+
color: var(--dim);
|
|
24797
|
+
background: var(--panel);
|
|
24798
|
+
border: 1px solid var(--border);
|
|
24799
|
+
border-radius: 7px;
|
|
24800
|
+
padding: 7px 13px;
|
|
24801
|
+
cursor: pointer;
|
|
24802
|
+
transition: color 0.13s, border-color 0.13s;
|
|
24803
|
+
}
|
|
24804
|
+
.opts-btn:hover { color: var(--text); }
|
|
24805
|
+
.opts-btn.save { color: var(--accent); border-color: var(--accent-dim); }
|
|
24806
|
+
.opts-btn.save:hover { background: rgba(205, 242, 91, 0.08); }
|
|
24807
|
+
|
|
24808
|
+
/* ---- layout ---- */
|
|
24809
|
+
.layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; margin-top: 20px; align-items: start; }
|
|
24810
|
+
.rail { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 3px; }
|
|
24811
|
+
.rail-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--faint); padding: 4px 10px 8px; }
|
|
24812
|
+
.source-btn {
|
|
24813
|
+
display: flex;
|
|
24814
|
+
align-items: center;
|
|
24815
|
+
justify-content: space-between;
|
|
24816
|
+
gap: 8px;
|
|
24817
|
+
font-family: var(--mono);
|
|
24818
|
+
font-size: 12px;
|
|
24819
|
+
color: var(--dim);
|
|
24820
|
+
background: transparent;
|
|
24821
|
+
border: 0;
|
|
24822
|
+
border-left: 2px solid transparent;
|
|
24823
|
+
padding: 7px 10px;
|
|
24824
|
+
cursor: pointer;
|
|
24825
|
+
text-align: left;
|
|
24826
|
+
transition: color 0.15s, background 0.12s, border-color 0.15s;
|
|
24827
|
+
border-radius: 0 6px 6px 0;
|
|
24828
|
+
}
|
|
24829
|
+
.source-btn:hover { color: var(--text); background: var(--panel); }
|
|
24830
|
+
.source-btn[data-active='true'] { color: var(--accent); border-left-color: var(--accent); background: var(--panel); }
|
|
24831
|
+
.source-btn .n { font-size: 11px; color: var(--faint); }
|
|
24832
|
+
.source-btn[data-active='true'] .n { color: var(--accent-dim); }
|
|
24833
|
+
|
|
24834
|
+
/* ---- rule list ---- */
|
|
24835
|
+
.section { margin-bottom: 30px; animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
|
|
24836
|
+
.section-head { display: flex; align-items: baseline; gap: 12px; padding: 0 2px 10px; border-bottom: 1px dashed var(--border-soft); margin-bottom: 4px; }
|
|
24837
|
+
.section-title { font-family: var(--serif); font-size: 22px; font-style: italic; }
|
|
24838
|
+
.section-files { font-size: 11px; color: var(--faint); }
|
|
24839
|
+
|
|
24840
|
+
.rule {
|
|
24841
|
+
display: grid;
|
|
24842
|
+
grid-template-columns: 1fr auto;
|
|
24843
|
+
gap: 14px;
|
|
24844
|
+
align-items: center;
|
|
24845
|
+
padding: 13px 14px;
|
|
24846
|
+
border: 1px solid transparent;
|
|
24847
|
+
border-radius: 10px;
|
|
24848
|
+
transition: background 0.14s, border-color 0.14s;
|
|
24849
|
+
position: relative;
|
|
24850
|
+
}
|
|
24851
|
+
.rule:hover { background: var(--panel); border-color: var(--border-soft); }
|
|
24852
|
+
.rule-main { min-width: 0; }
|
|
24853
|
+
.rule-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
|
|
24854
|
+
.rule-name { font-size: 13.5px; color: var(--text); letter-spacing: -0.01em; }
|
|
24855
|
+
.rule-name .pfx { color: var(--faint); }
|
|
24856
|
+
.badge {
|
|
24857
|
+
font-size: 9.5px;
|
|
24858
|
+
text-transform: uppercase;
|
|
24859
|
+
letter-spacing: 0.08em;
|
|
24860
|
+
padding: 2px 6px;
|
|
24861
|
+
border-radius: 4px;
|
|
24862
|
+
border: 1px solid var(--border);
|
|
24863
|
+
color: var(--dim);
|
|
24864
|
+
background: var(--panel-2);
|
|
24865
|
+
}
|
|
24866
|
+
.badge.src { color: var(--accent-dim); border-color: rgba(205, 242, 91, 0.2); }
|
|
24867
|
+
.badge.fix { color: #6cc6ff; border-color: rgba(108, 198, 255, 0.22); }
|
|
24868
|
+
.badge.dep { color: var(--warn); border-color: rgba(240, 180, 41, 0.25); }
|
|
24869
|
+
.rule-desc { font-size: 11.5px; color: var(--dim); margin-top: 4px; max-width: 64ch; line-height: 1.45; }
|
|
24870
|
+
.rule-opts { font-size: 11px; color: var(--accent-dim); margin-top: 5px; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 5px; padding: 3px 7px; display: inline-block; white-space: pre-wrap; word-break: break-word; }
|
|
24871
|
+
.docs { color: var(--faint); text-decoration: none; transition: color 0.15s; font-size: 11px; }
|
|
24872
|
+
.docs:hover { color: var(--accent); }
|
|
24873
|
+
|
|
24874
|
+
/* ---- severity segmented control ---- */
|
|
24875
|
+
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
|
|
24876
|
+
.seg button {
|
|
24877
|
+
font-family: var(--mono);
|
|
24878
|
+
font-size: 11px;
|
|
24879
|
+
letter-spacing: 0.02em;
|
|
24880
|
+
color: var(--faint);
|
|
24881
|
+
background: transparent;
|
|
24882
|
+
border: 0;
|
|
24883
|
+
padding: 5px 11px;
|
|
24884
|
+
border-radius: 6px;
|
|
24885
|
+
cursor: pointer;
|
|
24886
|
+
transition: color 0.13s, background 0.13s, box-shadow 0.13s;
|
|
24887
|
+
}
|
|
24888
|
+
.seg button:hover:not([data-on='true']) { color: var(--text); }
|
|
24889
|
+
.seg button[data-sev='off'][data-on='true'] { background: rgba(86, 92, 100, 0.22); color: #c2c7cd; box-shadow: inset 0 0 0 1px rgba(130,136,143,0.4); }
|
|
24890
|
+
.seg button[data-sev='warn'][data-on='true'] { background: rgba(240, 180, 41, 0.16); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(240,180,41,0.45); }
|
|
24891
|
+
.seg button[data-sev='error'][data-on='true'] { background: rgba(255, 93, 93, 0.15); color: var(--error); box-shadow: inset 0 0 0 1px rgba(255,93,93,0.45); }
|
|
24892
|
+
.seg.busy { opacity: 0.45; pointer-events: none; }
|
|
24893
|
+
|
|
24894
|
+
.cat-control { display: flex; align-items: center; }
|
|
24895
|
+
.effective { font-size: 10px; color: var(--faint); margin-right: 10px; letter-spacing: 0.04em; }
|
|
24896
|
+
.effective b { color: var(--dim); }
|
|
24897
|
+
|
|
24898
|
+
/* ---- toast ---- */
|
|
24899
|
+
.toast {
|
|
24900
|
+
position: fixed;
|
|
24901
|
+
bottom: 22px;
|
|
24902
|
+
left: 50%;
|
|
24903
|
+
transform: translateX(-50%);
|
|
24904
|
+
z-index: 50;
|
|
24905
|
+
font-family: var(--mono);
|
|
24906
|
+
font-size: 12px;
|
|
24907
|
+
padding: 11px 18px;
|
|
24908
|
+
border-radius: 10px;
|
|
24909
|
+
border: 1px solid var(--border);
|
|
24910
|
+
background: var(--panel-2);
|
|
24911
|
+
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
|
|
24912
|
+
animation: rise 0.3s ease both;
|
|
24913
|
+
display: flex;
|
|
24914
|
+
align-items: center;
|
|
24915
|
+
gap: 10px;
|
|
24916
|
+
}
|
|
24917
|
+
.toast b { font-size: 14px; }
|
|
24918
|
+
.toast.ok b { color: var(--accent); }
|
|
24919
|
+
.toast.err b { color: var(--error); }
|
|
24920
|
+
|
|
24921
|
+
.empty { padding: 60px 20px; text-align: center; color: var(--faint); font-size: 13px; }
|
|
24922
|
+
.more { padding: 18px 4px; font-size: 11px; color: var(--faint); text-align: center; }
|
|
24923
|
+
|
|
24924
|
+
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
|
|
24925
|
+
|
|
24926
|
+
@media (max-width: 820px) {
|
|
24927
|
+
.layout { grid-template-columns: 1fr; }
|
|
24928
|
+
.rail { position: static; flex-direction: row; flex-wrap: wrap; }
|
|
24929
|
+
.wordmark { font-size: 34px; }
|
|
24930
|
+
}
|
|
24931
|
+
`;
|
|
24932
|
+
|
|
24933
|
+
// src/cli/config/tsconfig/tsconfigStyles.ts
|
|
24934
|
+
var TSCONFIG_CSS = `
|
|
24935
|
+
.ts-control { display: flex; align-items: center; gap: 8px; }
|
|
24936
|
+
|
|
24937
|
+
.ts-select {
|
|
24938
|
+
appearance: none;
|
|
24939
|
+
font-family: var(--mono);
|
|
24940
|
+
font-size: 12px;
|
|
24941
|
+
color: var(--text);
|
|
24942
|
+
background: var(--panel-2);
|
|
24943
|
+
border: 1px solid var(--border);
|
|
24944
|
+
border-radius: 7px;
|
|
24945
|
+
padding: 6px 28px 6px 10px;
|
|
24946
|
+
background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
|
|
24947
|
+
linear-gradient(135deg, var(--dim) 50%, transparent 50%);
|
|
24948
|
+
background-position: right 12px center, right 7px center;
|
|
24949
|
+
background-size: 5px 5px, 5px 5px;
|
|
24950
|
+
background-repeat: no-repeat;
|
|
24951
|
+
cursor: pointer;
|
|
24952
|
+
}
|
|
24953
|
+
.ts-select:hover { border-color: var(--accent-dim); }
|
|
24954
|
+
|
|
24955
|
+
.ts-input {
|
|
24956
|
+
font-family: var(--mono);
|
|
24957
|
+
font-size: 12px;
|
|
24958
|
+
color: var(--text);
|
|
24959
|
+
background: var(--panel-2);
|
|
24960
|
+
border: 1px solid var(--border);
|
|
24961
|
+
border-radius: 7px;
|
|
24962
|
+
padding: 6px 10px;
|
|
24963
|
+
min-width: 220px;
|
|
24964
|
+
}
|
|
24965
|
+
.ts-input:focus { outline: none; border-color: var(--accent); }
|
|
24966
|
+
.ts-input.err { border-color: var(--error); }
|
|
24967
|
+
.ts-input.wide { flex: 1; min-width: 320px; }
|
|
24968
|
+
|
|
24969
|
+
.ts-btn {
|
|
24970
|
+
font-family: var(--mono);
|
|
24971
|
+
font-size: 11px;
|
|
24972
|
+
color: var(--bg);
|
|
24973
|
+
background: var(--accent);
|
|
24974
|
+
border: none;
|
|
24975
|
+
border-radius: 7px;
|
|
24976
|
+
padding: 6px 12px;
|
|
24977
|
+
cursor: pointer;
|
|
24978
|
+
}
|
|
24979
|
+
.ts-btn:hover { background: var(--accent-dim); }
|
|
24980
|
+
|
|
24981
|
+
.ts-clear {
|
|
24982
|
+
font-family: var(--mono);
|
|
24983
|
+
font-size: 11px;
|
|
24984
|
+
color: var(--dim);
|
|
24985
|
+
background: transparent;
|
|
24986
|
+
border: 1px solid var(--border);
|
|
24987
|
+
border-radius: 7px;
|
|
24988
|
+
padding: 6px 10px;
|
|
24989
|
+
cursor: pointer;
|
|
24990
|
+
}
|
|
24991
|
+
.ts-clear:hover { color: var(--error); border-color: var(--error); }
|
|
24992
|
+
|
|
24993
|
+
.ts-current {
|
|
24994
|
+
font-family: var(--mono);
|
|
24995
|
+
font-size: 11px;
|
|
24996
|
+
color: var(--accent);
|
|
24997
|
+
}
|
|
24998
|
+
.ts-default { color: var(--faint); font-size: 11px; }
|
|
24999
|
+
.ts-err { color: var(--error); font-size: 11px; margin-top: 6px; }
|
|
25000
|
+
`;
|
|
25001
|
+
|
|
24650
25002
|
// src/cli/config/page/configStyles.ts
|
|
24651
25003
|
var CONFIG_CSS = `
|
|
24652
25004
|
.cfg {
|
|
@@ -24731,6 +25083,52 @@ var CONFIG_CSS = `
|
|
|
24731
25083
|
.cfg-placeholder-title { font-family: var(--serif); font-size: 40px; margin-bottom: 12px; }
|
|
24732
25084
|
.cfg-placeholder-title em { color: var(--accent); font-style: italic; }
|
|
24733
25085
|
.cfg-placeholder-text { color: var(--dim); font-size: 14px; max-width: 460px; margin: 0 auto; }
|
|
25086
|
+
.cfg-loading { animation: cfg-pulse 1.2s ease-in-out infinite; }
|
|
25087
|
+
@keyframes cfg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
|
|
25088
|
+
|
|
25089
|
+
/* ---- recursive field editor ---- */
|
|
25090
|
+
.fe-block { align-items: flex-start; }
|
|
25091
|
+
.fe-root { margin-top: 10px; width: 100%; }
|
|
25092
|
+
.fe-actions { flex-direction: column; gap: 6px; }
|
|
25093
|
+
.fe-object {
|
|
25094
|
+
display: flex;
|
|
25095
|
+
flex-direction: column;
|
|
25096
|
+
gap: 10px;
|
|
25097
|
+
border-left: 2px solid var(--border);
|
|
25098
|
+
padding-left: 14px;
|
|
25099
|
+
}
|
|
25100
|
+
.fe-field { display: flex; flex-direction: column; gap: 4px; }
|
|
25101
|
+
.fe-label { display: flex; align-items: center; gap: 8px; }
|
|
25102
|
+
.fe-name { color: var(--dim); font-size: 12px; }
|
|
25103
|
+
.fe-array, .fe-record, .fe-union { display: flex; flex-direction: column; gap: 6px; }
|
|
25104
|
+
.fe-item, .fe-entry { display: flex; align-items: flex-start; gap: 6px; }
|
|
25105
|
+
.fe-key { min-width: 160px; flex: 0 0 auto; }
|
|
25106
|
+
.fe-add {
|
|
25107
|
+
align-self: flex-start;
|
|
25108
|
+
font-family: var(--mono);
|
|
25109
|
+
font-size: 11px;
|
|
25110
|
+
color: var(--accent);
|
|
25111
|
+
background: transparent;
|
|
25112
|
+
border: 1px dashed var(--border);
|
|
25113
|
+
border-radius: 7px;
|
|
25114
|
+
padding: 4px 10px;
|
|
25115
|
+
cursor: pointer;
|
|
25116
|
+
}
|
|
25117
|
+
.fe-add:hover { border-color: var(--accent); }
|
|
25118
|
+
.fe-remove {
|
|
25119
|
+
font-family: var(--mono);
|
|
25120
|
+
font-size: 11px;
|
|
25121
|
+
color: var(--dim);
|
|
25122
|
+
background: transparent;
|
|
25123
|
+
border: 1px solid var(--border);
|
|
25124
|
+
border-radius: 7px;
|
|
25125
|
+
padding: 4px 8px;
|
|
25126
|
+
cursor: pointer;
|
|
25127
|
+
}
|
|
25128
|
+
.fe-remove:hover { color: var(--error); border-color: var(--error); }
|
|
25129
|
+
.fe-type { color: var(--faint); font-size: 11px; margin-top: 4px; }
|
|
25130
|
+
.fe-raw { width: 100%; }
|
|
25131
|
+
.fe-raw .opts-input { width: 100%; }
|
|
24734
25132
|
|
|
24735
25133
|
@media (max-width: 720px) {
|
|
24736
25134
|
.cfg { flex-direction: column; }
|
|
@@ -24781,272 +25179,103 @@ var CONFIG_PANELS = [
|
|
|
24781
25179
|
var DEFAULT_PANEL = "absolute";
|
|
24782
25180
|
|
|
24783
25181
|
// src/cli/config/page/ConfigShell.tsx
|
|
24784
|
-
var
|
|
24785
|
-
var NavItem = ({ active, panel }) => /* @__PURE__ */
|
|
25182
|
+
var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
25183
|
+
var NavItem = ({ active, panel }) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("a", {
|
|
24786
25184
|
className: "cfg-item",
|
|
24787
25185
|
"data-active": active,
|
|
24788
25186
|
"data-soon": panel.status === "soon",
|
|
24789
25187
|
href: `/${panel.id}`,
|
|
24790
25188
|
children: [
|
|
24791
|
-
/* @__PURE__ */
|
|
25189
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
24792
25190
|
className: "cfg-item-top",
|
|
24793
25191
|
children: [
|
|
24794
|
-
/* @__PURE__ */
|
|
25192
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
24795
25193
|
className: "cfg-item-name",
|
|
24796
25194
|
children: panel.label
|
|
24797
25195
|
}, undefined, false, undefined, this),
|
|
24798
|
-
panel.status === "soon" && /* @__PURE__ */
|
|
25196
|
+
panel.status === "soon" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
24799
25197
|
className: "cfg-soon",
|
|
24800
25198
|
children: "soon"
|
|
24801
25199
|
}, undefined, false, undefined, this)
|
|
24802
25200
|
]
|
|
24803
25201
|
}, undefined, true, undefined, this),
|
|
24804
|
-
/* @__PURE__ */
|
|
25202
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
24805
25203
|
className: "cfg-item-blurb",
|
|
24806
25204
|
children: panel.blurb
|
|
24807
25205
|
}, undefined, false, undefined, this)
|
|
24808
25206
|
]
|
|
24809
25207
|
}, undefined, true, undefined, this);
|
|
24810
|
-
var
|
|
24811
|
-
className: "cfg-placeholder",
|
|
24812
|
-
children: [
|
|
24813
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24814
|
-
className: "cfg-placeholder-title",
|
|
24815
|
-
children: [
|
|
24816
|
-
title,
|
|
24817
|
-
" ",
|
|
24818
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24819
|
-
children: "coming soon"
|
|
24820
|
-
}, undefined, false, undefined, this)
|
|
24821
|
-
]
|
|
24822
|
-
}, undefined, true, undefined, this),
|
|
24823
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("p", {
|
|
24824
|
-
className: "cfg-placeholder-text",
|
|
24825
|
-
children: body
|
|
24826
|
-
}, undefined, false, undefined, this)
|
|
24827
|
-
]
|
|
24828
|
-
}, undefined, true, undefined, this);
|
|
24829
|
-
var renderBody = ({
|
|
24830
|
-
absoluteConfigState,
|
|
24831
|
-
active,
|
|
24832
|
-
eslintCatalog,
|
|
24833
|
-
packageJsonState,
|
|
24834
|
-
panel,
|
|
24835
|
-
prettierState,
|
|
24836
|
-
tsconfigState
|
|
24837
|
-
}) => {
|
|
24838
|
-
if (panel === "absolute") {
|
|
24839
|
-
if (absoluteConfigState?.configPath) {
|
|
24840
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(AbsoluteConfigPanel, {
|
|
24841
|
-
state: absoluteConfigState
|
|
24842
|
-
}, undefined, false, undefined, this);
|
|
24843
|
-
}
|
|
24844
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24845
|
-
className: "cfg-placeholder",
|
|
24846
|
-
children: [
|
|
24847
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24848
|
-
className: "cfg-placeholder-title",
|
|
24849
|
-
children: [
|
|
24850
|
-
"No ",
|
|
24851
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24852
|
-
children: "absolute.config"
|
|
24853
|
-
}, undefined, false, undefined, this)
|
|
24854
|
-
]
|
|
24855
|
-
}, undefined, true, undefined, this),
|
|
24856
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("p", {
|
|
24857
|
-
className: "cfg-placeholder-text",
|
|
24858
|
-
children: "No absolute.config.ts was found in this project."
|
|
24859
|
-
}, undefined, false, undefined, this)
|
|
24860
|
-
]
|
|
24861
|
-
}, undefined, true, undefined, this);
|
|
24862
|
-
}
|
|
24863
|
-
if (panel === "package") {
|
|
24864
|
-
if (packageJsonState?.configPath) {
|
|
24865
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(PackageJsonPanel, {
|
|
24866
|
-
state: packageJsonState
|
|
24867
|
-
}, undefined, false, undefined, this);
|
|
24868
|
-
}
|
|
24869
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24870
|
-
className: "cfg-placeholder",
|
|
24871
|
-
children: [
|
|
24872
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24873
|
-
className: "cfg-placeholder-title",
|
|
24874
|
-
children: [
|
|
24875
|
-
"No ",
|
|
24876
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24877
|
-
children: "package.json"
|
|
24878
|
-
}, undefined, false, undefined, this)
|
|
24879
|
-
]
|
|
24880
|
-
}, undefined, true, undefined, this),
|
|
24881
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("p", {
|
|
24882
|
-
className: "cfg-placeholder-text",
|
|
24883
|
-
children: "No package.json was found in this project."
|
|
24884
|
-
}, undefined, false, undefined, this)
|
|
24885
|
-
]
|
|
24886
|
-
}, undefined, true, undefined, this);
|
|
24887
|
-
}
|
|
24888
|
-
if (panel === "eslint") {
|
|
24889
|
-
if (eslintCatalog)
|
|
24890
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(EslintPanel, {
|
|
24891
|
-
catalog: eslintCatalog
|
|
24892
|
-
}, undefined, false, undefined, this);
|
|
24893
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24894
|
-
className: "cfg-placeholder",
|
|
24895
|
-
children: [
|
|
24896
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24897
|
-
className: "cfg-placeholder-title",
|
|
24898
|
-
children: [
|
|
24899
|
-
"No ",
|
|
24900
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24901
|
-
children: "ESLint"
|
|
24902
|
-
}, undefined, false, undefined, this),
|
|
24903
|
-
" config"
|
|
24904
|
-
]
|
|
24905
|
-
}, undefined, true, undefined, this),
|
|
24906
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("p", {
|
|
24907
|
-
className: "cfg-placeholder-text",
|
|
24908
|
-
children: "No flat ESLint config (eslint.config.{js,mjs,cjs,ts}) was found in this project."
|
|
24909
|
-
}, undefined, false, undefined, this)
|
|
24910
|
-
]
|
|
24911
|
-
}, undefined, true, undefined, this);
|
|
24912
|
-
}
|
|
24913
|
-
if (panel === "tsconfig") {
|
|
24914
|
-
if (tsconfigState?.configPath) {
|
|
24915
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(TsconfigPanel, {
|
|
24916
|
-
state: tsconfigState
|
|
24917
|
-
}, undefined, false, undefined, this);
|
|
24918
|
-
}
|
|
24919
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24920
|
-
className: "cfg-placeholder",
|
|
24921
|
-
children: [
|
|
24922
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24923
|
-
className: "cfg-placeholder-title",
|
|
24924
|
-
children: [
|
|
24925
|
-
"No ",
|
|
24926
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24927
|
-
children: "tsconfig"
|
|
24928
|
-
}, undefined, false, undefined, this),
|
|
24929
|
-
" found"
|
|
24930
|
-
]
|
|
24931
|
-
}, undefined, true, undefined, this),
|
|
24932
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("p", {
|
|
24933
|
-
className: "cfg-placeholder-text",
|
|
24934
|
-
children: "No tsconfig.json or jsconfig.json was found in this project."
|
|
24935
|
-
}, undefined, false, undefined, this)
|
|
24936
|
-
]
|
|
24937
|
-
}, undefined, true, undefined, this);
|
|
24938
|
-
}
|
|
24939
|
-
if (panel === "prettier") {
|
|
24940
|
-
if (prettierState?.editable) {
|
|
24941
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(PrettierPanel, {
|
|
24942
|
-
state: prettierState
|
|
24943
|
-
}, undefined, false, undefined, this);
|
|
24944
|
-
}
|
|
24945
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("div", {
|
|
24946
|
-
className: "cfg-placeholder",
|
|
24947
|
-
children: [
|
|
24948
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("h2", {
|
|
24949
|
-
className: "cfg-placeholder-title",
|
|
24950
|
-
children: [
|
|
24951
|
-
"Prettier ",
|
|
24952
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("em", {
|
|
24953
|
-
children: "unavailable"
|
|
24954
|
-
}, undefined, false, undefined, this)
|
|
24955
|
-
]
|
|
24956
|
-
}, undefined, true, undefined, this),
|
|
24957
|
-
/* @__PURE__ */ jsx_dev_runtime6.jsxDEV("p", {
|
|
24958
|
-
className: "cfg-placeholder-text",
|
|
24959
|
-
children: prettierState && !prettierState.available ? "Prettier is not installed in this project." : "Your prettier config uses a JS/YAML format that this editor cannot rewrite. Switch to .prettierrc.json to edit it here."
|
|
24960
|
-
}, undefined, false, undefined, this)
|
|
24961
|
-
]
|
|
24962
|
-
}, undefined, true, undefined, this);
|
|
24963
|
-
}
|
|
24964
|
-
if (active) {
|
|
24965
|
-
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Placeholder, {
|
|
24966
|
-
body: `This panel will let you edit ${active.blurb.toLowerCase()} from the same place. It's next on the list.`,
|
|
24967
|
-
title: active.label
|
|
24968
|
-
}, undefined, false, undefined, this);
|
|
24969
|
-
}
|
|
24970
|
-
return null;
|
|
24971
|
-
};
|
|
24972
|
-
var ConfigShell = ({
|
|
24973
|
-
absoluteConfigState,
|
|
24974
|
-
eslintCatalog,
|
|
24975
|
-
packageJsonState,
|
|
24976
|
-
panel,
|
|
24977
|
-
prettierState,
|
|
24978
|
-
tsconfigState
|
|
24979
|
-
}) => {
|
|
25208
|
+
var ConfigShell = ({ panel }) => {
|
|
24980
25209
|
const active = CONFIG_PANELS.find((entry) => entry.id === panel);
|
|
24981
25210
|
const activeLabel = active?.label ?? "Config";
|
|
24982
|
-
return /* @__PURE__ */
|
|
25211
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("html", {
|
|
24983
25212
|
lang: "en",
|
|
24984
25213
|
children: [
|
|
24985
|
-
/* @__PURE__ */
|
|
25214
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("head", {
|
|
24986
25215
|
children: [
|
|
24987
|
-
/* @__PURE__ */
|
|
25216
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("meta", {
|
|
24988
25217
|
charSet: "utf-8"
|
|
24989
25218
|
}, undefined, false, undefined, this),
|
|
24990
|
-
/* @__PURE__ */
|
|
25219
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("meta", {
|
|
24991
25220
|
content: "width=device-width, initial-scale=1",
|
|
24992
25221
|
name: "viewport"
|
|
24993
25222
|
}, undefined, false, undefined, this),
|
|
24994
|
-
/* @__PURE__ */
|
|
25223
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("title", {
|
|
24995
25224
|
children: `Absolute Config \xB7 ${activeLabel}`
|
|
24996
25225
|
}, undefined, false, undefined, this),
|
|
24997
|
-
/* @__PURE__ */
|
|
25226
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("link", {
|
|
24998
25227
|
href: "https://fonts.googleapis.com",
|
|
24999
25228
|
rel: "preconnect"
|
|
25000
25229
|
}, undefined, false, undefined, this),
|
|
25001
|
-
/* @__PURE__ */
|
|
25230
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("link", {
|
|
25002
25231
|
crossOrigin: "anonymous",
|
|
25003
25232
|
href: "https://fonts.gstatic.com",
|
|
25004
25233
|
rel: "preconnect"
|
|
25005
25234
|
}, undefined, false, undefined, this),
|
|
25006
|
-
/* @__PURE__ */
|
|
25235
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("link", {
|
|
25007
25236
|
href: "https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap",
|
|
25008
25237
|
rel: "stylesheet"
|
|
25009
25238
|
}, undefined, false, undefined, this),
|
|
25010
|
-
/* @__PURE__ */
|
|
25239
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("style", {
|
|
25011
25240
|
dangerouslySetInnerHTML: {
|
|
25012
25241
|
__html: ESLINT_CSS + TSCONFIG_CSS + CONFIG_CSS
|
|
25013
25242
|
}
|
|
25014
25243
|
}, undefined, false, undefined, this)
|
|
25015
25244
|
]
|
|
25016
25245
|
}, undefined, true, undefined, this),
|
|
25017
|
-
/* @__PURE__ */
|
|
25018
|
-
children: /* @__PURE__ */
|
|
25246
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("body", {
|
|
25247
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("div", {
|
|
25019
25248
|
className: "cfg",
|
|
25020
25249
|
children: [
|
|
25021
|
-
/* @__PURE__ */
|
|
25250
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("aside", {
|
|
25022
25251
|
className: "cfg-nav",
|
|
25023
25252
|
children: [
|
|
25024
|
-
/* @__PURE__ */
|
|
25253
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("div", {
|
|
25025
25254
|
className: "cfg-brand",
|
|
25026
25255
|
children: [
|
|
25027
|
-
/* @__PURE__ */
|
|
25256
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
25028
25257
|
className: "cfg-word",
|
|
25029
25258
|
children: [
|
|
25030
25259
|
"absolute ",
|
|
25031
|
-
/* @__PURE__ */
|
|
25260
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("em", {
|
|
25032
25261
|
children: "config"
|
|
25033
25262
|
}, undefined, false, undefined, this)
|
|
25034
25263
|
]
|
|
25035
25264
|
}, undefined, true, undefined, this),
|
|
25036
|
-
/* @__PURE__ */
|
|
25265
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
25037
25266
|
className: "cfg-tag",
|
|
25038
25267
|
children: "project tooling"
|
|
25039
25268
|
}, undefined, false, undefined, this)
|
|
25040
25269
|
]
|
|
25041
25270
|
}, undefined, true, undefined, this),
|
|
25042
|
-
/* @__PURE__ */
|
|
25271
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("nav", {
|
|
25043
25272
|
className: "cfg-panels",
|
|
25044
25273
|
children: [
|
|
25045
|
-
/* @__PURE__ */
|
|
25274
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("div", {
|
|
25046
25275
|
className: "cfg-rail-label",
|
|
25047
25276
|
children: "Panels"
|
|
25048
25277
|
}, undefined, false, undefined, this),
|
|
25049
|
-
CONFIG_PANELS.map((entry) => /* @__PURE__ */
|
|
25278
|
+
CONFIG_PANELS.map((entry) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(NavItem, {
|
|
25050
25279
|
active: entry.id === panel,
|
|
25051
25280
|
panel: entry
|
|
25052
25281
|
}, entry.id, false, undefined, this))
|
|
@@ -25054,17 +25283,11 @@ var ConfigShell = ({
|
|
|
25054
25283
|
}, undefined, true, undefined, this)
|
|
25055
25284
|
]
|
|
25056
25285
|
}, undefined, true, undefined, this),
|
|
25057
|
-
/* @__PURE__ */
|
|
25286
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("main", {
|
|
25058
25287
|
className: "cfg-main",
|
|
25059
|
-
children:
|
|
25060
|
-
|
|
25061
|
-
|
|
25062
|
-
eslintCatalog,
|
|
25063
|
-
packageJsonState,
|
|
25064
|
-
panel,
|
|
25065
|
-
prettierState,
|
|
25066
|
-
tsconfigState
|
|
25067
|
-
})
|
|
25288
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(PanelHost, {
|
|
25289
|
+
panel
|
|
25290
|
+
}, undefined, false, undefined, this)
|
|
25068
25291
|
}, undefined, false, undefined, this)
|
|
25069
25292
|
]
|
|
25070
25293
|
}, undefined, true, undefined, this)
|
|
@@ -32430,22 +32653,6 @@ var evaluateObject = (node) => {
|
|
|
32430
32653
|
return { isStatic: true, value: result };
|
|
32431
32654
|
};
|
|
32432
32655
|
|
|
32433
|
-
// src/cli/config/guards.ts
|
|
32434
|
-
var getRecord = (value, key) => {
|
|
32435
|
-
if (!isRecord(value))
|
|
32436
|
-
return null;
|
|
32437
|
-
const found = value[key];
|
|
32438
|
-
return isRecord(found) ? found : null;
|
|
32439
|
-
};
|
|
32440
|
-
var getString = (value, key) => {
|
|
32441
|
-
if (!isRecord(value))
|
|
32442
|
-
return null;
|
|
32443
|
-
const found = value[key];
|
|
32444
|
-
return typeof found === "string" ? found : null;
|
|
32445
|
-
};
|
|
32446
|
-
var isMap = (value) => value instanceof Map;
|
|
32447
|
-
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32448
|
-
|
|
32449
32656
|
// src/cli/config/eslint/serializeValue.ts
|
|
32450
32657
|
var IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
32451
32658
|
var quoteString = (value) => `'${value.replace(/'/g, "\\'")}'`;
|
|
@@ -34518,11 +34725,12 @@ import ts3 from "typescript";
|
|
|
34518
34725
|
import { existsSync as existsSync7, readFileSync as readFileSync9 } from "fs";
|
|
34519
34726
|
import { resolve as resolve7 } from "path";
|
|
34520
34727
|
|
|
34521
|
-
// src/cli/config/
|
|
34728
|
+
// src/cli/config/schema/fromType.ts
|
|
34522
34729
|
import ts2 from "typescript";
|
|
34523
34730
|
import { existsSync as existsSync6, readFileSync as readFileSync8 } from "fs";
|
|
34524
34731
|
import { resolve as resolve6 } from "path";
|
|
34525
34732
|
var VIRTUAL_NAME = "__absolute_type_introspect__.ts";
|
|
34733
|
+
var MAX_DEPTH2 = 6;
|
|
34526
34734
|
var isFrameworkRepo = (cwd) => {
|
|
34527
34735
|
try {
|
|
34528
34736
|
const pkg = JSON.parse(readFileSync8(resolve6(cwd, "package.json"), "utf-8"));
|
|
@@ -34541,25 +34749,93 @@ var compilerOptionsFor = (cwd) => {
|
|
|
34541
34749
|
});
|
|
34542
34750
|
return parsed?.options ?? ts2.getDefaultCompilerOptions();
|
|
34543
34751
|
};
|
|
34544
|
-
var
|
|
34545
|
-
var
|
|
34546
|
-
const
|
|
34547
|
-
|
|
34548
|
-
|
|
34549
|
-
|
|
34550
|
-
|
|
34551
|
-
|
|
34552
|
-
if (
|
|
34553
|
-
|
|
34554
|
-
|
|
34752
|
+
var docOf = (symbol, checker) => ts2.displayPartsToString(symbol.getDocumentationComment(checker)).trim();
|
|
34753
|
+
var typeOfSymbol = (symbol, checker) => {
|
|
34754
|
+
const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];
|
|
34755
|
+
return declaration ? checker.getTypeOfSymbolAtLocation(symbol, declaration) : checker.getDeclaredTypeOfSymbol(symbol);
|
|
34756
|
+
};
|
|
34757
|
+
var hasFlag = (type, flag) => (type.flags & flag) !== 0;
|
|
34758
|
+
var unionParts = (type) => type.isUnion() ? type.types : [type];
|
|
34759
|
+
var literalChoice = (type) => {
|
|
34760
|
+
if (type.isStringLiteral())
|
|
34761
|
+
return type.value;
|
|
34762
|
+
if (type.isNumberLiteral())
|
|
34763
|
+
return type.value;
|
|
34764
|
+
return null;
|
|
34765
|
+
};
|
|
34766
|
+
var toSchema = (type, checker, depth, seen) => {
|
|
34767
|
+
const opaque2 = () => ({
|
|
34768
|
+
kind: "opaque",
|
|
34769
|
+
typeText: checker.typeToString(type)
|
|
34770
|
+
});
|
|
34771
|
+
if (depth > MAX_DEPTH2)
|
|
34772
|
+
return opaque2();
|
|
34773
|
+
const parts = unionParts(type).filter((part) => !hasFlag(part, ts2.TypeFlags.Undefined) && !hasFlag(part, ts2.TypeFlags.Null));
|
|
34774
|
+
if (parts.length === 0)
|
|
34775
|
+
return opaque2();
|
|
34776
|
+
if (parts.every((part) => hasFlag(part, ts2.TypeFlags.BooleanLike))) {
|
|
34777
|
+
return { kind: "boolean" };
|
|
34778
|
+
}
|
|
34779
|
+
const choices = parts.map(literalChoice);
|
|
34780
|
+
if (parts.length > 1 && choices.every((choice) => choice !== null)) {
|
|
34781
|
+
return { choices: choices.filter((c) => c !== null), kind: "enum" };
|
|
34782
|
+
}
|
|
34783
|
+
if (parts.length > 1) {
|
|
34784
|
+
return {
|
|
34785
|
+
kind: "union",
|
|
34786
|
+
variants: parts.map((part) => single(part, checker, depth, seen))
|
|
34787
|
+
};
|
|
34555
34788
|
}
|
|
34556
|
-
|
|
34557
|
-
|
|
34789
|
+
const [only] = parts;
|
|
34790
|
+
return only ? single(only, checker, depth, seen) : opaque2();
|
|
34791
|
+
};
|
|
34792
|
+
var single = (type, checker, depth, seen) => {
|
|
34793
|
+
const opaque2 = () => ({
|
|
34794
|
+
kind: "opaque",
|
|
34795
|
+
typeText: checker.typeToString(type)
|
|
34796
|
+
});
|
|
34797
|
+
if (hasFlag(type, ts2.TypeFlags.BooleanLike))
|
|
34798
|
+
return { kind: "boolean" };
|
|
34799
|
+
if (hasFlag(type, ts2.TypeFlags.NumberLike))
|
|
34800
|
+
return { kind: "number" };
|
|
34801
|
+
if (hasFlag(type, ts2.TypeFlags.StringLike))
|
|
34802
|
+
return { kind: "string" };
|
|
34803
|
+
if (!hasFlag(type, ts2.TypeFlags.Object))
|
|
34804
|
+
return opaque2();
|
|
34805
|
+
if (type.getCallSignatures().length > 0)
|
|
34806
|
+
return opaque2();
|
|
34807
|
+
const element = type.getNumberIndexType();
|
|
34808
|
+
const stringIndex = type.getStringIndexType();
|
|
34809
|
+
const props = checker.getPropertiesOfType(type);
|
|
34810
|
+
if (element && props.length === 0) {
|
|
34811
|
+
return {
|
|
34812
|
+
item: toSchema(element, checker, depth + 1, seen),
|
|
34813
|
+
kind: "array"
|
|
34814
|
+
};
|
|
34558
34815
|
}
|
|
34559
|
-
if (
|
|
34560
|
-
return
|
|
34816
|
+
if (seen.has(type))
|
|
34817
|
+
return opaque2();
|
|
34818
|
+
seen.add(type);
|
|
34819
|
+
try {
|
|
34820
|
+
if (props.length > 0) {
|
|
34821
|
+
const fields = props.map((symbol) => ({
|
|
34822
|
+
description: docOf(symbol, checker),
|
|
34823
|
+
name: symbol.getName(),
|
|
34824
|
+
optional: (symbol.flags & ts2.SymbolFlags.Optional) !== 0,
|
|
34825
|
+
schema: toSchema(typeOfSymbol(symbol, checker), checker, depth + 1, seen)
|
|
34826
|
+
}));
|
|
34827
|
+
return { fields, kind: "object" };
|
|
34828
|
+
}
|
|
34829
|
+
if (stringIndex) {
|
|
34830
|
+
return {
|
|
34831
|
+
kind: "record",
|
|
34832
|
+
value: toSchema(stringIndex, checker, depth + 1, seen)
|
|
34833
|
+
};
|
|
34834
|
+
}
|
|
34835
|
+
} finally {
|
|
34836
|
+
seen.delete(type);
|
|
34561
34837
|
}
|
|
34562
|
-
return
|
|
34838
|
+
return opaque2();
|
|
34563
34839
|
};
|
|
34564
34840
|
var introspectFrom = (cwd, specifier, typeName, options, exclude) => {
|
|
34565
34841
|
const virtualPath = resolve6(cwd, VIRTUAL_NAME);
|
|
@@ -34579,7 +34855,7 @@ export { value };
|
|
|
34579
34855
|
const sourceFile = program.getSourceFile(virtualPath);
|
|
34580
34856
|
if (!sourceFile)
|
|
34581
34857
|
return [];
|
|
34582
|
-
const
|
|
34858
|
+
const nodes = [];
|
|
34583
34859
|
sourceFile.forEachChild((node) => {
|
|
34584
34860
|
if (!ts2.isVariableStatement(node))
|
|
34585
34861
|
return;
|
|
@@ -34591,19 +34867,15 @@ export { value };
|
|
|
34591
34867
|
const name = symbol.getName();
|
|
34592
34868
|
if (exclude.has(name) || name.startsWith("__"))
|
|
34593
34869
|
continue;
|
|
34594
|
-
|
|
34595
|
-
|
|
34596
|
-
fields.push({
|
|
34597
|
-
choices,
|
|
34598
|
-
description: ts2.displayPartsToString(symbol.getDocumentationComment(checker)).trim(),
|
|
34599
|
-
kind,
|
|
34870
|
+
nodes.push({
|
|
34871
|
+
description: docOf(symbol, checker),
|
|
34600
34872
|
name,
|
|
34601
34873
|
optional: (symbol.flags & ts2.SymbolFlags.Optional) !== 0,
|
|
34602
|
-
|
|
34874
|
+
schema: toSchema(typeOfSymbol(symbol, checker), checker, 1, new Set)
|
|
34603
34875
|
});
|
|
34604
34876
|
}
|
|
34605
34877
|
});
|
|
34606
|
-
return
|
|
34878
|
+
return nodes.sort((left, right) => left.name.localeCompare(right.name));
|
|
34607
34879
|
};
|
|
34608
34880
|
var cache = new Map;
|
|
34609
34881
|
var introspectType = (cwd, typeName, exclude = new Set) => {
|
|
@@ -34617,10 +34889,10 @@ var introspectType = (cwd, typeName, exclude = new Set) => {
|
|
|
34617
34889
|
}
|
|
34618
34890
|
for (const specifier of specifiers) {
|
|
34619
34891
|
try {
|
|
34620
|
-
const
|
|
34621
|
-
if (
|
|
34622
|
-
cache.set(typeName,
|
|
34623
|
-
return
|
|
34892
|
+
const nodes = introspectFrom(cwd, specifier, typeName, options, exclude);
|
|
34893
|
+
if (nodes.length > 0) {
|
|
34894
|
+
cache.set(typeName, nodes);
|
|
34895
|
+
return nodes;
|
|
34624
34896
|
}
|
|
34625
34897
|
} catch {}
|
|
34626
34898
|
}
|
|
@@ -34641,7 +34913,11 @@ var RUNTIME_FIELDS = new Set([
|
|
|
34641
34913
|
"mode",
|
|
34642
34914
|
"incrementalFiles"
|
|
34643
34915
|
]);
|
|
34644
|
-
var findConfigPath2 = (cwd) => {
|
|
34916
|
+
var findConfigPath2 = (cwd, override) => {
|
|
34917
|
+
if (override) {
|
|
34918
|
+
const resolved = resolve7(cwd, override);
|
|
34919
|
+
return existsSync7(resolved) ? resolved : null;
|
|
34920
|
+
}
|
|
34645
34921
|
for (const name of CONFIG_CANDIDATES3) {
|
|
34646
34922
|
const candidate = resolve7(cwd, name);
|
|
34647
34923
|
if (existsSync7(candidate))
|
|
@@ -34672,68 +34948,119 @@ var parseConfigObject = (configPath) => {
|
|
|
34672
34948
|
const text = readFileSync9(configPath, "utf-8");
|
|
34673
34949
|
return { object: findConfigObject(parseSource(configPath, text)), text };
|
|
34674
34950
|
};
|
|
34675
|
-
var
|
|
34676
|
-
if (ts3.isStringLiteralLike(
|
|
34677
|
-
return {
|
|
34951
|
+
var evalLiteral = (node) => {
|
|
34952
|
+
if (ts3.isStringLiteralLike(node)) {
|
|
34953
|
+
return { opaque: false, value: node.text };
|
|
34954
|
+
}
|
|
34955
|
+
if (node.kind === ts3.SyntaxKind.TrueKeyword) {
|
|
34956
|
+
return { opaque: false, value: true };
|
|
34678
34957
|
}
|
|
34679
|
-
if (
|
|
34680
|
-
return {
|
|
34958
|
+
if (node.kind === ts3.SyntaxKind.FalseKeyword) {
|
|
34959
|
+
return { opaque: false, value: false };
|
|
34681
34960
|
}
|
|
34682
|
-
if (
|
|
34683
|
-
return {
|
|
34961
|
+
if (node.kind === ts3.SyntaxKind.NullKeyword) {
|
|
34962
|
+
return { opaque: false, value: null };
|
|
34684
34963
|
}
|
|
34685
|
-
if (ts3.isNumericLiteral(
|
|
34686
|
-
return {
|
|
34964
|
+
if (ts3.isNumericLiteral(node)) {
|
|
34965
|
+
return { opaque: false, value: Number(node.text) };
|
|
34687
34966
|
}
|
|
34688
|
-
if (ts3.isPrefixUnaryExpression(
|
|
34689
|
-
return {
|
|
34967
|
+
if (ts3.isPrefixUnaryExpression(node) && node.operator === ts3.SyntaxKind.MinusToken && ts3.isNumericLiteral(node.operand)) {
|
|
34968
|
+
return { opaque: false, value: -Number(node.operand.text) };
|
|
34969
|
+
}
|
|
34970
|
+
if (ts3.isArrayLiteralExpression(node)) {
|
|
34971
|
+
const items = [];
|
|
34972
|
+
for (const element of node.elements) {
|
|
34973
|
+
const result = evalLiteral(element);
|
|
34974
|
+
if (result.opaque)
|
|
34975
|
+
return { opaque: true, value: undefined };
|
|
34976
|
+
items.push(result.value);
|
|
34977
|
+
}
|
|
34978
|
+
return { opaque: false, value: items };
|
|
34979
|
+
}
|
|
34980
|
+
if (ts3.isObjectLiteralExpression(node)) {
|
|
34981
|
+
const object = {};
|
|
34982
|
+
for (const property of node.properties) {
|
|
34983
|
+
if (!ts3.isPropertyAssignment(property) || !(ts3.isIdentifier(property.name) || ts3.isStringLiteral(property.name))) {
|
|
34984
|
+
return { opaque: true, value: undefined };
|
|
34985
|
+
}
|
|
34986
|
+
const result = evalLiteral(property.initializer);
|
|
34987
|
+
if (result.opaque)
|
|
34988
|
+
return { opaque: true, value: undefined };
|
|
34989
|
+
object[property.name.text] = result.value;
|
|
34990
|
+
}
|
|
34991
|
+
return { opaque: false, value: object };
|
|
34690
34992
|
}
|
|
34691
|
-
return {
|
|
34993
|
+
return { opaque: true, value: undefined };
|
|
34692
34994
|
};
|
|
34693
34995
|
var readCurrent2 = (configPath) => {
|
|
34694
34996
|
const current2 = {};
|
|
34695
|
-
const
|
|
34997
|
+
const opaqueKeys = [];
|
|
34696
34998
|
const { object } = parseConfigObject(configPath);
|
|
34697
34999
|
if (!object)
|
|
34698
|
-
return {
|
|
35000
|
+
return { current: current2, opaqueKeys };
|
|
34699
35001
|
for (const property of object.properties) {
|
|
34700
35002
|
if (!ts3.isPropertyAssignment(property) || !(ts3.isIdentifier(property.name) || ts3.isStringLiteral(property.name))) {
|
|
34701
35003
|
continue;
|
|
34702
35004
|
}
|
|
34703
35005
|
const name = property.name.text;
|
|
34704
|
-
const
|
|
34705
|
-
if (
|
|
34706
|
-
|
|
35006
|
+
const result = evalLiteral(property.initializer);
|
|
35007
|
+
if (result.opaque)
|
|
35008
|
+
opaqueKeys.push(name);
|
|
34707
35009
|
else
|
|
34708
|
-
current2[name] =
|
|
35010
|
+
current2[name] = result.value;
|
|
34709
35011
|
}
|
|
34710
|
-
return {
|
|
35012
|
+
return { current: current2, opaqueKeys };
|
|
34711
35013
|
};
|
|
34712
|
-
var resolveAbsoluteConfigState = (cwd) => {
|
|
34713
|
-
const configPath = findConfigPath2(cwd);
|
|
35014
|
+
var resolveAbsoluteConfigState = (cwd, override) => {
|
|
35015
|
+
const configPath = findConfigPath2(cwd, override);
|
|
34714
35016
|
const fields = introspectType(cwd, "BaseBuildConfig", RUNTIME_FIELDS);
|
|
34715
|
-
const {
|
|
34716
|
-
const complexSet = new Set(complexKeys);
|
|
34717
|
-
const adjusted = fields.map((field) => complexSet.has(field.name) && field.kind !== "complex" ? { ...field, kind: "complex" } : field);
|
|
35017
|
+
const { current: current2, opaqueKeys } = configPath ? readCurrent2(configPath) : { current: {}, opaqueKeys: [] };
|
|
34718
35018
|
return {
|
|
34719
35019
|
available: fields.length > 0,
|
|
34720
|
-
complexKeys,
|
|
34721
35020
|
configPath,
|
|
34722
35021
|
current: current2,
|
|
34723
|
-
fields
|
|
35022
|
+
fields,
|
|
35023
|
+
opaqueKeys
|
|
34724
35024
|
};
|
|
34725
35025
|
};
|
|
34726
35026
|
|
|
34727
|
-
// src/cli/config/
|
|
34728
|
-
var
|
|
35027
|
+
// src/cli/config/schema/serialize.ts
|
|
35028
|
+
var isIdentifier = (key) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key);
|
|
35029
|
+
var serializeValue2 = (value, level = 1, indent = "\t") => {
|
|
35030
|
+
if (value === null)
|
|
35031
|
+
return "null";
|
|
34729
35032
|
if (typeof value === "string") {
|
|
34730
35033
|
return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
34731
35034
|
}
|
|
34732
35035
|
if (typeof value === "number" || typeof value === "boolean") {
|
|
34733
35036
|
return String(value);
|
|
34734
35037
|
}
|
|
34735
|
-
|
|
35038
|
+
if (Array.isArray(value)) {
|
|
35039
|
+
if (value.length === 0)
|
|
35040
|
+
return "[]";
|
|
35041
|
+
const pad = indent.repeat(level + 1);
|
|
35042
|
+
return `[
|
|
35043
|
+
${value.map((item) => `${pad}${serializeValue2(item, level + 1, indent)}`).join(`,
|
|
35044
|
+
`)}
|
|
35045
|
+
${indent.repeat(level)}]`;
|
|
35046
|
+
}
|
|
35047
|
+
if (isRecord(value)) {
|
|
35048
|
+
const keys = Object.keys(value);
|
|
35049
|
+
if (keys.length === 0)
|
|
35050
|
+
return "{}";
|
|
35051
|
+
const pad = indent.repeat(level + 1);
|
|
35052
|
+
return `{
|
|
35053
|
+
${keys.map((key) => {
|
|
35054
|
+
const name = isIdentifier(key) ? key : `'${key}'`;
|
|
35055
|
+
return `${pad}${name}: ${serializeValue2(value[key], level + 1, indent)}`;
|
|
35056
|
+
}).join(`,
|
|
35057
|
+
`)}
|
|
35058
|
+
${indent.repeat(level)}}`;
|
|
35059
|
+
}
|
|
35060
|
+
return "undefined";
|
|
34736
35061
|
};
|
|
35062
|
+
|
|
35063
|
+
// src/cli/config/absolute/editAbsoluteConfig.ts
|
|
34737
35064
|
var lineStartOffset = (text, position) => {
|
|
34738
35065
|
let index = position;
|
|
34739
35066
|
while (index > 0 && text[index - 1] !== `
|
|
@@ -34866,55 +35193,28 @@ var readPackage = (configPath) => {
|
|
|
34866
35193
|
return null;
|
|
34867
35194
|
}
|
|
34868
35195
|
};
|
|
34869
|
-
var isScalar = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
34870
|
-
var scalarKind = (value) => {
|
|
34871
|
-
if (typeof value === "boolean")
|
|
34872
|
-
return "boolean";
|
|
34873
|
-
if (typeof value === "number")
|
|
34874
|
-
return "number";
|
|
34875
|
-
return "string";
|
|
34876
|
-
};
|
|
34877
35196
|
var resolvePackageJsonState = (cwd) => {
|
|
34878
35197
|
const configPath = findPackageJsonPath(cwd);
|
|
34879
35198
|
const catalog = introspectType(cwd, "PackageJson", new Set(["scripts"]));
|
|
34880
35199
|
const pkg = configPath ? readPackage(configPath) : null;
|
|
34881
35200
|
if (!pkg) {
|
|
34882
|
-
return {
|
|
34883
|
-
complexKeys: [],
|
|
34884
|
-
configPath,
|
|
34885
|
-
current: {},
|
|
34886
|
-
fields: catalog,
|
|
34887
|
-
scripts: []
|
|
34888
|
-
};
|
|
35201
|
+
return { configPath, current: {}, fields: catalog, scripts: [] };
|
|
34889
35202
|
}
|
|
34890
35203
|
const scripts = isRecord(pkg.scripts) ? Object.entries(pkg.scripts).filter(([, command]) => typeof command === "string").map(([name, command]) => ({ command: String(command), name })) : [];
|
|
34891
35204
|
const current2 = {};
|
|
34892
|
-
const complexKeys = [];
|
|
34893
|
-
const catalogNames = new Set(catalog.map((field) => field.name));
|
|
34894
|
-
const extras = [];
|
|
34895
35205
|
for (const [name, value] of Object.entries(pkg)) {
|
|
34896
|
-
if (name
|
|
34897
|
-
continue;
|
|
34898
|
-
const complex = !isScalar(value);
|
|
34899
|
-
if (complex)
|
|
34900
|
-
complexKeys.push(name);
|
|
34901
|
-
else
|
|
35206
|
+
if (name !== "scripts")
|
|
34902
35207
|
current2[name] = value;
|
|
34903
|
-
if (!catalogNames.has(name)) {
|
|
34904
|
-
extras.push({
|
|
34905
|
-
choices: [],
|
|
34906
|
-
description: "",
|
|
34907
|
-
kind: complex ? "complex" : scalarKind(value),
|
|
34908
|
-
name,
|
|
34909
|
-
optional: true,
|
|
34910
|
-
typeText: ""
|
|
34911
|
-
});
|
|
34912
|
-
}
|
|
34913
35208
|
}
|
|
34914
|
-
const
|
|
34915
|
-
const
|
|
34916
|
-
|
|
34917
|
-
|
|
35209
|
+
const catalogNames = new Set(catalog.map((field) => field.name));
|
|
35210
|
+
const extras = Object.keys(current2).filter((name) => !catalogNames.has(name)).map((name) => ({
|
|
35211
|
+
description: "",
|
|
35212
|
+
name,
|
|
35213
|
+
optional: true,
|
|
35214
|
+
schema: { kind: "opaque", typeText: "json" }
|
|
35215
|
+
}));
|
|
35216
|
+
const fields = [...catalog, ...extras].sort((left, right) => left.name.localeCompare(right.name));
|
|
35217
|
+
return { configPath, current: current2, fields, scripts };
|
|
34918
35218
|
};
|
|
34919
35219
|
|
|
34920
35220
|
// src/constants.ts
|
|
@@ -36428,25 +36728,11 @@ var getClientBundle = async () => {
|
|
|
36428
36728
|
cachedClientBundle = existsSync10(distClientBundle) ? readFileSync14(distClientBundle, "utf-8") : await buildClientBundle();
|
|
36429
36729
|
return cachedClientBundle;
|
|
36430
36730
|
};
|
|
36431
|
-
var renderShell =
|
|
36432
|
-
|
|
36433
|
-
|
|
36434
|
-
|
|
36435
|
-
|
|
36436
|
-
const packageJsonState = panel === "package" ? resolvePackageJsonState(cwd) : null;
|
|
36437
|
-
return handleReactPageRequest({
|
|
36438
|
-
Page: ConfigShell,
|
|
36439
|
-
index: CLIENT_ROUTE,
|
|
36440
|
-
props: {
|
|
36441
|
-
absoluteConfigState,
|
|
36442
|
-
eslintCatalog,
|
|
36443
|
-
packageJsonState,
|
|
36444
|
-
panel,
|
|
36445
|
-
prettierState,
|
|
36446
|
-
tsconfigState
|
|
36447
|
-
}
|
|
36448
|
-
});
|
|
36449
|
-
};
|
|
36731
|
+
var renderShell = (panel) => handleReactPageRequest({
|
|
36732
|
+
Page: ConfigShell,
|
|
36733
|
+
index: CLIENT_ROUTE,
|
|
36734
|
+
props: { panel }
|
|
36735
|
+
});
|
|
36450
36736
|
var isSeverity = (value) => value === "off" || value === "warn" || value === "error";
|
|
36451
36737
|
var parseEditRequest = (body) => {
|
|
36452
36738
|
if (!isRecord(body))
|
|
@@ -36560,9 +36846,9 @@ var parseAbsoluteEdit = (body) => {
|
|
|
36560
36846
|
};
|
|
36561
36847
|
return request;
|
|
36562
36848
|
};
|
|
36563
|
-
var handleAbsoluteEdit = (cwd, body) => {
|
|
36849
|
+
var handleAbsoluteEdit = (cwd, body, override) => {
|
|
36564
36850
|
const request = parseAbsoluteEdit(body);
|
|
36565
|
-
const configPath = findConfigPath2(cwd);
|
|
36851
|
+
const configPath = findConfigPath2(cwd, override);
|
|
36566
36852
|
if (!request || !configPath) {
|
|
36567
36853
|
const invalid = {
|
|
36568
36854
|
message: !configPath ? "No absolute.config.ts found." : "Invalid edit request.",
|
|
@@ -36578,7 +36864,7 @@ var handleAbsoluteEdit = (cwd, body) => {
|
|
|
36578
36864
|
const result = {
|
|
36579
36865
|
message: outcome.message,
|
|
36580
36866
|
ok: outcome.ok,
|
|
36581
|
-
state: outcome.ok ? resolveAbsoluteConfigState(cwd) : null
|
|
36867
|
+
state: outcome.ok ? resolveAbsoluteConfigState(cwd, override) : null
|
|
36582
36868
|
};
|
|
36583
36869
|
return result;
|
|
36584
36870
|
};
|
|
@@ -36631,26 +36917,32 @@ var launchConfig = async (args, cwd = process.cwd()) => {
|
|
|
36631
36917
|
const port = resolvePort(args);
|
|
36632
36918
|
const host = resolveHost(args);
|
|
36633
36919
|
const httpsRequested = !args.includes("--no-https");
|
|
36920
|
+
const shouldOpen = args.includes("--open");
|
|
36921
|
+
const configOverride = flagValue(args, "--config");
|
|
36634
36922
|
killStaleProcesses(port);
|
|
36635
36923
|
const cert = httpsRequested ? ensureConfigCert(host) : null;
|
|
36636
|
-
const app = new Elysia2().get("/", (
|
|
36924
|
+
const app = new Elysia2().get("/", () => renderShell(DEFAULT_PANEL)).get("/eslint", () => renderShell("eslint")).get("/tsconfig", () => renderShell("tsconfig")).get("/prettier", () => renderShell("prettier")).get("/absolute", () => renderShell("absolute")).get("/package", () => renderShell("package")).get(CLIENT_ROUTE, async () => {
|
|
36637
36925
|
const bundle = await getClientBundle();
|
|
36638
36926
|
return new Response(bundle, {
|
|
36639
36927
|
headers: { "Content-Type": "text/javascript; charset=utf-8" }
|
|
36640
36928
|
});
|
|
36641
|
-
}).get("/api/rules", ({ query }) => resolveRuleCatalog(cwd, fileScopeOf(query))).post("/api/rules", ({ body }) => handleEdit(cwd, body)).get("/api/tsconfig", () => resolveTsconfigState(cwd)).post("/api/tsconfig", ({ body }) => handleTsEdit(cwd, body)).get("/api/prettier", () => resolvePrettierState(cwd)).post("/api/prettier", ({ body }) => handlePrettierEdit(cwd, body)).get("/api/absolute", () => resolveAbsoluteConfigState(cwd)).post("/api/absolute", ({ body }) => handleAbsoluteEdit(cwd, body)).get("/api/package", () => resolvePackageJsonState(cwd)).post("/api/package/script", ({ body }) => handleScriptEdit(cwd, body)).post("/api/package/field", ({ body }) => handleFieldEdit(cwd, body)).listen(listenOptions(port, cert));
|
|
36929
|
+
}).get("/api/rules", ({ query }) => resolveRuleCatalog(cwd, fileScopeOf(query))).post("/api/rules", ({ body }) => handleEdit(cwd, body)).get("/api/tsconfig", () => resolveTsconfigState(cwd)).post("/api/tsconfig", ({ body }) => handleTsEdit(cwd, body)).get("/api/prettier", () => resolvePrettierState(cwd)).post("/api/prettier", ({ body }) => handlePrettierEdit(cwd, body)).get("/api/absolute", () => resolveAbsoluteConfigState(cwd, configOverride)).post("/api/absolute", ({ body }) => handleAbsoluteEdit(cwd, body, configOverride)).get("/api/package", () => resolvePackageJsonState(cwd)).post("/api/package/script", ({ body }) => handleScriptEdit(cwd, body)).post("/api/package/field", ({ body }) => handleFieldEdit(cwd, body)).listen(listenOptions(port, cert));
|
|
36642
36930
|
const url = cert ? `https://${host}:${port}` : `http://localhost:${port}`;
|
|
36643
36931
|
const green = "\x1B[32m";
|
|
36644
36932
|
const dim = "\x1B[2m";
|
|
36645
36933
|
const reset2 = "\x1B[0m";
|
|
36646
36934
|
console.log(`
|
|
36647
36935
|
${green}\u2713 Absolute Config${reset2} running at ${url}`);
|
|
36648
|
-
console.log(`${dim}ESLint \xB7 tsconfig \xB7 Prettier \u2014
|
|
36936
|
+
console.log(`${dim}absolute.config \xB7 package.json \xB7 ESLint \xB7 tsconfig \xB7 Prettier \u2014 Ctrl+C to stop${reset2}`);
|
|
36649
36937
|
if (!cert && httpsRequested) {
|
|
36650
36938
|
console.log(`${dim}Tip: install mkcert (\`absolute mkcert\`) to serve a trusted https://${host}${reset2}`);
|
|
36651
36939
|
}
|
|
36940
|
+
if (shouldOpen) {
|
|
36941
|
+
openUrlInBrowser(url, (message) => console.warn(message));
|
|
36942
|
+
} else {
|
|
36943
|
+
console.log(`${dim}Open it in your browser, or pass --open.${reset2}`);
|
|
36944
|
+
}
|
|
36652
36945
|
console.log("");
|
|
36653
|
-
openUrlInBrowser(url, (message) => console.warn(message));
|
|
36654
36946
|
process.on("SIGINT", () => {
|
|
36655
36947
|
app.stop();
|
|
36656
36948
|
process.exit(0);
|