tencil 0.4.0 → 0.6.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/dist/index.d.mts CHANGED
@@ -1,343 +1,4 @@
1
- import { z } from "zod";
2
- //#region ../protocol/src/context.d.ts
3
- /**
4
- * Everything the overlay knows about the picked element. Captured once when
5
- * the pin is placed and forwarded to the agent as context.
6
- */
7
- declare const ElementContext: z.ZodObject<{
8
- tagName: z.ZodString;
9
- selector: z.ZodString;
10
- html: z.ZodString;
11
- text: z.ZodOptional<z.ZodString>;
12
- components: z.ZodDefault<z.ZodArray<z.ZodObject<{
13
- name: z.ZodString;
14
- source: z.ZodOptional<z.ZodObject<{
15
- file: z.ZodString;
16
- line: z.ZodOptional<z.ZodNumber>;
17
- column: z.ZodOptional<z.ZodNumber>;
18
- }, z.core.$strip>>;
19
- library: z.ZodOptional<z.ZodString>;
20
- }, z.core.$strip>>>;
21
- rect: z.ZodObject<{
22
- x: z.ZodNumber;
23
- y: z.ZodNumber;
24
- width: z.ZodNumber;
25
- height: z.ZodNumber;
26
- }, z.core.$strip>;
27
- viewport: z.ZodObject<{
28
- width: z.ZodNumber;
29
- height: z.ZodNumber;
30
- dpr: z.ZodNumber;
31
- }, z.core.$strip>;
32
- selection: z.ZodOptional<z.ZodString>;
33
- }, z.core.$strip>;
34
- type ElementContext = z.infer<typeof ElementContext>;
35
- declare const ImageAttachment: z.ZodObject<{
36
- name: z.ZodString;
37
- mimeType: z.ZodEnum<{
38
- "image/png": "image/png";
39
- "image/jpeg": "image/jpeg";
40
- "image/webp": "image/webp";
41
- }>;
42
- dataUrl: z.ZodString;
43
- }, z.core.$strip>;
44
- type ImageAttachment = z.infer<typeof ImageAttachment>;
45
- //#endregion
46
- //#region ../protocol/src/thread.d.ts
47
- /**
48
- * Provider-agnostic run state.
49
- * - `draft`: a comment queued in a batch, not sent to the agent yet
50
- * - `starting`: thread is being created on the provider
51
- * - `working`: the agent is producing a turn
52
- * - `waiting`: the agent needs approval/input inside the provider UI
53
- * - `idle`: last turn finished, ready for a follow-up
54
- * - `error`: last turn or the thread itself failed
55
- */
56
- declare const ThreadStatus: z.ZodEnum<{
57
- draft: "draft";
58
- starting: "starting";
59
- working: "working";
60
- waiting: "waiting";
61
- idle: "idle";
62
- error: "error";
63
- }>;
64
- type ThreadStatus = z.infer<typeof ThreadStatus>;
65
- declare const MessageRole: z.ZodEnum<{
66
- user: "user";
67
- assistant: "assistant";
68
- system: "system";
69
- }>;
70
- type MessageRole = z.infer<typeof MessageRole>;
71
- /**
72
- * A conversation Tencil tracks, backed by one provider thread. Owned and
73
- * persisted by the bridge. Pinned threads sit on an element of a page;
74
- * threads opened from the provider's list have no anchor and live in the dock.
75
- * Several pins may continue the same provider thread.
76
- */
77
- declare const Thread: z.ZodObject<{
78
- id: z.ZodString;
79
- title: z.ZodString;
80
- pageUrl: z.ZodOptional<z.ZodString>;
81
- anchor: z.ZodOptional<z.ZodObject<{
82
- selector: z.ZodString;
83
- offsetX: z.ZodNumber;
84
- offsetY: z.ZodNumber;
85
- }, z.core.$strip>>;
86
- context: z.ZodOptional<z.ZodObject<{
87
- tagName: z.ZodString;
88
- selector: z.ZodString;
89
- html: z.ZodString;
90
- text: z.ZodOptional<z.ZodString>;
91
- components: z.ZodDefault<z.ZodArray<z.ZodObject<{
92
- name: z.ZodString;
93
- source: z.ZodOptional<z.ZodObject<{
94
- file: z.ZodString;
95
- line: z.ZodOptional<z.ZodNumber>;
96
- column: z.ZodOptional<z.ZodNumber>;
97
- }, z.core.$strip>>;
98
- library: z.ZodOptional<z.ZodString>;
99
- }, z.core.$strip>>>;
100
- rect: z.ZodObject<{
101
- x: z.ZodNumber;
102
- y: z.ZodNumber;
103
- width: z.ZodNumber;
104
- height: z.ZodNumber;
105
- }, z.core.$strip>;
106
- viewport: z.ZodObject<{
107
- width: z.ZodNumber;
108
- height: z.ZodNumber;
109
- dpr: z.ZodNumber;
110
- }, z.core.$strip>;
111
- selection: z.ZodOptional<z.ZodString>;
112
- }, z.core.$strip>>;
113
- status: z.ZodEnum<{
114
- draft: "draft";
115
- starting: "starting";
116
- working: "working";
117
- waiting: "waiting";
118
- idle: "idle";
119
- error: "error";
120
- }>;
121
- statusDetail: z.ZodOptional<z.ZodString>;
122
- resolved: z.ZodDefault<z.ZodBoolean>;
123
- messages: z.ZodArray<z.ZodObject<{
124
- id: z.ZodString;
125
- role: z.ZodEnum<{
126
- user: "user";
127
- assistant: "assistant";
128
- system: "system";
129
- }>;
130
- text: z.ZodString;
131
- streaming: z.ZodDefault<z.ZodBoolean>;
132
- createdAt: z.ZodString;
133
- }, z.core.$strip>>;
134
- provider: z.ZodObject<{
135
- id: z.ZodString;
136
- threadId: z.ZodOptional<z.ZodString>;
137
- url: z.ZodOptional<z.ZodString>;
138
- }, z.core.$strip>;
139
- createdAt: z.ZodString;
140
- updatedAt: z.ZodString;
141
- }, z.core.$strip>;
142
- type Thread = z.infer<typeof Thread>;
143
- /** A thread as listed by the provider (e.g. every T3 Code thread in the project). */
144
- declare const ProviderThreadSummary: z.ZodObject<{
145
- id: z.ZodString;
146
- title: z.ZodString;
147
- status: z.ZodEnum<{
148
- working: "working";
149
- waiting: "waiting";
150
- idle: "idle";
151
- error: "error";
152
- }>;
153
- updatedAt: z.ZodString;
154
- url: z.ZodOptional<z.ZodString>;
155
- branch: z.ZodOptional<z.ZodString>;
156
- pullRequest: z.ZodOptional<z.ZodObject<{
157
- number: z.ZodNumber;
158
- url: z.ZodString;
159
- }, z.core.$strip>>;
160
- background: z.ZodOptional<z.ZodEnum<{
161
- working: "working";
162
- monitoring: "monitoring";
163
- }>>;
164
- agent: z.ZodOptional<z.ZodString>;
165
- }, z.core.$strip>;
166
- type ProviderThreadSummary = z.infer<typeof ProviderThreadSummary>;
167
- /** A model a provider can start threads on, e.g. T3 Code's Claude Opus. */
168
- declare const ProviderModel: z.ZodObject<{
169
- id: z.ZodString;
170
- label: z.ZodString;
171
- group: z.ZodString;
172
- agent: z.ZodOptional<z.ZodString>;
173
- }, z.core.$strip>;
174
- type ProviderModel = z.infer<typeof ProviderModel>;
175
- /** How the provider presents the project the threads belong to. */
176
- declare const ProviderProject: z.ZodObject<{
177
- name: z.ZodString;
178
- iconUrl: z.ZodOptional<z.ZodString>;
179
- emoji: z.ZodOptional<z.ZodString>;
180
- }, z.core.$strip>;
181
- type ProviderProject = z.infer<typeof ProviderProject>;
182
- //#endregion
183
- //#region ../protocol/src/messages.d.ts
184
- declare const PROTOCOL_VERSION = 1;
185
- declare const ProviderInfo: z.ZodObject<{
186
- id: z.ZodString;
187
- label: z.ZodString;
188
- state: z.ZodEnum<{
189
- connecting: "connecting";
190
- ready: "ready";
191
- unauthorized: "unauthorized";
192
- unavailable: "unavailable";
193
- }>;
194
- detail: z.ZodOptional<z.ZodString>;
195
- target: z.ZodOptional<z.ZodString>;
196
- canPair: z.ZodOptional<z.ZodBoolean>;
197
- }, z.core.$strip>;
198
- type ProviderInfo = z.infer<typeof ProviderInfo>;
199
- /** A provider the project can send pins to. */
200
- declare const ProviderOption: z.ZodObject<{
201
- id: z.ZodString;
202
- label: z.ZodString;
203
- }, z.core.$strip>;
204
- type ProviderOption = z.infer<typeof ProviderOption>;
205
- /** Per-project settings, as the overlay shows them. */
206
- declare const ProjectSettings: z.ZodObject<{
207
- provider: z.ZodString;
208
- providers: z.ZodArray<z.ZodObject<{
209
- id: z.ZodString;
210
- label: z.ZodString;
211
- }, z.core.$strip>>;
212
- model: z.ZodOptional<z.ZodString>;
213
- batch: z.ZodBoolean;
214
- }, z.core.$strip>;
215
- type ProjectSettings = z.infer<typeof ProjectSettings>;
216
- type ServerMessage = {
217
- type: 'ready';
218
- protocol: typeof PROTOCOL_VERSION;
219
- version: string;
220
- project: {
221
- name: string;
222
- root: string;
223
- };
224
- /** The provider new pins go to. */
225
- provider: ProviderInfo;
226
- settings: ProjectSettings;
227
- threads: Thread[];
228
- } | {
229
- type: 'provider.status';
230
- provider: ProviderInfo;
231
- } | {
232
- type: 'settings';
233
- settings: ProjectSettings;
234
- } |
235
- /** The daemon couldn't tell which project this page belongs to; the overlay asks. */
236
- {
237
- type: 'project.unknown';
238
- pageUrl: string;
239
- choices: Array<{
240
- root: string;
241
- title: string;
242
- }>;
243
- /** What to do when there are no choices. */
244
- emptyHint?: string;
245
- } | {
246
- type: 'thread.upsert';
247
- thread: Thread;
248
- } | {
249
- type: 'thread.removed';
250
- threadId: string;
251
- } | {
252
- type: 'provider.threads';
253
- project: ProviderProject;
254
- threads: ProviderThreadSummary[];
255
- } | {
256
- type: 'provider.models';
257
- provider: string;
258
- models: ProviderModel[];
259
- /** What new threads run on when no model is picked. */
260
- defaultModel?: string;
261
- } | {
262
- type: 'error';
263
- message: string;
264
- threadId?: string;
265
- };
266
- //#endregion
267
- //#region ../protocol/src/provider.d.ts
268
- /**
269
- * A provider is the agent backend a pin is delegated to (T3 Code, Claude Code,
270
- * …). The bridge owns pins and talks to exactly one provider per process; the
271
- * provider owns the conversation.
272
- *
273
- * Providers only ever see plain text + images: the bridge renders element
274
- * context into the prompt so every provider gets identical input.
275
- */
276
- interface Provider {
277
- readonly id: string;
278
- readonly label: string;
279
- /** Connect/authenticate. Must not throw; report problems through `info()`. */
280
- start(): Promise<void>;
281
- info(): ProviderInfo;
282
- onInfoChange(listener: (info: ProviderInfo) => void): () => void;
283
- /** Authorize against the provider (e.g. pair with T3 Code). Optional. */
284
- pair?(): Promise<void>;
285
- /** Threads that already exist for this project, newest first. */
286
- listThreads(): Promise<{
287
- project: ProviderProject;
288
- threads: ProviderThreadSummary[];
289
- }>;
290
- /** Models new threads can run on, and the one they use by default. Optional. */
291
- listModels?(): Promise<ProviderModels>;
292
- /** Deep link into the provider UI for a thread, when it has one. */
293
- threadUrl(providerThreadId: string): string | undefined;
294
- createThread(input: CreateThreadInput): Promise<CreatedThread>;
295
- sendMessage(input: SendMessageInput): Promise<void>;
296
- interrupt(providerThreadId: string): Promise<void>;
297
- /**
298
- * Stream updates for a thread. Called right after `createThread` and again
299
- * for every persisted thread when the bridge restarts. The provider should
300
- * replay current state first, then live updates.
301
- */
302
- watch(providerThreadId: string, sink: ThreadSink): () => void;
303
- dispose(): Promise<void>;
304
- }
305
- interface CreateThreadInput {
306
- title: string;
307
- text: string;
308
- attachments: ImageAttachment[];
309
- /** A `ProviderModel.id` the user picked; the provider's default when absent or unknown. */
310
- model?: string;
311
- }
312
- interface ProviderModels {
313
- models: ProviderModel[];
314
- /** `ProviderModel.id` new threads use when none is picked. */
315
- defaultModel?: string;
316
- }
317
- interface CreatedThread {
318
- providerThreadId: string;
319
- url?: string;
320
- }
321
- interface SendMessageInput {
322
- providerThreadId: string;
323
- text: string;
324
- attachments: ImageAttachment[];
325
- }
326
- interface ProviderMessage {
327
- id: string;
328
- role: MessageRole;
329
- text: string;
330
- streaming: boolean;
331
- createdAt: string;
332
- }
333
- interface ThreadSink {
334
- /** Upsert by `id`; `text` is cumulative. */
335
- message(message: ProviderMessage): void;
336
- status(status: Exclude<ThreadStatus, 'starting' | 'draft'>, detail?: string): void;
337
- /** Provider no longer has this thread (deleted/archived on its side). */
338
- gone(): void;
339
- }
340
- //#endregion
1
+ import { a as Thread, i as Viewer, n as ProviderOption, o as ElementContext, r as ServerMessage, t as Provider } from "./index-B0phpEz9.mjs";
341
2
  //#region ../bridge/src/project-providers.d.ts
342
3
  /** What a project picked in the overlay's settings. */
343
4
  interface SavedProjectSettings {
@@ -419,6 +80,8 @@ interface ThreadStore {
419
80
  //#region ../bridge/src/bridge.d.ts
420
81
  interface BridgeClient {
421
82
  send(message: ServerMessage): void;
83
+ /** Tencil Cloud: who this connection signed in as, echoed in `ready`. */
84
+ viewer?: Viewer;
422
85
  }
423
86
  interface BridgeOptions {
424
87
  providers: ProjectProviders;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { C as renderPrompt, S as Bridge, b as ProjectResolver, d as projectStorePath, l as FileThreadStore, n as probeDaemon, r as startDaemon, t as DEFAULT_PORT, u as defaultDataDir, w as stripContext, x as projectRoot } from "./server-9m0nvaLs.mjs";
1
+ import { C as renderPrompt, S as Bridge, b as ProjectResolver, d as projectStorePath, l as FileThreadStore, n as probeDaemon, r as startDaemon, t as DEFAULT_PORT, u as defaultDataDir, w as stripContext, x as projectRoot } from "./server-COf9gtqR.mjs";
2
2
  export { Bridge, DEFAULT_PORT, ProjectResolver, FileThreadStore as ThreadStore, defaultDataDir, probeDaemon, projectRoot, projectStorePath, renderPrompt, startDaemon, stripContext };
@@ -0,0 +1,163 @@
1
+ let node_fs = require("node:fs");
2
+ let node_path = require("node:path");
3
+ //#region src/integrations/source-attributes.ts
4
+ /** Files whose JSX gets source attributes. */
5
+ const JSX_FILE = /\.[jt]sx$/;
6
+ /** Host elements that never get picked, or must stay untouched. */
7
+ const SKIP = /* @__PURE__ */ new Set([
8
+ "html",
9
+ "head",
10
+ "meta",
11
+ "link",
12
+ "script",
13
+ "style",
14
+ "title",
15
+ "base",
16
+ "noscript",
17
+ "template",
18
+ "slot"
19
+ ]);
20
+ /**
21
+ * Tags every host element (`<button>`, not `<Button>`) with where it's written,
22
+ * `data-tencil-src="src/card.tsx:42:7"`, and the component it's in,
23
+ * `data-tencil-component="Card"`. Production builds drop React's dev source
24
+ * info, so this is how a pin on a preview still knows its file and line.
25
+ *
26
+ * Paths are relative to `root`, the repository root, because that's what the
27
+ * cloud agent checks out. Returns undefined when there's nothing to tag or the
28
+ * file doesn't parse (the bundler will report that itself).
29
+ */
30
+ async function addSourceAttributes(code, id, root) {
31
+ const file = id.replace(/[?#].*$/, "");
32
+ if (!JSX_FILE.test(file) || file.includes(`${node_path.sep}node_modules${node_path.sep}`) || file.includes("\0")) return;
33
+ const path = (0, node_path.relative)(root, file).split(node_path.sep).join("/");
34
+ if (path.startsWith("..")) return void 0;
35
+ const { parseSync } = await import("oxc-parser");
36
+ const parsed = parseSync(file, code, {
37
+ lang: file.endsWith(".tsx") ? "tsx" : "jsx",
38
+ sourceType: "module"
39
+ });
40
+ if (parsed.errors.length > 0) return void 0;
41
+ const lines = lineStarts(code);
42
+ const inserts = [];
43
+ visit(parsed.program, void 0, (node) => {
44
+ const opening = node;
45
+ const tag = opening.name.type === "JSXIdentifier" ? opening.name.name : void 0;
46
+ if (!tag || !/^[a-z]/.test(tag) || SKIP.has(tag)) return;
47
+ if (opening.attributes.some(isTencilAttribute)) return;
48
+ const { line, column } = position(lines, opening.start);
49
+ return `${path}:${line}:${column}`;
50
+ }, inserts);
51
+ if (inserts.length === 0) return void 0;
52
+ const { default: MagicString } = await import("magic-string");
53
+ const output = new MagicString(code);
54
+ for (const insert of inserts) output.appendLeft(insert.at, insert.text);
55
+ return {
56
+ code: output.toString(),
57
+ map: output.generateMap({
58
+ source: file,
59
+ includeContent: true,
60
+ hires: "boundary"
61
+ })
62
+ };
63
+ }
64
+ /** Walks the AST, tracking the component each JSX element is written in. */
65
+ function visit(node, component, sourceOf, inserts) {
66
+ let current = component;
67
+ const named = componentName(node);
68
+ if (named) current = named;
69
+ if (node.type === "JSXOpeningElement") {
70
+ const source = sourceOf(node);
71
+ if (source) {
72
+ const name = node.name.end;
73
+ const attributes = [`data-tencil-src={${JSON.stringify(source)}}`];
74
+ if (current) attributes.push(`data-tencil-component={${JSON.stringify(current)}}`);
75
+ inserts.push({
76
+ at: name,
77
+ text: ` ${attributes.join(" ")}`
78
+ });
79
+ }
80
+ }
81
+ for (const key in node) {
82
+ if (key === "type" || key === "start" || key === "end") continue;
83
+ const value = node[key];
84
+ if (Array.isArray(value)) {
85
+ for (const child of value) if (isNode(child)) visit(child, current, sourceOf, inserts);
86
+ } else if (isNode(value)) visit(value, current, sourceOf, inserts);
87
+ }
88
+ }
89
+ /** `function Card()`, `const Card = () =>`, `const Card = memo(…)`, `class Card`. */
90
+ function componentName(node) {
91
+ let name;
92
+ if (node.type === "FunctionDeclaration" || node.type === "ClassDeclaration") name = node.id?.name;
93
+ else if (node.type === "VariableDeclarator") {
94
+ const init = node.init;
95
+ if (init && (init.type === "ArrowFunctionExpression" || init.type === "FunctionExpression" || init.type === "CallExpression")) name = node.id.name;
96
+ }
97
+ return name && /^[A-Z]/.test(name) ? name : void 0;
98
+ }
99
+ function isTencilAttribute(attribute) {
100
+ const name = attribute.name;
101
+ return attribute.type === "JSXAttribute" && name?.name === "data-tencil-src";
102
+ }
103
+ function isNode(value) {
104
+ return typeof value === "object" && value !== null && typeof value.type === "string";
105
+ }
106
+ function lineStarts(code) {
107
+ const starts = [0];
108
+ for (let i = 0; i < code.length; i++) if (code[i] === "\n") starts.push(i + 1);
109
+ return starts;
110
+ }
111
+ /** 1-based line and column of an offset. */
112
+ function position(starts, offset) {
113
+ let low = 0;
114
+ let high = starts.length - 1;
115
+ while (low < high) {
116
+ const middle = low + high + 1 >> 1;
117
+ if (starts[middle] <= offset) low = middle;
118
+ else high = middle - 1;
119
+ }
120
+ return {
121
+ line: low + 1,
122
+ column: offset - starts[low] + 1
123
+ };
124
+ }
125
+ const WORKSPACE_FILES = [
126
+ "pnpm-workspace.yaml",
127
+ "turbo.json",
128
+ "nx.json",
129
+ "lerna.json"
130
+ ];
131
+ /**
132
+ * The repository a build runs in: the nearest folder with `.git`, else the
133
+ * outermost workspace root (some hosts build without `.git`), else `start`.
134
+ */
135
+ function repositoryRoot(start) {
136
+ let workspace;
137
+ for (let dir = start;; dir = (0, node_path.dirname)(dir)) {
138
+ if ((0, node_fs.existsSync)((0, node_path.join)(dir, ".git"))) return dir;
139
+ if (WORKSPACE_FILES.some((name) => (0, node_fs.existsSync)((0, node_path.join)(dir, name))) || hasWorkspaces(dir)) workspace = dir;
140
+ if ((0, node_path.dirname)(dir) === dir) return workspace ?? start;
141
+ }
142
+ }
143
+ function hasWorkspaces(dir) {
144
+ try {
145
+ return "workspaces" in JSON.parse((0, node_fs.readFileSync)((0, node_path.join)(dir, "package.json"), "utf8"));
146
+ } catch {
147
+ return false;
148
+ }
149
+ }
150
+ //#endregion
151
+ //#region src/integrations/next-loader.ts
152
+ let root;
153
+ /**
154
+ * webpack / Turbopack loader for `withTencil`: adds `data-tencil-src` to the
155
+ * elements of a .jsx/.tsx file before Next compiles it.
156
+ */
157
+ function tencilSourceLoader(source) {
158
+ const callback = this.async();
159
+ root ??= repositoryRoot(this.rootContext ?? process.cwd());
160
+ addSourceAttributes(source, this.resourcePath, root).then((result) => result ? callback(null, result.code, result.map) : callback(null, source), (error) => callback(error));
161
+ }
162
+ //#endregion
163
+ module.exports = tencilSourceLoader;
@@ -0,0 +1,14 @@
1
+ import { t as TencilCloudOptions } from "./cloud-CIAGUsk2.mjs";
2
+ //#region src/integrations/next.d.ts
3
+ /**
4
+ * Wrap `next.config` for Tencil Cloud preview builds: every element gets a
5
+ * `data-tencil-src` attribute with its file and line, because production React
6
+ * keeps no source info. Without TENCIL_CLOUD, in development and on production
7
+ * deployments the config comes back untouched.
8
+ *
9
+ * export default withTencil(nextConfig);
10
+ */
11
+ export declare function withTencil<T extends object>(config?: T, options?: {
12
+ cloud?: TencilCloudOptions;
13
+ }): T;
14
+ //#endregion
package/dist/next.mjs ADDED
@@ -0,0 +1,45 @@
1
+ import { r as resolveCloudBuild } from "./cloud-CiwIrP1h.mjs";
2
+ import { fileURLToPath } from "node:url";
3
+ //#region src/integrations/next.ts
4
+ /**
5
+ * Wrap `next.config` for Tencil Cloud preview builds: every element gets a
6
+ * `data-tencil-src` attribute with its file and line, because production React
7
+ * keeps no source info. Without TENCIL_CLOUD, in development and on production
8
+ * deployments the config comes back untouched.
9
+ *
10
+ * export default withTencil(nextConfig);
11
+ */
12
+ function withTencil(config = {}, options = {}) {
13
+ if (process.env.NODE_ENV === "development") return config;
14
+ if (resolveCloudBuild(process.env, options.cloud).kind !== "on") return config;
15
+ return addSourceLoader(config);
16
+ }
17
+ function addSourceLoader(config) {
18
+ const loader = fileURLToPath(new URL("./next-loader.cjs", import.meta.url));
19
+ const rule = { loaders: [loader] };
20
+ return {
21
+ ...config,
22
+ turbopack: {
23
+ ...config.turbopack,
24
+ rules: {
25
+ ...config.turbopack?.rules,
26
+ "*.tsx": rule,
27
+ "*.jsx": rule
28
+ }
29
+ },
30
+ webpack(webpackConfig, context) {
31
+ const result = config.webpack ? config.webpack(webpackConfig, context) : webpackConfig;
32
+ result.module ??= {};
33
+ result.module.rules ??= [];
34
+ result.module.rules.unshift({
35
+ test: /\.[jt]sx$/,
36
+ exclude: /node_modules/,
37
+ enforce: "pre",
38
+ use: [{ loader }]
39
+ });
40
+ return result;
41
+ }
42
+ };
43
+ }
44
+ //#endregion
45
+ export { withTencil };