mano-coding 0.1.40 → 0.1.41

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/bin.js CHANGED
@@ -23725,21 +23725,9 @@ function isValidLocalPath(localPath) {
23725
23725
  if (!localPath || localPath.trim().length === 0) {
23726
23726
  return false;
23727
23727
  }
23728
- if (isAbsolute2(localPath)) {
23728
+ if (localPath.includes("\0")) {
23729
23729
  return false;
23730
23730
  }
23731
- if (/^[a-zA-Z]:/.test(localPath)) {
23732
- return false;
23733
- }
23734
- if (localPath.includes("\\")) {
23735
- return false;
23736
- }
23737
- const parts = localPath.split("/");
23738
- for (const part of parts) {
23739
- if (part === "..") {
23740
- return false;
23741
- }
23742
- }
23743
23731
  return true;
23744
23732
  }
23745
23733
  function toProjectRelativePath(absPath, projectRoot) {
@@ -23777,8 +23765,8 @@ var init_local_resolver = __esm({
23777
23765
  versionRange
23778
23766
  );
23779
23767
  }
23780
- const localPath = source.path;
23781
- if (!localPath) {
23768
+ const rawLocalPath = source.path;
23769
+ if (!rawLocalPath) {
23782
23770
  throw new ResolveError(
23783
23771
  `local \u6E90\u9700\u8981 path \u53C2\u6570`,
23784
23772
  "RESOLVE_SOURCE_INVALID",
@@ -23786,22 +23774,47 @@ var init_local_resolver = __esm({
23786
23774
  versionRange
23787
23775
  );
23788
23776
  }
23789
- if (!isValidLocalPath(localPath)) {
23777
+ if (!isValidLocalPath(rawLocalPath)) {
23790
23778
  throw new ResolveError(
23791
- `local \u6E90\u8DEF\u5F84 '${localPath}' \u4E0D\u5408\u6CD5\uFF1A\u7981\u6B62\u7EDD\u5BF9\u8DEF\u5F84\u3001\u76D8\u7B26\u3001\u53CD\u659C\u6760\u548C '..'`,
23779
+ `local \u6E90\u8DEF\u5F84 '${rawLocalPath}' \u4E0D\u5408\u6CD5`,
23792
23780
  "RESOLVE_PATH_INVALID",
23793
23781
  packageId,
23794
23782
  versionRange
23795
23783
  );
23796
23784
  }
23785
+ const localPath = rawLocalPath.replaceAll("\\", "/");
23797
23786
  const baseRoot = this.manifestRootProvider?.() ?? context.projectRoot ?? process.cwd();
23798
- const absPath = isAbsolute2(localPath) ? normalize(localPath) : normalize(resolvePath2(baseRoot, localPath));
23787
+ const isAbs = isAbsolute2(localPath) || /^[a-zA-Z]:/.test(localPath);
23788
+ let absPath;
23789
+ if (isAbs) {
23790
+ absPath = normalize(localPath).replaceAll("\\", "/");
23791
+ } else {
23792
+ const cwdCandidate = normalize(resolvePath2(process.cwd(), localPath)).replaceAll("\\", "/");
23793
+ const baseRootCandidate = normalize(resolvePath2(baseRoot, localPath)).replaceAll("\\", "/");
23794
+ let foundInCwd = false;
23795
+ try {
23796
+ await access3(resolvePath2(cwdCandidate, "manifest.yaml"));
23797
+ foundInCwd = true;
23798
+ } catch {
23799
+ }
23800
+ if (foundInCwd) {
23801
+ absPath = cwdCandidate;
23802
+ } else {
23803
+ let foundInBaseRoot = false;
23804
+ try {
23805
+ await access3(resolvePath2(baseRootCandidate, "manifest.yaml"));
23806
+ foundInBaseRoot = true;
23807
+ } catch {
23808
+ }
23809
+ absPath = foundInBaseRoot ? baseRootCandidate : cwdCandidate;
23810
+ }
23811
+ }
23799
23812
  const manifestPath = resolvePath2(absPath, "manifest.yaml");
23800
23813
  try {
23801
23814
  await access3(manifestPath);
23802
23815
  } catch {
23803
23816
  throw new ResolveError(
23804
- `\u672C\u5730\u8DEF\u5F84 '${localPath}' \u4E0B\u672A\u627E\u5230 manifest.yaml`,
23817
+ `\u672C\u5730\u8DEF\u5F84 '${rawLocalPath}' \u4E0B\u672A\u627E\u5230 manifest.yaml`,
23805
23818
  "RESOLVE_MANIFEST_NOT_FOUND",
23806
23819
  packageId,
23807
23820
  versionRange
@@ -23876,7 +23889,7 @@ var init_local_resolver = __esm({
23876
23889
  }
23877
23890
  }
23878
23891
  const integrity = computeContentDigest(manifestContent);
23879
- const lockPath = toProjectRelativePath(absPath, baseRoot);
23892
+ const lockPath = toProjectRelativePath(absPath, baseRoot).replaceAll("\\", "/");
23880
23893
  const resolvedSource = {
23881
23894
  type: "local",
23882
23895
  path: lockPath
@@ -45923,10 +45936,11 @@ async function buildRequestedSource(req) {
45923
45936
  "RESOLVE_SOURCE_INVALID"
45924
45937
  );
45925
45938
  }
45939
+ const normalizedPath = req.localPath.replaceAll("\\", "/");
45926
45940
  return {
45927
45941
  packageId,
45928
45942
  versionRange,
45929
- source: { type: "local", path: req.localPath }
45943
+ source: { type: "local", path: normalizedPath }
45930
45944
  };
45931
45945
  }
45932
45946
  return {
@@ -53307,7 +53321,7 @@ import { createRequire as createRequire2 } from "node:module";
53307
53321
  import { readFileSync as readFileSync4 } from "node:fs";
53308
53322
  import { fileURLToPath as fileURLToPath5 } from "node:url";
53309
53323
  function resolveVersion() {
53310
- if (true) return "0.1.40";
53324
+ if (true) return "0.1.41";
53311
53325
  const candidates = [
53312
53326
  new URL("../package.json", import.meta.url),
53313
53327
  new URL("../../package.json", import.meta.url),
@@ -43,6 +43,13 @@
43
43
  "maxLength": 512,
44
44
  "pattern": "^(?![A-Za-z]:)(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*//)(?!\\.?$).+$"
45
45
  },
46
+ "localSourcePath": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "maxLength": 1024,
50
+ "pattern": "^(?!.*\\\\).+$",
51
+ "description": "Normalized local source path; forward slashes only"
52
+ },
46
53
  "integrity": {
47
54
  "type": "string",
48
55
  "pattern": "^(sha256|sha512)-[A-Za-z0-9+/]+={0,2}$",
@@ -111,7 +118,7 @@
111
118
  "required": ["type", "path"],
112
119
  "properties": {
113
120
  "type": { "const": "local" },
114
- "path": { "$ref": "#/$defs/projectPath" }
121
+ "path": { "$ref": "#/$defs/localSourcePath" }
115
122
  },
116
123
  "additionalProperties": false
117
124
  },
@@ -178,7 +185,7 @@
178
185
  "required": ["type", "path"],
179
186
  "properties": {
180
187
  "type": { "const": "local" },
181
- "path": { "$ref": "#/$defs/projectPath" }
188
+ "path": { "$ref": "#/$defs/localSourcePath" }
182
189
  },
183
190
  "additionalProperties": false
184
191
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mano-coding",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "Mano Coding CLI and toolchain",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,6 +43,13 @@
43
43
  "maxLength": 512,
44
44
  "pattern": "^(?![A-Za-z]:)(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)(?!.*//)(?!\\.?$).+$"
45
45
  },
46
+ "localSourcePath": {
47
+ "type": "string",
48
+ "minLength": 1,
49
+ "maxLength": 1024,
50
+ "pattern": "^(?!.*\\\\).+$",
51
+ "description": "Normalized local source path; forward slashes only"
52
+ },
46
53
  "integrity": {
47
54
  "type": "string",
48
55
  "pattern": "^(sha256|sha512)-[A-Za-z0-9+/]+={0,2}$",
@@ -111,7 +118,7 @@
111
118
  "required": ["type", "path"],
112
119
  "properties": {
113
120
  "type": { "const": "local" },
114
- "path": { "$ref": "#/$defs/projectPath" }
121
+ "path": { "$ref": "#/$defs/localSourcePath" }
115
122
  },
116
123
  "additionalProperties": false
117
124
  },
@@ -178,7 +185,7 @@
178
185
  "required": ["type", "path"],
179
186
  "properties": {
180
187
  "type": { "const": "local" },
181
- "path": { "$ref": "#/$defs/projectPath" }
188
+ "path": { "$ref": "#/$defs/localSourcePath" }
182
189
  },
183
190
  "additionalProperties": false
184
191
  },