pasika 0.10.128 → 0.10.130

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.
@@ -9932,10 +9932,12 @@ var colorRoleUsageRule = {
9932
9932
  };
9933
9933
 
9934
9934
  // eslint/rules/tailwind/css-entry-point.ts
9935
- import { statSync as statSync4 } from "fs";
9935
+ import { existsSync as existsSync9, statSync as statSync4 } from "fs";
9936
9936
  import path67 from "path";
9937
9937
  var APP_STYLES_DIR = path67.join("app", "styles");
9938
9938
  var GLOBAL_STYLESHEET_PATH = path67.join(APP_STYLES_DIR, "globals.css");
9939
+ var FEATURE_STYLESHEET_NAME = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*\.css$/u;
9940
+ var FEATURE_STYLESHEET_ERROR = "Only globals.css and <feature>.css matching an existing src/features/<feature>/ directory are allowed in src/app/styles/.";
9939
9941
  var cssEntryPointRule = {
9940
9942
  meta: {
9941
9943
  schema: [],
@@ -10016,6 +10018,13 @@ var cssEntryPointRule = {
10016
10018
  });
10017
10019
  return;
10018
10020
  }
10021
+ const basename = path67.basename(current);
10022
+ const featureName = basename.slice(0, -".css".length);
10023
+ const featureDir = path67.join(sourceRoot, "features", featureName);
10024
+ const isFeatureStylesheet = path67.dirname(current) === path67.join(sourceRoot, APP_STYLES_DIR) && FEATURE_STYLESHEET_NAME.test(basename) && existsSync9(featureDir) && statSync4(featureDir).isDirectory();
10025
+ if (!isFeatureStylesheet) {
10026
+ context.report({ node, message: FEATURE_STYLESHEET_ERROR });
10027
+ }
10019
10028
  if (!directChildren.has(current)) {
10020
10029
  context.report({
10021
10030
  node,
@@ -10070,7 +10079,7 @@ var customUtilityApplyRule = {
10070
10079
  };
10071
10080
 
10072
10081
  // eslint/rules/tailwind/feature-css-placement.ts
10073
- import { existsSync as existsSync9 } from "fs";
10082
+ import { existsSync as existsSync10 } from "fs";
10074
10083
  import path70 from "path";
10075
10084
 
10076
10085
  // eslint/rules/tailwind/css-dependency-graph.ts
@@ -10519,7 +10528,7 @@ var featureCssPlacementRule = {
10519
10528
  if (!relative.startsWith(`${STYLES_DIR}${path70.sep}`)) return {};
10520
10529
  const basename = path70.basename(current);
10521
10530
  const featureName = basename.slice(0, -".css".length);
10522
- const isFeatureFile = path70.dirname(current) === styles && FEATURE_CSS.test(basename) && existsSync9(path70.join(sourceRoot, "features", featureName));
10531
+ const isFeatureFile = path70.dirname(current) === styles && FEATURE_CSS.test(basename) && existsSync10(path70.join(sourceRoot, "features", featureName));
10523
10532
  const read = cachedTextReader();
10524
10533
  const css2 = findFiles(sourceRoot, CSS_EXTENSIONS).map((file) => ({ path: file, content: read(file) }));
10525
10534
  const modules = findFiles(sourceRoot, MODULE_EXTENSIONS4).map((file) => ({ path: file, content: read(file) }));
@@ -10532,7 +10541,7 @@ var featureCssPlacementRule = {
10532
10541
  const owner = owners.get(symbolId(definition));
10533
10542
  if (!owner) continue;
10534
10543
  const expected = owner === GLOBALS ? GLOBALS : `${owner}.css`;
10535
- if (owner !== GLOBALS && (basename === GLOBALS || !isFeatureFile) && !existsSync9(path70.join(styles, expected))) {
10544
+ if (owner !== GLOBALS && (basename === GLOBALS || !isFeatureFile) && !existsSync10(path70.join(styles, expected))) {
10536
10545
  continue;
10537
10546
  }
10538
10547
  if (basename === expected) continue;
@@ -10552,7 +10561,7 @@ var featureCssPlacementRule = {
10552
10561
  };
10553
10562
 
10554
10563
  // eslint/rules/tailwind/global-stylesheet.ts
10555
- import { existsSync as existsSync10 } from "fs";
10564
+ import { existsSync as existsSync11 } from "fs";
10556
10565
  import path71 from "path";
10557
10566
  var MISSING_REGISTRATION = 'Global stylesheet must register Tailwind with @import "tailwindcss".';
10558
10567
  var MISSING_ENTRYPOINT = "Project CSS must have a canonical global stylesheet at src/app/styles/globals.css.";
@@ -10570,7 +10579,7 @@ var globalStylesheetRule = {
10570
10579
  const entryPoint = path71.normalize(path71.join(sourceRoot, "app", "styles", "globals.css"));
10571
10580
  const current = path71.normalize(path71.resolve(context.filename));
10572
10581
  const isEntryPoint = current === entryPoint;
10573
- const hasEntryPoint = existsSync10(entryPoint);
10582
+ const hasEntryPoint = existsSync11(entryPoint);
10574
10583
  const isFirstStylesheet = !hasEntryPoint && [current, ...findFiles(sourceRoot, CSS_EXTENSIONS).map((file) => path71.normalize(file))].sort()[0] === current;
10575
10584
  if (!isEntryPoint && !isFirstStylesheet) return {};
10576
10585
  return {
@@ -10675,15 +10684,17 @@ var rootVariablesRule = {
10675
10684
  const names = new Set(
10676
10685
  graph.definitions.filter((symbol) => symbol.kind === "theme-token").map((symbol) => symbol.name)
10677
10686
  );
10678
- function isFixedThemeAlias(name, value, visited = /* @__PURE__ */ new Set()) {
10679
- const match = /^var\(\s*(?<target>--[a-z][\w-]*)\s*\)$/u.exec(value.trim());
10680
- const target = match?.groups?.target;
10681
- if (!target || target === name || visited.has(target)) return false;
10682
- const next = themeValues.get(target);
10683
- if (!next) return false;
10684
- if (!/\bvar\s*\(/u.test(next)) return true;
10685
- visited.add(target);
10686
- return isFixedThemeAlias(name, next, visited);
10687
+ function isFixedThemeExpression(name, value, visited = /* @__PURE__ */ new Set([name])) {
10688
+ const references = [...value.matchAll(/\bvar\s*\(\s*(?<target>--[a-z][\w-]*)/giu)].map(
10689
+ (match) => match.groups?.target
10690
+ );
10691
+ if (references.length === 0) return true;
10692
+ return references.every((target) => {
10693
+ if (!target || visited.has(target)) return false;
10694
+ const next = themeValues.get(target);
10695
+ if (!next) return false;
10696
+ return isFixedThemeExpression(target, next, /* @__PURE__ */ new Set([...visited, target]));
10697
+ });
10687
10698
  }
10688
10699
  const mirroredTokens = /* @__PURE__ */ new Set();
10689
10700
  let hasPlainThemeBlocks = false;
@@ -10798,7 +10809,7 @@ var rootVariablesRule = {
10798
10809
  context.report({ node: theme, message: REDUNDANT_INLINE_MESSAGE(name) });
10799
10810
  }
10800
10811
  }
10801
- if (inline === referencesVariable || !inline && isFixedThemeAlias(name, unquoted)) continue;
10812
+ if (inline === referencesVariable || !inline && isFixedThemeExpression(name, unquoted)) continue;
10802
10813
  const offset = (theme.loc?.start.offset ?? 0) + match.index + match[0].indexOf(name);
10803
10814
  const preceding = context.sourceCode.text.slice(0, offset);
10804
10815
  const line = preceding.split("\n").length;
@@ -10942,7 +10953,7 @@ var stylesheetOrderingRule = {
10942
10953
  };
10943
10954
 
10944
10955
  // eslint/rules/tailwind/theme-reset.ts
10945
- import { existsSync as existsSync11 } from "fs";
10956
+ import { existsSync as existsSync12 } from "fs";
10946
10957
  import path74 from "path";
10947
10958
  import { generate as generate4, parse as parse7, toPlainObject as toPlainObject2 } from "@eslint/css-tree";
10948
10959
  function isThemeReset(node) {
@@ -10987,7 +10998,7 @@ var themeResetRule = {
10987
10998
  const target = resolveSpecifier2(from.file, specifier, sourceRoot);
10988
10999
  if (!target || path74.extname(target) !== ".css") continue;
10989
11000
  const filename = path74.normalize(target);
10990
- if (seen.has(filename) || !existsSync11(filename)) continue;
11001
+ if (seen.has(filename) || !existsSync12(filename)) continue;
10991
11002
  seen.add(filename);
10992
11003
  const source = textOf(filename);
10993
11004
  const parsed = toPlainObject2(parse7(source, { parseAtrulePrelude: false }));
@@ -11210,7 +11221,7 @@ var unusedUtilityRule = {
11210
11221
 
11211
11222
  // eslint/rules/tailwind/utility-mapping.ts
11212
11223
  import { spawnSync } from "child_process";
11213
- import { existsSync as existsSync12 } from "fs";
11224
+ import { existsSync as existsSync13 } from "fs";
11214
11225
  import path78 from "path";
11215
11226
  function applyOperationCount(utility, textOf) {
11216
11227
  let count = 0;
@@ -11693,7 +11704,7 @@ var utilityMappingRule = {
11693
11704
  (utility) => themeCandidate(preludeIdentifiers(utility)[0] ?? "unknown", context.sourceCode.getText(utility))
11694
11705
  ).filter((candidate) => Boolean(candidate && requiresGeneratorProbe(candidate)));
11695
11706
  const physicalDir = path78.dirname(context.physicalFilename);
11696
- const tailwindCwd = path78.isAbsolute(physicalDir) && existsSync12(physicalDir) ? physicalDir : context.cwd;
11707
+ const tailwindCwd = path78.isAbsolute(physicalDir) && existsSync13(physicalDir) ? physicalDir : context.cwd;
11697
11708
  const themeGenerators = themeSupportedGenerators(generatorCandidates, tailwindCwd);
11698
11709
  for (const utility of utilities) {
11699
11710
  const name = preludeIdentifiers(utility)[0] ?? "unknown";
@@ -11803,7 +11814,7 @@ var utilityMappingRule = {
11803
11814
  // eslint/rules/tailwind/utility-name-parity.ts
11804
11815
  import { spawnSync as spawnSync2 } from "child_process";
11805
11816
  import { createHash } from "crypto";
11806
- import { existsSync as existsSync13 } from "fs";
11817
+ import { existsSync as existsSync14 } from "fs";
11807
11818
  import path79 from "path";
11808
11819
  import { generate as generate5, parse as parse8, toPlainObject as toPlainObject3 } from "@eslint/css-tree";
11809
11820
  function numericPart(value) {
@@ -11955,7 +11966,7 @@ var utilityNameParityRule = {
11955
11966
  });
11956
11967
  if (candidates.length === 0) return;
11957
11968
  const physicalDir = path79.dirname(context.physicalFilename);
11958
- const cwd = path79.isAbsolute(physicalDir) && existsSync13(physicalDir) ? physicalDir : context.cwd;
11969
+ const cwd = path79.isAbsolute(physicalDir) && existsSync14(physicalDir) ? physicalDir : context.cwd;
11959
11970
  const compiled = compileApplies(
11960
11971
  candidates.map((candidate) => candidate.apply),
11961
11972
  cwd
@@ -12153,7 +12164,7 @@ var uiStateRule = {
12153
12164
  };
12154
12165
 
12155
12166
  // eslint/rules/unknown-utility.ts
12156
- import { existsSync as existsSync14, readdirSync as readdirSync6, readFileSync as readFileSync15, statSync as statSync6 } from "fs";
12167
+ import { existsSync as existsSync15, readdirSync as readdirSync6, readFileSync as readFileSync15, statSync as statSync6 } from "fs";
12157
12168
  import { createRequire } from "module";
12158
12169
  import path81 from "path";
12159
12170
  var PREFIX_NAMESPACES = {
@@ -12464,7 +12475,7 @@ function resolvePackageStylesheet(fromFile, specifier) {
12464
12475
  while (directory !== path81.dirname(directory)) {
12465
12476
  const packageRoot = path81.join(directory, "node_modules", packageName);
12466
12477
  const manifestPath = path81.join(packageRoot, "package.json");
12467
- if (existsSync14(manifestPath)) {
12478
+ if (existsSync15(manifestPath)) {
12468
12479
  try {
12469
12480
  const manifest = readFileSync15(manifestPath, "utf8");
12470
12481
  const stylesheet = /"style"\s*:\s*"(?<file>[^"]+\.css)"/.exec(manifest)?.groups?.file;
@@ -12472,7 +12483,7 @@ function resolvePackageStylesheet(fromFile, specifier) {
12472
12483
  const target = stylesheet ?? main;
12473
12484
  if (!target) return void 0;
12474
12485
  const resolved = path81.resolve(packageRoot, target);
12475
- return existsSync14(resolved) ? resolved : void 0;
12486
+ return existsSync15(resolved) ? resolved : void 0;
12476
12487
  } catch {
12477
12488
  return void 0;
12478
12489
  }
@@ -12822,7 +12833,7 @@ var valueExtractionRule = {
12822
12833
  };
12823
12834
 
12824
12835
  // eslint/rules/vulyk/tracked-docs.ts
12825
- import { existsSync as existsSync15, readFileSync as readFileSync16 } from "fs";
12836
+ import { existsSync as existsSync16, readFileSync as readFileSync16 } from "fs";
12826
12837
  import path84 from "path";
12827
12838
  var PASIKA_REPO = "Bredansky/pasika";
12828
12839
  var BASE_REQUIRED_TRACKED_DOCS = [
@@ -12858,7 +12869,7 @@ var trackedDocsRule = {
12858
12869
  if (root.type !== "Object") return;
12859
12870
  const projectRoot = path84.dirname(path84.resolve(context.filename));
12860
12871
  const configPath = path84.join(projectRoot, "vulyk.config.ts");
12861
- if (!existsSync15(configPath)) {
12872
+ if (!existsSync16(configPath)) {
12862
12873
  context.report({
12863
12874
  node,
12864
12875
  message: "No vulyk.config.ts found. Run npx vulyk init to create one that tracks the framework's required tracked docs."
@@ -12883,7 +12894,7 @@ var trackedDocsRule = {
12883
12894
  }
12884
12895
  }
12885
12896
  const agentsPath = path84.join(projectRoot, "AGENTS.md");
12886
- if (!existsSync15(agentsPath)) {
12897
+ if (!existsSync16(agentsPath)) {
12887
12898
  context.report({
12888
12899
  node,
12889
12900
  message: "No AGENTS.md found. Run npx vulyk agents to generate the agent file that routes to the tracked docs."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pasika",
3
- "version": "0.10.128",
3
+ "version": "0.10.130",
4
4
  "description": "Reusable agent setup package",
5
5
  "repository": {
6
6
  "type": "git",