@luckystack/devkit 0.13.0 → 0.14.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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to `@luckystack/devkit` are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.14.0] - 2026-10-16
9
+
10
+ ### Fixed
11
+
12
+ - **Injected route and page files no longer start with a blanket `eslint-disable`.** The dev watcher copied the template's own lint-disable header into each new file, which silenced all lint there and, once the file was clean, failed lint as an unused directive. The header is now dropped on injection, for the bundled templates and for project copies in `.luckystack/templates/`; the template files keep it, and a template saved with a byte-order mark loses it too. Files injected earlier keep their header until you delete those two lines.
13
+ - **Injected route and page files pass the scaffold's lint.** Without the header the template bodies failed it: an empty `({ })` parameter, an `async` sync handler without `await`, unused page props, a stray `@ts-ignore` in the page templates and untranslated placeholder text. `main` now takes no parameters (a comment shows what to destructure), the legacy `sync_client` template returns `MaybePromise`, pages take no props until they need them. The empty `{}` input/output shapes stay, because the type generator and the sync-pairing rewrite read them; the scaffold's ESLint config allows them in `_api` and `_sync` files (`create-luckystack-app` 0.14.0). In an existing project, `npx luckystack update` brings the new `.luckystack/templates/` copies and `eslint.official.config.js` (an edited copy gets a `.new` sidecar to merge).
14
+
8
15
  ## [0.12.0] - 2026-10-15
9
16
 
10
17
  ### Changed
package/dist/index.js CHANGED
@@ -4458,10 +4458,16 @@ var checkPagePlacement = (filePath, srcRelativePath) => {
4458
4458
  }
4459
4459
  return null;
4460
4460
  };
4461
+ var TEMPLATE_LINT_HEADER = /^(?:\/\* eslint-disable(?: unicorn\/no-abusive-eslint-disable)? \*\/[^\S\r\n]*\r?\n)+(?:[^\S\r\n]*\r?\n)?/;
4462
+ var BYTE_ORDER_MARK = String.fromCodePoint(65279);
4463
+ var stripTemplateLintHeader = (content) => {
4464
+ const unmarked = content.startsWith(BYTE_ORDER_MARK) ? content.slice(1) : content;
4465
+ return TEMPLATE_LINT_HEADER.test(unmarked) ? unmarked.replace(TEMPLATE_LINT_HEADER, "") : content;
4466
+ };
4461
4467
  var applyTemplatePlaceholders = (content, filePath, fileKind) => {
4462
4468
  const relPath = calculateRelativePath(filePath);
4463
4469
  const pragmaPattern = /\/\/\s*@ts-(?:ignore|expect-error).*\r?\n(.*)\{\{REL_PATH\}\}/g;
4464
- let result = content.replaceAll(pragmaPattern, (_, prefix) => `${prefix}${relPath}`);
4470
+ let result = stripTemplateLintHeader(content).replaceAll(pragmaPattern, (_, prefix) => `${prefix}${relPath}`);
4465
4471
  result = result.replaceAll("{{REL_PATH}}", () => relPath);
4466
4472
  if (fileKind === "sync_client" || fileKind === "sync_server") {
4467
4473
  const pagePath = extractSyncPagePath2(filePath);
@@ -4685,11 +4691,12 @@ var injectServerTemplateWithClientInput = async (serverFilePath, clientInputType
4685
4691
  try {
4686
4692
  await ensureConsumerTemplateConfigLoaded();
4687
4693
  const relPath = calculateRelativePath(serverFilePath);
4688
- let content = resolveTemplateContent("sync_server");
4689
- if (content === null) {
4694
+ const rawContent = resolveTemplateContent("sync_server");
4695
+ if (rawContent === null) {
4690
4696
  console.error(`[TemplateInjector] No sync_server template content available for: ${serverFilePath}`);
4691
4697
  return false;
4692
4698
  }
4699
+ let content = stripTemplateLintHeader(rawContent);
4693
4700
  const pragmaPattern = /\/\/\s*@ts-(?:ignore|expect-error).*\r?\n(.*)\{\{REL_PATH\}\}/g;
4694
4701
  content = content.replaceAll(pragmaPattern, (_, prefix) => {
4695
4702
  return `${prefix}${relPath}`;