cssints 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -44
- package/dist/check.mjs +2 -2
- package/dist/{contrast-DhK69Xak.mjs → contrast-B49XCnVX.mjs} +2 -2
- package/dist/devtools-link-D2YxsJKZ.mjs +94 -0
- package/dist/devtools-link.d.mts +55 -0
- package/dist/devtools-link.mjs +2 -0
- package/dist/groups/baseline-2015/with-downstream.d.mts +81 -0
- package/dist/groups/baseline-2015.d.mts +291 -0
- package/dist/groups/baseline-2016/with-downstream.d.mts +86 -0
- package/dist/groups/baseline-2016.d.mts +310 -0
- package/dist/groups/baseline-2017/with-downstream.d.mts +94 -0
- package/dist/groups/baseline-2017.d.mts +365 -0
- package/dist/groups/baseline-2018/with-downstream.d.mts +94 -0
- package/dist/groups/baseline-2018.d.mts +368 -0
- package/dist/groups/baseline-2019/with-downstream.d.mts +97 -0
- package/dist/groups/baseline-2019.d.mts +375 -0
- package/dist/groups/baseline-2020/with-downstream.d.mts +112 -0
- package/dist/groups/baseline-2020.d.mts +480 -0
- package/dist/groups/baseline-2021/with-downstream.d.mts +125 -0
- package/dist/groups/baseline-2021.d.mts +536 -0
- package/dist/groups/baseline-2022/with-downstream.d.mts +126 -0
- package/dist/groups/baseline-2022.d.mts +562 -0
- package/dist/groups/baseline-2023/with-downstream.d.mts +120 -0
- package/dist/groups/baseline-2023.d.mts +606 -0
- package/dist/groups/baseline-2024/with-downstream.d.mts +627 -0
- package/dist/groups/baseline-2024.d.mts +632 -0
- package/dist/groups/baseline-2025/with-downstream.d.mts +628 -0
- package/dist/groups/baseline-2025.d.mts +640 -0
- package/dist/groups/baseline-2026/with-downstream.d.mts +3 -0
- package/dist/groups/baseline-2026.d.mts +3 -0
- package/dist/groups/newly-available/with-downstream.d.mts +632 -0
- package/dist/groups/widely-available/with-downstream.d.mts +121 -0
- package/dist/index.mjs +22 -7
- package/dist/instrument-BqIZpbIU.mjs +3956 -0
- package/dist/{lowered-D2KusPLp.mjs → lowered-aJVapQT6.mjs} +1 -1
- package/dist/plugin-types.d.mts +7 -0
- package/dist/plugin.d.mts +2 -2
- package/dist/plugin.mjs +8 -1
- package/dist/{registry-CTumHB8p.mjs → registry-BUSEO32-.mjs} +7 -1
- package/dist/{scope-ZVhUxQH1.d.mts → scope-INuJD4RT.d.mts} +8 -1
- package/dist/{sheet-BKsMTa0c.mjs → sheet-BeHdq4xt.mjs} +1 -1
- package/dist/surface.d.mts +1 -1
- package/dist/{theme-BsP2E4LB.mjs → theme-SlQ73rFL.mjs} +3 -3
- package/dist/tui.mjs +4 -4
- package/dist/vite.d.mts +3 -1
- package/dist/vite.mjs +86 -34
- package/docs/API.md +454 -231
- package/package.json +6 -2
- package/skills/cssints-plugin/SKILL.md +2 -0
- package/dist/instrument-gCazujmb.mjs +0 -1624
package/dist/plugin-types.d.mts
CHANGED
|
@@ -373,5 +373,12 @@ export declare const lacking: (...keys: BcdKey[]) => string[];
|
|
|
373
373
|
* file. Build time, like `scope()`: in a member's functions or in the plugin's own.
|
|
374
374
|
*/
|
|
375
375
|
export declare const dependsOn: (path: string) => void;
|
|
376
|
+
/**
|
|
377
|
+
* Whether a declaration is in an export group (`cssints/widely-available`, `baseline-2022/with-downstream`, ...): the group
|
|
378
|
+
* has the property and the value holds no word the group bans. A property cssints has no member for (a custom property, a
|
|
379
|
+
* vendor-prefixed one) is in every group. A plugin that has a variant per group emits only what passes. Build time, like
|
|
380
|
+
* `scope()`; an unknown group is an error.
|
|
381
|
+
*/
|
|
382
|
+
export declare const inGroup: (group: string, property: string, value: string) => boolean;
|
|
376
383
|
//#endregion
|
|
377
384
|
export type { ArgsDef, Chain, Conflict, Css, Decl, Entry, GlobalRule, Impl, Kernel, KernelDef, Made, Members, Part, Pending, Runtime, Scope, Style, Table, ThemeRule, Typed };
|
package/dist/plugin.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as inGroup, a as Entry, b as Part, c as Made, d as Scope, f as Table, g as fn, h as dependsOn, i as Css, l as Members, m as arg, n as ArgsDef, o as Impl, p as Typed, r as Chain, s as KernelDef, u as Pending, v as lacking, x as Style, y as scope } from "./scope-INuJD4RT.mjs";
|
|
2
2
|
import { a as Kernel, i as GlobalRule, n as Conflict, o as Runtime, r as Decl, s as ThemeRule } from "./author-types-C1AhsnrT.mjs";
|
|
3
|
-
export { type ArgsDef, type Chain, type Conflict, type Css, type Decl, type Entry, type GlobalRule, type Impl, type Kernel, type KernelDef, type Made, type Members, type Part, type Pending, type Runtime, type Scope, type Style, type Table, type ThemeRule, type Typed, arg, dependsOn, fn, lacking, scope };
|
|
3
|
+
export { type ArgsDef, type Chain, type Conflict, type Css, type Decl, type Entry, type GlobalRule, type Impl, type Kernel, type KernelDef, type Made, type Members, type Part, type Pending, type Runtime, type Scope, type Style, type Table, type ThemeRule, type Typed, arg, dependsOn, fn, inGroup, lacking, scope };
|
package/dist/plugin.mjs
CHANGED
|
@@ -26,5 +26,12 @@ const lacking = (...keys) => engine().lacking(keys);
|
|
|
26
26
|
* file. Build time, like `scope()`: in a member's functions or in the plugin's own.
|
|
27
27
|
*/
|
|
28
28
|
const dependsOn = (path) => engine().dependsOn(path);
|
|
29
|
+
/**
|
|
30
|
+
* Whether a declaration is in an export group (`cssints/widely-available`, `baseline-2022/with-downstream`, ...): the group
|
|
31
|
+
* has the property and the value holds no word the group bans. A property cssints has no member for (a custom property, a
|
|
32
|
+
* vendor-prefixed one) is in every group. A plugin that has a variant per group emits only what passes. Build time, like
|
|
33
|
+
* `scope()`; an unknown group is an error.
|
|
34
|
+
*/
|
|
35
|
+
const inGroup = (group, property, value) => engine().inGroup(group, property, value);
|
|
29
36
|
//#endregion
|
|
30
|
-
export { arg, dependsOn, fn, lacking, scope };
|
|
37
|
+
export { arg, dependsOn, fn, inGroup, lacking, scope };
|
|
@@ -66,7 +66,13 @@ const forgetKernels = (file) => {
|
|
|
66
66
|
};
|
|
67
67
|
const forget = (file) => {
|
|
68
68
|
forgetKernels(file);
|
|
69
|
-
for (const
|
|
69
|
+
for (const s of [registry, registry.terminal ?? registry]) {
|
|
70
|
+
for (const [k, p] of s.properties) if (p.file === file) {
|
|
71
|
+
s.properties.delete(k);
|
|
72
|
+
s.defs.delete(k);
|
|
73
|
+
}
|
|
74
|
+
for (const [k, t] of s.themed) if (t.file === file) s.themed.delete(k);
|
|
75
|
+
}
|
|
70
76
|
for (const [k, c] of registry.checks) if (c.at.file === file) registry.checks.delete(k);
|
|
71
77
|
};
|
|
72
78
|
//#endregion
|
|
@@ -2097,5 +2097,12 @@ declare const lacking: (...keys: BcdKey[]) => string[];
|
|
|
2097
2097
|
* file. Build time, like `scope()`: in a member's functions or in the plugin's own.
|
|
2098
2098
|
*/
|
|
2099
2099
|
declare const dependsOn: (path: string) => void;
|
|
2100
|
+
/**
|
|
2101
|
+
* Whether a declaration is in an export group (`cssints/widely-available`, `baseline-2022/with-downstream`, ...): the group
|
|
2102
|
+
* has the property and the value holds no word the group bans. A property cssints has no member for (a custom property, a
|
|
2103
|
+
* vendor-prefixed one) is in every group. A plugin that has a variant per group emits only what passes. Build time, like
|
|
2104
|
+
* `scope()`; an unknown group is an error.
|
|
2105
|
+
*/
|
|
2106
|
+
declare const inGroup: (group: string, property: string, value: string) => boolean;
|
|
2100
2107
|
//#endregion
|
|
2101
|
-
export {
|
|
2108
|
+
export { inGroup as _, Entry as a, Part as b, Made as c, Scope as d, Table as f, fn as g, dependsOn as h, Css as i, Members as l, arg as m, ArgsDef as n, Impl as o, Typed as p, Chain as r, KernelDef as s, AliasesOf as t, Pending as u, lacking as v, Style as x, scope as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as MacroError, f as MemberError, o as warn, t as Registry } from "./registry-
|
|
1
|
+
import { d as MacroError, f as MemberError, o as warn, t as Registry } from "./registry-BUSEO32-.mjs";
|
|
2
2
|
import { browsers, lacking, messageOf, supportOf } from "@cssints/css-grammar/support";
|
|
3
3
|
import { Effect, Formatter, Result, Schema } from "effect";
|
|
4
4
|
import { longhands } from "@cssints/css-grammar/longhands";
|
package/dist/surface.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as registry, d as MacroError, f as MemberError, o as warn } from "./registry-
|
|
2
|
-
import { D as relation, E as covers, d as requireLayer, p as standIn } from "./sheet-
|
|
3
|
-
import { t as fallbackOf } from "./lowered-
|
|
1
|
+
import { a as registry, d as MacroError, f as MemberError, o as warn } from "./registry-BUSEO32-.mjs";
|
|
2
|
+
import { D as relation, E as covers, d as requireLayer, p as standIn } from "./sheet-BeHdq4xt.mjs";
|
|
3
|
+
import { t as fallbackOf } from "./lowered-aJVapQT6.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { checkSelector } from "@cssints/css-grammar/check";
|
|
6
6
|
import { browsers, supportOf } from "@cssints/css-grammar/support";
|
package/dist/tui.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as registry } from "./registry-
|
|
2
|
-
import { a as createTokens$1, i as createGlobalTheme$1, j as fail, s as sets } from "./theme-
|
|
3
|
-
import { g as evaluate, h as css } from "./sheet-
|
|
4
|
-
import { n as valueOf, t as together } from "./contrast-
|
|
1
|
+
import { a as registry } from "./registry-BUSEO32-.mjs";
|
|
2
|
+
import { a as createTokens$1, i as createGlobalTheme$1, j as fail, s as sets } from "./theme-SlQ73rFL.mjs";
|
|
3
|
+
import { g as evaluate, h as css } from "./sheet-BeHdq4xt.mjs";
|
|
4
|
+
import { n as valueOf, t as together } from "./contrast-B49XCnVX.mjs";
|
|
5
5
|
import { n as parseColor } from "./color-BYIxVLlS.mjs";
|
|
6
6
|
import { Formatter } from "effect";
|
|
7
7
|
import { clampRgb, formatHex, formatHex8 } from "culori/fn";
|
package/dist/vite.d.mts
CHANGED
|
@@ -76,6 +76,8 @@ interface Site {
|
|
|
76
76
|
start: number;
|
|
77
77
|
end: number;
|
|
78
78
|
inFn: boolean;
|
|
79
|
+
/** dev with devtools: the readable class of a cn() or cv() site (`cs-Landing-logo`), see `tagged` */
|
|
80
|
+
name: string | undefined;
|
|
79
81
|
locals: Set<string>;
|
|
80
82
|
group?: SiteGroup;
|
|
81
83
|
}
|
|
@@ -84,7 +86,7 @@ interface Instrumented {
|
|
|
84
86
|
sites: Site[];
|
|
85
87
|
imp: CssImports;
|
|
86
88
|
}
|
|
87
|
-
export declare const instrument: (code: string, id: string, client?: boolean | undefined) => Effect.Effect<Instrumented | null, ImportError, never>;
|
|
89
|
+
export declare const instrument: (code: string, id: string, client?: boolean | undefined, named?: boolean | undefined) => Effect.Effect<Instrumented | null, ImportError, never>;
|
|
88
90
|
//#endregion
|
|
89
91
|
//#region src/sheet.d.ts
|
|
90
92
|
/** Adds a global rule (`*{box-sizing:border-box}`) of a plugin member, by its content, to the sheet of the module at `at`. `layer` names a declared top-level layer to wrap it in, no layer puts it in `_.k`. */
|
package/dist/vite.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { c as EvalError, d as MacroError, f as MemberError, i as forgetWarnings, l as HookError, n as forget, p as SiteMissingError, t as Registry } from "./registry-
|
|
2
|
-
import { C as fallbackEntries, T as runtimeNames, a as closeNames, b as DERIVED, c as layerEntries, f as themedEntries, l as layerStatements, m as usesDerived, n as addGlobal, o as globalEntries, r as addLayers, s as globalNames, t as LAYERS, u as renderSheet, v as kernelEntries, w as runtimeModule, x as RUNTIME_ID } from "./sheet-
|
|
3
|
-
import { a as runtimeImport, i as instrument, o as writeSite } from "./instrument-
|
|
4
|
-
import { r as verifyChecks } from "./contrast-
|
|
1
|
+
import { c as EvalError, d as MacroError, f as MemberError, i as forgetWarnings, l as HookError, n as forget, p as SiteMissingError, t as Registry } from "./registry-BUSEO32-.mjs";
|
|
2
|
+
import { C as fallbackEntries, T as runtimeNames, a as closeNames, b as DERIVED, c as layerEntries, f as themedEntries, l as layerStatements, m as usesDerived, n as addGlobal, o as globalEntries, r as addLayers, s as globalNames, t as LAYERS, u as renderSheet, v as kernelEntries, w as runtimeModule, x as RUNTIME_ID } from "./sheet-BeHdq4xt.mjs";
|
|
3
|
+
import { a as runtimeImport, i as instrument, o as tagged, s as writeSite } from "./instrument-BqIZpbIU.mjs";
|
|
4
|
+
import { r as verifyChecks } from "./contrast-B49XCnVX.mjs";
|
|
5
|
+
import { i as serverId, n as gitRoot, o as sessionOf, r as register } from "./devtools-link-D2YxsJKZ.mjs";
|
|
5
6
|
import { createRequire } from "node:module";
|
|
6
7
|
import { targets as targets$1, useTargets } from "@cssints/css-grammar/support";
|
|
7
8
|
import { Cause, Clock, Config, Data, Effect, Exit, Formatter, Option, Predicate, Result, Schema, Semaphore } from "effect";
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
9
|
-
import { basename, join, relative, resolve
|
|
10
|
+
import { basename, join, relative, resolve } from "node:path";
|
|
10
11
|
import { browserslistToTargets } from "lightningcss";
|
|
11
12
|
import MagicString from "magic-string";
|
|
12
|
-
import {
|
|
13
|
+
import { readFileSync } from "node:fs";
|
|
13
14
|
import { readFile } from "node:fs/promises";
|
|
14
15
|
import { browsers as browsers$1 } from "@cssints/css-grammar/browsers";
|
|
15
16
|
import { createFilter, createServer, createServerModuleRunner, normalizePath, transformWithOxc } from "vite";
|
|
@@ -190,13 +191,30 @@ const table = Effect.fn("cssints.devtoolsTable")(function* (root, usedBy, callsO
|
|
|
190
191
|
});
|
|
191
192
|
const ASK = "cssints:devtools:ask";
|
|
192
193
|
const ASKED = "cssints:devtools:asked";
|
|
194
|
+
const LINK = "cssints:devtools:link";
|
|
195
|
+
const LINKED = "cssints:devtools:linked";
|
|
193
196
|
const MAX_PROMPT = 16e3;
|
|
194
197
|
const Asking = Schema.Struct({
|
|
195
198
|
ref: Schema.Finite,
|
|
196
199
|
prompt: Schema.String
|
|
197
200
|
});
|
|
198
201
|
var OpenCodeError = class extends Data.TaggedError("OpenCodeError") {};
|
|
199
|
-
const
|
|
202
|
+
const attachedTo = (root) => Effect.sync(() => {
|
|
203
|
+
const git = gitRoot(root);
|
|
204
|
+
return sessionOf(git, serverId(git, root));
|
|
205
|
+
});
|
|
206
|
+
const urlOf = (s) => {
|
|
207
|
+
const address = s.httpServer?.address();
|
|
208
|
+
return Predicate.hasProperty(address, "port") ? `${s.config.server.https ? "https" : "http"}://localhost:${address.port}/` : void 0;
|
|
209
|
+
};
|
|
210
|
+
const announce = (s) => Effect.try(() => {
|
|
211
|
+
const http = s.httpServer;
|
|
212
|
+
const url = urlOf(s);
|
|
213
|
+
if (!http || !url) return;
|
|
214
|
+
const remove = register(gitRoot(s.config.root), s.config.root, url);
|
|
215
|
+
http.once("close", remove);
|
|
216
|
+
process.once("exit", remove);
|
|
217
|
+
}).pipe(Effect.ignore);
|
|
200
218
|
const connect = Effect.fn("cssints.opencodeConnect")(function* () {
|
|
201
219
|
const unavailable = (message) => () => new OpenCodeError({
|
|
202
220
|
status: "unavailable",
|
|
@@ -216,15 +234,36 @@ const connect = Effect.fn("cssints.opencodeConnect")(function* () {
|
|
|
216
234
|
});
|
|
217
235
|
if (!service) return yield* new OpenCodeError({
|
|
218
236
|
status: "unavailable",
|
|
237
|
+
idle: true,
|
|
219
238
|
message: "No OpenCode service is running. Start OpenCode (or `opencode serve --service`) and send again."
|
|
220
239
|
});
|
|
221
|
-
return
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
240
|
+
return {
|
|
241
|
+
url: service.url,
|
|
242
|
+
client: OpenCode.make({
|
|
243
|
+
baseUrl: service.url,
|
|
244
|
+
headers: Service.headers(service)
|
|
245
|
+
})
|
|
246
|
+
};
|
|
225
247
|
});
|
|
226
|
-
const
|
|
227
|
-
const
|
|
248
|
+
const link = Effect.fn("cssints.opencodeLink")(function* (root) {
|
|
249
|
+
const directory = gitRoot(root);
|
|
250
|
+
const attached = yield* attachedTo(root);
|
|
251
|
+
const session = attached ? { session: attached } : {};
|
|
252
|
+
return yield* connect().pipe(Effect.map(({ url }) => ({
|
|
253
|
+
connected: true,
|
|
254
|
+
url,
|
|
255
|
+
directory,
|
|
256
|
+
...session
|
|
257
|
+
})), Effect.catchTag("OpenCodeError", (e) => Effect.succeed({
|
|
258
|
+
connected: false,
|
|
259
|
+
directory,
|
|
260
|
+
...session,
|
|
261
|
+
...e.idle ? {} : { message: e.message }
|
|
262
|
+
})));
|
|
263
|
+
});
|
|
264
|
+
const appLine = (root, url) => `App: ${relative(gitRoot(root), root) || "."}${url ? ` (${url})` : ""}; file paths below are relative to it`;
|
|
265
|
+
const ask = Effect.fn("cssints.opencodeAsk")(function* (root, url, options, ref, prompt, say) {
|
|
266
|
+
const { client } = yield* connect();
|
|
228
267
|
const call = (f) => Effect.tryPromise({
|
|
229
268
|
try: f,
|
|
230
269
|
catch: (e) => new OpenCodeError({
|
|
@@ -232,11 +271,16 @@ const ask = Effect.fn("cssints.opencodeAsk")(function* (root, options, ref, prom
|
|
|
232
271
|
message: Predicate.isError(e) ? e.message : String(e)
|
|
233
272
|
})
|
|
234
273
|
});
|
|
235
|
-
const
|
|
274
|
+
const attached = yield* attachedTo(root);
|
|
275
|
+
if (attached) yield* call(() => client.session.get({ sessionID: attached })).pipe(Effect.mapError((e) => new OpenCodeError({
|
|
276
|
+
status: "failed",
|
|
277
|
+
message: `The attached session ${attached} is gone (${e.message}). Run /cssints-devtools in an OpenCode session to attach another.`
|
|
278
|
+
})));
|
|
279
|
+
const id = attached ?? (yield* call(() => client.session.create({
|
|
236
280
|
title: "cssints devtools: UI change",
|
|
237
281
|
...options.agent ? { agent: options.agent } : {},
|
|
238
|
-
location: { directory:
|
|
239
|
-
}));
|
|
282
|
+
location: { directory: gitRoot(root) }
|
|
283
|
+
}))).id;
|
|
240
284
|
say({
|
|
241
285
|
ref,
|
|
242
286
|
status: "running",
|
|
@@ -244,7 +288,7 @@ const ask = Effect.fn("cssints.opencodeAsk")(function* (root, options, ref, prom
|
|
|
244
288
|
});
|
|
245
289
|
yield* call(() => client.session.prompt({
|
|
246
290
|
sessionID: id,
|
|
247
|
-
text: prompt
|
|
291
|
+
text: `${appLine(root, url)}\n${prompt}`.slice(0, MAX_PROMPT),
|
|
248
292
|
...options.skills?.length ? { skills: options.skills.map((s) => ({ id: s })) } : {}
|
|
249
293
|
}));
|
|
250
294
|
yield* call(() => client.session.wait({ sessionID: id }));
|
|
@@ -260,7 +304,7 @@ const hot = import.meta.hot;
|
|
|
260
304
|
mount({
|
|
261
305
|
root: ${Formatter.formatJson(root)},
|
|
262
306
|
request: () => hot.send("cssints:devtools:get"),
|
|
263
|
-
on: (event, listener) => hot.on(event, listener),${opencode ? `\n ask: (ref, prompt) => hot.send("${ASK}", { ref, prompt }),` : ""}
|
|
307
|
+
on: (event, listener) => hot.on(event, listener),${opencode ? `\n ask: (ref, prompt) => hot.send("${ASK}", { ref, prompt }),\n link: () => hot.send("${LINK}"),` : ""}
|
|
264
308
|
});
|
|
265
309
|
` : `console.warn("cssints: devtools is on, but @cssints/devtools/overlay is not installed (or not built): add @cssints/devtools to the devDependencies of the app");\n`;
|
|
266
310
|
/**
|
|
@@ -283,18 +327,22 @@ const devtoolsPlugin = (usedBy, callsOf, opencode) => {
|
|
|
283
327
|
apply: "serve",
|
|
284
328
|
configureServer(s) {
|
|
285
329
|
server = s;
|
|
330
|
+
if (opencode) s.httpServer?.once("listening", () => Effect.runSync(announce(s)));
|
|
286
331
|
s.environments.client.hot.on("cssints:devtools:get", (_, client) => client.send("cssints:devtools", Effect.runSync(table(s.config.root, usedBy, callsOf))));
|
|
287
|
-
if (opencode)
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
332
|
+
if (opencode) {
|
|
333
|
+
s.environments.client.hot.on(LINK, () => Effect.runFork(link(s.config.root).pipe(Effect.map((linked) => s.environments.client.hot.send(LINKED, linked)))));
|
|
334
|
+
s.environments.client.hot.on(ASK, (data) => {
|
|
335
|
+
const asking = Schema.decodeUnknownOption(Asking)(data);
|
|
336
|
+
if (Option.isNone(asking)) return;
|
|
337
|
+
const { ref, prompt } = asking.value;
|
|
338
|
+
const say = (asked) => s.environments.client.hot.send(ASKED, asked);
|
|
339
|
+
Effect.runFork(ask(s.config.root, urlOf(s), opencode, ref, prompt, say).pipe(Effect.catchTag("OpenCodeError", (e) => Effect.sync(() => say({
|
|
340
|
+
ref,
|
|
341
|
+
status: e.status,
|
|
342
|
+
message: e.message
|
|
343
|
+
})))));
|
|
344
|
+
});
|
|
345
|
+
}
|
|
298
346
|
},
|
|
299
347
|
transformIndexHtml: () => [{
|
|
300
348
|
tag: "script",
|
|
@@ -717,7 +765,7 @@ function cssints({ inner = false, exclude, devtools = false, opencode = false }
|
|
|
717
765
|
site: n,
|
|
718
766
|
offset: s.start
|
|
719
767
|
});
|
|
720
|
-
writeSite(ms, s, replacement);
|
|
768
|
+
writeSite(ms, s, s.name ? tagged(replacement, s.name) : replacement);
|
|
721
769
|
}
|
|
722
770
|
for (const decl of parsed.imp.decls) ms.remove(decl.start, decl.end);
|
|
723
771
|
for (const dep of runnerDeps(env, id)) (depsOf.get(dep) ?? depsOf.set(dep, /* @__PURE__ */ new Set()).get(dep)).add(id);
|
|
@@ -762,7 +810,7 @@ function cssints({ inner = false, exclude, devtools = false, opencode = false }
|
|
|
762
810
|
return out && /x$/.test(id) ? yield* inertJsx(out.code, id) : out?.code;
|
|
763
811
|
}
|
|
764
812
|
if (inner) return void 0;
|
|
765
|
-
const parsed = yield* instrument(code, id);
|
|
813
|
+
const parsed = yield* instrument(code, id, true, !!devtools && !build);
|
|
766
814
|
if (!parsed) return void 0;
|
|
767
815
|
const env = server.environments.ssr;
|
|
768
816
|
runner ??= createServerModuleRunner(env, {
|
|
@@ -852,8 +900,12 @@ function cssints({ inner = false, exclude, devtools = false, opencode = false }
|
|
|
852
900
|
const buildEnd = Effect.fn("cssints.buildEnd")(function* (warn) {
|
|
853
901
|
yield* verifyChecks(() => true).pipe(Effect.catch((e) => locate(e, "", "")), Effect.ensuring(flushWarnings(warn)));
|
|
854
902
|
});
|
|
855
|
-
const hotUpdate = Effect.fn("cssints.hotUpdate")(function* (env, file, modules) {
|
|
903
|
+
const hotUpdate = Effect.fn("cssints.hotUpdate")(function* (env, file, modules, type) {
|
|
856
904
|
if (env.name !== "client") return void 0;
|
|
905
|
+
if (type === "delete") {
|
|
906
|
+
yield* Effect.sync(() => forget(file));
|
|
907
|
+
yield* drop(file);
|
|
908
|
+
}
|
|
857
909
|
yield* Effect.sync(() => forgetWarnings([file]));
|
|
858
910
|
const graph = env.moduleGraph;
|
|
859
911
|
const affected = [.../* @__PURE__ */ new Set([...depsOf.get(file) ?? [], ...inflight])].flatMap((id) => graph.getModuleById(id) ?? []);
|
|
@@ -941,8 +993,8 @@ function cssints({ inner = false, exclude, devtools = false, opencode = false }
|
|
|
941
993
|
return run(hook("vite.transform", id, transform(this, code, id).pipe(Effect.catch((e) => locate(e, code, id))), this.environment.name));
|
|
942
994
|
}
|
|
943
995
|
},
|
|
944
|
-
hotUpdate({ file, modules }) {
|
|
945
|
-
return runSync(hook("vite.hotUpdate", file, hotUpdate(this.environment, file, modules)));
|
|
996
|
+
hotUpdate({ file, modules, type }) {
|
|
997
|
+
return runSync(hook("vite.hotUpdate", file, hotUpdate(this.environment, file, modules, type)));
|
|
946
998
|
}
|
|
947
999
|
};
|
|
948
1000
|
const version = {
|