@codefast/cli 0.4.0-canary.6 → 0.5.0-canary.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.
@@ -5,7 +5,7 @@ import { applyEditsDescending, indentOfLineContaining } from "../../../core/sour
5
5
  /**
6
6
  * Known module specifiers that export `cn` / `tv`.
7
7
  */
8
- const KNOWN_CN_TV_MODULES = new Set([
8
+ const KNOWN_CN_TV_MODULES = /* @__PURE__ */ new Set([
9
9
  "@codefast/tailwind-variants",
10
10
  "clsx",
11
11
  "class-variance-authority",
@@ -112,20 +112,20 @@ const BUCKET_ORDER = {
112
112
  * @since 0.3.16-canary.0
113
113
  */
114
114
  const COMPATIBLE_BUCKET_SETS = [
115
- new Set(["existence", "position"]),
116
- new Set(["existence", "layout"]),
117
- new Set(["position", "layout"]),
118
- new Set(["layout", "sizing"]),
119
- new Set(["shape", "shadow"]),
120
- new Set(["background", "shadow"]),
121
- new Set(["background", "typography"]),
122
- new Set(["layout", "typography"]),
123
- new Set(["sizing", "typography"]),
124
- new Set(["motion", "behavior"]),
125
- new Set(["motion", "starting"]),
126
- new Set(["composite", "motion"]),
127
- new Set(["sizing", "composite"]),
128
- new Set(["sizing", "spacing"])
115
+ /* @__PURE__ */ new Set(["existence", "position"]),
116
+ /* @__PURE__ */ new Set(["existence", "layout"]),
117
+ /* @__PURE__ */ new Set(["position", "layout"]),
118
+ /* @__PURE__ */ new Set(["layout", "sizing"]),
119
+ /* @__PURE__ */ new Set(["shape", "shadow"]),
120
+ /* @__PURE__ */ new Set(["background", "shadow"]),
121
+ /* @__PURE__ */ new Set(["background", "typography"]),
122
+ /* @__PURE__ */ new Set(["layout", "typography"]),
123
+ /* @__PURE__ */ new Set(["sizing", "typography"]),
124
+ /* @__PURE__ */ new Set(["motion", "behavior"]),
125
+ /* @__PURE__ */ new Set(["motion", "starting"]),
126
+ /* @__PURE__ */ new Set(["composite", "motion"]),
127
+ /* @__PURE__ */ new Set(["sizing", "composite"]),
128
+ /* @__PURE__ */ new Set(["sizing", "spacing"])
129
129
  ];
130
130
  /**
131
131
  * Responsive / variant prefix — Tailwind v4 aware.
@@ -141,7 +141,7 @@ const RESPONSIVE_PREFIX = /^(?:@(?:min|max)-\[[^\]]+\]:|@\[[^\]]+\]:|@(?:[a-z0-9
141
141
  *
142
142
  * @since 0.3.16-canary.0
143
143
  */
144
- const STATE_PREFIXES = new Set([
144
+ const STATE_PREFIXES = /* @__PURE__ */ new Set([
145
145
  "hover",
146
146
  "focus",
147
147
  "focus-within",
@@ -0,0 +1,20 @@
1
+ import picomatch from "picomatch";
2
+ //#region src/core/glob.ts
3
+ /**
4
+ * Compile a list of glob patterns into a predicate that returns `true` when its
5
+ * argument matches **any** of them (picomatch semantics). Returns a never-match
6
+ * predicate when no patterns are supplied.
7
+ *
8
+ * Shared by every "match a name/path against a configured pattern list" use
9
+ * (workspace excludes, `tag.skipPackages`, …) so the compile-then-`some` logic
10
+ * lives in one place.
11
+ *
12
+ * @since 0.5.0-canary.0
13
+ */
14
+ function createAnyGlobMatcher(patterns, options) {
15
+ if (!patterns || patterns.length === 0) return () => false;
16
+ const matchers = patterns.map((pattern) => picomatch(pattern, options));
17
+ return (value) => matchers.some((isMatch) => isMatch(value));
18
+ }
19
+ //#endregion
20
+ export { createAnyGlobMatcher };
@@ -1,9 +1,9 @@
1
1
  import { messageFrom } from "../errors.mjs";
2
2
  import { logger } from "../logger.mjs";
3
+ import { createAnyGlobMatcher } from "../glob.mjs";
3
4
  import { globSync } from "node:fs";
4
5
  import path from "node:path";
5
6
  import { fileURLToPath } from "node:url";
6
- import picomatch from "picomatch";
7
7
  import { parse } from "yaml";
8
8
  //#region src/core/workspace/resolver.ts
9
9
  /**
@@ -164,8 +164,8 @@ async function listWorkspacePackageDirectories(rootDirectoryPathAbsolute, fs, su
164
164
  foundRelativePosixPackageRoots.add(rel);
165
165
  }
166
166
  }
167
- const excludeMatchers = exclude.map((pat) => picomatch(pat, { dot: true }));
168
- const filteredRelative = [...foundRelativePosixPackageRoots].filter((rel) => !excludeMatchers.some((isMatch) => isMatch(rel)));
167
+ const isExcluded = createAnyGlobMatcher(exclude, { dot: true });
168
+ const filteredRelative = [...foundRelativePosixPackageRoots].filter((rel) => !isExcluded(rel));
169
169
  filteredRelative.sort((a, b) => a.localeCompare(b));
170
170
  return {
171
171
  packageDirectoryPathsAbsolute: filteredRelative.map((rel) => path.resolve(rootDirectoryPathAbsolute, rel.split("/").join(path.sep))),
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  //#region src/core/workspace/typescript-walk.ts
3
- const defaultSkipDirectoryNames = new Set([
3
+ const defaultSkipDirectoryNames = /* @__PURE__ */ new Set([
4
4
  "node_modules",
5
5
  "dist",
6
6
  ".git",
@@ -10,7 +10,7 @@ const PACKAGE_JSON = "package.json";
10
10
  /**
11
11
  * @since 0.3.16-canary.0
12
12
  */
13
- const VALID_JS_EXTENSIONS = new Set([
13
+ const VALID_JS_EXTENSIONS = /* @__PURE__ */ new Set([
14
14
  ".js",
15
15
  ".mjs",
16
16
  ".cjs"
@@ -18,7 +18,7 @@ const VALID_JS_EXTENSIONS = new Set([
18
18
  /**
19
19
  * @since 0.3.16-canary.0
20
20
  */
21
- const VALID_DTS_EXTENSIONS = new Set([
21
+ const VALID_DTS_EXTENSIONS = /* @__PURE__ */ new Set([
22
22
  ".d.ts",
23
23
  ".d.mts",
24
24
  ".d.cts"
@@ -44,7 +44,7 @@ function findImportSpecifier(fs, distDir, modulePath) {
44
44
  */
45
45
  function buildSupplementedEntry(specifier, existing, modulePath, distDir, fs, options) {
46
46
  const result = {};
47
- const knownKeys = new Set([
47
+ const knownKeys = /* @__PURE__ */ new Set([
48
48
  "source",
49
49
  "types",
50
50
  "import",
@@ -36,7 +36,7 @@ var TagSinceWriter = class {
36
36
  }
37
37
  addDeclarationName(registry, name, declaration) {
38
38
  if (!registry.has(name)) {
39
- registry.set(name, new Set([declaration]));
39
+ registry.set(name, /* @__PURE__ */ new Set([declaration]));
40
40
  return;
41
41
  }
42
42
  const bucket = registry.get(name);
package/dist/tag/sync.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AppError, messageFrom } from "../core/errors.mjs";
2
2
  import { err, ok } from "../core/result.mjs";
3
+ import { createAnyGlobMatcher } from "../core/glob.mjs";
3
4
  import { resolveTagTargetCandidates } from "./target-candidates.mjs";
4
5
  import { runTagOnTarget } from "./target-runner.mjs";
5
6
  import path from "node:path";
@@ -83,17 +84,24 @@ function resolveTargetSelection(fs, candidate, rootDir) {
83
84
  packageName: candidate.packageName
84
85
  };
85
86
  }
87
+ /**
88
+ * Partition tag target candidates into those to tag and those to skip, matching
89
+ * each candidate's package name against `skipPackages` as glob patterns.
90
+ * Candidates without a package name (e.g. an explicit-target path) are never skipped.
91
+ *
92
+ * @since 0.5.0-canary.0
93
+ */
86
94
  function filterSkippedCandidates(targetCandidates, skipPackages) {
87
95
  if (!skipPackages || skipPackages.length === 0) return {
88
96
  includedCandidates: targetCandidates,
89
97
  skippedPackages: []
90
98
  };
91
- const skipPackageSet = new Set(skipPackages);
99
+ const isSkipped = createAnyGlobMatcher(skipPackages);
92
100
  const includedCandidates = [];
93
101
  const skippedPackages = [];
94
102
  for (const candidate of targetCandidates) {
95
103
  const packageName = candidate.packageName;
96
- if (packageName && skipPackageSet.has(packageName)) {
104
+ if (packageName && isSkipped(packageName)) {
97
105
  skippedPackages.push(packageName);
98
106
  continue;
99
107
  }
@@ -138,4 +146,4 @@ async function runOnResolvedTarget(fs, resolvedTarget, write, listener) {
138
146
  }
139
147
  }
140
148
  //#endregion
141
- export { runTagSync };
149
+ export { filterSkippedCandidates, runTagSync };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefast/cli",
3
- "version": "0.4.0-canary.6",
3
+ "version": "0.5.0-canary.0",
4
4
  "description": "Developer CLI for the Codefast monorepo (arrange, mirror, tag)",
5
5
  "keywords": [
6
6
  "cli",
@@ -59,14 +59,14 @@
59
59
  "zod": "^4.4.3"
60
60
  },
61
61
  "devDependencies": {
62
- "@types/node": "^25.9.3",
62
+ "@types/node": "^26.0.1",
63
63
  "@types/picomatch": "^4.0.3",
64
- "@typescript/native-preview": "7.0.0-dev.20260615.1",
64
+ "@typescript/native-preview": "7.0.0-dev.20260624.1",
65
65
  "@vitest/coverage-v8": "^4.1.9",
66
- "tsdown": "^0.22.2",
67
- "vite": "^8.0.16",
66
+ "tsdown": "^0.22.3",
67
+ "vite": "~8.0.16",
68
68
  "vitest": "^4.1.9",
69
- "@codefast/typescript-config": "0.4.0-canary.6"
69
+ "@codefast/typescript-config": "0.5.0-canary.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=24.0.0"