@lark.js/mvc 0.0.12 → 0.0.14

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/webpack.js CHANGED
@@ -27,12 +27,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.4_34a04ed47198e6dd24361ae1f6711a67/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.43_@swc+helpers@0.5.23__jiti@2.7.0_postcss@8.5.15_tsx@4.22.4_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/esm_shims.js
31
31
  import path from "path";
32
32
  import { fileURLToPath } from "url";
33
33
  var getFilename, __filename;
34
34
  var init_esm_shims = __esm({
35
- "../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.4_34a04ed47198e6dd24361ae1f6711a67/node_modules/tsup/assets/esm_shims.js"() {
35
+ "../../node_modules/.pnpm/tsup@8.5.1_@swc+core@1.15.43_@swc+helpers@0.5.23__jiti@2.7.0_postcss@8.5.15_tsx@4.22.4_typescript@5.9.3_yaml@2.9.0/node_modules/tsup/assets/esm_shims.js"() {
36
36
  "use strict";
37
37
  getFilename = () => fileURLToPath(import.meta.url);
38
38
  __filename = /* @__PURE__ */ getFilename();
@@ -14528,7 +14528,7 @@ var require_lib = __commonJS({
14528
14528
  options = Object.assign({}, options);
14529
14529
  try {
14530
14530
  options.sourceType = "module";
14531
- const parser = getParser2(options, input);
14531
+ const parser = getParser(options, input);
14532
14532
  const ast = parser.parse();
14533
14533
  if (parser.sawUnambiguousESM) {
14534
14534
  return ast;
@@ -14536,7 +14536,7 @@ var require_lib = __commonJS({
14536
14536
  if (parser.ambiguousScriptDifferentAst) {
14537
14537
  try {
14538
14538
  options.sourceType = "script";
14539
- return getParser2(options, input).parse();
14539
+ return getParser(options, input).parse();
14540
14540
  } catch (_unused) {
14541
14541
  }
14542
14542
  } else {
@@ -14546,17 +14546,17 @@ var require_lib = __commonJS({
14546
14546
  } catch (moduleError) {
14547
14547
  try {
14548
14548
  options.sourceType = "script";
14549
- return getParser2(options, input).parse();
14549
+ return getParser(options, input).parse();
14550
14550
  } catch (_unused2) {
14551
14551
  }
14552
14552
  throw moduleError;
14553
14553
  }
14554
14554
  } else {
14555
- return getParser2(options, input).parse();
14555
+ return getParser(options, input).parse();
14556
14556
  }
14557
14557
  }
14558
14558
  function parseExpression(input, options) {
14559
- const parser = getParser2(options, input);
14559
+ const parser = getParser(options, input);
14560
14560
  if (parser.options.strictMode) {
14561
14561
  parser.state.strict = true;
14562
14562
  }
@@ -14570,7 +14570,7 @@ var require_lib = __commonJS({
14570
14570
  return tokenTypes2;
14571
14571
  }
14572
14572
  var tokTypes = generateExportedTokenTypes(tt);
14573
- function getParser2(options, input) {
14573
+ function getParser(options, input) {
14574
14574
  let cls = Parser;
14575
14575
  const pluginsMap = /* @__PURE__ */ new Map();
14576
14576
  if (options != null && options.plugins) {
@@ -15159,336 +15159,10 @@ function compileToVDomFunction(source, debug, file) {
15159
15159
  return `($data,$viewId,$refAlt,$n,$refFn,$encUri,$encQuote)=>{${fullSource}}`;
15160
15160
  }
15161
15161
 
15162
- // src/compiler/swc/extract-global-vars.ts
15163
- init_esm_shims();
15164
- var parseSyncFn = null;
15165
- var parseSyncLoadAttempted = false;
15166
- async function getParser() {
15167
- if (!parseSyncLoadAttempted) {
15168
- parseSyncLoadAttempted = true;
15169
- try {
15170
- const swc = await import("@swc/core");
15171
- parseSyncFn = swc.parseSync;
15172
- } catch (err) {
15173
- console.error("failed to load @swc/core", err);
15174
- }
15175
- }
15176
- return parseSyncFn;
15177
- }
15178
- async function extractGlobalVars(source) {
15179
- const { protectedSource, comments: _comments } = protectComments(source);
15180
- const viewEventProcessed = processViewEvents(protectedSource);
15181
- const converted = convertArtSyntax(viewEventProcessed, false);
15182
- const template = restoreComments(converted, _comments);
15183
- const templateCmdRegExp = /<%([@=!:])?([\s\S]*?)%>|$/g;
15184
- const fnParts = [];
15185
- const htmlStore = {};
15186
- let htmlIndex = 0;
15187
- let lastIndex = 0;
15188
- const htmlKey = String.fromCharCode(5);
15189
- template.replace(
15190
- templateCmdRegExp,
15191
- (match, operate, content, offset) => {
15192
- const start = operate ? 3 : 2;
15193
- const htmlText = template.substring(lastIndex, offset + start);
15194
- const key = htmlKey + htmlIndex++ + htmlKey;
15195
- htmlStore[key] = htmlText;
15196
- lastIndex = offset + match.length - 2;
15197
- if (operate && content.trim()) {
15198
- fnParts.push(';"' + key + '";', "[" + content + "]");
15199
- } else {
15200
- fnParts.push(';"' + key + '";', content || "");
15201
- }
15202
- return match;
15203
- }
15204
- );
15205
- let fn = fnParts.join("");
15206
- fn = `(function(){${fn}})`;
15207
- const parseSync = await getParser();
15208
- if (!parseSync) {
15209
- return fallbackExtractVariables(source);
15210
- }
15211
- let ast;
15212
- try {
15213
- ast = parseSync(fn, {
15214
- syntax: "ecmascript",
15215
- target: "es2022"
15216
- });
15217
- } catch {
15218
- return fallbackExtractVariables(source);
15219
- }
15220
- const globalExists = {};
15221
- for (const name of BUILTIN_GLOBALS) globalExists[name] = 1;
15222
- const globalVars = /* @__PURE__ */ Object.create(null);
15223
- const fnNodes = [];
15224
- walkSwcAst(ast, {
15225
- VariableDeclarator(node) {
15226
- if (node.id.type === "Identifier") {
15227
- const name = node.id.value;
15228
- globalExists[name] = node.init ? 3 : 2;
15229
- }
15230
- },
15231
- FunctionDeclaration(node) {
15232
- if (node.identifier) {
15233
- globalExists[node.identifier.value] = 3;
15234
- }
15235
- fnNodes.push(node);
15236
- },
15237
- FunctionExpression(node) {
15238
- fnNodes.push(node);
15239
- },
15240
- ArrowFunctionExpression(node) {
15241
- fnNodes.push(node);
15242
- },
15243
- CallExpression(node) {
15244
- if (node.callee.type === "Identifier") {
15245
- globalExists[node.callee.value] = 1;
15246
- }
15247
- }
15248
- });
15249
- const functionParams = /* @__PURE__ */ Object.create(null);
15250
- for (const fnNode of fnNodes) {
15251
- const patterns = getParamPatterns(fnNode);
15252
- for (const pat of patterns) {
15253
- if (pat.type === "Identifier") {
15254
- functionParams[pat.value] = 1;
15255
- } else if (pat.type === "AssignmentPattern" && pat.left.type === "Identifier") {
15256
- functionParams[pat.left.value] = 1;
15257
- } else if (pat.type === "RestElement" && pat.argument.type === "Identifier") {
15258
- functionParams[pat.argument.value] = 1;
15259
- }
15260
- }
15261
- }
15262
- walkSwcAst(ast, {
15263
- Identifier(node) {
15264
- const name = node.value;
15265
- if (globalExists[name]) return;
15266
- if (functionParams[name]) return;
15267
- globalVars[name] = 1;
15268
- },
15269
- AssignmentExpression(node) {
15270
- if (node.left.type === "Identifier") {
15271
- const name = node.left.value;
15272
- if (!globalExists[name] || globalExists[name] === 1) {
15273
- globalExists[name] = (globalExists[name] || 0) + 1;
15274
- }
15275
- }
15276
- }
15277
- });
15278
- return Object.keys(globalVars);
15279
- }
15280
- function getParamPatterns(fnNode) {
15281
- if (fnNode.type === "ArrowFunctionExpression") {
15282
- return fnNode.params;
15283
- }
15284
- return fnNode.params.map((p) => p.pat);
15285
- }
15286
- function fallbackExtractVariables(source) {
15287
- const vars = /* @__PURE__ */ new Set();
15288
- const outputRegExp = /\{\{[:=!@]\s*([a-zA-Z_$][\w$]*)[^}]*\}\}/g;
15289
- let m;
15290
- while ((m = outputRegExp.exec(source)) !== null) {
15291
- vars.add(m[1]);
15292
- }
15293
- const eachRegExp = /\{\{forOf\s+([a-zA-Z_$][\w$]*)\s+as/g;
15294
- while ((m = eachRegExp.exec(source)) !== null) {
15295
- vars.add(m[1]);
15296
- }
15297
- const ifRegExp = /\{\{(?:else\s+)?if\s+([a-zA-Z_$][\w$]*)[^}]*\}\}/g;
15298
- while ((m = ifRegExp.exec(source)) !== null) {
15299
- vars.add(m[1]);
15300
- }
15301
- return Array.from(vars).filter((v) => !BUILTIN_GLOBALS.has(v));
15302
- }
15303
- function walkSwcAst(ast, visitors) {
15304
- function visit(node) {
15305
- const type = node.type;
15306
- if (visitors[type]) {
15307
- visitors[type](node);
15308
- }
15309
- for (const key of Object.keys(node)) {
15310
- if (key === "type" || key === "span" || key === "ctxt") continue;
15311
- if (type === "MemberExpression" && key === "property") {
15312
- const me = node;
15313
- if (me.property.type !== "Computed") continue;
15314
- }
15315
- if (type === "KeyValueProperty" && key === "key") {
15316
- const kv = node;
15317
- if (kv.key.type !== "Computed") continue;
15318
- }
15319
- if (type === "MethodProperty" && key === "key") {
15320
- const mp = node;
15321
- if (mp.key.type !== "Computed") continue;
15322
- }
15323
- const child = Reflect.get(node, key);
15324
- if (Array.isArray(child)) {
15325
- for (const item of child) {
15326
- if (isSwcNode(item)) visit(item);
15327
- }
15328
- } else if (isSwcNode(child)) {
15329
- visit(child);
15330
- }
15331
- }
15332
- }
15333
- visit(ast);
15334
- }
15335
- function isSwcNode(v) {
15336
- return !!v && typeof v === "object" && typeof v.type === "string";
15337
- }
15338
- var BUILTIN_GLOBALS = /* @__PURE__ */ new Set([
15339
- // ─── Template runtime helpers (injected by compileToFunction) ───────
15340
- //
15341
- // These variables appear in the generated template function signature
15342
- // or body. They must be excluded from extractGlobalVars() so that
15343
- // they are not mistaken for user data variables and destructured from $data.
15344
- // SPLITTER character constant (same as \x1e), used as namespace separator
15345
- // for refData keys, event attribute encoding, and internal data structures.
15346
- // Declared as: let $splitter='\x1e'
15347
- "$splitter",
15348
- // Data — the data object passed from Updater to the template function.
15349
- // User variables are destructured from $data at the top of the function:
15350
- // let {name, age} = $data;
15351
- // This is the first parameter of the generated arrow function.
15352
- "$data",
15353
- // Null-safe toString: v => '' + (v == null ? '' : v)
15354
- // Converts null/undefined to empty string, otherwise calls toString().
15355
- // Wraps every {{!raw}} output to prevent "null" / "undefined" rendering.
15356
- "$strSafe",
15357
- // HTML entity encoder: v => $strSafe(v).replace(/[&<>"'`]/g, entityMap)
15358
- // Encodes &, <, >, ", ', ` to HTML entities (&amp; &lt; etc.)
15359
- // Applied to all {{=escaped}} and {{:binding}} outputs.
15360
- "$encHtml",
15361
- // HTML entity map — internal object used by $encHtml:
15362
- // {'&':'amp','<':'gt','>':'gt','"':'#34','\'':'#39','`':'#96'}
15363
- // Not a standalone function; referenced inside $encHtml's closure.
15364
- "$entMap",
15365
- // HTML entity RegExp — internal regexp used by $encHtml:
15366
- // /[&<>"'`]/g
15367
- "$entReg",
15368
- // HTML entity replacer function — internal helper used by $encHtml:
15369
- // m => '&' + $entMap[m] + ';'
15370
- // Maps matched character to its entity string.
15371
- "$entFn",
15372
- // Output buffer — the string accumulator for rendered HTML.
15373
- // All template output is appended via $out += '...'.
15374
- // Declared as: let $out = ''
15375
- "$out",
15376
- // Reference lookup: (refData, value) => key
15377
- // Finds or allocates a SPLITTER-prefixed key in refData for a given
15378
- // object reference. Used by {{@ref}} operator for passing object
15379
- // references to child views via v-lark attributes.
15380
- "$refFn",
15381
- // URI encoder: v => encodeURIComponent($strSafe(v)).replace(/[!')(*]/g, extraMap)
15382
- // Extends encodeURIComponent with encoding of ! ' ( ) *.
15383
- // Applied to values in @event URL parameters and {{!uri}} contexts.
15384
- "$encUri",
15385
- // URI encode map — internal object used by $encUri:
15386
- // {'!':'%21','\'':'%27','(':'%28',')':'%29','*':'%2A'}
15387
- "$uriMap",
15388
- // URI encode replacer — internal helper used by $encUri:
15389
- // m => $uriMap[m]
15390
- "$uriFn",
15391
- // URI encode regexp — internal regexp used by $encUri:
15392
- // /[!')(*]/g
15393
- "$uriReg",
15394
- // Quote encoder: v => $strSafe(v).replace(/['"\\]/g, '\\$&')
15395
- // Escapes quotes and backslashes for safe embedding in HTML attribute
15396
- // values (e.g. data-json='...').
15397
- "$encQuote",
15398
- // Quote encode regexp — internal regexp used by $encQuote:
15399
- // /['"\\]/g
15400
- "$qReg",
15401
- // View ID — the unique identifier of the owning View instance.
15402
- // Injected into @event attribute values at render time so that
15403
- // EventDelegator can dispatch events to the correct View handler.
15404
- // The \x1f placeholder in compiled output is replaced with '+$viewId+'.
15405
- "$viewId",
15406
- // Debug: current expression text — stores the template expression being
15407
- // evaluated, for error reporting. Only present in debug mode.
15408
- // e.g. $dbgExpr='<%=user.name%>'
15409
- "$dbgExpr",
15410
- // Debug: original art syntax — stores the {{}} template syntax before
15411
- // conversion, for error reporting. Only present in debug mode.
15412
- // e.g. $dbgArt='{{=user.name}}'
15413
- "$dbgArt",
15414
- // Debug: source line number — tracks the current line in the template
15415
- // source, for error reporting. Only present in debug mode.
15416
- "$dbgLine",
15417
- // RefData alias — fallback reference lookup table.
15418
- // Defaults to $data when no explicit $refAlt is provided.
15419
- // Ensures $refFn() does not crash when @ operator is used without refData.
15420
- "$refAlt",
15421
- // Temporary variable — used by the compiler for intermediate
15422
- // expression results in generated code (e.g. loop variables,
15423
- // conditional branches). Declared as: let $tmp
15424
- "$tmp",
15425
- // JS literals
15426
- "undefined",
15427
- "null",
15428
- "true",
15429
- "false",
15430
- "NaN",
15431
- "Infinity",
15432
- // JS built-in globals
15433
- "window",
15434
- "self",
15435
- "globalThis",
15436
- "document",
15437
- "console",
15438
- "JSON",
15439
- "Math",
15440
- "Intl",
15441
- "Promise",
15442
- "Symbol",
15443
- "Number",
15444
- "String",
15445
- "Boolean",
15446
- "Array",
15447
- "Object",
15448
- "Date",
15449
- "RegExp",
15450
- "Error",
15451
- "TypeError",
15452
- "RangeError",
15453
- "SyntaxError",
15454
- "Map",
15455
- "Set",
15456
- "WeakMap",
15457
- "WeakSet",
15458
- "Proxy",
15459
- "Reflect",
15460
- "ArrayBuffer",
15461
- "DataView",
15462
- "Float32Array",
15463
- "Float64Array",
15464
- "Int8Array",
15465
- "Int16Array",
15466
- "Int32Array",
15467
- "Uint8Array",
15468
- "Uint16Array",
15469
- "Uint32Array",
15470
- "Uint8ClampedArray",
15471
- // Functions
15472
- "parseInt",
15473
- "parseFloat",
15474
- "isNaN",
15475
- "isFinite",
15476
- "encodeURIComponent",
15477
- "decodeURIComponent",
15478
- "encodeURI",
15479
- "decodeURI",
15480
- // SWC helpers
15481
- "arguments",
15482
- "this",
15483
- "require",
15484
- // Lark framework
15485
- "Lark"
15486
- ]);
15487
-
15488
15162
  // src/compiler/extract-global-vars.ts
15489
15163
  init_esm_shims();
15490
15164
  var import_parser = __toESM(require_lib(), 1);
15491
- async function extractGlobalVars2(source) {
15165
+ async function extractGlobalVars(source) {
15492
15166
  const { protectedSource, comments: _comments } = protectComments(source);
15493
15167
  const viewEventProcessed = processViewEvents(protectedSource);
15494
15168
  const converted = convertArtSyntax(viewEventProcessed, false);
@@ -15525,10 +15199,10 @@ async function extractGlobalVars2(source) {
15525
15199
  allowAwaitOutsideFunction: true
15526
15200
  });
15527
15201
  } catch {
15528
- return fallbackExtractVariables2(source);
15202
+ return fallbackExtractVariables(source);
15529
15203
  }
15530
15204
  const globalExists = {};
15531
- for (const name of BUILTIN_GLOBALS2) globalExists[name] = 1;
15205
+ for (const name of BUILTIN_GLOBALS) globalExists[name] = 1;
15532
15206
  const globalVars = /* @__PURE__ */ Object.create(null);
15533
15207
  const fnRange = [];
15534
15208
  walkAst(ast, {
@@ -15587,22 +15261,22 @@ async function extractGlobalVars2(source) {
15587
15261
  });
15588
15262
  return Object.keys(globalVars);
15589
15263
  }
15590
- function fallbackExtractVariables2(source) {
15264
+ function fallbackExtractVariables(source) {
15591
15265
  const vars = /* @__PURE__ */ new Set();
15592
15266
  const outputRegExp = /\{\{[:=!@]\s*([a-zA-Z_$][\w$]*)[^}]*\}\}/g;
15593
15267
  let m;
15594
15268
  while ((m = outputRegExp.exec(source)) !== null) {
15595
15269
  vars.add(m[1]);
15596
15270
  }
15597
- const eachRegExp = /\{\{forOf\s+([a-zA-Z_$][\w$]*)\s+as/g;
15598
- while ((m = eachRegExp.exec(source)) !== null) {
15271
+ const forOfRegExp = /\{\{forOf\s+([a-zA-Z_$][\w$]*)\s+as/g;
15272
+ while ((m = forOfRegExp.exec(source)) !== null) {
15599
15273
  vars.add(m[1]);
15600
15274
  }
15601
15275
  const ifRegExp = /\{\{(?:else\s+)?if\s+([a-zA-Z_$][\w$]*)[^}]*\}\}/g;
15602
15276
  while ((m = ifRegExp.exec(source)) !== null) {
15603
15277
  vars.add(m[1]);
15604
15278
  }
15605
- return Array.from(vars).filter((v) => !BUILTIN_GLOBALS2.has(v));
15279
+ return Array.from(vars).filter((v) => !BUILTIN_GLOBALS.has(v));
15606
15280
  }
15607
15281
  function walkAst(ast, visitors) {
15608
15282
  function visit(node) {
@@ -15640,7 +15314,7 @@ function walkAst(ast, visitors) {
15640
15314
  function isAstNode(v) {
15641
15315
  return !!v && typeof v === "object" && typeof v.type === "string";
15642
15316
  }
15643
- var BUILTIN_GLOBALS2 = /* @__PURE__ */ new Set([
15317
+ var BUILTIN_GLOBALS = /* @__PURE__ */ new Set([
15644
15318
  // ─── Template runtime helpers (injected by compileToFunction) ───────
15645
15319
  //
15646
15320
  // These variables appear in the generated template function signature
@@ -15879,8 +15553,8 @@ function compileToFunction(source, debug, file) {
15879
15553
  return `($data,$viewId,$refAlt,$encHtml,$strSafe,$encUri,$refFn,$encQuote)=>{${fullSource}}`;
15880
15554
  }
15881
15555
  async function compileTemplate(source, options = {}) {
15882
- const { debug = false, file, virtualDom = false, useSwc = false } = options;
15883
- const globalVars = options.globalVars ?? await (useSwc ? extractGlobalVars(source) : extractGlobalVars2(source));
15556
+ const { debug = false, file, virtualDom = false } = options;
15557
+ const globalVars = options.globalVars ?? await extractGlobalVars(source);
15884
15558
  const { protectedSource, comments } = protectComments(source);
15885
15559
  const converted = convertArtSyntax(protectedSource, debug);
15886
15560
  const viewEventProcessed = processViewEvents(converted);
@@ -15917,13 +15591,12 @@ export default function(data, viewId, refData) {
15917
15591
  async function larkMvcLoader(source) {
15918
15592
  try {
15919
15593
  const options = this.getOptions() || {};
15920
- const { debug = false, virtualDom = false, useSwc = false } = options;
15921
- const globalVars = await extractGlobalVars2(source);
15594
+ const { debug = false, virtualDom = false } = options;
15595
+ const globalVars = await extractGlobalVars(source);
15922
15596
  return compileTemplate(source, {
15923
15597
  debug,
15924
15598
  globalVars,
15925
- virtualDom,
15926
- useSwc
15599
+ virtualDom
15927
15600
  });
15928
15601
  } catch (err) {
15929
15602
  console.error(err);
@@ -15936,7 +15609,6 @@ var LarkMvcPlugin = class {
15936
15609
  this.options = {
15937
15610
  debug: false,
15938
15611
  virtualDom: false,
15939
- useSwc: false,
15940
15612
  test: /\.html$/,
15941
15613
  exclude: /node_modules/,
15942
15614
  ...options
@@ -15947,7 +15619,7 @@ var LarkMvcPlugin = class {
15947
15619
  * Called by webpack when the plugin is applied.
15948
15620
  */
15949
15621
  apply(compiler) {
15950
- const { debug, virtualDom, useSwc, test, exclude } = this.options;
15622
+ const { debug, virtualDom, test, exclude } = this.options;
15951
15623
  compiler.options.module = compiler.options.module || {};
15952
15624
  compiler.options.module.rules = compiler.options.module.rules || [];
15953
15625
  compiler.options.module.rules.push({
@@ -15961,7 +15633,7 @@ var LarkMvcPlugin = class {
15961
15633
  // __filename is provided by tsup's ESM shim (shims: true) in ESM output,
15962
15634
  // and is a native CJS global in CJS output.
15963
15635
  loader: __filename,
15964
- options: { debug, virtualDom, useSwc }
15636
+ options: { debug, virtualDom }
15965
15637
  }
15966
15638
  ]
15967
15639
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark.js/mvc",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "@lark.js/mvc - TypeScript MVC framework",
5
5
  "keywords": [
6
6
  "framework",
@@ -11,7 +11,6 @@
11
11
  "author": "https://github.com/hangtiancheng",
12
12
  "files": [
13
13
  "dist",
14
- "src/client.d.ts",
15
14
  "README.md"
16
15
  ],
17
16
  "type": "module",
@@ -88,6 +87,9 @@
88
87
  "types": "./dist/devtool.d.cts",
89
88
  "default": "./dist/devtool.cjs"
90
89
  }
90
+ },
91
+ "./client": {
92
+ "types": "./dist/client.d.ts"
91
93
  }
92
94
  },
93
95
  "scripts": {
@@ -106,7 +108,6 @@
106
108
  "@babel/parser": "^7.29.7",
107
109
  "@babel/types": "^7.29.7",
108
110
  "@rspack/core": "^2.0.8",
109
- "@swc/core": "^1.15.41",
110
111
  "htmlparser2": "^12.0.0"
111
112
  },
112
113
  "devDependencies": {
@@ -115,11 +116,12 @@
115
116
  "@rollup/plugin-typescript": "^12.3.0",
116
117
  "@types/node": "^24.13.2",
117
118
  "@vitest/coverage-v8": "4.1.6",
118
- "rollup": "^4.62.0",
119
+ "rollup": "^4.62.2",
119
120
  "rollup-plugin-dts": "^6.4.1",
120
121
  "tsup": "^8.5.1",
121
122
  "typescript": "^5.9.3",
122
- "vite": "^8.0.16",
123
+ "vite": "^8.1.0",
124
+ "vite7": "npm:vite@7.3.5",
123
125
  "vitest": "^4.1.9"
124
126
  },
125
127
  "peerDependencies": {
package/src/client.d.ts DELETED
@@ -1,89 +0,0 @@
1
- import type {
2
- FrameInterface,
3
- FrameworkInterface,
4
- StateInterface,
5
- RouterInterface,
6
- CrossSiteConfig,
7
- } from "./types";
8
- import type { Frame } from "./frame";
9
- import type { View } from "./view";
10
- declare global {
11
- interface Window {
12
- /** Whether lark debug mode is enabled */
13
- __lark_Debug: boolean;
14
- /** Lark Framework object */
15
- __lark_Framework?: FrameworkInterface;
16
- /** Lark State object */
17
- __lark_State?: StateInterface;
18
- /** Lark Router object */
19
- __lark_Router?: RouterInterface;
20
- /** Lark Frame class */
21
- __lark_Frame?: typeof Frame;
22
- /** Lark View class */
23
- __lark_View?: typeof View;
24
- /** Invalidate a view class from the registry (HMR support) */
25
- __lark_invalidateViewClass?: (viewPath: string) => void;
26
- /** Get the view class registry (HMR/debug support) */
27
- __lark_getViewClassRegistry?: () => Record<string, typeof View>;
28
- /** Register a view class (HMR support) */
29
- __lark_registerViewClass?: (
30
- viewPath: string,
31
- ViewClass: typeof View,
32
- ) => void;
33
- /** Cross-site configuration injected by build tools */
34
- crossConfigs?: CrossSiteConfig[];
35
- scheduler?: Scheduler;
36
- }
37
- interface ImportMeta {
38
- /** HMR context provided by Vite / webpack dev server. Undefined in production. */
39
- hot?: {
40
- accept(cb?: (mod: { default?: unknown } | undefined) => void): void;
41
- dispose(cb: (data: unknown) => void): void;
42
- invalidate(): void;
43
- };
44
- }
45
- interface HTMLElement {
46
- /** Bound frame instance */
47
- frame?: FrameInterface | undefined;
48
- /** Whether frame is bound to this element (1 = bound) */
49
- frameBound?: number;
50
- /** Whether auto-generated ID was assigned */
51
- autoId?: number;
52
- /** View rendered flag for selector matching */
53
- viewRendered?: number;
54
- /** Range frame ID for event delegation */
55
- rangeFrameId?: string;
56
- /** Range element guid for event delegation */
57
- rangeElementGuid?: number;
58
- }
59
-
60
- interface Element {
61
- /** DOM diff cached compare key flag */
62
- compareKeyCached?: number | undefined;
63
- /** DOM diff cached compare key */
64
- cachedCompareKey?: string | undefined;
65
- "v-lark"?: string | undefined;
66
-
67
- // @lark.js/sentry
68
- "s-lark-ev"?: string | undefined;
69
- "s-lark-msg"?: string | undefined;
70
- }
71
- }
72
-
73
- // CSS module type declarations
74
- declare module "*.css" {
75
- const content: string;
76
- export default content;
77
- }
78
-
79
- // HTML template module declarations (Lark templates - compiled to functions)
80
- declare module "*.html" {
81
- // const template: (
82
- // data: unknown,
83
- // viewId: string,
84
- // refData: unknown,
85
- // ) => string;
86
- // export default template;
87
- const content: string;
88
- export default content;
89
- }