@fractary/codex 0.3.0 → 0.3.1
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.cjs +10 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var path3 = require('path');
|
|
4
4
|
var child_process = require('child_process');
|
|
5
|
-
var
|
|
5
|
+
var micromatch3 = require('micromatch');
|
|
6
6
|
var zod = require('zod');
|
|
7
7
|
var yaml = require('js-yaml');
|
|
8
8
|
var fs2 = require('fs/promises');
|
|
@@ -10,7 +10,7 @@ var fs2 = require('fs/promises');
|
|
|
10
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
11
|
|
|
12
12
|
var path3__default = /*#__PURE__*/_interopDefault(path3);
|
|
13
|
-
var
|
|
13
|
+
var micromatch3__default = /*#__PURE__*/_interopDefault(micromatch3);
|
|
14
14
|
var yaml__default = /*#__PURE__*/_interopDefault(yaml);
|
|
15
15
|
var fs2__default = /*#__PURE__*/_interopDefault(fs2);
|
|
16
16
|
|
|
@@ -499,7 +499,7 @@ var TypeRegistry = class {
|
|
|
499
499
|
for (const type of sortedTypes) {
|
|
500
500
|
if (type.name === "default") continue;
|
|
501
501
|
for (const pattern of type.patterns) {
|
|
502
|
-
if (
|
|
502
|
+
if (micromatch3__default.default.isMatch(normalizedPath, pattern)) {
|
|
503
503
|
this.patternCache.set(filePath, type.name);
|
|
504
504
|
return type.name;
|
|
505
505
|
}
|
|
@@ -554,7 +554,7 @@ var TypeRegistry = class {
|
|
|
554
554
|
}
|
|
555
555
|
return files.filter((file) => {
|
|
556
556
|
const normalized = file.replace(/\\/g, "/");
|
|
557
|
-
return type.patterns.some((pattern) =>
|
|
557
|
+
return type.patterns.some((pattern) => micromatch3__default.default.isMatch(normalized, pattern));
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
560
|
/**
|
|
@@ -808,7 +808,7 @@ function extractRawFrontmatter(content) {
|
|
|
808
808
|
}
|
|
809
809
|
function matchPattern(pattern, value) {
|
|
810
810
|
if (pattern === value) return true;
|
|
811
|
-
return
|
|
811
|
+
return micromatch3__default.default.isMatch(value, pattern);
|
|
812
812
|
}
|
|
813
813
|
function matchAnyPattern(patterns, value) {
|
|
814
814
|
if (patterns.length === 1 && patterns[0] === "*") {
|
|
@@ -2439,7 +2439,7 @@ var DEFAULT_SYNC_CONFIG = {
|
|
|
2439
2439
|
};
|
|
2440
2440
|
function evaluatePath(path6, rules, direction, defaultExcludes = []) {
|
|
2441
2441
|
for (const pattern of defaultExcludes) {
|
|
2442
|
-
if (
|
|
2442
|
+
if (micromatch3__default.default.isMatch(path6, pattern)) {
|
|
2443
2443
|
return {
|
|
2444
2444
|
path: path6,
|
|
2445
2445
|
shouldSync: false,
|
|
@@ -2452,7 +2452,7 @@ function evaluatePath(path6, rules, direction, defaultExcludes = []) {
|
|
|
2452
2452
|
if (rule.direction && rule.direction !== direction) {
|
|
2453
2453
|
continue;
|
|
2454
2454
|
}
|
|
2455
|
-
if (
|
|
2455
|
+
if (micromatch3__default.default.isMatch(path6, rule.pattern)) {
|
|
2456
2456
|
return {
|
|
2457
2457
|
path: path6,
|
|
2458
2458
|
shouldSync: rule.include,
|
|
@@ -2527,7 +2527,7 @@ function validateRules(rules) {
|
|
|
2527
2527
|
continue;
|
|
2528
2528
|
}
|
|
2529
2529
|
try {
|
|
2530
|
-
|
|
2530
|
+
micromatch3__default.default.isMatch("test", rule.pattern);
|
|
2531
2531
|
} catch {
|
|
2532
2532
|
errors.push(`Rule ${i}: invalid pattern "${rule.pattern}"`);
|
|
2533
2533
|
}
|
|
@@ -3140,7 +3140,7 @@ function ruleMatchesContext(rule, context) {
|
|
|
3140
3140
|
return true;
|
|
3141
3141
|
}
|
|
3142
3142
|
function ruleMatchesPath(rule, path6) {
|
|
3143
|
-
return
|
|
3143
|
+
return micromatch3__default.default.isMatch(path6, rule.pattern);
|
|
3144
3144
|
}
|
|
3145
3145
|
function ruleMatchesAction(rule, action) {
|
|
3146
3146
|
return rule.actions.includes(action);
|
|
@@ -3201,7 +3201,7 @@ function validateRules2(rules) {
|
|
|
3201
3201
|
continue;
|
|
3202
3202
|
}
|
|
3203
3203
|
try {
|
|
3204
|
-
|
|
3204
|
+
micromatch3__default.default.isMatch("test", rule.pattern);
|
|
3205
3205
|
} catch {
|
|
3206
3206
|
errors.push(`Rule ${i}: invalid pattern "${rule.pattern}"`);
|
|
3207
3207
|
}
|